mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
hide smart search also
This commit is contained in:
parent
ecb3082490
commit
cf52b82fa6
@ -222,10 +222,11 @@ export function UsersEdit($scope, $rootScope, $location,
|
||||
|
||||
function init() {
|
||||
$scope.hidePagination = false;
|
||||
$scope.hideSmartSearch = false;
|
||||
$scope.user_type_options = user_type_options;
|
||||
$scope.user_type = user_type_options[0];
|
||||
$scope.$watch('user_type', user_type_sync($scope));
|
||||
$scope.$watch('is_superuser', hidePermissionsTabPaginationIfSuperUser($scope));
|
||||
$scope.$watch('is_superuser', hidePermissionsTabSmartSearchAndPaginationIfSuperUser($scope));
|
||||
Rest.setUrl(defaultUrl);
|
||||
Wait('start');
|
||||
Rest.get(defaultUrl).success(function(data) {
|
||||
@ -274,12 +275,15 @@ export function UsersEdit($scope, $rootScope, $location,
|
||||
}
|
||||
|
||||
// Organizations and Teams tab pagination is hidden through other mechanism
|
||||
function hidePermissionsTabPaginationIfSuperUser(scope) {
|
||||
return function(newValue) {
|
||||
if (newValue === true) {
|
||||
function hidePermissionsTabSmartSearchAndPaginationIfSuperUser(scope) {
|
||||
return function(isSuperuserNewValue) {
|
||||
let shouldHide = isSuperuserNewValue;
|
||||
if (shouldHide === true) {
|
||||
scope.hidePagination = true;
|
||||
} else if (newValue === false) {
|
||||
scope.hideSmartSearch = true;
|
||||
} else if (shouldHide === false) {
|
||||
scope.hidePagination = false;
|
||||
scope.hideSmartSearch = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -1836,7 +1836,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
||||
// smart-search directive
|
||||
html += `
|
||||
<div
|
||||
ng-hide="${itm}.length === 0 && (searchTags | isEmpty)">
|
||||
ng-hide="(${itm}.length === 0 && (searchTags | isEmpty)) || hideSmartSearch === true">
|
||||
<smart-search
|
||||
django-model="${itm}"
|
||||
search-size="${width}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user