diff --git a/frontend/app/scripts/controllers/SearchCtrl.js b/frontend/app/scripts/controllers/SearchCtrl.js index f9ac71640d..0ba6db0c72 100644 --- a/frontend/app/scripts/controllers/SearchCtrl.js +++ b/frontend/app/scripts/controllers/SearchCtrl.js @@ -102,9 +102,9 @@ }; $scope.filterFields = function(entity) { - return _.filter($scope.metadata[entity].attributes, function(value, key) { + return _.pluck(_.filter($scope.metadata[entity].attributes, function(value, key) { return !key.startsWith('computed.'); - }); + }), 'name').sort(); }; $scope.search = function() { diff --git a/frontend/app/scripts/services/common/ui/FilteringSrv.js b/frontend/app/scripts/services/common/ui/FilteringSrv.js index 95486168b6..d4cb37e0fe 100644 --- a/frontend/app/scripts/services/common/ui/FilteringSrv.js +++ b/frontend/app/scripts/services/common/ui/FilteringSrv.js @@ -11,6 +11,7 @@ this.config = config; this.defaults = config.defaults || {}; this.defaultFilter = config.defaultFilter || {}; + this.attributeKeys = []; this.initContext = function(state) { self.state = state; @@ -22,6 +23,8 @@ _.each(self.config.excludes || [], function(exclude) { delete self.attributes[exclude]; }); + + self.attributeKeys = _.keys(self.attributes).sort(); }) .then(function() { var storedContext = localStorageService.get(self.sectionName); diff --git a/frontend/app/views/partials/admin/organisation/list/filters.html b/frontend/app/views/partials/admin/organisation/list/filters.html index b7e40c6786..431c826ca5 100644 --- a/frontend/app/views/partials/admin/organisation/list/filters.html +++ b/frontend/app/views/partials/admin/organisation/list/filters.html @@ -11,7 +11,7 @@

Filters

diff --git a/frontend/app/views/partials/alert/list/filters.html b/frontend/app/views/partials/alert/list/filters.html index d2c32b6cc1..12c948d197 100644 --- a/frontend/app/views/partials/alert/list/filters.html +++ b/frontend/app/views/partials/alert/list/filters.html @@ -12,7 +12,7 @@

Filters

diff --git a/frontend/app/views/partials/case/list/filters.html b/frontend/app/views/partials/case/list/filters.html index b7e40c6786..431c826ca5 100644 --- a/frontend/app/views/partials/case/list/filters.html +++ b/frontend/app/views/partials/case/list/filters.html @@ -11,7 +11,7 @@

Filters

diff --git a/frontend/app/views/partials/observables/list/filters.html b/frontend/app/views/partials/observables/list/filters.html index 1cb79dbb14..ffc4faaaa5 100644 --- a/frontend/app/views/partials/observables/list/filters.html +++ b/frontend/app/views/partials/observables/list/filters.html @@ -11,7 +11,7 @@

Filters

diff --git a/frontend/app/views/partials/search/list.html b/frontend/app/views/partials/search/list.html index df29b01e9c..8782940eae 100644 --- a/frontend/app/views/partials/search/list.html +++ b/frontend/app/views/partials/search/list.html @@ -51,7 +51,7 @@

Search filters {{config[config.enti