Raphaël Bosi
2025-01-23 14:44:21 +01:00
committed by GitHub
parent cc53cb3b7b
commit 337b6a86ab
21 changed files with 582 additions and 83 deletions

View File

@ -5,6 +5,7 @@ import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';
import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope';
import { RightDrawerPages } from '@/ui/layout/right-drawer/types/RightDrawerPages';
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
import { IconCalendarEvent } from 'twenty-ui';
export const useOpenCalendarEventRightDrawer = () => {
const { openRightDrawer } = useRightDrawer();
@ -13,7 +14,10 @@ export const useOpenCalendarEventRightDrawer = () => {
const openCalendarEventRightDrawer = (calendarEventId: string) => {
setHotkeyScope(RightDrawerHotkeyScope.RightDrawer, { goto: false });
openRightDrawer(RightDrawerPages.ViewCalendarEvent);
openRightDrawer(RightDrawerPages.ViewCalendarEvent, {
title: 'Calendar Event',
Icon: IconCalendarEvent,
});
setViewableRecordId(calendarEventId);
};

View File

@ -2,6 +2,7 @@ import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';
import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope';
import { RightDrawerPages } from '@/ui/layout/right-drawer/types/RightDrawerPages';
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
import { IconSparkles } from 'twenty-ui';
export const useOpenCopilotRightDrawer = () => {
const { openRightDrawer } = useRightDrawer();
@ -9,6 +10,9 @@ export const useOpenCopilotRightDrawer = () => {
return () => {
setHotkeyScope(RightDrawerHotkeyScope.RightDrawer, { goto: false });
openRightDrawer(RightDrawerPages.Copilot);
openRightDrawer(RightDrawerPages.Copilot, {
title: 'Copilot',
Icon: IconSparkles,
});
};
};

View File

@ -4,6 +4,7 @@ import { act } from 'react-dom/test-utils';
import { useOpenEmailThreadRightDrawer } from '@/activities/emails/right-drawer/hooks/useOpenEmailThreadRightDrawer';
import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope';
import { RightDrawerPages } from '@/ui/layout/right-drawer/types/RightDrawerPages';
import { IconMail } from 'twenty-ui';
const mockOpenRightDrawer = jest.fn();
const mockSetHotkeyScope = jest.fn();
@ -31,5 +32,9 @@ test('useOpenEmailThreadRightDrawer opens the email thread right drawer', () =>
);
expect(mockOpenRightDrawer).toHaveBeenCalledWith(
RightDrawerPages.ViewEmailThread,
{
title: 'Email Thread',
Icon: IconMail,
},
);
});

View File

@ -2,6 +2,7 @@ import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';
import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope';
import { RightDrawerPages } from '@/ui/layout/right-drawer/types/RightDrawerPages';
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
import { IconMail } from 'twenty-ui';
export const useOpenEmailThreadRightDrawer = () => {
const { openRightDrawer } = useRightDrawer();
@ -9,6 +10,9 @@ export const useOpenEmailThreadRightDrawer = () => {
return () => {
setHotkeyScope(RightDrawerHotkeyScope.RightDrawer, { goto: false });
openRightDrawer(RightDrawerPages.ViewEmailThread);
openRightDrawer(RightDrawerPages.ViewEmailThread, {
title: 'Email Thread',
Icon: IconMail,
});
};
};