mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 10:57:35 -02: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:
@@ -993,10 +993,33 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
|
|
||||||
// Launch a job using the selected template
|
// Launch a job using the selected template
|
||||||
$scope.launch = function() {
|
$scope.launch = function() {
|
||||||
PlaybookRun({
|
|
||||||
scope: $scope,
|
if ($scope.removePromptForSurvey) {
|
||||||
id: id
|
$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
|
// handler for 'Enable Survey' button
|
||||||
|
|||||||
Reference in New Issue
Block a user