From bf6b201bf56d1b3c2f624271596920414e5e0b1a Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Fri, 31 Oct 2014 16:17:11 -0400 Subject: [PATCH 1/2] Extra Variable parsing on job launch the extra_vars didn't need the key 'extra_vars' when posting to the API. i also cleaned up some hint errors from matt --- awx/ui/static/js/forms/Permissions.js | 8 ++++---- awx/ui/static/js/helpers/JobSubmission.js | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/awx/ui/static/js/forms/Permissions.js b/awx/ui/static/js/forms/Permissions.js index 4abf0c455e..567ee0d589 100644 --- a/awx/ui/static/js/forms/Permissions.js +++ b/awx/ui/static/js/forms/Permissions.js @@ -107,10 +107,10 @@ angular.module('PermissionFormDefinition', []) value: 'admin', ngShow: "category == 'Inventory'" }, { - label: 'Create', - value: 'create', - ngShow: "category == 'Deploy'" - }, { + label: 'Create', + value: 'create', + ngShow: "category == 'Deploy'" + }, { label: 'Run', value: 'run', ngShow: "category == 'Deploy'" diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index f4600a7dcf..4422cad7fc 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -22,7 +22,8 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential callback = params.callback || 'JobLaunched', job_launch_data = {}, url = params.url, - fld; + fld, + extra_vars; if(!Empty(scope.passwords_needed_to_start) && scope.passwords_needed_to_start .length>0){ @@ -31,7 +32,10 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential }); } if(scope.prompt_for_vars===true){ - job_launch_data.extra_vars = ToJSON(scope.parseType, scope.variables, true); + extra_vars = ToJSON(scope.parseType, scope.variables, false); + $.each(extra_vars, function(key,value){ + job_launch_data[key] = value; + }); } if(scope.survey_enabled===true){ for (fld in scope.job_launch_form){ From df8a7be75971861ea8840d22efb61bfb2f64c24b Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 3 Nov 2014 10:34:15 -0500 Subject: [PATCH 2/2] Job Templates list Added ngHide for copy icon to hide the icon when can_copy=false --- awx/ui/static/js/controllers/JobTemplates.js | 2 ++ awx/ui/static/js/lists/JobTemplates.js | 1 + 2 files changed, 3 insertions(+) diff --git a/awx/ui/static/js/controllers/JobTemplates.js b/awx/ui/static/js/controllers/JobTemplates.js index 01d0e843cb..c39bd1a130 100644 --- a/awx/ui/static/js/controllers/JobTemplates.js +++ b/awx/ui/static/js/controllers/JobTemplates.js @@ -61,6 +61,8 @@ function JobTemplatesList($scope, $rootScope, $location, $log, $routeParams, Res LoadBreadCrumbs(); + + $scope.showActivity = function () { Stream({ scope: $scope }); }; diff --git a/awx/ui/static/js/lists/JobTemplates.js b/awx/ui/static/js/lists/JobTemplates.js index a17314e4fa..5321770777 100644 --- a/awx/ui/static/js/lists/JobTemplates.js +++ b/awx/ui/static/js/lists/JobTemplates.js @@ -85,6 +85,7 @@ angular.module('JobTemplatesListDefinition', []) "class": 'btn-danger btn-xs', awToolTip: 'Copy template', dataPlacement: 'top', + ngHide: 'job_template.summary_fields.can_copy===false' } }