Skip to content

Commit

Permalink
add maxLength to text fields
Browse files Browse the repository at this point in the history
  • Loading branch information
sigruntg committed Sep 12, 2024
1 parent 5c4c160 commit bb9e869
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export const AboutMachine: FC<React.PropsWithChildren<FieldBaseProps>> = (
backgroundColor="blue"
required
disabled={fromService}
maxLength={50}
onChange={(e) => setType(e.target.value)}
error={
displayError && type.length === 0
Expand All @@ -145,6 +146,7 @@ export const AboutMachine: FC<React.PropsWithChildren<FieldBaseProps>> = (
backgroundColor="blue"
required
disabled={fromService}
maxLength={50}
onChange={(e) => setModel(e.target.value)}
error={
displayError && model.length === 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const ImporterInformationSubSection = buildSubSection({
backgroundColor: 'white',
width: 'half',
readOnly: true,
maxLength: 100,
defaultValue: (application: Application) =>
getValueViaPath(
application.externalData,
Expand All @@ -51,6 +52,7 @@ export const ImporterInformationSubSection = buildSubSection({
title: information.labels.importer.address,
width: 'half',
required: true,
maxLength: 50,
defaultValue: (application: Application) =>
getValueViaPath(
application.externalData,
Expand Down Expand Up @@ -92,6 +94,7 @@ export const ImporterInformationSubSection = buildSubSection({
title: information.labels.importer.email,
width: 'half',
variant: 'email',
maxLength: 250,
required: true,
defaultValue: (application: Application) =>
getValueViaPath(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const OperatorInformationSubSection = buildSubSection({
title: information.labels.operator.name,
width: 'half',
required: true,
maxLength: 100,
condition: (answer: FormValue) => hasOperator(answer),
}),
buildTextField({
Expand All @@ -56,6 +57,7 @@ export const OperatorInformationSubSection = buildSubSection({
title: information.labels.operator.address,
width: 'half',
required: true,
maxLength: 50,
condition: (answer: FormValue) => hasOperator(answer),
}),
buildSelectField({
Expand Down Expand Up @@ -83,6 +85,7 @@ export const OperatorInformationSubSection = buildSubSection({
width: 'half',
required: true,
variant: 'email',
maxLength: 250,
condition: (answer: FormValue) => hasOperator(answer),
}),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const MachineBasicInformation = buildSubSection({
id: 'machine.basicInformation.productionNumber',
title: machine.labels.basicMachineInformation.productionNumber,
width: 'half',
maxLength: 50,
required: true,
}),
buildSelectField({
Expand Down Expand Up @@ -122,11 +123,13 @@ export const MachineBasicInformation = buildSubSection({
id: 'machine.basicInformation.location',
title: machine.labels.basicMachineInformation.location,
width: 'half',
maxLength: 255,
}),
buildTextField({
id: 'machine.basicInformation.cargoFileNumber',
title: machine.labels.basicMachineInformation.cargoFileNumber,
width: 'half',
maxLength: 50,
}),
],
}),
Expand Down

0 comments on commit bb9e869

Please sign in to comment.