19567: fix missing url origin in copy-to-clipboard for local resources
authorStephen Smith <stephen@curii.com>
Wed, 21 Sep 2022 18:02:46 +0000 (14:02 -0400)
committerStephen Smith <stephen@curii.com>
Wed, 21 Sep 2022 18:07:00 +0000 (14:07 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/store/open-in-new-tab/open-in-new-tab.actions.ts

index c465aae8695a51291918aa0fd630e57fe8b327c6..6b9db6a538e1322004f14138b4e45b0bd8b53a73 100644 (file)
@@ -21,7 +21,9 @@ export const copyToClipboardAction = (resource: any) => (dispatch: Dispatch, get
     // Copy to clipboard omits token to avoid accidental sharing
     const url = getNavUrl(resource.uuid, getState().auth, false);
 
-    if (url) {
+    if (url[0] === '/') {
+        copy(`${window.location.origin}${url}`);
+    } else if (url.length) {
         copy(url);
     }
 };