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> </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> {
{ {
{ [gceCredentialTypeId]: <GoogleComputeEngineSubForm />,
[gceCredentialTypeId]: <GoogleComputeEngineSubForm />, [sshCredentialTypeId]: <ManualSubForm />,
[sshCredentialTypeId]: <ManualSubForm />, [scmCredentialTypeId]: <SourceControlSubForm />,
[scmCredentialTypeId]: <SourceControlSubForm />, }[credTypeField.value]
}[formik.values.credential_type] }
} </SubFormLayout>
</SubFormLayout> )}
)}
</> </>
); );
} }