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