251 create top bar chips inside the command menu (#9809)
Closes #https://github.com/twentyhq/core-team-issues/issues/251 https://github.com/user-attachments/assets/065c97fe-1daf-4b48-9d57-6bbb96d24ede
This commit is contained in:
@ -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);
|
||||
};
|
||||
|
||||
|
||||
@ -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,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@ -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,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@ -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,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user