Merge pull request #1914 from mabashian/1901-wfjt-prompt-vars

Fix aggregation of extra vars on wfjt launch preview
This commit is contained in:
Michael Abashian 2018-05-23 10:11:57 -04:00 committed by GitHub
commit c7a0634480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,12 +73,13 @@ function atLaunchTemplateCtrl (
} else if (vm.template.type === 'workflow_job_template') {
const selectedWorkflowJobTemplate = workflowTemplate.create();
const preLaunchPromises = [
selectedWorkflowJobTemplate.request('get', vm.template.id),
selectedWorkflowJobTemplate.getLaunch(vm.template.id),
selectedWorkflowJobTemplate.optionsLaunch(vm.template.id),
];
Promise.all(preLaunchPromises)
.then(([launchData, launchOptions]) => {
.then(([wfjtData, launchData, launchOptions]) => {
if (selectedWorkflowJobTemplate.canLaunchWithoutPrompt()) {
selectedWorkflowJobTemplate
.postLaunch({ id: vm.template.id })
@ -86,6 +87,9 @@ function atLaunchTemplateCtrl (
$state.go('workflowResults', { id: data.workflow_job }, { reload: true });
});
} else {
launchData.data.defaults = {
extra_vars: wfjtData.data.extra_vars
};
const promptData = {
launchConf: launchData.data,
launchOptions: launchOptions.data,