mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-03 12:07:40 +03:00
use regex to validate name on frontend
This commit is contained in:
parent
88629cfddb
commit
0af58caf1c
@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"description": {
|
"description": {
|
||||||
"addFace": "Walk through adding a new collection to the Face Library.",
|
"addFace": "Walk through adding a new collection to the Face Library.",
|
||||||
"placeholder": "Enter a name for this collection"
|
"placeholder": "Enter a name for this collection",
|
||||||
|
"invalidName": "Invalid name. Names can only include letters, numbers, spaces, apostrophes, underscores, and hyphens."
|
||||||
},
|
},
|
||||||
"details": {
|
"details": {
|
||||||
"person": "Person",
|
"person": "Person",
|
||||||
|
|||||||
@ -119,6 +119,8 @@ export default function CreateFaceWizardDialog({
|
|||||||
setName(name);
|
setName(name);
|
||||||
setStep(1);
|
setStep(1);
|
||||||
}}
|
}}
|
||||||
|
regexPattern={/^[\p{L}\p{N}\s'_-]{1,50}$/u}
|
||||||
|
regexErrorMessage={t("description.invalidName")}
|
||||||
>
|
>
|
||||||
<div className="flex justify-end py-2">
|
<div className="flex justify-end py-2">
|
||||||
<Button variant="select" type="submit">
|
<Button variant="select" type="submit">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user