From a41fd5bdf89e31c16cf98a9158eede2b71010d21 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 10 Jan 2017 16:18:30 -0500 Subject: [PATCH] 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