From 0d8a2a0d82b16ecb998e9f48772820ab25151337 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 28 Jan 2015 10:59:54 -0500 Subject: [PATCH] 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. --- awx/ui/static/js/controllers/Permissions.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/awx/ui/static/js/controllers/Permissions.js b/awx/ui/static/js/controllers/Permissions.js index bb1cfd652f..658ffc3140 100644 --- a/awx/ui/static/js/controllers/Permissions.js +++ b/awx/ui/static/js/controllers/Permissions.js @@ -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');