mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 22:18:01 -03:30
Launch job from job template form
added a check that there is a valid survey if survey_enabled === true on the JT form
This commit is contained in:
parent
e14630b155
commit
c96b317202
@ -993,10 +993,33 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
|
||||
// Launch a job using the selected template
|
||||
$scope.launch = function() {
|
||||
PlaybookRun({
|
||||
scope: $scope,
|
||||
id: id
|
||||
|
||||
if ($scope.removePromptForSurvey) {
|
||||
$scope.removePromptForSurvey();
|
||||
}
|
||||
$scope.removePromptForSurvey = $scope.$on('PromptForSurvey', function() {
|
||||
var action = function () {
|
||||
// $scope.$emit("GatherFormFields");
|
||||
Wait('start');
|
||||
$('#prompt-modal').modal('hide');
|
||||
$scope.addSurvey();
|
||||
|
||||
};
|
||||
Prompt({
|
||||
hdr: 'Incomplete Survey',
|
||||
body: 'Do you want to create a survey before proceeding?',
|
||||
action: action
|
||||
});
|
||||
});
|
||||
|
||||
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
||||
$scope.$emit("PromptForSurvey");
|
||||
}
|
||||
else
|
||||
PlaybookRun({
|
||||
scope: $scope,
|
||||
id: id
|
||||
});
|
||||
};
|
||||
|
||||
// handler for 'Enable Survey' button
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user