Skip to content

The open alternative to Salesforce, designed for AI.

Delete frontend files nothing imports (#25253)

Félix Malfait063b152cf1da
diff --git a/packages/twenty-front/src/hooks/useNavigateApp.ts b/packages/twenty-front/src/hooks/useNavigateApp.ts
index 9f260276e46..bf5a743982c 100644
--- a/packages/twenty-front/src/hooks/useNavigateApp.ts
+++ b/packages/twenty-front/src/hooks/useNavigateApp.ts
@@ -2,7 +2,7 @@ import { useNavigate } from 'react-router-dom';
import { type AppPath, type NavigateOptions } from 'twenty-shared/types';
import { getAppPath } from 'twenty-shared/utils';
-export type NavigateAppOptions = NavigateOptions;
+type NavigateAppOptions = NavigateOptions;
export const useNavigateApp = () => {
const navigate = useNavigate();
diff --git a/packages/twenty-front/src/modules/accounts/constants/GmailSendScope.ts b/packages/twenty-front/src/modules/accounts/constants/GmailSendScope.ts
deleted file mode 100644
index 6918d126f2b..00000000000
--- a/packages/twenty-front/src/modules/accounts/constants/GmailSendScope.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const GMAIL_SEND_SCOPE = 'https://www.googleapis.com/auth/gmail.send';
diff --git a/packages/twenty-front/src/modules/activities/calendar/utils/__tests__/hasCalendarEventStarted.test.ts b/packages/twenty-front/src/modules/activities/calendar/utils/__tests__/hasCalendarEventStarted.test.ts
deleted file mode 100644
index 74ba7662571..00000000000
--- a/packages/twenty-front/src/modules/activities/calendar/utils/__tests__/hasCalendarEventStarted.test.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { addHours, subHours } from 'date-fns';
-
-import { hasCalendarEventStarted } from '@/activities/calendar/utils/hasCalendarEventStarted';
-
-describe('hasCalendarEventStarted', () => {
- it('returns true for an event with a past start date', () => {
- const startsAt = subHours(new Date(), 2).toISOString();
-
- const result = hasCalendarEventStarted({ startsAt });
-
- expect(result).toBe(true);
- });
-
- it('returns false for an event with a future start date', () => {
- const startsAt = addHours(new Date(), 1).toISOString();
-
- const result = hasCalendarEventStarted({ startsAt });
-
- expect(result).toBe(false);
- });
-});
diff --git a/packages/twenty-front/src/modules/activities/calendar/utils/__tests__/sortCalendarEvents.test.ts b/packages/twenty-front/src/modules/activities/calendar/utils/__tests__/sortCalendarEvents.test.ts
deleted file mode 100644
index 3c3432403d7..00000000000
--- a/packages/twenty-front/src/modules/activities/calendar/utils/__tests__/sortCalendarEvents.test.ts
+++ /dev/null
@@ -1,271 +0,0 @@
-import { addHours } from 'date-fns';
-
-import {
- sortCalendarEventsAsc,
- sortCalendarEventsDesc,
-} from '@/activities/calendar/utils/sortCalendarEvents';
-
-const someDate = new Date(2000, 1, 1);
-const someDatePlusOneHour = addHours(someDate, 1);
-const someDatePlusTwoHours = addHours(someDate, 2);
-const someDatePlusThreeHours = addHours(someDate, 3);
-
-describe('sortCalendarEventsAsc', () => {
- it('sorts non-intersecting events by ascending order', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusOneHour.toISOString(),
- isFullDay: false,
- };
- const eventB = {
- startsAt: someDatePlusTwoHours.toISOString(),
- endsAt: someDatePlusThreeHours.toISOString(),
- isFullDay: false,
- };
-
- const result = sortCalendarEventsAsc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsAsc(eventB, eventA);
-
- expect(result).toBe(-1);
- expect(invertedArgsResult).toBe(1);
- });
-
- it('sorts intersecting events by start date ascending order', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusTwoHours.toISOString(),
- isFullDay: false,
- };
- const eventB = {
- startsAt: someDatePlusOneHour.toISOString(),
- endsAt: someDatePlusThreeHours.toISOString(),
- isFullDay: false,
- };
-
- const result = sortCalendarEventsAsc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsAsc(eventB, eventA);
-
- expect(result).toBe(-1);
- expect(invertedArgsResult).toBe(1);
- });
-
- it('sorts events with same start date by end date ascending order', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusTwoHours.toISOString(),
- isFullDay: false,
- };
- const eventB = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusThreeHours.toISOString(),
- isFullDay: false,
- };
-
- const result = sortCalendarEventsAsc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsAsc(eventB, eventA);
-
- expect(result).toBe(-1);
- expect(invertedArgsResult).toBe(1);
- });
-
- it('sorts events with same end date by start date ascending order', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusThreeHours.toISOString(),
- isFullDay: false,
- };
- const eventB = {
- startsAt: someDatePlusOneHour.toISOString(),
- endsAt: someDatePlusThreeHours.toISOString(),
- isFullDay: false,
- };
-
- const result = sortCalendarEventsAsc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsAsc(eventB, eventA);
-
- expect(result).toBe(-1);
- expect(invertedArgsResult).toBe(1);
- });
-
- it('sorts events without end date by start date ascending order', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- isFullDay: true,
- };
- const eventB = {
- startsAt: someDatePlusOneHour.toISOString(),
- isFullDay: true,
- };
-
- const result = sortCalendarEventsAsc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsAsc(eventB, eventA);
-
- expect(result).toBe(-1);
- expect(invertedArgsResult).toBe(1);
- });
-
- it('returns 0 for full day events with the same start date', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- isFullDay: true,
- };
- const eventB = {
- startsAt: someDate.toISOString(),
- isFullDay: true,
- };
-
- const result = sortCalendarEventsAsc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsAsc(eventB, eventA);
-
- expect(result).toBe(0);
- expect(invertedArgsResult).toBe(0);
- });
-
- it('sorts the full day event last for two events with the same start date if one is full day', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusOneHour.toISOString(),
- isFullDay: false,
- };
- const eventB = {
- startsAt: someDate.toISOString(),
- isFullDay: true,
- };
-
- const result = sortCalendarEventsAsc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsAsc(eventB, eventA);
-
- expect(result).toBe(-1);
- expect(invertedArgsResult).toBe(1);
- });
-});
-
-describe('sortCalendarEventsDesc', () => {
- it('sorts non-intersecting events by descending order', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusOneHour.toISOString(),
- isFullDay: false,
- };
- const eventB = {
- startsAt: someDatePlusTwoHours.toISOString(),
- endsAt: someDatePlusThreeHours.toISOString(),
- isFullDay: false,
- };
-
- const result = sortCalendarEventsDesc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsDesc(eventB, eventA);
-
- expect(result).toBe(1);
- expect(invertedArgsResult).toBe(-1);
- });
-
- it('sorts intersecting events by start date descending order', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusTwoHours.toISOString(),
- isFullDay: false,
- };
- const eventB = {
- startsAt: someDatePlusOneHour.toISOString(),
- endsAt: someDatePlusThreeHours.toISOString(),
- isFullDay: false,
- };
-
- const result = sortCalendarEventsDesc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsDesc(eventB, eventA);
-
- expect(result).toBe(1);
- expect(invertedArgsResult).toBe(-1);
- });
-
- it('sorts events with same start date by end date descending order', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusTwoHours.toISOString(),
- isFullDay: false,
- };
- const eventB = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusThreeHours.toISOString(),
- isFullDay: false,
- };
-
- const result = sortCalendarEventsDesc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsDesc(eventB, eventA);
-
- expect(result).toBe(1);
- expect(invertedArgsResult).toBe(-1);
- });
-
- it('sorts events with same end date by start date descending order', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusThreeHours.toISOString(),
- isFullDay: false,
- };
- const eventB = {
- startsAt: someDatePlusOneHour.toISOString(),
- endsAt: someDatePlusThreeHours.toISOString(),
- isFullDay: false,
- };
-
- const result = sortCalendarEventsDesc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsDesc(eventB, eventA);
-
- expect(result).toBe(1);
- expect(invertedArgsResult).toBe(-1);
- });
-
- it('sorts events without end date by start date descending order', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- isFullDay: true,
- };
- const eventB = {
- startsAt: someDatePlusOneHour.toISOString(),
- isFullDay: true,
- };
-
- const result = sortCalendarEventsDesc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsDesc(eventB, eventA);
-
- expect(result).toBe(1);
- expect(invertedArgsResult).toBe(-1);
- });
-
- it('returns 0 for full day events with the same start date', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- isFullDay: true,
- };
- const eventB = {
- startsAt: someDate.toISOString(),
- isFullDay: true,
- };
-
- const result = sortCalendarEventsDesc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsDesc(eventB, eventA);
-
- expect(result === 0).toBe(true);
- expect(invertedArgsResult === 0).toBe(true);
- });
-
- it('sorts the full day event first for two events with the same start date if one is full day', () => {
- const eventA = {
- startsAt: someDate.toISOString(),
- endsAt: someDatePlusOneHour.toISOString(),
- isFullDay: false,
- };
- const eventB = {
- startsAt: someDate.toISOString(),
- isFullDay: true,
- };
-
- const result = sortCalendarEventsDesc(eventA, eventB);
- const invertedArgsResult = sortCalendarEventsDesc(eventB, eventA);
-
- expect(result).toBe(1);
- expect(invertedArgsResult).toBe(-1);
- });
-});
diff --git a/packages/twenty-front/src/modules/activities/calendar/utils/hasCalendarEventStarted.ts b/packages/twenty-front/src/modules/activities/calendar/utils/hasCalendarEventStarted.ts
deleted file mode 100644
index f3789c9e1fe..00000000000
--- a/packages/twenty-front/src/modules/activities/calendar/utils/hasCalendarEventStarted.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { isPast } from 'date-fns';
-
-import { type CalendarEvent } from '@/activities/calendar/types/CalendarEvent';
-import { getCalendarEventStartDate } from '@/activities/calendar/utils/getCalendarEventStartDate';
-
-export const hasCalendarEventStarted = (
- calendarEvent: Pick<CalendarEvent, 'startsAt'>,
-) => isPast(getCalendarEventStartDate(calendarEvent));
diff --git a/packages/twenty-front/src/modules/activities/calendar/utils/sortCalendarEvents.ts b/packages/twenty-front/src/modules/activities/calendar/utils/sortCalendarEvents.ts
deleted file mode 100644
index 0f3ea8e94cb..00000000000
--- a/packages/twenty-front/src/modules/activities/calendar/utils/sortCalendarEvents.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { type CalendarEvent } from '@/activities/calendar/types/CalendarEvent';
-import { getCalendarEventEndDate } from '@/activities/calendar/utils/getCalendarEventEndDate';
-import { getCalendarEventStartDate } from '@/activities/calendar/utils/getCalendarEventStartDate';
-import { sortAsc } from '~/utils/sort';
-
-export const sortCalendarEventsAsc = (
- calendarEventA: Pick<CalendarEvent, 'startsAt' | 'endsAt' | 'isFullDay'>,
- calendarEventB: Pick<CalendarEvent, 'startsAt' | 'endsAt' | 'isFullDay'>,
-) => {
- const startsAtSort = sortAsc(
- getCalendarEventStartDate(calendarEventA).getTime(),
- getCalendarEventStartDate(calendarEventB).getTime(),
- );
-
- if (startsAtSort !== 0) return startsAtSort;
-
- return sortAsc(
- getCalendarEventEndDate(calendarEventA).getTime(),
- getCalendarEventEndDate(calendarEventB).getTime(),
- );
-};
-
-export const sortCalendarEventsDesc = (
- calendarEventA: Pick<CalendarEvent, 'startsAt' | 'endsAt' | 'isFullDay'>,
- calendarEventB: Pick<CalendarEvent, 'startsAt' | 'endsAt' | 'isFullDay'>,
-) => -sortCalendarEventsAsc(calendarEventA, calendarEventB);
diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadBottomBar.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailThreadBottomBar.tsx
deleted file mode 100644
index fd453c6a6a2..00000000000
--- a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadBottomBar.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-import { IconArrowBackUp, IconUserCircle } from 'twenty-ui/icon';
-import { Button } from 'twenty-ui/input';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-
-const StyledThreadBottomBar = styled.div`
- align-items: center;
- display: flex;
- gap: ${themeCssVariables.spacing[2]};
- padding-left: ${themeCssVariables.spacing[6]};
- padding-right: ${themeCssVariables.spacing[6]};
- padding-top: ${themeCssVariables.spacing[4]};
-`;
-
-export const ThreadBottomBar = () => {
- return (
- <StyledThreadBottomBar>
- <Button
- Icon={IconArrowBackUp}
- title={t`Reply`}
- variant="secondary"
- accent="default"
- />
- <Button
- Icon={IconArrowBackUp}
- title={t`Reply to all`}
- variant="secondary"
- accent="default"
- />
- <Button
- Icon={IconUserCircle}
- title={t`Share`}
- variant="secondary"
- accent="default"
- />
- </StyledThreadBottomBar>
- );
-};
diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadHeader.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailThreadHeader.tsx
deleted file mode 100644
index 3d25d8d1933..00000000000
--- a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadHeader.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-import { dateLocaleState } from '~/localization/states/dateLocaleState';
-import { beautifyPastDateRelativeToNow } from '~/utils/date-utils';
-
-type EmailThreadHeaderProps = {
- subject: string;
- lastMessageSentAt: string;
-};
-
-const StyledContainer = styled.div`
- align-items: flex-start;
- background: ${themeCssVariables.background.secondary};
- border-bottom: 1px solid ${themeCssVariables.border.color.medium};
- display: flex;
- flex-direction: column;
- gap: ${themeCssVariables.spacing[6]};
- padding: ${themeCssVariables.spacing[6]};
-`;
-
-const StyledHead = styled.div`
- width: 100%;
-`;
-
-const StyledHeading = styled.h2`
- color: ${themeCssVariables.font.color.primary};
- margin: 0;
- margin-bottom: ${themeCssVariables.spacing[3]};
- max-width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-`;
-
-const StyledContent = styled.span`
- color: ${themeCssVariables.font.color.tertiary};
- width: 100%;
-`;
-
-export const EmailThreadHeader = ({
- subject,
- lastMessageSentAt,
-}: EmailThreadHeaderProps) => {
- const { localeCatalog } = useAtomStateValue(dateLocaleState);
- const lastMessageSentAtFormatted = beautifyPastDateRelativeToNow(
- lastMessageSentAt,
- localeCatalog,
- );
-
- return (
- <StyledContainer>
- <StyledHead>
- <StyledHeading>{subject}</StyledHeading>
- {lastMessageSentAt && (
- <StyledContent>
- {t`Last message ${lastMessageSentAtFormatted}`}
- </StyledContent>
- )}
- </StyledHead>
- </StyledContainer>
- );
-};
diff --git a/packages/twenty-front/src/modules/activities/states/activityBodyFamilyState.ts b/packages/twenty-front/src/modules/activities/states/activityBodyFamilyState.ts
deleted file mode 100644
index e8393c5d6b5..00000000000
--- a/packages/twenty-front/src/modules/activities/states/activityBodyFamilyState.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { createAtomFamilyState } from '@/ui/utilities/state/jotai/utils/createAtomFamilyState';
-
-export const activityBodyFamilyState = createAtomFamilyState<
- string,
- { activityId: string }
->({
- key: 'activityBodyFamilyState',
- defaultValue: '',
-});
diff --git a/packages/twenty-front/src/modules/activities/tasks/constants/TasksTabListComponentId.ts b/packages/twenty-front/src/modules/activities/tasks/constants/TasksTabListComponentId.ts
deleted file mode 100644
index c92c97d8ee9..00000000000
--- a/packages/twenty-front/src/modules/activities/tasks/constants/TasksTabListComponentId.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const TASKS_TAB_LIST_COMPONENT_ID = 'tasks-tab-list';
diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/hooks/useLinkedObjectObjectMetadataItem.ts b/packages/twenty-front/src/modules/activities/timeline-activities/hooks/useLinkedObjectObjectMetadataItem.ts
deleted file mode 100644
index b4a4b70e43b..00000000000
--- a/packages/twenty-front/src/modules/activities/timeline-activities/hooks/useLinkedObjectObjectMetadataItem.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-
-export const useLinkedObjectObjectMetadataItem = (id: string | null) => {
- const objectMetadataItems: EnrichedObjectMetadataItem[] = useAtomStateValue(
- objectMetadataItemsSelector,
- );
-
- if (id === null) {
- return null;
- }
- return (
- objectMetadataItems.find(
- (objectMetadataItem) => objectMetadataItem.id === id,
- ) ?? null
- );
-};
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/index.ts b/packages/twenty-front/src/modules/advanced-text-editor/index.ts
deleted file mode 100644
index 12b282d7b9e..00000000000
--- a/packages/twenty-front/src/modules/advanced-text-editor/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export { AdvancedTextEditor } from './components/AdvancedTextEditor';
-export { ImageBubbleMenu } from './components/ImageBubbleMenu';
-export { LinkBubbleMenu } from './components/LinkBubbleMenu';
-export { TextBubbleMenu } from './components/TextBubbleMenu';
-export { useAdvancedTextEditor } from './hooks/useAdvancedTextEditor';
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadGroup.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadGroup.tsx
deleted file mode 100644
index 6cd884d4034..00000000000
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadGroup.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import { styled } from '@linaria/react';
-import { type ReactNode } from 'react';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-
-import { AiChatThreadListItem } from '@/ai/components/AiChatThreadListItem';
-import { NavigationDrawerSectionTitle } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle';
-import { type AgentChatThread } from '~/generated-metadata/graphql';
-
-const StyledThreadsList = styled.div`
- display: flex;
- flex-direction: column;
- gap: ${themeCssVariables.spacing[1]};
-`;
-
-const StyledDateGroup = styled.div`
- margin-bottom: ${themeCssVariables.spacing[4]};
-`;
-
-type AiChatThreadGroupProps = {
- alwaysShowRightIcon?: boolean;
- rightIcon?: ReactNode;
- threads: AgentChatThread[];
- title: string;
-};
-
-export const AiChatThreadGroup = ({
- alwaysShowRightIcon = false,
- rightIcon,
- threads,
- title,
-}: AiChatThreadGroupProps) => {
- if (threads.length === 0) {
- return null;
- }
-
- return (
- <StyledDateGroup>
- <NavigationDrawerSectionTitle
- label={title}
- alwaysShowRightIcon={alwaysShowRightIcon}
- rightIcon={rightIcon}
- />
- <StyledThreadsList>
- {threads.map((thread) => (
- <AiChatThreadListItem key={thread.id} thread={thread} />
- ))}
- </StyledThreadsList>
- </StyledDateGroup>
- );
-};
diff --git a/packages/twenty-front/src/modules/ai/contexts/AgentChatContext.tsx b/packages/twenty-front/src/modules/ai/contexts/AgentChatContext.tsx
deleted file mode 100644
index 92a04966e8a..00000000000
--- a/packages/twenty-front/src/modules/ai/contexts/AgentChatContext.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { createContext, useContext } from 'react';
-
-export type AgentChatContextValue = {
- ensureThreadForDraft: (() => void) | undefined;
- threadsLoading: boolean;
- messagesLoading: boolean;
-};
-
-export const AgentChatContext = createContext<AgentChatContextValue>({
- ensureThreadForDraft: undefined,
- threadsLoading: false,
- messagesLoading: false,
-});
-
-export const useAgentChatContext = () => useContext(AgentChatContext);
diff --git a/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx b/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx
index 1d847d721d1..e478ab2e1f5 100644
--- a/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx
+++ b/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx
@@ -9,7 +9,6 @@ import {
SettingsRouteOutlet,
} from '@/app/components/SettingsRoutes';
import { type WorkspaceRouteObject } from '@/app/routing/types/WorkspaceRouteObject';
-import indexAppPath from '@/navigation/utils/indexAppPath';
import { RecordIndexSkeletonLoader } from '@/object-record/record-index/components/RecordIndexSkeletonLoader';
const WorkflowCoreIndexPage = lazy(() =>
@@ -88,7 +87,7 @@ export const createWorkspaceRouteObjects = ({
]
: []),
{
- path: indexAppPath.getIndexAppPath(),
+ path: AppPath.Index,
element: <RecordIndexSkeletonLoader />,
},
{
diff --git a/packages/twenty-front/src/modules/blocknote-editor/components/BlockEditorDropdownFocusEffect.tsx b/packages/twenty-front/src/modules/blocknote-editor/components/BlockEditorDropdownFocusEffect.tsx
deleted file mode 100644
index 05e15020c02..00000000000
--- a/packages/twenty-front/src/modules/blocknote-editor/components/BlockEditorDropdownFocusEffect.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { SuggestionMenu } from '@blocknote/core/extensions';
-import { useExtensionState } from '@blocknote/react';
-import { useStore } from 'jotai';
-import { useCallback, useState } from 'react';
-
-import { isSlashMenuOpenComponentState } from '@/blocknote-editor/states/isSlashMenuOpenComponentState';
-import { useGoBackToPreviousDropdownFocusId } from '@/ui/layout/dropdown/hooks/useGoBackToPreviousDropdownFocusId';
-import { useSetActiveDropdownFocusIdAndMemorizePrevious } from '@/ui/layout/dropdown/hooks/useSetFocusedDropdownIdAndMemorizePrevious';
-import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
-
-export const BlockEditorDropdownFocusEffect = () => {
- const [prevShowing, setPrevShowing] = useState<boolean | null>(null);
-
- const isSlashMenuOpenState = useAtomComponentStateCallbackState(
- isSlashMenuOpenComponentState,
- );
-
- const { setActiveDropdownFocusIdAndMemorizePrevious } =
- useSetActiveDropdownFocusIdAndMemorizePrevious();
-
- const { goBackToPreviousDropdownFocusId } =
- useGoBackToPreviousDropdownFocusId();
-
- const store = useStore();
-
- const suggestionState = useExtensionState(SuggestionMenu);
-
- const isSlashMenuShowing =
- suggestionState?.show === true && suggestionState?.triggerCharacter === '/';
-
- const syncSlashMenuState = useCallback(
- (showing: boolean) => {
- const isAlreadyOpen = store.get(isSlashMenuOpenState);
-
- if (showing && isAlreadyOpen !== true) {
- setActiveDropdownFocusIdAndMemorizePrevious('custom-slash-menu');
- store.set(isSlashMenuOpenState, true);
- } else if (!showing && isAlreadyOpen === true) {
- goBackToPreviousDropdownFocusId();
- store.set(isSlashMenuOpenState, false);
- }
- },
- [
- isSlashMenuOpenState,
- setActiveDropdownFocusIdAndMemorizePrevious,
- goBackToPreviousDropdownFocusId,
- store,
- ],
- );
-
- if (prevShowing !== isSlashMenuShowing) {
- setPrevShowing(isSlashMenuShowing);
- syncSlashMenuState(isSlashMenuShowing);
- }
-
- return <></>;
-};
diff --git a/packages/twenty-front/src/modules/command-menu-item/record/types/RecordCommandKeys.ts b/packages/twenty-front/src/modules/command-menu-item/record/types/RecordCommandKeys.ts
deleted file mode 100644
index efcfcff71b9..00000000000
--- a/packages/twenty-front/src/modules/command-menu-item/record/types/RecordCommandKeys.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export enum RecordCommandKeys {
- DELETE = 'delete-records',
- RESTORE = 'restore-records',
- DESTROY = 'destroy-records',
- EXPORT = 'export-records',
-}
diff --git a/packages/twenty-front/src/modules/context-store/constants/ContextStoreInstanceIdDefaultValue.tsx b/packages/twenty-front/src/modules/context-store/constants/ContextStoreInstanceIdDefaultValue.tsx
deleted file mode 100644
index e6ecdbdadb8..00000000000
--- a/packages/twenty-front/src/modules/context-store/constants/ContextStoreInstanceIdDefaultValue.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export const CONTEXT_STORE_INSTANCE_ID_DEFAULT_VALUE = 'app';
diff --git a/packages/twenty-front/src/modules/dashboards/components/types/Dashboard.ts b/packages/twenty-front/src/modules/dashboards/components/types/Dashboard.ts
deleted file mode 100644
index 7c7f1bcf1c9..00000000000
--- a/packages/twenty-front/src/modules/dashboards/components/types/Dashboard.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export type Dashboard = {
- __typename: 'Dashboard';
- id: string;
- title: string;
- pageLayoutId: string;
-};
diff --git a/packages/twenty-front/src/modules/file-upload/index.ts b/packages/twenty-front/src/modules/file-upload/index.ts
deleted file mode 100644
index 1a568781d2d..00000000000
--- a/packages/twenty-front/src/modules/file-upload/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export { FileUploadProvider } from './components/FileUploadProvider';
-export { FileUploadContext } from './contexts/FileUploadContext';
-export type {
- FileUploadCallback,
- FileUploadContextValue,
- FileUploadOptions,
-} from './contexts/FileUploadContext';
-export { useFileUpload } from './hooks/useFileUpload';
diff --git a/packages/twenty-front/src/modules/information-banner/constants/InformationBannerHeight.ts b/packages/twenty-front/src/modules/information-banner/constants/InformationBannerHeight.ts
deleted file mode 100644
index 472d20303a5..00000000000
--- a/packages/twenty-front/src/modules/information-banner/constants/InformationBannerHeight.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const INFORMATION_BANNER_HEIGHT = '40px';
diff --git a/packages/twenty-front/src/modules/localization/utils/__tests__/formatDateISOStringToDateTimeSimplified.test.ts b/packages/twenty-front/src/modules/localization/utils/__tests__/formatDateISOStringToDateTimeSimplified.test.ts
deleted file mode 100644
index 748b32fd3b7..00000000000
--- a/packages/twenty-front/src/modules/localization/utils/__tests__/formatDateISOStringToDateTimeSimplified.test.ts
+++ /dev/null
@@ -1,98 +0,0 @@
-import { TimeFormat } from '@/localization/constants/TimeFormat';
-import { detectDateFormat } from '@/localization/utils/detection/detectDateFormat';
-import { formatDateISOStringToDateTimeSimplified } from '@/localization/utils/formatDateISOStringToDateTimeSimplified';
-import { formatInTimeZone } from 'date-fns-tz';
-
-jest.mock('@/localization/utils/detection/detectDateFormat');
-jest.mock('date-fns-tz');
-
-const mockDetectDateFormat = detectDateFormat as jest.MockedFunction<
- typeof detectDateFormat
->;
-const mockFormatInTimeZone = formatInTimeZone as jest.MockedFunction<
- typeof formatInTimeZone
->;
-
-describe('formatDateISOStringToDateTimeSimplified', () => {
- const mockDate = new Date('2023-08-15T10:30:00Z');
- const mockTimeZone = 'America/New_York';
- const mockTimeFormat = TimeFormat.HOUR_24;
-
- beforeEach(() => {
- jest.resetAllMocks();
- });
-
- it('should format the date correctly when DATE_FORMAT is MONTH_FIRST', () => {
- mockDetectDateFormat.mockReturnValue('MONTH_FIRST');
- mockFormatInTimeZone.mockReturnValue('Oct 15 · 06:30');
-
- const result = formatDateISOStringToDateTimeSimplified(
- mockDate,
- mockTimeZone,
- mockTimeFormat,
- );
-
- expect(mockDetectDateFormat).toHaveBeenCalled();
- expect(mockFormatInTimeZone).toHaveBeenCalledWith(
- mockDate,
- mockTimeZone,
- 'MMM d · HH:mm',
- );
- expect(result).toBe('Oct 15 · 06:30');
- });
-
- it('should format the date correctly when DATE_FORMAT is DAY_FIRST', () => {
- mockDetectDateFormat.mockReturnValue('DAY_FIRST');
- mockFormatInTimeZone.mockReturnValue('15 Oct · 06:30');
-
- const result = formatDateISOStringToDateTimeSimplified(
- mockDate,
- mockTimeZone,
- mockTimeFormat,
- );
-
- expect(mockDetectDateFormat).toHaveBeenCalled();
- expect(mockFormatInTimeZone).toHaveBeenCalledWith(
- mockDate,
- mockTimeZone,
- 'd MMM · HH:mm',
- );
- expect(result).toBe('15 Oct · 06:30');
- });
-
- it('should use the provided time format', () => {
- mockDetectDateFormat.mockReturnValue('MONTH_FIRST');
- mockFormatInTimeZone.mockReturnValue('Oct 15 · 6:30 AM');
-
- const result = formatDateISOStringToDateTimeSimplified(
- mockDate,
- mockTimeZone,
- TimeFormat.HOUR_12,
- );
-
- expect(mockFormatInTimeZone).toHaveBeenCalledWith(
- mockDate,
- mockTimeZone,
- 'MMM d · h:mm aa',
- );
- expect(result).toBe('Oct 15 · 6:30 AM');
- });
-
- it('should handle different time zones', () => {
- mockDetectDateFormat.mockReturnValue('MONTH_FIRST');
- mockFormatInTimeZone.mockReturnValue('Oct 16 · 02:30');
-
- const result = formatDateISOStringToDateTimeSimplified(
- mockDate,
- 'Asia/Tokyo',
- mockTimeFormat,
- );
-
- expect(mockFormatInTimeZone).toHaveBeenCalledWith(
- mockDate,
- 'Asia/Tokyo',
- 'MMM d · HH:mm',
- );
- expect(result).toBe('Oct 16 · 02:30');
- });
-});
diff --git a/packages/twenty-front/src/modules/localization/utils/format-preferences/__tests__/getDateFormatFromWorkspaceDateFormat.test.ts b/packages/twenty-front/src/modules/localization/utils/format-preferences/__tests__/getDateFormatFromWorkspaceDateFormat.test.ts
deleted file mode 100644
index 0c33dfda2b6..00000000000
--- a/packages/twenty-front/src/modules/localization/utils/format-preferences/__tests__/getDateFormatFromWorkspaceDateFormat.test.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { DateFormat } from '@/localization/constants/DateFormat';
-import { getDateFormatFromWorkspaceDateFormat } from '@/localization/utils/format-preferences/getDateFormatFromWorkspaceDateFormat';
-import { WorkspaceMemberDateFormatEnum } from '~/generated-metadata/graphql';
-
-jest.mock('@/localization/utils/detection/detectDateFormat', () => ({
- detectDateFormat: jest.fn(() => 'MONTH_FIRST'),
-}));
-
-describe('getDateFormatFromWorkspaceDateFormat', () => {
- it('should return MONTH_FIRST for MONTH_FIRST workspace format', () => {
- expect(
- getDateFormatFromWorkspaceDateFormat(
- WorkspaceMemberDateFormatEnum.MONTH_FIRST,
- ),
- ).toBe(DateFormat.MONTH_FIRST);
- });
-
- it('should return DAY_FIRST for DAY_FIRST workspace format', () => {
- expect(
- getDateFormatFromWorkspaceDateFormat(
- WorkspaceMemberDateFormatEnum.DAY_FIRST,
- ),
- ).toBe(DateFormat.DAY_FIRST);
- });
-
- it('should return YEAR_FIRST for YEAR_FIRST workspace format', () => {
- expect(
- getDateFormatFromWorkspaceDateFormat(
- WorkspaceMemberDateFormatEnum.YEAR_FIRST,
- ),
- ).toBe(DateFormat.YEAR_FIRST);
- });
-
- it('should return detected format for SYSTEM workspace format', () => {
- expect(
- getDateFormatFromWorkspaceDateFormat(
- WorkspaceMemberDateFormatEnum.SYSTEM,
- ),
- ).toBe(DateFormat.MONTH_FIRST);
- });
-
- it('should return MONTH_FIRST for unknown format', () => {
- expect(
- getDateFormatFromWorkspaceDateFormat(
- 'UNKNOWN' as WorkspaceMemberDateFormatEnum,
- ),
- ).toBe(DateFormat.MONTH_FIRST);
- });
-});
diff --git a/packages/twenty-front/src/modules/localization/utils/format-preferences/__tests__/getTimeFormatFromWorkspaceTimeFormat.test.ts b/packages/twenty-front/src/modules/localization/utils/format-preferences/__tests__/getTimeFormatFromWorkspaceTimeFormat.test.ts
deleted file mode 100644
index e075f6e3aef..00000000000
--- a/packages/twenty-front/src/modules/localization/utils/format-preferences/__tests__/getTimeFormatFromWorkspaceTimeFormat.test.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { TimeFormat } from '@/localization/constants/TimeFormat';
-import { getTimeFormatFromWorkspaceTimeFormat } from '@/localization/utils/format-preferences/getTimeFormatFromWorkspaceTimeFormat';
-import { WorkspaceMemberTimeFormatEnum } from '~/generated-metadata/graphql';
-
-jest.mock('@/localization/utils/detection/detectTimeFormat', () => ({
- detectTimeFormat: jest.fn(() => 'HOUR_12'),
-}));
-
-describe('getTimeFormatFromWorkspaceTimeFormat', () => {
- it('should return HOUR_24 for HOUR_24 workspace format', () => {
- expect(
- getTimeFormatFromWorkspaceTimeFormat(
- WorkspaceMemberTimeFormatEnum.HOUR_24,
- ),
- ).toBe(TimeFormat.HOUR_24);
- });
-
- it('should return HOUR_12 for HOUR_12 workspace format', () => {
- expect(
- getTimeFormatFromWorkspaceTimeFormat(
- WorkspaceMemberTimeFormatEnum.HOUR_12,
- ),
- ).toBe(TimeFormat.HOUR_12);
- });
-
- it('should return detected format for SYSTEM workspace format', () => {
- expect(
- getTimeFormatFromWorkspaceTimeFormat(
- WorkspaceMemberTimeFormatEnum.SYSTEM,
- ),
- ).toBe(TimeFormat.HOUR_12);
- });
-
- it('should return HOUR_24 for unknown format', () => {
- expect(
- getTimeFormatFromWorkspaceTimeFormat(
- 'UNKNOWN' as WorkspaceMemberTimeFormatEnum,
- ),
- ).toBe(TimeFormat.HOUR_24);
- });
-});
diff --git a/packages/twenty-front/src/modules/localization/utils/format-preferences/getDateFormatFromWorkspaceDateFormat.ts b/packages/twenty-front/src/modules/localization/utils/format-preferences/getDateFormatFromWorkspaceDateFormat.ts
deleted file mode 100644
index 910c5c497fb..00000000000
--- a/packages/twenty-front/src/modules/localization/utils/format-preferences/getDateFormatFromWorkspaceDateFormat.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { DateFormat } from '@/localization/constants/DateFormat';
-import { detectDateFormat } from '@/localization/utils/detection/detectDateFormat';
-import { WorkspaceMemberDateFormatEnum } from '~/generated-metadata/graphql';
-
-export const getDateFormatFromWorkspaceDateFormat = (
- workspaceDateFormat: WorkspaceMemberDateFormatEnum,
-) => {
- switch (workspaceDateFormat) {
- case WorkspaceMemberDateFormatEnum.SYSTEM:
- return DateFormat[detectDateFormat()];
- case WorkspaceMemberDateFormatEnum.MONTH_FIRST:
- return DateFormat.MONTH_FIRST;
- case WorkspaceMemberDateFormatEnum.DAY_FIRST:
- return DateFormat.DAY_FIRST;
- case WorkspaceMemberDateFormatEnum.YEAR_FIRST:
- return DateFormat.YEAR_FIRST;
- default:
- return DateFormat.MONTH_FIRST;
- }
-};
diff --git a/packages/twenty-front/src/modules/localization/utils/format-preferences/getNumberFormatFromWorkspaceNumberFormat.ts b/packages/twenty-front/src/modules/localization/utils/format-preferences/getNumberFormatFromWorkspaceNumberFormat.ts
deleted file mode 100644
index a0897a56ec6..00000000000
--- a/packages/twenty-front/src/modules/localization/utils/format-preferences/getNumberFormatFromWorkspaceNumberFormat.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { NumberFormat } from '@/localization/constants/NumberFormat';
-import { detectNumberFormat } from '@/localization/utils/detection/detectNumberFormat';
-import { WorkspaceMemberNumberFormatEnum } from '~/generated-metadata/graphql';
-
-export const getNumberFormatFromWorkspaceNumberFormat = (
- numberFormat: WorkspaceMemberNumberFormatEnum,
-): NumberFormat => {
- switch (numberFormat) {
- case WorkspaceMemberNumberFormatEnum.SYSTEM:
- return NumberFormat[detectNumberFormat()];
- case WorkspaceMemberNumberFormatEnum.COMMAS_AND_DOT:
- return NumberFormat.COMMAS_AND_DOT;
- case WorkspaceMemberNumberFormatEnum.SPACES_AND_COMMA:
- return NumberFormat.SPACES_AND_COMMA;
- case WorkspaceMemberNumberFormatEnum.DOTS_AND_COMMA:
- return NumberFormat.DOTS_AND_COMMA;
- case WorkspaceMemberNumberFormatEnum.APOSTROPHE_AND_DOT:
- return NumberFormat.APOSTROPHE_AND_DOT;
- default:
- return NumberFormat.COMMAS_AND_DOT;
- }
-};
diff --git a/packages/twenty-front/src/modules/localization/utils/format-preferences/getTimeFormatFromWorkspaceTimeFormat.ts b/packages/twenty-front/src/modules/localization/utils/format-preferences/getTimeFormatFromWorkspaceTimeFormat.ts
deleted file mode 100644
index f744bd21a3d..00000000000
--- a/packages/twenty-front/src/modules/localization/utils/format-preferences/getTimeFormatFromWorkspaceTimeFormat.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { TimeFormat } from '@/localization/constants/TimeFormat';
-import { detectTimeFormat } from '@/localization/utils/detection/detectTimeFormat';
-import { WorkspaceMemberTimeFormatEnum } from '~/generated-metadata/graphql';
-
-export const getTimeFormatFromWorkspaceTimeFormat = (
- workspaceTimeFormat: WorkspaceMemberTimeFormatEnum,
-) => {
- switch (workspaceTimeFormat) {
- case WorkspaceMemberTimeFormatEnum.SYSTEM:
- return TimeFormat[detectTimeFormat()];
- case WorkspaceMemberTimeFormatEnum.HOUR_24:
- return TimeFormat.HOUR_24;
- case WorkspaceMemberTimeFormatEnum.HOUR_12:
- return TimeFormat.HOUR_12;
- default:
- return TimeFormat.HOUR_24;
- }
-};
diff --git a/packages/twenty-front/src/modules/localization/utils/formatDateISOStringToDateTimeSimplified.ts b/packages/twenty-front/src/modules/localization/utils/formatDateISOStringToDateTimeSimplified.ts
deleted file mode 100644
index da0475dcb9e..00000000000
--- a/packages/twenty-front/src/modules/localization/utils/formatDateISOStringToDateTimeSimplified.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { DATE_FORMAT_WITHOUT_YEAR } from '@/localization/constants/DateFormatWithoutYear';
-import { type TimeFormat } from '@/localization/constants/TimeFormat';
-import { detectDateFormat } from '@/localization/utils/detection/detectDateFormat';
-import { formatInTimeZone } from 'date-fns-tz';
-
-export const formatDateISOStringToDateTimeSimplified = (
- date: Date,
- timeZone: string,
- timeFormat: TimeFormat,
-) => {
- const simplifiedDateFormat = DATE_FORMAT_WITHOUT_YEAR[detectDateFormat()];
-
- return formatInTimeZone(
- date,
- timeZone,
- `${simplifiedDateFormat} · ${timeFormat}`,
- );
-};
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/common/graphql/queries/findOneNavigationMenuItem.ts b/packages/twenty-front/src/modules/navigation-menu-item/common/graphql/queries/findOneNavigationMenuItem.ts
deleted file mode 100644
index dcd631c04c9..00000000000
--- a/packages/twenty-front/src/modules/navigation-menu-item/common/graphql/queries/findOneNavigationMenuItem.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { NAVIGATION_MENU_ITEM_QUERY_FRAGMENT } from '@/navigation-menu-item/common/graphql/fragments/navigationMenuItemQueryFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_ONE_NAVIGATION_MENU_ITEM = gql`
- ${NAVIGATION_MENU_ITEM_QUERY_FRAGMENT}
- query FindOneNavigationMenuItem($id: UUID!) {
- navigationMenuItem(id: $id) {
- ...NavigationMenuItemQueryFields
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/common/utils/__tests__/getDropTargetIdFromDestination.test.ts b/packages/twenty-front/src/modules/navigation-menu-item/common/utils/__tests__/getDropTargetIdFromDestination.test.ts
deleted file mode 100644
index ac4ebbf592f..00000000000
--- a/packages/twenty-front/src/modules/navigation-menu-item/common/utils/__tests__/getDropTargetIdFromDestination.test.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-import { getDropTargetIdFromDestination } from '@/navigation-menu-item/common/utils/getDropTargetIdFromDestination';
-
-describe('getDropTargetIdFromDestination', () => {
- describe('workspace section', () => {
- it('should return null when destination is null or droppableId is not workspace', () => {
- expect(
- getDropTargetIdFromDestination({
- navigationMenuItemSection: 'workspace',
- destination: null,
- }),
- ).toBe(null);
- expect(
- getDropTargetIdFromDestination({
- navigationMenuItemSection: 'workspace',
- destination: { droppableId: 'favorite-orphan', index: 0 },
- }),
- ).toBe(null);
- });
-
- it('should return workspace-orphan-index for workspace orphan droppable', () => {
- expect(
- getDropTargetIdFromDestination({
- navigationMenuItemSection: 'workspace',
- destination: {
- droppableId: 'workspace-orphan-navigation-menu-items',
- index: 2,
- },
- }),
- ).toBe('workspace-orphan-2');
- });
-
- it('should return workspace-folderId-index for workspace folder droppable', () => {
- expect(
- getDropTargetIdFromDestination({
- navigationMenuItemSection: 'workspace',
- destination: {
- droppableId: 'workspace-folder-folder-123',
- index: 1,
- },
- }),
- ).toBe('workspace-folder-123-1');
- });
-
- it('should return workspace-folderId-index for workspace folder header droppable', () => {
- expect(
- getDropTargetIdFromDestination({
- navigationMenuItemSection: 'workspace',
- destination: {
- droppableId: 'workspace-folder-header-folder-456',
- index: 0,
- },
- }),
- ).toBe('workspace-folder-456-0');
- });
- });
-
- describe('favorite section', () => {
- it('should return null when destination is null or droppableId is not favorite', () => {
- expect(
- getDropTargetIdFromDestination({
- navigationMenuItemSection: 'favorite',
- destination: null,
- }),
- ).toBe(null);
- expect(
- getDropTargetIdFromDestination({
- navigationMenuItemSection: 'favorite',
- destination: { droppableId: 'workspace-orphan', index: 0 },
- }),
- ).toBe(null);
- });
-
- it('should return favorite-orphan-index for favorite orphan droppable', () => {
- expect(
- getDropTargetIdFromDestination({
- navigationMenuItemSection: 'favorite',
- destination: {
- droppableId: 'favorite-orphan-navigation-menu-items',
- index: 3,
- },
- }),
- ).toBe('favorite-orphan-3');
- });
-
- it('should return favorite-folderId-index for favorite folder droppable', () => {
- expect(
- getDropTargetIdFromDestination({
- navigationMenuItemSection: 'favorite',
- destination: {
- droppableId: 'favorite-folder-abc-123',
- index: 1,
- },
- }),
- ).toBe('favorite-abc-123-1');
- });
-
- it('should return favorite-folderId-index for favorite folder header droppable', () => {
- expect(
- getDropTargetIdFromDestination({
- navigationMenuItemSection: 'favorite',
- destination: {
- droppableId: 'favorite-folder-header-def-456',
- index: 0,
- },
- }),
- ).toBe('favorite-def-456-0');
- });
- });
-});
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/common/utils/__tests__/orderFoldersForCreation.test.ts b/packages/twenty-front/src/modules/navigation-menu-item/common/utils/__tests__/orderFoldersForCreation.test.ts
deleted file mode 100644
index 02397aa7431..00000000000
--- a/packages/twenty-front/src/modules/navigation-menu-item/common/utils/__tests__/orderFoldersForCreation.test.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { orderFoldersForCreation } from '@/navigation-menu-item/common/utils/orderFoldersForCreation';
-
-describe('orderFoldersForCreation', () => {
- it('returns empty array for empty input', () => {
- expect(orderFoldersForCreation([], new Set())).toEqual([]);
- });
-
- it('orders so parent folders come before their children', () => {
- const parent = { id: 'parent', folderId: null };
- const child = { id: 'child', folderId: 'parent' };
- expect(orderFoldersForCreation([child, parent], new Set())).toEqual([
- parent,
- child,
- ]);
- });
-
- it('treats folderId in existingIds as already created so child can be placed', () => {
- const child = { id: 'child', folderId: 'existing-parent' };
- expect(
- orderFoldersForCreation([child], new Set(['existing-parent'])),
- ).toEqual([child]);
- });
-
- it('orders multiple levels: root first, then children in dependency order', () => {
- const a = { id: 'a', folderId: undefined };
- const b = { id: 'b', folderId: 'a' };
- const c = { id: 'c', folderId: 'b' };
- expect(orderFoldersForCreation([c, a, b], new Set())).toEqual([a, b, c]);
- });
-
- it('leaves out folders whose parent is missing and not in existingIds', () => {
- const child = { id: 'child', folderId: 'missing-parent' };
- expect(orderFoldersForCreation([child], new Set())).toEqual([]);
- });
-});
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/common/utils/getDropTargetIdFromDestination.ts b/packages/twenty-front/src/modules/navigation-menu-item/common/utils/getDropTargetIdFromDestination.ts
deleted file mode 100644
index 6a1bb81817e..00000000000
--- a/packages/twenty-front/src/modules/navigation-menu-item/common/utils/getDropTargetIdFromDestination.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { NAVIGATION_MENU_ITEM_SECTION_DROPPABLE_CONFIG } from '@/navigation-menu-item/common/constants/NavigationMenuItemSectionDroppableConfig';
-import type { DropDestination } from '@/navigation-menu-item/common/types/navigationMenuItemDndKitDropDestination';
-import type { NavigationMenuItemSection } from '@/navigation-menu-item/common/types/NavigationMenuItemSection';
-import { canNavigationMenuItemBeDroppedIn } from '@/navigation-menu-item/common/utils/canNavigationMenuItemBeDroppedIn';
-
-export const getDropTargetIdFromDestination = ({
- navigationMenuItemSection,
- destination,
-}: {
- navigationMenuItemSection: NavigationMenuItemSection;
- destination: DropDestination | null;
-}): string | null => {
- if (
- !destination ||
- !canNavigationMenuItemBeDroppedIn({
- navigationMenuItemSection,
- droppableId: destination.droppableId,
- })
- ) {
- return null;
- }
-
- const config =
- NAVIGATION_MENU_ITEM_SECTION_DROPPABLE_CONFIG[navigationMenuItemSection];
- const { droppableId, index } = destination;
-
- if (droppableId === config.orphanDroppableId) {
- return `${navigationMenuItemSection}-orphan-${index}`;
- }
-
- if (droppableId.startsWith(config.folderHeaderPrefix)) {
- const folderId = droppableId.slice(config.folderHeaderPrefix.length);
- return `${navigationMenuItemSection}-${folderId}-${index}`;
- }
-
- if (droppableId.startsWith(config.folderPrefix)) {
- const folderId = droppableId.slice(config.folderPrefix.length);
- return `${navigationMenuItemSection}-${folderId}-${index}`;
- }
-
- return null;
-};
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/common/utils/hasNavigationMenuItemOwnColor.ts b/packages/twenty-front/src/modules/navigation-menu-item/common/utils/hasNavigationMenuItemOwnColor.ts
deleted file mode 100644
index 68e457cbf49..00000000000
--- a/packages/twenty-front/src/modules/navigation-menu-item/common/utils/hasNavigationMenuItemOwnColor.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { NavigationMenuItemType } from 'twenty-shared/types';
-
-export const hasNavigationMenuItemOwnColor = (item: { type?: string | null }) =>
- item.type === NavigationMenuItemType.FOLDER;
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/common/utils/orderFoldersForCreation.ts b/packages/twenty-front/src/modules/navigation-menu-item/common/utils/orderFoldersForCreation.ts
deleted file mode 100644
index 88ef500d660..00000000000
--- a/packages/twenty-front/src/modules/navigation-menu-item/common/utils/orderFoldersForCreation.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-export const orderFoldersForCreation = <
- T extends { id: string; folderId?: string | null },
->(
- folders: T[],
- existingIds: Set<string>,
-): T[] => {
- const result: T[] = [];
- let remaining = [...folders];
-
- while (remaining.length > 0) {
- const readyIndex = remaining.findIndex(
- (folder) =>
- !folder.folderId ||
- existingIds.has(folder.folderId) ||
- result.some((r) => r.id === folder.folderId),
- );
- if (readyIndex === -1) break;
-
- const [ready] = remaining.splice(readyIndex, 1);
- result.push(ready);
- }
-
- return result;
-};
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/components/NavigationMenuItemSkeletonLoader.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/components/NavigationMenuItemSkeletonLoader.tsx
deleted file mode 100644
index 34cb993024a..00000000000
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/components/NavigationMenuItemSkeletonLoader.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
-import { css } from '@linaria/core';
-import { styled } from '@linaria/react';
-import { useContext } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
-
-const StyledSkeletonContainer = styled.div`
- display: flex;
- flex-direction: column;
- gap: ${themeCssVariables.spacing[2]};
- height: 71px;
- padding-left: ${themeCssVariables.spacing[1]};
-`;
-
-const StyledSkeletonColumn = styled.div`
- display: flex;
- flex-direction: column;
- gap: ${themeCssVariables.spacing[1]};
- width: 100%;
-`;
-
-const fillSkeletonContainer = css`
- display: block;
- width: 100%;
-`;
-
-export const NavigationMenuItemSkeletonLoader = () => {
- const { theme } = useContext(ThemeContext);
- return (
- <SkeletonTheme
- baseColor={theme.grayScale.gray3}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <StyledSkeletonContainer>
- <Skeleton
- width={56}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.xs}
- />
- <StyledSkeletonColumn>
- <Skeleton
- containerClassName={fillSkeletonContainer}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- <Skeleton
- containerClassName={fillSkeletonContainer}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </StyledSkeletonColumn>
- </StyledSkeletonContainer>
- </SkeletonTheme>
- );
-};
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/edit/folder/hooks/useUpdateFolderNameInDraft.ts b/packages/twenty-front/src/modules/navigation-menu-item/edit/folder/hooks/useUpdateFolderNameInDraft.ts
deleted file mode 100644
index a968d3761b8..00000000000
--- a/packages/twenty-front/src/modules/navigation-menu-item/edit/folder/hooks/useUpdateFolderNameInDraft.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { navigationMenuItemsDraftState } from '@/navigation-menu-item/common/states/navigationMenuItemsDraftState';
-import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
-import { isNavigationMenuItemFolder } from '@/navigation-menu-item/common/utils/isNavigationMenuItemFolder';
-
-export const useUpdateFolderNameInDraft = () => {
- const setNavigationMenuItemsDraft = useSetAtomState(
- navigationMenuItemsDraftState,
- );
-
- const updateFolderNameInDraft = (folderId: string, name: string) => {
- setNavigationMenuItemsDraft((draft) => {
- if (!draft) return draft;
-
- return draft.map((item) =>
- isNavigationMenuItemFolder(item) && item.id === folderId
- ? { ...item, name }
- : item,
- );
- });
- };
-
- return { updateFolderNameInDraft };
-};
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/edit/side-panel/components/SidePanelEditFolderPickerSubView.tsx b/packages/twenty-front/src/modules/navigation-menu-item/edit/side-panel/components/SidePanelEditFolderPickerSubView.tsx
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/edit/view/hooks/useUpdateViewInDraft.ts b/packages/twenty-front/src/modules/navigation-menu-item/edit/view/hooks/useUpdateViewInDraft.ts
deleted file mode 100644
index 18ca0ede8a6..00000000000
--- a/packages/twenty-front/src/modules/navigation-menu-item/edit/view/hooks/useUpdateViewInDraft.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { navigationMenuItemsDraftState } from '@/navigation-menu-item/common/states/navigationMenuItemsDraftState';
-import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
-import { type View } from '@/views/types/View';
-
-export const useUpdateViewInDraft = () => {
- const setNavigationMenuItemsDraft = useSetAtomState(
- navigationMenuItemsDraftState,
- );
-
- const updateViewInDraft = (navigationMenuItemId: string, view: View) => {
- setNavigationMenuItemsDraft((draft) => {
- if (!draft) return draft;
-
- return draft.map((item) =>
- item.id === navigationMenuItemId
- ? {
- ...item,
- viewId: view.id,
- targetObjectMetadataId: undefined,
- targetRecordId: undefined,
- }
- : item,
- );
- });
- };
-
- return { updateViewInDraft };
-};
diff --git a/packages/twenty-front/src/modules/navigation/components/NavigationDrawerOtherSection.tsx b/packages/twenty-front/src/modules/navigation/components/NavigationDrawerOtherSection.tsx
deleted file mode 100644
index 2be2bfc1e40..00000000000
--- a/packages/twenty-front/src/modules/navigation/components/NavigationDrawerOtherSection.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { useLingui } from '@lingui/react/macro';
-import { SettingsPath } from 'twenty-shared/types';
-import { IconHelpCircle, IconSettings } from 'twenty-ui/icon';
-import { AnimatedExpandableContainer } from 'twenty-ui/layout';
-
-import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
-import { getDocumentationUrl } from '@/support/utils/getDocumentationUrl';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-
-import { NavigationDrawerAnimatedCollapseWrapper } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerAnimatedCollapseWrapper';
-import { NavigationDrawerItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';
-import { NavigationDrawerSection } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSection';
-import { NavigationDrawerSectionTitle } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle';
-import { useNavigationSection } from '@/ui/navigation/navigation-drawer/hooks/useNavigationSection';
-import { isNavigationSectionOpenFamilyState } from '@/ui/navigation/navigation-drawer/states/isNavigationSectionOpenFamilyState';
-import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
-import { useNavigateSettings } from '~/hooks/useNavigateSettings';
-
-export const NavigationDrawerOtherSection = () => {
- const { t } = useLingui();
- const navigateSettings = useNavigateSettings();
- const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
-
- const { toggleNavigationSection } = useNavigationSection('Other');
- const isNavigationSectionOpen = useAtomFamilyStateValue(
- isNavigationSectionOpenFamilyState,
- 'Other',
- );
-
- const handleSettingsClick = () => {
- navigateSettings(SettingsPath.ProfilePage);
- };
-
- return (
- <NavigationDrawerSection>
- <NavigationDrawerAnimatedCollapseWrapper>
- <NavigationDrawerSectionTitle
- label={t`Other`}
- onClick={toggleNavigationSection}
- isOpen={isNavigationSectionOpen}
- />
- </NavigationDrawerAnimatedCollapseWrapper>
- <AnimatedExpandableContainer
- isExpanded={isNavigationSectionOpen}
- dimension="height"
- mode="fit-content"
- containAnimation
- initial={false}
- >
- <NavigationDrawerItem
- label={t`Settings`}
- Icon={IconSettings}
- onClick={handleSettingsClick}
- />
- <NavigationDrawerItem
- label={t`Documentation`}
- to={getDocumentationUrl({
- locale: currentWorkspaceMember?.locale,
- })}
- Icon={IconHelpCircle}
- />
- </AnimatedExpandableContainer>
- </NavigationDrawerSection>
- );
-};
diff --git a/packages/twenty-front/src/modules/navigation/utils/indexAppPath.ts b/packages/twenty-front/src/modules/navigation/utils/indexAppPath.ts
deleted file mode 100644
index b6a3af05a33..00000000000
--- a/packages/twenty-front/src/modules/navigation/utils/indexAppPath.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { AppPath } from 'twenty-shared/types';
-
-const getIndexAppPath = () => {
- return AppPath.Index;
-};
-
-// This file is using the default export pattern to be compatible
-// with the way it is imported in the tests.
-// Otherwise we cannot mock it: https://github.com/jestjs/jest/issues/12145 as we are using ES native modules
-// TBH: I am not a big fan of this pattern, alternatively we could set a global variable or a global state
-// to store the value
-export default { getIndexAppPath };
diff --git a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerSectionForObjectMetadataItemsSkeletonLoader.tsx b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerSectionForObjectMetadataItemsSkeletonLoader.tsx
deleted file mode 100644
index 2c91682daa6..00000000000
--- a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerSectionForObjectMetadataItemsSkeletonLoader.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
-import { css } from '@linaria/core';
-import { styled } from '@linaria/react';
-import { useContext } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
-
-const StyledSkeletonColumn = styled.div`
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- gap: ${themeCssVariables.spacing[1]};
- height: 76px;
- padding-left: ${themeCssVariables.spacing[1]};
- width: 100%;
-`;
-
-const fillSkeletonContainer = css`
- display: block;
- width: 100%;
-`;
-
-export const NavigationDrawerSectionForObjectMetadataItemsSkeletonLoader: React.FC =
- () => {
- const { theme } = useContext(ThemeContext);
- return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.light}
- borderRadius={4}
- >
- <StyledSkeletonColumn>
- <Skeleton
- containerClassName={fillSkeletonContainer}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- <Skeleton
- containerClassName={fillSkeletonContainer}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- <Skeleton
- containerClassName={fillSkeletonContainer}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </StyledSkeletonColumn>
- </SkeletonTheme>
- );
- };
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useGetObjectRecordIdentifierByNameSingular.test.tsx b/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useGetObjectRecordIdentifierByNameSingular.test.tsx
deleted file mode 100644
index 954d3f3c1b6..00000000000
--- a/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useGetObjectRecordIdentifierByNameSingular.test.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-import { renderHook } from '@testing-library/react';
-import { Provider as JotaiProvider } from 'jotai';
-
-import { useGetObjectRecordIdentifierByNameSingular } from '@/object-metadata/hooks/useGetObjectRecordIdentifierByNameSingular';
-import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
-import { setTestObjectMetadataItemsInMetadataStore } from '~/testing/utils/setTestObjectMetadataItemsInMetadataStore';
-import { getTestEnrichedObjectMetadataItemsMock } from '~/testing/utils/getTestEnrichedObjectMetadataItemsMock';
-
-const Wrapper = ({ children }: { children: React.ReactNode }) => (
- <JotaiProvider store={jotaiStore}>{children}</JotaiProvider>
-);
-
-describe('useGetObjectRecordIdentifierByNameSingular', () => {
- beforeEach(() => {
- setTestObjectMetadataItemsInMetadataStore(
- jotaiStore,
- getTestEnrichedObjectMetadataItemsMock(),
- );
- });
-
- it('should work as expected', async () => {
- const { result, rerender } = renderHook(
- ({
- record,
- objectNameSingular,
- }: {
- record: any;
- objectNameSingular: string;
- }) => {
- return useGetObjectRecordIdentifierByNameSingular(true)(
- record,
- objectNameSingular,
- );
- },
- {
- wrapper: Wrapper,
- initialProps: {
- record: { id: 'recordId' } as any,
- objectNameSingular: 'blocklist',
- },
- },
- );
-
- expect(result.current.linkToShowPage).toBe('/object/blocklist/recordId');
-
- rerender({
- record: { id: 'recordId', avatarUrl: 'https://fake-url.com' },
- objectNameSingular: 'opportunity',
- });
-
- expect(result.current.linkToShowPage).toBe('/object/opportunity/recordId');
-
- rerender({
- record: {
- id: 'recordId',
- name: { firstName: 'John', lastName: 'Connor' },
- },
- objectNameSingular: 'person',
- });
-
- expect(result.current.linkToShowPage).toBe('/object/person/recordId');
- expect(result.current.name).toBe('John Connor');
- expect(result.current.avatarType).toBe('rounded');
-
- rerender({
- record: {
- id: 'recordId',
- domainName: { primaryLinkUrl: 'https://cool-company.com' },
- },
- objectNameSingular: 'company',
- });
-
- expect(result.current.linkToShowPage).toBe('/object/company/recordId');
- expect(result.current.avatarUrl).toBe(
- 'https://twenty-icons.com/cool-company.com',
- );
- expect(result.current.avatarType).toBe('squared');
- });
-});
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useAvailableFieldMetadataItems.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useAvailableFieldMetadataItems.ts
deleted file mode 100644
index fd23ad354b8..00000000000
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useAvailableFieldMetadataItems.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMetadataItemById';
-import { isHiddenSystemField } from '@/object-metadata/utils/isHiddenSystemField';
-import { TABLE_COLUMNS_DENY_LIST } from '@/object-record/constants/TableColumnsDenyList';
-import { useMemo } from 'react';
-
-export const useAvailableFieldMetadataItems = ({
- objectMetadataItemId,
-}: {
- objectMetadataItemId: string;
-}) => {
- const { objectMetadataItem } = useObjectMetadataItemById({
- objectId: objectMetadataItemId,
- });
-
- const availableFieldMetadataItems = useMemo(
- () =>
- objectMetadataItem.readableFields.filter((fieldMetadataItemToFilter) => {
- return (
- fieldMetadataItemToFilter.isActive &&
- !isHiddenSystemField(fieldMetadataItemToFilter) &&
- !TABLE_COLUMNS_DENY_LIST.includes(fieldMetadataItemToFilter.name)
- );
- }),
- [objectMetadataItem],
- );
-
- return { availableFieldMetadataItems };
-};
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useGetObjectMetadataItemById.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useGetObjectMetadataItemById.ts
deleted file mode 100644
index cf6f815dc56..00000000000
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useGetObjectMetadataItemById.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { CustomError, isDefined } from 'twenty-shared/utils';
-
-export const useGetObjectMetadataItemById = () => {
- const objectMetadataItems = useAtomStateValue(objectMetadataItemsSelector);
-
- const getObjectMetadataItemById = (objectId: string) => {
- const objectMetadataItem = objectMetadataItems.find(
- (objectMetadataItem) => objectMetadataItem.id === objectId,
- );
-
- if (!isDefined(objectMetadataItem)) {
- throw new CustomError(
- `Object metadata item not found for id ${objectId}`,
- 'OBJECT_METADATA_ITEM_NOT_FOUND',
- );
- }
-
- return objectMetadataItem;
- };
-
- return {
- getObjectMetadataItemById,
- };
-};
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useGetObjectRecordIdentifierByNameSingular.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useGetObjectRecordIdentifierByNameSingular.ts
deleted file mode 100644
index 3d7263977b9..00000000000
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useGetObjectRecordIdentifierByNameSingular.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { getObjectRecordIdentifier } from '@/object-metadata/utils/getObjectRecordIdentifier';
-import { type ObjectRecordIdentifier } from '@/object-record/types/ObjectRecordIdentifier';
-
-export const useGetObjectRecordIdentifierByNameSingular = (
- allowRequestsToTwentyIcons: boolean,
-) => {
- const objectMetadataItems = useAtomStateValue(objectMetadataItemsSelector);
-
- return (record: any, objectNameSingular: string): ObjectRecordIdentifier => {
- const objectMetadataItem = objectMetadataItems.find(
- (item) => item.nameSingular === objectNameSingular,
- );
-
- if (!objectMetadataItem) {
- throw new Error(
- `Object metadata not found for objectNameSingular: ${objectNameSingular}`,
- );
- }
-
- return getObjectRecordIdentifier({
- objectMetadataItem,
- record,
- allowRequestsToTwentyIcons,
- });
- };
-};
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useOrderByFieldPerMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useOrderByFieldPerMetadataItem.ts
deleted file mode 100644
index 11ab74a1522..00000000000
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useOrderByFieldPerMetadataItem.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { getOrderByFieldForObjectMetadataItem } from '@/object-metadata/utils/getObjectOrderByField';
-import { capitalize, isDefined } from 'twenty-shared/utils';
-
-export const useOrderByFieldPerMetadataItem = ({
- objectMetadataItems,
-}: {
- objectMetadataItems: EnrichedObjectMetadataItem[];
-}) => {
- const orderByFieldPerMetadataItem = Object.fromEntries(
- objectMetadataItems
- .map((objectMetadataItem) => {
- const orderByField =
- getOrderByFieldForObjectMetadataItem(objectMetadataItem);
-
- return [
- `orderBy${capitalize(objectMetadataItem.nameSingular)}`,
- [...orderByField],
- ];
- })
- .filter(isDefined),
- );
-
- return {
- orderByFieldPerMetadataItem,
- };
-};
diff --git a/packages/twenty-front/src/modules/object-metadata/states/activeObjectNameSingularsSelector.ts b/packages/twenty-front/src/modules/object-metadata/states/activeObjectNameSingularsSelector.ts
deleted file mode 100644
index 45f1cd2341d..00000000000
--- a/packages/twenty-front/src/modules/object-metadata/states/activeObjectNameSingularsSelector.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { flatObjectMetadataItemsSelector } from '@/object-metadata/states/flatObjectMetadataItemsSelector';
-import { createAtomSelector } from '@/ui/utilities/state/jotai/utils/createAtomSelector';
-
-export const activeObjectNameSingularsSelector = createAtomSelector<string[]>({
- key: 'activeObjectNameSingularsSelector',
- get: ({ get }) => {
- const flatObjects = get(flatObjectMetadataItemsSelector);
-
- return flatObjects
- .filter((flatObject) => flatObject.isActive)
- .map((flatObject) => flatObject.nameSingular);
- },
-});
diff --git a/packages/twenty-front/src/modules/object-metadata/states/flattenedReadableFieldMetadataItemIdsSelector.ts b/packages/twenty-front/src/modules/object-metadata/states/flattenedReadableFieldMetadataItemIdsSelector.ts
deleted file mode 100644
index 08ca20a02bd..00000000000
--- a/packages/twenty-front/src/modules/object-metadata/states/flattenedReadableFieldMetadataItemIdsSelector.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { objectMetadataItemsWithFieldsSelector } from '@/object-metadata/states/objectMetadataItemsWithFieldsSelector';
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-import { createAtomSelector } from '@/ui/utilities/state/jotai/utils/createAtomSelector';
-
-export const flattenedReadableFieldMetadataItemsSelector = createAtomSelector<
- FieldMetadataItem[]
->({
- key: 'flattenedReadableFieldMetadataItemsSelector',
- get: ({ get }) => {
- const objectMetadataItems = get(objectMetadataItemsWithFieldsSelector);
-
- return objectMetadataItems.flatMap(
- (objectMetadataItem) => objectMetadataItem.readableFields,
- );
- },
-});
diff --git a/packages/twenty-front/src/modules/object-metadata/states/isSystemObjectByNameSingularFamilySelector.ts b/packages/twenty-front/src/modules/object-metadata/states/isSystemObjectByNameSingularFamilySelector.ts
deleted file mode 100644
index 226c4f07bc3..00000000000
--- a/packages/twenty-front/src/modules/object-metadata/states/isSystemObjectByNameSingularFamilySelector.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { flatObjectMetadataItemsSelector } from '@/object-metadata/states/flatObjectMetadataItemsSelector';
-import { createAtomFamilySelector } from '@/ui/utilities/state/jotai/utils/createAtomFamilySelector';
-
-export const isSystemObjectByNameSingularFamilySelector =
- createAtomFamilySelector<boolean, string>({
- key: 'isSystemObjectByNameSingularFamilySelector',
- get:
- (nameSingular: string) =>
- ({ get }) => {
- const flatObjects = get(flatObjectMetadataItemsSelector);
-
- return (
- flatObjects.find(
- (flatObject) => flatObject.nameSingular === nameSingular,
- )?.isSystem ?? false
- );
- },
- });
diff --git a/packages/twenty-front/src/modules/object-metadata/types/QueryMethodName.ts b/packages/twenty-front/src/modules/object-metadata/types/QueryMethodName.ts
deleted file mode 100644
index 851dcffc08d..00000000000
--- a/packages/twenty-front/src/modules/object-metadata/types/QueryMethodName.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export enum QueryMethodName {
- FindOne = 'findOne',
- FindMany = 'findMany',
-}
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterDropdownNumberInput.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterDropdownNumberInput.tsx
deleted file mode 100644
index cb8fd3d877d..00000000000
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterDropdownNumberInput.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { useApplyObjectFilterDropdownFilterValue } from '@/object-record/object-filter-dropdown/hooks/useApplyObjectFilterDropdownFilterValue';
-import { useObjectFilterDropdownFilterValue } from '@/object-record/object-filter-dropdown/hooks/useObjectFilterDropdownFilterValue';
-import { fieldMetadataItemUsedInDropdownComponentSelector } from '@/object-record/object-filter-dropdown/states/fieldMetadataItemUsedInDropdownComponentSelector';
-import { selectedOperandInDropdownComponentState } from '@/object-record/object-filter-dropdown/states/selectedOperandInDropdownComponentState';
-import { TextInput } from '@/ui/input/components/TextInput';
-import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
-import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { t } from '@lingui/core/macro';
-
-export const AdvancedFilterDropdownNumberInput = () => {
- const selectedOperandInDropdown = useAtomComponentStateValue(
- selectedOperandInDropdownComponentState,
- );
-
- const fieldMetadataItemUsedInDropdown = useAtomComponentSelectorValue(
- fieldMetadataItemUsedInDropdownComponentSelector,
- );
-
- const { objectFilterDropdownFilterValue } =
- useObjectFilterDropdownFilterValue();
-
- const { applyObjectFilterDropdownFilterValue } =
- useApplyObjectFilterDropdownFilterValue();
-
- const handleChange = (newValue: string) => {
- applyObjectFilterDropdownFilterValue(newValue);
- };
-
- if (!selectedOperandInDropdown || !fieldMetadataItemUsedInDropdown) {
- return null;
- }
-
- return (
- <TextInput
- value={objectFilterDropdownFilterValue}
- onChange={handleChange}
- placeholder={t`Enter value`}
- fullWidth
- type="number"
- />
- );
-};
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/utils/isRecordFilterGroupChildARecordFilter.ts b/packages/twenty-front/src/modules/object-record/advanced-filter/utils/isRecordFilterGroupChildARecordFilter.ts
deleted file mode 100644
index 9710e66af3a..00000000000
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/utils/isRecordFilterGroupChildARecordFilter.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { type RecordFilterGroup } from '@/object-record/record-filter-group/types/RecordFilterGroup';
-import { type RecordFilter } from '@/object-record/record-filter/types/RecordFilter';
-
-export const isRecordFilterGroupChildARecordFilter = (
- child: RecordFilter | RecordFilterGroup,
-): child is RecordFilter => {
- return ('fieldMetadataId' satisfies keyof RecordFilter) in child;
-};
diff --git a/packages/twenty-front/src/modules/object-record/cache/hooks/useCreateManyRecordsInCache.ts b/packages/twenty-front/src/modules/object-record/cache/hooks/useCreateManyRecordsInCache.ts
deleted file mode 100644
index 25244705928..00000000000
--- a/packages/twenty-front/src/modules/object-record/cache/hooks/useCreateManyRecordsInCache.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
-import { type ObjectMetadataItemIdentifier } from '@/object-metadata/types/ObjectMetadataItemIdentifier';
-import { useCreateOneRecordInCache } from '@/object-record/cache/hooks/useCreateOneRecordInCache';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-import { prefillRecord } from '@/object-record/utils/prefillRecord';
-import { isDefined } from 'twenty-shared/utils';
-
-export const useCreateManyRecordsInCache = <T extends ObjectRecord>({
- objectNameSingular,
-}: ObjectMetadataItemIdentifier) => {
- const { objectMetadataItem } = useObjectMetadataItem({
- objectNameSingular,
- });
-
- const createOneRecordInCache = useCreateOneRecordInCache({
- objectMetadataItem,
- });
-
- const createManyRecordsInCache = (recordsToCreate: Partial<T>[]) => {
- const recordsWithId = recordsToCreate
- .map((record) => {
- return prefillRecord<T>({
- input: record,
- objectMetadataItem,
- });
- })
- .filter(isDefined);
-
- const createdRecordsInCache = [] as T[];
-
- for (const record of recordsWithId) {
- if (isDefined(record)) {
- createOneRecordInCache(record);
- createdRecordsInCache.push(record);
- }
- }
-
- return createdRecordsInCache;
- };
-
- return { createManyRecordsInCache };
-};
diff --git a/packages/twenty-front/src/modules/object-record/cache/hooks/useDeleteRecordFromCache.ts b/packages/twenty-front/src/modules/object-record/cache/hooks/useDeleteRecordFromCache.ts
deleted file mode 100644
index e48c75f2b42..00000000000
--- a/packages/twenty-front/src/modules/object-record/cache/hooks/useDeleteRecordFromCache.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
-import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
-import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
-import { deleteRecordFromCache } from '@/object-record/cache/utils/deleteRecordFromCache';
-import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions';
-import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-
-export const useDeleteRecordFromCache = ({
- objectNameSingular,
-}: {
- objectNameSingular: string;
-}) => {
- const apolloCoreClient = useApolloCoreClient();
- const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
-
- const { objectMetadataItem } = useObjectMetadataItem({
- objectNameSingular,
- });
- const { upsertRecordsInStore } = useUpsertRecordsInStore();
- const { objectMetadataItems } = useObjectMetadataItems();
-
- return (recordToDestroy: ObjectRecord) => {
- deleteRecordFromCache({
- objectMetadataItem,
- objectMetadataItems,
- recordToDestroy,
- cache: apolloCoreClient.cache,
- upsertRecordsInStore,
- objectPermissionsByObjectMetadataId,
- });
- };
-};
diff --git a/packages/twenty-front/src/modules/object-record/cache/hooks/useReadFindManyRecordsQueryInCache.ts b/packages/twenty-front/src/modules/object-record/cache/hooks/useReadFindManyRecordsQueryInCache.ts
deleted file mode 100644
index bb7f9ee37a7..00000000000
--- a/packages/twenty-front/src/modules/object-record/cache/hooks/useReadFindManyRecordsQueryInCache.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
-import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { getRecordsFromRecordConnection } from '@/object-record/cache/utils/getRecordsFromRecordConnection';
-import { type RecordGqlOperationFindManyResult } from '@/object-record/graphql/types/RecordGqlOperationFindManyResult';
-import { type RecordGqlOperationVariables } from 'twenty-shared/types';
-import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-import { generateFindManyRecordsQuery } from '@/object-record/utils/generateFindManyRecordsQuery';
-import { isDefined } from 'twenty-shared/utils';
-
-export const useReadFindManyRecordsQueryInCache = ({
- objectMetadataItem,
-}: {
- objectMetadataItem: EnrichedObjectMetadataItem;
-}) => {
- const apolloCoreClient = useApolloCoreClient();
-
- const { objectMetadataItems } = useObjectMetadataItems();
-
- const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
-
- const readFindManyRecordsQueryInCache = <
- T extends ObjectRecord = ObjectRecord,
- >({
- queryVariables,
- recordGqlFields,
- }: {
- queryVariables: RecordGqlOperationVariables;
- recordGqlFields?: Record<string, any>;
- }) => {
- const findManyRecordsQueryForCacheRead = generateFindManyRecordsQuery({
- objectMetadataItem,
- objectMetadataItems,
- recordGqlFields,
- objectPermissionsByObjectMetadataId,
- });
-
- const existingRecordsQueryResult =
- apolloCoreClient.readQuery<RecordGqlOperationFindManyResult>({
- query: findManyRecordsQueryForCacheRead,
- variables: queryVariables,
- });
-
- const existingRecordConnection =
- existingRecordsQueryResult?.[objectMetadataItem.namePlural];
-
- const existingObjectRecords = isDefined(existingRecordConnection)
- ? getRecordsFromRecordConnection<T>({
- recordConnection: existingRecordConnection,
- })
- : [];
-
- return existingObjectRecords;
- };
-
- return {
- readFindManyRecordsQueryInCache,
- };
-};
diff --git a/packages/twenty-front/src/modules/object-record/cache/types/ObjectPermissions.ts b/packages/twenty-front/src/modules/object-record/cache/types/ObjectPermissions.ts
deleted file mode 100644
index efcb142df4f..00000000000
--- a/packages/twenty-front/src/modules/object-record/cache/types/ObjectPermissions.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { type ObjectPermission } from '~/generated-metadata/graphql';
-
-export type ObjectPermissions = {
- [K in keyof Omit<
- ObjectPermission,
- 'objectMetadataId' | '__typename'
- >]-?: boolean;
-};
diff --git a/packages/twenty-front/src/modules/object-record/graphql/types/RecordGqlOperationFindOneResult.ts b/packages/twenty-front/src/modules/object-record/graphql/types/RecordGqlOperationFindOneResult.ts
deleted file mode 100644
index 412c85c6b88..00000000000
--- a/packages/twenty-front/src/modules/object-record/graphql/types/RecordGqlOperationFindOneResult.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { type RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
-
-export type RecordGqlOperationFindOneResult = {
- [objectNameSingular: string]: RecordGqlNode;
-};
diff --git a/packages/twenty-front/src/modules/object-record/graphql/types/RecordGqlOperationSearchResult.ts b/packages/twenty-front/src/modules/object-record/graphql/types/RecordGqlOperationSearchResult.ts
deleted file mode 100644
index 8f0ffb23b2e..00000000000
--- a/packages/twenty-front/src/modules/object-record/graphql/types/RecordGqlOperationSearchResult.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { type RecordGqlConnectionEdgesRequired } from '@/object-record/graphql/types/RecordGqlConnectionEdgesRequired';
-
-export type RecordGqlOperationSearchResult = {
- [objectNamePlural: string]: RecordGqlConnectionEdgesRequired;
-};
diff --git a/packages/twenty-front/src/modules/object-record/hooks/useDestroyManyRecords.ts b/packages/twenty-front/src/modules/object-record/hooks/useDestroyManyRecords.ts
deleted file mode 100644
index 759ab7f4685..00000000000
--- a/packages/twenty-front/src/modules/object-record/hooks/useDestroyManyRecords.ts
+++ /dev/null
@@ -1,163 +0,0 @@
-import { triggerCreateRecordsOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerCreateRecordsOptimisticEffect';
-import { triggerDestroyRecordsOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerDestroyRecordsOptimisticEffect';
-import { dispatchObjectRecordOperationBrowserEvent } from '@/browser-event/utils/dispatchObjectRecordOperationBrowserEvent';
-import { apiConfigState } from '@/client-config/states/apiConfigState';
-import { useRemoveNavigationMenuItemByTargetRecordId } from '@/navigation-menu-item/common/hooks/useRemoveNavigationMenuItemByTargetRecordId';
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
-import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
-import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
-import { useGetRecordFromCache } from '@/object-record/cache/hooks/useGetRecordFromCache';
-import { DEFAULT_MUTATION_BATCH_SIZE } from '@/object-record/constants/DefaultMutationBatchSize';
-import { useDestroyManyRecordsMutation } from '@/object-record/hooks/useDestroyManyRecordsMutation';
-import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions';
-import { useRefetchAggregateQueries } from '@/object-record/hooks/useRefetchAggregateQueries';
-import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-import { getDestroyManyRecordsMutationResponseField } from '@/object-record/utils/getDestroyManyRecordsMutationResponseField';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { capitalize, isDefined } from 'twenty-shared/utils';
-import { sleep } from '~/utils/sleep';
-
-type useDestroyManyRecordProps = {
- objectNameSingular: string;
- refetchFindManyQuery?: boolean;
-};
-
-export type DestroyManyRecordsProps = {
- recordIdsToDestroy: string[];
- skipOptimisticEffect?: boolean;
- delayInMsBetweenRequests?: number;
-};
-
-export const useDestroyManyRecords = ({
- objectNameSingular,
-}: useDestroyManyRecordProps) => {
- const { upsertRecordsInStore } = useUpsertRecordsInStore();
- const apiConfig = useAtomStateValue(apiConfigState);
-
- const mutationPageSize =
- apiConfig?.mutationMaximumAffectedRecords ?? DEFAULT_MUTATION_BATCH_SIZE;
-
- const apolloCoreClient = useApolloCoreClient();
-
- const { objectMetadataItem } = useObjectMetadataItem({
- objectNameSingular,
- });
-
- const getRecordFromCache = useGetRecordFromCache({ objectNameSingular });
-
- const { destroyManyRecordsMutation } = useDestroyManyRecordsMutation({
- objectNameSingular,
- });
-
- const { objectMetadataItems } = useObjectMetadataItems();
- const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
- const { refetchAggregateQueries } = useRefetchAggregateQueries();
- const { removeNavigationMenuItemsByTargetRecordIds } =
- useRemoveNavigationMenuItemByTargetRecordId();
-
- const mutationResponseField = getDestroyManyRecordsMutationResponseField(
- objectMetadataItem.namePlural,
- );
-
- const destroyManyRecords = async ({
- recordIdsToDestroy,
- delayInMsBetweenRequests,
- skipOptimisticEffect = false,
- }: DestroyManyRecordsProps) => {
- const numberOfBatches = Math.ceil(
- recordIdsToDestroy.length / mutationPageSize,
- );
-
- const destroyedRecords = [];
-
- for (let batchIndex = 0; batchIndex < numberOfBatches; batchIndex++) {
- const batchedIdToDestroy = recordIdsToDestroy.slice(
- batchIndex * mutationPageSize,
- (batchIndex + 1) * mutationPageSize,
- );
-
- const cachedRecords = batchedIdToDestroy
- .map((recordId) => getRecordFromCache(recordId, apolloCoreClient.cache))
- .filter(isDefined);
-
- const destroyedRecordsResponse = await apolloCoreClient
- .mutate<Record<string, ObjectRecord[]>>({
- mutation: destroyManyRecordsMutation,
- variables: {
- filter: { id: { in: batchedIdToDestroy } },
- },
- optimisticResponse: skipOptimisticEffect
- ? undefined
- : {
- [mutationResponseField]: batchedIdToDestroy.map(
- (idToDestroy) => ({
- __typename: capitalize(objectNameSingular),
- id: idToDestroy,
- }),
- ),
- },
- update: (cache, { data }) => {
- if (skipOptimisticEffect) {
- return;
- }
- const records = data?.[mutationResponseField];
-
- if (!isDefined(records) || records.length === 0) return;
-
- const cachedRecords = records
- .map((record) => getRecordFromCache(record.id, cache))
- .filter(isDefined);
-
- triggerDestroyRecordsOptimisticEffect({
- cache,
- objectMetadataItem,
- recordsToDestroy: cachedRecords,
- objectMetadataItems,
- upsertRecordsInStore,
- objectPermissionsByObjectMetadataId,
- });
- },
- })
- .catch((error: Error) => {
- if (cachedRecords.length > 0 && !skipOptimisticEffect) {
- triggerCreateRecordsOptimisticEffect({
- cache: apolloCoreClient.cache,
- objectMetadataItem,
- recordsToCreate: cachedRecords,
- objectMetadataItems,
- objectPermissionsByObjectMetadataId,
- upsertRecordsInStore,
- });
- }
- throw error;
- });
-
- const destroyedRecordsForThisBatch =
- destroyedRecordsResponse.data?.[mutationResponseField] ?? [];
-
- destroyedRecords.push(...destroyedRecordsForThisBatch);
-
- if (isDefined(delayInMsBetweenRequests)) {
- await sleep(delayInMsBetweenRequests);
- }
- }
-
- await refetchAggregateQueries({
- objectMetadataNamePlural: objectMetadataItem.namePlural,
- });
-
- removeNavigationMenuItemsByTargetRecordIds(recordIdsToDestroy);
-
- dispatchObjectRecordOperationBrowserEvent({
- objectMetadataItem,
- operation: {
- type: 'destroy-many',
- },
- });
-
- return destroyedRecords;
- };
-
- return { destroyManyRecords };
-};
diff --git a/packages/twenty-front/src/modules/object-record/multiple-objects/utils/getLimitPerMetadataItem.ts b/packages/twenty-front/src/modules/object-record/multiple-objects/utils/getLimitPerMetadataItem.ts
deleted file mode 100644
index 99adfadee74..00000000000
--- a/packages/twenty-front/src/modules/object-record/multiple-objects/utils/getLimitPerMetadataItem.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { capitalize } from 'twenty-shared/utils';
-
-export const getLimitPerMetadataItem = (
- objectMetadataItems: Pick<EnrichedObjectMetadataItem, 'nameSingular'>[],
- limit: number,
-) => {
- return Object.fromEntries(
- objectMetadataItems.map(({ nameSingular }) => {
- return [`limit${capitalize(nameSingular)}`, limit];
- }),
- );
-};
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownFilterInputHeader.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownFilterInputHeader.tsx
deleted file mode 100644
index b3bd16435fa..00000000000
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownFilterInputHeader.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { fieldMetadataItemUsedInDropdownComponentSelector } from '@/object-record/object-filter-dropdown/states/fieldMetadataItemUsedInDropdownComponentSelector';
-import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';
-import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';
-import { DropdownComponentInstanceContext } from '@/ui/layout/dropdown/contexts/DropdownComponentInstanceContext';
-import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
-import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
-import { ViewBarFilterDropdownFilterInputMenuHeader } from '@/views/components/ViewBarFilterDropdownFilterInputMenuHeader';
-import { ViewBarFilterDropdownIds } from '@/views/constants/ViewBarFilterDropdownIds';
-import { useContext } from 'react';
-import { IconX } from 'twenty-ui/icon';
-
-// TODO: we shouldn't guess in which parent we are, this should be splitted in two components, one for each case
-export const ObjectFilterDropdownFilterInputHeader = () => {
- const fieldMetadataItemUsedInDropdown = useAtomComponentSelectorValue(
- fieldMetadataItemUsedInDropdownComponentSelector,
- );
-
- const { closeDropdown } = useCloseDropdown();
-
- const dropdownInstanceId = useContext(
- DropdownComponentInstanceContext,
- )?.instanceId;
-
- const isInViewBarFilterDropdown =
- dropdownInstanceId === ViewBarFilterDropdownIds.MAIN;
-
- if (isInViewBarFilterDropdown) {
- return <ViewBarFilterDropdownFilterInputMenuHeader />;
- } else {
- return (
- <DropdownMenuHeader
- StartComponent={
- <DropdownMenuHeaderLeftComponent
- onClick={() => closeDropdown(dropdownInstanceId)}
- Icon={IconX}
- />
- }
- >
- {fieldMetadataItemUsedInDropdown?.label}
- </DropdownMenuHeader>
- );
- }
-};
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/constants/DateOperandsThatShouldBeInitializedWithNow.ts b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/constants/DateOperandsThatShouldBeInitializedWithNow.ts
deleted file mode 100644
index 63e34c6fe74..00000000000
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/constants/DateOperandsThatShouldBeInitializedWithNow.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { RecordFilterOperand } from '@/object-record/record-filter/types/RecordFilterOperand';
-
-export const DATE_OPERANDS_THAT_SHOULD_BE_INITIALIZED_WITH_NOW: RecordFilterOperand[] =
- [
- RecordFilterOperand.IS,
- RecordFilterOperand.IS_NOT,
- RecordFilterOperand.IS_AFTER,
- RecordFilterOperand.IS_BEFORE,
- ];
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/hooks/useEmptyRecordFilter.ts b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/hooks/useEmptyRecordFilter.ts
deleted file mode 100644
index 6d2d7683d02..00000000000
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/hooks/useEmptyRecordFilter.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { useCallback } from 'react';
-
-import { objectFilterDropdownCurrentRecordFilterComponentState } from '@/object-record/object-filter-dropdown/states/objectFilterDropdownCurrentRecordFilterComponentState';
-import { objectFilterDropdownSearchInputComponentState } from '@/object-record/object-filter-dropdown/states/objectFilterDropdownSearchInputComponentState';
-import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
-import { useStore } from 'jotai';
-
-export const useEmptyRecordFilter = (componentInstanceId?: string) => {
- const store = useStore();
- const objectFilterDropdownSearchInput = useAtomComponentStateCallbackState(
- objectFilterDropdownSearchInputComponentState,
- componentInstanceId,
- );
-
- const objectFilterDropdownCurrentRecordFilter =
- useAtomComponentStateCallbackState(
- objectFilterDropdownCurrentRecordFilterComponentState,
- componentInstanceId,
- );
-
- const emptyRecordFilter = useCallback(() => {
- store.set(objectFilterDropdownSearchInput, '');
- store.set(objectFilterDropdownCurrentRecordFilter, undefined);
- }, [
- objectFilterDropdownSearchInput,
- objectFilterDropdownCurrentRecordFilter,
- store,
- ]);
-
- return {
- emptyRecordFilter,
- };
-};
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/states/isObjectFilterDropdownOperandSelectUnfoldedComponentState.ts b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/states/isObjectFilterDropdownOperandSelectUnfoldedComponentState.ts
deleted file mode 100644
index f9359d3f110..00000000000
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/states/isObjectFilterDropdownOperandSelectUnfoldedComponentState.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { ObjectFilterDropdownComponentInstanceContext } from '@/object-record/object-filter-dropdown/states/contexts/ObjectFilterDropdownComponentInstanceContext';
-import { createAtomComponentState } from '@/ui/utilities/state/jotai/utils/createAtomComponentState';
-
-export const isObjectFilterDropdownOperandSelectUnfoldedComponentState =
- createAtomComponentState<boolean>({
- key: 'isObjectFilterDropdownOperandSelectUnfoldedComponentState',
- defaultValue: false,
- componentInstanceContext: ObjectFilterDropdownComponentInstanceContext,
- });
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/states/isObjectFilterDropdownUnfoldedComponentState.ts b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/states/isObjectFilterDropdownUnfoldedComponentState.ts
deleted file mode 100644
index 77caf667476..00000000000
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/states/isObjectFilterDropdownUnfoldedComponentState.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { ObjectFilterDropdownComponentInstanceContext } from '@/object-record/object-filter-dropdown/states/contexts/ObjectFilterDropdownComponentInstanceContext';
-import { createAtomComponentState } from '@/ui/utilities/state/jotai/utils/createAtomComponentState';
-
-export const isObjectFilterDropdownUnfoldedComponentState =
- createAtomComponentState<boolean>({
- key: 'isObjectFilterDropdownUnfoldedComponentState',
- defaultValue: false,
- componentInstanceContext: ObjectFilterDropdownComponentInstanceContext,
- });
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/states/objectFilterDropdownSelectedOptionValuesComponentState.ts b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/states/objectFilterDropdownSelectedOptionValuesComponentState.ts
deleted file mode 100644
index c07b571c9c1..00000000000
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/states/objectFilterDropdownSelectedOptionValuesComponentState.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { ObjectFilterDropdownComponentInstanceContext } from '@/object-record/object-filter-dropdown/states/contexts/ObjectFilterDropdownComponentInstanceContext';
-import { createAtomComponentState } from '@/ui/utilities/state/jotai/utils/createAtomComponentState';
-
-export const objectFilterDropdownSelectedOptionValuesComponentState =
- createAtomComponentState<string[]>({
- key: 'objectFilterDropdownSelectedOptionValuesComponentState',
- defaultValue: [],
- componentInstanceContext: ObjectFilterDropdownComponentInstanceContext,
- });
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/utils/getSubMenuOptions.ts b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/utils/getSubMenuOptions.ts
deleted file mode 100644
index acf8c04fc54..00000000000
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/utils/getSubMenuOptions.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { type FilterableFieldType } from 'twenty-shared/types';
-
-export const getSubMenuOptions = (subMenu: FilterableFieldType | null) => {
- switch (subMenu) {
- case 'ACTOR':
- return [
- {
- name: 'Creation Source',
- icon: 'IconPlug',
- type: 'SOURCE',
- },
- {
- name: 'Creator Name',
- icon: 'IconId',
- type: 'ACTOR',
- },
- {
- name: 'Workspace Member',
- icon: 'IconUserCircle',
- type: 'WORKSPACE_MEMBER',
- },
- ];
- default:
- return [];
- }
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-board/constants/RecordBoardFocusId.ts b/packages/twenty-front/src/modules/object-record/record-board/constants/RecordBoardFocusId.ts
deleted file mode 100644
index 3b5f6c4d2c1..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-board/constants/RecordBoardFocusId.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const RECORD_BOARD_FOCUS_ID = 'record-board';
diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/constants/AggregateDropdownButtonId.ts b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/constants/AggregateDropdownButtonId.ts
deleted file mode 100644
index 65efa709546..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/constants/AggregateDropdownButtonId.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const AGGREGATE_DROPDOWN_ID = 'aggregate-dropdown-id';
diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/utils/__tests__/buildRecordGqlFieldsAggregateForView.test.ts b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/utils/__tests__/buildRecordGqlFieldsAggregateForView.test.ts
deleted file mode 100644
index d950f37ff2d..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/utils/__tests__/buildRecordGqlFieldsAggregateForView.test.ts
+++ /dev/null
@@ -1,96 +0,0 @@
-import { ObjectOpenRecordIn } from 'twenty-shared/types';
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { buildRecordGqlFieldsAggregateForView } from '@/object-record/record-board/record-board-column/utils/buildRecordGqlFieldsAggregateForView';
-
-import { AggregateOperations } from '@/object-record/record-table/constants/AggregateOperations';
-import { FieldMetadataType } from '~/generated-metadata/graphql';
-
-const MOCK_FIELD_ID = '7d2d7b5e-7b3e-4b4a-8b0a-7b3e4b4a8b0a';
-
-describe('buildRecordGqlFieldsAggregateForView', () => {
- const fields = [
- {
- id: MOCK_FIELD_ID,
- universalIdentifier: MOCK_FIELD_ID,
- name: 'amount',
- type: FieldMetadataType.NUMBER,
- } as FieldMetadataItem,
- {
- id: '06b33746-5293-4d07-9f7f-ebf5ad396064',
- universalIdentifier: '06b33746-5293-4d07-9f7f-ebf5ad396064',
- name: 'name',
- type: FieldMetadataType.TEXT,
- } as FieldMetadataItem,
- {
- id: 'e46b9ba4-144b-4d10-a092-03a7521c8aa0',
- universalIdentifier: 'e46b9ba4-144b-4d10-a092-03a7521c8aa0',
- name: 'createdAt',
- type: FieldMetadataType.DATE_TIME,
- } as FieldMetadataItem,
- ];
-
- const mockObjectMetadata: EnrichedObjectMetadataItem = {
- id: '123',
- universalIdentifier: '123',
- nameSingular: 'opportunity',
- namePlural: 'opportunities',
- labelSingular: 'Opportunity',
- labelPlural: 'Opportunities',
- isActive: true,
- isSystem: false,
- isUIEditable: true,
- isUICreatable: true,
- openRecordIn: ObjectOpenRecordIn.USER_CHOICE,
- isRemote: false,
- isSearchable: false,
- labelIdentifierFieldMetadataId: '06b33746-5293-4d07-9f7f-ebf5ad396064',
- imageIdentifierFieldMetadataId: null,
- isLabelSyncedWithName: true,
- fields,
- readableFields: fields,
- updatableFields: fields,
- indexMetadatas: [],
- searchFieldMetadatas: [],
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- };
-
- const mockFieldMetadataItem = fields[0];
-
- it('should build fields for numeric aggregate', () => {
- const result = buildRecordGqlFieldsAggregateForView({
- objectMetadataItem: mockObjectMetadata,
- recordIndexGroupAggregateFieldMetadataItem: mockFieldMetadataItem,
- recordIndexGroupAggregateOperation: AggregateOperations.SUM,
- });
-
- expect(result).toEqual({
- amount: [AggregateOperations.SUM],
- });
- });
-
- it('should default to count when no field is found', () => {
- const result = buildRecordGqlFieldsAggregateForView({
- objectMetadataItem: mockObjectMetadata,
- recordIndexGroupAggregateFieldMetadataItem: null,
- recordIndexGroupAggregateOperation: AggregateOperations.COUNT,
- });
-
- expect(result).toEqual({
- id: [AggregateOperations.COUNT],
- });
- });
-
- it('should throw error for non-count operation with invalid field', () => {
- expect(() =>
- buildRecordGqlFieldsAggregateForView({
- objectMetadataItem: mockObjectMetadata,
- recordIndexGroupAggregateFieldMetadataItem: null,
- recordIndexGroupAggregateOperation: AggregateOperations.SUM,
- }),
- ).toThrow(
- `No field found to compute aggregate operation ${AggregateOperations.SUM} on object ${mockObjectMetadata.nameSingular}`,
- );
- });
-});
diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/utils/buildRecordGqlFieldsAggregateForView.ts b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/utils/buildRecordGqlFieldsAggregateForView.ts
deleted file mode 100644
index 8481a5a32cf..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/utils/buildRecordGqlFieldsAggregateForView.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { type RecordGqlFieldsAggregate } from '@/object-record/graphql/types/RecordGqlFieldsAggregate';
-
-import { AggregateOperations } from '@/object-record/record-table/constants/AggregateOperations';
-import { type ExtendedAggregateOperations } from '@/object-record/record-table/types/ExtendedAggregateOperations';
-import { FIELD_FOR_TOTAL_COUNT_AGGREGATE_OPERATION } from 'twenty-shared/constants';
-import { type Nullable } from 'twenty-shared/types';
-import { isDefined } from 'twenty-shared/utils';
-
-export const buildRecordGqlFieldsAggregateForView = ({
- objectMetadataItem,
- recordIndexGroupAggregateFieldMetadataItem,
- recordIndexGroupAggregateOperation,
-}: {
- objectMetadataItem: EnrichedObjectMetadataItem;
- recordIndexGroupAggregateFieldMetadataItem: Nullable<FieldMetadataItem>;
- recordIndexGroupAggregateOperation: ExtendedAggregateOperations;
-}): RecordGqlFieldsAggregate => {
- let recordGqlFieldsAggregate = {};
-
- if (!isDefined(recordIndexGroupAggregateFieldMetadataItem)) {
- if (recordIndexGroupAggregateOperation !== AggregateOperations.COUNT) {
- throw new Error(
- `No field found to compute aggregate operation ${recordIndexGroupAggregateOperation} on object ${objectMetadataItem.nameSingular}`,
- );
- } else {
- recordGqlFieldsAggregate = {
- [FIELD_FOR_TOTAL_COUNT_AGGREGATE_OPERATION]: [
- AggregateOperations.COUNT,
- ],
- };
- }
- } else {
- recordGqlFieldsAggregate = {
- [recordIndexGroupAggregateFieldMetadataItem.name]: [
- recordIndexGroupAggregateOperation ?? AggregateOperations.COUNT,
- ],
- };
- }
-
- return recordGqlFieldsAggregate;
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-board/states/isRecordBoardFetchingRecordsByColumnFamilyState.ts b/packages/twenty-front/src/modules/object-record/record-board/states/isRecordBoardFetchingRecordsByColumnFamilyState.ts
deleted file mode 100644
index 64081ee543e..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-board/states/isRecordBoardFetchingRecordsByColumnFamilyState.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { type RecordGroupDefinition } from '@/object-record/record-group/types/RecordGroupDefinition';
-import { createAtomFamilyState } from '@/ui/utilities/state/jotai/utils/createAtomFamilyState';
-
-export const isRecordBoardFetchingRecordsByColumnFamilyState =
- createAtomFamilyState<boolean, RecordGroupDefinition['id']>({
- key: 'isRecordBoardFetchingRecordsByColumnFamilyState',
- defaultValue: false,
- });
diff --git a/packages/twenty-front/src/modules/object-record/record-drag/types/RecordDragContext.ts b/packages/twenty-front/src/modules/object-record/record-drag/types/RecordDragContext.ts
deleted file mode 100644
index c342f23a48d..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-drag/types/RecordDragContext.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type RecordDragContext = 'board' | 'table' | 'calendar';
diff --git a/packages/twenty-front/src/modules/object-record/record-field/hooks/useFilterVisibleAndReadableRecordField.ts b/packages/twenty-front/src/modules/object-record/record-field/hooks/useFilterVisibleAndReadableRecordField.ts
deleted file mode 100644
index 2c1106784e1..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-field/hooks/useFilterVisibleAndReadableRecordField.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { flattenedReadableFieldMetadataItemsSelector } from '@/object-metadata/states/flattenedReadableFieldMetadataItemIdsSelector';
-import { isHiddenSystemField } from '@/object-metadata/utils/isHiddenSystemField';
-import { type RecordField } from '@/object-record/record-field/types/RecordField';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-
-export const useFilterVisibleAndReadableRecordField = () => {
- const flattenedReadableFieldMetadataItems = useAtomStateValue(
- flattenedReadableFieldMetadataItemsSelector,
- );
-
- const filterVisibleAndReadableRecordField = (
- recordFieldToFilter: RecordField,
- ) => {
- return (
- recordFieldToFilter.isVisible === true &&
- flattenedReadableFieldMetadataItems.some(
- (fieldMetadataItemToFilter) =>
- fieldMetadataItemToFilter.id ===
- recordFieldToFilter.fieldMetadataItemId &&
- fieldMetadataItemToFilter.isActive === true &&
- !isHiddenSystemField(fieldMetadataItemToFilter),
- )
- );
- };
-
- return { filterVisibleAndReadableRecordField };
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/types/EditingMode.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/types/EditingMode.ts
deleted file mode 100644
index a80a00204e6..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/types/EditingMode.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type EditingMode = 'input' | 'variable';
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/hooks/useChipField.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/hooks/useChipField.ts
deleted file mode 100644
index 0154d072964..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/hooks/useChipField.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { useContext } from 'react';
-import { isFieldFullName } from '@/object-record/record-field/ui/types/guards/isFieldFullName';
-import { isFieldNumber } from '@/object-record/record-field/ui/types/guards/isFieldNumber';
-import { isFieldText } from '@/object-record/record-field/ui/types/guards/isFieldText';
-import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
-import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
-
-import { FieldContext } from '@/object-record/record-field/ui/contexts/FieldContext';
-
-export const useChipField = () => {
- const { recordId, fieldDefinition } = useContext(FieldContext);
-
- const objectNameSingular =
- isFieldText(fieldDefinition) ||
- isFieldFullName(fieldDefinition) ||
- isFieldNumber(fieldDefinition)
- ? fieldDefinition.metadata.objectMetadataNameSingular
- : undefined;
-
- const recordStore = useAtomFamilyStateValue(recordStoreFamilyState, recordId);
-
- return {
- objectNameSingular,
- recordStore,
- };
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/hooks/useMorphRelationField.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/hooks/useMorphRelationField.ts
deleted file mode 100644
index 4b698972605..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/hooks/useMorphRelationField.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { useContext } from 'react';
-
-import { useGetButtonIcon } from '@/object-record/record-field/ui/hooks/useGetButtonIcon';
-import { type FieldRelationValue } from '@/object-record/record-field/ui/types/FieldMetadata';
-import { recordStoreFamilySelector } from '@/object-record/record-store/states/selectors/recordStoreFamilySelector';
-import { FieldMetadataType } from '~/generated-metadata/graphql';
-
-import { FieldContext } from '@/object-record/record-field/ui/contexts/FieldContext';
-import { recordFieldInputDraftValueComponentState } from '@/object-record/record-field/ui/states/recordFieldInputDraftValueComponentState';
-import { assertFieldMetadata } from '@/object-record/record-field/ui/types/guards/assertFieldMetadata';
-import { isFieldMorphRelation } from '@/object-record/record-field/ui/types/guards/isFieldMorphRelation';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-import { useAtomFamilySelectorState } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorState';
-import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-
-export const useMorphRelationField = <
- T extends ObjectRecord | ObjectRecord[],
->() => {
- const { recordId, fieldDefinition, maxWidth } = useContext(FieldContext);
- const button = useGetButtonIcon();
-
- assertFieldMetadata(
- FieldMetadataType.MORPH_RELATION,
- isFieldMorphRelation,
- fieldDefinition,
- );
-
- const fieldName = fieldDefinition.metadata.fieldName;
-
- const [fieldValue, setFieldValue] = useAtomFamilySelectorState(
- recordStoreFamilySelector,
- { recordId, fieldName },
- ) as [FieldRelationValue<T>, (value: FieldRelationValue<T>) => void];
-
- const recordFieldInputDraftValue = useAtomComponentStateValue(
- recordFieldInputDraftValueComponentState,
- );
-
- const initialSearchValue = recordFieldInputDraftValue;
-
- return {
- fieldDefinition,
- fieldValue,
- initialSearchValue,
- setFieldValue,
- maxWidth: button && maxWidth ? maxWidth - 28 : maxWidth,
- recordId,
- };
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/types/guards/isFieldPositionValue.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/types/guards/isFieldPositionValue.ts
deleted file mode 100644
index f697ccbcffe..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/types/guards/isFieldPositionValue.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { isNumber } from '@sniptt/guards';
-import { type FieldPositionMetadata } from '@/object-record/record-field/ui/types/FieldMetadata';
-
-// TODO: add zod
-export const isFieldPhoneValue = (
- fieldValue: unknown,
-): fieldValue is FieldPositionMetadata =>
- isNumber(fieldValue) || fieldValue === 'first' || fieldValue === 'last';
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/types/guards/isFieldRelationOneToManyValue.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/types/guards/isFieldRelationOneToManyValue.ts
deleted file mode 100644
index e97ed4eeec9..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/types/guards/isFieldRelationOneToManyValue.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { isNull, isObject, isUndefined } from '@sniptt/guards';
-
-import { type FieldRelationFromManyValue } from '@/object-record/record-field/ui/types/FieldMetadata';
-
-// TODO: add zod
-export const isFieldRelationOneToManyValue = (
- fieldValue: unknown,
-): fieldValue is FieldRelationFromManyValue =>
- !isUndefined(fieldValue) && (isObject(fieldValue) || isNull(fieldValue));
diff --git a/packages/twenty-front/src/modules/object-record/record-filter/constants/DefaultAnySubFieldIconName.ts b/packages/twenty-front/src/modules/object-record/record-filter/constants/DefaultAnySubFieldIconName.ts
deleted file mode 100644
index 2ab90e44bda..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-filter/constants/DefaultAnySubFieldIconName.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const DEFAULT_ANY_SUB_FIELD_ICON_NAME = 'IconApps';
diff --git a/packages/twenty-front/src/modules/object-record/record-filter/types/RecordFilterDraft.ts b/packages/twenty-front/src/modules/object-record/record-filter/types/RecordFilterDraft.ts
deleted file mode 100644
index f07428d3639..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-filter/types/RecordFilterDraft.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { type RecordFilter } from '@/object-record/record-filter/types/RecordFilter';
-
-export type FilterDraft = Partial<RecordFilter> &
- Omit<RecordFilter, 'fieldMetadataId' | 'operand' | 'definition'>;
diff --git a/packages/twenty-front/src/modules/object-record/record-group/states/selectors/availableRecordGroupIdsComponentSelector.ts b/packages/twenty-front/src/modules/object-record/record-group/states/selectors/availableRecordGroupIdsComponentSelector.ts
deleted file mode 100644
index 9324a729490..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-group/states/selectors/availableRecordGroupIdsComponentSelector.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { recordGroupDefinitionFamilyState } from '@/object-record/record-group/states/recordGroupDefinitionFamilyState';
-import { recordGroupIdsComponentState } from '@/object-record/record-group/states/recordGroupIdsComponentState';
-import {
- type RecordGroupDefinition,
- RecordGroupDefinitionType,
-} from '@/object-record/record-group/types/RecordGroupDefinition';
-import { recordGroupSortedInsert } from '@/object-record/record-group/utils/recordGroupSortedInsert';
-import { createAtomComponentSelector } from '@/ui/utilities/state/jotai/utils/createAtomComponentSelector';
-import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
-import { isDefined } from 'twenty-shared/utils';
-
-export const availableRecordGroupIdsComponentSelector =
- createAtomComponentSelector<RecordGroupDefinition['id'][]>({
- key: 'availableRecordGroupIdsComponentSelector',
- componentInstanceContext: ViewComponentInstanceContext,
- get:
- ({ instanceId }) =>
- ({ get }) => {
- const recordGroupIds = get(recordGroupIdsComponentState, {
- instanceId,
- });
-
- const result: RecordGroupDefinition[] = [];
-
- for (const recordGroupId of recordGroupIds) {
- const recordGroupDefinition = get(
- recordGroupDefinitionFamilyState,
- recordGroupId,
- );
-
- if (!isDefined(recordGroupDefinition)) {
- continue;
- }
-
- if (
- recordGroupDefinition.type === RecordGroupDefinitionType.NoValue
- ) {
- continue;
- }
-
- recordGroupSortedInsert(result, recordGroupDefinition, (a, b) =>
- a.title.localeCompare(b.title),
- );
- }
-
- return result.map(({ id }) => id);
- },
- });
diff --git a/packages/twenty-front/src/modules/object-record/record-group/utils/__tests__/sortRecordGroupDefinitions.test.ts b/packages/twenty-front/src/modules/object-record/record-group/utils/__tests__/sortRecordGroupDefinitions.test.ts
deleted file mode 100644
index 4d1c974d67b..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-group/utils/__tests__/sortRecordGroupDefinitions.test.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import { RecordGroupDefinitionType } from '@/object-record/record-group/types/RecordGroupDefinition';
-import { RecordGroupSort } from '@/object-record/record-group/types/RecordGroupSort';
-import { sortRecordGroupDefinitions } from '@/object-record/record-group/utils/sortRecordGroupDefinitions';
-
-const createGroup = (
- overrides: Partial<{
- id: string;
- title: string;
- position: number;
- isVisible: boolean;
- }>,
-) => ({
- id: overrides.id ?? '1',
- type: RecordGroupDefinitionType.Value,
- title: overrides.title ?? 'Group',
- value: 'value',
- color: 'green' as const,
- position: overrides.position ?? 0,
- isVisible: overrides.isVisible ?? true,
-});
-
-describe('sortRecordGroupDefinitions', () => {
- const groups = [
- createGroup({ id: '1', title: 'Charlie', position: 2 }),
- createGroup({ id: '2', title: 'Alpha', position: 0 }),
- createGroup({ id: '3', title: 'Bravo', position: 1 }),
- ];
-
- it('should sort alphabetically', () => {
- const result = sortRecordGroupDefinitions(
- groups,
- RecordGroupSort.Alphabetical,
- );
-
- expect(result.map((g) => g.title)).toEqual(['Alpha', 'Bravo', 'Charlie']);
- });
-
- it('should sort reverse alphabetically', () => {
- const result = sortRecordGroupDefinitions(
- groups,
- RecordGroupSort.ReverseAlphabetical,
- );
-
- expect(result.map((g) => g.title)).toEqual(['Charlie', 'Bravo', 'Alpha']);
- });
-
- it('should sort by position for Manual sort', () => {
- const result = sortRecordGroupDefinitions(groups, RecordGroupSort.Manual);
-
- expect(result.map((g) => g.title)).toEqual(['Alpha', 'Bravo', 'Charlie']);
- });
-
- it('should filter out hidden groups', () => {
- const groupsWithHidden = [
- ...groups,
- createGroup({ id: '4', title: 'Delta', position: 3, isVisible: false }),
- ];
-
- const result = sortRecordGroupDefinitions(
- groupsWithHidden,
- RecordGroupSort.Manual,
- );
-
- expect(result).toHaveLength(3);
- expect(result.find((g) => g.title === 'Delta')).toBeUndefined();
- });
-});
diff --git a/packages/twenty-front/src/modules/object-record/record-group/utils/sortRecordGroupDefinitions.ts b/packages/twenty-front/src/modules/object-record/record-group/utils/sortRecordGroupDefinitions.ts
deleted file mode 100644
index 9d7de9ad56f..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-group/utils/sortRecordGroupDefinitions.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { type RecordGroupDefinition } from '@/object-record/record-group/types/RecordGroupDefinition';
-import { RecordGroupSort } from '@/object-record/record-group/types/RecordGroupSort';
-
-export const sortRecordGroupDefinitions = (
- recordGroupDefinitions: RecordGroupDefinition[],
- recordGroupSort: RecordGroupSort,
-) => {
- const visibleRecordGroups = recordGroupDefinitions.filter(
- (recordGroup) => recordGroup.isVisible,
- );
-
- const compareAlphabetical = (a: string, b: string, reverse = false) => {
- if (a < b) return reverse ? 1 : -1;
- if (a > b) return reverse ? -1 : 1;
- return 0;
- };
-
- switch (recordGroupSort) {
- case RecordGroupSort.Alphabetical:
- return visibleRecordGroups.sort((a, b) =>
- compareAlphabetical(a.title.toLowerCase(), b.title.toLowerCase()),
- );
- case RecordGroupSort.ReverseAlphabetical:
- return visibleRecordGroups.sort((a, b) =>
- compareAlphabetical(a.title.toLowerCase(), b.title.toLowerCase(), true),
- );
- case RecordGroupSort.Manual:
- default:
- return visibleRecordGroups.sort((a, b) => a.position - b.position);
- }
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageKanbanAddMenuItem.tsx b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageKanbanAddMenuItem.tsx
deleted file mode 100644
index 86ec49f9d46..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageKanbanAddMenuItem.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-import { recordGroupDefinitionFamilyState } from '@/object-record/record-group/states/recordGroupDefinitionFamilyState';
-import { RecordGroupDefinitionType } from '@/object-record/record-group/types/RecordGroupDefinition';
-import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
-import { styled } from '@linaria/react';
-import { isDefined } from 'twenty-shared/utils';
-import { MenuItem } from 'twenty-ui/navigation';
-import { Tag } from 'twenty-ui/data-display';
-
-const StyledMenuItemContainer = styled.div`
- width: calc(100% - 2 * var(--horizontal-padding));
-`;
-
-type RecordIndexPageKanbanAddMenuItemProps = {
- columnId: string;
- onItemClick: (columnDefinition: any) => void;
-};
-
-export const RecordIndexPageKanbanAddMenuItem = ({
- columnId,
- onItemClick,
-}: RecordIndexPageKanbanAddMenuItemProps) => {
- const recordGroupDefinition = useAtomFamilyStateValue(
- recordGroupDefinitionFamilyState,
- columnId,
- );
-
- if (!isDefined(recordGroupDefinition)) {
- return null;
- }
-
- return (
- <StyledMenuItemContainer>
- <MenuItem
- text={
- <Tag
- variant={
- recordGroupDefinition.type === RecordGroupDefinitionType.Value
- ? 'solid'
- : 'outline'
- }
- color={
- recordGroupDefinition.type === RecordGroupDefinitionType.Value
- ? recordGroupDefinition.color
- : 'transparent'
- }
- text={recordGroupDefinition.title}
- weight={
- recordGroupDefinition.type === RecordGroupDefinitionType.Value
- ? 'regular'
- : 'medium'
- }
- />
- }
- onClick={() => onItemClick(recordGroupDefinition)}
- />
- </StyledMenuItemContainer>
- );
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexEntityCountByGroupComponentFamilyState.ts b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexEntityCountByGroupComponentFamilyState.ts
deleted file mode 100644
index 16be113d021..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexEntityCountByGroupComponentFamilyState.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { type RecordGroupDefinition } from '@/object-record/record-group/types/RecordGroupDefinition';
-import { createAtomComponentFamilyState } from '@/ui/utilities/state/jotai/utils/createAtomComponentFamilyState';
-import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
-
-export const recordIndexEntityCountByGroupComponentFamilyState =
- createAtomComponentFamilyState<
- number | undefined,
- RecordGroupDefinition['id']
- >({
- key: 'recordIndexEntityCountByGroupComponentFamilyState',
- defaultValue: undefined,
- componentInstanceContext: ViewComponentInstanceContext,
- });
diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/constants/InlineCellHotkeyScopeMemoizeKey.ts b/packages/twenty-front/src/modules/object-record/record-inline-cell/constants/InlineCellHotkeyScopeMemoizeKey.ts
deleted file mode 100644
index 6aaed6c54d0..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-inline-cell/constants/InlineCellHotkeyScopeMemoizeKey.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const INLINE_CELL_HOTKEY_SCOPE_MEMOIZE_KEY = 'inline-cell';
diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/contexts/InlineCellMutationContext.ts b/packages/twenty-front/src/modules/object-record/record-inline-cell/contexts/InlineCellMutationContext.ts
deleted file mode 100644
index 1505d6ceab8..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-inline-cell/contexts/InlineCellMutationContext.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { createContext } from 'react';
-
-export const InlineCellMutationContext = createContext<any>(undefined);
diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/property-box/components/PropertyBoxSkeletonLoader.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/property-box/components/PropertyBoxSkeletonLoader.tsx
deleted file mode 100644
index a4b8ead4c59..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-inline-cell/property-box/components/PropertyBoxSkeletonLoader.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
-import { styled } from '@linaria/react';
-import { useContext } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
-
-const StyledSkeletonDiv = styled.div`
- align-items: center;
- display: flex;
- gap: ${themeCssVariables.spacing[1]};
- height: 24px;
- width: 100%;
-`;
-export const PropertyBoxSkeletonLoader = () => {
- const { theme } = useContext(ThemeContext);
- const skeletonItems = Array.from({ length: 4 }).map((_, index) => ({
- id: `skeleton-item-${index}`,
- }));
- return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- {skeletonItems.map(({ id }) => (
- <StyledSkeletonDiv key={id}>
- <Skeleton
- width={92}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- <Skeleton
- width={154}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </StyledSkeletonDiv>
- ))}
- </SkeletonTheme>
- );
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-merge/utils/__tests__/mergeRelationshipDataUtils.test.ts b/packages/twenty-front/src/modules/object-record/record-merge/utils/__tests__/mergeRelationshipDataUtils.test.ts
deleted file mode 100644
index 53823a1355d..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-merge/utils/__tests__/mergeRelationshipDataUtils.test.ts
+++ /dev/null
@@ -1,356 +0,0 @@
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-import { mergeManyToOneRelationship } from '@/object-record/record-merge/utils/mergeManyToOneRelationship';
-import { mergeOneToManyRelationships } from '@/object-record/record-merge/utils/mergeOneToManyRelationships';
-import { mergeRecordRelationshipData } from '@/object-record/record-merge/utils/mergeRelationshipData';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-import { FieldMetadataType, RelationType } from '~/generated-metadata/graphql';
-
-describe('mergeOneToManyRelationships', () => {
- it('should merge one-to-many relationships and remove duplicates', () => {
- const records: ObjectRecord[] = [
- {
- __typename: 'Company',
- id: 'record1',
- opportunities: [
- { __typename: 'Opportunity', id: 'opp1', name: 'Opportunity 1' },
- { __typename: 'Opportunity', id: 'opp2', name: 'Opportunity 2' },
- ],
- },
- {
- __typename: 'Company',
- id: 'record2',
- opportunities: [
- { __typename: 'Opportunity', id: 'opp2', name: 'Opportunity 2' }, // Duplicate
- { __typename: 'Opportunity', id: 'opp3', name: 'Opportunity 3' },
- ],
- },
- ];
-
- const result = mergeOneToManyRelationships(records, 'opportunities');
-
- expect(result).toHaveLength(3);
- expect(result).toEqual([
- { __typename: 'Opportunity', id: 'opp1', name: 'Opportunity 1' },
- { __typename: 'Opportunity', id: 'opp2', name: 'Opportunity 2' },
- { __typename: 'Opportunity', id: 'opp3', name: 'Opportunity 3' },
- ]);
- });
-
- it('should handle empty arrays', () => {
- const records: ObjectRecord[] = [
- {
- __typename: 'Company',
- id: 'record1',
- opportunities: [],
- },
- {
- __typename: 'Company',
- id: 'record2',
- opportunities: [],
- },
- ];
-
- const result = mergeOneToManyRelationships(records, 'opportunities');
-
- expect(result).toEqual([]);
- });
-
- it('should handle records with null or undefined relationship values', () => {
- const records: ObjectRecord[] = [
- {
- __typename: 'Company',
- id: 'record1',
- opportunities: [
- { __typename: 'Opportunity', id: 'opp1', name: 'Opportunity 1' },
- ],
- },
- {
- __typename: 'Company',
- id: 'record2',
- opportunities: null,
- },
- {
- __typename: 'Company',
- id: 'record3',
- opportunities: undefined,
- },
- ];
-
- const result = mergeOneToManyRelationships(records, 'opportunities');
-
- expect(result).toEqual([
- { __typename: 'Opportunity', id: 'opp1', name: 'Opportunity 1' },
- ]);
- });
-
- it('should handle empty records array', () => {
- const result = mergeOneToManyRelationships([], 'opportunities');
-
- expect(result).toEqual([]);
- });
-});
-
-describe('mergeManyToOneRelationship', () => {
- it('should return the first non-null value', () => {
- const records: ObjectRecord[] = [
- {
- __typename: 'Person',
- id: 'record1',
- company: null,
- },
- {
- __typename: 'Person',
- id: 'record2',
- company: { __typename: 'Company', id: 'company1', name: 'Company 1' },
- },
- {
- __typename: 'Person',
- id: 'record3',
- company: { __typename: 'Company', id: 'company2', name: 'Company 2' },
- },
- ];
-
- const result = mergeManyToOneRelationship(records, 'company');
-
- expect(result).toEqual({
- __typename: 'Company',
- id: 'company1',
- name: 'Company 1',
- });
- });
-
- it('should return the first non-undefined value', () => {
- const records: ObjectRecord[] = [
- {
- __typename: 'Person',
- id: 'record1',
- company: undefined,
- },
- {
- __typename: 'Person',
- id: 'record2',
- company: { __typename: 'Company', id: 'company1', name: 'Company 1' },
- },
- ];
-
- const result = mergeManyToOneRelationship(records, 'company');
-
- expect(result).toEqual({
- __typename: 'Company',
- id: 'company1',
- name: 'Company 1',
- });
- });
-
- it('should return null if all values are null or undefined', () => {
- const records: ObjectRecord[] = [
- {
- __typename: 'Person',
- id: 'record1',
- company: null,
- },
- {
- __typename: 'Person',
- id: 'record2',
- company: undefined,
- },
- ];
-
- const result = mergeManyToOneRelationship(records, 'company');
-
- expect(result).toBeNull();
- });
-
- it('should handle empty records array', () => {
- const result = mergeManyToOneRelationship([], 'company');
-
- expect(result).toBeNull();
- });
-});
-
-describe('mergeRecordRelationshipData', () => {
- const mockFieldMetadataItems: FieldMetadataItem[] = [
- {
- id: 'field1',
- name: 'opportunities',
- type: FieldMetadataType.RELATION,
- relation: {
- type: RelationType.ONE_TO_MANY,
- },
- } as FieldMetadataItem,
- {
- id: 'field2',
- name: 'company',
- type: FieldMetadataType.RELATION,
- relation: {
- type: RelationType.MANY_TO_ONE,
- },
- } as FieldMetadataItem,
- {
- id: 'field3',
- name: 'name',
- type: FieldMetadataType.TEXT,
- } as FieldMetadataItem,
- ];
-
- it('should merge all relationship fields correctly', () => {
- const records: ObjectRecord[] = [
- {
- __typename: 'Company',
- id: 'record1',
- opportunities: [
- { __typename: 'Opportunity', id: 'opp1', name: 'Opportunity 1' },
- { __typename: 'Opportunity', id: 'opp2', name: 'Opportunity 2' },
- ],
- company: null,
- name: 'Record 1',
- },
- {
- __typename: 'Company',
- id: 'record2',
- opportunities: [
- { __typename: 'Opportunity', id: 'opp2', name: 'Opportunity 2' },
- { __typename: 'Opportunity', id: 'opp3', name: 'Opportunity 3' },
- ],
- company: { __typename: 'Company', id: 'company1', name: 'Company 1' },
- name: 'Record 2',
- },
- ];
-
- const result = mergeRecordRelationshipData(
- records,
- mockFieldMetadataItems,
- false,
- );
-
- expect(result).toEqual({
- opportunities: [
- { __typename: 'Opportunity', id: 'opp1', name: 'Opportunity 1' },
- { __typename: 'Opportunity', id: 'opp2', name: 'Opportunity 2' },
- { __typename: 'Opportunity', id: 'opp3', name: 'Opportunity 3' },
- ],
- company: { __typename: 'Company', id: 'company1', name: 'Company 1' },
- });
- });
-
- it('should return empty object when isLoading is true', () => {
- const records: ObjectRecord[] = [
- {
- __typename: 'Company',
- id: 'record1',
- opportunities: [
- { __typename: 'Opportunity', id: 'opp1', name: 'Opportunity 1' },
- ],
- company: { __typename: 'Company', id: 'company1', name: 'Company 1' },
- },
- ];
-
- const result = mergeRecordRelationshipData(
- records,
- mockFieldMetadataItems,
- true,
- );
-
- expect(result).toEqual({});
- });
-
- it('should return empty object when records array is empty', () => {
- const result = mergeRecordRelationshipData(
- [],
- mockFieldMetadataItems,
- false,
- );
-
- expect(result).toEqual({});
- });
-
- it('should only process relation fields', () => {
- const records: ObjectRecord[] = [
- {
- __typename: 'Company',
- id: 'record1',
- opportunities: [
- { __typename: 'Opportunity', id: 'opp1', name: 'Opportunity 1' },
- ],
- company: { __typename: 'Company', id: 'company1', name: 'Company 1' },
- name: 'Record 1',
- email: '[email protected]',
- },
- ];
-
- const result = mergeRecordRelationshipData(
- records,
- mockFieldMetadataItems,
- false,
- );
-
- expect(result).toEqual({
- opportunities: [
- { __typename: 'Opportunity', id: 'opp1', name: 'Opportunity 1' },
- ],
- company: { __typename: 'Company', id: 'company1', name: 'Company 1' },
- });
- expect(result).not.toHaveProperty('name');
- expect(result).not.toHaveProperty('email');
- });
-
- it('should handle fields without relation metadata', () => {
- const fieldsWithoutRelation: FieldMetadataItem[] = [
- {
- id: 'field1',
- name: 'opportunities',
- type: FieldMetadataType.RELATION,
- relation: null,
- } as FieldMetadataItem,
- ];
-
- const records: ObjectRecord[] = [
- {
- __typename: 'Company',
- id: 'record1',
- opportunities: [
- { __typename: 'Opportunity', id: 'opp1', name: 'Opportunity 1' },
- ],
- },
- ];
-
- const result = mergeRecordRelationshipData(
- records,
- fieldsWithoutRelation,
- false,
- );
-
- expect(result).toEqual({});
- });
-
- it('should handle unknown relation types gracefully', () => {
- const fieldsWithUnknownRelation: FieldMetadataItem[] = [
- {
- id: 'field1',
- name: 'unknownRelation',
- type: FieldMetadataType.RELATION,
- relation: {
- type: 'UNKNOWN_TYPE' as RelationType,
- },
- } as FieldMetadataItem,
- ];
-
- const records: ObjectRecord[] = [
- {
- __typename: 'Person',
- id: 'record1',
- unknownRelation: [
- { __typename: 'Unknown', id: 'unknown1', name: 'Unknown 1' },
- ],
- },
- ];
-
- const result = mergeRecordRelationshipData(
- records,
- fieldsWithUnknownRelation,
- false,
- );
-
- expect(result).toEqual({});
- });
-});
diff --git a/packages/twenty-front/src/modules/object-record/record-merge/utils/mergeRelationshipData.ts b/packages/twenty-front/src/modules/object-record/record-merge/utils/mergeRelationshipData.ts
deleted file mode 100644
index 69f9c7d163f..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-merge/utils/mergeRelationshipData.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-import { mergeManyToOneRelationship } from '@/object-record/record-merge/utils/mergeManyToOneRelationship';
-import { mergeOneToManyRelationships } from '@/object-record/record-merge/utils/mergeOneToManyRelationships';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-import { FieldMetadataType, RelationType } from '~/generated-metadata/graphql';
-
-export const mergeRecordRelationshipData = (
- records: ObjectRecord[],
- fieldMetadataItems: FieldMetadataItem[],
- isLoading: boolean,
-): Record<string, ObjectRecord[] | ObjectRecord | null> => {
- if (isLoading || records.length === 0) {
- return {};
- }
-
- const mergedData: Record<string, ObjectRecord[] | ObjectRecord | null> = {};
-
- const relationFieldMetadataItems = fieldMetadataItems.filter(
- (field) => field.type === FieldMetadataType.RELATION,
- );
-
- relationFieldMetadataItems.forEach((fieldMetadataItem) => {
- const fieldName = fieldMetadataItem.name;
- const relationType = fieldMetadataItem.relation?.type;
-
- if (relationType === RelationType.ONE_TO_MANY) {
- mergedData[fieldName] = mergeOneToManyRelationships(records, fieldName);
- } else if (relationType === RelationType.MANY_TO_ONE) {
- mergedData[fieldName] = mergeManyToOneRelationship(records, fieldName);
- }
- });
-
- return mergedData;
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/states/selectors/multipleRecordPickerPickableMorphItemsLengthComponentSelector.ts b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/states/selectors/multipleRecordPickerPickableMorphItemsLengthComponentSelector.ts
deleted file mode 100644
index ae688eab192..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/states/selectors/multipleRecordPickerPickableMorphItemsLengthComponentSelector.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { MultipleRecordPickerComponentInstanceContext } from '@/object-record/record-picker/multiple-record-picker/states/contexts/MultipleRecordPickerComponentInstanceContext';
-import { multipleRecordPickerPickableMorphItemsComponentState } from '@/object-record/record-picker/multiple-record-picker/states/multipleRecordPickerPickableMorphItemsComponentState';
-import { createAtomComponentSelector } from '@/ui/utilities/state/jotai/utils/createAtomComponentSelector';
-
-export const multipleRecordPickerPickableMorphItemsLengthComponentSelector =
- createAtomComponentSelector<number>({
- key: 'multipleRecordPickerPickableMorphItemsLengthComponentSelector',
- componentInstanceContext: MultipleRecordPickerComponentInstanceContext,
- get:
- ({ instanceId }) =>
- ({ get }) => {
- const pickableMorphItems = get(
- multipleRecordPickerPickableMorphItemsComponentState,
- { instanceId },
- );
-
- return pickableMorphItems.length;
- },
- });
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/utils/multiRecordPickerFormatSearchResults.ts b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/utils/multiRecordPickerFormatSearchResults.ts
deleted file mode 100644
index 8da2ab4d2f1..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/utils/multiRecordPickerFormatSearchResults.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { type CombinedFindManyRecordsQueryResult } from '@/object-record/multiple-objects/types/CombinedFindManyRecordsQueryResult';
-
-export const multiRecordPickerFormatSearchResults = (
- searchResults: CombinedFindManyRecordsQueryResult | undefined | null,
-): CombinedFindManyRecordsQueryResult => {
- if (!searchResults) {
- return {};
- }
-
- return Object.entries(searchResults).reduce((acc, [key, value]) => {
- let newKey = key.replace(/^search/, '');
- newKey = newKey.charAt(0).toLowerCase() + newKey.slice(1);
- acc[newKey] = value;
- return acc;
- }, {} as CombinedFindManyRecordsQueryResult);
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/utils/multipleRecordPickerformatQueryResultAsRecordWithObjectMetadataId.ts b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/utils/multipleRecordPickerformatQueryResultAsRecordWithObjectMetadataId.ts
deleted file mode 100644
index b8b308462c5..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/utils/multipleRecordPickerformatQueryResultAsRecordWithObjectMetadataId.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { type CombinedFindManyRecordsQueryResult } from '@/object-record/multiple-objects/types/CombinedFindManyRecordsQueryResult';
-import { multiRecordPickerFormatSearchResults } from '@/object-record/record-picker/multiple-record-picker/utils/multiRecordPickerFormatSearchResults';
-import { isDefined } from 'twenty-shared/utils';
-
-export const multipleRecordPickerformatQueryResultAsRecordsWithObjectMetadataId =
- ({
- objectMetadataItems,
- searchQueryResult,
- }: {
- objectMetadataItems: EnrichedObjectMetadataItem[];
- searchQueryResult: CombinedFindManyRecordsQueryResult;
- }) => {
- const formattedSearchQueryResult =
- multiRecordPickerFormatSearchResults(searchQueryResult);
-
- const recordsWithObjectMetadataId = Object.entries(
- formattedSearchQueryResult,
- ).flatMap(([namePlural, objectRecordConnection]) => {
- const objectMetadataItem = objectMetadataItems.find(
- (objectMetadataItem) => objectMetadataItem.namePlural === namePlural,
- );
-
- if (!isDefined(objectMetadataItem)) return [];
-
- return objectRecordConnection.edges.map(({ node }) => ({
- objectMetadataItem,
- record: node,
- }));
- });
-
- return {
- recordsWithObjectMetadataId,
- };
- };
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/constants/SingleRecordPickerClickOutsideListenerId.ts b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/constants/SingleRecordPickerClickOutsideListenerId.ts
deleted file mode 100644
index 29c9ea6288e..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/constants/SingleRecordPickerClickOutsideListenerId.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const SINGLE_RECORD_PICKER_CLICK_OUTSIDE_LISTENER_ID =
- 'single-record-picker-click-outside-listener';
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/states/singleRecordPickerSearchQueryComponentState.ts b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/states/singleRecordPickerSearchQueryComponentState.ts
deleted file mode 100644
index a8b2bd1c123..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/states/singleRecordPickerSearchQueryComponentState.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { SingleRecordPickerComponentInstanceContext } from '@/object-record/record-picker/single-record-picker/states/contexts/SingleRecordPickerComponentInstanceContext';
-import { type RecordPickerSearchQuery } from '@/object-record/record-picker/single-record-picker/types/SingleRecordPickerSearchQuery';
-import { createAtomComponentState } from '@/ui/utilities/state/jotai/utils/createAtomComponentState';
-
-export const singleRecordPickerSearchQueryComponentState =
- createAtomComponentState<RecordPickerSearchQuery | null>({
- key: 'singleRecordPickerSearchQueryComponentState',
- defaultValue: null,
- componentInstanceContext: SingleRecordPickerComponentInstanceContext,
- });
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/types/SingleRecordPickerSearchQuery.ts b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/types/SingleRecordPickerSearchQuery.ts
deleted file mode 100644
index d622db5a6b8..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/types/SingleRecordPickerSearchQuery.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export type RecordPickerSearchQuery = {
- computeFilterFields: (relationPickerType: string) => string[];
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordIdsFromFindManyCacheRootQuery.ts b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordIdsFromFindManyCacheRootQuery.ts
deleted file mode 100644
index 02cd9273f0e..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordIdsFromFindManyCacheRootQuery.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
-import { type RecordGqlRefEdge } from '@/object-record/cache/types/RecordGqlRefEdge';
-import { createApolloStoreFieldName } from '~/utils/createApolloStoreFieldName';
-
-export const useRecordIdsFromFindManyCacheRootQuery = ({
- objectNamePlural,
- fieldVariables,
-}: {
- objectNamePlural: string;
- fieldVariables: {
- filter: any;
- orderBy: any;
- };
-}) => {
- const apolloCoreClient = useApolloCoreClient();
-
- const testsFieldNameOnRootQuery = createApolloStoreFieldName({
- fieldName: objectNamePlural,
- fieldVariables: fieldVariables,
- });
-
- const extractedCache = apolloCoreClient.cache.extract() as any;
-
- const recordIdsInCache: string[] =
- extractedCache?.['ROOT_QUERY']?.[testsFieldNameOnRootQuery]?.edges?.map(
- (edge: RecordGqlRefEdge) => edge.node?.__ref.split(':')[1],
- ) ?? [];
-
- return { recordIdsInCache };
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/constants/RecordTableHtmlId.ts b/packages/twenty-front/src/modules/object-record/record-table/constants/RecordTableHtmlId.ts
deleted file mode 100644
index ce5767b1763..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/constants/RecordTableHtmlId.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const RECORD_TABLE_HTML_ID = 'record-table';
diff --git a/packages/twenty-front/src/modules/object-record/record-table/constants/TableHiddenFieldsDropdownId.ts b/packages/twenty-front/src/modules/object-record/record-table/constants/TableHiddenFieldsDropdownId.ts
deleted file mode 100644
index d94eeb6b89a..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/constants/TableHiddenFieldsDropdownId.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-// We should either apply the constant all caps case or maybe define a more general enum to store those ids ?
-export const TABLE_HIDDEN_FIELDS_DROPDOWN_ID =
- 'table-hidden-fields-dropdown-id';
diff --git a/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyHandler.tsx b/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyHandler.tsx
deleted file mode 100644
index c5d8392c07f..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyHandler.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { recordIndexAllRecordIdsComponentSelector } from '@/object-record/record-index/states/selectors/recordIndexAllRecordIdsComponentSelector';
-import { RecordTableEmptyState } from '@/object-record/record-table/empty-state/components/RecordTableEmptyState';
-import { isRecordTableInitialLoadingComponentState } from '@/object-record/record-table/states/isRecordTableInitialLoadingComponentState';
-import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
-import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-
-type RecordTableEmptyHandlerProps = {
- recordTableId: string;
- children: React.ReactNode;
-};
-
-export const RecordTableEmptyHandler = ({
- recordTableId,
- children,
-}: RecordTableEmptyHandlerProps) => {
- const isRecordTableInitialLoading = useAtomComponentStateValue(
- isRecordTableInitialLoadingComponentState,
- recordTableId,
- );
-
- const allRecordIds = useAtomComponentSelectorValue(
- recordIndexAllRecordIdsComponentSelector,
- recordTableId,
- );
-
- const recordTableIsEmpty =
- !isRecordTableInitialLoading && allRecordIds.length === 0;
-
- if (recordTableIsEmpty) {
- return <RecordTableEmptyState />;
- }
-
- return children;
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useHandleContainerMouseEnter.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useHandleContainerMouseEnter.ts
deleted file mode 100644
index 2ac44d94d4b..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useHandleContainerMouseEnter.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { useCallback } from 'react';
-import { useStore } from 'jotai';
-
-import { useMoveHoverToCurrentCell } from '@/object-record/record-table/record-table-cell/hooks/useMoveHoverToCurrentCell';
-import { isSomeCellInEditModeComponentSelector } from '@/object-record/record-table/states/selectors/isSomeCellInEditModeComponentSelector';
-import { type TableCellPosition } from '@/object-record/record-table/types/TableCellPosition';
-import { useAtomComponentSelectorCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorCallbackState';
-
-export type HandleContainerMouseEnterArgs = {
- cellPosition: TableCellPosition;
-};
-
-export const useHandleContainerMouseEnter = ({
- recordTableId,
-}: {
- recordTableId: string;
-}) => {
- const { moveHoverToCurrentCell } = useMoveHoverToCurrentCell(recordTableId);
-
- const isSomeCellInEditModeSelector = useAtomComponentSelectorCallbackState(
- isSomeCellInEditModeComponentSelector,
- recordTableId,
- );
-
- const store = useStore();
-
- const handleContainerMouseEnter = useCallback(
- ({ cellPosition }: HandleContainerMouseEnterArgs) => {
- const isSomeCellInEditMode = store.get(isSomeCellInEditModeSelector);
-
- if (!isSomeCellInEditMode) {
- moveHoverToCurrentCell(cellPosition);
- }
- },
- [isSomeCellInEditModeSelector, moveHoverToCurrentCell, store],
- );
-
- return {
- handleContainerMouseEnter,
- };
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetAllRowSelectedState.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetAllRowSelectedState.ts
deleted file mode 100644
index 5d77f1060b2..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetAllRowSelectedState.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { hasUserSelectedAllRowsComponentState } from '@/object-record/record-table/record-table-row/states/hasUserSelectedAllRowsFamilyState';
-import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
-import { useStore } from 'jotai';
-
-export const useSetHasUserSelectedAllRows = (recordTableId?: string) => {
- const hasUserSelectedAllRows = useAtomComponentStateCallbackState(
- hasUserSelectedAllRowsComponentState,
- recordTableId,
- );
-
- const store = useStore();
-
- return (selected: boolean) => {
- store.set(hasUserSelectedAllRows, selected);
- };
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellSkeletonLoader.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellSkeletonLoader.tsx
deleted file mode 100644
index eae1a0a920b..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellSkeletonLoader.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
-import { styled } from '@linaria/react';
-import { useContext } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
-
-const StyledSkeletonContainer = styled.div`
- padding-left: ${themeCssVariables.spacing[2]};
- padding-right: ${themeCssVariables.spacing[2]};
- padding-top: ${themeCssVariables.spacing['1.5']};
-`;
-
-const StyledRecordTableCellLoader = ({ width }: { width?: number }) => {
- const { theme } = useContext(ThemeContext);
- return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Skeleton
- width={width}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </SkeletonTheme>
- );
-};
-
-export const RecordTableCellSkeletonLoader = () => {
- return (
- <StyledSkeletonContainer>
- <StyledRecordTableCellLoader />
- </StyledSkeletonContainer>
- );
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTablePlusButtonCellPlaceholderSkeleton.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTablePlusButtonCellPlaceholderSkeleton.tsx
deleted file mode 100644
index 1cbb81cad85..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTablePlusButtonCellPlaceholderSkeleton.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { RECORD_TABLE_COLUMN_ADD_COLUMN_BUTTON_WIDTH_CLASS_NAME } from '@/object-record/record-table/constants/RecordTableColumnAddColumnButtonWidthClassName';
-import { useRecordTableRowContextOrThrow } from '@/object-record/record-table/contexts/RecordTableRowContext';
-import { RecordTableCellStyleWrapper } from '@/object-record/record-table/record-table-cell/components/RecordTableCellStyleWrapper';
-
-export const RecordTablePlusButtonCellPlaceholder = () => {
- const { isSelected } = useRecordTableRowContextOrThrow();
-
- return (
- <RecordTableCellStyleWrapper
- isSelected={isSelected}
- hasRightBorder={false}
- widthClassName={RECORD_TABLE_COLUMN_ADD_COLUMN_BUTTON_WIDTH_CLASS_NAME}
- />
- );
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/utils/buildRecordGqlFieldsAggregateForRecordTable.ts b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/utils/buildRecordGqlFieldsAggregateForRecordTable.ts
deleted file mode 100644
index ff117c4dd04..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/utils/buildRecordGqlFieldsAggregateForRecordTable.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { type RecordGqlFieldsAggregate } from '@/object-record/graphql/types/RecordGqlFieldsAggregate';
-import { AggregateOperations } from '@/object-record/record-table/constants/AggregateOperations';
-
-export const buildRecordGqlFieldsAggregateForRecordTable = ({
- aggregateOperation,
- fieldName,
-}: {
- fieldName: string;
- aggregateOperation?: AggregateOperations | null;
-}): RecordGqlFieldsAggregate => {
- return {
- [fieldName]: [aggregateOperation ?? AggregateOperations.COUNT],
- };
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableCellsEmpty.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableCellsEmpty.tsx
deleted file mode 100644
index 81608b1138c..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableCellsEmpty.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { useRecordTableContextOrThrow } from '@/object-record/record-table/contexts/RecordTableContext';
-import { useRecordTableRowContextOrThrow } from '@/object-record/record-table/contexts/RecordTableRowContext';
-import { RecordTableCellStyleWrapper } from '@/object-record/record-table/record-table-cell/components/RecordTableCellStyleWrapper';
-import { getRecordTableColumnFieldWidthClassName } from '@/object-record/record-table/utils/getRecordTableColumnFieldWidthClassName';
-
-export const RecordTableCellsEmpty = () => {
- const { isSelected } = useRecordTableRowContextOrThrow();
-
- const { visibleRecordFields } = useRecordTableContextOrThrow();
-
- return visibleRecordFields.map((recordField, index) => (
- <RecordTableCellStyleWrapper
- isSelected={isSelected}
- key={recordField.fieldMetadataItemId}
- widthClassName={getRecordTableColumnFieldWidthClassName(index)}
- />
- ));
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableFirstRowOfGroup.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableFirstRowOfGroup.tsx
deleted file mode 100644
index 2f80505c190..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableFirstRowOfGroup.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { RecordTableRowDiv } from '@/object-record/record-table/record-table-row/components/RecordTableRowDiv';
-import { forwardRef, type ReactNode } from 'react';
-
-type RecordTableTrProps = {
- children: ReactNode;
- recordId: string;
- isDragging?: boolean;
-};
-
-export const RecordTableFirstRowOfGroup = forwardRef<
- HTMLDivElement,
- RecordTableTrProps
->(({ children, recordId, isDragging = false, ...props }, ref) => {
- return (
- <RecordTableRowDiv
- className="table-row"
- data-virtualized-id={recordId}
- isDragging={isDragging}
- ref={ref}
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...props}
- >
- {children}
- </RecordTableRowDiv>
- );
-});
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableLastDynamicFillingCell.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableLastDynamicFillingCell.tsx
deleted file mode 100644
index ee1d1b38284..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableLastDynamicFillingCell.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { RECORD_TABLE_COLUMN_LAST_EMPTY_COLUMN_WIDTH_CLASS_NAME } from '@/object-record/record-table/constants/RecordTableColumnLastEmptyColumnWidthClassName';
-import { RECORD_TABLE_ROW_HEIGHT } from '@/object-record/record-table/constants/RecordTableRowHeight';
-import { styled } from '@linaria/react';
-import { cx } from '@linaria/core';
-
-const StyledPlaceholderLastDynamicFillingCell = styled.div`
- height: ${RECORD_TABLE_ROW_HEIGHT}px;
-`;
-
-export const RecordTableLastDynamicFillingCell = ({
- className,
-}: {
- className?: string;
-}) => {
- return (
- <StyledPlaceholderLastDynamicFillingCell
- className={cx(
- RECORD_TABLE_COLUMN_LAST_EMPTY_COLUMN_WIDTH_CLASS_NAME,
- className,
- )}
- />
- );
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableRowMultiDragCounterChip.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableRowMultiDragCounterChip.tsx
deleted file mode 100644
index e0ea8edc34e..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableRowMultiDragCounterChip.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { originalDragSelectionComponentState } from '@/object-record/record-drag/states/originalDragSelectionComponentState';
-import { useRecordIndexContextOrThrow } from '@/object-record/record-index/contexts/RecordIndexContext';
-import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { styled } from '@linaria/react';
-import { NotificationCounter } from 'twenty-ui/data-display';
-
-const StyledNotificationCounterContainer = styled.div`
- left: -7px;
- position: absolute;
- top: -7px;
- z-index: 1000;
-`;
-
-export const RecordTableRowMultiDragCounterChip = () => {
- const { recordIndexId } = useRecordIndexContextOrThrow();
-
- const originalDragSelection = useAtomComponentStateValue(
- originalDragSelectionComponentState,
- recordIndexId,
- );
-
- const selectedCount = originalDragSelection.length ?? 0;
-
- const shouldShow = selectedCount > 1;
-
- if (!shouldShow) {
- return null;
- }
-
- return (
- <StyledNotificationCounterContainer>
- <NotificationCounter count={selectedCount} />
- </StyledNotificationCounterContainer>
- );
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/states/isRecordIdFirstOfGroupComponentFamilySelector.ts b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/states/isRecordIdFirstOfGroupComponentFamilySelector.ts
deleted file mode 100644
index a8c3d815365..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/states/isRecordIdFirstOfGroupComponentFamilySelector.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import { recordGroupIdsComponentState } from '@/object-record/record-group/states/recordGroupIdsComponentState';
-import { recordIndexAllRecordIdsComponentSelector } from '@/object-record/record-index/states/selectors/recordIndexAllRecordIdsComponentSelector';
-import { recordIndexRecordIdsByGroupComponentFamilyState } from '@/object-record/record-index/states/recordIndexRecordIdsByGroupComponentFamilyState';
-import { createAtomComponentFamilySelector } from '@/ui/utilities/state/jotai/utils/createAtomComponentFamilySelector';
-import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
-import { isDefined } from 'twenty-shared/utils';
-
-export const isRecordIdFirstOfGroupComponentFamilySelector =
- createAtomComponentFamilySelector<boolean, string>({
- key: 'isRecordIdFirstOfGroupComponentFamilySelector',
- componentInstanceContext: ViewComponentInstanceContext,
- get:
- ({ instanceId, familyKey }) =>
- ({ get }) => {
- const recordGroupIds = get(recordGroupIdsComponentState, {
- instanceId,
- });
-
- const hasRecordGroups = recordGroupIds.length > 0;
-
- if (!isDefined(familyKey)) {
- return false;
- }
-
- const recordIdToCheck = familyKey;
-
- if (hasRecordGroups) {
- for (const recordGroupId of recordGroupIds) {
- const recordIdsForThisGroup = get(
- recordIndexRecordIdsByGroupComponentFamilyState,
- { instanceId, familyKey: recordGroupId },
- );
-
- if (recordIdsForThisGroup[0] === recordIdToCheck) {
- return true;
- }
- }
- } else {
- const allRecordIds = get(recordIndexAllRecordIdsComponentSelector, {
- instanceId,
- });
-
- if (allRecordIds[0] === recordIdToCheck) {
- return true;
- }
- }
-
- return false;
- },
- });
diff --git a/packages/twenty-front/src/modules/object-record/record-table/states/numberOfTableRowsComponentState.ts b/packages/twenty-front/src/modules/object-record/record-table/states/numberOfTableRowsComponentState.ts
deleted file mode 100644
index 312e07e6e0e..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/states/numberOfTableRowsComponentState.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { RecordTableComponentInstanceContext } from '@/object-record/record-table/states/context/RecordTableComponentInstanceContext';
-import { createAtomComponentState } from '@/ui/utilities/state/jotai/utils/createAtomComponentState';
-
-export const numberOfTableRowsComponentState = createAtomComponentState<number>(
- {
- key: 'numberOfTableRowsComponentState',
- defaultValue: 0,
- componentInstanceContext: RecordTableComponentInstanceContext,
- },
-);
diff --git a/packages/twenty-front/src/modules/object-record/record-table/states/selectors/isAtLeastOneTableRowSelectedSelector.ts b/packages/twenty-front/src/modules/object-record/record-table/states/selectors/isAtLeastOneTableRowSelectedSelector.ts
deleted file mode 100644
index 8bbdd7365d5..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/states/selectors/isAtLeastOneTableRowSelectedSelector.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { recordIndexAllRecordIdsComponentSelector } from '@/object-record/record-index/states/selectors/recordIndexAllRecordIdsComponentSelector';
-import { isRowSelectedComponentFamilyState } from '@/object-record/record-table/record-table-row/states/isRowSelectedComponentFamilyState';
-import { RecordTableComponentInstanceContext } from '@/object-record/record-table/states/context/RecordTableComponentInstanceContext';
-import { createAtomComponentSelector } from '@/ui/utilities/state/jotai/utils/createAtomComponentSelector';
-
-export const isAtLeastOneTableRowSelectedSelector =
- createAtomComponentSelector<boolean>({
- key: 'isAtLeastOneTableRowSelectedSelector',
- componentInstanceContext: RecordTableComponentInstanceContext,
- get:
- ({ instanceId }) =>
- ({ get }) => {
- const allRecordIds = get(recordIndexAllRecordIdsComponentSelector, {
- instanceId,
- });
-
- const isAnyRecordSelected = allRecordIds.some((recordId) =>
- get(isRowSelectedComponentFamilyState, {
- instanceId,
- familyKey: recordId,
- }),
- );
-
- return isAnyRecordSelected;
- },
- });
diff --git a/packages/twenty-front/src/modules/object-record/record-table/types/TableDimensions.ts b/packages/twenty-front/src/modules/object-record/record-table/types/TableDimensions.ts
deleted file mode 100644
index 5dde85478a2..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/types/TableDimensions.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export type TablePosition = {
- numberOfRows: number;
- numberOfColumns: number;
-};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/virtualization/constants/VirtualizationScrollDebounceTime.ts b/packages/twenty-front/src/modules/object-record/record-table/virtualization/constants/VirtualizationScrollDebounceTime.ts
deleted file mode 100644
index fe1e2b5ffe9..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/virtualization/constants/VirtualizationScrollDebounceTime.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const VIRTUALIZATION_SCROLL_DEBOUNCE_TIME = 20;
diff --git a/packages/twenty-front/src/modules/object-record/record-table/virtualization/states/tableHasAnyFilterOrSortComponentSelector.ts b/packages/twenty-front/src/modules/object-record/record-table/virtualization/states/tableHasAnyFilterOrSortComponentSelector.ts
deleted file mode 100644
index e3ccc0c92a6..00000000000
--- a/packages/twenty-front/src/modules/object-record/record-table/virtualization/states/tableHasAnyFilterOrSortComponentSelector.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { currentRecordFiltersComponentState } from '@/object-record/record-filter/states/currentRecordFiltersComponentState';
-import { currentRecordSortsComponentState } from '@/object-record/record-sort/states/currentRecordSortsComponentState';
-import { RecordTableComponentInstanceContext } from '@/object-record/record-table/states/context/RecordTableComponentInstanceContext';
-import { createAtomComponentSelector } from '@/ui/utilities/state/jotai/utils/createAtomComponentSelector';
-
-export const tableHasAnyFilterOrSortComponentSelector =
- createAtomComponentSelector<boolean>({
- key: 'tableHasAnyFilterOrSortComponentSelector',
- componentInstanceContext: RecordTableComponentInstanceContext,
- get:
- ({ instanceId }) =>
- ({ get }) => {
- const currentRecordFilters = get(currentRecordFiltersComponentState, {
- instanceId,
- });
-
- const currentRecordSorts = get(currentRecordSortsComponentState, {
- instanceId,
- });
-
- const tableHasAnyFilterOrSort =
- currentRecordFilters.length > 0 || currentRecordSorts.length > 0;
-
- return tableHasAnyFilterOrSort;
- },
- });
diff --git a/packages/twenty-front/src/modules/object-record/spreadsheet-import/types/CompositeFieldLabels.ts b/packages/twenty-front/src/modules/object-record/spreadsheet-import/types/CompositeFieldLabels.ts
deleted file mode 100644
index 9486babdac0..00000000000
--- a/packages/twenty-front/src/modules/object-record/spreadsheet-import/types/CompositeFieldLabels.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { type KeyOfCompositeField } from '@/object-record/spreadsheet-import/types/KeyOfCompositeField';
-
-export type CompositeFieldLabels<T> = {
- [key in `${KeyOfCompositeField<T>}Label`]: string;
-};
diff --git a/packages/twenty-front/src/modules/object-record/spreadsheet-import/types/KeyOfCompositeField.ts b/packages/twenty-front/src/modules/object-record/spreadsheet-import/types/KeyOfCompositeField.ts
deleted file mode 100644
index 29eeea021ca..00000000000
--- a/packages/twenty-front/src/modules/object-record/spreadsheet-import/types/KeyOfCompositeField.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export type KeyOfCompositeField<T> = keyof Omit<T, '__typename'> extends string
- ? keyof Omit<T, '__typename'>
- : never;
diff --git a/packages/twenty-front/src/modules/object-record/states/isRecordBoardColumnLoadingFamilyState.ts b/packages/twenty-front/src/modules/object-record/states/isRecordBoardColumnLoadingFamilyState.ts
deleted file mode 100644
index 1f6086c7229..00000000000
--- a/packages/twenty-front/src/modules/object-record/states/isRecordBoardColumnLoadingFamilyState.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { createAtomFamilyState } from '@/ui/utilities/state/jotai/utils/createAtomFamilyState';
-
-export const isRecordIndexBoardColumnLoadingFamilyState = createAtomFamilyState<
- boolean,
- string | undefined
->({
- key: 'isRecordIndexBoardColumnLoadingFamilyState',
- defaultValue: false,
-});
diff --git a/packages/twenty-front/src/modules/object-record/types/UseFindManyRecordsParams.ts b/packages/twenty-front/src/modules/object-record/types/UseFindManyRecordsParams.ts
deleted file mode 100644
index ee73a7f433b..00000000000
--- a/packages/twenty-front/src/modules/object-record/types/UseFindManyRecordsParams.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { type WatchQueryFetchPolicy } from '@apollo/client';
-
-import { type ObjectMetadataItemIdentifier } from '@/object-metadata/types/ObjectMetadataItemIdentifier';
-import { type OnFindManyRecordsCompleted } from '@/object-record/types/OnFindManyRecordsCompleted';
-import {
- type RecordGqlOperationGqlRecordFields,
- type RecordGqlOperationVariables,
-} from 'twenty-shared/types';
-
-export type UseFindManyRecordsParams<T> = ObjectMetadataItemIdentifier &
- RecordGqlOperationVariables & {
- onCompleted?: OnFindManyRecordsCompleted<T>;
- skip?: boolean;
- recordGqlFields?: RecordGqlOperationGqlRecordFields;
- fetchPolicy?: WatchQueryFetchPolicy;
- };
diff --git a/packages/twenty-front/src/modules/object-record/utils/__tests__/sortRecordsByPosition.test.ts b/packages/twenty-front/src/modules/object-record/utils/__tests__/sortRecordsByPosition.test.ts
deleted file mode 100644
index 18aac5b36af..00000000000
--- a/packages/twenty-front/src/modules/object-record/utils/__tests__/sortRecordsByPosition.test.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import { sortRecordsByPosition } from '@/object-record/utils/sortRecordsByPosition';
-
-describe('sortRecordsByPosition', () => {
- it('should sort by numeric position', () => {
- const record1 = { id: '1', __typename: 'Record', position: 1 };
- const record2 = { id: '2', __typename: 'Record', position: 2 };
-
- expect(sortRecordsByPosition(record1, record2)).toBeLessThan(0);
- expect(sortRecordsByPosition(record2, record1)).toBeGreaterThan(0);
- });
-
- it('should return 0 for equal numeric positions', () => {
- const record1 = { id: '1', __typename: 'Record', position: 5 };
- const record2 = { id: '2', __typename: 'Record', position: 5 };
-
- expect(sortRecordsByPosition(record1, record2)).toBe(0);
- });
-
- it('should place "first" before other positions', () => {
- const record1 = { id: '1', __typename: 'Record', position: 'first' };
- const record2 = { id: '2', __typename: 'Record', position: 'last' };
-
- expect(sortRecordsByPosition(record1 as any, record2 as any)).toBe(-1);
- });
-
- it('should place "last" after other positions', () => {
- const record1 = { id: '1', __typename: 'Record', position: 'last' };
- const record2 = { id: '2', __typename: 'Record', position: 'first' };
-
- expect(sortRecordsByPosition(record1 as any, record2 as any)).toBe(1);
- });
-
- it('should return 0 for unknown position types', () => {
- const record1 = {
- id: '1',
- __typename: 'Record',
- position: undefined as any,
- };
- const record2 = {
- id: '2',
- __typename: 'Record',
- position: undefined as any,
- };
-
- expect(sortRecordsByPosition(record1, record2)).toBe(0);
- });
-});
diff --git a/packages/twenty-front/src/modules/object-record/utils/getRecordIndexIdFromObjectNamePlural.ts b/packages/twenty-front/src/modules/object-record/utils/getRecordIndexIdFromObjectNamePlural.ts
deleted file mode 100644
index 4dd869f86b5..00000000000
--- a/packages/twenty-front/src/modules/object-record/utils/getRecordIndexIdFromObjectNamePlural.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const getRecordIndexIdFromObjectNamePlural = (
- objectNamePlural: string,
-) => {
- return objectNamePlural;
-};
diff --git a/packages/twenty-front/src/modules/object-record/utils/sortRecordsByPosition.ts b/packages/twenty-front/src/modules/object-record/utils/sortRecordsByPosition.ts
deleted file mode 100644
index c558cecb184..00000000000
--- a/packages/twenty-front/src/modules/object-record/utils/sortRecordsByPosition.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-
-export const sortRecordsByPosition = (
- record1: ObjectRecord,
- record2: ObjectRecord,
-) => {
- if (
- typeof record1.position == 'number' &&
- typeof record2.position == 'number'
- ) {
- return record1.position - record2.position;
- } else if (record1.position === 'first' || record2.position === 'last') {
- return -1;
- } else if (record2.position === 'first' || record1.position === 'last') {
- return 1;
- } else {
- return 0;
- }
-};
diff --git a/packages/twenty-front/src/modules/page-layout/actions/PageLayoutSingleRecordActionKeys.ts b/packages/twenty-front/src/modules/page-layout/actions/PageLayoutSingleRecordActionKeys.ts
deleted file mode 100644
index b911bb2a749..00000000000
--- a/packages/twenty-front/src/modules/page-layout/actions/PageLayoutSingleRecordActionKeys.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export enum PageLayoutSingleRecordActionKeys {
- EDIT_LAYOUT = 'edit-layout-single-record',
- SAVE_LAYOUT = 'save-layout-single-record',
- CANCEL_LAYOUT_EDITION = 'cancel-layout-edition-single-record',
- ADD_TO_FAVORITES_READ_MODE = 'add-to-favorites-read-mode-dashboard',
-}
diff --git a/packages/twenty-front/src/modules/page-layout/constants/SettingsPageLayoutTabsInstanceId.ts b/packages/twenty-front/src/modules/page-layout/constants/SettingsPageLayoutTabsInstanceId.ts
deleted file mode 100644
index 92044d62dee..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/SettingsPageLayoutTabsInstanceId.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID =
- 'settings-page-layout-tabs';
diff --git a/packages/twenty-front/src/modules/page-layout/constants/WidgetPlaceholderSize.ts b/packages/twenty-front/src/modules/page-layout/constants/WidgetPlaceholderSize.ts
deleted file mode 100644
index 8daa1476bb6..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/WidgetPlaceholderSize.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export const WIDGET_PLACEHOLDER_SIZE = {
- w: 4,
- h: 4,
-};
diff --git a/packages/twenty-front/src/modules/page-layout/graphql/queries/findAllPageLayouts.ts b/packages/twenty-front/src/modules/page-layout/graphql/queries/findAllPageLayouts.ts
deleted file mode 100644
index 7b7c4144a54..00000000000
--- a/packages/twenty-front/src/modules/page-layout/graphql/queries/findAllPageLayouts.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { PAGE_LAYOUT_FRAGMENT } from '@/dashboards/graphql/fragments/pageLayoutFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_ALL_PAGE_LAYOUTS = gql`
- ${PAGE_LAYOUT_FRAGMENT}
- query FindAllPageLayouts {
- getPageLayouts {
- ...PageLayoutFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useDeletePageLayoutWidget.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useDeletePageLayoutWidget.test.tsx
index ccb0848916d..fd3d7595795 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useDeletePageLayoutWidget.test.tsx
+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useDeletePageLayoutWidget.test.tsx
@@ -17,15 +17,6 @@ jest.mock(
}),
);
-jest.mock(
- '@/page-layout/widgets/fields/hooks/useDeleteViewForFieldsWidget',
- () => ({
- useDeleteViewForFieldsWidget: () => ({
- deleteViewForFieldsWidget: jest.fn(),
- }),
- }),
-);
-
jest.mock('@/side-panel/hooks/useSidePanelMenu', () => ({
useSidePanelMenu: () => ({
closeSidePanelMenu: jest.fn(),
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutDraftState.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutDraftState.test.tsx
deleted file mode 100644
index a0f17a4195e..00000000000
--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutDraftState.test.tsx
+++ /dev/null
@@ -1,215 +0,0 @@
-import { usePageLayoutDraftState } from '@/page-layout/hooks/usePageLayoutDraftState';
-import { pageLayoutDraftComponentState } from '@/page-layout/states/pageLayoutDraftComponentState';
-import { pageLayoutPersistedComponentState } from '@/page-layout/states/pageLayoutPersistedComponentState';
-import {
- makeDraft,
- makeTab,
-} from '@/page-layout/testing/pageLayoutDraftFixtures';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import { toDraftPageLayout } from '@/page-layout/utils/toDraftPageLayout';
-import { act, renderHook } from '@testing-library/react';
-import { createStore } from 'jotai';
-import { type ReactNode } from 'react';
-import {
- AggregateOperations,
- BarChartLayout,
- GraphOrderBy,
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-import {
- PAGE_LAYOUT_TEST_INSTANCE_ID,
- PageLayoutTestWrapper,
-} from './PageLayoutTestWrapper';
-
-describe('usePageLayoutDraftState', () => {
- it.each([null, 'tab-2'])(
- 'should track default-tab edits when the persisted default is %s',
- (defaultTabToFocusOnMobileAndSidePanelId) => {
- const store = createStore();
- const persistedPageLayout: PageLayout = {
- ...makeDraft([makeTab('tab-1', []), makeTab('tab-2', [], 1)]),
- id: PAGE_LAYOUT_TEST_INSTANCE_ID,
- applicationId: 'application-id',
- universalIdentifier: 'page-layout-universal-identifier',
- isSystemSideEffect: false,
- createdAt: '2024-01-01',
- updatedAt: '2024-01-01',
- deletedAt: null,
- defaultTabToFocusOnMobileAndSidePanelId,
- };
-
- store.set(
- pageLayoutPersistedComponentState.atomFamily({
- instanceId: PAGE_LAYOUT_TEST_INSTANCE_ID,
- }),
- persistedPageLayout,
- );
- store.set(
- pageLayoutDraftComponentState.atomFamily({
- instanceId: PAGE_LAYOUT_TEST_INSTANCE_ID,
- }),
- toDraftPageLayout(persistedPageLayout),
- );
-
- const { result } = renderHook(() => usePageLayoutDraftState(), {
- wrapper: ({ children }: { children: ReactNode }) => (
- <PageLayoutTestWrapper store={store}>
- {children}
- </PageLayoutTestWrapper>
- ),
- });
-
- expect(result.current.isDirty).toBe(false);
-
- act(() => {
- result.current.setPageLayoutDraft((draft) => ({
- ...draft,
- defaultTabToFocusOnMobileAndSidePanelId: 'tab-1',
- }));
- });
-
- expect(result.current.isDirty).toBe(true);
-
- act(() => {
- result.current.setPageLayoutDraft((draft) => ({
- ...draft,
- defaultTabToFocusOnMobileAndSidePanelId,
- }));
- });
-
- expect(result.current.isDirty).toBe(false);
- },
- );
-
- it('should detect dirty state when draft differs from persisted', () => {
- const { result } = renderHook(
- () => usePageLayoutDraftState(PAGE_LAYOUT_TEST_INSTANCE_ID),
- {
- wrapper: PageLayoutTestWrapper,
- },
- );
-
- expect(result.current.isDirty).toBe(false);
- expect(result.current.canSave).toBe(false);
- });
-
- it('should handle empty name as not saveable', () => {
- const { result } = renderHook(
- () => usePageLayoutDraftState(PAGE_LAYOUT_TEST_INSTANCE_ID),
- {
- wrapper: PageLayoutTestWrapper,
- },
- );
-
- act(() => {
- result.current.setPageLayoutDraft({
- id: 'test-layout',
- name: ' ',
- type: PageLayoutType.DASHBOARD,
- isFirstTabPinned: true,
- objectMetadataId: null,
- tabs: [],
- });
- });
-
- expect(result.current.isDirty).toBe(false);
- expect(result.current.canSave).toBe(false);
- });
-
- it('should allow updating draft state', () => {
- const { result } = renderHook(
- () => usePageLayoutDraftState(PAGE_LAYOUT_TEST_INSTANCE_ID),
- {
- wrapper: PageLayoutTestWrapper,
- },
- );
-
- act(() => {
- result.current.setPageLayoutDraft({
- id: 'test-layout',
- name: 'Updated Name',
- type: PageLayoutType.DASHBOARD,
- isFirstTabPinned: true,
- objectMetadataId: null,
- tabs: [],
- });
- });
-
- expect(result.current.pageLayoutDraft.name).toBe('Updated Name');
- expect(result.current.canSave).toBe(true);
- expect(result.current.isDirty).toBe(true);
- });
-
- it('should detect changes in widgets', () => {
- const { result } = renderHook(
- () => usePageLayoutDraftState(PAGE_LAYOUT_TEST_INSTANCE_ID),
- {
- wrapper: PageLayoutTestWrapper,
- },
- );
-
- act(() => {
- result.current.setPageLayoutDraft({
- id: 'test-layout',
- name: 'Test Layout',
- type: PageLayoutType.DASHBOARD,
- isFirstTabPinned: true,
- objectMetadataId: null,
- tabs: [
- {
- isSystemSideEffect: false,
- universalIdentifier: 'universal-identifier-mock',
- id: 'tab-1',
- applicationId: '',
- title: 'Tab 1',
- isActive: true,
- position: 0,
- pageLayoutId: '',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- isSystemSideEffect: false,
- universalIdentifier: 'universal-identifier-mock',
- id: 'widget-1',
- applicationId: '',
- pageLayoutTabId: 'tab-1',
- title: 'New Widget',
- isActive: true,
- type: WidgetType.GRAPH,
- position: {
- __typename: 'PageLayoutWidgetGridPosition' as const,
- layoutMode: PageLayoutTabLayoutMode.GRID,
- row: 2,
- column: 2,
- rowSpan: 2,
- columnSpan: 2,
- },
- configuration: {
- configurationType: WidgetConfigurationType.BAR_CHART,
- layout: BarChartLayout.VERTICAL,
- aggregateOperation: AggregateOperations.COUNT,
- aggregateFieldMetadataId: 'id',
- primaryAxisGroupByFieldMetadataId: 'createdAt',
- primaryAxisOrderBy: GraphOrderBy.FIELD_ASC,
- displayDataLabel: false,
- },
- objectMetadataId: null,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
- });
- });
-
- expect(result.current.isDirty).toBe(true);
- expect(result.current.canSave).toBe(true);
- });
-});
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useIsCurrentObjectCustom.ts b/packages/twenty-front/src/modules/page-layout/hooks/useIsCurrentObjectCustom.ts
deleted file mode 100644
index b8cfca54a95..00000000000
--- a/packages/twenty-front/src/modules/page-layout/hooks/useIsCurrentObjectCustom.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { useGetIsMetadataItemCustom } from '@/object-metadata/hooks/useGetIsMetadataItemCustom';
-import { objectMetadataItemFamilySelector } from '@/object-metadata/states/objectMetadataItemFamilySelector';
-import { useLayoutRenderingContext } from '@/ui/layout/contexts/LayoutRenderingContext';
-import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
-import { isDefined } from 'twenty-shared/utils';
-
-export const useIsCurrentObjectCustom = () => {
- const { targetRecordIdentifier } = useLayoutRenderingContext();
-
- const getIsMetadataItemCustom = useGetIsMetadataItemCustom();
-
- const objectMetadataItem = useAtomFamilySelectorValue(
- objectMetadataItemFamilySelector,
- {
- objectName: targetRecordIdentifier?.targetObjectNameSingular ?? '',
- objectNameType: 'singular',
- },
- );
-
- if (!isDefined(targetRecordIdentifier)) {
- return { isCustom: true };
- }
-
- if (!isDefined(objectMetadataItem)) {
- return { isCustom: true };
- }
-
- return { isCustom: getIsMetadataItemCustom(objectMetadataItem) };
-};
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutDraftState.ts b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutDraftState.ts
deleted file mode 100644
index 4c6c2f58ed8..00000000000
--- a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutDraftState.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { PageLayoutComponentInstanceContext } from '@/page-layout/states/contexts/PageLayoutComponentInstanceContext';
-import { pageLayoutDraftComponentState } from '@/page-layout/states/pageLayoutDraftComponentState';
-import { pageLayoutPersistedComponentState } from '@/page-layout/states/pageLayoutPersistedComponentState';
-import { toDraftPageLayout } from '@/page-layout/utils/toDraftPageLayout';
-import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
-import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentState';
-import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
-
-export const usePageLayoutDraftState = (pageLayoutIdFromProps?: string) => {
- const pageLayoutId = useAvailableComponentInstanceIdOrThrow(
- PageLayoutComponentInstanceContext,
- pageLayoutIdFromProps,
- );
-
- const [pageLayoutDraft, setPageLayoutDraft] = useAtomComponentState(
- pageLayoutDraftComponentState,
- pageLayoutId,
- );
- const pageLayoutPersisted = useAtomComponentStateValue(
- pageLayoutPersistedComponentState,
- pageLayoutId,
- );
-
- const isDirty = pageLayoutPersisted
- ? !isDeeplyEqual(pageLayoutDraft, toDraftPageLayout(pageLayoutPersisted))
- : pageLayoutDraft.name.trim().length > 0 || pageLayoutDraft.tabs.length > 0;
-
- const canSave = pageLayoutDraft.name?.trim().length > 0;
-
- return {
- pageLayoutDraft,
- setPageLayoutDraft,
- isDirty,
- canSave,
- };
-};
diff --git a/packages/twenty-front/src/modules/page-layout/states/savedPageLayoutsComponentState.ts b/packages/twenty-front/src/modules/page-layout/states/savedPageLayoutsComponentState.ts
deleted file mode 100644
index a3346c4564f..00000000000
--- a/packages/twenty-front/src/modules/page-layout/states/savedPageLayoutsComponentState.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { createAtomComponentState } from '@/ui/utilities/state/jotai/utils/createAtomComponentState';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-
-import { PageLayoutComponentInstanceContext } from './contexts/PageLayoutComponentInstanceContext';
-
-export const savedPageLayoutsComponentState = createAtomComponentState<
- PageLayout[]
->({
- key: 'savedPageLayoutsComponentState',
- defaultValue: [],
- componentInstanceContext: PageLayoutComponentInstanceContext,
-});
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/computeFieldsWidgetFieldDiff.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/computeFieldsWidgetFieldDiff.test.ts
deleted file mode 100644
index af56e939b8d..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/computeFieldsWidgetFieldDiff.test.ts
+++ /dev/null
@@ -1,337 +0,0 @@
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-import { computeFieldsWidgetFieldDiff } from '@/page-layout/utils/computeFieldsWidgetFieldDiff';
-import { type FieldsWidgetGroup } from '@/page-layout/widgets/fields/types/FieldsWidgetGroup';
-
-const mockFieldMetadataItem = {
- id: 'field-meta-1',
- name: 'name',
- label: 'Name',
- type: 'TEXT',
-} as FieldMetadataItem;
-
-const makeGroup = (
- overrides: Partial<FieldsWidgetGroup> & { id: string },
-): FieldsWidgetGroup => ({
- name: 'Group',
- position: 0,
- isVisible: true,
- fields: [],
- ...overrides,
-});
-
-describe('computeFieldsWidgetFieldDiff', () => {
- it('should return empty updates when both arrays are empty', () => {
- const result = computeFieldsWidgetFieldDiff([], []);
-
- expect(result).toEqual([]);
- });
-
- it('should return empty updates when fields are identical', () => {
- const groups: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- ];
-
- const result = computeFieldsWidgetFieldDiff(groups, groups);
-
- expect(result).toEqual([]);
- });
-
- it('should detect visibility changes', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: false,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- ];
-
- const result = computeFieldsWidgetFieldDiff(persisted, draft);
-
- expect(result).toEqual([{ viewFieldId: 'vf1', isVisible: false }]);
- });
-
- it('should detect position changes', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 3,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- ];
-
- const result = computeFieldsWidgetFieldDiff(persisted, draft);
-
- expect(result).toEqual([{ viewFieldId: 'vf1', position: 3 }]);
- });
-
- it('should detect group changes (field moved to different group)', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- makeGroup({ id: 'g2' }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1' }),
- makeGroup({
- id: 'g2',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- ];
-
- const result = computeFieldsWidgetFieldDiff(persisted, draft);
-
- expect(result).toEqual([{ viewFieldId: 'vf1', viewFieldGroupId: 'g2' }]);
- });
-
- it('should detect multiple simultaneous changes on a field', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- makeGroup({ id: 'g2' }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1' }),
- makeGroup({
- id: 'g2',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 5,
- isVisible: false,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- ];
-
- const result = computeFieldsWidgetFieldDiff(persisted, draft);
-
- expect(result).toEqual([
- {
- viewFieldId: 'vf1',
- isVisible: false,
- position: 5,
- viewFieldGroupId: 'g2',
- },
- ]);
- });
-
- it('should skip fields without viewFieldId', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- },
- ],
- }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 5,
- isVisible: false,
- globalIndex: 0,
- },
- ],
- }),
- ];
-
- const result = computeFieldsWidgetFieldDiff(persisted, draft);
-
- expect(result).toEqual([]);
- });
-
- it('should skip fields not found in persisted state', () => {
- const persisted: FieldsWidgetGroup[] = [makeGroup({ id: 'g1' })];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf-new',
- },
- ],
- }),
- ];
-
- const result = computeFieldsWidgetFieldDiff(persisted, draft);
-
- expect(result).toEqual([]);
- });
-
- it('should handle multiple fields across multiple groups', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 1,
- isVisible: true,
- globalIndex: 1,
- viewFieldId: 'vf2',
- },
- ],
- }),
- makeGroup({
- id: 'g2',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: false,
- globalIndex: 2,
- viewFieldId: 'vf3',
- },
- ],
- }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 1,
- isVisible: false,
- globalIndex: 1,
- viewFieldId: 'vf2',
- },
- ],
- }),
- makeGroup({
- id: 'g2',
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 2,
- viewFieldId: 'vf3',
- },
- ],
- }),
- ];
-
- const result = computeFieldsWidgetFieldDiff(persisted, draft);
-
- expect(result).toHaveLength(2);
- expect(result).toContainEqual({ viewFieldId: 'vf2', isVisible: false });
- expect(result).toContainEqual({ viewFieldId: 'vf3', isVisible: true });
- });
-});
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/computeFieldsWidgetGroupDiff.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/computeFieldsWidgetGroupDiff.test.ts
deleted file mode 100644
index a686e9f5515..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/computeFieldsWidgetGroupDiff.test.ts
+++ /dev/null
@@ -1,191 +0,0 @@
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-import { computeFieldsWidgetGroupDiff } from '@/page-layout/utils/computeFieldsWidgetGroupDiff';
-import { type FieldsWidgetGroup } from '@/page-layout/widgets/fields/types/FieldsWidgetGroup';
-
-const mockFieldMetadataItem = {
- id: 'field-meta-1',
- name: 'name',
- label: 'Name',
- type: 'TEXT',
-} as FieldMetadataItem;
-
-const makeGroup = (
- overrides: Partial<FieldsWidgetGroup> & { id: string },
-): FieldsWidgetGroup => ({
- name: 'Group',
- position: 0,
- isVisible: true,
- fields: [],
- ...overrides,
-});
-
-describe('computeFieldsWidgetGroupDiff', () => {
- it('should return empty diffs when both arrays are empty', () => {
- const result = computeFieldsWidgetGroupDiff([], []);
-
- expect(result).toEqual({
- createdGroups: [],
- deletedGroups: [],
- updatedGroups: [],
- });
- });
-
- it('should return empty diffs when groups are identical', () => {
- const groups: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'Group 1', position: 0 }),
- makeGroup({ id: 'g2', name: 'Group 2', position: 1 }),
- ];
-
- const result = computeFieldsWidgetGroupDiff(groups, groups);
-
- expect(result).toEqual({
- createdGroups: [],
- deletedGroups: [],
- updatedGroups: [],
- });
- });
-
- it('should detect created groups', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'Group 1', position: 0 }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'Group 1', position: 0 }),
- makeGroup({ id: 'g2', name: 'New Group', position: 1 }),
- ];
-
- const result = computeFieldsWidgetGroupDiff(persisted, draft);
-
- expect(result.createdGroups).toHaveLength(1);
- expect(result.createdGroups[0].id).toBe('g2');
- expect(result.deletedGroups).toHaveLength(0);
- expect(result.updatedGroups).toHaveLength(0);
- });
-
- it('should detect deleted groups', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'Group 1', position: 0 }),
- makeGroup({ id: 'g2', name: 'Group 2', position: 1 }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'Group 1', position: 0 }),
- ];
-
- const result = computeFieldsWidgetGroupDiff(persisted, draft);
-
- expect(result.createdGroups).toHaveLength(0);
- expect(result.deletedGroups).toHaveLength(1);
- expect(result.deletedGroups[0].id).toBe('g2');
- expect(result.updatedGroups).toHaveLength(0);
- });
-
- it('should detect updated groups when name changes', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'Old Name', position: 0 }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'New Name', position: 0 }),
- ];
-
- const result = computeFieldsWidgetGroupDiff(persisted, draft);
-
- expect(result.updatedGroups).toHaveLength(1);
- expect(result.updatedGroups[0].name).toBe('New Name');
- });
-
- it('should detect updated groups when position changes', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'Group 1', position: 0 }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'Group 1', position: 5 }),
- ];
-
- const result = computeFieldsWidgetGroupDiff(persisted, draft);
-
- expect(result.updatedGroups).toHaveLength(1);
- expect(result.updatedGroups[0].position).toBe(5);
- });
-
- it('should detect updated groups when visibility changes', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', isVisible: true }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', isVisible: false }),
- ];
-
- const result = computeFieldsWidgetGroupDiff(persisted, draft);
-
- expect(result.updatedGroups).toHaveLength(1);
- expect(result.updatedGroups[0].isVisible).toBe(false);
- });
-
- it('should handle simultaneous creates, deletes, and updates', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'Group 1', position: 0 }),
- makeGroup({ id: 'g2', name: 'To Delete', position: 1 }),
- makeGroup({ id: 'g3', name: 'To Update', position: 2 }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({ id: 'g1', name: 'Group 1', position: 0 }),
- makeGroup({ id: 'g3', name: 'Updated Name', position: 2 }),
- makeGroup({ id: 'g4', name: 'New Group', position: 3 }),
- ];
-
- const result = computeFieldsWidgetGroupDiff(persisted, draft);
-
- expect(result.createdGroups).toHaveLength(1);
- expect(result.createdGroups[0].id).toBe('g4');
- expect(result.deletedGroups).toHaveLength(1);
- expect(result.deletedGroups[0].id).toBe('g2');
- expect(result.updatedGroups).toHaveLength(1);
- expect(result.updatedGroups[0].id).toBe('g3');
- });
-
- it('should not mark group as updated when fields differ but group props are same', () => {
- const persisted: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- name: 'Group 1',
- position: 0,
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: true,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- ];
-
- const draft: FieldsWidgetGroup[] = [
- makeGroup({
- id: 'g1',
- name: 'Group 1',
- position: 0,
- fields: [
- {
- fieldMetadataItem: mockFieldMetadataItem,
- position: 0,
- isVisible: false,
- globalIndex: 0,
- viewFieldId: 'vf1',
- },
- ],
- }),
- ];
-
- const result = computeFieldsWidgetGroupDiff(persisted, draft);
-
- expect(result.updatedGroups).toHaveLength(0);
- });
-});
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/removeTabLayouts.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/removeTabLayouts.test.ts
deleted file mode 100644
index 36d76880df4..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/removeTabLayouts.test.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { removeTabLayouts } from '@/page-layout/utils/removeTabLayouts';
-
-describe('removeTabLayouts', () => {
- it('should remove the specified tab and return the rest', () => {
- const allTabLayouts = {
- 'tab-1': { lg: [], md: [] },
- 'tab-2': { lg: [], md: [] },
- 'tab-3': { lg: [], md: [] },
- };
-
- const result = removeTabLayouts(allTabLayouts, 'tab-2');
-
- expect(result).toEqual({
- 'tab-1': { lg: [], md: [] },
- 'tab-3': { lg: [], md: [] },
- });
- expect(result).not.toHaveProperty('tab-2');
- });
-
- it('should return the same object reference when tab does not exist', () => {
- const allTabLayouts = {
- 'tab-1': { lg: [], md: [] },
- };
-
- const result = removeTabLayouts(allTabLayouts, 'non-existent');
-
- expect(result).toBe(allTabLayouts);
- });
-
- it('should return empty object when removing the only tab', () => {
- const allTabLayouts = {
- 'tab-1': { lg: [], md: [] },
- };
-
- const result = removeTabLayouts(allTabLayouts, 'tab-1');
-
- expect(result).toEqual({});
- });
-
- it('should not mutate the original object', () => {
- const allTabLayouts = {
- 'tab-1': { lg: [], md: [] },
- 'tab-2': { lg: [], md: [] },
- };
-
- removeTabLayouts(allTabLayouts, 'tab-1');
-
- expect(allTabLayouts).toHaveProperty('tab-1');
- expect(allTabLayouts).toHaveProperty('tab-2');
- });
-});
diff --git a/packages/twenty-front/src/modules/page-layout/utils/computeFieldsWidgetFieldDiff.ts b/packages/twenty-front/src/modules/page-layout/utils/computeFieldsWidgetFieldDiff.ts
deleted file mode 100644
index b04802dbfb8..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/computeFieldsWidgetFieldDiff.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import { type FieldsWidgetGroup } from '@/page-layout/widgets/fields/types/FieldsWidgetGroup';
-import { isDefined } from 'twenty-shared/utils';
-
-export const computeFieldsWidgetFieldDiff = (
- persistedGroups: FieldsWidgetGroup[],
- draftGroups: FieldsWidgetGroup[],
-) => {
- const fieldUpdates: Array<{
- viewFieldId: string;
- isVisible?: boolean;
- position?: number;
- viewFieldGroupId?: string;
- }> = [];
-
- const persistedFieldMap = new Map<
- string,
- {
- isVisible: boolean;
- position: number;
- groupId: string;
- }
- >();
-
- for (const group of persistedGroups) {
- for (const field of group.fields) {
- if (isDefined(field.viewFieldId)) {
- persistedFieldMap.set(field.viewFieldId, {
- isVisible: field.isVisible,
- position: field.position,
- groupId: group.id,
- });
- }
- }
- }
-
- for (const draftGroup of draftGroups) {
- for (const draftField of draftGroup.fields) {
- if (!isDefined(draftField.viewFieldId)) {
- continue;
- }
-
- const persistedField = persistedFieldMap.get(draftField.viewFieldId);
-
- if (!isDefined(persistedField)) {
- continue;
- }
-
- const hasVisibilityChange =
- persistedField.isVisible !== draftField.isVisible;
- const hasPositionChange = persistedField.position !== draftField.position;
- const hasGroupChange = persistedField.groupId !== draftGroup.id;
-
- if (hasVisibilityChange || hasPositionChange || hasGroupChange) {
- fieldUpdates.push({
- viewFieldId: draftField.viewFieldId,
- ...(hasVisibilityChange ? { isVisible: draftField.isVisible } : {}),
- ...(hasPositionChange ? { position: draftField.position } : {}),
- ...(hasGroupChange ? { viewFieldGroupId: draftGroup.id } : {}),
- });
- }
- }
- }
-
- return fieldUpdates;
-};
diff --git a/packages/twenty-front/src/modules/page-layout/utils/computeFieldsWidgetGroupDiff.ts b/packages/twenty-front/src/modules/page-layout/utils/computeFieldsWidgetGroupDiff.ts
deleted file mode 100644
index 97468fcde0d..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/computeFieldsWidgetGroupDiff.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { type FieldsWidgetGroup } from '@/page-layout/widgets/fields/types/FieldsWidgetGroup';
-import { isDefined } from 'twenty-shared/utils';
-
-export const computeFieldsWidgetGroupDiff = (
- persistedGroups: FieldsWidgetGroup[],
- draftGroups: FieldsWidgetGroup[],
-) => {
- const persistedGroupIds = new Set(persistedGroups.map((g) => g.id));
- const draftGroupIds = new Set(draftGroups.map((g) => g.id));
-
- const createdGroups = draftGroups.filter((g) => !persistedGroupIds.has(g.id));
-
- const deletedGroups = persistedGroups.filter((g) => !draftGroupIds.has(g.id));
-
- const updatedGroups = draftGroups.filter((draftGroup) => {
- if (!persistedGroupIds.has(draftGroup.id)) {
- return false;
- }
-
- const persistedGroup = persistedGroups.find((g) => g.id === draftGroup.id);
-
- if (!isDefined(persistedGroup)) {
- return false;
- }
-
- return (
- persistedGroup.name !== draftGroup.name ||
- persistedGroup.position !== draftGroup.position ||
- persistedGroup.isVisible !== draftGroup.isVisible
- );
- });
-
- return { createdGroups, deletedGroups, updatedGroups };
-};
diff --git a/packages/twenty-front/src/modules/page-layout/utils/removeTabLayouts.ts b/packages/twenty-front/src/modules/page-layout/utils/removeTabLayouts.ts
deleted file mode 100644
index 4e004c5ecd0..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/removeTabLayouts.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { isDefined } from 'twenty-shared/utils';
-import { type TabLayouts } from '@/page-layout/types/TabLayouts';
-
-export const removeTabLayouts = (
- allTabLayouts: TabLayouts,
- tabId: string,
-): TabLayouts => {
- if (!isDefined(allTabLayouts[tabId])) {
- return allTabLayouts;
- }
-
- const { [tabId]: _removed, ...rest } = allTabLayouts;
- return rest;
-};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/hooks/useDeleteViewForFieldsWidget.ts b/packages/twenty-front/src/modules/page-layout/widgets/fields/hooks/useDeleteViewForFieldsWidget.ts
deleted file mode 100644
index dc5a3d2b31a..00000000000
--- a/packages/twenty-front/src/modules/page-layout/widgets/fields/hooks/useDeleteViewForFieldsWidget.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { usePerformViewAPIPersist } from '@/views/hooks/internal/usePerformViewAPIPersist';
-import { useCallback } from 'react';
-
-export const useDeleteViewForFieldsWidget = () => {
- const { performViewAPIDestroy } = usePerformViewAPIPersist();
-
- const deleteViewForFieldsWidget = useCallback(
- async (viewId: string) => {
- await performViewAPIDestroy({ id: viewId });
- },
- [performViewAPIDestroy],
- );
-
- return { deleteViewForFieldsWidget };
-};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/constants/GraphDefaultColor.constant.ts b/packages/twenty-front/src/modules/page-layout/widgets/graph/constants/GraphDefaultColor.constant.ts
deleted file mode 100644
index bccce042e8f..00000000000
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/constants/GraphDefaultColor.constant.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { type GraphColor } from '@/page-layout/widgets/graph/types/GraphColor';
-
-export const GRAPH_DEFAULT_COLOR: GraphColor = 'blue';
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-bar-chart/utils/computeSliceHighlightPosition.ts b/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-bar-chart/utils/computeSliceHighlightPosition.ts
deleted file mode 100644
index bd4b83c94f8..00000000000
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-bar-chart/utils/computeSliceHighlightPosition.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { BAR_CHART_CONSTANTS } from '@/page-layout/widgets/graph/graph-widget-bar-chart/constants/BarChartConstants';
-
-type ComputeSliceHighlightPositionParams = {
- sliceCenter: number | null;
- isVerticalLayout: boolean;
- innerWidth: number;
- innerHeight: number;
-};
-
-type SliceHighlightPosition = {
- x: number;
- y: number;
- width: number;
- height: number;
-};
-
-export const computeSliceHighlightPosition = ({
- sliceCenter,
- isVerticalLayout,
- innerWidth,
- innerHeight,
-}: ComputeSliceHighlightPositionParams): SliceHighlightPosition => {
- const center = sliceCenter ?? 0;
- const halfThickness = BAR_CHART_CONSTANTS.SLICE_HIGHLIGHT_THICKNESS / 2;
-
- return {
- x: isVerticalLayout ? center - halfThickness : 0,
- y: isVerticalLayout ? 0 : center - halfThickness,
- width: isVerticalLayout
- ? BAR_CHART_CONSTANTS.SLICE_HIGHLIGHT_THICKNESS
- : innerWidth,
- height: isVerticalLayout
- ? innerHeight
- : BAR_CHART_CONSTANTS.SLICE_HIGHLIGHT_THICKNESS,
- };
-};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-pie-chart/constants/PieChartCenterMetricMinSizes.ts b/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-pie-chart/constants/PieChartCenterMetricMinSizes.ts
deleted file mode 100644
index 41f79dc970d..00000000000
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-pie-chart/constants/PieChartCenterMetricMinSizes.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const PIE_CHART_CENTER_METRIC_MIN_SIZES = {
- valueFontSize: 12,
- labelFontSize: 10,
- labelOffset: 12,
-} as const;
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-pie-chart/constants/PieChartCenterMetricRatios.ts b/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-pie-chart/constants/PieChartCenterMetricRatios.ts
deleted file mode 100644
index 85ee84dc26d..00000000000
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graph-widget-pie-chart/constants/PieChartCenterMetricRatios.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const PIE_CHART_CENTER_METRIC_RATIOS = {
- valueFontSize: 0.25,
- labelFontSize: 0.12,
- labelOffset: 0.15,
-} as const;
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelsGeneral.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelsGeneral.tsx
deleted file mode 100644
index ff44fb8529a..00000000000
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelsGeneral.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-import { CalendarMonthCard } from '@/activities/calendar/components/CalendarMonthCard';
-import { CalendarContext } from '@/activities/calendar/contexts/CalendarContext';
-import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
-import { DATE_TIME_SETTINGS_PREVIEW_DATE } from '@/localization/constants/DateTimeSettingsPreviewDate';
-import { SettingsAccountsCalendarDisplaySettings } from '@/settings/accounts/components/SettingsAccountsCalendarDisplaySettings';
-import { styled } from '@linaria/react';
-import { t } from '@lingui/core/macro';
-import { Section } from 'twenty-ui/layout';
-import { addMinutes, endOfDay, min, startOfDay } from 'date-fns';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { H2Title } from 'twenty-ui/typography';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-import {
- CalendarChannelVisibility,
- type TimelineCalendarEvent,
-} from '~/generated/graphql';
-
-const StyledGeneralContainer = styled.div`
- display: flex;
- flex-direction: column;
- gap: ${themeCssVariables.spacing[6]};
- padding-top: ${themeCssVariables.spacing[6]};
-`;
-
-export const SettingsAccountsCalendarChannelsGeneral = () => {
- const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
-
- const exampleStartDate = DATE_TIME_SETTINGS_PREVIEW_DATE;
- const exampleEndDate = min([
- addMinutes(exampleStartDate, 30),
- endOfDay(exampleStartDate),
- ]);
- const exampleDayTime = startOfDay(exampleStartDate).getTime();
- const exampleCalendarEvent: TimelineCalendarEvent = {
- id: '',
- participants: [
- {
- firstName: currentWorkspaceMember?.name.firstName || '',
- lastName: currentWorkspaceMember?.name.lastName || '',
- displayName: currentWorkspaceMember
- ? [
- currentWorkspaceMember.name.firstName,
- currentWorkspaceMember.name.lastName,
- ].join(' ')
- : '',
- avatarUrl: currentWorkspaceMember?.avatarUrl || '',
- handle: '',
- personId: '',
- workspaceMemberId: currentWorkspaceMember?.id || '',
- },
- ],
- callRecordings: [],
- endsAt: exampleEndDate.toISOString(),
- isFullDay: false,
- startsAt: exampleStartDate.toISOString(),
- conferenceSolution: '',
- conferenceLink: {
- primaryLinkLabel: '',
- primaryLinkUrl: '',
- },
- description: '',
- isCanceled: false,
- location: '',
- title: t`Onboarding call`,
- visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
- };
-
- return (
- <StyledGeneralContainer>
- <Section>
- <H2Title
- title={t`Display`}
- description={t`Configure how we should display your events in your calendar`}
- />
- <SettingsAccountsCalendarDisplaySettings />
- </Section>
- <Section>
- <H2Title
- title={t`Color code`}
- description={t`Events you participated in are displayed in red.`}
- />
- <CalendarContext.Provider
- value={{
- calendarEventsByDayTime: {
- [exampleDayTime]: [exampleCalendarEvent],
- },
- }}
- >
- <CalendarMonthCard dayTimes={[exampleDayTime]} />
- </CalendarContext.Provider>
- </Section>
- </StyledGeneralContainer>
- );
-};
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCardMedia.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCardMedia.tsx
deleted file mode 100644
index a0ab6adcaeb..00000000000
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCardMedia.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { styled } from '@linaria/react';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-
-const StyledCardMedia = styled.div`
- align-items: center;
- border: 2px solid ${themeCssVariables.border.color.medium};
- border-radius: ${themeCssVariables.border.radius.sm};
- color: ${themeCssVariables.font.color.light};
- display: flex;
- flex-direction: column;
- gap: ${themeCssVariables.spacing['0.5']};
- height: ${themeCssVariables.spacing[8]};
- justify-content: center;
- padding: ${themeCssVariables.spacing['0.5']};
- width: ${themeCssVariables.spacing[6]};
-`;
-
-export { StyledCardMedia as SettingsAccountsCardMedia };
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsToggleSettingCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsToggleSettingCard.tsx
deleted file mode 100644
index a70f2b41a4c..00000000000
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsToggleSettingCard.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { styled } from '@linaria/react';
-import { Card, CardContent } from 'twenty-ui/surfaces';
-import { Toggle } from 'twenty-ui/input';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-
-type Parameter = {
- value: boolean;
- title: string;
- description: string;
- onToggle: (value: boolean) => void;
-};
-
-type SettingsAccountsToggleSettingCardProps = {
- parameters: Parameter[];
-};
-
-const StyledCardContentContainer = styled.div`
- > div {
- align-items: center;
- cursor: pointer;
- display: flex;
- gap: ${themeCssVariables.spacing[4]};
-
- &:hover {
- background: ${themeCssVariables.background.transparent.lighter};
- }
- }
-`;
-
-const StyledTitle = styled.div`
- color: ${themeCssVariables.font.color.primary};
- font-weight: ${themeCssVariables.font.weight.medium};
- margin-bottom: ${themeCssVariables.spacing[2]};
-`;
-
-const StyledDescription = styled.div`
- color: ${themeCssVariables.font.color.tertiary};
- font-size: ${themeCssVariables.font.size.sm};
-`;
-
-const StyledToggleContainer = styled.span`
- align-items: center;
- display: flex;
- margin-left: auto;
-`;
-
-export const SettingsAccountsToggleSettingCard = ({
- parameters,
-}: SettingsAccountsToggleSettingCardProps) => (
- <Card rounded>
- {parameters.map((parameter, index) => (
- <StyledCardContentContainer key={index}>
- <CardContent
- divider={index < parameters.length - 1}
- onClick={() => parameter.onToggle(!parameter.value)}
- >
- <div>
- <StyledTitle>{parameter.title}</StyledTitle>
- <StyledDescription>{parameter.description}</StyledDescription>
- </div>
- <StyledToggleContainer>
- <Toggle value={parameter.value} onChange={parameter.onToggle} />
- </StyledToggleContainer>
- </CardContent>
- </StyledCardContentContainer>
- ))}
- </Card>
-);
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/__stories__/SettingsAccountsCalendarChannelsGeneral.stories.tsx b/packages/twenty-front/src/modules/settings/accounts/components/__stories__/SettingsAccountsCalendarChannelsGeneral.stories.tsx
deleted file mode 100644
index 4e78381a085..00000000000
--- a/packages/twenty-front/src/modules/settings/accounts/components/__stories__/SettingsAccountsCalendarChannelsGeneral.stories.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-
-import { SettingsAccountsCalendarChannelsGeneral } from '@/settings/accounts/components/SettingsAccountsCalendarChannelsGeneral';
-import { ComponentDecorator } from 'twenty-ui/testing';
-import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';
-import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';
-import { MemoryRouterDecorator } from '~/testing/decorators/MemoryRouterDecorator';
-
-const meta: Meta<typeof SettingsAccountsCalendarChannelsGeneral> = {
- title:
- 'Modules/Settings/Accounts/CalendarChannels/SettingsAccountsCalendarChannelsGeneral',
- component: SettingsAccountsCalendarChannelsGeneral,
- decorators: [
- MemoryRouterDecorator,
- ComponentDecorator,
- ObjectMetadataItemsDecorator,
- SnackBarDecorator,
- ],
-};
-
-export default meta;
-type Story = StoryObj<typeof SettingsAccountsCalendarChannelsGeneral>;
-
-export const Default: Story = {
- play: async () => {},
-};
diff --git a/packages/twenty-front/src/modules/settings/accounts/graphql/mutations/updateMessageFolder.ts b/packages/twenty-front/src/modules/settings/accounts/graphql/mutations/updateMessageFolder.ts
deleted file mode 100644
index 7f7027cfcd7..00000000000
--- a/packages/twenty-front/src/modules/settings/accounts/graphql/mutations/updateMessageFolder.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { gql } from '@apollo/client';
-
-export const UPDATE_MESSAGE_FOLDER = gql`
- mutation UpdateMessageFolder($input: UpdateMessageFolderInput!) {
- updateMessageFolder(input: $input) {
- id
- isSynced
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/utils/useSourceContent.ts b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/utils/useSourceContent.ts
deleted file mode 100644
index d36ff768771..00000000000
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/utils/useSourceContent.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { useLingui } from '@lingui/react/macro';
-import { useContext } from 'react';
-import { CustomError } from 'twenty-shared/utils';
-import { ThemeContext } from 'twenty-ui/theme-constants';
-
-import { ConfigSource } from '~/generated-admin/graphql';
-
-export const useSourceContent = (source: ConfigSource) => {
- const { theme } = useContext(ThemeContext);
- const { t } = useLingui();
-
- switch (source) {
- case ConfigSource.DATABASE:
- return {
- text: t`Stored in database`,
- color: theme.color.blue10,
- };
- case ConfigSource.ENVIRONMENT:
- return {
- text: t`Environment variable`,
- color: theme.color.green10,
- };
- case ConfigSource.DEFAULT:
- return {
- text: t`Default value`,
- color: theme.font.color.tertiary,
- };
- default:
- throw new CustomError(`Unknown source: ${source}`, 'UNKNOWN_SOURCE');
- }
-};
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SubscriptionPrice.tsx b/packages/twenty-front/src/modules/settings/billing/components/SubscriptionPrice.tsx
deleted file mode 100644
index 4e0a92621cc..00000000000
--- a/packages/twenty-front/src/modules/settings/billing/components/SubscriptionPrice.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { styled } from '@linaria/react';
-import { useLingui } from '@lingui/react/macro';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-import { SubscriptionInterval } from '~/generated-metadata/graphql';
-
-type SubscriptionPriceProps = {
- type: SubscriptionInterval;
- price: number;
-};
-
-const StyledPriceSpan = styled.span`
- color: ${themeCssVariables.font.color.primary};
- font-size: ${themeCssVariables.font.size.xxl};
- font-weight: ${themeCssVariables.font.weight.semiBold};
- margin-bottom: ${themeCssVariables.spacing[1]};
-`;
-
-const StyledPriceUnitSpan = styled.span`
- color: ${themeCssVariables.font.color.light};
- font-size: ${themeCssVariables.font.size.md};
- font-weight: ${themeCssVariables.font.weight.medium};
-`;
-
-const formatYearlyPriceToMonthly = (price: number): number => {
- const monthlyPrice = price / 12;
-
- return Number.isInteger(monthlyPrice)
- ? monthlyPrice
- : Number(monthlyPrice.toFixed(2));
-};
-
-export const SubscriptionPrice = ({ type, price }: SubscriptionPriceProps) => {
- const { t } = useLingui();
- const pricePerSeat =
- type === SubscriptionInterval.Year
- ? formatYearlyPriceToMonthly(price)
- : price;
-
- let priceUnit = '';
- switch (type) {
- case SubscriptionInterval.Month:
- priceUnit = t`seat / month`;
- break;
- case SubscriptionInterval.Year:
- priceUnit = t`seat / month - billed yearly`;
- break;
- }
-
- return (
- <>
- <StyledPriceSpan>{`$${pricePerSeat}`}</StyledPriceSpan>
- <StyledPriceUnitSpan>{priceUnit}</StyledPriceUnitSpan>
- </>
- );
-};
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/__tests__/useListProducts.test.ts b/packages/twenty-front/src/modules/settings/billing/hooks/__tests__/useListProducts.test.ts
deleted file mode 100644
index 6bc6a1753b5..00000000000
--- a/packages/twenty-front/src/modules/settings/billing/hooks/__tests__/useListProducts.test.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { useListProducts } from '@/settings/billing/hooks/useListProducts';
-
-describe('useListProducts', () => {
- it('should be a function', () => {
- expect(typeof useListProducts).toBe('function');
- });
-});
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useListProducts.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useListProducts.ts
deleted file mode 100644
index ab279b9d5a8..00000000000
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useListProducts.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { usePlans } from '@/settings/billing/hooks/usePlans';
-
-export const useListProducts = () => {
- const { listPlans } = usePlans();
-
- const listProducts = () =>
- listPlans().flatMap((plan) => [
- ...plan.baseProducts,
- ...plan.resourceCreditProducts,
- ...plan.meteredProducts,
- ]);
-
- return { listProducts };
-};
diff --git a/packages/twenty-front/src/modules/settings/billing/types/billing-price-tiers.type.ts b/packages/twenty-front/src/modules/settings/billing/types/billing-price-tiers.type.ts
deleted file mode 100644
index 96d345588f3..00000000000
--- a/packages/twenty-front/src/modules/settings/billing/types/billing-price-tiers.type.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { BillingPriceMetered } from '~/generated-metadata/graphql';
-
-export type BillingPriceTiers = [
- {
- flatAmount: number;
- unitAmount: null;
- upTo: number;
- },
- {
- flatAmount: null;
- unitAmount: number;
- upTo: null;
- },
-];
-
-// graphql does not support tuple so we need to create a new type
-export type MeteredBillingPrice = Omit<BillingPriceMetered, 'tiers'> & {
- tiers: BillingPriceTiers;
-};
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsHeaderContainer.tsx b/packages/twenty-front/src/modules/settings/components/SettingsHeaderContainer.tsx
deleted file mode 100644
index 253e6768412..00000000000
--- a/packages/twenty-front/src/modules/settings/components/SettingsHeaderContainer.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { styled } from '@linaria/react';
-
-const StyledSettingsHeaderContainer = styled.div`
- align-items: center;
- display: flex;
- justify-content: space-between;
-`;
-
-export { StyledSettingsHeaderContainer as SettingsHeaderContainer };
diff --git a/packages/twenty-front/src/modules/settings/constants/ExpandedWidthAnimationVariants.ts b/packages/twenty-front/src/modules/settings/constants/ExpandedWidthAnimationVariants.ts
deleted file mode 100644
index b6f14423e0a..00000000000
--- a/packages/twenty-front/src/modules/settings/constants/ExpandedWidthAnimationVariants.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { ADVANCED_SETTINGS_ANIMATION_DURATION } from '@/settings/constants/AdvancedSettingsAnimationDurations';
-
-export const EXPANDED_WIDTH_ANIMATION_VARIANTS = {
- initial: {
- opacity: 0,
- width: 0,
- overflow: 'hidden',
- transition: {
- opacity: { duration: ADVANCED_SETTINGS_ANIMATION_DURATION.opacity },
- width: { duration: ADVANCED_SETTINGS_ANIMATION_DURATION.size },
- },
- },
- animate: {
- opacity: 1,
- width: '100%',
- overflow: 'hidden',
- transition: {
- opacity: { duration: ADVANCED_SETTINGS_ANIMATION_DURATION.opacity },
- width: { duration: ADVANCED_SETTINGS_ANIMATION_DURATION.size },
- },
- },
- exit: {
- opacity: 0,
- width: 0,
- overflow: 'hidden',
- transition: {
- opacity: { duration: ADVANCED_SETTINGS_ANIMATION_DURATION.opacity },
- width: { duration: ADVANCED_SETTINGS_ANIMATION_DURATION.size },
- },
- },
-};
diff --git a/packages/twenty-front/src/modules/settings/data-model/constants/ObjectSettings.ts b/packages/twenty-front/src/modules/settings/data-model/constants/ObjectSettings.ts
deleted file mode 100644
index ce074c87de2..00000000000
--- a/packages/twenty-front/src/modules/settings/data-model/constants/ObjectSettings.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const OBJECT_SETTINGS_WIDTH = 512;
diff --git a/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectItemTableRow.tsx b/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectItemTableRow.tsx
deleted file mode 100644
index a6c85822c62..00000000000
--- a/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectItemTableRow.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { useNumberFormat } from '@/localization/hooks/useNumberFormat';
-import { ObjectMetadataIcon } from '@/object-metadata/components/ObjectMetadataIcon';
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { TableCell } from '@/ui/layout/table/components/TableCell';
-import { TableRow } from '@/ui/layout/table/components/TableRow';
-import { styled } from '@linaria/react';
-import { useContext } from 'react';
-import { Checkbox } from 'twenty-ui/input';
-import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
-
-export const AVAILABLE_STANDARD_OBJECTS_GRID_TEMPLATE_COLUMNS =
- '28px 148px 256px 80px';
-
-type SettingsAvailableStandardObjectItemTableRowProps = {
- isSelected?: boolean;
- objectItem: EnrichedObjectMetadataItem;
- onClick?: () => void;
-};
-
-const StyledDescription = styled.div`
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-`;
-
-export const SettingsAvailableStandardObjectItemTableRow = ({
- isSelected,
- objectItem,
- onClick,
-}: SettingsAvailableStandardObjectItemTableRowProps) => {
- const { theme } = useContext(ThemeContext);
- const { formatNumber } = useNumberFormat();
-
- return (
- <TableRow
- gridTemplateColumns={AVAILABLE_STANDARD_OBJECTS_GRID_TEMPLATE_COLUMNS}
- key={objectItem.namePlural}
- isSelected={isSelected}
- onClick={onClick}
- >
- <TableCell
- align="center"
- padding={`0 0 0 ${themeCssVariables.spacing[1]}`}
- >
- <Checkbox checked={!!isSelected} />
- </TableCell>
- <TableCell
- color={themeCssVariables.font.color.primary}
- gap={themeCssVariables.spacing[2]}
- >
- <ObjectMetadataIcon
- objectMetadataItem={objectItem}
- size={theme.icon.size.md}
- />
- {objectItem.labelPlural}
- </TableCell>
- <TableCell>
- <StyledDescription>{objectItem.description}</StyledDescription>
- </TableCell>
- <TableCell align="right">
- {formatNumber(objectItem.fields.length)}
- </TableCell>
- </TableRow>
- );
-};
diff --git a/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectsSection.tsx b/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectsSection.tsx
deleted file mode 100644
index 4bb849ba8f8..00000000000
--- a/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectsSection.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { Table } from '@/ui/layout/table/components/Table';
-import { TableBody } from '@/ui/layout/table/components/TableBody';
-import { TableHeader } from '@/ui/layout/table/components/TableHeader';
-
-import { t } from '@lingui/core/macro';
-import { H2Title } from 'twenty-ui/typography';
-import { Section } from 'twenty-ui/layout';
-import { TableRow } from '@/ui/layout/table/components/TableRow';
-import {
- AVAILABLE_STANDARD_OBJECTS_GRID_TEMPLATE_COLUMNS,
- SettingsAvailableStandardObjectItemTableRow,
-} from './SettingsAvailableStandardObjectItemTableRow';
-
-type SettingsAvailableStandardObjectsSectionProps = {
- objectItems: EnrichedObjectMetadataItem[];
- onChange: (selectedIds: Record<string, boolean>) => void;
- selectedIds: Record<string, boolean>;
-};
-
-export const SettingsAvailableStandardObjectsSection = ({
- objectItems,
- onChange,
- selectedIds,
-}: SettingsAvailableStandardObjectsSectionProps) => (
- <Section>
- <H2Title
- title={t`Available`}
- description={t`Select one or several standard objects to activate below`}
- />
- <Table>
- <TableRow
- gridTemplateColumns={AVAILABLE_STANDARD_OBJECTS_GRID_TEMPLATE_COLUMNS}
- >
- <TableHeader></TableHeader>
- <TableHeader>{t`Name`}</TableHeader>
- <TableHeader>{t`Description`}</TableHeader>
- <TableHeader align="right">{t`Fields`}</TableHeader>
- </TableRow>
- <TableBody>
- {objectItems.map((objectItem) => (
- <SettingsAvailableStandardObjectItemTableRow
- key={objectItem.id}
- isSelected={selectedIds[objectItem.id]}
- objectItem={objectItem}
- onClick={() =>
- onChange({
- ...selectedIds,
- [objectItem.id]: !selectedIds[objectItem.id],
- })
- }
- />
- ))}
- </TableBody>
- </Table>
- </Section>
-);
diff --git a/packages/twenty-front/src/modules/settings/data-model/types/SettingsCompositeFieldType.ts b/packages/twenty-front/src/modules/settings/data-model/types/SettingsCompositeFieldType.ts
deleted file mode 100644
index 82d8013e045..00000000000
--- a/packages/twenty-front/src/modules/settings/data-model/types/SettingsCompositeFieldType.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { type CompositeFieldType } from '@/settings/data-model/types/CompositeFieldType';
-import { type SettingsFieldType } from '@/settings/data-model/types/SettingsFieldType';
-
-export type SettingsCompositeFieldType = Extract<
- SettingsFieldType,
- CompositeFieldType
->;
diff --git a/packages/twenty-front/src/modules/settings/data-model/utils/__tests__/getFieldPreviewValueFromRecord.test.ts b/packages/twenty-front/src/modules/settings/data-model/utils/__tests__/getFieldPreviewValueFromRecord.test.ts
deleted file mode 100644
index c162075a101..00000000000
--- a/packages/twenty-front/src/modules/settings/data-model/utils/__tests__/getFieldPreviewValueFromRecord.test.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-
-import { getTestEnrichedObjectMetadataItemsMock } from '~/testing/utils/getTestEnrichedObjectMetadataItemsMock';
-import { getFieldPreviewValueFromRecord } from '@/settings/data-model/utils/getFieldPreviewValueFromRecord';
-const mockedCompanyObjectMetadataItem =
- getTestEnrichedObjectMetadataItemsMock().find(
- (item) => item.nameSingular === 'company',
- );
-
-const mockedPersonObjectMetadataItem =
- getTestEnrichedObjectMetadataItemsMock().find(
- (item) => item.nameSingular === 'person',
- );
-
-describe('getFieldPreviewValueFromRecord', () => {
- describe('RELATION field', () => {
- it('returns the first relation record from a list of edges ("to many" relation)', () => {
- const firstRelationRecord = {
- id: '1',
- name: { firstName: 'Jane', lastName: 'Doe' },
- };
- const record: ObjectRecord = {
- id: '',
- people: {
- edges: [{ node: firstRelationRecord }, { node: { id: '2' } }],
- },
- __typename: 'Opportunity',
- };
- const fieldMetadataItem = mockedCompanyObjectMetadataItem?.fields.find(
- ({ name }) => name === 'people',
- );
-
- if (!fieldMetadataItem) {
- throw new Error('Field not found');
- }
-
- const result = getFieldPreviewValueFromRecord({
- record,
- fieldMetadataItem,
- });
-
- expect(result).toEqual(firstRelationRecord);
- });
-
- it('returns the record field value ("to one" relation)', () => {
- const relationRecord = { id: '20', name: 'Twenty' };
- const record = {
- id: '',
- company: relationRecord,
- __typename: 'Opportunity',
- };
- const fieldMetadataItem = mockedPersonObjectMetadataItem?.fields.find(
- ({ name }) => name === 'company',
- );
-
- if (!fieldMetadataItem) {
- throw new Error('Field not found');
- }
-
- const result = getFieldPreviewValueFromRecord({
- record,
- fieldMetadataItem,
- });
-
- expect(result).toEqual(relationRecord);
- });
- });
-
- describe('Other fields', () => {
- it('returns the record field value', () => {
- const record = { id: '', name: 'Twenty', __typename: 'Opportunity' };
- const fieldMetadataItem = mockedCompanyObjectMetadataItem?.fields.find(
- ({ name }) => name === 'name',
- );
-
- if (!fieldMetadataItem) {
- throw new Error('Field not found');
- }
-
- const result = getFieldPreviewValueFromRecord({
- record,
- fieldMetadataItem,
- });
-
- expect(result).toEqual(record.name);
- });
- });
-});
diff --git a/packages/twenty-front/src/modules/settings/data-model/utils/getFieldPreviewValueFromRecord.ts b/packages/twenty-front/src/modules/settings/data-model/utils/getFieldPreviewValueFromRecord.ts
deleted file mode 100644
index a0153130911..00000000000
--- a/packages/twenty-front/src/modules/settings/data-model/utils/getFieldPreviewValueFromRecord.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-import { FieldMetadataType } from '~/generated-metadata/graphql';
-
-export const getFieldPreviewValueFromRecord = ({
- record,
- fieldMetadataItem,
-}: {
- record: ObjectRecord;
- fieldMetadataItem: Pick<FieldMetadataItem, 'name' | 'type'>;
-}) => {
- const recordFieldValue = record[fieldMetadataItem.name];
-
- // todo @guillim : adjust this to handle morph relations
- // Relation fields (to many)
- if (
- fieldMetadataItem.type === FieldMetadataType.RELATION &&
- Array.isArray(recordFieldValue?.edges)
- ) {
- return recordFieldValue.edges[0]?.node;
- }
-
- return recordFieldValue;
-};
diff --git a/packages/twenty-front/src/modules/settings/emailing-domains/graphql/mutations/deleteEmailingDomain.ts b/packages/twenty-front/src/modules/settings/emailing-domains/graphql/mutations/deleteEmailingDomain.ts
deleted file mode 100644
index 98523e92601..00000000000
--- a/packages/twenty-front/src/modules/settings/emailing-domains/graphql/mutations/deleteEmailingDomain.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { gql } from '@apollo/client';
-
-export const DELETE_EMAILING_DOMAIN = gql`
- mutation DeleteEmailingDomain($id: String!) {
- deleteEmailingDomain(id: $id)
- }
-`;
diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTabEnvironmentVariableTableRow.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTabEnvironmentVariableTableRow.tsx
deleted file mode 100644
index d382445f893..00000000000
--- a/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTabEnvironmentVariableTableRow.tsx
+++ /dev/null
@@ -1,148 +0,0 @@
-import { TextInput } from '@/ui/input/components/TextInput';
-import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
-import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
-import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
-import { TableCell } from '@/ui/layout/table/components/TableCell';
-import { TableRow } from '@/ui/layout/table/components/TableRow';
-import { t } from '@lingui/core/macro';
-import React, { useState } from 'react';
-import {
- IconCheck,
- IconDotsVertical,
- IconPencil,
- IconTrash,
- IconX,
-} from 'twenty-ui/icon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/surfaces';
-import { LightIconButton } from 'twenty-ui/input';
-import { MenuItem } from 'twenty-ui/navigation';
-import type { ApplicationVariable } from '~/generated-metadata/graphql';
-
-const StyledEditModeTableRow = (
- props: React.ComponentProps<typeof TableRow>,
-) => (
- <TableRow
- gridTemplateColumns="180px auto 56px"
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...props}
- />
-);
-
-const StyledTableRow = (props: React.ComponentProps<typeof TableRow>) => (
- <TableRow
- gridTemplateColumns="180px 300px 32px"
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...props}
- />
-);
-
-export const SettingsLogicFunctionTabEnvironmentVariableTableRow = ({
- envVariable,
- onChange,
- onDelete,
- initialEditMode = false,
-}: {
- envVariable: ApplicationVariable;
- onChange: (newEnvVariable: ApplicationVariable) => void;
- onDelete: () => void;
- initialEditMode?: boolean;
-}) => {
- const [editedEnvVariable, setEditedEnvVariable] = useState(envVariable);
- const [editMode, setEditMode] = useState(initialEditMode);
- const dropDownId = `settings-environment-variable-dropdown-${envVariable.id}`;
- const { closeDropdown } = useCloseDropdown();
-
- return editMode ? (
- <StyledEditModeTableRow>
- <TableCell>
- <TextInput
- autoFocus
- value={editedEnvVariable.key}
- onChange={(newKey) =>
- setEditedEnvVariable({ ...editedEnvVariable, key: newKey })
- }
- placeholder={t`Name`}
- fullWidth
- />
- </TableCell>
- <TableCell>
- <TextInput
- value={editedEnvVariable.value}
- onChange={(newValue) =>
- setEditedEnvVariable({ ...editedEnvVariable, value: newValue })
- }
- placeholder={t`Value`}
- fullWidth
- />
- </TableCell>
- <TableCell>
- <LightIconButton
- accent="tertiary"
- Icon={IconX}
- onClick={() => {
- if (envVariable.key === '' && envVariable.value === '') {
- onDelete();
- }
- setEditedEnvVariable(envVariable);
- setEditMode(false);
- }}
- />
- <LightIconButton
- accent="tertiary"
- Icon={IconCheck}
- disabled={
- editedEnvVariable.key === '' || editedEnvVariable.value === ''
- }
- onClick={() => {
- onChange(editedEnvVariable);
- setEditMode(false);
- }}
- />
- </TableCell>
- </StyledEditModeTableRow>
- ) : (
- <StyledTableRow onClick={() => setEditMode(true)}>
- <TableCell>
- <OverflowingTextWithTooltip text={envVariable.key} />
- </TableCell>
- <TableCell>
- <OverflowingTextWithTooltip text={envVariable.value} />
- </TableCell>
- <TableCell>
- <Dropdown
- dropdownId={dropDownId}
- clickableComponent={
- <LightIconButton
- aria-label={t`Env Variable Options`}
- Icon={IconDotsVertical}
- accent="tertiary"
- />
- }
- dropdownComponents={
- <DropdownContent>
- <DropdownMenuItemsContainer>
- <MenuItem
- text={t`Edit`}
- LeftIcon={IconPencil}
- onClick={() => {
- setEditMode(true);
- closeDropdown(dropDownId);
- }}
- />
- <MenuItem
- text={t`Delete`}
- LeftIcon={IconTrash}
- onClick={() => {
- onDelete();
- closeDropdown(dropDownId);
- }}
- />
- </DropdownMenuItemsContainer>
- </DropdownContent>
- }
- />
- </TableCell>
- </StyledTableRow>
- );
-};
diff --git a/packages/twenty-front/src/modules/settings/mcp-and-apis/states/openAPIReference.ts b/packages/twenty-front/src/modules/settings/mcp-and-apis/states/openAPIReference.ts
deleted file mode 100644
index 0cc22609ac0..00000000000
--- a/packages/twenty-front/src/modules/settings/mcp-and-apis/states/openAPIReference.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
-export const openAPIReferenceState = createAtomState<any>({
- key: 'OpenAPIReference',
- defaultValue: null,
-});
diff --git a/packages/twenty-front/src/modules/settings/roles/constants/RolesListTabs.ts b/packages/twenty-front/src/modules/settings/roles/constants/RolesListTabs.ts
deleted file mode 100644
index ee0160e8cf3..00000000000
--- a/packages/twenty-front/src/modules/settings/roles/constants/RolesListTabs.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export const ROLES_LIST_TABS = {
- COMPONENT_INSTANCE_ID: 'settings-roles-list-tabs',
- TABS_IDS: {
- USER_ROLES: 'user-roles',
- AGENT_ROLES: 'agent-roles',
- API_KEY_ROLES: 'api-key-roles',
- },
-} as const;
diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableHeader.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableHeader.tsx
deleted file mode 100644
index 04983dc01a8..00000000000
--- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableHeader.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { TableHeader } from '@/ui/layout/table/components/TableHeader';
-import { TableRow } from '@/ui/layout/table/components/TableRow';
-import { t } from '@lingui/core/macro';
-
-export const SettingsRoleAssignmentTableHeader = () => (
- <TableRow gridAutoColumns="2fr 4fr">
- <TableHeader>{t`Name`}</TableHeader>
- <TableHeader>{t`Email`}</TableHeader>
- </TableRow>
-);
diff --git a/packages/twenty-front/src/modules/settings/roles/states/settingsValidateRoleFamilyState.ts b/packages/twenty-front/src/modules/settings/roles/states/settingsValidateRoleFamilyState.ts
deleted file mode 100644
index c2be23c99eb..00000000000
--- a/packages/twenty-front/src/modules/settings/roles/states/settingsValidateRoleFamilyState.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { createAtomFamilyState } from '@/ui/utilities/state/jotai/utils/createAtomFamilyState';
-import { type Role } from '~/generated-metadata/graphql';
-
-export const settingsValidateRoleFamilyState = createAtomFamilyState<
- Record<keyof Pick<Role, 'label'>, boolean>,
- string
->({
- key: 'settingsValidateRoleFamilyState',
- scope: 'routed-flow',
- defaultValue: {
- label: false,
- },
-});
diff --git a/packages/twenty-front/src/modules/settings/security/graphql/mutations/createOIDCSSOIdentityProvider.ts b/packages/twenty-front/src/modules/settings/security/graphql/mutations/createOIDCSSOIdentityProvider.ts
deleted file mode 100644
index e0cd4b6dd32..00000000000
--- a/packages/twenty-front/src/modules/settings/security/graphql/mutations/createOIDCSSOIdentityProvider.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/* @license Enterprise */
-
-import { gql } from '@apollo/client';
-
-export const CREATE_OIDC_SSO_IDENTITY_PROVIDER = gql`
- mutation CreateOIDCIdentityProvider($input: SetupOIDCSsoInput!) {
- createOIDCIdentityProvider(input: $input) {
- id
- type
- issuer
- name
- status
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/settings/security/graphql/mutations/createSAMLSSOIdentityProvider.ts b/packages/twenty-front/src/modules/settings/security/graphql/mutations/createSAMLSSOIdentityProvider.ts
deleted file mode 100644
index 3729b4f504a..00000000000
--- a/packages/twenty-front/src/modules/settings/security/graphql/mutations/createSAMLSSOIdentityProvider.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/* @license Enterprise */
-
-import { gql } from '@apollo/client';
-
-export const CREATE_SAML_SSO_IDENTITY_PROVIDER = gql`
- mutation CreateSAMLIdentityProvider($input: SetupSAMLSsoInput!) {
- createSAMLIdentityProvider(input: $input) {
- id
- type
- issuer
- name
- status
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/settings/security/graphql/mutations/deleteSSOIdentityProvider.ts b/packages/twenty-front/src/modules/settings/security/graphql/mutations/deleteSSOIdentityProvider.ts
deleted file mode 100644
index d9153d33d90..00000000000
--- a/packages/twenty-front/src/modules/settings/security/graphql/mutations/deleteSSOIdentityProvider.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/* @license Enterprise */
-
-import { gql } from '@apollo/client';
-
-export const DELETE_SSO_IDENTITY_PROVIDER = gql`
- mutation DeleteSSOIdentityProvider($input: DeleteSsoInput!) {
- deleteSSOIdentityProvider(input: $input) {
- identityProviderId
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/settings/security/graphql/mutations/editSSOIdentityProvider.ts b/packages/twenty-front/src/modules/settings/security/graphql/mutations/editSSOIdentityProvider.ts
deleted file mode 100644
index 78a83a3b53f..00000000000
--- a/packages/twenty-front/src/modules/settings/security/graphql/mutations/editSSOIdentityProvider.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/* @license Enterprise */
-
-import { gql } from '@apollo/client';
-
-export const EDIT_SSO_IDENTITY_PROVIDER = gql`
- mutation EditSSOIdentityProvider($input: EditSsoInput!) {
- editSSOIdentityProvider(input: $input) {
- id
- type
- issuer
- name
- status
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/settings/security/graphql/queries/getWorkspaceSSOIdentitiesProviders.ts b/packages/twenty-front/src/modules/settings/security/graphql/queries/getWorkspaceSSOIdentitiesProviders.ts
deleted file mode 100644
index dded0d7691f..00000000000
--- a/packages/twenty-front/src/modules/settings/security/graphql/queries/getWorkspaceSSOIdentitiesProviders.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/* @license Enterprise */
-
-import { gql } from '@apollo/client';
-
-export const GET_SSO_IDENTITY_PROVIDERS = gql`
- query GetSSOIdentityProviders {
- getSSOIdentityProviders {
- type
- id
- name
- issuer
- status
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useTwoFactorAuthentication.ts b/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useTwoFactorAuthentication.ts
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
index 44b9d9bbd92..4d372512681 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
@@ -12,7 +12,7 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme-constants';
-export type SidePanelListProps = {
+type SidePanelListProps = {
selectableItemIds: string[];
children: React.ReactNode;
loading?: boolean;
diff --git a/packages/twenty-front/src/modules/side-panel/constants/SidePanelNewSidebarItemFlowSubPages.ts b/packages/twenty-front/src/modules/side-panel/constants/SidePanelNewSidebarItemFlowSubPages.ts
deleted file mode 100644
index 6c34dd19d3a..00000000000
--- a/packages/twenty-front/src/modules/side-panel/constants/SidePanelNewSidebarItemFlowSubPages.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { SidePanelSubPages } from '@/side-panel/types/SidePanelSubPages';
-
-export const NEW_SIDEBAR_ITEM_FLOW_SIDE_PANEL_SUB_PAGES: SidePanelSubPages[] = [
- SidePanelSubPages.NewSidebarItemMainMenu,
- SidePanelSubPages.NewSidebarItemViewObjectPicker,
- SidePanelSubPages.NewSidebarItemViewPicker,
- SidePanelSubPages.NewSidebarItemViewSystemPicker,
- SidePanelSubPages.NewSidebarItemObjectPicker,
- SidePanelSubPages.NewSidebarItemObjectSystemPicker,
- SidePanelSubPages.NewSidebarItemRecord,
-];
diff --git a/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/EmailAlignmentInput.tsx b/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/EmailAlignmentInput.tsx
index 1ff27304633..25a9775d1c1 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/EmailAlignmentInput.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/EmailAlignmentInput.tsx
@@ -34,7 +34,7 @@ const StyledAlignButton = styled.button<{ isActive: boolean }>`
}
`;
-export const CAMPAIGN_ALIGN_OPTIONS = [
+const CAMPAIGN_ALIGN_OPTIONS = [
{ align: 'left', Icon: IconAlignLeft },
{ align: 'center', Icon: IconAlignCenter },
{ align: 'right', Icon: IconAlignRight },
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/SidePanelRecordTableFieldsSubPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/SidePanelRecordTableFieldsSubPage.tsx
deleted file mode 100644
index c35269db13d..00000000000
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/SidePanelRecordTableFieldsSubPage.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { RecordTableSettingsFieldVisibility } from '@/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFieldVisibility';
-import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
-import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
-import { isDefined } from 'twenty-shared/utils';
-import { WidgetConfigurationType } from '~/generated-metadata/graphql';
-
-export const SidePanelRecordTableFieldsSubPage = () => {
- const { pageLayoutId } = usePageLayoutIdFromContextStore();
- const { widgetInEditMode } = useWidgetInEditMode(pageLayoutId);
-
- if (!isDefined(widgetInEditMode)) {
- return null;
- }
-
- const { configuration } = widgetInEditMode;
-
- const isRecordTableConfiguration =
- configuration.configurationType === WidgetConfigurationType.RECORD_TABLE;
-
- const viewId =
- isRecordTableConfiguration &&
- 'viewId' in configuration &&
- isDefined(configuration.viewId)
- ? (configuration.viewId as string)
- : undefined;
-
- if (!isDefined(viewId)) {
- return null;
- }
-
- return (
- <RecordTableSettingsFieldVisibility
- viewId={viewId}
- widgetId={widgetInEditMode.id}
- pageLayoutId={pageLayoutId}
- />
- );
-};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/utils/filterSortOptionsByFieldType.ts b/packages/twenty-front/src/modules/side-panel/pages/page-layout/utils/filterSortOptionsByFieldType.ts
index 8f538ba7910..984f960c4f5 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/utils/filterSortOptionsByFieldType.ts
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/utils/filterSortOptionsByFieldType.ts
@@ -6,7 +6,7 @@ import {
import { type IconComponent } from 'twenty-ui/icon';
import { GraphOrderBy } from '~/generated-metadata/graphql';
-export type SortOption = {
+type SortOption = {
value: GraphOrderBy;
icon?: IconComponent | null;
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType.ts b/packages/twenty-front/src/modules/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType.ts
index 4a5204e6ca3..9dba39ab98c 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType.ts
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType.ts
@@ -152,9 +152,6 @@ type WidgetConfigurationTypenameMap = {
type WidgetConfigurationTypename = keyof WidgetConfigurationTypenameMap;
-export type WidgetConfigurationOfType<T extends WidgetConfigurationTypename> =
- WidgetConfigurationTypenameMap[T];
-
export const isWidgetConfigurationOfType = <
T extends WidgetConfigurationTypename,
>(
diff --git a/packages/twenty-front/src/modules/side-panel/pages/search/hooks/useSidePanelSearchRecords.tsx b/packages/twenty-front/src/modules/side-panel/pages/search/hooks/useSidePanelSearchRecords.tsx
index 13ba7f7cf4c..73368a51bbb 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/search/hooks/useSidePanelSearchRecords.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/search/hooks/useSidePanelSearchRecords.tsx
@@ -18,11 +18,6 @@ export type SearchResultItem = {
avatarType: 'squared' | 'rounded';
};
-export type SearchResultGroup = {
- heading: string;
- items: SearchResultItem[];
-};
-
export const useSidePanelSearchRecords = () => {
const sidePanelSearch = useAtomStateValue(sidePanelSearchState);
const sidePanelSearchObjectFilter = useAtomStateValue(
diff --git a/packages/twenty-front/src/modules/side-panel/types/SidePanelPage.ts b/packages/twenty-front/src/modules/side-panel/types/SidePanelPage.ts
index d3e79c9a320..2d969112cbe 100644
--- a/packages/twenty-front/src/modules/side-panel/types/SidePanelPage.ts
+++ b/packages/twenty-front/src/modules/side-panel/types/SidePanelPage.ts
@@ -1,6 +1,6 @@
import { type SidePanelPages } from 'twenty-shared/types';
-export type LegacySidePanelPage =
+type LegacySidePanelPage =
| SidePanelPages.ViewRecord
| SidePanelPages.ViewRecords
| SidePanelPages.Copilot;
diff --git a/packages/twenty-front/src/modules/side-panel/utils/getSelectedRecordsContextText.ts b/packages/twenty-front/src/modules/side-panel/utils/getSelectedRecordsContextText.ts
deleted file mode 100644
index 15fbe28b6b9..00000000000
--- a/packages/twenty-front/src/modules/side-panel/utils/getSelectedRecordsContextText.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { getObjectRecordIdentifier } from '@/object-metadata/utils/getObjectRecordIdentifier';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-
-export const getSelectedRecordsContextText = (
- objectMetadataItem: EnrichedObjectMetadataItem,
- records: ObjectRecord[],
- totalCount: number,
- allowRequestsToTwentyIcons: boolean,
-) => {
- return totalCount === 1
- ? getObjectRecordIdentifier({
- objectMetadataItem,
- record: records[0],
- allowRequestsToTwentyIcons,
- }).name
- : `${totalCount} ${objectMetadataItem.labelPlural}`;
-};
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/utils/csv-security/sanitizeValueForCSVExport.ts b/packages/twenty-front/src/modules/spreadsheet-import/utils/csv-security/sanitizeValueForCSVExport.ts
deleted file mode 100644
index 58b5ce71b23..00000000000
--- a/packages/twenty-front/src/modules/spreadsheet-import/utils/csv-security/sanitizeValueForCSVExport.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { CSV_DANGEROUS_CHARACTERS } from '@/spreadsheet-import/constants/CsvDangerousCharacters';
-import { CSV_INJECTION_PREVENTION_ZWJ } from '@/spreadsheet-import/constants/CsvInjectionPreventionZwj';
-
-export const sanitizeValueForCSVExport = (value: any): string => {
- if (value == null) return '';
-
- const stringValue = typeof value === 'string' ? value : String(value);
-
- if (CSV_DANGEROUS_CHARACTERS.test(stringValue)) {
- return CSV_INJECTION_PREVENTION_ZWJ + stringValue;
- }
-
- return stringValue;
-};
diff --git a/packages/twenty-front/src/modules/sse-db-event/hooks/useClearSseClient.ts b/packages/twenty-front/src/modules/sse-db-event/hooks/useClearSseClient.ts
deleted file mode 100644
index b18fdb9e0ba..00000000000
--- a/packages/twenty-front/src/modules/sse-db-event/hooks/useClearSseClient.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { activeQueryListenersState } from '@/sse-db-event/states/activeQueryListenersState';
-import { requiredQueryListenersState } from '@/sse-db-event/states/requiredQueryListenersState';
-import { sseClientState } from '@/sse-db-event/states/sseClientState';
-import { sseEventStreamIdState } from '@/sse-db-event/states/sseEventStreamIdState';
-import { sseEventStreamReadyState } from '@/sse-db-event/states/sseEventStreamReadyState';
-import { useCallback } from 'react';
-import { useStore } from 'jotai';
-
-export const useClearSseClient = () => {
- const store = useStore();
-
- const clearSseClient = useCallback(() => {
- const sseClient = store.get(sseClientState.atom);
-
- store.set(sseClientState.atom, null);
- store.set(sseEventStreamIdState.atom, null);
- store.set(sseEventStreamReadyState.atom, false);
- store.set(activeQueryListenersState.atom, []);
- store.set(requiredQueryListenersState.atom, []);
-
- sseClient?.dispose();
- }, [store]);
-
- return { clearSseClient };
-};
diff --git a/packages/twenty-front/src/modules/sse-db-event/types/ObjectRecordEventsByQueryId.ts b/packages/twenty-front/src/modules/sse-db-event/types/ObjectRecordEventsByQueryId.ts
deleted file mode 100644
index a0e904022b8..00000000000
--- a/packages/twenty-front/src/modules/sse-db-event/types/ObjectRecordEventsByQueryId.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { type ObjectRecordEvent } from '~/generated-metadata/graphql';
-
-export type ObjectRecordEventsByQueryId = Record<string, ObjectRecordEvent[]>;
diff --git a/packages/twenty-front/src/modules/sse-db-event/utils/dispatchObjectRecordEventsWithQueryIds.ts b/packages/twenty-front/src/modules/sse-db-event/utils/dispatchObjectRecordEventsWithQueryIds.ts
deleted file mode 100644
index 8fa4d8af37c..00000000000
--- a/packages/twenty-front/src/modules/sse-db-event/utils/dispatchObjectRecordEventsWithQueryIds.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { type ObjectRecordEventsByQueryId } from '@/sse-db-event/types/ObjectRecordEventsByQueryId';
-import { getObjectRecordEventsForQueryEventName } from '@/sse-db-event/utils/getObjectRecordEventsForQueryEventName';
-import { isDefined } from 'twenty-shared/utils';
-import { type ObjectRecordEventWithQueryIds } from '~/generated-metadata/graphql';
-
-export const dispatchObjectRecordEventsWithQueryIds = (
- objectRecordEventsWithQueryIds: ObjectRecordEventWithQueryIds[],
-) => {
- const objectRecordEventsByQueryId: ObjectRecordEventsByQueryId = {};
-
- for (const item of objectRecordEventsWithQueryIds) {
- for (const queryId of item.queryIds) {
- if (!isDefined(objectRecordEventsByQueryId[queryId])) {
- objectRecordEventsByQueryId[queryId] = [];
- }
-
- objectRecordEventsByQueryId[queryId].push(item.objectRecordEvent);
- }
- }
-
- for (const queryId in objectRecordEventsByQueryId) {
- window.dispatchEvent(
- new CustomEvent(getObjectRecordEventsForQueryEventName(queryId), {
- detail: objectRecordEventsByQueryId[queryId],
- }),
- );
- }
-};
diff --git a/packages/twenty-front/src/modules/sse-db-event/utils/getObjectRecordEventsForQueryEventName.ts b/packages/twenty-front/src/modules/sse-db-event/utils/getObjectRecordEventsForQueryEventName.ts
deleted file mode 100644
index eba06294d02..00000000000
--- a/packages/twenty-front/src/modules/sse-db-event/utils/getObjectRecordEventsForQueryEventName.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export const getObjectRecordEventsForQueryEventName = (queryId: string) => {
- return `object-record-events-${queryId}`;
-};
diff --git a/packages/twenty-front/src/modules/ui/display/components/LinkifiedTextBody.tsx b/packages/twenty-front/src/modules/ui/display/components/LinkifiedTextBody.tsx
deleted file mode 100644
index eed1ee79245..00000000000
--- a/packages/twenty-front/src/modules/ui/display/components/LinkifiedTextBody.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { styled } from '@linaria/react';
-import { motion } from 'framer-motion';
-import Linkify from 'linkify-react';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-import { AnimatedEaseInOut } from 'twenty-ui/layout';
-
-const StyledTextBody = styled(motion.div)`
- color: ${themeCssVariables.font.color.primary};
- display: flex;
- flex-direction: column;
- margin-top: ${themeCssVariables.spacing[4]};
- overflow-wrap: break-word;
- white-space: pre-line;
-
- a {
- color: ${themeCssVariables.color.blue};
- text-decoration: underline;
-
- &:hover {
- text-decoration-color: ${themeCssVariables.color.blue};
- }
- }
-`;
-
-type LinkifiedTextBodyProps = {
- body: string;
- isDisplayed: boolean;
-};
-
-export const LinkifiedTextBody = ({
- body,
- isDisplayed,
-}: LinkifiedTextBodyProps) => {
- return (
- <AnimatedEaseInOut isOpen={isDisplayed} duration="fast">
- <StyledTextBody>
- <Linkify
- options={{
- target: '_blank',
- rel: 'noopener noreferrer',
- }}
- >
- {body}
- </Linkify>
- </StyledTextBody>
- </AnimatedEaseInOut>
- );
-};
diff --git a/packages/twenty-front/src/modules/ui/field/display/components/MoneyDisplay.tsx b/packages/twenty-front/src/modules/ui/field/display/components/MoneyDisplay.tsx
deleted file mode 100644
index 501e12551b7..00000000000
--- a/packages/twenty-front/src/modules/ui/field/display/components/MoneyDisplay.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useNumberFormat } from '@/localization/hooks/useNumberFormat';
-
-import { EllipsisDisplay } from 'twenty-ui/data-display';
-
-type MoneyDisplayProps = {
- value: number | null;
-};
-
-export const MoneyDisplay = ({ value }: MoneyDisplayProps) => {
- const { formatNumber } = useNumberFormat();
- return (
- <EllipsisDisplay>{value ? `$${formatNumber(value)}` : ''}</EllipsisDisplay>
- );
-};
diff --git a/packages/twenty-front/src/modules/ui/field/display/components/URLDisplay.tsx b/packages/twenty-front/src/modules/ui/field/display/components/URLDisplay.tsx
deleted file mode 100644
index a7f40d41809..00000000000
--- a/packages/twenty-front/src/modules/ui/field/display/components/URLDisplay.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { type MouseEvent } from 'react';
-
-import { RoundedLink, SocialLink } from 'twenty-ui/navigation';
-import { checkUrlType } from '~/utils/checkUrlType';
-import { isSocialLinkType } from '~/utils/isSocialLinkType';
-import { getSafeUrl } from 'twenty-shared/utils';
-import { EllipsisDisplay } from 'twenty-ui/data-display';
-
-type URLDisplayProps = {
- value: string | null;
-};
-
-export const URLDisplay = ({ value }: URLDisplayProps) => {
- const handleClick = (event: MouseEvent<HTMLElement>) => {
- event.stopPropagation();
- };
-
- const absoluteUrl = value ? (getSafeUrl(value) ?? '') : '';
-
- const displayedValue = value ?? '';
-
- const type = checkUrlType(absoluteUrl);
-
- if (isSocialLinkType(type)) {
- return (
- <EllipsisDisplay>
- <SocialLink
- href={absoluteUrl}
- onClick={handleClick}
- type={type}
- label={null}
- />
- </EllipsisDisplay>
- );
- }
- return (
- <EllipsisDisplay>
- <RoundedLink
- href={absoluteUrl}
- onClick={handleClick}
- label={displayedValue}
- />
- </EllipsisDisplay>
- );
-};
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/DaySelect.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/DaySelect.tsx
deleted file mode 100644
index 78c67d0e4d0..00000000000
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/DaySelect.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { useMemo } from 'react';
-
-import { SELECT_DAY_DROPDOWN_ID } from '@/ui/input/components/internal/date/constants/SelectDayDropdownId';
-import { type DayNameWithIndex } from '@/ui/input/components/internal/date/types/DayNameWithIndex';
-import { Select } from '@/ui/input/components/Select';
-import { type SelectOption } from 'twenty-ui/input';
-
-export const DaySelect = ({
- label,
- selectedDayIndex,
- onChange,
- dayList,
-}: {
- label: string;
- selectedDayIndex: number;
- onChange: (dayIndex: number | string) => void;
- dayList: DayNameWithIndex[];
-}) => {
- const options: SelectOption<string | number>[] = useMemo(() => {
- const days = dayList?.map<SelectOption<string | number>>(
- ({ day, index }) => ({
- label: day,
- value: index,
- }),
- );
-
- return days;
- }, [dayList]);
-
- return (
- <Select
- fullWidth
- dropdownId={SELECT_DAY_DROPDOWN_ID}
- options={options}
- label={label}
- onChange={onChange}
- value={selectedDayIndex}
- dropdownWidth={218}
- dropdownWidthAuto
- />
- );
-};
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/DateTimeBlocks.ts b/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/DateTimeBlocks.ts
deleted file mode 100644
index e6b88733285..00000000000
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/DateTimeBlocks.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { DATE_BLOCKS } from '@/ui/input/components/internal/date/constants/DateBlocks';
-import { TIME_BLOCKS } from '@/ui/input/components/internal/date/constants/TimeBlocks';
-
-export const DATE_TIME_BLOCKS = {
- ...DATE_BLOCKS,
- ...TIME_BLOCKS,
-};
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/SelectDayDropdownId.ts b/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/SelectDayDropdownId.ts
deleted file mode 100644
index 9be327d0aad..00000000000
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/SelectDayDropdownId.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const SELECT_DAY_DROPDOWN_ID = 'select-day-dropdown-Id';
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/TimeBlocks.ts b/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/TimeBlocks.ts
deleted file mode 100644
index 6e041f727cd..00000000000
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/TimeBlocks.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { IMask } from 'react-imask';
-
-export const TIME_BLOCKS = {
- HH: {
- mask: IMask.MaskedRange, // Use MaskedRange for valid hour range (0-23)
- from: 0,
- to: 23,
- },
- mm: {
- mask: IMask.MaskedRange, // Use MaskedRange for valid minute range (0-59)
- from: 0,
- to: 59,
- },
-};
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/TimeMask.ts b/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/TimeMask.ts
deleted file mode 100644
index dc9afff84bf..00000000000
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/constants/TimeMask.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const TIME_MASK = 'HH`:mm`'; // Define blocks for hours and minutes
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/hooks/__tests__/useParseZonedDateTimeToIMaskDateTimeInputString.test.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/hooks/__tests__/useParseZonedDateTimeToIMaskDateTimeInputString.test.tsx
deleted file mode 100644
index 51cac0afc75..00000000000
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/hooks/__tests__/useParseZonedDateTimeToIMaskDateTimeInputString.test.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-import { renderHook } from '@testing-library/react';
-import { Provider as JotaiProvider } from 'jotai';
-import { Temporal } from 'temporal-polyfill';
-
-import { DateFormat } from '@/localization/constants/DateFormat';
-import { NumberFormat } from '@/localization/constants/NumberFormat';
-import { TimeFormat } from '@/localization/constants/TimeFormat';
-import { workspaceMemberFormatPreferencesState } from '@/localization/states/workspaceMemberFormatPreferencesState';
-import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
-import { useParseZonedDateTimeToIMaskDateTimeInputString } from '@/ui/input/components/internal/date/hooks/useParseZonedDateTimeToIMaskDateTimeInputString';
-import { CalendarStartDay } from 'twenty-shared/constants';
-
-describe('useParseZonedDateTimeToIMaskDateTimeInputString', () => {
- const testZonedDateTime = Temporal.ZonedDateTime.from({
- year: 2024,
- month: 3,
- day: 15,
- hour: 14,
- minute: 30,
- timeZone: 'Pacific/Auckland',
- });
-
- const createWrapper =
- (dateFormat: DateFormat) =>
- ({ children }: { children: React.ReactNode }) => {
- jotaiStore.set(workspaceMemberFormatPreferencesState.atom, {
- timeZone: 'Pacific/Auckland',
- dateFormat,
- timeFormat: TimeFormat.HOUR_24,
- numberFormat: NumberFormat.COMMAS_AND_DOT,
- calendarStartDay: CalendarStartDay.MONDAY,
- });
- return <JotaiProvider store={jotaiStore}>{children}</JotaiProvider>;
- };
-
- it('should format with day first format (DD/MM/YYYY, HH:mm)', () => {
- const { result } = renderHook(
- () => useParseZonedDateTimeToIMaskDateTimeInputString(),
- { wrapper: createWrapper(DateFormat.DAY_FIRST) },
- );
-
- const formattedString =
- result.current.parseZonedDateTimeToDateTimeInputString(testZonedDateTime);
-
- expect(formattedString).toBe('15/03/2024, 14:30');
- });
-
- it('should format with year first format (YYYY-MM-DD, HH:mm)', () => {
- const { result } = renderHook(
- () => useParseZonedDateTimeToIMaskDateTimeInputString(),
- { wrapper: createWrapper(DateFormat.YEAR_FIRST) },
- );
-
- const formattedString =
- result.current.parseZonedDateTimeToDateTimeInputString(testZonedDateTime);
-
- expect(formattedString).toBe('2024-03-15, 14:30');
- });
-
- it('should format with month first format (MM/DD/YYYY, HH:mm)', () => {
- const { result } = renderHook(
- () => useParseZonedDateTimeToIMaskDateTimeInputString(),
- { wrapper: createWrapper(DateFormat.MONTH_FIRST) },
- );
-
- const formattedString =
- result.current.parseZonedDateTimeToDateTimeInputString(testZonedDateTime);
-
- expect(formattedString).toBe('03/15/2024, 14:30');
- });
-
- it('should format with month first format when dateFormat is SYSTEM', () => {
- const { result } = renderHook(
- () => useParseZonedDateTimeToIMaskDateTimeInputString(),
- { wrapper: createWrapper(DateFormat.SYSTEM) },
- );
-
- const formattedString =
- result.current.parseZonedDateTimeToDateTimeInputString(testZonedDateTime);
-
- expect(formattedString).toBe('03/15/2024, 14:30');
- });
-});
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/hooks/useParseZonedDateTimeToIMaskDateTimeInputString.ts b/packages/twenty-front/src/modules/ui/input/components/internal/date/hooks/useParseZonedDateTimeToIMaskDateTimeInputString.ts
deleted file mode 100644
index 1aaaa79c862..00000000000
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/hooks/useParseZonedDateTimeToIMaskDateTimeInputString.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { DateFormat } from '@/localization/constants/DateFormat';
-import { useDateTimeFormat } from '@/localization/hooks/useDateTimeFormat';
-import { type Temporal } from 'temporal-polyfill';
-
-export const useParseZonedDateTimeToIMaskDateTimeInputString = () => {
- const { dateFormat } = useDateTimeFormat();
-
- const parseZonedDateTimeToDateTimeInputString = (
- zonedDateTime: Temporal.ZonedDateTime,
- ) => {
- switch (dateFormat) {
- case DateFormat.DAY_FIRST: {
- return zonedDateTime.toLocaleString('en-GB', {
- day: '2-digit',
- month: '2-digit',
- year: 'numeric',
- hour: '2-digit',
- minute: '2-digit',
- hour12: false,
- });
- }
- case DateFormat.YEAR_FIRST: {
- return zonedDateTime.toLocaleString('en-CA', {
- year: 'numeric',
- month: '2-digit',
- day: '2-digit',
- hour: '2-digit',
- minute: '2-digit',
- hour12: false,
- });
- }
- case DateFormat.SYSTEM:
- case DateFormat.MONTH_FIRST: {
- return zonedDateTime.toLocaleString('en-US', {
- month: '2-digit',
- day: '2-digit',
- year: 'numeric',
- hour: '2-digit',
- minute: '2-digit',
- hour12: false,
- });
- }
- }
- };
-
- return {
- parseZonedDateTimeToDateTimeInputString,
- };
-};
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/types/DayNameWithIndex.ts b/packages/twenty-front/src/modules/ui/input/components/internal/date/types/DayNameWithIndex.ts
deleted file mode 100644
index a126c8668d3..00000000000
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/types/DayNameWithIndex.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export type DayNameWithIndex = {
- day: string;
- index: number;
-};
diff --git a/packages/twenty-front/src/modules/ui/input/hooks/__tests__/useIconPicker.test.tsx b/packages/twenty-front/src/modules/ui/input/hooks/__tests__/useIconPicker.test.tsx
deleted file mode 100644
index 6fc56fd7ee8..00000000000
--- a/packages/twenty-front/src/modules/ui/input/hooks/__tests__/useIconPicker.test.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { renderHook } from '@testing-library/react';
-import { act } from 'react';
-
-import { useIconPicker } from '@/ui/input/hooks/useIconPicker';
-import { Icon123, IconApps } from 'twenty-ui/icon';
-
-describe('useIconPicker', () => {
- it('should return correct iconPickerState', async () => {
- const { result } = renderHook(() => useIconPicker());
-
- const { Icon, iconKey, setIconPicker } = result.current;
-
- expect(Icon).toEqual(IconApps);
- expect(iconKey).toEqual('IconApps');
- expect(setIconPicker).toBeInstanceOf(Function);
- });
-
- it('should update the icon', async () => {
- const { result } = renderHook(() => useIconPicker());
-
- const { Icon, iconKey, setIconPicker } = result.current;
-
- expect(Icon).toEqual(IconApps);
- expect(iconKey).toEqual('IconApps');
- expect(setIconPicker).toBeInstanceOf(Function);
-
- await act(async () => {
- result.current.setIconPicker({ Icon: Icon123, iconKey: 'Icon123' });
- });
-
- const { Icon: UpdatedIcon, iconKey: updatedIconKey } = result.current;
-
- expect(UpdatedIcon).toEqual(Icon123);
- expect(updatedIconKey).toEqual('Icon123');
- });
-});
diff --git a/packages/twenty-front/src/modules/ui/input/hooks/useIconPicker.ts b/packages/twenty-front/src/modules/ui/input/hooks/useIconPicker.ts
deleted file mode 100644
index de9d3dc98a6..00000000000
--- a/packages/twenty-front/src/modules/ui/input/hooks/useIconPicker.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { iconPickerState } from '@/ui/input/states/iconPickerState';
-import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
-
-export const useIconPicker = () => {
- const [iconPicker, setIconPicker] = useAtomState(iconPickerState);
-
- return {
- Icon: iconPicker.Icon,
- iconKey: iconPicker.iconKey,
- setIconPicker,
- };
-};
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownAdvancedSectionHeader.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownAdvancedSectionHeader.tsx
deleted file mode 100644
index 8b650a5abb8..00000000000
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownAdvancedSectionHeader.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';
-import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';
-import { Trans } from '@lingui/react/macro';
-import { IconChevronLeft } from 'twenty-ui/icon';
-
-type DropdownAdvancedSectionHeaderProps = {
- onBack: () => void;
-};
-
-export const DropdownAdvancedSectionHeader = ({
- onBack,
-}: DropdownAdvancedSectionHeaderProps) => (
- <DropdownMenuHeader
- StartComponent={
- <DropdownMenuHeaderLeftComponent
- onClick={onBack}
- Icon={IconChevronLeft}
- />
- }
- >
- <Trans>Advanced</Trans>
- </DropdownMenuHeader>
-);
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownAdvancedSectionMenuItem.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownAdvancedSectionMenuItem.tsx
deleted file mode 100644
index 48861f27761..00000000000
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownAdvancedSectionMenuItem.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Trans } from '@lingui/react/macro';
-import { IconSettings } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/navigation';
-
-type DropdownAdvancedSectionMenuItemProps = {
- onClick: () => void;
-};
-
-export const DropdownAdvancedSectionMenuItem = ({
- onClick,
-}: DropdownAdvancedSectionMenuItemProps) => (
- <MenuItem
- text={<Trans>Advanced</Trans>}
- LeftIcon={IconSettings}
- onClick={onClick}
- hasSubMenu
- />
-);
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/constants/DropdownWidth.ts b/packages/twenty-front/src/modules/ui/layout/dropdown/constants/DropdownWidth.ts
deleted file mode 100644
index e7e83396556..00000000000
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/constants/DropdownWidth.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const DROPDOWN_WIDTH = '200px';
diff --git a/packages/twenty-front/src/modules/ui/layout/page/components/PageBody.tsx b/packages/twenty-front/src/modules/ui/layout/page/components/PageBody.tsx
deleted file mode 100644
index a2b5c62c5b2..00000000000
--- a/packages/twenty-front/src/modules/ui/layout/page/components/PageBody.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { styled } from '@linaria/react';
-import { type ReactNode } from 'react';
-
-import { PagePanel } from './PagePanel';
-import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme-constants';
-
-type PageBodyProps = {
- children: ReactNode;
- className?: string;
-};
-
-const StyledMainContainer = styled.div`
- background: ${themeCssVariables.background.noisy};
- box-sizing: border-box;
- display: flex;
- flex: 1 1 auto;
- flex-direction: row;
- gap: ${themeCssVariables.spacing[2]};
- min-height: 0;
- padding-bottom: ${themeCssVariables.spacing[3]};
- padding-left: 0;
- padding-right: ${themeCssVariables.spacing[3]};
- width: 100%;
-
- @media (max-width: ${MOBILE_VIEWPORT}px) {
- padding-left: ${themeCssVariables.spacing[3]};
- }
-`;
-
-type LeftContainerProps = {
- isSidePanelOpen?: boolean;
-};
-
-const StyledLeftContainer = styled.div<LeftContainerProps>`
- display: flex;
- flex-direction: column;
- position: relative;
- width: 100%;
-`;
-
-export const PageBody = ({ children, className }: PageBodyProps) => (
- <StyledMainContainer className={className}>
- <StyledLeftContainer>
- <PagePanel>{children}</PagePanel>
- </StyledLeftContainer>
- </StyledMainContainer>
-);
diff --git a/packages/twenty-front/src/modules/ui/layout/page/components/PagePanel.tsx b/packages/twenty-front/src/modules/ui/layout/page/components/PagePanel.tsx
deleted file mode 100644
index c728a092729..00000000000
--- a/packages/twenty-front/src/modules/ui/layout/page/components/PagePanel.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { styled } from '@linaria/react';
-import React from 'react';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-
-const StyledPanel = styled.div`
- background: ${themeCssVariables.background.primary};
- border: 1px solid ${themeCssVariables.border.color.medium};
- display: flex;
- flex-direction: column;
- height: 100%;
- overflow-x: auto;
- overflow-y: hidden;
- width: 100%;
-`;
-
-type PagePanelProps = {
- children: React.ReactNode;
- hasInformationBar?: boolean;
-};
-
-export const PagePanel = ({ children }: PagePanelProps) => (
- <StyledPanel>{children}</StyledPanel>
-);
diff --git a/packages/twenty-front/src/modules/ui/layout/table/components/TableSubRow.tsx b/packages/twenty-front/src/modules/ui/layout/table/components/TableSubRow.tsx
deleted file mode 100644
index b84c5510bdc..00000000000
--- a/packages/twenty-front/src/modules/ui/layout/table/components/TableSubRow.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { styled } from '@linaria/react';
-import { type ReactNode } from 'react';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-
-import { TableRow } from '@/ui/layout/table/components/TableRow';
-
-const StyledTableSubRowContainer = styled.div`
- padding-left: ${themeCssVariables.spacing[4]};
-`;
-
-export const TableSubRow = ({
- children,
- ...props
-}: React.ComponentProps<typeof TableRow> & { children?: ReactNode }) => (
- <StyledTableSubRowContainer>
- {/* oxlint-disable-next-line react/jsx-props-no-spreading */}
- <TableRow {...props}>{children}</TableRow>
- </StyledTableSubRowContainer>
-);
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitleSkeletonLoader.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitleSkeletonLoader.tsx
deleted file mode 100644
index 14a284ec375..00000000000
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitleSkeletonLoader.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
-import { styled } from '@linaria/react';
-import { useContext } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
-
-const StyledSkeletonTitle = styled.div`
- margin-bottom: ${themeCssVariables.spacing[2]};
- padding-left: ${themeCssVariables.spacing[1]};
-`;
-
-export const NavigationDrawerSectionTitleSkeletonLoader = () => {
- const { theme } = useContext(ThemeContext);
- return (
- <SkeletonTheme
- baseColor={theme.grayScale.gray3}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <StyledSkeletonTitle>
- <Skeleton
- width={56}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.xs}
- />
- </StyledSkeletonTitle>
- </SkeletonTheme>
- );
-};
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/constants/DefaultWorkspaceName.ts b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/constants/DefaultWorkspaceName.ts
deleted file mode 100644
index de9ed6e96ad..00000000000
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/constants/DefaultWorkspaceName.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const DEFAULT_WORKSPACE_NAME = 'Twenty';
diff --git a/packages/twenty-front/src/modules/ui/utilities/debug/components/TimingProfiler.tsx b/packages/twenty-front/src/modules/ui/utilities/debug/components/TimingProfiler.tsx
deleted file mode 100644
index 461cd152a66..00000000000
--- a/packages/twenty-front/src/modules/ui/utilities/debug/components/TimingProfiler.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { Profiler, type ProfilerOnRenderCallback } from 'react';
-
-import { logDebug } from '~/utils/logDebug';
-
-type TimingProfilerProps = {
- id: string;
- children: React.ReactNode;
-};
-
-export const TimingProfiler = ({ id, children }: TimingProfilerProps) => {
- const handleRender: ProfilerOnRenderCallback = (
- id: string,
- phase: 'mount' | 'update' | 'nested-update',
- actualDuration: number,
- baseDuration: number,
- startTime: number,
- commitTime: number,
- ) => {
- logDebug(
- 'TimingProfiler',
- JSON.stringify(
- {
- id,
- phase,
- actualDuration,
- baseDuration,
- startTime,
- commitTime,
- },
- null,
- 2,
- ),
- );
- };
-
- return (
- <Profiler id={id} onRender={handleRender}>
- {children}
- </Profiler>
- );
-};
diff --git a/packages/twenty-front/src/modules/ui/utilities/focus/hooks/__tests__/useResetFocusStack.test.tsx b/packages/twenty-front/src/modules/ui/utilities/focus/hooks/__tests__/useResetFocusStack.test.tsx
deleted file mode 100644
index f0db32be743..00000000000
--- a/packages/twenty-front/src/modules/ui/utilities/focus/hooks/__tests__/useResetFocusStack.test.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import { usePushFocusItemToFocusStack } from '@/ui/utilities/focus/hooks/usePushFocusItemToFocusStack';
-import { useResetFocusStack } from '@/ui/utilities/focus/hooks/useResetFocusStack';
-import { currentFocusIdSelector } from '@/ui/utilities/focus/states/currentFocusIdSelector';
-import { focusStackState } from '@/ui/utilities/focus/states/focusStackState';
-import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import {
- jotaiStore,
- resetJotaiStore,
-} from '@/ui/utilities/state/jotai/jotaiStore';
-import { renderHook } from '@testing-library/react';
-import { Provider as JotaiProvider } from 'jotai';
-import { act } from 'react';
-
-const Wrapper = ({ children }: { children: React.ReactNode }) => (
- <JotaiProvider store={jotaiStore}>{children}</JotaiProvider>
-);
-
-const renderHooks = () => {
- const { result } = renderHook(
- () => {
- const { pushFocusItemToFocusStack } = usePushFocusItemToFocusStack();
- const { resetFocusStack } = useResetFocusStack();
- const focusStack = useAtomStateValue(focusStackState);
- const currentFocusId = useAtomStateValue(currentFocusIdSelector);
-
- return {
- pushFocusItemToFocusStack,
- resetFocusStack,
- focusStack,
- currentFocusId,
- };
- },
- {
- wrapper: Wrapper,
- },
- );
-
- return { result };
-};
-
-describe('useResetFocusStack', () => {
- beforeEach(() => {
- resetJotaiStore();
- });
-
- it('should reset the focus stack', async () => {
- const { result } = renderHooks();
-
- const focusItem = {
- focusId: 'test-focus-id',
- componentInstance: {
- componentType: FocusComponentType.MODAL,
- componentInstanceId: 'test-instance-id',
- },
- globalHotkeysConfig: {
- enableGlobalHotkeysWithModifiers: true,
- enableGlobalHotkeysConflictingWithKeyboard: true,
- },
- };
-
- await act(async () => {
- result.current.pushFocusItemToFocusStack({
- focusId: focusItem.focusId,
- component: {
- type: focusItem.componentInstance.componentType,
- instanceId: focusItem.componentInstance.componentInstanceId,
- },
- });
- });
-
- expect(result.current.focusStack).toEqual([focusItem]);
- expect(result.current.currentFocusId).toEqual(focusItem.focusId);
-
- await act(async () => {
- result.current.resetFocusStack();
- });
-
- expect(result.current.focusStack).toEqual([]);
- expect(result.current.currentFocusId).toEqual(undefined);
- });
-});
diff --git a/packages/twenty-front/src/modules/ui/utilities/focus/hooks/useResetFocusStack.ts b/packages/twenty-front/src/modules/ui/utilities/focus/hooks/useResetFocusStack.ts
deleted file mode 100644
index f655814d304..00000000000
--- a/packages/twenty-front/src/modules/ui/utilities/focus/hooks/useResetFocusStack.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { useCallback } from 'react';
-
-import { DEBUG_FOCUS_STACK } from '@/ui/utilities/focus/constants/DebugFocusStack';
-import { focusStackState } from '@/ui/utilities/focus/states/focusStackState';
-import { useStore } from 'jotai';
-import { logDebug } from '~/utils/logDebug';
-
-export const useResetFocusStack = () => {
- const store = useStore();
-
- const resetFocusStack = useCallback(() => {
- store.set(focusStackState.atom, []);
-
- if (DEBUG_FOCUS_STACK) {
- logDebug(`DEBUG: reset focus stack`);
- }
- }, [store]);
-
- return { resetFocusStack };
-};
diff --git a/packages/twenty-front/src/modules/ui/utilities/loading-state/states/currentPageLocationState.ts b/packages/twenty-front/src/modules/ui/utilities/loading-state/states/currentPageLocationState.ts
deleted file mode 100644
index ed31566472d..00000000000
--- a/packages/twenty-front/src/modules/ui/utilities/loading-state/states/currentPageLocationState.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
-export const currentPageLocationState = createAtomState<string>({
- key: 'currentPageLocationState',
- defaultValue: '',
-});
diff --git a/packages/twenty-front/src/modules/ui/utilities/pointer-event/types/ClickOutsideListenerCallback.ts b/packages/twenty-front/src/modules/ui/utilities/pointer-event/types/ClickOutsideListenerCallback.ts
deleted file mode 100644
index e33b0d4cb5a..00000000000
--- a/packages/twenty-front/src/modules/ui/utilities/pointer-event/types/ClickOutsideListenerCallback.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { type ClickOutsideListenerCallbackFunction } from '@/ui/utilities/pointer-event/types/ClickOutsideListenerCallbackFunction';
-
-export type ClickOutsideListenerCallback = {
- callbackId: string;
- callbackFunction: ClickOutsideListenerCallbackFunction;
-};
diff --git a/packages/twenty-front/src/modules/ui/utilities/pointer-event/types/ClickOutsideListenerCallbackFunction.ts b/packages/twenty-front/src/modules/ui/utilities/pointer-event/types/ClickOutsideListenerCallbackFunction.ts
deleted file mode 100644
index b3ad996c8d8..00000000000
--- a/packages/twenty-front/src/modules/ui/utilities/pointer-event/types/ClickOutsideListenerCallbackFunction.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export type ClickOutsideListenerCallbackFunction = (
- event: MouseEvent | TouchEvent,
-) => void;
diff --git a/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/ComponentStateType.ts b/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/ComponentStateType.ts
deleted file mode 100644
index 759d99db805..00000000000
--- a/packages/twenty-front/src/modules/ui/utilities/state/component-state/types/ComponentStateType.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export type ComponentStateType =
- | 'ComponentState'
- | 'ComponentFamilyState'
- | 'ComponentSelector'
- | 'ComponentReadOnlySelector'
- | 'ComponentFamilySelector'
- | 'ComponentFamilyReadOnlySelector';
diff --git a/packages/twenty-front/src/modules/ui/utilities/state/jotai/utils/createAtomWritableSelector.ts b/packages/twenty-front/src/modules/ui/utilities/state/jotai/utils/createAtomWritableSelector.ts
deleted file mode 100644
index 76d125df39d..00000000000
--- a/packages/twenty-front/src/modules/ui/utilities/state/jotai/utils/createAtomWritableSelector.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { atom } from 'jotai';
-
-import {
- type SelectorGetter,
- type SelectorSetter,
-} from '@/ui/utilities/state/jotai/types/SelectorCallbacks';
-import { type WritableSelector } from '@/ui/utilities/state/jotai/types/WritableSelector';
-import { buildGetHelper } from '@/ui/utilities/state/jotai/utils/buildGetHelper';
-import { buildSetHelper } from '@/ui/utilities/state/jotai/utils/buildSetHelper';
-
-export const createAtomWritableSelector = <ValueType>({
- key,
- get,
- set,
-}: {
- key: string;
- get: (callbacks: SelectorGetter) => ValueType;
- set: (callbacks: SelectorSetter, newValue: ValueType) => void;
-}): WritableSelector<ValueType> => {
- const derivedAtom = atom(
- (jotaiGet) => {
- const getHelper = buildGetHelper(jotaiGet);
-
- return get({ get: getHelper });
- },
- (
- jotaiGet,
- jotaiSet,
- valueOrUpdater: ValueType | ((prev: ValueType) => ValueType),
- ) => {
- const getHelper = buildGetHelper(jotaiGet);
- const setHelper = buildSetHelper(jotaiSet);
-
- const resolvedValue =
- typeof valueOrUpdater === 'function'
- ? (valueOrUpdater as (prev: ValueType) => ValueType)(
- get({ get: getHelper }),
- )
- : valueOrUpdater;
-
- set({ get: getHelper, set: setHelper }, resolvedValue);
- },
- );
-
- derivedAtom.debugLabel = key;
-
- return {
- type: 'WritableSelector',
- key,
- atom: derivedAtom,
- };
-};
diff --git a/packages/twenty-front/src/modules/views/components/ViewBarSkeletonLoader.tsx b/packages/twenty-front/src/modules/views/components/ViewBarSkeletonLoader.tsx
deleted file mode 100644
index d1ea91af3a5..00000000000
--- a/packages/twenty-front/src/modules/views/components/ViewBarSkeletonLoader.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
-import { useContext } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { ThemeContext } from 'twenty-ui/theme-constants';
-
-export const ViewBarSkeletonLoader = () => {
- const { theme } = useContext(ThemeContext);
- return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Skeleton width={140} height={SKELETON_LOADER_HEIGHT_SIZES.standard.s} />
- </SkeletonTheme>
- );
-};
diff --git a/packages/twenty-front/src/modules/views/graphql/mutations/createViewField.ts b/packages/twenty-front/src/modules/views/graphql/mutations/createViewField.ts
deleted file mode 100644
index b30e2599f04..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/mutations/createViewField.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_FIELD_FRAGMENT } from '@/views/graphql/fragments/viewFieldFragment';
-import { gql } from '@apollo/client';
-
-export const CREATE_VIEW_FIELD = gql`
- ${VIEW_FIELD_FRAGMENT}
- mutation CreateViewField($input: CreateViewFieldInput!) {
- createViewField(input: $input) {
- ...ViewFieldFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/mutations/createViewFieldGroup.ts b/packages/twenty-front/src/modules/views/graphql/mutations/createViewFieldGroup.ts
deleted file mode 100644
index 34b8dfb5821..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/mutations/createViewFieldGroup.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_FIELD_GROUP_FRAGMENT } from '@/views/graphql/fragments/viewFieldGroupFragment';
-import { gql } from '@apollo/client';
-
-export const CREATE_VIEW_FIELD_GROUP = gql`
- ${VIEW_FIELD_GROUP_FRAGMENT}
- mutation CreateViewFieldGroup($input: CreateViewFieldGroupInput!) {
- createViewFieldGroup(input: $input) {
- ...ViewFieldGroupFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/mutations/createViewGroup.ts b/packages/twenty-front/src/modules/views/graphql/mutations/createViewGroup.ts
deleted file mode 100644
index c6d7ff8a0af..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/mutations/createViewGroup.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_GROUP_FRAGMENT } from '@/views/graphql/fragments/viewGroupFragment';
-import { gql } from '@apollo/client';
-
-export const CREATE_VIEW_GROUP = gql`
- ${VIEW_GROUP_FRAGMENT}
- mutation CreateViewGroup($input: CreateViewGroupInput!) {
- createViewGroup(input: $input) {
- ...ViewGroupFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/mutations/deleteView.ts b/packages/twenty-front/src/modules/views/graphql/mutations/deleteView.ts
deleted file mode 100644
index 6c394979dea..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/mutations/deleteView.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { gql } from '@apollo/client';
-
-export const DELETE_VIEW = gql`
- mutation DeleteView($id: String!) {
- deleteView(id: $id)
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/mutations/deleteViewFilterGroup.ts b/packages/twenty-front/src/modules/views/graphql/mutations/deleteViewFilterGroup.ts
deleted file mode 100644
index f663897dfdf..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/mutations/deleteViewFilterGroup.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { gql } from '@apollo/client';
-
-export const DELETE_VIEW_FILTER_GROUP = gql`
- mutation DeleteViewFilterGroup($id: String!) {
- deleteViewFilterGroup(id: $id)
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/mutations/deleteViewGroup.ts b/packages/twenty-front/src/modules/views/graphql/mutations/deleteViewGroup.ts
deleted file mode 100644
index 8d8499dada8..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/mutations/deleteViewGroup.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_GROUP_FRAGMENT } from '@/views/graphql/fragments/viewGroupFragment';
-import { gql } from '@apollo/client';
-
-export const DELETE_VIEW_GROUP = gql`
- ${VIEW_GROUP_FRAGMENT}
- mutation DeleteViewGroup($input: DeleteViewGroupInput!) {
- deleteViewGroup(input: $input) {
- ...ViewGroupFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/mutations/destroyViewGroup.ts b/packages/twenty-front/src/modules/views/graphql/mutations/destroyViewGroup.ts
deleted file mode 100644
index bc732c02a56..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/mutations/destroyViewGroup.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_GROUP_FRAGMENT } from '@/views/graphql/fragments/viewGroupFragment';
-import { gql } from '@apollo/client';
-
-export const DESTROY_VIEW_GROUP = gql`
- ${VIEW_GROUP_FRAGMENT}
- mutation DestroyViewGroup($input: DestroyViewGroupInput!) {
- destroyViewGroup(input: $input) {
- ...ViewGroupFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/mutations/updateViewGroup.ts b/packages/twenty-front/src/modules/views/graphql/mutations/updateViewGroup.ts
deleted file mode 100644
index df246df52fc..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/mutations/updateViewGroup.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_GROUP_FRAGMENT } from '@/views/graphql/fragments/viewGroupFragment';
-import { gql } from '@apollo/client';
-
-export const UPDATE_VIEW_GROUP = gql`
- ${VIEW_GROUP_FRAGMENT}
- mutation UpdateViewGroup($input: UpdateViewGroupInput!) {
- updateViewGroup(input: $input) {
- ...ViewGroupFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findManyViewFields.ts b/packages/twenty-front/src/modules/views/graphql/queries/findManyViewFields.ts
deleted file mode 100644
index d1ce3f903a4..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findManyViewFields.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_FIELD_FRAGMENT } from '@/views/graphql/fragments/viewFieldFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_MANY_VIEW_FIELDS = gql`
- ${VIEW_FIELD_FRAGMENT}
- query FindManyViewFields($viewId: String!) {
- getViewFields(viewId: $viewId) {
- ...ViewFieldFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findManyViewFilterGroups.ts b/packages/twenty-front/src/modules/views/graphql/queries/findManyViewFilterGroups.ts
deleted file mode 100644
index 57f06b8539a..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findManyViewFilterGroups.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_FILTER_GROUP_FRAGMENT } from '@/views/graphql/fragments/viewFilterGroupFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_MANY_VIEW_FILTER_GROUPS = gql`
- ${VIEW_FILTER_GROUP_FRAGMENT}
- query FindManyViewFilterGroups($viewId: String) {
- getViewFilterGroups(viewId: $viewId) {
- ...ViewFilterGroupFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findManyViewFilters.ts b/packages/twenty-front/src/modules/views/graphql/queries/findManyViewFilters.ts
deleted file mode 100644
index bcfd2ffd6e2..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findManyViewFilters.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_FILTER_FRAGMENT } from '@/views/graphql/fragments/viewFilterFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_MANY_VIEW_FILTERS = gql`
- ${VIEW_FILTER_FRAGMENT}
- query FindManyViewFilters($viewId: String) {
- getViewFilters(viewId: $viewId) {
- ...ViewFilterFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findManyViewGroups.ts b/packages/twenty-front/src/modules/views/graphql/queries/findManyViewGroups.ts
deleted file mode 100644
index 6bd302d7f64..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findManyViewGroups.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_GROUP_FRAGMENT } from '@/views/graphql/fragments/viewGroupFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_MANY_VIEW_GROUPS = gql`
- ${VIEW_GROUP_FRAGMENT}
- query FindManyViewGroups($viewId: String) {
- getViewGroups(viewId: $viewId) {
- ...ViewGroupFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findManyViewSorts.ts b/packages/twenty-front/src/modules/views/graphql/queries/findManyViewSorts.ts
deleted file mode 100644
index fbae06dcc81..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findManyViewSorts.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_SORT_FRAGMENT } from '@/views/graphql/fragments/viewSortFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_MANY_VIEW_SORTS = gql`
- ${VIEW_SORT_FRAGMENT}
- query FindManyViewSorts($viewId: String) {
- getViewSorts(viewId: $viewId) {
- ...ViewSortFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findOneView.ts b/packages/twenty-front/src/modules/views/graphql/queries/findOneView.ts
deleted file mode 100644
index d59fd9f2bea..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findOneView.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_FRAGMENT } from '@/views/graphql/fragments/viewFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_ONE_VIEW = gql`
- ${VIEW_FRAGMENT}
- query FindOneView($id: String!) {
- getView(id: $id) {
- ...ViewFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findOneViewField.ts b/packages/twenty-front/src/modules/views/graphql/queries/findOneViewField.ts
deleted file mode 100644
index eb5ab0b9000..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findOneViewField.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_FIELD_FRAGMENT } from '@/views/graphql/fragments/viewFieldFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_ONE_VIEW_FIELD = gql`
- ${VIEW_FIELD_FRAGMENT}
- query FindOneViewField($id: String!) {
- getViewField(id: $id) {
- ...ViewFieldFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findOneViewFilter.ts b/packages/twenty-front/src/modules/views/graphql/queries/findOneViewFilter.ts
deleted file mode 100644
index 6d16087d6d4..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findOneViewFilter.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_FILTER_FRAGMENT } from '@/views/graphql/fragments/viewFilterFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_ONE_VIEW_FILTER = gql`
- ${VIEW_FILTER_FRAGMENT}
- query FindOneViewFilter($id: String!) {
- getViewFilter(id: $id) {
- ...ViewFilterFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findOneViewFilterGroup.ts b/packages/twenty-front/src/modules/views/graphql/queries/findOneViewFilterGroup.ts
deleted file mode 100644
index 32ac18489c4..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findOneViewFilterGroup.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_FILTER_GROUP_FRAGMENT } from '@/views/graphql/fragments/viewFilterGroupFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_ONE_VIEW_FILTER_GROUP = gql`
- ${VIEW_FILTER_GROUP_FRAGMENT}
- query FindOneViewFilterGroup($id: String!) {
- getViewFilterGroup(id: $id) {
- ...ViewFilterGroupFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findOneViewGroup.ts b/packages/twenty-front/src/modules/views/graphql/queries/findOneViewGroup.ts
deleted file mode 100644
index cd64a652a96..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findOneViewGroup.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_GROUP_FRAGMENT } from '@/views/graphql/fragments/viewGroupFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_ONE_VIEW_GROUP = gql`
- ${VIEW_GROUP_FRAGMENT}
- query FindOneViewGroup($id: String!) {
- getViewGroup(id: $id) {
- ...ViewGroupFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/graphql/queries/findOneViewSort.ts b/packages/twenty-front/src/modules/views/graphql/queries/findOneViewSort.ts
deleted file mode 100644
index 142475fed5a..00000000000
--- a/packages/twenty-front/src/modules/views/graphql/queries/findOneViewSort.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { VIEW_SORT_FRAGMENT } from '@/views/graphql/fragments/viewSortFragment';
-import { gql } from '@apollo/client';
-
-export const FIND_ONE_VIEW_SORT = gql`
- ${VIEW_SORT_FRAGMENT}
- query FindOneViewSort($id: String!) {
- getViewSort(id: $id) {
- ...ViewSortFragment
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/views/states/isCurrentViewIndexComponentState.ts b/packages/twenty-front/src/modules/views/states/isCurrentViewIndexComponentState.ts
deleted file mode 100644
index f343bb046e5..00000000000
--- a/packages/twenty-front/src/modules/views/states/isCurrentViewIndexComponentState.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { createAtomComponentState } from '@/ui/utilities/state/jotai/utils/createAtomComponentState';
-import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
-
-export const isCurrentViewKeyIndexComponentState =
- createAtomComponentState<boolean>({
- key: 'isCurrentViewKeyIndexComponentState',
- defaultValue: true,
- componentInstanceContext: ViewComponentInstanceContext,
- });
diff --git a/packages/twenty-front/src/modules/views/states/selectors/viewIdsFromObjectMetadataItemFamilySelector.ts b/packages/twenty-front/src/modules/views/states/selectors/viewIdsFromObjectMetadataItemFamilySelector.ts
deleted file mode 100644
index fbd9c1b7513..00000000000
--- a/packages/twenty-front/src/modules/views/states/selectors/viewIdsFromObjectMetadataItemFamilySelector.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { createAtomFamilySelector } from '@/ui/utilities/state/jotai/utils/createAtomFamilySelector';
-import { viewsSelector } from '@/views/states/selectors/viewsSelector';
-
-export const viewIdsFromObjectMetadataItemFamilySelector =
- createAtomFamilySelector<string[], { objectMetadataItemId: string }>({
- key: 'viewIdsFromObjectMetadataItemFamilySelector',
- get:
- ({ objectMetadataItemId }) =>
- ({ get }) => {
- const views = get(viewsSelector);
- return views
- .filter((view) => view.objectMetadataId === objectMetadataItemId)
- .map((view) => view.id);
- },
- });
diff --git a/packages/twenty-front/src/modules/views/states/selectors/viewsByObjectMetadataIdFamilySelector.ts b/packages/twenty-front/src/modules/views/states/selectors/viewsByObjectMetadataIdFamilySelector.ts
deleted file mode 100644
index f16c62edd31..00000000000
--- a/packages/twenty-front/src/modules/views/states/selectors/viewsByObjectMetadataIdFamilySelector.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { type ViewWithRelations } from '@/views/types/ViewWithRelations';
-import { viewsSelector } from '@/views/states/selectors/viewsSelector';
-import { createAtomFamilySelector } from '@/ui/utilities/state/jotai/utils/createAtomFamilySelector';
-
-export const viewsByObjectMetadataIdFamilySelector = createAtomFamilySelector<
- ViewWithRelations[],
- string
->({
- key: 'viewsByObjectMetadataIdFamilySelector',
- get:
- (objectMetadataId) =>
- ({ get }) => {
- const views = get(viewsSelector);
- return views.filter((view) => view.objectMetadataId === objectMetadataId);
- },
-});
diff --git a/packages/twenty-front/src/modules/views/states/selectors/viewsLengthSelector.ts b/packages/twenty-front/src/modules/views/states/selectors/viewsLengthSelector.ts
deleted file mode 100644
index 02a72a27b94..00000000000
--- a/packages/twenty-front/src/modules/views/states/selectors/viewsLengthSelector.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { viewsSelector } from '@/views/states/selectors/viewsSelector';
-import { createAtomSelector } from '@/ui/utilities/state/jotai/utils/createAtomSelector';
-
-export const viewsLengthSelector = createAtomSelector<number>({
- key: 'viewsLengthSelector',
- get: ({ get }) => {
- const views = get(viewsSelector);
- return views?.length ?? 0;
- },
-});
diff --git a/packages/twenty-front/src/modules/views/utils/__tests__/mapBoardFieldDefinitionsToViewFields.test.ts b/packages/twenty-front/src/modules/views/utils/__tests__/mapBoardFieldDefinitionsToViewFields.test.ts
deleted file mode 100644
index 0894ad3e3af..00000000000
--- a/packages/twenty-front/src/modules/views/utils/__tests__/mapBoardFieldDefinitionsToViewFields.test.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import { type RecordBoardFieldDefinition } from '@/object-record/record-board/types/RecordBoardFieldDefinition';
-import { type FieldMetadata } from '@/object-record/record-field/ui/types/FieldMetadata';
-import { mapBoardFieldDefinitionsToViewFields } from '@/views/utils/mapBoardFieldDefinitionsToViewFields';
-import { FieldMetadataType } from '~/generated-metadata/graphql';
-
-describe('mapBoardFieldDefinitionsToViewFields', () => {
- it('should map board field definitions to view fields', () => {
- const fieldDefinitions: RecordBoardFieldDefinition<FieldMetadata>[] = [
- {
- fieldMetadataId: 'fieldMetadataId',
- label: 'label',
- iconName: 'iconName',
- type: FieldMetadataType.BOOLEAN,
- metadata: {
- objectMetadataNameSingular: 'objectMetadataNameSingular',
- fieldName: 'fieldName',
- },
- position: 0,
- isVisible: true,
- viewFieldId: 'viewFieldId',
- },
- {
- fieldMetadataId: 'fieldMetadataId1',
- label: 'label1',
- iconName: 'iconName1',
- type: FieldMetadataType.NUMBER,
- metadata: {
- objectMetadataNameSingular: 'objectMetadataNameSingular1',
- fieldName: 'fieldName1',
- placeHolder: 'placeHolder1',
- isPositive: true,
- },
- position: 1,
- isVisible: false,
- viewFieldId: 'viewFieldId1',
- },
- ];
- const viewFields = mapBoardFieldDefinitionsToViewFields(fieldDefinitions);
-
- expect(viewFields).toHaveLength(2);
-
- expect(viewFields[0]).toHaveProperty('id');
- expect(viewFields[0]).toHaveProperty('size');
- expect(viewFields[0]).toHaveProperty('position');
- expect(viewFields[0]).toHaveProperty('isVisible');
-
- expect(viewFields[0].definition).toEqual(fieldDefinitions[0]);
- expect(viewFields[1].definition).toEqual(fieldDefinitions[1]);
- });
-});
diff --git a/packages/twenty-front/src/modules/views/utils/__tests__/shouldReplaceFilter.test.ts b/packages/twenty-front/src/modules/views/utils/__tests__/shouldReplaceFilter.test.ts
deleted file mode 100644
index 32e886c11b4..00000000000
--- a/packages/twenty-front/src/modules/views/utils/__tests__/shouldReplaceFilter.test.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { shouldReplaceFilter } from '@/views/utils/shouldReplaceFilter';
-
-describe('shouldReplaceFilter', () => {
- it('should match advanced filters by id', () => {
- const result = shouldReplaceFilter(
- { id: 'f1', fieldMetadataId: 'field-a', recordFilterGroupId: 'g1' },
- { id: 'f1', fieldMetadataId: 'field-b', recordFilterGroupId: 'g1' },
- );
-
- expect(result).toBe(true);
- });
-
- it('should not match advanced filters with different ids', () => {
- const result = shouldReplaceFilter(
- { id: 'f1', fieldMetadataId: 'field-a', recordFilterGroupId: 'g1' },
- { id: 'f2', fieldMetadataId: 'field-a', recordFilterGroupId: 'g1' },
- );
-
- expect(result).toBe(false);
- });
-
- it('should match simple filters by fieldMetadataId when old filter has no group', () => {
- const result = shouldReplaceFilter(
- { id: 'f1', fieldMetadataId: 'field-a', recordFilterGroupId: undefined },
- { id: 'f2', fieldMetadataId: 'field-a', recordFilterGroupId: undefined },
- );
-
- expect(result).toBe(true);
- });
-
- it('should not replace when old filter belongs to a group but new filter does not', () => {
- const result = shouldReplaceFilter(
- { id: 'f1', fieldMetadataId: 'field-a', recordFilterGroupId: 'g1' },
- { id: 'f2', fieldMetadataId: 'field-a', recordFilterGroupId: undefined },
- );
-
- expect(result).toBe(false);
- });
-});
diff --git a/packages/twenty-front/src/modules/views/utils/areRecordFieldsEqual.ts b/packages/twenty-front/src/modules/views/utils/areRecordFieldsEqual.ts
deleted file mode 100644
index f16e608a25d..00000000000
--- a/packages/twenty-front/src/modules/views/utils/areRecordFieldsEqual.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { type RecordField } from '@/object-record/record-field/types/RecordField';
-import { compareStrictlyExceptForNullAndUndefined } from '~/utils/compareStrictlyExceptForNullAndUndefined';
-
-export const areRecordFieldsEqual = (
- recordFieldA: RecordField,
- recordFieldB: RecordField,
-) => {
- const propertiesToCompare: (keyof RecordField)[] = [
- 'fieldMetadataItemId',
- 'isVisible',
- 'position',
- 'size',
- 'aggregateOperation',
- ];
-
- return propertiesToCompare.every((property) =>
- compareStrictlyExceptForNullAndUndefined(
- recordFieldA[property],
- recordFieldB[property],
- ),
- );
-};
diff --git a/packages/twenty-front/src/modules/views/utils/getCombinedViewFilterGroups.ts b/packages/twenty-front/src/modules/views/utils/getCombinedViewFilterGroups.ts
deleted file mode 100644
index 8bce6a4757c..00000000000
--- a/packages/twenty-front/src/modules/views/utils/getCombinedViewFilterGroups.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { type ViewFilterGroup } from '@/views/types/ViewFilterGroup';
-
-export const getCombinedViewFilterGroups = (
- viewFilterGroups: ViewFilterGroup[],
- unsavedToUpsertViewFilterGroups: ViewFilterGroup[],
- unsavedToDeleteViewFilterGroupIds: string[],
-): ViewFilterGroup[] => {
- const toCreateViewFilterGroups = unsavedToUpsertViewFilterGroups.filter(
- (toUpsertViewFilterGroup) =>
- !viewFilterGroups.some(
- (viewFilterGroup) => viewFilterGroup.id === toUpsertViewFilterGroup.id,
- ),
- );
-
- const toUpdateViewFilterGroups = unsavedToUpsertViewFilterGroups.filter(
- (toUpsertViewFilterGroup) =>
- viewFilterGroups.some(
- (viewFilterGroup) => viewFilterGroup.id === toUpsertViewFilterGroup.id,
- ),
- );
-
- const combinedViewFilterGroups = viewFilterGroups
- .filter(
- (viewFilterGroup) =>
- !unsavedToDeleteViewFilterGroupIds.includes(viewFilterGroup.id),
- )
- .map((viewFilterGroup) => {
- const toUpdateViewFilterGroup = toUpdateViewFilterGroups.find(
- (toUpdateViewFilterGroup) =>
- toUpdateViewFilterGroup.id === viewFilterGroup.id,
- );
-
- return toUpdateViewFilterGroup ?? viewFilterGroup;
- })
- .concat(toCreateViewFilterGroups);
-
- return combinedViewFilterGroups;
-};
diff --git a/packages/twenty-front/src/modules/views/utils/getFilterableFields.ts b/packages/twenty-front/src/modules/views/utils/getFilterableFields.ts
deleted file mode 100644
index 2537c355c22..00000000000
--- a/packages/twenty-front/src/modules/views/utils/getFilterableFields.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
-import { getFilterFilterableFieldMetadataItems } from '@/object-metadata/utils/getFilterFilterableFieldMetadataItems';
-
-export const getFilterableFields = (
- objectMetadataItem: EnrichedObjectMetadataItem,
-) => {
- return [
- ...objectMetadataItem.fields.filter(
- getFilterFilterableFieldMetadataItems({ isJsonFilterEnabled: true }),
- ),
- ];
-};
diff --git a/packages/twenty-front/src/modules/views/utils/getObjectMetadataItemViews.ts b/packages/twenty-front/src/modules/views/utils/getObjectMetadataItemViews.ts
deleted file mode 100644
index 08c87089a1c..00000000000
--- a/packages/twenty-front/src/modules/views/utils/getObjectMetadataItemViews.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { type GraphQLView } from '@/views/types/GraphQLView';
-
-export const getObjectMetadataItemViews = (
- viewObjectMetadataId: string,
- views: GraphQLView[],
-) => {
- return [
- ...views.filter((view) => view.objectMetadataId === viewObjectMetadataId),
- ]
- .sort((a, b) => a.position - b.position)
-
- .map((view) => ({
- id: view.id,
- name: view.name,
- type: view.type,
- key: view.key,
- position: view.position,
- objectMetadataId: view.objectMetadataId,
- mainGroupByFieldMetadataId: view.mainGroupByFieldMetadataId,
- kanbanAggregateOperation: view.kanbanAggregateOperation,
- kanbanAggregateOperationFieldMetadataId:
- view.kanbanAggregateOperationFieldMetadataId,
- icon: view.icon,
- }));
-};
diff --git a/packages/twenty-front/src/modules/views/utils/mapBoardFieldDefinitionsToViewFields.ts b/packages/twenty-front/src/modules/views/utils/mapBoardFieldDefinitionsToViewFields.ts
deleted file mode 100644
index 7b5a6e232a7..00000000000
--- a/packages/twenty-front/src/modules/views/utils/mapBoardFieldDefinitionsToViewFields.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { type RecordBoardFieldDefinition } from '@/object-record/record-board/types/RecordBoardFieldDefinition';
-import { type FieldMetadata } from '@/object-record/record-field/ui/types/FieldMetadata';
-import { type ViewField } from '@/views/types/ViewField';
-
-export const mapBoardFieldDefinitionsToViewFields = (
- fieldsDefinitions: RecordBoardFieldDefinition<FieldMetadata>[],
-): ViewField[] => {
- return fieldsDefinitions.map(
- (fieldDefinition): ViewField => ({
- id: fieldDefinition.viewFieldId || '',
- fieldMetadataId: fieldDefinition.fieldMetadataId,
- size: 0,
- position: fieldDefinition.position,
- isVisible: fieldDefinition.isVisible ?? true,
- isActive: true,
- definition: fieldDefinition,
- }),
- );
-};
diff --git a/packages/twenty-front/src/modules/views/utils/shouldReplaceFilter.ts b/packages/twenty-front/src/modules/views/utils/shouldReplaceFilter.ts
deleted file mode 100644
index 85ad6a9de5d..00000000000
--- a/packages/twenty-front/src/modules/views/utils/shouldReplaceFilter.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { type RecordFilter } from '@/object-record/record-filter/types/RecordFilter';
-import { compareStrictlyExceptForNullAndUndefined } from '~/utils/compareStrictlyExceptForNullAndUndefined';
-import { isDefined } from 'twenty-shared/utils';
-
-export const shouldReplaceFilter = (
- oldFilter: Pick<
- RecordFilter,
- 'id' | 'fieldMetadataId' | 'recordFilterGroupId'
- >,
- newFilter: Pick<
- RecordFilter,
- 'id' | 'fieldMetadataId' | 'recordFilterGroupId'
- >,
-) => {
- const isNewFilterAdvancedFilter = isDefined(newFilter.recordFilterGroupId);
-
- if (isNewFilterAdvancedFilter) {
- return newFilter.id === oldFilter.id;
- } else {
- return (
- compareStrictlyExceptForNullAndUndefined(
- newFilter.fieldMetadataId,
- oldFilter.fieldMetadataId,
- ) && !isDefined(oldFilter.recordFilterGroupId)
- );
- }
-};
diff --git a/packages/twenty-front/src/modules/views/utils/sortViewFilterGroupsOutermostFirst.ts b/packages/twenty-front/src/modules/views/utils/sortViewFilterGroupsOutermostFirst.ts
deleted file mode 100644
index f27f52a0a6b..00000000000
--- a/packages/twenty-front/src/modules/views/utils/sortViewFilterGroupsOutermostFirst.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { type ViewFilterGroup } from '@/views/types/ViewFilterGroup';
-
-export const sortViewFilterGroupsOutermostFirst = (
- viewFilterGroups: ViewFilterGroup[],
- parentViewFilterGroupId?: string,
-): ViewFilterGroup[] => {
- const childGroups = viewFilterGroups.filter(
- (group) => group.parentViewFilterGroupId === parentViewFilterGroupId,
- );
-
- return childGroups.flatMap((group) => [
- group,
- ...sortViewFilterGroupsOutermostFirst(viewFilterGroups, group.id),
- ]);
-};
diff --git a/packages/twenty-front/src/modules/workflow/hooks/__tests__/useComputeStepOutputSchema.test.ts b/packages/twenty-front/src/modules/workflow/hooks/__tests__/useComputeStepOutputSchema.test.ts
deleted file mode 100644
index c064ca677bc..00000000000
--- a/packages/twenty-front/src/modules/workflow/hooks/__tests__/useComputeStepOutputSchema.test.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { useMutation } from '@apollo/client/react';
-import { renderHook } from '@testing-library/react';
-import { type ComputeStepOutputSchemaInput } from '~/generated/graphql';
-import { useComputeStepOutputSchema } from '@/workflow/hooks/useComputeStepOutputSchema';
-
-jest.mock('@apollo/client/react', () => ({
- ...jest.requireActual('@apollo/client/react'),
- useMutation: jest.fn(),
-}));
-jest.mock('@/object-metadata/hooks/useApolloCoreClient', () => ({
- useApolloCoreClient: () => ({}),
-}));
-
-describe('useComputeStepOutputSchema', () => {
- it('should compute schema successfully', async () => {
- const mockInput = { stepId: '123' };
- const mockResponse = {
- data: { computeStepOutputSchema: { schema: { type: 'object' } } },
- };
- const mockMutate = jest.fn().mockResolvedValue(mockResponse);
-
- (useMutation as unknown as jest.Mock).mockReturnValue([mockMutate]);
-
- const { result } = renderHook(() => useComputeStepOutputSchema());
- const response = await result.current.computeStepOutputSchema(
- mockInput as unknown as ComputeStepOutputSchemaInput,
- );
-
- expect(mockMutate).toHaveBeenCalledWith({
- variables: { input: mockInput },
- });
- expect(response).toEqual(mockResponse);
- });
-});
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useComputeStepOutputSchema.ts b/packages/twenty-front/src/modules/workflow/hooks/useComputeStepOutputSchema.ts
deleted file mode 100644
index 51bd8b56b25..00000000000
--- a/packages/twenty-front/src/modules/workflow/hooks/useComputeStepOutputSchema.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
-import { COMPUTE_STEP_OUTPUT_SCHEMA } from '@/workflow/graphql/mutations/computeStepOutputSchema';
-import { useMutation } from '@apollo/client/react';
-import {
- type ComputeStepOutputSchemaInput,
- type ComputeStepOutputSchemaMutation,
- type ComputeStepOutputSchemaMutationVariables,
-} from '~/generated/graphql';
-
-export const useComputeStepOutputSchema = () => {
- const apolloCoreClient = useApolloCoreClient();
- const [mutate] = useMutation<
- ComputeStepOutputSchemaMutation,
- ComputeStepOutputSchemaMutationVariables
- >(COMPUTE_STEP_OUTPUT_SCHEMA, {
- client: apolloCoreClient,
- });
-
- const computeStepOutputSchema = async (
- input: ComputeStepOutputSchemaInput,
- ) => {
- return await mutate({ variables: { input } });
- };
-
- return { computeStepOutputSchema };
-};
diff --git a/packages/twenty-front/src/modules/workflow/states/selectors/stepSelector.ts b/packages/twenty-front/src/modules/workflow/states/selectors/stepSelector.ts
deleted file mode 100644
index f94a41924b8..00000000000
--- a/packages/twenty-front/src/modules/workflow/states/selectors/stepSelector.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { createAtomComponentSelector } from '@/ui/utilities/state/jotai/utils/createAtomComponentSelector';
-import { flowComponentState } from '@/workflow/states/flowComponentState';
-import type { WorkflowAction } from '@/workflow/types/Workflow';
-import { WorkflowVisualizerComponentInstanceContext } from '@/workflow/workflow-diagram/states/contexts/WorkflowVisualizerComponentInstanceContext';
-import { isDefined } from 'twenty-shared/utils';
-
-export const createStepSelector = (stepId: string) =>
- createAtomComponentSelector<WorkflowAction | null>({
- key: `stepSelector-${stepId}`,
- get:
- (componentStateKey) =>
- ({ get }) => {
- const flowState = get(flowComponentState, componentStateKey);
-
- if (!isDefined(flowState) || !isDefined(flowState.steps)) {
- return null;
- }
-
- const step = flowState.steps.find(
- (step: WorkflowAction) => step.id === stepId,
- );
-
- return step ?? null;
- },
- componentInstanceContext: WorkflowVisualizerComponentInstanceContext,
- });
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVisualizer.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVisualizer.tsx
deleted file mode 100644
index 531ec6f69bc..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVisualizer.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { WorkflowDiagramCanvasEditable } from '@/workflow/workflow-diagram/components/WorkflowDiagramCanvasEditable';
-import { WorkflowDiagramEffect } from '@/workflow/workflow-diagram/components/WorkflowDiagramEffect';
-
-export const WorkflowVisualizer = () => {
- return (
- <>
- <WorkflowDiagramEffect />
- <WorkflowDiagramCanvasEditable />
- </>
- );
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/constants/EmptyTriggerStepId.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/constants/EmptyTriggerStepId.ts
deleted file mode 100644
index 7647ed0275b..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/constants/EmptyTriggerStepId.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const EMPTY_TRIGGER_STEP_ID = 'empty-trigger';
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/hooks/useSidePanelState.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/hooks/useSidePanelState.ts
deleted file mode 100644
index 6617dc4d2e2..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/hooks/useSidePanelState.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { isSidePanelOpenedState } from '@/side-panel/states/isSidePanelOpenedState';
-import { type SidePanelAnimationVariant } from '@/side-panel/types/SidePanelAnimationVariant';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { useIsMobile } from 'twenty-ui/utilities';
-
-export const useSidePanelState = (): {
- sidePanelState: SidePanelAnimationVariant;
-} => {
- const isMobile = useIsMobile();
- const isSidePanelOpened = useAtomStateValue(isSidePanelOpenedState);
-
- if (isMobile) {
- return {
- sidePanelState: 'fullScreen',
- };
- }
-
- return {
- sidePanelState: isSidePanelOpened ? 'normal' : 'closed',
- };
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/getWorkflowVersionDiagram.test.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/getWorkflowVersionDiagram.test.ts
deleted file mode 100644
index 54a15986dc5..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/getWorkflowVersionDiagram.test.ts
+++ /dev/null
@@ -1,225 +0,0 @@
-import { getWorkflowVersionDiagram } from '@/workflow/workflow-diagram/utils/getWorkflowVersionDiagram';
-import { v4 as uuidv4 } from 'uuid';
-
-jest.mock('uuid', () => ({
- ...jest.requireActual('uuid'),
- v4: jest.fn(),
-}));
-
-beforeEach(() => {
- let counter = 0;
- (uuidv4 as jest.Mock).mockImplementation(
- () => `8f3b2121-f194-4ba4-9fbf-${counter++}`,
- );
-});
-
-afterAll(() => {
- jest.resetAllMocks();
-});
-
-describe('getWorkflowVersionDiagram', () => {
- it('returns an empty diagram if the provided workflow version', () => {
- const result = getWorkflowVersionDiagram({
- workflowVersion: undefined,
- workflowContext: 'workflow',
- });
-
- expect(result).toMatchInlineSnapshot(`
-{
- "edges": [],
- "nodes": [],
-}
-`);
- });
-
- it('returns a diagram with an empty-trigger node if the provided workflow version has no trigger', () => {
- const result = getWorkflowVersionDiagram({
- workflowVersion: {
- __typename: 'WorkflowVersion',
- status: 'ACTIVE',
- createdAt: '',
- id: '1',
- name: '',
- steps: [],
- trigger: null,
- updatedAt: '',
- workflowId: '',
- },
- workflowContext: 'workflow',
- });
-
- expect(result).toMatchInlineSnapshot(`
-{
- "edges": [],
- "nodes": [
- {
- "data": {
- "nodeType": "empty-trigger",
- "position": {
- "x": 0,
- "y": 0,
- },
- },
- "id": "trigger",
- "position": {
- "x": 0,
- "y": 0,
- },
- "type": "empty-trigger",
- },
- ],
-}
-`);
- });
-
- it('returns a diagram with only a trigger node if the provided workflow version has no steps', () => {
- const result = getWorkflowVersionDiagram({
- workflowVersion: {
- __typename: 'WorkflowVersion',
- status: 'ACTIVE',
- createdAt: '',
- id: '1',
- name: '',
- steps: null,
- trigger: {
- name: 'Record is created',
- settings: { eventName: 'company.created', outputSchema: {} },
- type: 'DATABASE_EVENT',
- },
- updatedAt: '',
- workflowId: '',
- },
- workflowContext: 'workflow',
- });
-
- expect(result).toMatchInlineSnapshot(`
-{
- "edges": [],
- "nodes": [
- {
- "data": {
- "hasNextStepIds": false,
- "icon": "IconPlaylistAdd",
- "name": "Record is created",
- "nodeType": "trigger",
- "position": {
- "x": 0,
- "y": 0,
- },
- "stepId": "trigger",
- "triggerType": "DATABASE_EVENT",
- },
- "id": "trigger",
- "position": {
- "x": 0,
- "y": 0,
- },
- },
- ],
-}
-`);
- });
-
- it('returns the diagram for the last version', () => {
- const result = getWorkflowVersionDiagram({
- workflowVersion: {
- __typename: 'WorkflowVersion',
- status: 'ACTIVE',
- createdAt: '',
- id: '1',
- name: '',
- steps: [
- {
- id: 'step-1',
- name: '',
- settings: {
- errorHandlingOptions: {
- retryOnFailure: { value: true },
- continueOnFailure: { value: false },
- },
- input: {
- logicFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',
- logicFunctionInput: {},
- },
- outputSchema: {},
- },
- type: 'CODE',
- valid: true,
- },
- ],
- trigger: {
- name: 'Company created',
- settings: { eventName: 'company.created', outputSchema: {} },
- type: 'DATABASE_EVENT',
- nextStepIds: ['step-1'],
- },
- updatedAt: '',
- workflowId: '',
- },
- workflowContext: 'workflow',
- });
-
- expect(result).toMatchInlineSnapshot(`
-{
- "edges": [
- {
- "data": {
- "edgeType": "default",
- },
- "deletable": true,
- "id": "8f3b2121-f194-4ba4-9fbf-0",
- "markerEnd": "edge-branch-arrow-default",
- "markerStart": undefined,
- "reconnectable": "target",
- "selectable": true,
- "source": "trigger",
- "sourceHandle": "default",
- "target": "step-1",
- "targetHandle": "default",
- "type": "editable",
- "zIndex": -2,
- },
- ],
- "nodes": [
- {
- "data": {
- "hasNextStepIds": true,
- "icon": "IconPlaylistAdd",
- "name": "Company created",
- "nodeType": "trigger",
- "position": {
- "x": 0,
- "y": 0,
- },
- "stepId": "trigger",
- "triggerType": "DATABASE_EVENT",
- },
- "id": "trigger",
- "position": {
- "x": 0,
- "y": 0,
- },
- },
- {
- "data": {
- "actionType": "CODE",
- "hasNextStepIds": false,
- "name": "",
- "nodeType": "action",
- "position": {
- "x": 0,
- "y": 150,
- },
- "stepId": "step-1",
- },
- "id": "step-1",
- "position": {
- "x": 0,
- "y": 150,
- },
- },
- ],
-}
-`);
- });
-});
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/getWorkflowVersionDiagram.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/getWorkflowVersionDiagram.ts
deleted file mode 100644
index 00866cdf8e7..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/getWorkflowVersionDiagram.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { type WorkflowVersion } from '@/workflow/types/Workflow';
-import { type WorkflowContext } from '@/workflow/workflow-diagram/types/WorkflowContext';
-import { type WorkflowDiagram } from '@/workflow/workflow-diagram/types/WorkflowDiagram';
-import { generateWorkflowDiagram } from '@/workflow/workflow-diagram/utils/generateWorkflowDiagram';
-import { isDefined } from 'twenty-shared/utils';
-
-const EMPTY_DIAGRAM: WorkflowDiagram = {
- nodes: [],
- edges: [],
-};
-
-export const getWorkflowVersionDiagram = ({
- workflowVersion,
- workflowContext,
-}: {
- workflowVersion: WorkflowVersion | undefined;
- workflowContext: WorkflowContext;
-}): WorkflowDiagram => {
- if (!isDefined(workflowVersion)) {
- return EMPTY_DIAGRAM;
- }
-
- return generateWorkflowDiagram({
- trigger: workflowVersion.trigger ?? undefined,
- steps: workflowVersion.steps ?? [],
- workflowContext,
- });
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-iterator/hooks/useStartIteratorFirstNodeCreation.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-iterator/hooks/useStartIteratorFirstNodeCreation.ts
deleted file mode 100644
index 668ea882c64..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-iterator/hooks/useStartIteratorFirstNodeCreation.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { useCallback } from 'react';
-
-export const useStartIteratorFirstNodeCreation = () => {
- /**
- * This function is used in a context where dependencies shouldn't change much.
- * That's why its wrapped in a `useCallback` hook. Removing memoization might break the app unexpectedly.
- */
- const startIteratorFirstNodeCreation = useCallback(() => {
- // TODO: to implement
- }, []);
-
- // TODO: to implement
- const isIteratorFirstNodeCreationStarted = () => {
- return false;
- };
-
- return {
- startIteratorFirstNodeCreation,
- isIteratorFirstNodeCreationStarted,
- };
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/hooks/useFilterCounter.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/hooks/useFilterCounter.ts
deleted file mode 100644
index 06b895421b6..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/hooks/useFilterCounter.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
-import { createStepSelector } from '@/workflow/states/selectors/stepSelector';
-import { useMemo } from 'react';
-import { isDefined } from 'twenty-shared/utils';
-
-export const useFilterCounter = ({ stepId }: { stepId: string }) => {
- const stepSelector = useMemo(() => createStepSelector(stepId), [stepId]);
- const step = useAtomComponentSelectorValue(stepSelector);
-
- if (!isDefined(step)) {
- return {
- filterCounter: 0,
- };
- }
-
- if (step.type === 'FILTER' && isDefined(step.settings?.input?.stepFilters)) {
- return {
- filterCounter: step.settings.input.stepFilters.length,
- };
- }
-
- return {
- filterCounter: 0,
- };
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useActionHeaderTypeOrThrow.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useActionHeaderTypeOrThrow.ts
deleted file mode 100644
index 3debfd5b1bf..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useActionHeaderTypeOrThrow.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { type WorkflowActionType } from '@/workflow/types/Workflow';
-import { getActionHeaderTypeOrThrow } from '@/workflow/workflow-steps/workflow-actions/utils/getActionHeaderTypeOrThrow';
-import { useLingui } from '@lingui/react/macro';
-
-export const useActionHeaderTypeOrThrow = (actionType: WorkflowActionType) => {
- const { i18n } = useLingui();
-
- return i18n._(getActionHeaderTypeOrThrow(actionType));
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useActionIconColorOrThrow.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useActionIconColorOrThrow.ts
deleted file mode 100644
index ea44cd8b452..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useActionIconColorOrThrow.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { type WorkflowActionType } from '@/workflow/types/Workflow';
-import { getActionIconColorOrThrow } from '@/workflow/workflow-steps/workflow-actions/utils/getActionIconColorOrThrow';
-
-export const useActionIconColorOrThrow = (
- actionType: WorkflowActionType,
-): string => getActionIconColorOrThrow(actionType);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/utils/__tests__/shouldDisplayRawJsonByDefault.test.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/utils/__tests__/shouldDisplayRawJsonByDefault.test.ts
deleted file mode 100644
index 26e8cc1a08d..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/utils/__tests__/shouldDisplayRawJsonByDefault.test.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-import { type HttpRequestBody } from '@/workflow/workflow-steps/workflow-actions/http-request-action/constants/HttpRequest';
-import { shouldDisplayRawJsonByDefault } from '@/workflow/workflow-steps/workflow-actions/http-request-action/utils/shouldDisplayRawJsonByDefault';
-
-describe('shouldDisplayRawJsonByDefault', () => {
- describe('when defaultValue is undefined', () => {
- it('should return false', () => {
- expect(shouldDisplayRawJsonByDefault(undefined)).toBe(false);
- });
- });
-
- describe('when defaultValue is a string', () => {
- describe('when string contains valid JSON with only string values', () => {
- it('should return false for simple object', () => {
- const defaultValue = '{"key1": "value1", "key2": "value2"}';
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(false);
- });
-
- it('should return true for nested object with only string values', () => {
- const defaultValue = '{"key1": "value1", "nested": {"key2": "value2"}}';
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
-
- it('should return false for array with only string values', () => {
- const defaultValue = '["value1", "value2", "value3"]';
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(false);
- });
-
- it('should return true for empty object', () => {
- const defaultValue = '{}';
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
-
- it('should return true for empty array', () => {
- const defaultValue = '[]';
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
- });
-
- describe('when string is not valid JSON', () => {
- it('should return true for invalid JSON string', () => {
- const defaultValue = 'invalid json string';
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
-
- it('should return true for malformed JSON', () => {
- const defaultValue = '{"key1": "value1", "key2":}';
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
- });
- });
-
- describe('when defaultValue is an HttpRequestBody object', () => {
- describe('when object has non-string values', () => {
- it('should return true for object with number values', () => {
- const defaultValue: HttpRequestBody = { key1: 'value1', key2: 123 };
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
-
- it('should return true for object with boolean values', () => {
- const defaultValue: HttpRequestBody = { key1: 'value1', key2: true };
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
-
- it('should return true for object with null values', () => {
- const defaultValue: HttpRequestBody = { key1: 'value1', key2: null };
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
-
- it('should return true for object with array values', () => {
- const defaultValue: HttpRequestBody = {
- key1: 'value1',
- key2: [1, 'two', true, null],
- };
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
-
- it('should return true for object with mixed types', () => {
- const defaultValue: HttpRequestBody = {
- key1: 'value1',
- key2: 123,
- key3: true,
- key4: null,
- key5: ['array', 'values'],
- };
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
- });
- });
-
- describe('edge cases', () => {
- it('should handle complex nested structures', () => {
- const defaultValue = JSON.stringify({
- level1: {
- level2: {
- stringValue: 'test',
- numberValue: 42,
- booleanValue: true,
- nullValue: null,
- arrayValue: [1, 'two', false],
- },
- },
- });
- expect(shouldDisplayRawJsonByDefault(defaultValue)).toBe(true);
- });
- });
-});
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/utils/shouldDisplayRawJsonByDefault.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/utils/shouldDisplayRawJsonByDefault.ts
deleted file mode 100644
index a6f1e6fd494..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/utils/shouldDisplayRawJsonByDefault.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { type HttpRequestBody } from '@/workflow/workflow-steps/workflow-actions/http-request-action/constants/HttpRequest';
-import { hasNonStringValues } from '@/workflow/workflow-steps/workflow-actions/http-request-action/utils/hasNonStringValues';
-import { removeVariablesFromJson } from '@/workflow/workflow-variables/utils/removeVariablesFromJson';
-import { isObject, isString, isUndefined } from '@sniptt/guards';
-import { parseJson } from 'twenty-shared/utils';
-import { type JsonValue } from 'type-fest';
-
-export const shouldDisplayRawJsonByDefault = (
- defaultValue: string | HttpRequestBody | undefined,
-) => {
- const defaultValueParsedWithoutVariables: JsonValue | undefined = isString(
- defaultValue,
- )
- ? (parseJson<JsonValue>(removeVariablesFromJson(defaultValue)) ?? {})
- : defaultValue;
-
- if (isUndefined(defaultValueParsedWithoutVariables)) {
- return false;
- }
-
- return (
- ((isObject(defaultValueParsedWithoutVariables) ||
- Array.isArray(defaultValueParsedWithoutVariables)) &&
- hasNonStringValues(defaultValueParsedWithoutVariables)) ||
- !(
- isObject(defaultValueParsedWithoutVariables) ||
- Array.isArray(defaultValueParsedWithoutVariables)
- )
- );
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/utils/getEmptyChildStepIds.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/utils/getEmptyChildStepIds.ts
deleted file mode 100644
index 6098870c9fb..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/utils/getEmptyChildStepIds.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import {
- type WorkflowIfElseAction,
- type WorkflowStep,
-} from '@/workflow/types/Workflow';
-import { isDefined } from 'twenty-shared/utils';
-
-export const getEmptyChildStepIds = ({
- ifElseAction,
- allSteps,
-}: {
- ifElseAction: WorkflowIfElseAction;
- allSteps: WorkflowStep[];
-}): string[] => {
- const branches = ifElseAction.settings.input.branches;
- const childStepIds = branches.flatMap((branch) => branch.nextStepIds);
-
- return childStepIds.filter((childStepId) => {
- const childStep = allSteps.find((step) => step.id === childStepId);
- return isDefined(childStep) && childStep.type === 'EMPTY';
- });
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/constants/ManualTriggerAvailabilityOptions.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/constants/ManualTriggerAvailabilityOptions.ts
deleted file mode 100644
index 9db38da0b37..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/constants/ManualTriggerAvailabilityOptions.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { type WorkflowManualTriggerAvailability } from '@/workflow/types/Workflow';
-import { IconCheckbox, type IconComponent, IconSquare } from 'twenty-ui/icon';
-
-export const MANUAL_TRIGGER_AVAILABILITY_OPTIONS: Array<{
- label: string;
- value: WorkflowManualTriggerAvailability;
- Icon: IconComponent;
-}> = [
- {
- label: 'When records are selected',
- value: 'WHEN_RECORD_SELECTED',
- Icon: IconCheckbox,
- },
- {
- label: 'When no records are selected',
- value: 'EVERYWHERE',
- Icon: IconSquare,
- },
-];
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/__tests__/getRootStepIds.test.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/__tests__/getRootStepIds.test.ts
deleted file mode 100644
index 225b3e01066..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/__tests__/getRootStepIds.test.ts
+++ /dev/null
@@ -1,146 +0,0 @@
-import { type WorkflowAction } from '@/workflow/types/Workflow';
-import { getRootStepIds } from '@/workflow/workflow-trigger/utils/getRootStepIds';
-
-describe('getRootStepIds', () => {
- it('should return empty array for empty steps', () => {
- const result = getRootStepIds([]);
-
- expect(result).toEqual([]);
- });
-
- it('should return single step id when only one step exists', () => {
- const steps: WorkflowAction[] = [
- {
- id: 'step-1',
- name: 'Step 1',
- type: 'CREATE_RECORD',
- valid: true,
- settings: {} as any,
- },
- ];
-
- const result = getRootStepIds(steps);
-
- expect(result).toEqual(['step-1']);
- });
-
- it('should return root step ids (steps not referenced by other steps)', () => {
- const steps: WorkflowAction[] = [
- {
- id: 'step-1',
- name: 'Root Step',
- type: 'CREATE_RECORD',
- valid: true,
- settings: {} as any,
- nextStepIds: ['step-2'],
- },
- {
- id: 'step-2',
- name: 'Child Step',
- type: 'UPDATE_RECORD',
- valid: true,
- settings: {} as any,
- },
- ];
-
- const result = getRootStepIds(steps);
-
- expect(result).toEqual(['step-1']);
- });
-
- it('should return multiple root steps when there are parallel branches', () => {
- const steps: WorkflowAction[] = [
- {
- id: 'step-1',
- name: 'Root 1',
- type: 'CREATE_RECORD',
- valid: true,
- settings: {} as any,
- nextStepIds: ['step-3'],
- },
- {
- id: 'step-2',
- name: 'Root 2',
- type: 'UPDATE_RECORD',
- valid: true,
- settings: {} as any,
- nextStepIds: ['step-3'],
- },
- {
- id: 'step-3',
- name: 'Child',
- type: 'SEND_EMAIL',
- valid: true,
- settings: {} as any,
- },
- ];
-
- const result = getRootStepIds(steps);
-
- expect(result).toEqual(['step-1', 'step-2']);
- });
-
- it('should handle steps with undefined nextStepIds', () => {
- const steps: WorkflowAction[] = [
- {
- id: 'step-1',
- name: 'Step 1',
- type: 'CREATE_RECORD',
- valid: true,
- settings: {} as any,
- nextStepIds: undefined,
- },
- {
- id: 'step-2',
- name: 'Step 2',
- type: 'UPDATE_RECORD',
- valid: true,
- settings: {} as any,
- },
- ];
-
- const result = getRootStepIds(steps);
-
- expect(result).toEqual(['step-1', 'step-2']);
- });
-
- it('should handle complex workflow with multiple levels', () => {
- const steps: WorkflowAction[] = [
- {
- id: 'root',
- name: 'Root',
- type: 'CREATE_RECORD',
- valid: true,
- settings: {} as any,
- nextStepIds: ['level-1-a', 'level-1-b'],
- },
- {
- id: 'level-1-a',
- name: 'Level 1 A',
- type: 'UPDATE_RECORD',
- valid: true,
- settings: {} as any,
- nextStepIds: ['level-2'],
- },
- {
- id: 'level-1-b',
- name: 'Level 1 B',
- type: 'SEND_EMAIL',
- valid: true,
- settings: {} as any,
- nextStepIds: ['level-2'],
- },
- {
- id: 'level-2',
- name: 'Level 2',
- type: 'DELETE_RECORD',
- valid: true,
- settings: {} as any,
- },
- ];
-
- const result = getRootStepIds(steps);
-
- expect(result).toEqual(['root']);
- });
-});
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/__tests__/getTriggerHeaderType.test.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/__tests__/getTriggerHeaderType.test.ts
deleted file mode 100644
index aec6bee3fc6..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/__tests__/getTriggerHeaderType.test.ts
+++ /dev/null
@@ -1,251 +0,0 @@
-import { type WorkflowTrigger } from '@/workflow/types/Workflow';
-import { getTriggerHeaderType } from '@/workflow/workflow-trigger/utils/getTriggerHeaderType';
-
-describe('getTriggerHeaderType', () => {
- describe('DATABASE_EVENT triggers', () => {
- it('returns "Trigger · Record is created" for created event', () => {
- const trigger: WorkflowTrigger = {
- type: 'DATABASE_EVENT',
- name: 'Company Created',
- settings: {
- eventName: 'company.created',
- outputSchema: {},
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Record is created');
- });
-
- it('returns "Trigger · Record is updated" for updated event', () => {
- const trigger: WorkflowTrigger = {
- type: 'DATABASE_EVENT',
- name: 'Company Updated',
- settings: {
- eventName: 'company.updated',
- outputSchema: {},
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Record is updated');
- });
-
- it('returns "Trigger · Record is deleted" for deleted event', () => {
- const trigger: WorkflowTrigger = {
- type: 'DATABASE_EVENT',
- name: 'Company Deleted',
- settings: {
- eventName: 'company.deleted',
- outputSchema: {},
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Record is deleted');
- });
-
- it('works with different object types', () => {
- const trigger: WorkflowTrigger = {
- type: 'DATABASE_EVENT',
- name: 'Person Created',
- settings: {
- eventName: 'person.created',
- outputSchema: {},
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Record is created');
- });
- });
-
- describe('MANUAL triggers', () => {
- it('returns "Trigger · Manual" for manual trigger', () => {
- const trigger: WorkflowTrigger = {
- type: 'MANUAL',
- name: 'Manual Trigger',
- settings: {
- objectType: 'company',
- outputSchema: {},
- icon: 'IconHandMove',
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Manual');
- });
-
- it('returns "Trigger · Manual" for manual trigger without objectType', () => {
- const trigger: WorkflowTrigger = {
- type: 'MANUAL',
- name: 'Manual Trigger',
- settings: {
- outputSchema: {},
- icon: 'IconHandMove',
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Manual');
- });
- });
-
- describe('CRON triggers', () => {
- it('returns "Trigger" for cron trigger with DAYS schedule', () => {
- const trigger: WorkflowTrigger = {
- type: 'CRON',
- name: 'Scheduled Trigger',
- settings: {
- type: 'DAYS',
- schedule: {
- day: 1,
- hour: 9,
- minute: 0,
- },
- outputSchema: {},
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Cron');
- });
-
- it('returns "Trigger" for cron trigger with HOURS schedule', () => {
- const trigger: WorkflowTrigger = {
- type: 'CRON',
- name: 'Hourly Trigger',
- settings: {
- type: 'HOURS',
- schedule: {
- hour: 2,
- minute: 30,
- },
- outputSchema: {},
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Cron');
- });
-
- it('returns "Trigger" for cron trigger with MINUTES schedule', () => {
- const trigger: WorkflowTrigger = {
- type: 'CRON',
- name: 'Minutely Trigger',
- settings: {
- type: 'MINUTES',
- schedule: {
- minute: 15,
- },
- outputSchema: {},
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Cron');
- });
-
- it('returns "Trigger" for cron trigger with CUSTOM schedule', () => {
- const trigger: WorkflowTrigger = {
- type: 'CRON',
- name: 'Custom Trigger',
- settings: {
- type: 'CUSTOM',
- pattern: '0 9 * * 1',
- outputSchema: {},
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Cron');
- });
- });
-
- describe('WEBHOOK triggers', () => {
- it('returns "Trigger · Webhook" for webhook trigger with GET method', () => {
- const trigger: WorkflowTrigger = {
- type: 'WEBHOOK',
- name: 'Webhook Trigger',
- settings: {
- httpMethod: 'GET',
- authentication: null,
- outputSchema: {},
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Webhook');
- });
-
- it('returns "Trigger · Webhook" for webhook trigger with POST method', () => {
- const trigger: WorkflowTrigger = {
- type: 'WEBHOOK',
- name: 'Webhook Trigger',
- settings: {
- httpMethod: 'POST',
- expectedBody: {
- message: 'Workflow was started',
- },
- authentication: null,
- outputSchema: {
- message: {
- icon: 'IconVariable',
- isLeaf: true,
- label: 'message',
- type: 'string',
- value: 'Workflow was started',
- },
- },
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Webhook');
- });
-
- it('returns "Trigger · Webhook" for webhook trigger with API_KEY authentication', () => {
- const trigger: WorkflowTrigger = {
- type: 'WEBHOOK',
- name: 'Secure Webhook Trigger',
- settings: {
- httpMethod: 'GET',
- authentication: 'API_KEY',
- outputSchema: {},
- },
- };
-
- const result = getTriggerHeaderType(trigger);
-
- expect(result).toBe('Trigger · Webhook');
- });
- });
-
- describe('error cases', () => {
- it('throws error for unknown trigger type', () => {
- const trigger = {
- type: 'UNKNOWN_TYPE',
- name: 'Unknown Trigger',
- settings: {
- outputSchema: {},
- },
- } as unknown as WorkflowTrigger;
-
- expect(() => getTriggerHeaderType(trigger)).toThrow(
- 'Unknown trigger type',
- );
- });
- });
-});
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/cron-to-human/utils/validateCronField.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/cron-to-human/utils/validateCronField.ts
deleted file mode 100644
index dd8bceacfed..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/cron-to-human/utils/validateCronField.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-import { isDefined } from 'twenty-shared/utils';
-
-import { type CronFieldType } from '@/workflow/workflow-trigger/utils/cron-to-human/types/cronExpressionParts';
-
-type FieldRange = {
- min: number;
- max: number;
-};
-
-const FIELD_RANGES: Record<CronFieldType, FieldRange> = {
- seconds: { min: 0, max: 59 },
- minutes: { min: 0, max: 59 },
- hours: { min: 0, max: 23 },
- dayOfMonth: { min: 1, max: 31 },
- month: { min: 1, max: 12 },
- dayOfWeek: { min: 0, max: 7 }, // 0 and 7 both represent Sunday
- year: { min: 1970, max: 2099 },
-};
-
-export const validateCronField = (
- value: string,
- fieldType: CronFieldType,
-): boolean => {
- if (!isDefined(value) || value.trim() === '') {
- return false;
- }
-
- if (value === '*') {
- return true;
- }
-
- const range = FIELD_RANGES[fieldType];
- if (!isDefined(range)) {
- return false;
- }
-
- if (value.includes('/')) {
- const [rangePart, stepPart] = value.split('/');
- const step = parseInt(stepPart, 10);
-
- if (isNaN(step) || step <= 0) {
- return false;
- }
-
- if (rangePart === '*') {
- return true;
- }
-
- return validateCronField(rangePart, fieldType);
- }
-
- if (value.includes('-')) {
- const [startStr, endStr] = value.split('-');
- const start = parseInt(startStr, 10);
- const end = parseInt(endStr, 10);
-
- if (isNaN(start) || isNaN(end)) {
- return false;
- }
-
- return (
- start >= range.min &&
- start <= range.max &&
- end >= range.min &&
- end <= range.max &&
- start <= end
- );
- }
-
- if (value.includes(',')) {
- const values = value.split(',');
- return values.every((val) => validateCronField(val.trim(), fieldType));
- }
-
- const numValue = parseInt(value, 10);
- if (isNaN(numValue)) {
- return false;
- }
-
- if (fieldType === 'dayOfWeek' && (numValue === 0 || numValue === 7)) {
- return true;
- }
-
- return numValue >= range.min && numValue <= range.max;
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getRootStepIds.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getRootStepIds.ts
deleted file mode 100644
index 0daec14c26d..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getRootStepIds.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { type WorkflowAction } from '@/workflow/types/Workflow';
-
-export const getRootStepIds = (steps: WorkflowAction[]): string[] => {
- const childIds = new Set<string>();
-
- for (const step of steps) {
- step.nextStepIds?.forEach((id) => childIds.add(id));
- }
-
- return steps.filter((step) => !childIds.has(step.id)).map((step) => step.id);
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getTriggerHeaderType.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getTriggerHeaderType.ts
deleted file mode 100644
index ff4d53267cc..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getTriggerHeaderType.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { type WorkflowTrigger } from '@/workflow/types/Workflow';
-import { getTriggerDefaultLabel } from '@/workflow/workflow-trigger/utils/getTriggerDefaultLabel';
-import { assertUnreachable } from 'twenty-shared/utils';
-
-export const getTriggerHeaderType = (trigger: WorkflowTrigger) => {
- switch (trigger.type) {
- case 'CRON': {
- return 'Trigger · Cron';
- }
- case 'WEBHOOK': {
- return 'Trigger · Webhook';
- }
- case 'MANUAL': {
- return 'Trigger · Manual';
- }
- case 'DATABASE_EVENT': {
- const defaultLabel = getTriggerDefaultLabel(trigger);
-
- return `Trigger · ${defaultLabel}`;
- }
- default: {
- assertUnreachable(trigger, 'Unknown trigger type');
- }
- }
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/types/OpenStepOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/OpenStepOutputSchema.ts
deleted file mode 100644
index 1034fffcf82..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/types/OpenStepOutputSchema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { type BaseOutputSchemaV2 } from 'twenty-shared/workflow';
-
-export type OpenStepOutputSchema = BaseOutputSchemaV2;
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/types/RecordActionOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/RecordActionOutputSchema.ts
deleted file mode 100644
index dffb7d0832c..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/types/RecordActionOutputSchema.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { type RecordOutputSchemaV2 } from '@/workflow/workflow-variables/types/RecordOutputSchemaV2';
-
-export type RecordActionOutputSchema = RecordOutputSchemaV2;
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isCodeOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isCodeOutputSchema.ts
deleted file mode 100644
index cd9d053ab40..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isCodeOutputSchema.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {
- type WorkflowActionType,
- type WorkflowTriggerType,
-} from '@/workflow/types/Workflow';
-import { type CodeOutputSchema } from '@/workflow/workflow-variables/types/CodeOutputSchema';
-import { type OutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
-
-export const isCodeOutputSchema = (
- stepType: WorkflowActionType | WorkflowTriggerType,
- _schema: OutputSchemaV2,
-): _schema is CodeOutputSchema => {
- return stepType === 'CODE';
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isDatabaseEventTriggerOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isDatabaseEventTriggerOutputSchema.ts
deleted file mode 100644
index 5331ef7b2cd..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isDatabaseEventTriggerOutputSchema.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {
- type WorkflowActionType,
- type WorkflowTriggerType,
-} from '@/workflow/types/Workflow';
-import { type DatabaseEventTriggerOutputSchema } from '@/workflow/workflow-variables/types/DatabaseEventTriggerOutputSchema';
-import { type OutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
-
-export const isDatabaseEventTriggerOutputSchema = (
- stepType: WorkflowActionType | WorkflowTriggerType,
- _schema: OutputSchemaV2,
-): _schema is DatabaseEventTriggerOutputSchema => {
- return stepType === 'DATABASE_EVENT';
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isFindRecordsOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isFindRecordsOutputSchema.ts
deleted file mode 100644
index d08263860a4..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isFindRecordsOutputSchema.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {
- type WorkflowActionType,
- type WorkflowTriggerType,
-} from '@/workflow/types/Workflow';
-import { type FindRecordsOutputSchema } from '@/workflow/workflow-variables/types/FindRecordsOutputSchema';
-import { type OutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
-
-export const isFindRecordsOutputSchema = (
- stepType: WorkflowActionType | WorkflowTriggerType,
- _schema: OutputSchemaV2,
-): _schema is FindRecordsOutputSchema => {
- return stepType === 'FIND_RECORDS';
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isFormOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isFormOutputSchema.ts
deleted file mode 100644
index 171cfc2ffbc..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isFormOutputSchema.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {
- type WorkflowActionType,
- type WorkflowTriggerType,
-} from '@/workflow/types/Workflow';
-import { type FormOutputSchema } from '@/workflow/workflow-variables/types/FormOutputSchema';
-import { type OutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
-
-export const isFormOutputSchema = (
- stepType: WorkflowActionType | WorkflowTriggerType,
- _schema: OutputSchemaV2,
-): _schema is FormOutputSchema => {
- return stepType === 'FORM';
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isManualTriggerOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isManualTriggerOutputSchema.ts
deleted file mode 100644
index 3be0022aa64..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isManualTriggerOutputSchema.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {
- type WorkflowActionType,
- type WorkflowTriggerType,
-} from '@/workflow/types/Workflow';
-import { type OutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
-import { type ManualTriggerOutputSchema } from 'twenty-shared/workflow';
-
-export const isManualTriggerOutputSchema = (
- stepType: WorkflowActionType | WorkflowTriggerType,
- _schema: OutputSchemaV2,
-): _schema is ManualTriggerOutputSchema => {
- return stepType === 'MANUAL';
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isOpenStepOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isOpenStepOutputSchema.ts
deleted file mode 100644
index f30332449e7..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isOpenStepOutputSchema.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import {
- type WorkflowActionType,
- type WorkflowTriggerType,
-} from '@/workflow/types/Workflow';
-import { type OpenStepOutputSchema } from '@/workflow/workflow-variables/types/OpenStepOutputSchema';
-import { type OutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
-
-import { isCodeOutputSchema } from './isCodeOutputSchema';
-import { isDatabaseEventTriggerOutputSchema } from './isDatabaseEventTriggerOutputSchema';
-import { isFindRecordsOutputSchema } from './isFindRecordsOutputSchema';
-import { isFormOutputSchema } from './isFormOutputSchema';
-import { isRecordStepOutputSchema } from './isRecordStepOutputSchema';
-
-export const isOpenStepOutputSchema = (
- stepType: WorkflowActionType | WorkflowTriggerType,
- schema: OutputSchemaV2,
-): schema is OpenStepOutputSchema => {
- return (
- !isRecordStepOutputSchema(stepType, schema) &&
- !isDatabaseEventTriggerOutputSchema(stepType, schema) &&
- !isFindRecordsOutputSchema(stepType, schema) &&
- !isFormOutputSchema(stepType, schema) &&
- !isCodeOutputSchema(stepType, schema)
- );
-};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isRecordStepOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isRecordStepOutputSchema.ts
deleted file mode 100644
index d8a89740af7..00000000000
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/types/guards/isRecordStepOutputSchema.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import {
- type WorkflowActionType,
- type WorkflowTriggerType,
-} from '@/workflow/types/Workflow';
-import { type RecordActionOutputSchema } from '@/workflow/workflow-variables/types/RecordActionOutputSchema';
-import { type OutputSchemaV2 } from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
-
-const RECORD_STEP_TYPES = [
- 'CREATE_RECORD',
- 'UPDATE_RECORD',
- 'DELETE_RECORD',
- 'UPSERT_RECORD',
-];
-
-export const isRecordStepOutputSchema = (
- stepType: WorkflowActionType | WorkflowTriggerType,
- _schema: OutputSchemaV2,
-): _schema is RecordActionOutputSchema => {
- return RECORD_STEP_TYPES.includes(stepType);
-};
diff --git a/packages/twenty-front/src/modules/workspace/hooks/useFeatureFlagsMap.ts b/packages/twenty-front/src/modules/workspace/hooks/useFeatureFlagsMap.ts
deleted file mode 100644
index 7a11bb59fa4..00000000000
--- a/packages/twenty-front/src/modules/workspace/hooks/useFeatureFlagsMap.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { extractFeatureFlagMapFromWorkspace } from '@/workspace/utils/extractFeatureFlagMapFromWorkspace';
-import { type FeatureFlagKey } from '~/generated-metadata/graphql';
-
-export const useFeatureFlagsMap = (): Record<FeatureFlagKey, boolean> => {
- const currentWorkspace = useAtomStateValue(currentWorkspaceState);
-
- return extractFeatureFlagMapFromWorkspace(currentWorkspace);
-};
diff --git a/packages/twenty-front/src/modules/workspace/utils/extractFeatureFlagMapFromWorkspace.ts b/packages/twenty-front/src/modules/workspace/utils/extractFeatureFlagMapFromWorkspace.ts
deleted file mode 100644
index 78d33f786a9..00000000000
--- a/packages/twenty-front/src/modules/workspace/utils/extractFeatureFlagMapFromWorkspace.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { type CurrentWorkspace } from '@/auth/states/currentWorkspaceState';
-import { FeatureFlagKey } from '~/generated-metadata/graphql';
-import { buildRecordFromKeysWithSameValue } from '~/utils/array/buildRecordFromKeysWithSameValue';
-
-export const extractFeatureFlagMapFromWorkspace = (
- currentWorkspace: CurrentWorkspace | null,
-): Record<FeatureFlagKey, boolean> => {
- const currentWorkspaceFeatureFlags = currentWorkspace?.featureFlags;
-
- const initialFeatureFlags = buildRecordFromKeysWithSameValue(
- Object.values(FeatureFlagKey),
- false,
- );
-
- if (!currentWorkspaceFeatureFlags) {
- return initialFeatureFlags;
- }
-
- return currentWorkspaceFeatureFlags.reduce((acc, featureFlag) => {
- acc[featureFlag.key] = featureFlag.value;
- return acc;
- }, initialFeatureFlags);
-};
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiAgentTableRow.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiAgentTableRow.tsx
deleted file mode 100644
index b9d0791bfd4..00000000000
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiAgentTableRow.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import { styled } from '@linaria/react';
-import { type ReactNode, useContext } from 'react';
-
-import { SettingsItemTypeTag } from '@/settings/components/SettingsItemTypeTag';
-import { TableCell } from '@/ui/layout/table/components/TableCell';
-import { TableRow } from '@/ui/layout/table/components/TableRow';
-import { useIcons } from 'twenty-ui/icon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/surfaces';
-import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
-import { type Agent } from '~/generated-metadata/graphql';
-
-export type SettingsAiAgentTableRowProps = {
- action: ReactNode;
- agent: Agent;
- link?: string;
-};
-
-export const AI_AGENT_TABLE_ROW_GRID_TEMPLATE_COLUMNS = '1fr 120px 36px';
-
-const StyledIconContainer = styled.div`
- flex-shrink: 0;
- height: ${themeCssVariables.spacing[4]};
-`;
-
-export const SettingsAiAgentTableRow = ({
- action,
- agent,
- link,
-}: SettingsAiAgentTableRowProps) => {
- const { theme } = useContext(ThemeContext);
- const { getIcon } = useIcons();
- const Icon = getIcon(agent.icon || 'IconLego');
-
- return (
- <TableRow
- gridTemplateColumns={AI_AGENT_TABLE_ROW_GRID_TEMPLATE_COLUMNS}
- key={agent.id}
- to={link}
- >
- <TableCell
- color={themeCssVariables.font.color.primary}
- gap={themeCssVariables.spacing[2]}
- minWidth="0"
- overflow="hidden"
- >
- <StyledIconContainer>
- <Icon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />
- </StyledIconContainer>
- <OverflowingTextWithTooltip text={agent.label} />
- </TableCell>
- <TableCell>
- <SettingsItemTypeTag item={agent} />
- </TableCell>
- <TableCell
- align="right"
- padding={`0 ${themeCssVariables.spacing[2]} 0 0`}
- >
- {action}
- </TableCell>
- </TableRow>
- );
-};
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiAgentsTable.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiAgentsTable.tsx
deleted file mode 100644
index 4f7719721ef..00000000000
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiAgentsTable.tsx
+++ /dev/null
@@ -1,144 +0,0 @@
-import { styled } from '@linaria/react';
-import { useLingui } from '@lingui/react/macro';
-import { useContext, useState } from 'react';
-
-import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
-import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
-import { SortableTableHeader } from '@/ui/layout/table/components/SortableTableHeader';
-import { Table } from '@/ui/layout/table/components/Table';
-import { TableHeader } from '@/ui/layout/table/components/TableHeader';
-import { useSortedArray } from '@/ui/layout/table/hooks/useSortedArray';
-import { SettingsPath } from 'twenty-shared/types';
-import { getSettingsPath } from 'twenty-shared/utils';
-import { IconChevronRight, IconSettingsAutomation } from 'twenty-ui/icon';
-import { SearchInput } from 'twenty-ui/input';
-import { MenuItemToggle } from 'twenty-ui/navigation';
-import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
-import { SETTINGS_AI_AGENT_TABLE_METADATA } from '~/pages/settings/ai/constants/SettingsAiAgentTableMetadata';
-import { normalizeSearchText } from '~/utils/normalizeSearchText';
-
-import Skeleton from 'react-loading-skeleton';
-import { useQuery } from '@apollo/client/react';
-import { FindManyAgentsDocument } from '~/generated-metadata/graphql';
-import { TableRow } from '@/ui/layout/table/components/TableRow';
-import {
- AI_AGENT_TABLE_ROW_GRID_TEMPLATE_COLUMNS,
- SettingsAiAgentTableRow,
-} from './SettingsAiAgentTableRow';
-
-const StyledSearchContainer = styled.div`
- margin-bottom: ${themeCssVariables.spacing[2]};
-`;
-
-const StyledTableContainer = styled.div`
- margin-top: ${themeCssVariables.spacing[3]};
-`;
-
-const StyledTableHeaderRowContainer = styled.div`
- margin-bottom: ${themeCssVariables.spacing[2]};
-`;
-
-export const SettingsAiAgentsTable = () => {
- const { theme } = useContext(ThemeContext);
- const { data, loading } = useQuery(FindManyAgentsDocument);
-
- const { t } = useLingui();
- const [searchTerm, setSearchTerm] = useState('');
- const [showWorkflowAgents, setShowWorkflowAgents] = useState(false);
-
- const sortedAgents = useSortedArray(
- data?.findManyAgents || [],
- SETTINGS_AI_AGENT_TABLE_METADATA,
- );
-
- const filteredAgents = sortedAgents.filter((agent) => {
- const isWorkflowAgent = agent.name.includes('workflow-service-agent');
- const matchesType = !isWorkflowAgent || showWorkflowAgents;
-
- const searchNormalized = normalizeSearchText(searchTerm);
- const matchesSearch =
- normalizeSearchText(agent.name).includes(searchNormalized) ||
- normalizeSearchText(agent.label).includes(searchNormalized);
-
- return matchesType && matchesSearch;
- });
-
- return (
- <>
- <StyledSearchContainer>
- <SearchInput
- placeholder={t`Search an agent...`}
- value={searchTerm}
- onChange={setSearchTerm}
- filterDropdown={(filterButton) => (
- <Dropdown
- dropdownId="settings-ai-agents-filter-dropdown"
- dropdownPlacement="bottom-end"
- dropdownOffset={{ x: 0, y: 8 }}
- clickableComponent={filterButton}
- dropdownComponents={
- <DropdownContent>
- <DropdownMenuItemsContainer>
- <MenuItemToggle
- LeftIcon={IconSettingsAutomation}
- onToggleChange={() =>
- setShowWorkflowAgents(!showWorkflowAgents)
- }
- toggled={showWorkflowAgents}
- text={t`Workflow agents`}
- toggleSize="small"
- />
- </DropdownMenuItemsContainer>
- </DropdownContent>
- }
- />
- )}
- />
- </StyledSearchContainer>
-
- <StyledTableContainer>
- <Table>
- <StyledTableHeaderRowContainer>
- <TableRow
- gridTemplateColumns={AI_AGENT_TABLE_ROW_GRID_TEMPLATE_COLUMNS}
- >
- {SETTINGS_AI_AGENT_TABLE_METADATA.fields.map(
- (settingsAiAgentTableMetadataField) => (
- <SortableTableHeader
- key={settingsAiAgentTableMetadataField.fieldName}
- fieldName={settingsAiAgentTableMetadataField.fieldName}
- label={t(settingsAiAgentTableMetadataField.fieldLabel)}
- tableId={SETTINGS_AI_AGENT_TABLE_METADATA.tableId}
- align={settingsAiAgentTableMetadataField.align}
- initialSort={SETTINGS_AI_AGENT_TABLE_METADATA.initialSort}
- />
- ),
- )}
- <TableHeader />
- </TableRow>
- </StyledTableHeaderRowContainer>
- {loading &&
- Array.from({ length: 3 }).map((_, index) => (
- <Skeleton height={32} borderRadius={4} key={index} />
- ))}
- {filteredAgents.map((agent) => (
- <SettingsAiAgentTableRow
- key={agent.id}
- agent={agent}
- action={
- <IconChevronRight
- size={theme.icon.size.md}
- stroke={theme.icon.stroke.sm}
- />
- }
- link={getSettingsPath(SettingsPath.AiAgentDetail, {
- agentId: agent.id,
- })}
- />
- ))}
- </Table>
- </StyledTableContainer>
- </>
- );
-};
diff --git a/packages/twenty-front/src/pages/settings/ai/constants/SettingsAiAgentTableMetadata.ts b/packages/twenty-front/src/pages/settings/ai/constants/SettingsAiAgentTableMetadata.ts
deleted file mode 100644
index b76811a6f13..00000000000
--- a/packages/twenty-front/src/pages/settings/ai/constants/SettingsAiAgentTableMetadata.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { type TableMetadata } from '@/ui/layout/table/types/TableMetadata';
-import { msg } from '@lingui/core/macro';
-import { type Agent } from '~/generated-metadata/graphql';
-
-export const SETTINGS_AI_AGENT_TABLE_METADATA: TableMetadata<Agent> = {
- tableId: 'settingsAiAgent',
- fields: [
- {
- fieldLabel: msg`Name`,
- fieldName: 'name',
- fieldType: 'string',
- align: 'left',
- },
- {
- fieldLabel: msg`Type`,
- fieldName: 'isCustom',
- fieldType: 'string',
- align: 'left',
- },
- ],
- initialSort: {
- fieldName: 'name',
- direction: 'asc',
- },
-};
diff --git a/packages/twenty-front/src/pages/settings/ai/forms/components/SettingsAiAgentForm.tsx b/packages/twenty-front/src/pages/settings/ai/forms/components/SettingsAiAgentForm.tsx
deleted file mode 100644
index 0aee454a4cc..00000000000
--- a/packages/twenty-front/src/pages/settings/ai/forms/components/SettingsAiAgentForm.tsx
+++ /dev/null
@@ -1,145 +0,0 @@
-import { styled } from '@linaria/react';
-import { useLingui } from '@lingui/react/macro';
-
-import { SettingsAgentModelCapabilities } from '@/ai/components/SettingsAgentModelCapabilities';
-import { useAiModelOptions } from '@/ai/hooks/useAiModelOptions';
-import { IconPicker } from '@/ui/input/components/IconPicker';
-import { Select } from '@/ui/input/components/Select';
-import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
-import { TextArea } from '@/ui/input/components/TextArea';
-import { isDefined } from 'twenty-shared/utils';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-import { computeMetadataNameFromLabel } from '~/pages/settings/data-model/utils/computeMetadataNameFromLabel';
-import { type SettingsAiAgentFormValues } from '~/pages/settings/ai/hooks/useSettingsAgentFormState';
-
-const StyledFormContainer = styled.div`
- display: flex;
- flex-direction: column;
- gap: ${themeCssVariables.spacing[2]};
-`;
-
-const StyledIconNameRow = styled.div`
- align-items: flex-start;
- display: flex;
- gap: ${themeCssVariables.spacing[2]};
-`;
-
-const StyledNameContainer = styled.div`
- flex: 1;
-`;
-
-const StyledErrorMessage = styled.div`
- color: ${themeCssVariables.color.red};
- font-size: ${themeCssVariables.font.size.sm};
- margin-top: ${themeCssVariables.spacing[1]};
-`;
-
-type SettingsAiAgentFormProps = {
- formValues: SettingsAiAgentFormValues;
- onFieldChange: (
- field: keyof SettingsAiAgentFormValues,
- value: SettingsAiAgentFormValues[keyof SettingsAiAgentFormValues],
- ) => void;
- disabled: boolean;
-};
-
-export const SettingsAiAgentForm = ({
- formValues,
- onFieldChange,
- disabled,
-}: SettingsAiAgentFormProps) => {
- const { t } = useLingui();
-
- const { options: modelOptions } = useAiModelOptions();
-
- const noModelsAvailable = modelOptions.length === 0;
-
- const fillNameFromLabel = (label: string) => {
- isDefined(label) &&
- onFieldChange('name', computeMetadataNameFromLabel(label));
- };
-
- return (
- <StyledFormContainer>
- <StyledFormContainer>
- <StyledIconNameRow>
- <IconPicker
- selectedIconKey={formValues.icon || 'IconLego'}
- onChange={({ iconKey }) => {
- onFieldChange('icon', iconKey);
- }}
- disabled={disabled}
- />
-
- <StyledNameContainer>
- <SettingsTextInput
- instanceId="agent-label-input"
- placeholder={t`Enter agent name*`}
- value={formValues.label}
- onChange={(value) => {
- onFieldChange('label', value);
- fillNameFromLabel(value);
- }}
- fullWidth
- disabled={disabled}
- />
- </StyledNameContainer>
- </StyledIconNameRow>
- </StyledFormContainer>
-
- <StyledFormContainer>
- <TextArea
- textAreaId="agent-description-textarea"
- placeholder={t`Write a description for this agent`}
- minRows={3}
- value={formValues.description || ''}
- onChange={(value) => onFieldChange('description', value)}
- disabled={disabled}
- />
- </StyledFormContainer>
-
- <StyledFormContainer>
- {noModelsAvailable ? (
- <StyledErrorMessage>
- {t`No models available. Please configure AI models in your workspace settings.`}
- </StyledErrorMessage>
- ) : (
- <Select
- dropdownId="ai-model-select"
- label={t`AI Model`}
- value={formValues.modelId}
- onChange={(value) => onFieldChange('modelId', value)}
- options={modelOptions}
- disabled={noModelsAvailable || disabled}
- />
- )}
- </StyledFormContainer>
-
- {formValues.modelId && (
- <StyledFormContainer>
- <SettingsAgentModelCapabilities
- selectedModelId={formValues.modelId}
- modelConfiguration={formValues.modelConfiguration || {}}
- onConfigurationChange={(configuration) =>
- onFieldChange('modelConfiguration', configuration)
- }
- disabled={disabled}
- />
- </StyledFormContainer>
- )}
-
- <StyledFormContainer>
- <TextArea
- textAreaId="agent-prompt-textarea"
- label={t`System Prompt`}
- placeholder={t`Enter the system prompt that defines this agent's behavior and capabilities`}
- minRows={6}
- maxRows={15}
- value={formValues.prompt}
- onChange={(value) => onFieldChange('prompt', value)}
- disabled={disabled}
- />
- </StyledFormContainer>
- </StyledFormContainer>
- );
-};
diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationConnectScopePickerModal.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationConnectScopePickerModal.tsx
deleted file mode 100644
index 5203b12dd3e..00000000000
--- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationConnectScopePickerModal.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import { useLingui } from '@lingui/react/macro';
-import { useState } from 'react';
-
-import { SettingsRadioCardContainer } from '@/settings/components/SettingsRadioCardContainer';
-import { useModal } from '@/ui/layout/modal/hooks/useModal';
-import { H1Title, H1TitleFontColor } from 'twenty-ui/typography';
-import { SectionAlignment, SectionFontColor } from 'twenty-ui/layout';
-import {
- StyledAppModal,
- StyledAppModalButton,
- StyledAppModalSection,
- StyledAppModalTitle,
-} from '~/pages/settings/applications/components/SettingsAppModalLayout';
-
-type SettingsApplicationConnectScopePickerModalProps = {
- modalInstanceId: string;
- providerDisplayName: string;
- onConfirm: (scope: 'user' | 'workspace') => void;
-};
-
-export const SettingsApplicationConnectScopePickerModal = ({
- modalInstanceId,
- providerDisplayName,
- onConfirm,
-}: SettingsApplicationConnectScopePickerModalProps) => {
- const { t } = useLingui();
- const { closeModal } = useModal();
- const [scope, setScope] = useState<'user' | 'workspace'>('user');
-
- const options = [
- {
- value: 'user',
- title: t`Just for me`,
- description: t`Only you can use this credential.`,
- },
- {
- value: 'workspace',
- title: t`Workspace shared`,
- description: t`Anyone in this workspace can use this credential.`,
- },
- ];
-
- return (
- <StyledAppModal modalId={modalInstanceId} isClosable padding="large">
- <StyledAppModalTitle>
- <H1Title
- title={t`Connect ${providerDisplayName}`}
- fontColor={H1TitleFontColor.Primary}
- />
- </StyledAppModalTitle>
- <StyledAppModalSection
- alignment={SectionAlignment.Center}
- fontColor={SectionFontColor.Primary}
- >
- <SettingsRadioCardContainer
- value={scope}
- options={options}
- onChange={(value) => setScope(value as 'user' | 'workspace')}
- />
- </StyledAppModalSection>
- <StyledAppModalButton
- onClick={() => closeModal(modalInstanceId)}
- variant="secondary"
- title={t`Cancel`}
- fullWidth
- justify="center"
- />
- <StyledAppModalButton
- onClick={() => {
- closeModal(modalInstanceId);
- onConfirm(scope);
- }}
- variant="secondary"
- accent="blue"
- title={t`Continue`}
- fullWidth
- justify="center"
- />
- </StyledAppModal>
- );
-};
diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationVersionContainer.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationVersionContainer.tsx
deleted file mode 100644
index 4f9f2f74a69..00000000000
--- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationVersionContainer.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-import { styled } from '@linaria/react';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-import { SettingsTableCard } from '@/settings/components/SettingsTableCard';
-import { SettingsAdminVersionDisplay } from '@/settings/admin-panel/components/SettingsAdminVersionDisplay';
-import { useUpgradeApplication } from '@/marketplace/hooks/useUpgradeApplication';
-import { t } from '@lingui/core/macro';
-import { isDefined } from 'twenty-shared/utils';
-import { IconCircleDot, IconUpload, IconVersions } from 'twenty-ui/icon';
-import { Button } from 'twenty-ui/input';
-import { type Application } from '~/generated-metadata/graphql';
-import { isNewerSemver } from '~/pages/settings/applications/utils/isNewerSemver';
-import { isUpgradableApplicationSourceType } from '~/pages/settings/applications/utils/isUpgradableApplicationSourceType';
-
-const StyledContainer = styled.div`
- display: flex;
- flex-direction: column;
- gap: ${themeCssVariables.spacing[4]};
-`;
-
-export const SettingsApplicationVersionContainer = ({
- application,
- latestAvailableVersion,
- appRegistrationId,
-}: {
- application?: Omit<
- Application,
- 'objects' | 'universalIdentifier' | 'frontComponents'
- > & {
- objects: { id: string }[];
- };
- latestAvailableVersion?: string | null;
- appRegistrationId?: string | null;
-}) => {
- const loading = !isDefined(application);
- const currentVersion = application?.version;
-
- const sourceType = application?.applicationRegistration?.sourceType;
- const isUpgradableApp = isUpgradableApplicationSourceType(sourceType);
-
- const latestVersion = isUpgradableApp
- ? (latestAvailableVersion ?? currentVersion)
- : currentVersion;
-
- const hasUpdate =
- isUpgradableApp &&
- isDefined(latestAvailableVersion) &&
- isDefined(currentVersion) &&
- isNewerSemver(latestAvailableVersion, currentVersion);
-
- const { upgrade, isUpgrading } = useUpgradeApplication();
-
- const handleUpgrade = async () => {
- if (!isDefined(appRegistrationId) || !isDefined(latestAvailableVersion)) {
- return;
- }
-
- await upgrade({
- appRegistrationId,
- targetVersion: latestAvailableVersion,
- });
- };
-
- const versionItems = [
- {
- Icon: IconCircleDot,
- label: t`Current version`,
- value: (
- <SettingsAdminVersionDisplay
- version={currentVersion}
- loading={loading}
- noVersionMessage={t`Unknown`}
- />
- ),
- },
- ...(isUpgradableApp
- ? [
- {
- Icon: IconVersions,
- label: t`Latest version`,
- value: (
- <SettingsAdminVersionDisplay
- version={latestVersion}
- loading={loading}
- noVersionMessage={t`No latest version found`}
- />
- ),
- },
- ]
- : []),
- ];
-
- return (
- <StyledContainer>
- <SettingsTableCard
- rounded
- items={versionItems}
- gridAutoColumns="3fr 8fr"
- />
- {hasUpdate && isDefined(appRegistrationId) && (
- <Button
- Icon={IconUpload}
- title={
- isUpgrading
- ? t`Upgrading...`
- : t`Upgrade to ${latestAvailableVersion}`
- }
- variant="secondary"
- accent="blue"
- onClick={handleUpgrade}
- disabled={isUpgrading}
- />
- )}
- </StyledContainer>
- );
-};
diff --git a/packages/twenty-front/src/pages/settings/data-model/constants/MetadataNameValidPattern.ts b/packages/twenty-front/src/pages/settings/data-model/constants/MetadataNameValidPattern.ts
deleted file mode 100644
index ac00bbc803c..00000000000
--- a/packages/twenty-front/src/pages/settings/data-model/constants/MetadataNameValidPattern.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const METADATA_NAME_VALID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;
diff --git a/packages/twenty-front/src/pages/settings/data-model/constants/OptionValueValidPattern.ts b/packages/twenty-front/src/pages/settings/data-model/constants/OptionValueValidPattern.ts
deleted file mode 100644
index 3db373acc14..00000000000
--- a/packages/twenty-front/src/pages/settings/data-model/constants/OptionValueValidPattern.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const OPTION_VALUE_VALID_PATTERN = /^[A-Z_][A-Z0-9_]*$/;
diff --git a/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsWebhooks.stories.tsx b/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsWebhooks.stories.tsx
deleted file mode 100644
index 7341801d666..00000000000
--- a/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsWebhooks.stories.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { within } from 'storybook/test';
-import { SettingsWebhooks } from '~/pages/settings/developers/webhooks/components/SettingsWebhooks';
-
-import {
- PageDecorator,
- type PageDecoratorArgs,
-} from '~/testing/decorators/PageDecorator';
-import { graphqlMocks } from '~/testing/graphqlMocks';
-
-const meta: Meta<PageDecoratorArgs> = {
- title: 'Pages/Settings/Webhooks',
- component: SettingsWebhooks,
- decorators: [PageDecorator],
- args: { routePath: '/settings/webhooks' },
- parameters: {
- msw: graphqlMocks,
- },
-};
-
-export default meta;
-
-export type Story = StoryObj<typeof SettingsWebhooks>;
-
-export const Default: Story = {
- play: async ({ canvasElement }) => {
- const canvas = within(canvasElement);
-
- await canvas.findAllByText('Webhooks', undefined, {
- timeout: 3000,
- });
- },
-};
diff --git a/packages/twenty-front/src/pages/settings/developers/webhooks/components/SettingsWebhooks.tsx b/packages/twenty-front/src/pages/settings/developers/webhooks/components/SettingsWebhooks.tsx
deleted file mode 100644
index 6c7288a0e4d..00000000000
--- a/packages/twenty-front/src/pages/settings/developers/webhooks/components/SettingsWebhooks.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
-import { SettingsWebhooksTable } from '@/settings/developers/components/SettingsWebhooksTable';
-import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
-import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
-import { styled } from '@linaria/react';
-import { Trans, useLingui } from '@lingui/react/macro';
-import { SettingsPath } from 'twenty-shared/types';
-import { getSettingsPath } from 'twenty-shared/utils';
-import { IconPlus } from 'twenty-ui/icon';
-import { H2Title } from 'twenty-ui/typography';
-import { Button } from 'twenty-ui/input';
-import { Section } from 'twenty-ui/layout';
-import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme-constants';
-
-const StyledButtonContainer = styled.div`
- display: flex;
- justify-content: flex-end;
- padding-top: ${themeCssVariables.spacing[2]};
- @media (max-width: ${MOBILE_VIEWPORT}px) {
- padding-top: ${themeCssVariables.spacing[5]};
- }
-`;
-
-const StyledContainer = styled.div<{ isMobile: boolean }>`
- display: flex;
- flex-direction: column;
- gap: ${themeCssVariables.spacing[2]};
- overflow: hidden;
-`;
-
-export const SettingsWebhooks = () => {
- const isMobile = useIsMobile();
- const { t } = useLingui();
-
- return (
- <SettingsPageLayout
- title={t`Webhooks`}
- links={[
- {
- children: <Trans>Workspace</Trans>,
- href: getSettingsPath(SettingsPath.General),
- },
- { children: <Trans>Webhooks</Trans> },
- ]}
- >
- <SettingsPageContainer>
- <StyledContainer isMobile={isMobile}>
- <Section>
- <H2Title
- title={t`Webhooks`}
- description={t`Establish Webhook endpoints for notifications on asynchronous events.`}
- />
- <SettingsWebhooksTable />
- <StyledButtonContainer>
- <Button
- Icon={IconPlus}
- title={t`Create Webhook`}
- size="small"
- variant="secondary"
- to={getSettingsPath(SettingsPath.NewWebhook)}
- />
- </StyledButtonContainer>
- </Section>
- </StyledContainer>
- </SettingsPageContainer>
- </SettingsPageLayout>
- );
-};
diff --git a/packages/twenty-front/src/pages/settings/emailing-domains/validation-schemas/settingsEmailingDomainFormSchema.ts b/packages/twenty-front/src/pages/settings/emailing-domains/validation-schemas/settingsEmailingDomainFormSchema.ts
deleted file mode 100644
index 3ee6579979b..00000000000
--- a/packages/twenty-front/src/pages/settings/emailing-domains/validation-schemas/settingsEmailingDomainFormSchema.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { z } from 'zod';
-
-export const settingsEmailingDomainFormSchema = z.object({
- domain: z
- .string()
- .min(1, 'Domain is required')
- .regex(
- /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])\.[a-zA-Z]{2,}$/,
- 'Invalid domain format. Please enter a valid domain name.',
- )
- .max(256, 'Domain must be less than 256 characters.'),
-});
-
-export type SettingsEmailingDomainFormValues = z.infer<
- typeof settingsEmailingDomainFormSchema
->;
diff --git a/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsDateFormatSelect.tsx b/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsDateFormatSelect.tsx
deleted file mode 100644
index 4112701cba5..00000000000
--- a/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsDateFormatSelect.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import { formatInTimeZone } from 'date-fns-tz';
-
-import { DateFormat } from '@/localization/constants/DateFormat';
-import { detectDateFormat } from '@/localization/utils/detection/detectDateFormat';
-import { detectTimeZone } from '@/localization/utils/detection/detectTimeZone';
-import { Select } from '@/ui/input/components/Select';
-import { t } from '@lingui/core/macro';
-
-type DateTimeSettingsDateFormatSelectProps = {
- value: DateFormat;
- onChange: (nextValue: DateFormat) => void;
- timeZone: string;
-};
-
-export const DateTimeSettingsDateFormatSelect = ({
- onChange,
- timeZone,
- value,
-}: DateTimeSettingsDateFormatSelectProps) => {
- const systemTimeZone = detectTimeZone();
-
- const usedTimeZone = timeZone === 'system' ? systemTimeZone : timeZone;
-
- const systemDateFormat = DateFormat[detectDateFormat()];
-
- const systemDateFormatLabel = formatInTimeZone(
- Date.now(),
- usedTimeZone,
- systemDateFormat,
- );
-
- return (
- <Select
- dropdownId="datetime-settings-date-format"
- dropdownWidth={218}
- label={t`Date format`}
- fullWidth
- dropdownWidthAuto
- value={value}
- options={[
- {
- label: t`System settings - ${systemDateFormatLabel}`,
- value: DateFormat.SYSTEM,
- },
- {
- label: `${formatInTimeZone(
- Date.now(),
- usedTimeZone,
- DateFormat.MONTH_FIRST,
- )}`,
- value: DateFormat.MONTH_FIRST,
- },
- {
- label: `${formatInTimeZone(
- Date.now(),
- usedTimeZone,
- DateFormat.DAY_FIRST,
- )}`,
- value: DateFormat.DAY_FIRST,
- },
- {
- label: `${formatInTimeZone(
- Date.now(),
- usedTimeZone,
- DateFormat.YEAR_FIRST,
- )}`,
- value: DateFormat.YEAR_FIRST,
- },
- ]}
- onChange={onChange}
- />
- );
-};
diff --git a/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsTimeFormatSelect.tsx b/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsTimeFormatSelect.tsx
deleted file mode 100644
index 17bf395d806..00000000000
--- a/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsTimeFormatSelect.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-import { formatInTimeZone } from 'date-fns-tz';
-
-import { TimeFormat } from '@/localization/constants/TimeFormat';
-import { detectTimeFormat } from '@/localization/utils/detection/detectTimeFormat';
-import { detectTimeZone } from '@/localization/utils/detection/detectTimeZone';
-import { Select } from '@/ui/input/components/Select';
-import { useLingui } from '@lingui/react/macro';
-
-type DateTimeSettingsTimeFormatSelectProps = {
- value: TimeFormat;
- onChange: (nextValue: TimeFormat) => void;
- timeZone: string;
-};
-
-export const DateTimeSettingsTimeFormatSelect = ({
- onChange,
- timeZone,
- value,
-}: DateTimeSettingsTimeFormatSelectProps) => {
- const { t } = useLingui();
- const systemTimeZone = detectTimeZone();
-
- const usedTimeZone = timeZone === 'system' ? systemTimeZone : timeZone;
-
- const systemTimeFormat = TimeFormat[detectTimeFormat()];
-
- const systemTimeFormatLabel = formatInTimeZone(
- Date.now(),
- usedTimeZone,
- systemTimeFormat,
- );
-
- const hour24Label = formatInTimeZone(
- Date.now(),
- usedTimeZone,
- TimeFormat.HOUR_24,
- );
-
- const hour12Label = formatInTimeZone(
- Date.now(),
- usedTimeZone,
- TimeFormat.HOUR_12,
- );
-
- return (
- <Select
- dropdownId="datetime-settings-time-format"
- dropdownWidth={218}
- label={t`Time format`}
- dropdownWidthAuto
- fullWidth
- value={value}
- options={[
- {
- label: t`System Settings - ${systemTimeFormatLabel}`,
- value: TimeFormat.SYSTEM,
- },
- {
- label: t`24h (${hour24Label})`,
- value: TimeFormat.HOUR_24,
- },
- {
- label: t`12h (${hour12Label})`,
- value: TimeFormat.HOUR_12,
- },
- ]}
- onChange={onChange}
- />
- );
-};
diff --git a/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsTimeZoneSelect.tsx b/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsTimeZoneSelect.tsx
deleted file mode 100644
index beb1bc9cffe..00000000000
--- a/packages/twenty-front/src/pages/settings/profile/appearance/components/DateTimeSettingsTimeZoneSelect.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { detectTimeZone } from '@/localization/utils/detection/detectTimeZone';
-import { findAvailableTimeZoneOption } from '@/localization/utils/findAvailableTimeZoneOption';
-import { AVAILABLE_TIMEZONE_OPTIONS } from '@/settings/experience/constants/AvailableTimezoneOptions';
-import { Select } from '@/ui/input/components/Select';
-import { t } from '@lingui/core/macro';
-import { isDefined } from 'twenty-shared/utils';
-import { type SelectOption } from 'twenty-ui/input';
-
-type DateTimeSettingsTimeZoneSelectProps = {
- value?: string;
- onChange: (nextValue: string) => void;
-};
-
-export const DateTimeSettingsTimeZoneSelect = ({
- value = detectTimeZone(),
- onChange,
-}: DateTimeSettingsTimeZoneSelectProps) => {
- const systemTimeZone = detectTimeZone();
-
- const systemTimeZoneOption = findAvailableTimeZoneOption(systemTimeZone);
-
- return (
- <Select
- dropdownId="settings-accounts-calendar-time-zone"
- label={t`Time zone`}
- dropdownWidthAuto
- fullWidth
- value={value}
- options={[
- {
- label: isDefined(systemTimeZoneOption)
- ? t`System settings`.concat(` - ${systemTimeZoneOption.label}`)
- : t`System settings`,
- value: 'system',
- },
- ...(AVAILABLE_TIMEZONE_OPTIONS as SelectOption<string>[]),
- ]}
- onChange={onChange}
- withSearchInput
- />
- );
-};
diff --git a/packages/twenty-front/src/testing/decorators/FullScreenDecorator.tsx b/packages/twenty-front/src/testing/decorators/FullScreenDecorator.tsx
deleted file mode 100644
index 9eae4829f58..00000000000
--- a/packages/twenty-front/src/testing/decorators/FullScreenDecorator.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { FullScreenContainer } from '@/ui/layout/fullscreen/components/FullScreenContainer';
-import { styled } from '@linaria/react';
-import { type Decorator } from '@storybook/react-vite';
-import { action } from 'storybook/actions';
-const StyledT = styled.div`
- height: 100%;
- width: 100%;
-`;
-
-export const FullScreenDecorator: Decorator = (Story) => (
- <FullScreenContainer
- links={[
- {
- children: 'Layout',
- href: '/',
- },
- {
- children: 'FullScreen',
- href: '/',
- },
- ]}
- exitFullScreen={action('Full screen exit called.')}
- >
- <StyledT>
- <Story />
- </StyledT>
- </FullScreenContainer>
-);
diff --git a/packages/twenty-front/src/testing/decorators/HelmetProviderDecorator.tsx b/packages/twenty-front/src/testing/decorators/HelmetProviderDecorator.tsx
deleted file mode 100644
index 69937baffe8..00000000000
--- a/packages/twenty-front/src/testing/decorators/HelmetProviderDecorator.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { type Decorator } from '@storybook/react-vite';
-import { HelmetProvider } from '@dr.pogodin/react-helmet';
-
-export const HelmetProviderDecorator: Decorator = (Story) => {
- return (
- <HelmetProvider>
- <Story />
- </HelmetProvider>
- );
-};
diff --git a/packages/twenty-front/src/testing/hooks/useMockFieldContext.tsx b/packages/twenty-front/src/testing/hooks/useMockFieldContext.tsx
deleted file mode 100644
index 31f2709af22..00000000000
--- a/packages/twenty-front/src/testing/hooks/useMockFieldContext.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import { isDefined } from 'twenty-shared/utils';
-import { type ReactNode } from 'react';
-
-import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
-import { formatFieldMetadataItemAsColumnDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsColumnDefinition';
-import {
- FieldContext,
- type RecordUpdateHook,
-} from '@/object-record/record-field/ui/contexts/FieldContext';
-
-export const useMockFieldContext = ({
- clearable,
- fieldMetadataName,
- fieldPosition,
- isLabelIdentifier = false,
- objectNameSingular,
- objectRecordId,
-}: {
- clearable?: boolean;
- fieldMetadataName: string;
- fieldPosition: number;
- isLabelIdentifier?: boolean;
- objectNameSingular: string;
- objectRecordId: string;
-}) => {
- const { objectMetadataItem } = useObjectMetadataItem({
- objectNameSingular,
- });
-
- const fieldMetadataItem = objectMetadataItem?.fields.find(
- (field) => field.name === fieldMetadataName,
- );
-
- const useUpdateOneObjectMutation: RecordUpdateHook = () => {
- const updateEntity = () => {};
-
- return [updateEntity, { loading: false }];
- };
-
- const FieldContextProvider =
- isDefined(fieldMetadataItem) && isDefined(objectMetadataItem)
- ? ({ children }: { children: ReactNode }) => (
- <FieldContext.Provider
- key={objectRecordId + fieldMetadataItem.id}
- value={{
- recordId: objectRecordId,
- isLabelIdentifier,
- fieldDefinition: formatFieldMetadataItemAsColumnDefinition({
- field: fieldMetadataItem,
- position: fieldPosition,
- objectMetadataItem,
- }),
- useUpdateRecord: useUpdateOneObjectMutation,
- clearable,
- isRecordFieldReadOnly: false,
- }}
- >
- {children}
- </FieldContext.Provider>
- )
- : undefined;
-
- return {
- FieldContextProvider,
- };
-};
diff --git a/packages/twenty-front/src/testing/jest/JestRecordStoreSetter.tsx b/packages/twenty-front/src/testing/jest/JestRecordStoreSetter.tsx
deleted file mode 100644
index c90f9559904..00000000000
--- a/packages/twenty-front/src/testing/jest/JestRecordStoreSetter.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { type ReactNode, useEffect } from 'react';
-
-import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-
-export const JestRecordStoreSetter = ({
- children,
- records,
-}: {
- children: ReactNode;
- records: ObjectRecord[];
-}) => {
- const { upsertRecordsInStore } = useUpsertRecordsInStore();
-
- useEffect(() => {
- upsertRecordsInStore({ partialRecords: records });
- });
-
- return <>{children}</>;
-};
diff --git a/packages/twenty-front/src/testing/mock-data/generated/data/calendarEvents/mock-calendarEvents-data.ts b/packages/twenty-front/src/testing/mock-data/generated/data/calendarEvents/mock-calendarEvents-data.ts
deleted file mode 100644
index 22cb640a611..00000000000
--- a/packages/twenty-front/src/testing/mock-data/generated/data/calendarEvents/mock-calendarEvents-data.ts
+++ /dev/null
@@ -1,762 +0,0 @@
-/* oxlint-disable */
-// @ts-nocheck
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-
-// This file was automatically generated — do not edit manually.
-
-// prettier-ignore
-export const mockedCalendarEventRecords: ObjectRecord[] =
-[
- {
- "__typename": "CalendarEvent",
- "calendarChannelEventAssociations": {
- "__typename": "CalendarChannelEventAssociationConnection",
- "edges": [
- {
- "__typename": "CalendarChannelEventAssociationEdge",
- "node": {
- "__typename": "CalendarChannelEventAssociation",
- "id": "20202020-0001-4e7c-8001-123456789abc"
- }
- }
- ]
- },
- "calendarEventParticipants": {
- "__typename": "CalendarEventParticipantConnection",
- "edges": [
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0001-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0002-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0003-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0004-4e7c-8001-123456789def"
- }
- }
- ]
- },
- "conferenceLink": {
- "__typename": "Links",
- "primaryLinkUrl": "https://teams.com/j/7097393112",
- "primaryLinkLabel": "https://teams.com/j/7097393112",
- "secondaryLinks": []
- },
- "conferenceSolution": "Teams",
- "createdAt": "2026-02-27T01:17:29.464Z",
- "createdBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- },
- "deletedAt": null,
- "description": "FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED",
- "endsAt": "2025-10-23T12:00:00.000Z",
- "externalCreatedAt": "2025-10-23T07:10:38.067Z",
- "externalUpdatedAt": "2025-10-22T11:34:06.086Z",
- "iCalUid": "[email protected]",
- "id": "20202020-0001-4e7c-8001-123456789cde",
- "isCanceled": false,
- "isFullDay": false,
- "location": "Conference Room A",
- "position": 0,
- "startsAt": "2025-10-23T11:30:00.000Z",
- "title": "FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED",
- "updatedAt": "2026-02-27T01:17:29.464Z",
- "updatedBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- }
- },
- {
- "__typename": "CalendarEvent",
- "calendarChannelEventAssociations": {
- "__typename": "CalendarChannelEventAssociationConnection",
- "edges": [
- {
- "__typename": "CalendarChannelEventAssociationEdge",
- "node": {
- "__typename": "CalendarChannelEventAssociation",
- "id": "20202020-0002-4e7c-8001-123456789abc"
- }
- }
- ]
- },
- "calendarEventParticipants": {
- "__typename": "CalendarEventParticipantConnection",
- "edges": [
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0005-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0006-4e7c-8001-123456789def"
- }
- }
- ]
- },
- "conferenceLink": {
- "__typename": "Links",
- "primaryLinkUrl": "https://zoom.com/j/8113375940",
- "primaryLinkLabel": "https://zoom.com/j/8113375940",
- "secondaryLinks": []
- },
- "conferenceSolution": "Zoom",
- "createdAt": "2026-02-27T01:17:29.464Z",
- "createdBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- },
- "deletedAt": null,
- "description": "FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED",
- "endsAt": "2025-12-06T09:45:00.000Z",
- "externalCreatedAt": "2025-12-02T22:30:49.748Z",
- "externalUpdatedAt": "2025-12-05T15:44:06.870Z",
- "iCalUid": "[email protected]",
- "id": "20202020-0002-4e7c-8001-123456789cde",
- "isCanceled": false,
- "isFullDay": false,
- "location": "Zoom",
- "position": 0,
- "startsAt": "2025-12-06T08:45:00.000Z",
- "title": "FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED",
- "updatedAt": "2026-02-27T01:17:29.464Z",
- "updatedBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- }
- },
- {
- "__typename": "CalendarEvent",
- "calendarChannelEventAssociations": {
- "__typename": "CalendarChannelEventAssociationConnection",
- "edges": [
- {
- "__typename": "CalendarChannelEventAssociationEdge",
- "node": {
- "__typename": "CalendarChannelEventAssociation",
- "id": "20202020-0003-4e7c-8001-123456789abc"
- }
- }
- ]
- },
- "calendarEventParticipants": {
- "__typename": "CalendarEventParticipantConnection",
- "edges": [
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0007-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0008-4e7c-8001-123456789def"
- }
- }
- ]
- },
- "conferenceLink": {
- "__typename": "Links",
- "primaryLinkUrl": "https://googlemeet.com/j/2800305522",
- "primaryLinkLabel": "https://googlemeet.com/j/2800305522",
- "secondaryLinks": []
- },
- "conferenceSolution": "Google Meet",
- "createdAt": "2026-02-27T01:17:29.464Z",
- "createdBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- },
- "deletedAt": null,
- "description": "Strategic planning session for upcoming project milestones and deliverables.",
- "endsAt": "2026-03-23T18:00:00.000Z",
- "externalCreatedAt": "2026-03-17T21:03:04.293Z",
- "externalUpdatedAt": "2026-03-23T13:11:32.796Z",
- "iCalUid": "[email protected]",
- "id": "20202020-0003-4e7c-8001-123456789cde",
- "isCanceled": false,
- "isFullDay": false,
- "location": "Boardroom",
- "position": 0,
- "startsAt": "2026-03-23T16:30:00.000Z",
- "title": "Project Planning Session",
- "updatedAt": "2026-02-27T01:17:29.464Z",
- "updatedBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- }
- },
- {
- "__typename": "CalendarEvent",
- "calendarChannelEventAssociations": {
- "__typename": "CalendarChannelEventAssociationConnection",
- "edges": [
- {
- "__typename": "CalendarChannelEventAssociationEdge",
- "node": {
- "__typename": "CalendarChannelEventAssociation",
- "id": "20202020-0004-4e7c-8001-123456789abc"
- }
- }
- ]
- },
- "calendarEventParticipants": {
- "__typename": "CalendarEventParticipantConnection",
- "edges": [
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0009-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-000a-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-000b-4e7c-8001-123456789def"
- }
- }
- ]
- },
- "conferenceLink": {
- "__typename": "Links",
- "primaryLinkUrl": "https://googlemeet.com/j/5896936049",
- "primaryLinkLabel": "https://googlemeet.com/j/5896936049",
- "secondaryLinks": []
- },
- "conferenceSolution": "Google Meet",
- "createdAt": "2026-02-27T01:17:29.464Z",
- "createdBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- },
- "deletedAt": null,
- "description": "Regular one-on-one check-in to discuss performance and career development.",
- "endsAt": "2026-07-18T15:45:00.000Z",
- "externalCreatedAt": "2026-07-12T01:15:12.967Z",
- "externalUpdatedAt": "2026-07-17T19:37:32.025Z",
- "iCalUid": "[email protected]",
- "id": "20202020-0004-4e7c-8001-123456789cde",
- "isCanceled": false,
- "isFullDay": false,
- "location": "Zoom",
- "position": 0,
- "startsAt": "2026-07-18T15:00:00.000Z",
- "title": "One-on-One Meeting",
- "updatedAt": "2026-02-27T01:17:29.464Z",
- "updatedBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- }
- },
- {
- "__typename": "CalendarEvent",
- "calendarChannelEventAssociations": {
- "__typename": "CalendarChannelEventAssociationConnection",
- "edges": [
- {
- "__typename": "CalendarChannelEventAssociationEdge",
- "node": {
- "__typename": "CalendarChannelEventAssociation",
- "id": "20202020-0005-4e7c-8001-123456789abc"
- }
- }
- ]
- },
- "calendarEventParticipants": {
- "__typename": "CalendarEventParticipantConnection",
- "edges": [
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-000c-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-000d-4e7c-8001-123456789def"
- }
- }
- ]
- },
- "conferenceLink": {
- "__typename": "Links",
- "primaryLinkUrl": "https://googlemeet.com/j/3812632404",
- "primaryLinkLabel": "https://googlemeet.com/j/3812632404",
- "secondaryLinks": []
- },
- "conferenceSolution": "Google Meet",
- "createdAt": "2026-02-27T01:17:29.464Z",
- "createdBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- },
- "deletedAt": null,
- "description": "Collaborative code review and technical discussion.",
- "endsAt": "2026-07-10T13:00:00.000Z",
- "externalCreatedAt": "2026-07-10T04:28:54.960Z",
- "externalUpdatedAt": "2026-07-10T05:22:07.621Z",
- "iCalUid": "[email protected]",
- "id": "20202020-0005-4e7c-8001-123456789cde",
- "isCanceled": false,
- "isFullDay": false,
- "location": "Teams",
- "position": 0,
- "startsAt": "2026-07-10T12:00:00.000Z",
- "title": "Code Review Session",
- "updatedAt": "2026-02-27T01:17:29.464Z",
- "updatedBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- }
- },
- {
- "__typename": "CalendarEvent",
- "calendarChannelEventAssociations": {
- "__typename": "CalendarChannelEventAssociationConnection",
- "edges": [
- {
- "__typename": "CalendarChannelEventAssociationEdge",
- "node": {
- "__typename": "CalendarChannelEventAssociation",
- "id": "20202020-0006-4e7c-8001-123456789abc"
- }
- }
- ]
- },
- "calendarEventParticipants": {
- "__typename": "CalendarEventParticipantConnection",
- "edges": [
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-000e-4e7c-8001-123456789def"
- }
- }
- ]
- },
- "conferenceLink": {
- "__typename": "Links",
- "primaryLinkUrl": "https://googlemeet.com/j/8745159251",
- "primaryLinkLabel": "https://googlemeet.com/j/8745159251",
- "secondaryLinks": []
- },
- "conferenceSolution": "Google Meet",
- "createdAt": "2026-02-27T01:17:29.464Z",
- "createdBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- },
- "deletedAt": null,
- "description": "Quarterly strategic planning and goal setting workshop.",
- "endsAt": "2026-06-19T22:00:00.000Z",
- "externalCreatedAt": "2026-06-17T17:57:29.360Z",
- "externalUpdatedAt": "2026-06-19T07:49:37.396Z",
- "iCalUid": "[email protected]",
- "id": "20202020-0006-4e7c-8001-123456789cde",
- "isCanceled": false,
- "isFullDay": true,
- "location": "Conference Center",
- "position": 0,
- "startsAt": "2026-06-19T11:00:00.000Z",
- "title": "Strategic Planning Workshop",
- "updatedAt": "2026-02-27T01:17:29.464Z",
- "updatedBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- }
- },
- {
- "__typename": "CalendarEvent",
- "calendarChannelEventAssociations": {
- "__typename": "CalendarChannelEventAssociationConnection",
- "edges": [
- {
- "__typename": "CalendarChannelEventAssociationEdge",
- "node": {
- "__typename": "CalendarChannelEventAssociation",
- "id": "20202020-0007-4e7c-8001-123456789abc"
- }
- }
- ]
- },
- "calendarEventParticipants": {
- "__typename": "CalendarEventParticipantConnection",
- "edges": [
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-000f-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0010-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0011-4e7c-8001-123456789def"
- }
- }
- ]
- },
- "conferenceLink": {
- "__typename": "Links",
- "primaryLinkUrl": "https://teams.com/j/2210986422",
- "primaryLinkLabel": "https://teams.com/j/2210986422",
- "secondaryLinks": []
- },
- "conferenceSolution": "Teams",
- "createdAt": "2026-02-27T01:17:29.464Z",
- "createdBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- },
- "deletedAt": null,
- "description": "Professional development and skills training session.",
- "endsAt": "2026-04-30T10:00:00.000Z",
- "externalCreatedAt": "2026-04-27T16:37:41.128Z",
- "externalUpdatedAt": "2026-04-29T18:18:07.528Z",
- "iCalUid": "[email protected]",
- "id": "20202020-0007-4e7c-8001-123456789cde",
- "isCanceled": false,
- "isFullDay": false,
- "location": "Teams",
- "position": 0,
- "startsAt": "2026-04-30T08:00:00.000Z",
- "title": "Training Session",
- "updatedAt": "2026-02-27T01:17:29.464Z",
- "updatedBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- }
- },
- {
- "__typename": "CalendarEvent",
- "calendarChannelEventAssociations": {
- "__typename": "CalendarChannelEventAssociationConnection",
- "edges": [
- {
- "__typename": "CalendarChannelEventAssociationEdge",
- "node": {
- "__typename": "CalendarChannelEventAssociation",
- "id": "20202020-0008-4e7c-8001-123456789abc"
- }
- }
- ]
- },
- "calendarEventParticipants": {
- "__typename": "CalendarEventParticipantConnection",
- "edges": [
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0012-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0013-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0014-4e7c-8001-123456789def"
- }
- }
- ]
- },
- "conferenceLink": {
- "__typename": "Links",
- "primaryLinkUrl": "https://googlemeet.com/j/2260515052",
- "primaryLinkLabel": "https://googlemeet.com/j/2260515052",
- "secondaryLinks": []
- },
- "conferenceSolution": "Google Meet",
- "createdAt": "2026-02-27T01:17:29.464Z",
- "createdBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- },
- "deletedAt": null,
- "description": "Customer interview to gather feedback and understand needs.",
- "endsAt": "2026-04-01T11:00:00.000Z",
- "externalCreatedAt": "2026-03-28T21:09:24.516Z",
- "externalUpdatedAt": "2026-03-31T14:40:32.244Z",
- "iCalUid": "[email protected]",
- "id": "20202020-0008-4e7c-8001-123456789cde",
- "isCanceled": false,
- "isFullDay": false,
- "location": "Teams",
- "position": 0,
- "startsAt": "2026-04-01T10:15:00.000Z",
- "title": "Customer Discovery Call",
- "updatedAt": "2026-02-27T01:17:29.464Z",
- "updatedBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- }
- },
- {
- "__typename": "CalendarEvent",
- "calendarChannelEventAssociations": {
- "__typename": "CalendarChannelEventAssociationConnection",
- "edges": [
- {
- "__typename": "CalendarChannelEventAssociationEdge",
- "node": {
- "__typename": "CalendarChannelEventAssociation",
- "id": "20202020-0009-4e7c-8001-123456789abc"
- }
- }
- ]
- },
- "calendarEventParticipants": {
- "__typename": "CalendarEventParticipantConnection",
- "edges": [
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0015-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0016-4e7c-8001-123456789def"
- }
- },
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0017-4e7c-8001-123456789def"
- }
- }
- ]
- },
- "conferenceLink": {
- "__typename": "Links",
- "primaryLinkUrl": "https://googlemeet.com/j/1181385220",
- "primaryLinkLabel": "https://googlemeet.com/j/1181385220",
- "secondaryLinks": []
- },
- "conferenceSolution": "Google Meet",
- "createdAt": "2026-02-27T01:17:29.464Z",
- "createdBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- },
- "deletedAt": null,
- "description": "Quarterly budget review and financial planning session.",
- "endsAt": "2026-06-09T12:45:00.000Z",
- "externalCreatedAt": "2026-06-08T23:06:40.889Z",
- "externalUpdatedAt": "2026-06-09T09:09:28.748Z",
- "iCalUid": "[email protected]",
- "id": "20202020-0009-4e7c-8001-123456789cde",
- "isCanceled": false,
- "isFullDay": false,
- "location": "Zoom",
- "position": 0,
- "startsAt": "2026-06-09T11:15:00.000Z",
- "title": "Budget Review Meeting",
- "updatedAt": "2026-02-27T01:17:29.464Z",
- "updatedBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- }
- },
- {
- "__typename": "CalendarEvent",
- "calendarChannelEventAssociations": {
- "__typename": "CalendarChannelEventAssociationConnection",
- "edges": [
- {
- "__typename": "CalendarChannelEventAssociationEdge",
- "node": {
- "__typename": "CalendarChannelEventAssociation",
- "id": "20202020-000a-4e7c-8001-123456789abc"
- }
- }
- ]
- },
- "calendarEventParticipants": {
- "__typename": "CalendarEventParticipantConnection",
- "edges": [
- {
- "__typename": "CalendarEventParticipantEdge",
- "node": {
- "__typename": "CalendarEventParticipant",
- "handle": "[email protected]",
- "id": "20202020-0018-4e7c-8001-123456789def"
- }
- }
- ]
- },
- "conferenceLink": {
- "__typename": "Links",
- "primaryLinkUrl": "https://googlemeet.com/j/4116289029",
- "primaryLinkLabel": "https://googlemeet.com/j/4116289029",
- "secondaryLinks": []
- },
- "conferenceSolution": "Google Meet",
- "createdAt": "2026-02-27T01:17:29.464Z",
- "createdBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- },
- "deletedAt": null,
- "description": "Product demonstration for potential customers and stakeholders.",
- "endsAt": "2026-03-12T09:30:00.000Z",
- "externalCreatedAt": "2026-03-05T20:44:15.718Z",
- "externalUpdatedAt": "2026-03-11T22:42:25.619Z",
- "iCalUid": "[email protected]",
- "id": "20202020-000a-4e7c-8001-123456789cde",
- "isCanceled": false,
- "isFullDay": false,
- "location": "Client Site",
- "position": 0,
- "startsAt": "2026-03-12T08:30:00.000Z",
- "title": "Product Demo",
- "updatedAt": "2026-02-27T01:17:29.464Z",
- "updatedBy": {
- "__typename": "Actor",
- "source": "MANUAL",
- "workspaceMemberId": null,
- "name": "System",
- "context": null
- }
- }
-];
diff --git a/packages/twenty-front/src/testing/profiling/states/currentProfilingRunState.ts b/packages/twenty-front/src/testing/profiling/states/currentProfilingRunState.ts
deleted file mode 100644
index ade4e1f2e8d..00000000000
--- a/packages/twenty-front/src/testing/profiling/states/currentProfilingRunState.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
-
-export const currentProfilingRunIndexState = createAtomState<number>({
- key: 'currentProfilingRunIndexState',
- defaultValue: 0,
-});
diff --git a/packages/twenty-front/src/testing/profiling/utils/computeProfilingReportByComponent.ts b/packages/twenty-front/src/testing/profiling/utils/computeProfilingReportByComponent.ts
deleted file mode 100644
index bd96d476ef0..00000000000
--- a/packages/twenty-front/src/testing/profiling/utils/computeProfilingReportByComponent.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { type ProfilingDataPoint } from '~/testing/profiling/types/ProfilingDataPoint';
-import { type ProfilingReportByComponent } from '~/testing/profiling/types/ProfilingReportByComponent';
-
-export const computeProfilingReportByComponent = (
- profilingReport: Record<string, ProfilingDataPoint[]>,
-) => {
- const reportByComponent = {} as ProfilingReportByComponent;
-
- const dataPoints = Object.entries(profilingReport)
- .map(([, dataPoints]) => dataPoints)
- .flat(1);
-
- for (const dataPoint of dataPoints) {
- reportByComponent[dataPoint.componentName] = {
- ...reportByComponent?.[dataPoint.componentName],
- sumById: {
- ...reportByComponent?.[dataPoint.componentName]?.sumById,
- [dataPoint.id]:
- (reportByComponent[dataPoint.componentName]?.sumById?.[
- dataPoint.id
- ] ?? 0) + dataPoint.durationInMs,
- },
- sum:
- (reportByComponent[dataPoint.componentName]?.sum ?? 0) +
- dataPoint.durationInMs,
- };
- }
-
- for (const componentName of Object.keys(reportByComponent)) {
- const ids = Object.keys(reportByComponent[componentName].sumById);
- const valuesUnsorted = Object.values(
- reportByComponent[componentName].sumById,
- );
-
- const valuesSortedAsc = [...valuesUnsorted].sort((a, b) => a - b);
-
- const numberOfIds = ids.length;
-
- reportByComponent[componentName].average =
- reportByComponent[componentName].sum / numberOfIds;
-
- reportByComponent[componentName].min = Math.min(
- ...Object.values(reportByComponent[componentName].sumById),
- );
-
- reportByComponent[componentName].max = Math.max(
- ...Object.values(reportByComponent[componentName].sumById),
- );
-
- const p50Index = Math.floor(numberOfIds * 0.5);
- const p80Index = Math.floor(numberOfIds * 0.8);
- const p90Index = Math.floor(numberOfIds * 0.9);
- const p95Index = Math.floor(numberOfIds * 0.95);
- const p99Index = Math.floor(numberOfIds * 0.99);
-
- reportByComponent[componentName].p50 = valuesSortedAsc[p50Index];
- reportByComponent[componentName].p80 = valuesSortedAsc[p80Index];
- reportByComponent[componentName].p90 = valuesSortedAsc[p90Index];
- reportByComponent[componentName].p95 = valuesSortedAsc[p95Index];
- reportByComponent[componentName].p99 = valuesSortedAsc[p99Index];
- }
-
- return reportByComponent;
-};
diff --git a/packages/twenty-front/src/types/ComponentParameters.ts b/packages/twenty-front/src/types/ComponentParameters.ts
deleted file mode 100644
index abc8ff98393..00000000000
--- a/packages/twenty-front/src/types/ComponentParameters.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { type JSX } from 'react';
-export type ComponentParameters<
- ComponentTypeToExtract extends (args: object) => JSX.Element,
-> = Parameters<ComponentTypeToExtract>[0];
diff --git a/packages/twenty-front/src/types/SparseArray.ts b/packages/twenty-front/src/types/SparseArray.ts
deleted file mode 100644
index d75bd0bc944..00000000000
--- a/packages/twenty-front/src/types/SparseArray.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type SparseArray<T> = Array<T | undefined>;
diff --git a/packages/twenty-front/src/types/StringKeyOf.ts b/packages/twenty-front/src/types/StringKeyOf.ts
deleted file mode 100644
index 244e5e1ede7..00000000000
--- a/packages/twenty-front/src/types/StringKeyOf.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type StringKeyOf<T> = Extract<keyof T, string>;
diff --git a/packages/twenty-front/src/types/WithNarrowedStringLiteralProperty.ts b/packages/twenty-front/src/types/WithNarrowedStringLiteralProperty.ts
deleted file mode 100644
index 7e0ff52b406..00000000000
--- a/packages/twenty-front/src/types/WithNarrowedStringLiteralProperty.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export type WithNarrowedStringLiteralProperty<
- T,
- K extends keyof T,
- Sub extends T[K],
-> = Omit<T, K> & {
- [P in K]: Extract<T[K], Sub>;
-};
diff --git a/packages/twenty-front/src/utils/__tests__/cast-as-positive-integer-or-null.test.ts b/packages/twenty-front/src/utils/__tests__/cast-as-positive-integer-or-null.test.ts
deleted file mode 100644
index b9a88647c11..00000000000
--- a/packages/twenty-front/src/utils/__tests__/cast-as-positive-integer-or-null.test.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-import {
- canBeCastAsPositiveIntegerOrNull,
- castAsPositiveIntegerOrNull,
-} from '~/utils/cast-as-positive-integer-or-null';
-
-describe('canBeCastAsPositiveIntegerOrNull', () => {
- it(`should return true if null`, () => {
- expect(canBeCastAsPositiveIntegerOrNull(null)).toBeTruthy();
- });
-
- it(`should return true if positive number`, () => {
- expect(canBeCastAsPositiveIntegerOrNull(9)).toBeTruthy();
- });
-
- it(`should return false if negative number`, () => {
- expect(canBeCastAsPositiveIntegerOrNull(-9)).toBeFalsy();
- });
-
- it(`should return true if zero`, () => {
- expect(canBeCastAsPositiveIntegerOrNull(0)).toBeTruthy();
- });
-
- it(`should return true if string 0`, () => {
- expect(canBeCastAsPositiveIntegerOrNull('0')).toBeTruthy();
- });
-
- it(`should return false if negative float`, () => {
- expect(canBeCastAsPositiveIntegerOrNull(-1.22)).toBeFalsy();
- });
-
- it(`should return false if positive float`, () => {
- expect(canBeCastAsPositiveIntegerOrNull(1.22)).toBeFalsy();
- });
-
- it(`should return false if positive float string`, () => {
- expect(canBeCastAsPositiveIntegerOrNull('0.9')).toBeFalsy();
- });
-
- it(`should return false if negative float string`, () => {
- expect(canBeCastAsPositiveIntegerOrNull('-0.9')).toBeFalsy();
- });
-
- it(`should return false if less than 1`, () => {
- expect(canBeCastAsPositiveIntegerOrNull(0.22)).toBeFalsy();
- });
-
- it(`should return true if empty string`, () => {
- expect(canBeCastAsPositiveIntegerOrNull('')).toBeTruthy();
- });
-
- it(`should return true if integer string`, () => {
- expect(canBeCastAsPositiveIntegerOrNull('9')).toBeTruthy();
- });
-
- it(`should return false if undefined`, () => {
- expect(canBeCastAsPositiveIntegerOrNull(undefined)).toBeFalsy();
- });
-
- it(`should return false if non numeric string`, () => {
- expect(canBeCastAsPositiveIntegerOrNull('9a')).toBeFalsy();
- });
-
- it(`should return false if non numeric string #2`, () => {
- expect(canBeCastAsPositiveIntegerOrNull('a9a')).toBeFalsy();
- });
-});
-
-describe('castAsPositiveIntegerOrNull', () => {
- it(`should cast null to null`, () => {
- expect(castAsPositiveIntegerOrNull(null)).toBe(null);
- });
-
- it(`should cast empty string to null`, () => {
- expect(castAsPositiveIntegerOrNull('')).toBe(null);
- });
-
- it(`should cast an integer to positive integer`, () => {
- expect(castAsPositiveIntegerOrNull(9)).toBe(9);
- });
-
- it(`should cast an integer string to positive integer`, () => {
- expect(castAsPositiveIntegerOrNull('9')).toBe(9);
- });
-
- it(`should cast an integer to zero integer`, () => {
- expect(castAsPositiveIntegerOrNull(0)).toBe(0);
- });
-
- it(`should cast an integer string to zero integer`, () => {
- expect(castAsPositiveIntegerOrNull('0')).toBe(0);
- });
-
- it(`should throw if trying to cast a positive float string to positive integer`, () => {
- expect(() => castAsPositiveIntegerOrNull('9.9')).toThrow(Error);
- });
-
- it(`should throw if trying to cast a negative float string to positive integer`, () => {
- expect(() => castAsPositiveIntegerOrNull('-9.9')).toThrow(Error);
- });
-
- it(`should throw if trying to cast a positive float to positive integer`, () => {
- expect(() => castAsPositiveIntegerOrNull(9.9)).toThrow(Error);
- });
-
- it(`should throw if trying to cast a negative float to positive integer`, () => {
- expect(() => castAsPositiveIntegerOrNull(-9.9)).toThrow(Error);
- });
-
- it(`should throw if trying to cast a non numeric string to positive integer`, () => {
- expect(() => castAsPositiveIntegerOrNull('9.9a')).toThrow(Error);
- });
-
- it(`should throw if trying to cast an undefined to positive integer`, () => {
- expect(() => castAsPositiveIntegerOrNull(undefined)).toThrow(Error);
- });
-});
diff --git a/packages/twenty-front/src/utils/__tests__/sortFieldMetadataItem.test.ts b/packages/twenty-front/src/utils/__tests__/sortFieldMetadataItem.test.ts
deleted file mode 100644
index e4eeb445a6e..00000000000
--- a/packages/twenty-front/src/utils/__tests__/sortFieldMetadataItem.test.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-
-import { sortFieldMetadataItem } from '~/utils/sortFieldMetadataItem';
-
-const WORKSPACE_CUSTOM_APPLICATION_ID = 'workspace-custom-application-id';
-const STANDARD_APPLICATION_ID = 'standard-application-id';
-
-const sortByCustomThenCreatedAt = (
- a: FieldMetadataItem,
- b: FieldMetadataItem,
-) => sortFieldMetadataItem(a, b, WORKSPACE_CUSTOM_APPLICATION_ID);
-
-describe('sortFieldMetadataItem', () => {
- it('should return an empty array for an empty array', () => {
- const items: FieldMetadataItem[] = [];
- const sortedItems = items.sort(sortByCustomThenCreatedAt);
- const expectedItems: FieldMetadataItem[] = [];
- expect(sortedItems).toEqual(expectedItems);
- });
-
- it('should return array with a single item for the same array', () => {
- const item1 = {
- applicationId: STANDARD_APPLICATION_ID,
- createdAt: '2024-01-03T11:41:16.344Z',
- } as FieldMetadataItem;
-
- const items: FieldMetadataItem[] = [item1];
- const sortedItems = items.sort(sortByCustomThenCreatedAt);
- const expectedItems: FieldMetadataItem[] = [item1];
- expect(sortedItems).toEqual(expectedItems);
- });
-
- it('should correctly sort items based on createdAt', () => {
- const item1 = {
- applicationId: STANDARD_APPLICATION_ID,
- createdAt: '2024-01-03T11:41:16.344Z',
- } as FieldMetadataItem;
-
- const item2 = {
- applicationId: STANDARD_APPLICATION_ID,
- createdAt: '2024-01-02T09:41:16.344Z',
- } as FieldMetadataItem;
-
- const item3 = {
- applicationId: STANDARD_APPLICATION_ID,
- createdAt: '2024-01-03T09:41:16.344Z',
- } as FieldMetadataItem;
-
- const items = [item1, item2, item3];
- const sortedItems = items.sort(sortByCustomThenCreatedAt);
- const expectedItems = [item2, item3, item1];
-
- expect(sortedItems).toEqual(expectedItems);
- });
-
- it('should correctly sort items based on isCustom and createdAt', () => {
- const item1 = {
- applicationId: STANDARD_APPLICATION_ID,
- createdAt: '2024-01-03T09:41:16.344Z',
- } as FieldMetadataItem;
-
- const item2 = {
- applicationId: WORKSPACE_CUSTOM_APPLICATION_ID,
- createdAt: '2024-01-02T09:41:16.344Z',
- } as FieldMetadataItem;
-
- const item3 = {
- applicationId: STANDARD_APPLICATION_ID,
- createdAt: '2024-01-01T09:41:16.344Z',
- } as FieldMetadataItem;
-
- const item4 = {
- applicationId: WORKSPACE_CUSTOM_APPLICATION_ID,
- createdAt: '2024-01-04T09:41:16.344Z',
- } as FieldMetadataItem;
-
- const items = [item1, item2, item3, item4];
- const sortedItems = items.sort(sortByCustomThenCreatedAt);
- const expectedItems = [item3, item1, item2, item4];
-
- expect(sortedItems).toEqual(expectedItems);
- });
-
- it('should handle arrays with items missing required properties', () => {
- const item1 = {
- applicationId: STANDARD_APPLICATION_ID,
- createdAt: '2024-01-03T11:41:16.344Z',
- } as FieldMetadataItem;
-
- const item2 = {
- applicationId: STANDARD_APPLICATION_ID,
- } as FieldMetadataItem;
-
- const item3 = {
- createdAt: '2024-01-05T11:41:16.344Z',
- } as FieldMetadataItem;
-
- const items = [item1, item2, item3];
- const sortedItems = items.sort(sortByCustomThenCreatedAt);
- expect(sortedItems).toHaveLength(items.length);
- });
-});
diff --git a/packages/twenty-front/src/utils/array/__tests__/getIndexNeighboursElementsFromArray.test.ts b/packages/twenty-front/src/utils/array/__tests__/getIndexNeighboursElementsFromArray.test.ts
deleted file mode 100644
index 35ba5e6a673..00000000000
--- a/packages/twenty-front/src/utils/array/__tests__/getIndexNeighboursElementsFromArray.test.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-import { type EachTestingContext } from 'twenty-shared/testing';
-import { getIndexNeighboursElementsFromArray } from '~/utils/array/getIndexNeighboursElementsFromArray';
-
-type TestCase = {
- expected: ReturnType<typeof getIndexNeighboursElementsFromArray>;
-} & Parameters<typeof getIndexNeighboursElementsFromArray>[0];
-
-describe('getIndexNeighboursElementsFromArray', () => {
- const testCases: EachTestingContext<TestCase>[] = [
- {
- title:
- 'should return undefined for before and first element for after when index is 0',
- context: {
- index: 0,
- array: [
- 'a1b2c3d4-e5f6-4a5b-8c7d-9e0f1a2b3c4d',
- 'b2c3d4e5-f6a7-5b6c-9d8e-0f1a2b3c4d5e',
- 'c3d4e5f6-a7b8-6c7d-0e9f-1a2b3c4d5e6f',
- ],
- expected: {
- before: undefined,
- after: 'a1b2c3d4-e5f6-4a5b-8c7d-9e0f1a2b3c4d',
- },
- },
- },
- {
- title:
- 'should return last element for before and undefined for after when index is at end',
- context: {
- index: 3,
- array: [
- 'a1b2c3d4-e5f6-4a5b-8c7d-9e0f1a2b3c4d',
- 'b2c3d4e5-f6a7-5b6c-9d8e-0f1a2b3c4d5e',
- 'c3d4e5f6-a7b8-6c7d-0e9f-1a2b3c4d5e6f',
- ],
- expected: {
- before: 'c3d4e5f6-a7b8-6c7d-0e9f-1a2b3c4d5e6f',
- after: undefined,
- },
- },
- },
- {
- title:
- 'should return last element for before and undefined for after when index is above the end',
- context: {
- index: 42,
- array: [
- 'a1b2c3d4-e5f6-4a5b-8c7d-9e0f1a2b3c4d',
- 'b2c3d4e5-f6a7-5b6c-9d8e-0f1a2b3c4d5e',
- 'c3d4e5f6-a7b8-6c7d-0e9f-1a2b3c4d5e6f',
- ],
- expected: {
- before: 'c3d4e5f6-a7b8-6c7d-0e9f-1a2b3c4d5e6f',
- after: undefined,
- },
- },
- },
- {
- title: 'should return correct before and after elements for middle index',
- context: {
- index: 1,
- array: [
- 'a1b2c3d4-e5f6-4a5b-8c7d-9e0f1a2b3c4d',
- 'b2c3d4e5-f6a7-5b6c-9d8e-0f1a2b3c4d5e',
- 'c3d4e5f6-a7b8-6c7d-0e9f-1a2b3c4d5e6f',
- ],
- expected: {
- before: 'a1b2c3d4-e5f6-4a5b-8c7d-9e0f1a2b3c4d',
- after: 'b2c3d4e5-f6a7-5b6c-9d8e-0f1a2b3c4d5e',
- },
- },
- },
- {
- title: 'should handle empty array array',
- context: {
- index: 0,
- array: [],
- expected: {
- before: undefined,
- after: undefined,
- },
- },
- },
- ];
-
- it.each(testCases)('$title', ({ context }) => {
- const result = getIndexNeighboursElementsFromArray({
- index: context.index,
- array: context.array,
- });
- expect(result).toEqual(context.expected);
- });
-});
diff --git a/packages/twenty-front/src/utils/array/getIndexNeighboursElementsFromArray.ts b/packages/twenty-front/src/utils/array/getIndexNeighboursElementsFromArray.ts
deleted file mode 100644
index 7422ebdee8f..00000000000
--- a/packages/twenty-front/src/utils/array/getIndexNeighboursElementsFromArray.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-type GetIndexNeighboursElementsFromArrayArgs = {
- index: number;
- array: string[];
-};
-type GetIndexNeighboursElementsFromArrayReturnType = {
- before?: string;
- after?: string;
-};
-export const getIndexNeighboursElementsFromArray = ({
- index,
- array,
-}: GetIndexNeighboursElementsFromArrayArgs): GetIndexNeighboursElementsFromArrayReturnType => {
- if (index === 0) {
- return {
- after: array.at(0),
- };
- }
-
- if (index >= array.length) {
- return {
- before: array.at(-1),
- };
- }
-
- return {
- before: array.at(index - 1),
- after: array.at(index),
- };
-};
diff --git a/packages/twenty-front/src/utils/cast-as-positive-integer-or-null.ts b/packages/twenty-front/src/utils/cast-as-positive-integer-or-null.ts
deleted file mode 100644
index fff306b4df7..00000000000
--- a/packages/twenty-front/src/utils/cast-as-positive-integer-or-null.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import { isInteger, isNull, isNumber, isString } from '@sniptt/guards';
-
-export const canBeCastAsPositiveIntegerOrNull = (
- probablePositiveNumberOrNull: string | undefined | number | null,
-): probablePositiveNumberOrNull is number | null => {
- if (probablePositiveNumberOrNull === undefined) {
- return false;
- }
-
- if (isNumber(probablePositiveNumberOrNull)) {
- return (
- Number.isInteger(probablePositiveNumberOrNull) &&
- Math.sign(probablePositiveNumberOrNull) !== -1
- );
- }
-
- if (isNull(probablePositiveNumberOrNull)) {
- return true;
- }
-
- if (probablePositiveNumberOrNull === '') {
- return true;
- }
-
- if (isString(probablePositiveNumberOrNull)) {
- const stringAsNumber = +probablePositiveNumberOrNull;
-
- if (isNaN(stringAsNumber)) {
- return false;
- }
-
- if (isInteger(stringAsNumber) && Math.sign(stringAsNumber) !== -1) {
- return true;
- }
- }
-
- return false;
-};
-
-export const castAsPositiveIntegerOrNull = (
- probablePositiveNumberOrNull: string | undefined | number | null,
-): number | null => {
- if (
- canBeCastAsPositiveIntegerOrNull(probablePositiveNumberOrNull) === false
- ) {
- throw new Error('Cannot cast to positive number or null');
- }
-
- if (probablePositiveNumberOrNull === null) {
- return null;
- }
-
- if (isString(probablePositiveNumberOrNull)) {
- if (probablePositiveNumberOrNull === '') {
- return null;
- }
- return +probablePositiveNumberOrNull;
- }
-
- if (isNumber(probablePositiveNumberOrNull)) {
- return probablePositiveNumberOrNull;
- }
-
- return null;
-};
diff --git a/packages/twenty-front/src/utils/format/number.ts b/packages/twenty-front/src/utils/format/number.ts
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/packages/twenty-front/src/utils/retryWithBackoff.ts b/packages/twenty-front/src/utils/retryWithBackoff.ts
deleted file mode 100644
index 236a0dc6708..00000000000
--- a/packages/twenty-front/src/utils/retryWithBackoff.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { sleep } from '~/utils/sleep';
-
-type ShouldRetryFn = (error: unknown) => boolean;
-
-export const retryWithBackoff = async <T>(
- fn: () => Promise<T>,
- {
- maxRetries = 3,
- baseDelayMs = 1000,
- shouldRetry,
- }: {
- maxRetries?: number;
- baseDelayMs?: number;
- shouldRetry: ShouldRetryFn;
- },
-): Promise<T> => {
- for (let attempt = 0; attempt <= maxRetries; attempt++) {
- try {
- return await fn();
- } catch (error) {
- const isLastAttempt = attempt === maxRetries;
-
- if (!shouldRetry(error) || isLastAttempt) {
- throw error;
- }
-
- await sleep(baseDelayMs * (attempt + 1));
- }
- }
-
- throw new Error('Unreachable');
-};
diff --git a/packages/twenty-front/src/utils/sortFieldMetadataItem.ts b/packages/twenty-front/src/utils/sortFieldMetadataItem.ts
deleted file mode 100644
index 0d1d721313b..00000000000
--- a/packages/twenty-front/src/utils/sortFieldMetadataItem.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-import { getIsMetadataItemCustom } from '@/object-metadata/utils/getIsMetadataItemCustom';
-
-import { parseDate } from '~/utils/date-utils';
-
-export const sortFieldMetadataItem = (
- a: FieldMetadataItem,
- b: FieldMetadataItem,
- workspaceCustomApplicationId?: string | null,
-) => {
- const aIsCustom = getIsMetadataItemCustom(a, workspaceCustomApplicationId);
- const bIsCustom = getIsMetadataItemCustom(b, workspaceCustomApplicationId);
-
- const customCompare = aIsCustom === bIsCustom ? 0 : aIsCustom ? 1 : -1;
- if (customCompare !== 0) return customCompare;
-
- const dateA = a.createdAt ? parseDate(a.createdAt) : null;
- const dateB = b.createdAt ? parseDate(b.createdAt) : null;
-
- if (!dateA && !dateB) return 0;
- if (!dateA) return 1;
- if (!dateB) return -1;
-
- return dateB.getTime() - dateA.getTime() > 0 ? -1 : 1;
-};