Skip to content

[Port dspace-8_x] Store the state of the computed filters#4179

Merged
tdonohue merged 3 commits intoDSpace:dspace-8_xfrom
arvoConsultores:DS-4097-dspace8
Apr 11, 2025
Merged

[Port dspace-8_x] Store the state of the computed filters#4179
tdonohue merged 3 commits intoDSpace:dspace-8_xfrom
arvoConsultores:DS-4097-dspace8

Conversation

@sergius02
Copy link
Copy Markdown
Contributor

References

Port of #4121 for DSpace dspace-8_x branch

Description

Store the state of the computed filters in the array finalFiltersComputed.

Instructions for Reviewers

The counter filtersWithComputedVisibility doesn't store the count of filters computed when you change between options in the select box in /mydspace, causing the ngIf in the HTML is always false, and no filters options render on the web.

List of changes in this PR:

  • First, countFiltersWithComputedVisibility now store the count every time a new filter is "computed" till it reach the maximum filters configured.
  • Second, added some utility functions to find the current and final counter, and a function to update the count.
  • Third, update the ngIf, to use the new functions.
  • Fourth, removed the trackBy: trackUpdate in the ngFor because when you enter in /mydspace from the link in the dropdown it seems that it interferes.

How to test:

  1. Enter in /mydspace from URL or from the link in the dropdown when you are logged in.
  2. Change between options in the select box from the sidebar
  3. The filters should be loaded without problem

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

Copy link
Copy Markdown
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Thanks @sergius02 ! I've verified this is the same as #4121

@tdonohue tdonohue merged commit 9fe2ad9 into DSpace:dspace-8_x Apr 11, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from 👍 Reviewer Approved to ✅ Done in DSpace Maintenance (9.x, 8.x, 7.6.x) Apr 11, 2025
@sergius02 sergius02 deleted the DS-4097-dspace8 branch May 26, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants