-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort-Jobs Implemented #2462
Sort-Jobs Implemented #2462
Conversation
Signed-off-by: Likhitha Nimma <[email protected]>
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
packages/zowe-explorer/package.json
Outdated
@@ -121,6 +121,21 @@ | |||
} | |||
], | |||
"commands": [ | |||
{ | |||
"command": "zowe.jobs.sortbyreturncode", | |||
"title": "Sort by returncode", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add these new command titles to the package.nls.json file and reference them here like the other commands for localization, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified the command titles in package.json and updated the respective in package.nls.json file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the couple cosmetic text items I mentioned this is working great! thanks @likhithanimma1
Signed-off-by: Likhitha Nimma <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this enhancement - tested and functionality LGTM @likhithanimma1!
To minimize code duplication, could we consolidate sortById, sortByName, sortByReturnCode
(in jobs/actions.ts
) into one action, and then call it with a different parameter based on what command was executed? The logic is similar across these actions, so this would make maintenance easier. For example:
export async function sortJobsBy(jobs: IZoweJobTreeNode, jobsProvider: IZoweTree<IZoweJobTreeNode>, key: keyof zowe.IJob): Promise<void> {
jobs["children"].sort((x, y) => {
if (key !== "jobid" && x["job"][key] == y["job"][key]) {
// if values for this key are identical, sort by job ID
} else {
return x["job"][key] > y["job"][key] ? 1 : -1;
}
});
jobsProvider.refresh();
}
Signed-off-by: Likhitha Nimma <[email protected]>
Signed-off-by: Likhitha Nimma <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Thanks for letting me know @traeok . Updated the actions.ts file to contain the whole in 1 function . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and in Theia, functioning as expected - thanks for making those adjustments @likhithanimma1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! thanks @likhithanimma1 for this enhancement.
Proposed changes
Implemented the feature of sorting jobs in the jobs tree at the zosmf level based on the required criteria sortby id, name, returncode.
Release Notes
Milestone:
Changelog:
Types of changes
What types of changes does your code introduce to Zowe Explorer?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the revieweryarn workspace vscode-extension-for-zowe vscode:prepublish
has been executedFurther comments