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

Sort by options for collection items are only for date uploaded/modified (preferred dates: Publication, Creation) #650

Open
2 tasks done
Tracked by #660
jillpe opened this issue Jul 22, 2024 · 6 comments
Assignees

Comments

@jillpe
Copy link

jillpe commented Jul 22, 2024

Summary

reference: https://docs.google.com/spreadsheets/d/1XbfCosfI_P3N2JVYldD28p6Ca6AxNRbAOKbOcp1GRgo/edit?gid=0#gid=0

Example link
Example screenshot

This is relevant to an IR but is not helpful to sorting our results by metadata fields (date of publication etc.) The sort by title option doesn't seem to make any difference in the display of collection items? We need to be able to sort by Solr fields or something similar

Acceptance Criteria

  • The user can sort search results by Publication
  • The user can sort search results by Creation

⚠️ NOTE ⚠️

This change does require a reindex to take effect.

Testing Instructions

  • Click search button or visit this staging URL
  • Click on Sort by relevance dropdown menu
  • Select date published ascending
  • Select date published descending
  • Select date created ascending
  • Select date created descending
@jillpe jillpe added this to utk-hyku Jul 22, 2024
@jillpe jillpe converted this from a draft issue Jul 22, 2024
@jillpe jillpe mentioned this issue Jul 22, 2024
15 tasks
@orangewolf orangewolf added the good first issue Good for newcomers label Jul 23, 2024
@orangewolf
Copy link
Contributor

recommend talking this through with Kirk, Kait or Shana before digging in to it. also be aware that creation and publication have 2 versions and the "machine readable" one is the only one you can sort by

@sjproctor sjproctor moved this to Ready for Development in utk-hyku Jul 29, 2024
@sjproctor sjproctor moved this from Ready for Development to In Development in utk-hyku Jul 29, 2024
sjproctor added a commit that referenced this issue Jul 30, 2024
This commit adds collection search options for sorting by ascending and descending publication dates and ascending and descending creation dates to the dropdown menu.

Ref:
- #650
@jillpe jillpe moved this from In Development to Deploy to Staging in utk-hyku Aug 6, 2024
@jillpe
Copy link
Author

jillpe commented Aug 14, 2024

SoftServ QA Observations

Does not appear to be changing order based on publication or creation date

Screen.Recording.2024-08-14.at.1.09.11.PM.mov

@jillpe jillpe moved this from Deploy to Staging to Ready for Development in utk-hyku Aug 14, 2024
@kirkkwang
Copy link
Contributor

@sjproctor I think i know what's wrong, we need to call #first on the dates because they are actually multiples.
https://github.com/scientist-softserv/utk-hyku/blob/main/app/indexers/collection_indexer.rb#L16-L17

@jillpe jillpe added the reindex label Aug 19, 2024
sjproctor added a commit that referenced this issue Aug 21, 2024
This commit addresses a bug in the dropdown menu search options for
created and published. The options were not behaving as expected due to
the date being a ActiveTriples::Relation rather than a string. The
changes ensure all dates are converted into an array then the first
date is extracted.

Ref:
- #650
sjproctor added a commit that referenced this issue Aug 21, 2024
This commit adds a conditional to account for works such as attachements
that don't have issue or created dates.

Ref:
- #650
@jillpe jillpe moved this from Ready for Development to Code Review in utk-hyku Aug 22, 2024
@sjproctor sjproctor moved this from Code Review to SoftServ QA in utk-hyku Aug 26, 2024
@ShanaLMoore
Copy link
Contributor

ShanaLMoore commented Aug 26, 2024

QA RESULTS: ⚠ Requires Review

tested on STAGING

  • A user can sort by publication date ❌
    • No changes occur between publication date asc and publication date dsc
    • cc @sjproctor @kirkkwang Has staging been reindexed since the last changes to fix this?
  • A user can sort by creation date ✅

Image

@ShanaLMoore
Copy link
Contributor

QA RESULTS: ✅ PASS

Kirk uploaded a new m3 profile to add publication_date to the objects. Now the sort is working as expected.

Image

@ShanaLMoore ShanaLMoore moved this from SoftServ QA to Client QA in utk-hyku Aug 27, 2024
@josh-morgan117
Copy link
Collaborator

@jillpe Looks like this one has been deployed to production and works. Before I move it to the end, I just want to make sure it's not sitting in Client QA for another reason?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

6 participants