mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Show scm_branch if project allows branch override
This commit is contained in:
committed by
Seth Foster
parent
a5f9506f49
commit
a7b4c03188
@@ -20,9 +20,9 @@ import {
|
|||||||
EnabledVarField,
|
EnabledVarField,
|
||||||
EnabledValueField,
|
EnabledValueField,
|
||||||
HostFilterField,
|
HostFilterField,
|
||||||
BranchFormField,
|
|
||||||
} from './SharedFields';
|
} from './SharedFields';
|
||||||
import getHelpText from '../Inventory.helptext';
|
import getHelpText from '../Inventory.helptext';
|
||||||
|
import FormField from 'components/FormField';
|
||||||
|
|
||||||
const SCMSubForm = ({ autoPopulateProject }) => {
|
const SCMSubForm = ({ autoPopulateProject }) => {
|
||||||
const helpText = getHelpText();
|
const helpText = getHelpText();
|
||||||
@@ -57,6 +57,7 @@ const SCMSubForm = ({ autoPopulateProject }) => {
|
|||||||
(value) => {
|
(value) => {
|
||||||
setFieldValue('source_project', value);
|
setFieldValue('source_project', value);
|
||||||
setFieldTouched('source_project', true, false);
|
setFieldTouched('source_project', true, false);
|
||||||
|
setFieldValue('scm_branch', '', false);
|
||||||
if (sourcePathField.value) {
|
if (sourcePathField.value) {
|
||||||
setFieldValue('source_path', '');
|
setFieldValue('source_path', '');
|
||||||
setFieldTouched('source_path', false);
|
setFieldTouched('source_path', false);
|
||||||
@@ -76,7 +77,15 @@ const SCMSubForm = ({ autoPopulateProject }) => {
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BranchFormField label={t`Source Control Branch/Tag/Commit`} />
|
{projectField.value?.allow_override && (
|
||||||
|
<FormField
|
||||||
|
id="project-scm-branch"
|
||||||
|
name="scm_branch"
|
||||||
|
type="text"
|
||||||
|
label={t`Source Control Branch/Tag/Commit`}
|
||||||
|
tooltip={helpText.sourceControlBranch}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<CredentialLookup
|
<CredentialLookup
|
||||||
credentialTypeKind="cloud"
|
credentialTypeKind="cloud"
|
||||||
label={t`Credential`}
|
label={t`Credential`}
|
||||||
|
|||||||
@@ -150,16 +150,3 @@ export const HostFilterField = () => {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const BranchFormField = ({ label }) => {
|
|
||||||
const helpText = getHelpText();
|
|
||||||
return (
|
|
||||||
<FormField
|
|
||||||
id="project-scm-branch"
|
|
||||||
name="scm_branch"
|
|
||||||
type="text"
|
|
||||||
label={label}
|
|
||||||
tooltip={helpText.sourceControlBranch}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user