Fix/5524 collection selector hide communities#5882
Open
shernandez-dev wants to merge 4 commits into
Open
Conversation
|
@shernandez-dev Thanks for your contribution, and identifying the secondary issue on this component! @tinsch Since you reported the original issue about the collection selector, would you by chance be interested in testing this to confirm if this addresses the usability concerns appropriately? |
Contributor
|
@lgeggleston yes I am happy to test this 👍 |
Contributor
|
@shernandez-dev thanks for the fix! I tested it and the UX is much better now. The tree structure between communities and collections is visible and it is clear only collections are selectable. The toggle between "Whole repository" und collections also works well 👍 |
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.
References
Description
Replaces the flat
<select>list in the Metadata Query Report Collection Selector with a grouped tree-style selector that shows communities as non-selectable headers and collections as clickable options, eliminating the confusion caused by unselectable community entries mixed with collections.Instructions for Reviewers
Root Cause
The
loadCollections()method inFilteredItemsComponentbuilt a flatOptionVO[]array by mixing communities (markeddisabled=true) and collections together in a single<select multiple>element. Communities appeared as entries that users could not select, and when many communities appeared at the top of the list, it was unclear whether anything could be selected at all.Changes
filtered-items.component.ts:CollectionGroupinterface to group collections under their parent communitycollectionGroups: CollectionGroup[]propertyloadCollections()to no longer push communities as disabled<option>entries — instead, each community becomes a group header with its collections as selectable itemstoggleCollection(collectionId: string)method to handle multi-selection via clickisCollectionSelected(collectionId: string)method to track selected statecollections: OptionVO[]is still maintained for form compatibility withtoQueryString()toggleCollection()to enforce mutual exclusion between "Whole Repository" and specific collections — selecting one automatically deselects the other (Administrator Reports - Metadata Query: "Whole Repository" and specific collections can be selected simultaneously in Collection Selector #5883)filtered-items.component.html:<select multiple>with a custom list using Bootstraplist-group-itembuttonstext-muted smallnon-interactive headersfw-boldclickable buttons withbg-primaryhighlight on selectiondso-selector), as suggested in the issue discussion. A full reuse of thedso-selectorcomponent was considered but not pursued, as that component is designed for single selection and would require significant refactoring to support multi-selection. Instead, the same visual hierarchy (community as breadcrumb context, collection as bold selectable item) was replicated using standard Bootstraplist-group-itembuttons, keeping the change isolated to this component.filtered-items.component.spec.ts:loadCollections(),toggleCollection(), andisCollectionSelected()Before
Communities and collections mixed in a flat
<select>list. Communities appeared as unselectable entries, making it unclear what could be selected:After
Communities shown as non-interactive group headers (grey, small text). Collections shown as bold clickable buttons with highlight on selection:
How to Test
Reproduced and confirmed on DSpace 9.x and DSpace 10.0 (as reported in the original issue).
Checklist
mainbranchnpm run lintfails with a pre-existing error unrelated to this fix (src/themes/custom/eager-theme-components.ts). ESLint was run directly on the 3 modified files and passes without errors.npx madge --circularon the affected directory)