16005: Copy to clipboard url fix
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Wed, 11 Nov 2020 14:56:47 +0000 (15:56 +0100)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Wed, 11 Nov 2020 14:56:47 +0000 (15:56 +0100)
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

src/views-components/context-menu/actions/helpers.ts

index 578af2053f74d543cf8d00fec26b87d1e4c8c8c6..0ad2dc3c56c2c2ecd25a2f397467f377e2928bef 100644 (file)
@@ -2,8 +2,6 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { REDIRECT_TO_APPLY_TO_PATH } from "~/common/redirect-to";
-
 export const sanitizeToken = (href: string, tokenAsQueryParam = true): string => {
     const [prefix, suffix] = href.split('/t=');
     const [token1, token2, token3, ...rest] = suffix.split('/');
@@ -17,5 +15,5 @@ export const getClipboardUrl = (href: string, shouldSanitizeToken = true): strin
     const { origin } = window.location;
     const url = shouldSanitizeToken ? sanitizeToken(href, false) : href;
 
-    return `${origin}${!shouldSanitizeToken ? `?${REDIRECT_TO_APPLY_TO_PATH}=true&` : `?`}redirectTo=${url}`;
+    return shouldSanitizeToken ? `${origin}?redirectTo=${url}` : `${origin}${url}`;
 };