-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Home page / sort topic categories and INSPIRE themes facets alphabetically #7569
Home page / sort topic categories and INSPIRE themes facets alphabetically #7569
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.
Tested and works. Thanks!
When removing in the configuration of the facets Not sure if it's useful to keep the old behaviour with some configuration, what do you think @fxprunayre? |
@fxprunayre I've improved the pull request to use the sorter per facet using the configuration provided: 1da4ec2 |
|
||
this.sortByQuantity = function (agg, bucket) { | ||
return function (facet) { | ||
return facet.count; | ||
}; | ||
}; | ||
|
||
this.sortByQuantityDesc = function (agg, bucket) { | ||
return function (facet) { | ||
return -1 * facet.count; | ||
}; | ||
}; |
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.
We don't need that as we can sort server side by facet configuration using "order" : { "_count" : "desc" }
or "order" : { "_count" : "asc" }
. So we can remove this and use the same sort method for all facet directive
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.
@fxprunayre updated the pull request with your comments, thanks.
web-ui/src/main/resources/catalog/components/elasticsearch/directives/FacetDirective.js
Outdated
Show resolved
Hide resolved
…ectives/FacetDirective.js Co-authored-by: François Prunayre <fx.prunayre@gmail.com>
…cally - remove not required code
…abetically (#7569) * Home page / sort topic categories and INSPIRE themes facets alphabetically * Home page / use facets configuration to sort alphabetically or by quantity * Update web-ui/src/main/resources/catalog/components/elasticsearch/directives/FacetDirective.js Co-authored-by: François Prunayre <fx.prunayre@gmail.com> * Home page / sort topic categories and INSPIRE themes facets alphabetically - remove not required code --------- Co-authored-by: François Prunayre <fx.prunayre@gmail.com>
Currently the topic categories and INSPIRE themes filters in the home page seem sorted by the amount of metadata in each category. This change adds support to sort the values alphabetically.
Before:
After:
Checklist
main
branch, backports managed with labelREADME.md
filespom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentation