IQSS / dataverse

Open source research data repository software
http://dataverse.org
Other
882 stars 494 forks source link

fix backwards newest oldest sort order #11000

Closed stevenwinship closed 2 weeks ago

stevenwinship commented 2 weeks ago

What this PR does / why we need it: Sort order in UI on dataset file listing is backwards for Newest and Oldest

Which issue(s) this PR closes:https://github.com/IQSS/dataverse/issues/10742

Special notes for your reviewer: fully tested the comparator and determined it was just a UI issue

Suggestions on how to test this: Test using UI On a dataset file listing, click "Sort -> Newest" The resulting order should be newest first.

On a dataset file listing, click "Sort -> Oldest" The resulting order should be oldest first.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?: Included

Additional documentation:

qqmyers commented 2 weeks ago

@stevenwinship - I see the JsonParserTest.parseDataverseDTO test failure - can you update from develop to get the fix for it (I assume that's the problem).

ofahimIQSS commented 2 weeks ago

@stevenwinship I'm trying to push the PR to Internal and received a failure in jenkins: [ERROR] Failures: [ERROR] JsonParserTest.parseDataverseDTO:286 expected: pi@example.edu,student@example.edu but was: pi@example.edu

Could you please update your PR with the latest from Dev. Thanks!

Edit: Just saw the update on the PR - will retest with latest build

coveralls commented 2 weeks ago

Coverage Status

coverage: 21.856%. remained the same when pulling d8b7ed04a98a32b57c022d023c5fbd7d3ef33b48 on 10742-newest-oldest-sort-order-backwards into e208eede135a96e2d0250448ffbb9ad38b3f7325 on develop.

ofahimIQSS commented 2 weeks ago

@stevenwinship Came across an observation while testing the fix in Internal.

Reproduction Steps:

  1. Push PR to Internal https://dataverse-internal.iq.harvard.edu/
  2. Login
  3. Go to https://dataverse-internal.iq.harvard.edu/dataset.xhtml?persistentId=doi:10.70122/FK2/3KPIQP
  4. Add a file and sort by "Newest"
  5. See screenshot - look at the 4th data file in the data set Deposited on Nov 4th

Note: I uploaded 1 csv file on Nov 4th, 2024 and published the dataset. I pushed the fix to internal then I added 9 more files to the same dataset with Deposited date: Nov. 6, 2024.

image

qqmyers commented 2 weeks ago

My guess is that internal has Order By Folder turned on. With that, the sorting (newest/oldest/alphabetical, etc.) is done within each folder.

ofahimIQSS commented 2 weeks ago

Thanks @qqmyers that did the trick. Merging PR Testing of 11000.docx

https://github.com/user-attachments/assets/6fc180cc-42f8-42c4-be04-77ea1fdfc3b0