Merge pull request #10581 from AlexSCorey/10544-fix

Prevents submission of jtform if name is > 512 characters

SUMMARY
This addresses #10544 by adding a maxLength validator to the name field on the Job Template form
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

UI

AWX VERSION
ADDITIONAL INFORMATION

Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
This commit is contained in:
softwarefactory-project-zuul[bot] 2021-07-14 13:46:07 +00:00 committed by GitHub
commit 4eca133080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,7 @@ import {
SubFormLayout,
} from '../../../components/FormLayout';
import { VariablesField } from '../../../components/CodeEditor';
import { required } from '../../../util/validators';
import { required, combine, maxLength } from '../../../util/validators';
import { JobTemplate } from '../../../types';
import {
InventoryLookup,
@ -239,7 +239,7 @@ function JobTemplateForm({
name="name"
type="text"
label={t`Name`}
validate={required(null)}
validate={combine([required(null), maxLength(512)])}
isRequired
/>
<FormField