1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-27 00:55:06 +03:00

Use credential type value from hook value instead of accessing it directly

This commit is contained in:
mabashian 2020-04-23 15:24:28 -04:00
parent 4a9d39c3fa
commit 428527052c

View File

@ -105,19 +105,18 @@ function CredentialFormFields({
}}
/>
</FormGroup>
{formik.values.credential_type !== undefined &&
formik.values.credential_type !== '' && (
<SubFormLayout>
<Title size="md">{i18n._(t`Type Details`)}</Title>
{credTypeField.value !== undefined && credTypeField.value !== '' && (
<SubFormLayout>
<Title size="md">{i18n._(t`Type Details`)}</Title>
{
{
{
[gceCredentialTypeId]: <GoogleComputeEngineSubForm />,
[sshCredentialTypeId]: <ManualSubForm />,
[scmCredentialTypeId]: <SourceControlSubForm />,
}[formik.values.credential_type]
}
</SubFormLayout>
)}
[gceCredentialTypeId]: <GoogleComputeEngineSubForm />,
[sshCredentialTypeId]: <ManualSubForm />,
[scmCredentialTypeId]: <SourceControlSubForm />,
}[credTypeField.value]
}
</SubFormLayout>
)}
</>
);
}