Skip to content

feat(facets): unique collection filter choice - #2198

Merged
zzacharo merged 1 commit into
CERNDocumentServer:mainfrom
liptakpanna:unique-collection-filter
Oct 29, 2026
Merged

zzacharo merged 1 commit into
CERNDocumentServer:mainfrom
liptakpanna:unique-collection-filter

Conversation

@liptakpanna

@liptakpanna liptakpanna commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

From the UI if one collection filter is selected hide the rest of them to minimize confusion. Currently, it looks like it would apply AND filter based on the numbers, but it's OR between the collections.

All records in 3 collections, one of them is in 2:

Screenshot 2026-10-28 at 15 36 08

One collection filter selected, hides the other one:

Screenshot 2026-10-28 at 15 36 37

If the URL has multiple collection filters, display them as active, hide the rest:

Screenshot 2026-10-28 at 15 37 18

For comparison BEFORE the change:

Screenshot 2026-10-28 at 15 38 36

<h2 class="text-capitalize f8 mt-5"><b>{{ key }}</b></h2>
<ul class="list-unstyled" ng-init="values=getValues(key)" ng-repeat="item in value.buckets">
<li class="cds-facets-item">
<li class="cds-facets-item" ng-show="key !== 'collections' || !getValues(key).length || getValues(key).indexOf(item.key) > -1">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would that hide facet item when the collections key is present on the buckets? The condition is a bit complex can you maybe add a comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the pr to use ng-hide - that logic is hopefully more readable and added a comment to explain

@liptakpanna
liptakpanna force-pushed the unique-collection-filter branch from 806609a to 1c3d96f Compare October 29, 2026 09:07
@liptakpanna
liptakpanna force-pushed the unique-collection-filter branch from 1c3d96f to d1a6732 Compare October 29, 2026 09:20
@zzacharo
zzacharo merged commit c222595 into CERNDocumentServer:main Oct 29, 2026
1 check passed
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.

2 participants