1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Disable cancel button after initial click

This commit is contained in:
Marliana Lara 2017-08-02 14:44:14 -04:00
parent e3f0246f4c
commit 207ea901ab
2 changed files with 7 additions and 4 deletions

View File

@ -77,6 +77,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
if (project.status === 'failed' && project.summary_fields.last_update && project.summary_fields.last_update.status === 'canceled') {
project.statusTip = i18n._('Canceled. Click for details');
project.scm_type_class = "btn-disabled";
}
if (project.status === 'running' || project.status === 'updating') {
@ -247,8 +248,9 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
});
});
$scope.cancelUpdate = function(id, name) {
Rest.setUrl(GetBasePath("projects") + id);
$scope.cancelUpdate = function(project) {
project.pending_cancellation = true;
Rest.setUrl(GetBasePath("projects") + project.id);
Rest.get()
.success(function(data) {
if (data.related.current_update) {

View File

@ -120,10 +120,11 @@ export default ['i18n', function(i18n) {
dataPlacement: 'top'
},
cancel: {
ngClick: "cancelUpdate(project.id, project.name)",
ngClick: "cancelUpdate(project)",
awToolTip: i18n._('Cancel the SCM update'),
ngShow: "(project.status == 'updating' || project.status == 'running' || project.status == 'pending') && project.summary_fields.user_capabilities.start",
dataPlacement: 'top'
dataPlacement: 'top',
ngDisabled: "project.pending_cancellation || project.status == 'canceled'"
}
}
};}];