Merge pull request #1620 from mabashian/1589-relaunch-passwords

Fixed error showing vault password prompts on relaunch
This commit is contained in:
Michael Abashian
2018-05-02 14:01:06 -04:00
committed by GitHub
7 changed files with 70 additions and 57 deletions

View File

@@ -41,11 +41,12 @@ function atRelaunchCtrl (
) {
const jobPromises = [
jobObj.request('get', vm.job.id),
jobTemplate.optionsLaunch(vm.job.unified_job_template)
jobTemplate.optionsLaunch(vm.job.unified_job_template),
jobObj.getCredentials(vm.job.id)
];
$q.all(jobPromises)
.then(([jobRes, launchOptions]) => {
.then(([jobRes, launchOptions, jobCreds]) => {
const populatedJob = jobRes.data;
const jobTypeChoices = _.get(
launchOptions,
@@ -76,7 +77,11 @@ function atRelaunchCtrl (
relaunchHostType: option ? (option.name).toLowerCase() : null,
prompts: {
credentials: {
value: populatedJob.summary_fields.credentials || []
value: populatedJob.summary_fields.credentials ?
_.merge(
jobCreds.data.results,
populatedJob.summary_fields.credentials
) : []
},
variables: {
value: populatedJob.extra_vars