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

EDSC-3560: Adding collection sort key parameter into URL #1868

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

william-valencia
Copy link
Collaborator

@william-valencia william-valencia commented Feb 24, 2025

Overview

What is the feature?

When the user clicks on a non default collection sort key (or if preferences are set, not preferred sort key) , they key shows up as a parameter in the URL

What is the Solution?

Updated code to add collection sort key parameter to the URL and have EDSC use collection sort key parameter in the URL if present

What areas of the application does this impact?

Collection Sorting on EDSC and the URL's shown on the browser. Also the user preferred sort key will be used if set.

Testing

Reproduction steps

Open a browser and navigate to EDSC. While logged out, select a different Collection Sort Key ie Relevance, Start Date, or End Date. Ensure that a corresponding query parameter gets added to the URL:
ie:
csk=-score (Relevance)
csk=start_date (Start Date)
csk=-ongoing (Ongoing)

Also ensure refreshing the page with the specified query parameter keeps the sort order as it should be.

Then login. Check your user preferences and make note of your Collection Sort preference. Go the the EDSC homepage and make sure the collections are sorted based on your preference.

Then select a new preference and repeat. Make sure the selected preference is how the collections get sorted initially on the home page and that your selected preference is highlighted as the active sorting option. Make sure your preference does not show up as a query parameter.

Selecting a new preference from the drop down, however will add the proper query parameter to the URL and the collections get sorted with the new parameter.

Refreshing the page with a proper csk parameter set will also yield the expected results. (proper collection sorting and correctly highlighted text)

Attachments

Screenshot 2025-03-04 at 6 40 46 PM

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.42%. Comparing base (dad00f6) to head (0b87d47).

Files with missing lines Patch % Lines
...ic/src/js/components/SearchPanels/SearchPanels.jsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1868   +/-   ##
=======================================
  Coverage   93.41%   93.42%           
=======================================
  Files         781      781           
  Lines       19239    19256   +17     
  Branches     5004     4997    -7     
=======================================
+ Hits        17973    17990   +17     
  Misses       1181     1181           
  Partials       85       85           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eudoroolivares2016
Copy link
Contributor

Tested feature locally including with a test with an empty user preferences

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.

3 participants