WEBDEV-8185 Refactor to extract default sort management#564
Open
latonv wants to merge 6 commits into
Open
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #564 +/- ##
==========================================
- Coverage 92.43% 91.78% -0.66%
==========================================
Files 113 113
Lines 18946 18919 -27
Branches 1379 1357 -22
==========================================
- Hits 17513 17365 -148
- Misses 1403 1524 +121
Partials 30 30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, collection-browser manages default sort properties internally, based on factors like the type/context of the search performed and any
sort-bymetadata present in the search response. While this allows the parent page to be hands-off about the default sort, it leads to increasing complexity in the logic that collection-browser must handle itself to determine the appropriate behavior, and requires it to know more than is reasonable about how/where it is being used.This PR inverts the responsibilities so that the parent page may independently set collection-browser's default sort depending on its own context and needs (e.g., what kind of page, what tab is selected), and removes much of collection-browser's own handling of that logic. Instead, collection-browser emits the appropriate events w/ more details for the parent page to react to with any sorting changes necessary (e.g., when new collection metadata is received).