diff --git a/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js b/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js index 6aa0e71b98..0d0c1a817e 100644 --- a/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js +++ b/awx/ui/client/src/templates/workflows/workflow-maker/workflow-maker.controller.js @@ -216,7 +216,8 @@ export default ['$scope', 'WorkflowService', 'GetBasePath', 'TemplatesService', }); let credentialsToAdd = credentialsNotInPriorCredentials.filter(function(credNotInPrior) { - return !params.node.promptData.prompts.credentials.previousOverrides.some(function(priorCred) { + let previousOverrides = params.node.promptData.prompts.credentials.previousOverrides ? params.node.promptData.prompts.credentials.previousOverrides : []; + return !previousOverrides.some(function(priorCred) { return credNotInPrior.id === priorCred.id; }); }); @@ -433,10 +434,10 @@ export default ['$scope', 'WorkflowService', 'GetBasePath', 'TemplatesService', .then(function() { $scope.closeDialog(); }).catch(({data, status}) => { - ProcessErrors($scope, data, status, null); + ProcessErrors($scope, data, status, null, {}); }); }).catch(({data, status}) => { - ProcessErrors($scope, data, status, null); + ProcessErrors($scope, data, status, null, {}); }); }; @@ -1026,6 +1027,10 @@ export default ['$scope', 'WorkflowService', 'GetBasePath', 'TemplatesService', $scope.templateManuallySelected = function(selectedTemplate) { + if (promptWatcher) { + promptWatcher(); + } + if (surveyQuestionWatcher) { surveyQuestionWatcher(); } @@ -1034,6 +1039,8 @@ export default ['$scope', 'WorkflowService', 'GetBasePath', 'TemplatesService', credentialsWatcher(); } + $scope.promptData = null; + if (selectedTemplate.type === "job_template") { let jobTemplate = new JobTemplate();