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) =>
|
validate: (value) =>
|
||||||
/^[\w\s-]*$/.test(value) ||
|
/^[\w\s-]*$/.test(value) ||
|
||||||
`Name can only contain (" "), ( - ), ( _ ) & alphanumeric characters.`,
|
`Name can only contain (" "), ( - ), ( _ ) & alphanumeric characters.`,
|
||||||
|
maxLength: {
|
||||||
|
value: 80,
|
||||||
|
message: "Workspace name should not exceed 80 characters",
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
placeholder="Enter workspace name..."
|
placeholder="Enter workspace name..."
|
||||||
error={errors.name}
|
error={errors.name}
|
||||||
|
@ -224,19 +224,21 @@ const WorkspaceSettings: NextPage = () => {
|
|||||||
<p className="text-sm text-custom-text-200">Your workspace URL.</p>
|
<p className="text-sm text-custom-text-200">Your workspace URL.</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-span-12 flex items-center gap-2 sm:col-span-6">
|
<div className="col-span-12 flex items-center gap-2 sm:col-span-6">
|
||||||
<Input
|
<div className="flex flex-col gap-1">
|
||||||
id="url"
|
<Input
|
||||||
name="url"
|
id="url"
|
||||||
autoComplete="off"
|
name="url"
|
||||||
register={register}
|
autoComplete="off"
|
||||||
error={errors.name}
|
register={register}
|
||||||
className="w-full"
|
error={errors.url}
|
||||||
value={`${
|
className="w-full"
|
||||||
typeof window !== "undefined" &&
|
value={`${
|
||||||
window.location.origin.replace("http://", "").replace("https://", "")
|
typeof window !== "undefined" &&
|
||||||
}/${activeWorkspace.slug}`}
|
window.location.origin.replace("http://", "").replace("https://", "")
|
||||||
disabled
|
}/${activeWorkspace.slug}`}
|
||||||
/>
|
disabled
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<SecondaryButton
|
<SecondaryButton
|
||||||
className="h-min"
|
className="h-min"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
@ -273,6 +275,10 @@ const WorkspaceSettings: NextPage = () => {
|
|||||||
error={errors.name}
|
error={errors.name}
|
||||||
validations={{
|
validations={{
|
||||||
required: "Name is required",
|
required: "Name is required",
|
||||||
|
maxLength: {
|
||||||
|
value: 80,
|
||||||
|
message: "Workspace name should not exceed 80 characters",
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user