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