From 2897ca8e232403c20da9ab6c90d2728f2017b063 Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Fri, 29 Apr 2016 09:32:26 -0400 Subject: [PATCH] Redirect to edit and listing after creation, fixed creation bug --- .../add/job-templates-add.controller.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/awx/ui/client/src/job-templates/add/job-templates-add.controller.js b/awx/ui/client/src/job-templates/add/job-templates-add.controller.js index 462033e768..c68e61c1aa 100644 --- a/awx/ui/client/src/job-templates/add/job-templates-add.controller.js +++ b/awx/ui/client/src/job-templates/add/job-templates-add.controller.js @@ -22,7 +22,6 @@ ) { ClearScope(); - // Inject dynamic view var defaultUrl = GetBasePath('job_templates'), form = JobTemplateForm(), @@ -319,8 +318,8 @@ }); - function saveCompleted() { - $state.go('jobTemplates', null, {reload: true}); + function saveCompleted(id) { + $state.go('jobTemplates.edit', {template_id: id}, {reload: true}); } if ($scope.removeTemplateSaveSuccess) { @@ -407,13 +406,6 @@ .then(function() { $scope.addedItem = data.id; - Refresh({ - scope: $scope, - set: 'job_templates', - iterator: 'job_template', - url: $scope.current_url - }); - if($scope.survey_questions && $scope.survey_questions.length > 0){ //once the job template information @@ -444,7 +436,7 @@ }); } - saveCompleted(); + saveCompleted(data.id); }); }); }); @@ -514,7 +506,8 @@ Rest.post(data) .success(function(data) { $scope.$emit('templateSaveSuccess', - data); + data + ); }) .error(function (data, status) { ProcessErrors($scope, data, status, form,