1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Merge pull request #2542 from mabashian/1466-workflow-node

Properly clear out prompt data when user manually changes a node's JT
This commit is contained in:
Michael Abashian 2018-07-16 16:17:52 -04:00 committed by GitHub
commit a955b3f947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();