mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: workspace name validation added (#1702)
This commit is contained in:
parent
d9ce042dff
commit
47838a506a
@ -140,6 +140,10 @@ export const CreateWorkspaceForm: React.FC<Props> = ({
|
||||
validate: (value) =>
|
||||
/^[\w\s-]*$/.test(value) ||
|
||||
`Name can only contain (" "), ( - ), ( _ ) & alphanumeric characters.`,
|
||||
maxLength: {
|
||||
value: 80,
|
||||
message: "Workspace name should not exceed 80 characters",
|
||||
},
|
||||
}}
|
||||
placeholder="Enter workspace name..."
|
||||
error={errors.name}
|
||||
|
@ -224,12 +224,13 @@ const WorkspaceSettings: NextPage = () => {
|
||||
<p className="text-sm text-custom-text-200">Your workspace URL.</p>
|
||||
</div>
|
||||
<div className="col-span-12 flex items-center gap-2 sm:col-span-6">
|
||||
<div className="flex flex-col gap-1">
|
||||
<Input
|
||||
id="url"
|
||||
name="url"
|
||||
autoComplete="off"
|
||||
register={register}
|
||||
error={errors.name}
|
||||
error={errors.url}
|
||||
className="w-full"
|
||||
value={`${
|
||||
typeof window !== "undefined" &&
|
||||
@ -237,6 +238,7 @@ const WorkspaceSettings: NextPage = () => {
|
||||
}/${activeWorkspace.slug}`}
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
<SecondaryButton
|
||||
className="h-min"
|
||||
onClick={() =>
|
||||
@ -273,6 +275,10 @@ const WorkspaceSettings: NextPage = () => {
|
||||
error={errors.name}
|
||||
validations={{
|
||||
required: "Name is required",
|
||||
maxLength: {
|
||||
value: 80,
|
||||
message: "Workspace name should not exceed 80 characters",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user