Skip to content

fix(#894): display facet name alongside facet value in selected filter chips - #1067

Open
Janvi-kapoor wants to merge 3 commits into
IQSS:developfrom
Janvi-kapoor:894-clicked-facet-label
Open

fix(#894): display facet name alongside facet value in selected filter chips#1067
Janvi-kapoor wants to merge 3 commits into
IQSS:developfrom
Janvi-kapoor:894-clicked-facet-label

Conversation

@Janvi-kapoor

Copy link
Copy Markdown

What this PR does / why we need it:

When selecting a facet filter in the collection items view, the filter chip above the results only displayed the facet value (e.g. 2024 ×) instead of the facet name and value combined (e.g. Publication Year: 2024 ×).

This PR:

  • Passes the existing facets list from CollectionItemsPanel to SelectedFacets.
  • Updates SelectedFacets to look up the facet's friendlyName by matching filterQueryKey, rendering <Facet Name>: <Facet Value>.
  • Keeps a clean fallback to filterQueryKey if no matching facet object is found.
  • Updates component specs to verify facet name rendering, click removal, and fallback handling.

Which issue(s) this PR closes:

Special notes for your reviewer:

  • Backend check: No backend or js-dataverse change is needed. The CollectionItemsFacet model already provides name and friendlyName in the frontend.
  • Since local installation of the @IQSS/dataverse-client-javascript package requires GitHub registry authentication, I verified the logic and test cases via isolated execution. I look forward to CI checks on this PR.

Suggestions on how to test this:

  1. Navigate to a collection page with facets (e.g., Publication Year, Subject, etc.).
  2. Select any facet value (for example, under Publication Year, select 2024).
  3. Observe the applied filter chip above the search results: it should display Publication Year: 2024 × instead of just 2024 ×.
  4. Click the × button on the chip and verify the filter is removed as expected.
  5. Run component tests:
    cypress run --component --spec "tests/component/sections/collection/collection-items-panel/SelectedFacets.spec.tsx"

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Yes. Applied facet filter buttons above results now render <Facet Name>: <Facet Value> × instead of only <Facet Value> ×.

Is there a release notes or changelog update needed for this change?:

Yes, updated CHANGELOG.md under [Unreleased] -> ### Fixed.

Additional documentation:

None.

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Sep 10, 2026
@ChengShi-1 ChengShi-1 moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Sep 10, 2026
@Janvi-kapoor

Copy link
Copy Markdown
Author

Hi @ChengShi-1 👋

Just an update on PR #1067: I've resolved the linting error directly on GitHub.

The core tests (Components, E2E, and Accessibility/Interaction) have already successfully passed. Could you please trigger or re-run the checks, or let me know if you have any other feedback on this?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Review ⏩

Development

Successfully merging this pull request may close these issues.

Clicked facet doesn't show facet name above search results

3 participants