diff --git a/src/js/index.js b/src/js/index.js index 67be9f636..d55a308b0 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -144,7 +144,7 @@ app.filter('appIsInstalledAndHealthy', function () { }; }); -app.filter('applicationLink', function() { +app.filter('applicationLink', function () { return function(app) { if (!app) return ''; @@ -156,6 +156,19 @@ app.filter('applicationLink', function() { }; }); +app.filter('userManagementFilter', function () { + return function(apps, option) { + return apps.filter(function (app) { + if (option.id === '') return true; + if (option.id === 'sso') return !!(app.manifest.optionalSso || app.manifest.addons.ldap || app.manifest.addons.proxyAuth); + if (option.id === 'nosso') return app.manifest.optionalSso || (!app.manifest.addons.ldap && !app.manifest.addons.proxyAuth); + if (option.id === 'email') return !!app.manifest.addons.email; + + return false; + }); + }; +}); + // this appears when an item in app grid is clicked app.filter('prettyAppErrorMessage', function () { return function (app) { diff --git a/src/views/appstore.html b/src/views/appstore.html index 0161f1c5f..0f1073963 100644 --- a/src/views/appstore.html +++ b/src/views/appstore.html @@ -295,6 +295,16 @@ + @@ -315,7 +325,7 @@
-
+
{{ 'appstore.unstable' | tr }}
@@ -336,7 +346,7 @@
-
+
{{ 'appstore.unstable' | tr }}
diff --git a/src/views/appstore.js b/src/views/appstore.js index 3c3454e7f..d535d8874 100644 --- a/src/views/appstore.js +++ b/src/views/appstore.js @@ -88,6 +88,22 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$tran return categoryLabel; }; + $scope.userManagementFilterOptions = [ + { id: '', icon: '', label: 'All Apps' }, + { id: 'sso', icon: 'fas fa-user', label: $translate.instant('apps.auth.sso') }, + { id: 'nosso', icon: 'far fa-user', label: $translate.instant('apps.auth.nosso') }, + { id: 'email', icon: 'fas fa-envelope', label: $translate.instant('apps.auth.email') }, + ]; + $scope.userManagementFilterOption = $scope.userManagementFilterOptions[0]; + + $scope.userManagementFilterOptionIsActive = function (option) { + return option.id === $scope.userManagementFilterOption.id; + }; + + $scope.applyUserMangamentFilter = function (option) { + $scope.userManagementFilterOption = option; + }; + $scope.appInstall = { busy: false, state: 'appInfo',