mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 18:21:12 +03:00
Redirect to edit and listing after creation, fixed creation bug
This commit is contained in:
parent
293db554c5
commit
2897ca8e23
@ -22,7 +22,6 @@
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
// Inject dynamic view
|
// Inject dynamic view
|
||||||
var defaultUrl = GetBasePath('job_templates'),
|
var defaultUrl = GetBasePath('job_templates'),
|
||||||
form = JobTemplateForm(),
|
form = JobTemplateForm(),
|
||||||
@ -319,8 +318,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function saveCompleted() {
|
function saveCompleted(id) {
|
||||||
$state.go('jobTemplates', null, {reload: true});
|
$state.go('jobTemplates.edit', {template_id: id}, {reload: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($scope.removeTemplateSaveSuccess) {
|
if ($scope.removeTemplateSaveSuccess) {
|
||||||
@ -407,13 +406,6 @@
|
|||||||
.then(function() {
|
.then(function() {
|
||||||
$scope.addedItem = data.id;
|
$scope.addedItem = data.id;
|
||||||
|
|
||||||
Refresh({
|
|
||||||
scope: $scope,
|
|
||||||
set: 'job_templates',
|
|
||||||
iterator: 'job_template',
|
|
||||||
url: $scope.current_url
|
|
||||||
});
|
|
||||||
|
|
||||||
if($scope.survey_questions &&
|
if($scope.survey_questions &&
|
||||||
$scope.survey_questions.length > 0){
|
$scope.survey_questions.length > 0){
|
||||||
//once the job template information
|
//once the job template information
|
||||||
@ -444,7 +436,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
saveCompleted();
|
saveCompleted(data.id);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -514,7 +506,8 @@
|
|||||||
Rest.post(data)
|
Rest.post(data)
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
$scope.$emit('templateSaveSuccess',
|
$scope.$emit('templateSaveSuccess',
|
||||||
data);
|
data
|
||||||
|
);
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, form,
|
ProcessErrors($scope, data, status, form,
|
||||||
|
Loading…
Reference in New Issue
Block a user