Skip to content

Commit

Permalink
Merge pull request ansible#7627 from jakemcdermott/fix-7512
Browse files Browse the repository at this point in the history
Show grant and client type validation errors

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
  • Loading branch information
softwarefactory-project-zuul[bot] authored Jul 16, 2020
2 parents 2e07ac3 + d1a4f01 commit 4db3cd0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions awx/ui_next/src/screens/Application/shared/ApplicationForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function ApplicationFormFields({
name: 'client_type',
validate: required(null, i18n),
});

return (
<>
<FormField
Expand Down Expand Up @@ -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
Expand All @@ -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]}
Expand All @@ -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
Expand All @@ -116,6 +126,7 @@ function ApplicationFormFields({
/>
<AnsibleSelect
{...clientTypeField}
isValid={!clientTypeMeta.touched || !clientTypeMeta.error}
id="clientType"
data={[{ label: '', key: 1, value: '' }, ...clientTypeOptions]}
onChange={(event, value) => {
Expand Down

0 comments on commit 4db3cd0

Please sign in to comment.