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

Sorting PDS members in the descending order causes unwanted behavior #2536

Closed
adam-wolfe opened this issue Oct 30, 2023 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@adam-wolfe
Copy link
Contributor

Describe the bug

When PDS members are sorted by date modified or user ID in the descending order, when the PDS is collapsed and re-expanded, the order of items with identical search values (i.e., same date last modified or same user ID) reverses (see screen recording)

To Reproduce

  1. Sort PDS members by user ID or date modified in descending order
  2. Collapse the PDS
  3. Expand the PDS
  4. Notice that the order of items with the same user id or date modified has reversed

Expected behavior

The order should not change when the PDS is collapsed and re-expanded.

Screenshots
Sorry for the huge gif.
SortDescendingIssue

Desktop (please complete the following information):

  • OS: Windows 10
  • Zowe Explorer Version:
  • (Optional) Zowe CLI Version:
  • (Optional) Are you using Secure Credential Store?

Additional context

This does not happen when the order is set to ascending.

@adam-wolfe adam-wolfe added the bug Something isn't working label Oct 30, 2023
@github-actions
Copy link

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@adam-wolfe adam-wolfe mentioned this issue Oct 30, 2023
16 tasks
@zFernand0
Copy link
Member

Is this due to the fact that we do not sort down to the millisecond in which something was created?
If we want, we could introduce a second sort criteria (e.g. name -when sorting by date, date-when sorting by name/user)

@traeok
Copy link
Member

traeok commented Oct 31, 2023

Is this due to the fact that we do not sort down to the millisecond in which something was created? If we want, we could introduce a second sort criteria (e.g. name -when sorting by date, date-when sorting by name/user)

@zFernand0 Technically we do sort by the smallest unit, as the date comparison was dateA < dateB. I've decided to adjust this slightly by using Day.js to compare the dates down to the very second, as it is the smallest unit of time that z/OSMF provides from their API responses.

But I agree, I think a user would expect it to fall back to sorting by name when the values are equal. Since it didn't take long to clean up the sort function, and the updated function is easier to read, I decided to address that in #2538

@traeok
Copy link
Member

traeok commented Nov 1, 2023

Fixed in #2538

@traeok traeok closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Closed
Development

No branches or pull requests

3 participants