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

View File

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