fix( #11589):japanese/chinese language support in custom property name (#11916)

* fix( #11589):japanese/chinese language support in custom property name

* update regex

* update cypress test
This commit is contained in:
Sachin Chaurasiya 2023-06-09 12:49:43 +05:30 committed by GitHub
parent 05dc42bdb8
commit c9cd4101dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -899,6 +899,14 @@ export const addCustomPropertiesForEntity = (
CUSTOM_PROPERTY_NAME_VALIDATION_ERROR CUSTOM_PROPERTY_NAME_VALIDATION_ERROR
); );
// should allow name in another languages
cy.get('[data-testid="name"]')
.should('be.visible')
.clear()
.type('汝らヴェディア');
// should not throw the validation error
cy.get('#name_help').should('not.exist');
cy.get('[data-testid="name"]') cy.get('[data-testid="name"]')
.should('be.visible') .should('be.visible')
.clear() .clear()

View File

@ -20,7 +20,7 @@ export const FQN_REGEX = new RegExp(
'g' 'g'
); );
export const ENTITY_NAME_REGEX = /^[\w\- .'&()]+$/; export const ENTITY_NAME_REGEX = /^[\p{L}\w\- .'&()]+$/;
export const delimiterRegex = /[\\[\]\\()\\;\\,\\|\\{}\\``\\/\\<>\\^]/g; export const delimiterRegex = /[\\[\]\\()\\;\\,\\|\\{}\\``\\/\\<>\\^]/g;
export const nameWithSpace = /\s/g; export const nameWithSpace = /\s/g;
@ -35,7 +35,8 @@ export const ONEOF_ANYOF_ALLOF_REGEX = /(oneof|anyof|allof)/;
export const markdownTextAndIdRegex = /^(\S.*?)\s*\$\(id="(.*?)"\)/; export const markdownTextAndIdRegex = /^(\S.*?)\s*\$\(id="(.*?)"\)/;
export const MARKDOWN_MATCH_ID = /\$\(id="(.*?)"\)/; export const MARKDOWN_MATCH_ID = /\$\(id="(.*?)"\)/;
export const CUSTOM_PROPERTY_NAME_REGEX = /^[a-z][a-zA-Z0-9]*$/; export const CUSTOM_PROPERTY_NAME_REGEX =
/^(?![\p{Lu}\p{Lt}])[\p{L}a-z][\p{L}a-zA-Z0-9]*$/u;
export const ENDS_WITH_NUMBER_REGEX = /\d+$/; export const ENDS_WITH_NUMBER_REGEX = /\d+$/;

View File

@ -170,7 +170,7 @@
"custom-logo": "Custom Logo", "custom-logo": "Custom Logo",
"custom-logo-configuration": "Custom Logo Configuration", "custom-logo-configuration": "Custom Logo Configuration",
"custom-oidc": "CustomOidc", "custom-oidc": "CustomOidc",
"custom-property": "Custom property", "custom-property": "Custom Property",
"custom-property-plural": "Custom Properties", "custom-property-plural": "Custom Properties",
"custom-range": "Custom Range", "custom-range": "Custom Range",
"dag": "Dag", "dag": "Dag",