mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 00:08:44 -03:30
make cancel normal after copy
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
jobTemplateCopyService.set(res)
|
jobTemplateCopyService.set(res)
|
||||||
.success(function(res){
|
.success(function(res){
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$state.go('jobTemplates.edit', {id: res.id, copied: true}, {reload: true});
|
$state.go('jobTemplates.edit', {id: res.id}, {reload: true});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.error(function(res, status){
|
.error(function(res, status){
|
||||||
|
|||||||
@@ -652,21 +652,7 @@ export default
|
|||||||
|
|
||||||
$scope.formCancel = function () {
|
$scope.formCancel = function () {
|
||||||
// the form was just copied in the previous state, it's safe to destroy on cancel
|
// the form was just copied in the previous state, it's safe to destroy on cancel
|
||||||
if ($state.params.copied){
|
$state.go('jobTemplates');
|
||||||
var defaultUrl = GetBasePath('job_templates') + $state.params.id;
|
|
||||||
Rest.setUrl(defaultUrl);
|
|
||||||
Rest.destroy()
|
|
||||||
.success(function(){
|
|
||||||
$state.go('jobTemplates', null, {reload: true, notify:true});
|
|
||||||
})
|
|
||||||
.error(function(res, status){
|
|
||||||
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
|
|
||||||
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$state.go('jobTemplates');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Related set: Add button
|
// Related set: Add button
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ export default {
|
|||||||
activityStreamId: 'id'
|
activityStreamId: 'id'
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
copied: null
|
|
||||||
},
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'jobTemplates',
|
parent: 'jobTemplates',
|
||||||
|
|||||||
Reference in New Issue
Block a user