feat: workspace name validation added (#767)

This commit is contained in:
Anmol Singh Bhatia 2023-04-11 12:11:41 +05:30 committed by GitHub
parent 748e5e7fb7
commit 22c1f6f8e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,6 +112,9 @@ export const CreateWorkspaceForm: React.FC<Props> = ({
}
validations={{
required: "Workspace name is required",
validate: (value) =>
/^[\w\s-]*$/.test(value) ||
`Name can only contain (" "), ( - ), ( _ ) & Alphanumeric characters.`,
}}
placeholder="e.g. My Workspace"
error={errors.name}