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

fix(ds/sort): Fallback to sorting by name when values are equal #2538

Merged
merged 7 commits into from
Nov 1, 2023

Conversation

traeok
Copy link
Member

@traeok traeok commented Oct 31, 2023

If we would prefer to keep this for a potential 2.12.1 release, then I will add a changelog. Otherwise, I think we can keep this as no-changelog as the feature will be released with 2.12.


Proposed changes

I've cleaned up the sorting function a bit so that it falls back to sorting by name when 2 node values are equal.

In addition, I've adjusted the date checks slightly to also use Day.js (consistent with the rest of the date processing for this feature) for easier date comparison.

Release Notes

Milestone: 2.12.0 (or 2.12.1)

Changelog:

  • Fixed an issue where sorting functionality did not consider the sort direction when values were equal.

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)

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

Copy link
Member

@zFernand0 zFernand0 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 this would work.
testing briefly before approving.

adam-wolfe
adam-wolfe previously approved these changes Oct 31, 2023
Copy link
Contributor

@adam-wolfe adam-wolfe left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Trae!

Copy link

codecov bot commented Oct 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
...kages/zowe-explorer/src/dataset/ZoweDatasetNode.ts 95.97% <100.00%> (+2.39%) ⬆️

... and 2 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@adam-wolfe
Copy link
Contributor

One minor issue I am seeing that may be related to this is that if a member has no user ID, and you sort by User ID in the descending order, the member without a user ID will switch to the top and bottom of the list when you collapse and expand the PDS.

@traeok
Copy link
Member Author

traeok commented Oct 31, 2023

One minor issue I am seeing that may be related to this is that if a member has no user ID, and you sort by User ID in the descending order, the member without a user ID will switch to the top and bottom of the list when you collapse and expand the PDS.

Thanks for catching this @adam-wolfe, I've addressed this in 9235f28

@traeok traeok added the no-changelog Add to PR's that don't require a CHANGELOG update label Oct 31, 2023
rudyflores
rudyflores previously approved these changes Oct 31, 2023
adam-wolfe
adam-wolfe previously approved these changes Oct 31, 2023
Copy link
Contributor

@adam-wolfe adam-wolfe left a comment

Choose a reason for hiding this comment

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

Looks good.

@traeok traeok dismissed stale reviews from adam-wolfe and rudyflores via 2da3995 October 31, 2023 18:32
@traeok
Copy link
Member Author

traeok commented Oct 31, 2023

I found a separate, unrelated issue with how we were building children in ZoweDatasetNode - we were only checking for dsname as part of the "existing node" check, where we should fallback to look for the member variable when dsname isn't present. Otherwise, the check for an existing PDS member node will always yield undefined. See 2da3995 for the change that was made.

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

LGTM! 😋
Thanks for addressing the comments

Copy link

sonarcloud bot commented Nov 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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
2.6% 2.6% Duplication

@JillieBeanSim JillieBeanSim merged commit 0592bd1 into main Nov 1, 2023
24 checks passed
@JillieBeanSim JillieBeanSim deleted the fix/sort/equal-values branch November 1, 2023 12:42
@JillieBeanSim JillieBeanSim added this to the v2.12.0 milestone Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Add to PR's that don't require a CHANGELOG update
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

5 participants