From ecb308249007c67fe2f18261a2be52e64e7a0b01 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Mon, 23 Jan 2017 11:22:06 -0500 Subject: [PATCH] hide pagination based on superness of user --- awx/ui/client/src/controllers/Users.js | 13 +++++++++++++ awx/ui/client/src/shared/form-generator.js | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index cef314f407..1b3ce5672c 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -221,9 +221,11 @@ export function UsersEdit($scope, $rootScope, $location, init(); function init() { + $scope.hidePagination = 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)); Rest.setUrl(defaultUrl); Wait('start'); Rest.get(defaultUrl).success(function(data) { @@ -271,6 +273,17 @@ 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) { + scope.hidePagination = true; + } else if (newValue === false) { + scope.hidePagination = false; + } + }; + } + function setScopeFields(data) { _(data) diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 0918fa514f..ba71dce611 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -1975,7 +1975,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat //html += "\n"; // close well html += "\n"; // close list-wrapper div - html += ``; + html += ``; return html; } };