From c68daf8496de2564318fc7681fade482e09faa22 Mon Sep 17 00:00:00 2001 From: Romaric Mourgues Date: Mon, 15 May 2023 13:57:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=20Fix=20drive=20public=20links?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/views/applications/drive/context-menu.tsx | 4 ++-- twake/frontend/src/app/views/applications/drive/index.tsx | 4 ++++ twake/frontend/src/app/views/applications/drive/shared.tsx | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/twake/frontend/src/app/views/applications/drive/context-menu.tsx b/twake/frontend/src/app/views/applications/drive/context-menu.tsx index ab09dc29a..3a5565fab 100644 --- a/twake/frontend/src/app/views/applications/drive/context-menu.tsx +++ b/twake/frontend/src/app/views/applications/drive/context-menu.tsx @@ -80,7 +80,7 @@ export const useOnBuildContextMenu = (children: DriveItem[], initialParentId?: s text: 'Copy public link', hide: !item.access_info.public?.level || item.access_info.public?.level === 'none', onClick: () => { - copyToClipboard(getPublicLink(item)); + copyToClipboard(getPublicLink(item || parent?.item)); ToasterService.success('Public link copied to clipboard'); }, }, @@ -244,7 +244,7 @@ export const useOnBuildContextMenu = (children: DriveItem[], initialParentId?: s !parent?.item?.access_info?.public?.level || parent?.item?.access_info?.public?.level === 'none', onClick: () => { - copyToClipboard(getPublicLink(item)); + copyToClipboard(getPublicLink(item || parent?.item)); ToasterService.success('Public link copied to clipboard'); }, }, diff --git a/twake/frontend/src/app/views/applications/drive/index.tsx b/twake/frontend/src/app/views/applications/drive/index.tsx index 2855146e5..c594930c8 100644 --- a/twake/frontend/src/app/views/applications/drive/index.tsx +++ b/twake/frontend/src/app/views/applications/drive/index.tsx @@ -1,6 +1,7 @@ import Browser from './browser'; import { SelectorModal } from './modals/selector'; import TwakeTabConfiguration from './twake-tab-configuration'; +import { useCompanyApplications } from 'app/features/applications/hooks/use-company-applications'; export type EmbedContext = { companyId?: string; @@ -18,6 +19,9 @@ export default ({ context?: EmbedContext; inPublicSharing?: boolean; }) => { + //Preload applications for shared view + useCompanyApplications(); + return ( <> diff --git a/twake/frontend/src/app/views/applications/drive/shared.tsx b/twake/frontend/src/app/views/applications/drive/shared.tsx index 22760bd41..3a0f60d1e 100755 --- a/twake/frontend/src/app/views/applications/drive/shared.tsx +++ b/twake/frontend/src/app/views/applications/drive/shared.tsx @@ -42,7 +42,7 @@ export default () => { } return ( -
+
{group.logo && ( @@ -65,7 +65,7 @@ export default () => {
-
+