diff --git a/awx/ui/client/lib/components/launchTemplateButton/launchTemplateButton.component.js b/awx/ui/client/lib/components/launchTemplateButton/launchTemplateButton.component.js index 40dcf2907c..bd82a2fa10 100644 --- a/awx/ui/client/lib/components/launchTemplateButton/launchTemplateButton.component.js +++ b/awx/ui/client/lib/components/launchTemplateButton/launchTemplateButton.component.js @@ -53,7 +53,7 @@ function atLaunchTemplateCtrl ( launchConf: launchData.data, launchOptions: launchOptions.data }), - triggerModalOpen: true, + triggerModalOpen: true }; if (launchData.data.survey_enabled) { diff --git a/awx/ui/client/src/templates/prompt/prompt.controller.js b/awx/ui/client/src/templates/prompt/prompt.controller.js index 5b6f035dd5..7c1c69fbb1 100644 --- a/awx/ui/client/src/templates/prompt/prompt.controller.js +++ b/awx/ui/client/src/templates/prompt/prompt.controller.js @@ -82,17 +82,25 @@ export default [ 'Rest', 'GetBasePath', 'ProcessErrors', 'CredentialTypeModel', vm.promptDataClone.prompts.credentials.passwords.ssh_key_unlock = {}; } if(passwordNeeded.startsWith("vault_password")) { - let vault_id; - if(passwordNeeded.includes('.')) { + let vault_id = null; + if (passwordNeeded.includes('.')) { vault_id = passwordNeeded.split(/\.(.+)/)[1]; } - if(!vm.promptDataClone.prompts.credentials.passwords.vault) { + if (!vm.promptDataClone.prompts.credentials.passwords.vault) { vm.promptDataClone.prompts.credentials.passwords.vault = []; } - vm.promptDataClone.prompts.credentials.passwords.vault.push({ - vault_id: vault_id + // Loop across the default credentials to find the name of the + // credential that requires a password + vm.promptDataClone.prompts.credentials.value.forEach((defaultCredential) => { + if (defaultCredential.vault_id === vault_id) { + vm.promptDataClone.prompts.credentials.passwords.vault.push({ + id: defaultCredential.id, + name: defaultCredential.name, + vault_id: defaultCredential.vault_id + }); + } }); } });