mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
hide pagination based on superness of user
This commit is contained in:
parent
8f9aecf716
commit
ecb3082490
@ -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)
|
||||
|
||||
@ -1975,7 +1975,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
||||
//html += "</div>\n"; // close well
|
||||
html += "</div>\n"; // close list-wrapper div
|
||||
|
||||
html += `<paginate base-path="${collection.basePath}" dataset="${collection.iterator}_dataset" iterator="${collection.iterator}">`;
|
||||
html += `<paginate base-path="${collection.basePath}" dataset="${collection.iterator}_dataset" iterator="${collection.iterator}" ng-hide="hidePagination">`;
|
||||
return html;
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user