-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Update home page "browse by" to display facet as label if there is only one #8426
Update home page "browse by" to display facet as label if there is only one #8426
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way that the facet panel works is a bit strange, the last item is displayed in a separate row, while all the others in the same row with a button.
I tried these tests with the home facets:
I too find it odd that the last facet is shown that way. I had assumed that the label would display similarly to the last facet when there was only a single facet as it was technically the last facet. But I see now that before my changes a single facet is also displayed as "radio buttons". I just updated the branch to display the label when there is only a single facet as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works as expected. Thanks.
@josegar74 Should be fixed now. I realised I only tested the single facet case on 4.2 which did not have the Tested with 1, 2, and 3 facets on main and 4.2 and it seems good now. |
The backport to
stderr
stdout
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.2.x 4.2.x
# Navigate to the new working tree
cd .worktrees/backport-4.2.x
# Create a new branch
git switch --create backport-8426-to-4.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick cab853f107da7955435ddd8e956ffcc0f1014ccb,7e6fb1d259c58b1765d23a8913bdbf686fb06343,38304cada8122811f1a7e0f8bc9ac087acd421d2
# Push it to GitHub
git push --set-upstream origin backport-8426-to-4.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.2.x Then, create a pull request where the |
…ly one (geonetwork#8426) * Update home page to display facet as label if there is only one * Show label with a single facet * Fix bug with single facet
When there are only two facets displayed on the home page the first facet appears as a button. This can be confusing to the users as it appears like there is some action to be taken on this button but clicking it results in no action.
Before changes:
Two facets:
Three facets:
This PR aims to fix this issue by displaying the facet in place of the "Browse by" label when there is only a single facet to be displayed. The logic checks for two facets however as the last facet is displayed separately.
After changes:
Two facets:
Three facets:
Checklist
main
branch, backports managed with labelREADME.md
filespom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentation