mirror of
https://github.com/ansible/awx.git
synced 2026-03-25 12:55:04 -02:30
Adds proper error handling to worklfow save related promises. Fixes bug watching for prompt changes after the node has been edited once.
This commit is contained in:
@@ -221,6 +221,7 @@ export default ['$scope', 'TemplatesService', 'JobTemplateModel', 'PromptService
|
|||||||
$scope.promptModalMissingReqFields = false;
|
$scope.promptModalMissingReqFields = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
watchForPromptChanges();
|
||||||
$scope.nodeFormDataLoaded = true;
|
$scope.nodeFormDataLoaded = true;
|
||||||
} else if (
|
} else if (
|
||||||
_.get($scope, 'nodeConfig.node.fullUnifiedJobTemplateObject.unified_job_type') === 'job_template' ||
|
_.get($scope, 'nodeConfig.node.fullUnifiedJobTemplateObject.unified_job_type') === 'job_template' ||
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default ['$scope', 'TemplatesService',
|
export default ['$scope', 'TemplatesService',
|
||||||
'ProcessErrors', 'CreateSelect2', '$q', 'JobTemplateModel',
|
'ProcessErrors', '$q',
|
||||||
'Empty', 'PromptService', 'Rest', 'TemplatesStrings', 'WorkflowChartService',
|
'PromptService', 'TemplatesStrings', 'WorkflowChartService',
|
||||||
'Wait', '$state',
|
'Wait', '$state',
|
||||||
function ($scope, TemplatesService,
|
function ($scope, TemplatesService,
|
||||||
ProcessErrors, CreateSelect2, $q, JobTemplate,
|
ProcessErrors, $q,
|
||||||
Empty, PromptService, Rest, TemplatesStrings, WorkflowChartService,
|
PromptService, TemplatesStrings, WorkflowChartService,
|
||||||
Wait, $state
|
Wait, $state
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -159,6 +159,11 @@ export default ['$scope', 'TemplatesService',
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}).catch(({ data, status }) => {
|
||||||
|
Wait('stop');
|
||||||
|
ProcessErrors($scope, data, status, null, {
|
||||||
|
hdr: $scope.strings.get('error.HEADER')
|
||||||
|
});
|
||||||
}));
|
}));
|
||||||
} else if (nodeRef[workflowMakerNodeId].isEdited) {
|
} else if (nodeRef[workflowMakerNodeId].isEdited) {
|
||||||
editPromises.push(TemplatesService.editWorkflowNode({
|
editPromises.push(TemplatesService.editWorkflowNode({
|
||||||
@@ -360,14 +365,26 @@ export default ['$scope', 'TemplatesService',
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$scope.closeDialog();
|
$scope.closeDialog();
|
||||||
|
}).catch(({ data, status }) => {
|
||||||
|
Wait('stop');
|
||||||
|
ProcessErrors($scope, data, status, null, {
|
||||||
|
hdr: $scope.strings.get('error.HEADER')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}).catch(({
|
}).catch(({
|
||||||
data,
|
data,
|
||||||
status
|
status
|
||||||
}) => {
|
}) => {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
ProcessErrors($scope, data, status, null, {});
|
ProcessErrors($scope, data, status, null, {
|
||||||
|
hdr: $scope.strings.get('error.HEADER')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
}).catch(({ data, status }) => {
|
||||||
|
Wait('stop');
|
||||||
|
ProcessErrors($scope, data, status, null, {
|
||||||
|
hdr: $scope.strings.get('error.HEADER')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -381,6 +398,11 @@ export default ['$scope', 'TemplatesService',
|
|||||||
Wait('stop');
|
Wait('stop');
|
||||||
$scope.closeDialog();
|
$scope.closeDialog();
|
||||||
$state.transitionTo('templates');
|
$state.transitionTo('templates');
|
||||||
|
}).catch(({ data, status }) => {
|
||||||
|
Wait('stop');
|
||||||
|
ProcessErrors($scope, data, status, null, {
|
||||||
|
hdr: $scope.strings.get('error.HEADER')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user