Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / validators / valid-name.tsx
index 000e27b004b6aa9922eff5de1d6f74d460dc1657..89bb3f96888203691029b322e486cd98b3e0df3f 100644 (file)
@@ -29,6 +29,9 @@ export const validFileName = (value: string) => {
 };
 
 export const validFilePath = (filePath: string) => {
-    const errors = filePath.split('/').map(pathPart => validFileName(pathPart));
+    const errors = filePath.split('/').map(pathPart => {
+        if (pathPart === "") { return "Empty dir name not allowed"; }
+        return validNameAllowSlash(pathPart) || validFileName(pathPart);
+    });
     return errors.filter(e => e !== undefined)[0];
 };
\ No newline at end of file