diff --git a/web-ui/src/main/resources/catalog/js/admin/CategoriesController.js b/web-ui/src/main/resources/catalog/js/admin/CategoriesController.js index ee0f4407b08..75971ff4c6e 100644 --- a/web-ui/src/main/resources/catalog/js/admin/CategoriesController.js +++ b/web-ui/src/main/resources/catalog/js/admin/CategoriesController.js @@ -37,7 +37,16 @@ "$rootScope", "$translate", "$timeout", - function ($scope, $routeParams, $http, $rootScope, $translate, $timeout) { + "gnUtilityService", + function ( + $scope, + $routeParams, + $http, + $rootScope, + $translate, + $timeout, + gnUtilityService + ) { $scope.categories = null; $scope.categorySelected = { id: $routeParams.categoryId }; @@ -138,7 +147,11 @@ function loadCategories() { $http.get("../api/tags").then(function (response) { - $scope.categories = response.data; + $scope.categories = gnUtilityService.sortByTranslation( + response.data, + $scope.lang, + "name" + ); }); } loadCategories(); diff --git a/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js b/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js index 37a1bdedd6a..93f028a8d5f 100644 --- a/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js +++ b/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js @@ -53,6 +53,7 @@ "gnConfig", "gnConfigService", "gnAuditableService", + "gnUtilityService", function ( $scope, $routeParams, @@ -63,7 +64,8 @@ $log, gnConfig, gnConfigService, - gnAuditableService + gnAuditableService, + gnUtilityService ) { $scope.searchObj = { params: { @@ -156,7 +158,13 @@ $http.get("../api/tags").then(function (response) { var nullTag = { id: null, name: "", label: {} }; nullTag.label[$scope.lang] = ""; - $scope.categories = [nullTag].concat(response.data); + var categoriesSorted = gnUtilityService.sortByTranslation( + response.data, + $scope.lang, + "name" + ); + + $scope.categories = [nullTag].concat(categoriesSorted); }); function loadGroups() {