1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-30 22:21:13 +03:00

Permissions page -> JT 'Create'

The permissions page, when saved with 'Create' JT permissions wouldn't re-fill the form correctly when the user renavigates to the edit form page for that permission.
This commit is contained in:
Jared Tabor 2015-01-28 10:59:54 -05:00
parent ffe0d4a5d0
commit 0d8a2a0d82

View File

@ -142,7 +142,8 @@ function PermissionsAdd($scope, $rootScope, $compile, $location, $log, $routePar
form: form,
current_item: null,
list: ProjectList,
field: 'project'
field: 'project',
input_type: 'radio'
});
// Save
@ -246,7 +247,7 @@ function PermissionsEdit($scope, $rootScope, $compile, $location, $log, $routePa
}
$scope.category = 'Deploy';
if (data.permission_type !== 'run' && data.permission_type !== 'check') {
if (data.permission_type !== 'run' && data.permission_type !== 'check' && data.permission_type !== 'create') {
$scope.category = 'Inventory';
}
master.category = $scope.category;
@ -305,6 +306,9 @@ function PermissionsEdit($scope, $rootScope, $compile, $location, $log, $routePa
data[fld] = $scope[fld];
}
Rest.setUrl(defaultUrl);
if($scope.category === "Inventory"){
delete data.project;
}
Rest.put(data)
.success(function () {
Wait('stop');