Skip to content

Commit

Permalink
Record view / Series statistics / Display filters in same order as ag…
Browse files Browse the repository at this point in the history
…gregation config
  • Loading branch information
fxprunayre authored Nov 28, 2023
1 parent 7523fe3 commit 56a63ee
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@

module.directive("gnRecordsFilters", [
"$rootScope",
function ($rootScope) {
"gnGlobalSettings",
function ($rootScope, gnGlobalSettings) {
return {
restrict: "A",
templateUrl: function (elem, attrs) {
Expand All @@ -588,6 +589,8 @@
scope.showTypes = !angular.isDefined(scope.type);
scope.type = scope.type || "blocks";
scope.criteria = { p: {} };
scope.relatedFacetConfig =
gnGlobalSettings.gnCfg.mods.recordview.relatedFacetConfig;

function removeEmptyFilters(filters, agg) {
var cleanFilterPos = [];
Expand All @@ -612,7 +615,7 @@
}

// Remove the filters without values
scope.filtersToProcess = scope.filters || Object.keys(scope.agg);
scope.filtersToProcess = scope.filters || Object.keys(scope.relatedFacetConfig);
scope.agg && removeEmptyFilters(scope.filtersToProcess, scope.agg);

reset();
Expand Down

0 comments on commit 56a63ee

Please sign in to comment.