From cf52b82fa6a7d786cf3145f8037cba10fea6907c Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 24 Jan 2017 15:33:18 -0500 Subject: [PATCH] hide smart search also --- awx/ui/client/src/controllers/Users.js | 14 +++++++++----- awx/ui/client/src/shared/form-generator.js | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index 1b3ce5672c..a305a3e133 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -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; } }; } diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index ba71dce611..883a8bd088 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -1836,7 +1836,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat // smart-search directive html += `
+ ng-hide="(${itm}.length === 0 && (searchTags | isEmpty)) || hideSmartSearch === true">