Skip to content

Commit

Permalink
M #5833: Make custom_attrs schema stricter (#3038)
Browse files Browse the repository at this point in the history
* Makes the NAME field a mandatory attribute + only allows alphanumeric
  chars and no spaces

Signed-off-by: Victor Hansson <[email protected]>
  • Loading branch information
vichansson authored Apr 23, 2024
1 parent 34dc9f1 commit bdaf644
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ const NAME = {
type: INPUT_TYPES.TEXT,
validation: string()
.trim()
.notRequired()
.lowercase()
.matches(/^[a-z0-9]*$/, {
message:
'Name must only contain lowercase alphanumeric characters and no spaces',
excludeEmptyString: true,
})
.required()
.default(() => undefined),
grid: { sm: 2.5, md: 2.5 },
}
Expand Down

0 comments on commit bdaf644

Please sign in to comment.