Skip to content

Commit 5794dcd

Browse files
authored
fix(CreateDirectoryDialog): check path is not empty (#981)
1 parent d1902d4 commit 5794dcd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/containers/Tenant/Schema/CreateDirectoryDialog/CreateDirectoryDialog.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ interface SchemaTreeProps {
2121
}
2222

2323
function validateRelativePath(value: string) {
24-
if (value && /\s/.test(value)) {
24+
if (!value) {
25+
return i18n('schema.tree.dialog.empty');
26+
}
27+
if (/\s/.test(value)) {
2528
return i18n('schema.tree.dialog.whitespace');
2629
}
2730
return '';

src/containers/Tenant/i18n/en.json

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"schema.tree.dialog.placeholder": "Relative path",
4646
"schema.tree.dialog.invalid": "Invalid path",
4747
"schema.tree.dialog.whitespace": "Whitespace is not allowed",
48+
"schema.tree.dialog.empty": "Path is empty",
4849
"schema.tree.dialog.header": "Create directory",
4950
"schema.tree.dialog.description": "Inside",
5051
"schema.tree.dialog.buttonCancel": "Cancel",

0 commit comments

Comments
 (0)