Open mipmip opened 1 week ago
Add Share Button to Note and Task Components
NoteComponent.tsx
). For tasks, modify TaskRow.tsx
.import { IconCopy } from 'twenty-ui';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { Button } from '@/ui/input/button/components/Button';
Add Share Button in JSX
Button
component with an IconCopy
icon and an onClick
handler to copy the URL:
<Button
Icon={IconCopy}
title="Copy URL"
onClick={() => {
const url = `${window.location.origin}/note/${noteId}`; // or `/task/${taskId}`
navigator.clipboard.writeText(url);
enqueueSnackBar('URL copied to clipboard', {
variant: SnackBarVariant.Success,
icon: <IconCopy size={theme.icon.size.md} />,
duration: 2000,
});
}}
/>
Snackbar Notification
useSnackBar
hook to show a notification when the URL is copied, similar to WorkspaceInviteLink.tsx
and ApiKeyInput.tsx
.Generate URL
const url = `${window.location.origin}/note/${noteId}`; // or `/task/${taskId}`
Update Styles if Necessary
/packages/twenty-front/src/modules/workspace/components/WorkspaceInviteLink.tsx /packages/twenty-front/src/modules/settings/developers/components/ApiKeyInput.tsx /packages/twenty-front/src/pages/tasks/Tasks.tsx /packages/twenty-front/src/modules/activities/tasks/components/TaskRow.tsx
Hi @mipmip, that sounds like a good idea! I think we need to release the action menu first to start working on this one.
This would be great yes. This is linked to a bigger refactoring. Tasks should become standard objects like any others. @Bonapara has made designs for that already, relying on the standard table view and standard show page to display tasks, but this requires a significant amount of work.
This would be great yes. This is linked to a bigger refactoring. Tasks should become standard objects like any others. @Bonapara has made designs for that already, relying on the standard table view and standard show page to display tasks, but this requires a significant amount of work.
Sounds good. And notes too,I hope.
Scope & Context
Having a permalink to a note would allow to refer to this note from inside a task. or to link to this note inside another application.
Current behavior
Currently it seems to be a pure javascript event which makes a note popup.
Expected behavior
A share button which includes a copy url action would make it possible to use permalinks to notes or tasks.