Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show grant and client type validation errors #7627

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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