mirror of
https://github.com/ansible/awx.git
synced 2026-02-27 15:58:45 -03:30
make cancel normal after copy
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
jobTemplateCopyService.set(res)
|
||||
.success(function(res){
|
||||
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){
|
||||
|
||||
@@ -652,21 +652,7 @@ export default
|
||||
|
||||
$scope.formCancel = function () {
|
||||
// the form was just copied in the previous state, it's safe to destroy on cancel
|
||||
if ($state.params.copied){
|
||||
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');
|
||||
}
|
||||
$state.go('jobTemplates');
|
||||
};
|
||||
|
||||
// Related set: Add button
|
||||
|
||||
@@ -15,7 +15,6 @@ export default {
|
||||
activityStreamId: 'id'
|
||||
},
|
||||
params: {
|
||||
copied: null
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
parent: 'jobTemplates',
|
||||
|
||||
Reference in New Issue
Block a user