[ARVADOS-WORKBENCH2] updated: 1.4.1-186-g631d2a37

Git user git at public.arvados.org
Fri Jan 17 15:06:49 UTC 2020


Summary of changes:
 src/components/warning/warning.tsx | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

       via  631d2a3780d7d6ae292dc4e5b8a277880e1ef2ca (commit)
      from  c29de730b2cf8582667e21bc985530a804797186 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 631d2a3780d7d6ae292dc4e5b8a277880e1ef2ca
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Jan 17 10:03:24 2020 -0500

    IllegalNamingWarning is conditional on ForwardSlashNameSubstitution
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/src/components/warning/warning.tsx b/src/components/warning/warning.tsx
index 728cb45a..bd330361 100644
--- a/src/components/warning/warning.tsx
+++ b/src/components/warning/warning.tsx
@@ -4,8 +4,10 @@
 
 import * as React from "react";
 import { ErrorIcon } from "~/components/icon/icon";
-import { disallowSlash } from "~/validators/valid-name";
 import { Tooltip } from "@material-ui/core";
+import { disallowSlash } from "~/validators/valid-name";
+import { connect } from "react-redux";
+import { RootState } from "~/store/store";
 
 interface WarningComponentProps {
     text: string;
@@ -22,9 +24,17 @@ export const WarningComponent = ({ text, rules, message }: WarningComponentProps
 
 interface IllegalNamingWarningProps {
     name: string;
+    validate: RegExp[];
 }
 
-export const IllegalNamingWarning = ({ name }: IllegalNamingWarningProps) =>
-    <WarningComponent
-        text={name} rules={[disallowSlash]}
-        message="Names embedding '/' will be renamed or invisible to file system access (arv-mount or WebDAV)" />;
+
+export const IllegalNamingWarning = connect(
+    (state: RootState) => {
+        return {
+            validate: (state.auth.config.clusterConfig.Collections.ForwardSlashNameSubstitution === "" ?
+                [disallowSlash] : [])
+        };
+    })(({ name, validate }: IllegalNamingWarningProps) =>
+        <WarningComponent
+            text={name} rules={validate}
+            message="Names embedding '/' will be renamed or invisible to file system access (arv-mount or WebDAV)" />);

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list