mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
Quick fix to survey's to create new surveys
'mode' was added to generate form, and when adding/editing new questions the 'mode' of the question form was getting mixed with the 'mode' of hte job template form.
This commit is contained in:
parent
e41359c8cc
commit
bc9c4d355e
@ -419,7 +419,7 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
|
|||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
index = params.index,
|
index = params.index,
|
||||||
element,
|
element,
|
||||||
//fld,
|
tmpVar,
|
||||||
i,
|
i,
|
||||||
question = params.question, //scope.survey_questions[index],
|
question = params.question, //scope.survey_questions[index],
|
||||||
form = SurveyQuestionForm;
|
form = SurveyQuestionForm;
|
||||||
@ -490,7 +490,9 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
|
|||||||
scope.removeGenerateForm();
|
scope.removeGenerateForm();
|
||||||
}
|
}
|
||||||
scope.removeGenerateForm = scope.$on('GenerateForm', function() {
|
scope.removeGenerateForm = scope.$on('GenerateForm', function() {
|
||||||
|
tmpVar = scope.mode;
|
||||||
GenerateForm.inject(form, { id: 'question_'+index, mode: 'edit' , related: false, scope:scope, breadCrumbs: false});
|
GenerateForm.inject(form, { id: 'question_'+index, mode: 'edit' , related: false, scope:scope, breadCrumbs: false});
|
||||||
|
scope.mode = tmpVar;
|
||||||
scope.$emit('FillQuestionForm');
|
scope.$emit('FillQuestionForm');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -565,7 +567,9 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
|
|||||||
};
|
};
|
||||||
|
|
||||||
scope.addQuestion = function(){
|
scope.addQuestion = function(){
|
||||||
|
var tmpMode = scope.mode;
|
||||||
GenerateForm.inject(form, { id:'new_question', mode: 'add' , scope: scope, related: false, breadCrumbs: false});
|
GenerateForm.inject(form, { id:'new_question', mode: 'add' , scope: scope, related: false, breadCrumbs: false});
|
||||||
|
scope.mode = tmpMode;
|
||||||
scope.required = true; //set the required checkbox to true via the ngmodel attached to scope.required.
|
scope.required = true; //set the required checkbox to true via the ngmodel attached to scope.required.
|
||||||
scope.text_min = null;
|
scope.text_min = null;
|
||||||
scope.text_max = null;
|
scope.text_max = null;
|
||||||
@ -1014,7 +1018,7 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
|
|||||||
scope.$emit('SurveySaved');
|
scope.$emit('SurveySaved');
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors(scope, data, status, { hdr: 'Error!',
|
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||||
msg: 'Failed to add new survey. POST returned status: ' + status });
|
msg: 'Failed to add new survey. POST returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user