Skip to content
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

updated with local filtering of jobs #2476

Closed

Conversation

SanthoshiBoyina
Copy link
Contributor

@SanthoshiBoyina SanthoshiBoyina commented Sep 23, 2023

Proposed changes

-> For filtering the jobs at the zOSMF session level a filter icon is added for the easier accessibility to filter jobs based on job name, job id and return code.

-> and also provided with an option 'Filter Jobs' at the right click menu of zOSMF session level to filter jobs based on job name, job id and return code.

And the input box added here will be filtering the content of Jobs dynamically. That means for each and every character user enters it will be displaying results based on that, which is an enhancement over the old method of filtering once the user enters text and hits the enter button.

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 apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Updates to Documentation or Tests (if none of the other choices apply)

Checklist

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 reviewer

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • PR title follows Conventional Commits Guidelines
  • PR Description is included
  • gif or screenshot is included if visual changes are made
  • yarn workspace vscode-extension-for-zowe vscode:prepublish has been executed
  • All checks have passed (DCO, Jenkins and Code Coverage)
  • I have added unit test and it is passing
  • I have added integration test and it is passing
  • There is coverage for the code that I have added
  • I have tested it manually and there are no regressions found
  • I have added necessary documentation (if appropriate)
  • Any PR dependencies have been merged and published (if appropriate)

Further comments

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Files Coverage Δ
packages/zowe-explorer/src/globals.ts 98.61% <100.00%> (ø)
packages/zowe-explorer/src/job/init.ts 98.30% <100.00%> (+0.04%) ⬆️
packages/zowe-explorer/src/job/actions.ts 90.70% <93.33%> (+0.15%) ⬆️

... and 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!.

Copy link
Member

@traeok traeok left a 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 @SanthoshiBoyina! I left some comments regarding error handling and use of the tree provider.

packages/zowe-explorer/src/job/actions.ts Outdated Show resolved Hide resolved
packages/zowe-explorer/src/job/actions.ts Outdated Show resolved Hide resolved
packages/zowe-explorer/src/job/actions.ts Outdated Show resolved Hide resolved
packages/zowe-explorer/src/job/actions.ts Outdated Show resolved Hide resolved
packages/zowe-explorer/src/job/actions.ts Outdated Show resolved Hide resolved
packages/zowe-explorer/src/job/actions.ts Outdated Show resolved Hide resolved
@zFernand0 zFernand0 self-requested a review September 27, 2023 18:27
Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing and clicking the filter icon I get the info message about needing a search in place to filter but do have a search in place.
Screen Shot 2023-09-28 at 9 18 26 AM

@@ -21,5 +21,7 @@
"cancelJobs.notImplemented": "The cancel function is not implemented in this API.",
"cancelJobs.notCancelled": "The job was not cancelled.",
"cancelJobs.failed": "One or more jobs failed to cancel: {0}",
"cancelJobs.succeeded": "Cancelled selected jobs successfully."
"cancelJobs.succeeded": "Cancelled selected jobs successfully.",
"filterJobs.message": "Inorder to filter jobs,first populate them using search icon",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change this message to say the same as if profile was expanded without search in place.
Use the search button to display jobs
Or something along those lines, possibly A jobs search must be in place before local filtering is possible

"cancelJobs.succeeded": "Cancelled selected jobs successfully."
"cancelJobs.succeeded": "Cancelled selected jobs successfully.",
"filterJobs.message": "Inorder to filter jobs,first populate them using search icon",
"filterJobs.prompt.message": "Type here..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we explain what is to be entered here? Maybe something like Enter local filter...

);
return spoolNode;
jobsProvider.refresh();
Copy link
Member

@traeok traeok Oct 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my previous comments 🙂 I have one more comment:

We should refresh the job element here instead of the whole tree; otherwise, it will perform logic on other job nodes that are not a part of this filter operation.

This would also apply to line 571 in the filterJobs function - we can refresh the session (level) element for that case

Copy link
Contributor

@JillieBeanSim JillieBeanSim Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried both jobProvider.refresh and refreshElement(job) and don't see either of these working like I see the filter search at the session level. it worked so well at the session level with jobProvider.refresh() I wonder if the spool file level will need the spoolProvider.refresh() to see the same outcome.

Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the inputBox.show then return of inputBox doesn't allow the input box to disappear after hitting enter, I have to escape the input box for it to leave the screen in both filter searches. One way to solve that is to to an
await vscode.window.showInputBox(inputBox) and if wanting to return what is entered can store and return value or just have a void return.
Is there a way to clear the local filtering and return user to initial filter search?

@@ -549,16 +549,16 @@ export async function filterJobs(jobsProvider: IZoweTree<IZoweJobTreeNode>): Pro
for (const level of jobsProvider.mSessionNodes) {
if (level.label === "zosmf") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to have any particular type calls like checking for zosmf profile type or if this is a check for profile name. We want to be able to handle this for all profile types and names. This may need to be a check on context value for if session node.

);
return spoolNode;
jobsProvider.refresh();
Copy link
Contributor

@JillieBeanSim JillieBeanSim Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried both jobProvider.refresh and refreshElement(job) and don't see either of these working like I see the filter search at the session level. it worked so well at the session level with jobProvider.refresh() I wonder if the spool file level will need the spoolProvider.refresh() to see the same outcome.

Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
@rudyflores
Copy link
Contributor

@JillieBeanSim do we have a milestone for this PR?

Signed-off-by: SanthoshiBoyina <[email protected]>
@JillieBeanSim JillieBeanSim added this to the v2.12.0 milestone Oct 11, 2023
traeok and others added 24 commits October 19, 2023 19:26
- Also adds unit tests for dataset filtering, sorting, and sorting jobs

Signed-off-by: Trae Yelovich <[email protected]>
- Renamed `m4date` to `modifiedDate` in `DatasetStats` API type

Signed-off-by: Trae Yelovich <[email protected]>
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.10 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
Signed-off-by: SanthoshiBoyina <[email protected]>
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
6.8% 6.8% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the recent changes to this branch pulled in some other commits that were already merged into main. To fix this, it might require undoing the last merge attempt, and then running git merge again with the main branch. I'd be happy to help with resolving any merge conflicts that come up during the merge 🙂

@SanthoshiBoyina SanthoshiBoyina deleted the local-filtering-of-jobs branch October 19, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants