Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(central): schema names with - should be allowed #4391

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/central/src/components/SchemaCreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default {
},
methods: {
validate(name) {
const simpleName = constants.TABLE_NAME_REGEX;
const simpleName = constants.SCHEMA_NAME_REGEX;
mswertz marked this conversation as resolved.
Show resolved Hide resolved
if (name === null) {
return undefined;
}
Expand All @@ -179,7 +179,7 @@ export default {
) {
return undefined;
} else {
return "Table name must start with a letter, followed by zero or more letters, numbers, spaces or underscores. A space immediately before or after an underscore is not allowed. The character limit is 31.";
return "Table name must start with a letter, followed by zero or more letters, numbers, spaces, dash or underscores. A space immediately before or after an underscore is not allowed. The character limit is 31.";
}
},
executeCreateSchema() {
Expand Down
1 change: 1 addition & 0 deletions apps/molgenis-components/src/components/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export default {
CODE_9: 57,
CODE_PERIOD: 46,
CODE_MINUS: 45,
SCHEMA_NAME_REGEX: /^(?!.* _|.*_ )[-a-zA-Z][a-zA-Z0-9 _]{0,30}$/,
TABLE_NAME_REGEX: /^(?!.* _|.*_ )[a-zA-Z][a-zA-Z0-9 _]{0,30}$/,
COLUMN_NAME_REGEX: /^(?!.* _|.*_ )[a-zA-Z][a-zA-Z0-9 _]{0,62}$/,
EMAIL_REGEX:
Expand Down