diff --git a/awx/ui/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.js b/awx/ui/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.js
index 87e9ece5cd..513a6fc473 100644
--- a/awx/ui/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.js
+++ b/awx/ui/src/screens/Inventory/InventorySourceDetail/InventorySourceDetail.js
@@ -48,6 +48,7 @@ function InventorySourceDetail({ inventorySource }) {
source,
source_path,
source_vars,
+ scm_branch,
update_cache_timeout,
update_on_launch,
verbosity,
@@ -233,6 +234,11 @@ function InventorySourceDetail({ inventorySource }) {
helpText={helpText.subFormVerbosityFields}
value={VERBOSITY()[verbosity]}
/>
+
({
},
enabledVariableField: t`Retrieve the enabled state from the given dict of host variables.
The enabled variable may be specified using dot notation, e.g: 'foo.bar'`,
+ sourceControlBranch: t`Branch to use on inventory sync. Project default used if blank. Only allowed if project allow_override field is set to true.`,
enabledValue: t`This field is ignored unless an Enabled Variable is set. If the enabled variable matches this value, the host will be enabled on import.`,
hostFilter: t`Regular expression where only matching host names will be imported. The filter is applied as a post-processing step after any inventory plugin filters are applied.`,
sourceVars: (docsBaseUrl, source) => {
diff --git a/awx/ui/src/screens/Inventory/shared/InventorySourceForm.js b/awx/ui/src/screens/Inventory/shared/InventorySourceForm.js
index 7131ed16bf..88baa8d03d 100644
--- a/awx/ui/src/screens/Inventory/shared/InventorySourceForm.js
+++ b/awx/ui/src/screens/Inventory/shared/InventorySourceForm.js
@@ -71,6 +71,7 @@ const InventorySourceFormFields = ({
source_project: null,
source_script: null,
source_vars: '---\n',
+ scm_branch: null,
update_cache_timeout: 0,
update_on_launch: false,
verbosity: 1,
@@ -248,6 +249,7 @@ const InventorySourceForm = ({
source_project: source?.summary_fields?.source_project || null,
source_script: source?.summary_fields?.source_script || null,
source_vars: source?.source_vars || '---\n',
+ scm_branch: source?.scm_branch || '',
update_cache_timeout: source?.update_cache_timeout || 0,
update_on_launch: source?.update_on_launch || false,
verbosity: source?.verbosity || 1,
diff --git a/awx/ui/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.js b/awx/ui/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.js
index 1b6d3e95ba..873275c61e 100644
--- a/awx/ui/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.js
+++ b/awx/ui/src/screens/Inventory/shared/InventorySourceSubForms/SCMSubForm.js
@@ -20,6 +20,7 @@ import {
EnabledVarField,
EnabledValueField,
HostFilterField,
+ BranchFormField,
} from './SharedFields';
import getHelpText from '../Inventory.helptext';
@@ -36,7 +37,6 @@ const SCMSubForm = ({ autoPopulateProject }) => {
name: 'source_path',
validate: required(t`Select a value for this field`),
});
-
const { error: sourcePathError, request: fetchSourcePath } = useRequest(
useCallback(async (projectId) => {
const { data } = await ProjectsAPI.readInventories(projectId);
@@ -44,7 +44,6 @@ const SCMSubForm = ({ autoPopulateProject }) => {
}, []),
[]
);
-
useEffect(() => {
if (projectMeta.initialValue) {
fetchSourcePath(projectMeta.initialValue.id);
@@ -68,7 +67,6 @@ const SCMSubForm = ({ autoPopulateProject }) => {
},
[fetchSourcePath, setFieldValue, setFieldTouched, sourcePathField.value]
);
-
const handleCredentialUpdate = useCallback(
(value) => {
setFieldValue('credential', value);
@@ -76,9 +74,9 @@ const SCMSubForm = ({ autoPopulateProject }) => {
},
[setFieldValue, setFieldTouched]
);
-
return (
<>
+
{
/>
);
};
+
+export const BranchFormField = ({ label }) => {
+ const helpText = getHelpText();
+ return (
+
+ );
+};