diff --git a/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx b/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx index bb24c66393..71d441e572 100644 --- a/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/LaunchPrompt.jsx @@ -45,6 +45,7 @@ function LaunchPrompt({ config, resource, onLaunch, onCancel, i18n }) { setValue('job_tags', values.job_tags); setValue('skip_tags', values.skip_tags); setValue('extra_vars', mergeExtraVars(values.extra_vars, surveyValues)); + setValue('scm_branch', values.scm_branch); onLaunch(postValues); }; diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.jsx index a1dc0ad8ab..61151e5c2e 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.jsx @@ -34,6 +34,16 @@ function OtherPromptsStep({ config, i18n }) { information and examples on patterns.`)} /> )} + {config.ask_scm_branch_on_launch && ( + + )} {config.ask_verbosity_on_launch && } {config.ask_diff_mode_on_launch && } {config.ask_tags_on_launch && ( diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.jsx index 7d3a374c84..b4b9ea3693 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/OtherPromptsStep.test.jsx @@ -48,6 +48,26 @@ describe('OtherPromptsStep', () => { ); }); + test('should render source control branch field', async () => { + let wrapper; + await act(async () => { + wrapper = mountWithContexts( + + + + ); + }); + + expect(wrapper.find('FormField#prompt-scm-branch')).toHaveLength(1); + expect( + wrapper.find('FormField#prompt-scm-branch input').prop('name') + ).toEqual('scm_branch'); + }); + test('should render verbosity field', async () => { let wrapper; await act(async () => { diff --git a/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx index a3a01c92c7..27c25094f4 100644 --- a/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx +++ b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx @@ -278,6 +278,9 @@ function JobTemplateForm({ label={i18n._(t`Source Control Branch`)} promptId="template-ask-scm-branch-on-launch" promptName="ask_scm_branch_on_launch" + tooltip={i18n._( + t`Select a branch for the job template. This branch is applied to all job template nodes that prompt for a branch.` + )} >