Skip to content

Commit

Permalink
馃洜 Fix drive public links
Browse files Browse the repository at this point in the history
  • Loading branch information
RomaricMourgues authored and Labels Bot committed May 15, 2023
1 parent 0770da3 commit f827ae4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Expand Up @@ -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');
},
},
Expand Down Expand Up @@ -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');
},
},
Expand Down
4 changes: 4 additions & 0 deletions 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;
Expand All @@ -18,6 +19,9 @@ export default ({
context?: EmbedContext;
inPublicSharing?: boolean;
}) => {
//Preload applications for shared view
useCompanyApplications();

return (
<>
<SelectorModal />
Expand Down
4 changes: 2 additions & 2 deletions twake/frontend/src/app/views/applications/drive/shared.tsx
Expand Up @@ -42,7 +42,7 @@ export default () => {
}

return (
<div className="flex flex-col h-full w-full">
<div className="flex flex-col h-full w-full dark:bg-zinc-900">
<div className="flex flex-row items-center justify-center bg-blue-500 px-4 py-2">
<div className="grow flex flex-row items-center">
{group.logo && (
Expand All @@ -65,7 +65,7 @@ export default () => {
</a>
</div>
</div>
<div className="main-view public ">
<div className="main-view public p-4">
<Drive initialParentId={documentId} inPublicSharing />
</div>
<MenusBodyLayer />
Expand Down

0 comments on commit f827ae4

Please sign in to comment.