From a7b4c03188c31810543ff4ba560b8b8b63e12b11 Mon Sep 17 00:00:00 2001 From: Vidya Nambiar Date: Tue, 7 Mar 2023 14:57:07 -0500 Subject: [PATCH] Show scm_branch if project allows branch override --- .../shared/InventorySourceSubForms/SCMSubForm.js | 13 +++++++++++-- .../shared/InventorySourceSubForms/SharedFields.js | 13 ------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/awx/ui/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.js b/awx/ui/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.js index 873275c61e..1217ca3ba0 100644 --- a/awx/ui/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.js +++ b/awx/ui/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.js @@ -20,9 +20,9 @@ import { EnabledVarField, EnabledValueField, HostFilterField, - BranchFormField, } from './SharedFields'; import getHelpText from '../Inventory.helptext'; +import FormField from 'components/FormField'; const SCMSubForm = ({ autoPopulateProject }) => { const helpText = getHelpText(); @@ -57,6 +57,7 @@ const SCMSubForm = ({ autoPopulateProject }) => { (value) => { setFieldValue('source_project', value); setFieldTouched('source_project', true, false); + setFieldValue('scm_branch', '', false); if (sourcePathField.value) { setFieldValue('source_path', ''); setFieldTouched('source_path', false); @@ -76,7 +77,15 @@ const SCMSubForm = ({ autoPopulateProject }) => { ); return ( <> - + {projectField.value?.allow_override && ( + + )} { /> ); }; - -export const BranchFormField = ({ label }) => { - const helpText = getHelpText(); - return ( - - ); -};