From a41fd5bdf89e31c16cf98a9158eede2b71010d21 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 10 Jan 2017 16:18:30 -0500 Subject: [PATCH 1/3] display workflow template instead of wfjt related to #3404 --- .../templates/list/templates-list.controller.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/templates/list/templates-list.controller.js b/awx/ui/client/src/templates/list/templates-list.controller.js index 5bcd659a38..2734232ae2 100644 --- a/awx/ui/client/src/templates/list/templates-list.controller.js +++ b/awx/ui/client/src/templates/list/templates-list.controller.js @@ -45,12 +45,14 @@ export default ['$scope', '$rootScope', '$location', '$stateParams', 'Rest', $scope.$on(`${list.iterator}_options`, function(event, data){ $scope.options = data.data.actions.GET; optionsRequestDataProcessing(); + renameTypeLabelFromWorkflowJobTemplateToWorkflowTemplate(); }); $scope.$watchCollection('templates', function() { - optionsRequestDataProcessing(); - } - ); + optionsRequestDataProcessing(); + renameTypeLabelFromWorkflowJobTemplateToWorkflowTemplate(); + }); + // iterate over the list and add fields like type label, after the // OPTIONS request returns, or the list is sorted/paginated/searched function optionsRequestDataProcessing(){ @@ -70,6 +72,13 @@ export default ['$scope', '$rootScope', '$location', '$stateParams', 'Rest', }); } + function renameTypeLabelFromWorkflowJobTemplateToWorkflowTemplate() { + $scope[list.name].forEach(function(item) { + if (item.type_label === "Workflow Job Template") { + item.type_label = "Workflow Template"; + } + }); + } $scope.$on(`ws-jobs`, function () { // @issue - this is no longer quite as ham-fisted but I'd like for someone else to take a peek From b903ad069e5d152a2eae25d3a99aac43e1601a8b Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 10 Jan 2017 18:23:26 -0500 Subject: [PATCH 2/3] Revert "display workflow template instead of wfjt" This reverts commit 459b03e2e90b2aeaaf071a7438323890f238bf3f. --- .../templates/list/templates-list.controller.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/awx/ui/client/src/templates/list/templates-list.controller.js b/awx/ui/client/src/templates/list/templates-list.controller.js index 2734232ae2..5bcd659a38 100644 --- a/awx/ui/client/src/templates/list/templates-list.controller.js +++ b/awx/ui/client/src/templates/list/templates-list.controller.js @@ -45,14 +45,12 @@ export default ['$scope', '$rootScope', '$location', '$stateParams', 'Rest', $scope.$on(`${list.iterator}_options`, function(event, data){ $scope.options = data.data.actions.GET; optionsRequestDataProcessing(); - renameTypeLabelFromWorkflowJobTemplateToWorkflowTemplate(); }); $scope.$watchCollection('templates', function() { - optionsRequestDataProcessing(); - renameTypeLabelFromWorkflowJobTemplateToWorkflowTemplate(); - }); - + optionsRequestDataProcessing(); + } + ); // iterate over the list and add fields like type label, after the // OPTIONS request returns, or the list is sorted/paginated/searched function optionsRequestDataProcessing(){ @@ -72,13 +70,6 @@ export default ['$scope', '$rootScope', '$location', '$stateParams', 'Rest', }); } - function renameTypeLabelFromWorkflowJobTemplateToWorkflowTemplate() { - $scope[list.name].forEach(function(item) { - if (item.type_label === "Workflow Job Template") { - item.type_label = "Workflow Template"; - } - }); - } $scope.$on(`ws-jobs`, function () { // @issue - this is no longer quite as ham-fisted but I'd like for someone else to take a peek From e5a2671d21eb43e86e47bd23fe1f73c230405eca Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 10 Jan 2017 18:23:52 -0500 Subject: [PATCH 3/3] rename wfjt to Workflow Template in OPTIONS --- awx/api/serializers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 05dca74cb6..66ca32764a 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -251,6 +251,7 @@ class BaseSerializer(serializers.ModelSerializer): 'inventory_update': _('Inventory Sync'), 'system_job': _('Management Job'), 'workflow_job': _('Workflow Job'), + 'workflow_job_template': _('Workflow Template'), } choices = [] for t in self.get_types():