dashboard: make filter bar persistent and inline instead of popover

This commit is contained in:
Johannes Zellner
2024-04-10 12:24:45 +02:00
parent f1679f1614
commit 6612f48d0a
3 changed files with 27 additions and 28 deletions

View File

@@ -80,6 +80,19 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
localStorage.appsView = $scope.view;
};
$scope.toggleFilter = function () {
$scope.showFilter = !$scope.showFilter;
localStorage.appsShowFilter = $scope.showFilter;
// clear on hide
if (!$scope.showFilter) {
$scope.selectedState = $scope.states[0];
$scope.selectedTags = [];
$scope.selectedGroup = GROUP_ACCESS_UNSET;
$scope.selectedDomain = ALL_DOMAINS_DOMAIN;
}
};
$scope.$watch('selectedTags', function (newVal, oldVal) {
if (newVal === oldVal) return;
@@ -109,13 +122,6 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
$scope.onAppClick = function (app, $event) { onAppClick(app, $event, $scope.isOperator(app), $scope); };
$scope.clearAllFilter = function () {
$scope.selectedState = $scope.states[0];
$scope.selectedTags = [];
$scope.selectedGroup = GROUP_ACCESS_UNSET;
$scope.selectedDomain = ALL_DOMAINS_DOMAIN;
};
$scope.appPostInstallConfirm = {
app: {},
message: '',
@@ -290,6 +296,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
$scope.orderBy = localStorage.appsOrderBy;
$scope.orderByReverse = !!localStorage.appsOrderByReverse;
$scope.showFilter = !!localStorage.appsShowFilter;
if (!$scope.user.isAtLeastAdmin) return;