Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide search text field when number of facet values is less than the maximum #3061

Merged
merged 4 commits into from
May 22, 2024

Conversation

VictorHugoDuranS
Copy link
Contributor

@VictorHugoDuranS VictorHugoDuranS commented May 17, 2024

Hi @tdonohue, I'm @jtimal partner. We have been working on this issue and we will send you the PR.

References

Description

Validation for hide search text field in the filter section if the number of facet values does not exceed the maximum number of facet values shown

Instructions for Reviewers

The change is applied in the filters: Subject, Item Type and Authors

For replicate, you realize a general search and select a filter with few results or search directament a term with few filter

For example, this is the view general
image

this is the same view with a filter wit few results:
image

List of changes in this PR:

  • First, the main change is applied in: search-facet-filter.component.ts
  • Second, i created a validation for control for show or not, considering the maximum number of facet and the current number of facet and assign in a observable for use it in the view

Checklist

  • 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 yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn 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.
  • 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.

…acet values does not exceed the maximum number of facet values shown
…acet values does not exceed the maximum number of facet values shown
…acet values does not exceed the maximum number of facet values shown
@tdonohue tdonohue added bug 1 APPROVAL pull request only requires a single approval to merge component: Discovery related to discovery search or browse system port to main This PR needs to be ported to `main` branch for the next major release labels May 17, 2024
@alanorth alanorth changed the title Dspace 7 2352 Hide search text field when number of facet values is less than the maximum May 22, 2024
@alanorth
Copy link
Contributor

Thanks @VictorHugoDuranS! This change seems simple and logical to me. I tested it on DSpace 7.6.1 and it works as expected. I think the new behavior is better for usability.

Before, the search box is shown even when there is only one value:

Screenshot 2024-05-22 at 09-14-35 CGSpace Search-fs8

After, the box is hidden:

Screenshot 2024-05-22 at 09-11-11 CGSpace Search-fs8

@alanorth alanorth merged commit 975e9fd into DSpace:dspace-7_x May 22, 2024
13 checks passed
@dspace-bot
Copy link
Contributor

Backport failed for main, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin main
git worktree add -d .worktree/backport-3061-to-main origin/main
cd .worktree/backport-3061-to-main
git switch --create backport-3061-to-main
git cherry-pick -x ea567d8b5a1471f4ecb97051e9d4028676adae6d f9809dc1f00a824d26f0a4b335dac9f0551bffb8 bc03856a41d5286e874772f978b3be76ec817a60

@alanorth alanorth added this to the 7.6.2 milestone May 22, 2024
@alanorth
Copy link
Contributor

@VictorHugoDuranS the automatic port to the main branch failed. Would you be able to submit a PR for that? Thanks!

@tdonohue
Copy link
Member

I've ported this to main in #3097.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge bug component: Discovery related to discovery search or browse system
Projects
Development

Successfully merging this pull request may close these issues.

4 participants