* Fix import space name validator (#3491)

import a space should has same regex validator as create a space
This commit is contained in:
qisy 2024-04-02 05:20:07 +08:00 committed by GitHub
parent 38510ca0c1
commit 8893d55eb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,7 +71,11 @@ const ImportSpaceForm = (props: ImportFormProps) => {
const validationSchemaStepTwo = yup.object().shape({
organization: yup.string().trim().required(getString('importSpace.orgRequired')),
name: yup.string().trim().required(getString('importSpace.spaceNameRequired'))
name: yup
.string()
.trim()
.required(getString('importSpace.spaceNameRequired'))
.matches(/^[a-zA-Z_][a-zA-Z0-9-_.]*$/, getString('validation.nameLogic'))
})
return (