1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-30 22:21:13 +03:00

Show grant and client type validation errors

This commit is contained in:
Jake McDermott 2020-07-15 12:05:39 -04:00
parent cd6df9299f
commit d1a4f010b9
No known key found for this signature in database
GPG Key ID: 0E56ED990CDFCB4F

View File

@ -39,6 +39,7 @@ function ApplicationFormFields({
name: 'client_type',
validate: required(null, i18n),
});
return (
<>
<FormField
@ -68,8 +69,12 @@ function ApplicationFormFields({
<FormGroup
fieldId="authType"
helperTextInvalid={authorizationTypeMeta.error}
validated={
!authorizationTypeMeta.touched || !authorizationTypeMeta.error
? 'default'
: 'error'
}
isRequired
isValid={!authorizationTypeMeta.touched || !authorizationTypeMeta.error}
label={i18n._(t`Authorization grant type`)}
>
<FieldTooltip
@ -79,6 +84,9 @@ function ApplicationFormFields({
/>
<AnsibleSelect
{...authorizationTypeField}
isValid={
!authorizationTypeMeta.touched || !authorizationTypeMeta.error
}
isDisabled={match.url.endsWith('edit')}
id="authType"
data={[{ label: '', key: 1, value: '' }, ...authorizationOptions]}
@ -105,8 +113,10 @@ function ApplicationFormFields({
<FormGroup
fieldId="clientType"
helperTextInvalid={clientTypeMeta.error}
validated={
!clientTypeMeta.touched || !clientTypeMeta.error ? 'default' : 'error'
}
isRequired
isValid={!clientTypeMeta.touched || !clientTypeMeta.error}
label={i18n._(t`Client type`)}
>
<FieldTooltip
@ -116,6 +126,7 @@ function ApplicationFormFields({
/>
<AnsibleSelect
{...clientTypeField}
isValid={!clientTypeMeta.touched || !clientTypeMeta.error}
id="clientType"
data={[{ label: '', key: 1, value: '' }, ...clientTypeOptions]}
onChange={(event, value) => {