Skip to content

Commit

Permalink
Home page / sort topic categories and INSPIRE themes facets alphabeti…
Browse files Browse the repository at this point in the history
…cally (geonetwork#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 <[email protected]>

* Home page / sort topic categories and INSPIRE themes facets alphabetically - remove not required code

---------

Co-authored-by: François Prunayre <[email protected]>
  • Loading branch information
josegar74 and fxprunayre authored Jan 4, 2024
1 parent 2af1efb commit 3b3180d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,9 @@
]);

module.directive("esFacetCards", [
"gnFacetSorter",
"gnLangs",
function (gnLangs) {
function (gnFacetSorter, gnLangs) {
return {
restrict: "A",
scope: {
Expand Down Expand Up @@ -486,6 +487,7 @@

init();

scope.facetSorter = gnFacetSorter.sortByTranslation;
scope.$watch("key", function (n, o) {
if (n && n !== o) {
init();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div
data-ng-repeat="(k, facet) in aggregations[key].items"
data-ng-repeat="(k, facet) in aggregations[key].items | orderBy: facetSorter(aggregations[key], aggregations[key].key)"
data-ng-init="facetValue = facet.value;"
data-ng-show="facetValue"
data-ng-class="isInspire ? ('bg-iti-' + (facet.key | facetCssClassCode: isInspire)) : ''"
Expand Down
6 changes: 4 additions & 2 deletions web-ui/src/main/resources/catalog/js/CatController.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@
type: "icon",
prefix: "fa fa-2x pull-left gn-icon iti-",
expression: "http://inspire.ec.europa.eu/theme/(.*)"
}
},
orderByTranslation: true
}
},
"cl_topic.key": {
Expand All @@ -154,7 +155,8 @@
decorator: {
type: "icon",
prefix: "fa fa-2x pull-left gn-icon-"
}
},
orderByTranslation: true
}
},
// 'OrgForResource': {
Expand Down

0 comments on commit 3b3180d

Please sign in to comment.