mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: allow non-latin characters to project identifier (#3226)
This commit is contained in:
parent
6ecaa661a7
commit
816b6abf3b
@ -182,7 +182,7 @@ export const CreateProjectModal: FC<Props> = observer((props) => {
|
|||||||
setValue(
|
setValue(
|
||||||
"identifier",
|
"identifier",
|
||||||
e.target.value
|
e.target.value
|
||||||
.replace(/[^a-zA-Z0-9]/g, "")
|
.replace(/[^ÇŞĞIİÖÜA-Za-z0-9]/g, "")
|
||||||
.toUpperCase()
|
.toUpperCase()
|
||||||
.substring(0, 5)
|
.substring(0, 5)
|
||||||
);
|
);
|
||||||
@ -191,7 +191,7 @@ export const CreateProjectModal: FC<Props> = observer((props) => {
|
|||||||
|
|
||||||
const handleIdentifierChange = (onChange: any) => (e: ChangeEvent<HTMLInputElement>) => {
|
const handleIdentifierChange = (onChange: any) => (e: ChangeEvent<HTMLInputElement>) => {
|
||||||
const { value } = e.target;
|
const { value } = e.target;
|
||||||
const alphanumericValue = value.replace(/[^a-zA-Z0-9]/g, "");
|
const alphanumericValue = value.replace(/[^ÇŞĞIİÖÜA-Za-z0-9]/g, "");
|
||||||
setIsChangeInIdentifierRequired(false);
|
setIsChangeInIdentifierRequired(false);
|
||||||
onChange(alphanumericValue.toUpperCase());
|
onChange(alphanumericValue.toUpperCase());
|
||||||
};
|
};
|
||||||
@ -301,8 +301,9 @@ export const CreateProjectModal: FC<Props> = observer((props) => {
|
|||||||
name="identifier"
|
name="identifier"
|
||||||
rules={{
|
rules={{
|
||||||
required: "Identifier is required",
|
required: "Identifier is required",
|
||||||
|
// allow only alphanumeric & non-latin characters
|
||||||
validate: (value) =>
|
validate: (value) =>
|
||||||
/^[A-Z0-9]+$/.test(value.toUpperCase()) || "Identifier must be in uppercase.",
|
/^[ÇŞĞIİÖÜA-Z0-9]+$/.test(value.toUpperCase()) || "Identifier must be in uppercase.",
|
||||||
minLength: {
|
minLength: {
|
||||||
value: 1,
|
value: 1,
|
||||||
message: "Identifier must at least be of 1 character",
|
message: "Identifier must at least be of 1 character",
|
||||||
|
Loading…
Reference in New Issue
Block a user