The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
🔧 Restore PRs #14348 and #14352 that were reverted by PR #14347 (#14359)
Félix Malfaitf7cde28dd61f
diff --git a/packages/twenty-front/src/hooks/__tests__/useNavigateApp.test.tsx b/packages/twenty-front/src/hooks/__tests__/useNavigateApp.test.tsxindex 3ef38ac7420..a3c904e5445 100644--- a/packages/twenty-front/src/hooks/__tests__/useNavigateApp.test.tsx+++ b/packages/twenty-front/src/hooks/__tests__/useNavigateApp.test.tsx@@ -2,7 +2,7 @@ import { renderHook } from '@testing-library/react';import { MemoryRouter, useNavigate } from 'react-router-dom';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';import { useNavigateApp } from '~/hooks/useNavigateApp';jest.mock('react-router-dom', () => ({diff --git a/packages/twenty-front/src/hooks/__tests__/useNavigateSettings.test.tsx b/packages/twenty-front/src/hooks/__tests__/useNavigateSettings.test.tsxindex 24b41e1fbcb..86efdab7398 100644--- a/packages/twenty-front/src/hooks/__tests__/useNavigateSettings.test.tsx+++ b/packages/twenty-front/src/hooks/__tests__/useNavigateSettings.test.tsx@@ -1,7 +1,7 @@import { renderHook } from '@testing-library/react';import { MemoryRouter, useNavigate } from 'react-router-dom';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';import { useNavigateSettings } from '~/hooks/useNavigateSettings';jest.mock('react-router-dom', () => ({diff --git a/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts b/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.tsindex a0f4a4ae937..afcf4796e38 100644--- a/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts+++ b/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts@@ -1,10 +1,11 @@import { useIsLogged } from '@/auth/hooks/useIsLogged';import { useDefaultHomePagePath } from '@/navigation/hooks/useDefaultHomePagePath';import { useOnboardingStatus } from '@/onboarding/hooks/useOnboardingStatus';-import { AppPath } from '@/types/AppPath';import { useIsWorkspaceActivationStatusEqualsTo } from '@/workspace/hooks/useIsWorkspaceActivationStatusEqualsTo';import { useParams } from 'react-router-dom';import { useRecoilValue } from 'recoil';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { OnboardingStatus } from '~/generated/graphql';@@ -85,7 +86,7 @@ const testCases: {verifyEmailRedirectPath?: string;}[] = [{ loc: AppPath.Verify, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.Verify, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.Verify, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.Verify, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: undefined },{ loc: AppPath.Verify, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.Verify, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -95,7 +96,7 @@ const testCases: {{ loc: AppPath.Verify, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.SignInUp, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.SignInUp, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.SignInUp, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.SignInUp, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: undefined },{ loc: AppPath.SignInUp, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.SignInUp, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -105,7 +106,7 @@ const testCases: {{ loc: AppPath.SignInUp, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.Invite, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: '/plan-required' },- { loc: AppPath.Invite, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.Invite, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.Invite, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: undefined },{ loc: AppPath.Invite, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: '/create/workspace' },{ loc: AppPath.Invite, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: '/create/profile' },@@ -115,7 +116,7 @@ const testCases: {{ loc: AppPath.Invite, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.ResetPassword, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: '/plan-required' },- { loc: AppPath.ResetPassword, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.ResetPassword, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.ResetPassword, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: undefined },{ loc: AppPath.ResetPassword, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: '/create/workspace' },{ loc: AppPath.ResetPassword, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: '/create/profile' },@@ -126,7 +127,7 @@ const testCases: {{ loc: AppPath.VerifyEmail, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },{ loc: AppPath.VerifyEmail, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, verifyEmailRedirectPath: '/nextPath?key=value', res: '/nextPath?key=value' },- { loc: AppPath.VerifyEmail, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.VerifyEmail, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.VerifyEmail, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, verifyEmailRedirectPath: '/nextPath?key=value', res: undefined },{ loc: AppPath.VerifyEmail, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: undefined },{ loc: AppPath.VerifyEmail, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },@@ -137,7 +138,7 @@ const testCases: {{ loc: AppPath.VerifyEmail, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.CreateWorkspace, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.CreateWorkspace, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.CreateWorkspace, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.CreateWorkspace, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.CreateWorkspace, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: undefined },{ loc: AppPath.CreateWorkspace, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -147,7 +148,7 @@ const testCases: {{ loc: AppPath.CreateWorkspace, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.CreateProfile, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.CreateProfile, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.CreateProfile, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.CreateProfile, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.CreateProfile, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.CreateProfile, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: undefined },@@ -157,7 +158,7 @@ const testCases: {{ loc: AppPath.CreateProfile, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.SyncEmails, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.SyncEmails, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.SyncEmails, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.SyncEmails, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.SyncEmails, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.SyncEmails, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -167,7 +168,7 @@ const testCases: {{ loc: AppPath.SyncEmails, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.InviteTeam, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.InviteTeam, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.InviteTeam, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.InviteTeam, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.InviteTeam, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.InviteTeam, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -177,7 +178,7 @@ const testCases: {{ loc: AppPath.InviteTeam, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.BookCallDecision, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: undefined },- { loc: AppPath.BookCallDecision, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.BookCallDecision, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.BookCallDecision, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.BookCallDecision, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: undefined },{ loc: AppPath.BookCallDecision, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -187,7 +188,7 @@ const testCases: {{ loc: AppPath.BookCallDecision, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.BookCall, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: undefined },- { loc: AppPath.BookCall, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.BookCall, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.BookCall, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.BookCall, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: undefined },{ loc: AppPath.BookCall, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -197,7 +198,7 @@ const testCases: {{ loc: AppPath.BookCall, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.PlanRequired, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: undefined },- { loc: AppPath.PlanRequired, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.PlanRequired, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.PlanRequired, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.PlanRequired, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.PlanRequired, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -207,7 +208,7 @@ const testCases: {{ loc: AppPath.PlanRequired, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.PlanRequiredSuccess, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: undefined },- { loc: AppPath.PlanRequiredSuccess, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.PlanRequiredSuccess, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.PlanRequiredSuccess, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.PlanRequiredSuccess, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.PlanRequiredSuccess, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -217,7 +218,7 @@ const testCases: {{ loc: AppPath.PlanRequiredSuccess, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.Index, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.Index, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.Index, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.Index, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.Index, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.Index, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -227,7 +228,7 @@ const testCases: {{ loc: AppPath.Index, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: defaultHomePagePath },{ loc: AppPath.TasksPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.TasksPage, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.TasksPage, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.TasksPage, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.TasksPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.TasksPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -237,7 +238,7 @@ const testCases: {{ loc: AppPath.TasksPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: undefined },{ loc: AppPath.OpportunitiesPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.OpportunitiesPage, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.OpportunitiesPage, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.OpportunitiesPage, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.OpportunitiesPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.OpportunitiesPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -247,7 +248,7 @@ const testCases: {{ loc: AppPath.OpportunitiesPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: undefined },{ loc: AppPath.RecordIndexPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.RecordIndexPage, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.RecordIndexPage, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.RecordIndexPage, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.RecordIndexPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.RecordIndexPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -259,7 +260,7 @@ const testCases: {{ loc: AppPath.RecordIndexPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: AppPath.NotFound, objectNamePluralFromParams: 'non-existing-object', objectNamePluralFromMetadata: 'existing-object' },{ loc: AppPath.RecordShowPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.RecordShowPage, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.RecordShowPage, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.RecordShowPage, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.RecordShowPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.RecordShowPage, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -279,7 +280,7 @@ const testCases: {{ loc: AppPath.SettingsCatchAll, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: undefined },{ loc: AppPath.DevelopersCatchAll, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.DevelopersCatchAll, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.DevelopersCatchAll, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.DevelopersCatchAll, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.DevelopersCatchAll, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.DevelopersCatchAll, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -289,7 +290,7 @@ const testCases: {{ loc: AppPath.DevelopersCatchAll, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: undefined },{ loc: AppPath.Authorize, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.Authorize, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.Authorize, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.Authorize, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.Authorize, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.Authorize, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -299,7 +300,7 @@ const testCases: {{ loc: AppPath.Authorize, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: undefined },{ loc: AppPath.NotFoundWildcard, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.NotFoundWildcard, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.NotFoundWildcard, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.NotFoundWildcard, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.NotFoundWildcard, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.NotFoundWildcard, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },@@ -309,7 +310,7 @@ const testCases: {{ loc: AppPath.NotFoundWildcard, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: undefined },{ loc: AppPath.NotFound, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },- { loc: AppPath.NotFound, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: '/settings/billing' },+ { loc: AppPath.NotFound, isLoggedIn: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },{ loc: AppPath.NotFound, isLoggedIn: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },{ loc: AppPath.NotFound, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.CreateWorkspace },{ loc: AppPath.NotFound, isLoggedIn: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },diff --git a/packages/twenty-front/src/hooks/useNavigateApp.ts b/packages/twenty-front/src/hooks/useNavigateApp.tsindex 5ef51ecbcba..7b1fb56880f 100644--- a/packages/twenty-front/src/hooks/useNavigateApp.ts+++ b/packages/twenty-front/src/hooks/useNavigateApp.ts@@ -1,6 +1,6 @@-import { type AppPath } from '@/types/AppPath';import { useNavigate } from 'react-router-dom';-import { getAppPath } from '~/utils/navigation/getAppPath';+import { type AppPath } from 'twenty-shared/types';+import { getAppPath } from 'twenty-shared/utils';export const useNavigateApp = () => {const navigate = useNavigate();diff --git a/packages/twenty-front/src/hooks/useNavigateSettings.ts b/packages/twenty-front/src/hooks/useNavigateSettings.tsindex f8e6c1186b7..3fdb987f2df 100644--- a/packages/twenty-front/src/hooks/useNavigateSettings.ts+++ b/packages/twenty-front/src/hooks/useNavigateSettings.ts@@ -1,6 +1,6 @@-import { type SettingsPath } from '@/types/SettingsPath';import { useNavigate } from 'react-router-dom';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { type SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';export const useNavigateSettings = () => {const navigate = useNavigate();diff --git a/packages/twenty-front/src/hooks/usePageChangeEffectNavigateLocation.ts b/packages/twenty-front/src/hooks/usePageChangeEffectNavigateLocation.tsindex d5c9a71bf72..c27c48935f6 100644--- a/packages/twenty-front/src/hooks/usePageChangeEffectNavigateLocation.ts+++ b/packages/twenty-front/src/hooks/usePageChangeEffectNavigateLocation.ts@@ -4,11 +4,10 @@ import { useIsCurrentLocationOnAWorkspace } from '@/domain-manager/hooks/useIsCuimport { useDefaultHomePagePath } from '@/navigation/hooks/useDefaultHomePagePath';import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';import { useOnboardingStatus } from '@/onboarding/hooks/useOnboardingStatus';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { useIsWorkspaceActivationStatusEqualsTo } from '@/workspace/hooks/useIsWorkspaceActivationStatusEqualsTo';import { useLocation, useParams } from 'react-router-dom';import { useRecoilValue } from 'recoil';+import { AppPath, SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { WorkspaceActivationStatus } from 'twenty-shared/workspace';import { OnboardingStatus } from '~/generated/graphql';diff --git a/packages/twenty-front/src/modules/action-menu/actions/components/ActionLink.tsx b/packages/twenty-front/src/modules/action-menu/actions/components/ActionLink.tsxindex 6f898891df3..a2c5c956c02 100644--- a/packages/twenty-front/src/modules/action-menu/actions/components/ActionLink.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/components/ActionLink.tsx@@ -1,8 +1,8 @@import { ActionDisplay } from '@/action-menu/actions/display/components/ActionDisplay';import { useCloseActionMenu } from '@/action-menu/hooks/useCloseActionMenu';-import { type AppPath } from '@/types/AppPath';import { type PathParam } from 'react-router-dom';-import { getAppPath } from '~/utils/navigation/getAppPath';+import { type AppPath } from 'twenty-shared/types';+import { getAppPath } from 'twenty-shared/utils';export const ActionLink = <T extends AppPath>({to,diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/DefaultRecordActionsConfig.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/DefaultRecordActionsConfig.tsxindex ec12f9e351c..31779f2fa59 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/DefaultRecordActionsConfig.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/DefaultRecordActionsConfig.tsx@@ -29,11 +29,10 @@ import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';import { BACKEND_BATCH_REQUEST_MAX_COUNT } from '@/object-record/constants/BackendBatchRequestMaxCount';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { msg } from '@lingui/core/macro';import { isNonEmptyString } from '@sniptt/guards';import { MUTATION_MAX_MERGE_RECORDS } from 'twenty-shared/constants';+import { AppPath, SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import {diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowActionsConfig.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowActionsConfig.tsxindex 4bf986dacad..79338014865 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowActionsConfig.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowActionsConfig.tsx@@ -16,13 +16,13 @@ import { ActionScope } from '@/action-menu/actions/types/ActionScope';import { ActionType } from '@/action-menu/actions/types/ActionType';import { ActionViewType } from '@/action-menu/actions/types/ActionViewType';import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';-import { AppPath } from '@/types/AppPath';import {type WorkflowStep,type WorkflowTrigger,type WorkflowWithCurrentVersion,} from '@/workflow/types/Workflow';import { msg } from '@lingui/core/macro';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import {IconHistoryToggle,diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowVersionsActionsConfig.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowVersionsActionsConfig.tsxindex b05d292f585..bdca663ad31 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowVersionsActionsConfig.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowVersionsActionsConfig.tsx@@ -13,8 +13,8 @@ import { ActionScope } from '@/action-menu/actions/types/ActionScope';import { ActionType } from '@/action-menu/actions/types/ActionType';import { ActionViewType } from '@/action-menu/actions/types/ActionViewType';import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';-import { AppPath } from '@/types/AppPath';import { msg } from '@lingui/core/macro';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import {IconHistoryToggle,diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/components/DestroySingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/components/DestroySingleRecordAction.tsxindex 30c26df561c..98889a048e3 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/components/DestroySingleRecordAction.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/components/DestroySingleRecordAction.tsx@@ -3,7 +3,7 @@ import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actionsimport { useDestroyOneRecord } from '@/object-record/hooks/useDestroyOneRecord';import { useRecordIndexIdFromCurrentContextStore } from '@/object-record/record-index/hooks/useRecordIndexIdFromCurrentContextStore';import { useResetTableRowSelection } from '@/object-record/record-table/hooks/internal/useResetTableRowSelection';-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';import { useNavigateApp } from '~/hooks/useNavigateApp';export const DestroySingleRecordAction = () => {diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeActiveVersionWorkflowSingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeActiveVersionWorkflowSingleRecordAction.tsxindex 9fd0032d821..f0a62dd69d4 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeActiveVersionWorkflowSingleRecordAction.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeActiveVersionWorkflowSingleRecordAction.tsx@@ -2,8 +2,8 @@ import { ActionLink } from '@/action-menu/actions/components/ActionLink';import { ActionDisplay } from '@/action-menu/actions/display/components/ActionDisplay';import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions/single-record/hooks/useSelectedRecordIdOrThrow';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';-import { AppPath } from '@/types/AppPath';import { useActiveWorkflowVersion } from '@/workflow/hooks/useActiveWorkflowVersion';+import { AppPath } from 'twenty-shared/types';export const SeeActiveVersionWorkflowSingleRecordAction = () => {const recordId = useSelectedRecordIdOrThrow();diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeRunsWorkflowSingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeRunsWorkflowSingleRecordAction.tsxindex 7c0df2635df..71e276cd9da 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeRunsWorkflowSingleRecordAction.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeRunsWorkflowSingleRecordAction.tsx@@ -1,9 +1,8 @@import { ActionLink } from '@/action-menu/actions/components/ActionLink';import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions/single-record/hooks/useSelectedRecordIdOrThrow';import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';-import { AppPath } from '@/types/AppPath';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';-import { ViewFilterOperand } from 'twenty-shared/types';+import { AppPath, ViewFilterOperand } from 'twenty-shared/types';export const SeeRunsWorkflowSingleRecordAction = () => {const recordId = useSelectedRecordIdOrThrow();diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeVersionsWorkflowSingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeVersionsWorkflowSingleRecordAction.tsxindex e0bbfcd540a..8ebb1e776a2 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeVersionsWorkflowSingleRecordAction.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-actions/components/SeeVersionsWorkflowSingleRecordAction.tsx@@ -1,9 +1,8 @@import { ActionLink } from '@/action-menu/actions/components/ActionLink';import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions/single-record/hooks/useSelectedRecordIdOrThrow';import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';-import { AppPath } from '@/types/AppPath';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';-import { ViewFilterOperand } from 'twenty-shared/types';+import { AppPath, ViewFilterOperand } from 'twenty-shared/types';export const SeeVersionsWorkflowSingleRecordAction = () => {const recordId = useSelectedRecordIdOrThrow();diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-run-actions/components/SeeVersionWorkflowRunSingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-run-actions/components/SeeVersionWorkflowRunSingleRecordAction.tsxindex 0dc5da7dc22..09798670452 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-run-actions/components/SeeVersionWorkflowRunSingleRecordAction.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-run-actions/components/SeeVersionWorkflowRunSingleRecordAction.tsx@@ -2,8 +2,8 @@ import { ActionLink } from '@/action-menu/actions/components/ActionLink';import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions/single-record/hooks/useSelectedRecordIdOrThrow';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';-import { AppPath } from '@/types/AppPath';import { useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';export const SeeVersionWorkflowRunSingleRecordAction = () => {diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-run-actions/components/SeeWorkflowWorkflowRunSingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-run-actions/components/SeeWorkflowWorkflowRunSingleRecordAction.tsxindex 7e0021280a8..91d951f7250 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-run-actions/components/SeeWorkflowWorkflowRunSingleRecordAction.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-run-actions/components/SeeWorkflowWorkflowRunSingleRecordAction.tsx@@ -2,8 +2,8 @@ import { ActionLink } from '@/action-menu/actions/components/ActionLink';import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions/single-record/hooks/useSelectedRecordIdOrThrow';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';-import { AppPath } from '@/types/AppPath';import { useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';export const SeeWorkflowWorkflowRunSingleRecordAction = () => {diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeRunsWorkflowVersionSingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeRunsWorkflowVersionSingleRecordAction.tsxindex 6b19cd48eb5..560d4861b1f 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeRunsWorkflowVersionSingleRecordAction.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeRunsWorkflowVersionSingleRecordAction.tsx@@ -2,10 +2,9 @@ import { ActionLink } from '@/action-menu/actions/components/ActionLink';import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions/single-record/hooks/useSelectedRecordIdOrThrow';import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';-import { AppPath } from '@/types/AppPath';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';import { useRecoilValue } from 'recoil';-import { ViewFilterOperand } from 'twenty-shared/types';+import { AppPath, ViewFilterOperand } from 'twenty-shared/types';export const SeeRunsWorkflowVersionSingleRecordAction = () => {const recordId = useSelectedRecordIdOrThrow();diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeVersionsWorkflowVersionSingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeVersionsWorkflowVersionSingleRecordAction.tsxindex d542a6781d6..cd29e7fb161 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeVersionsWorkflowVersionSingleRecordAction.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeVersionsWorkflowVersionSingleRecordAction.tsx@@ -2,10 +2,9 @@ import { ActionLink } from '@/action-menu/actions/components/ActionLink';import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions/single-record/hooks/useSelectedRecordIdOrThrow';import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';-import { AppPath } from '@/types/AppPath';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';import { useRecoilValue } from 'recoil';-import { ViewFilterOperand } from 'twenty-shared/types';+import { AppPath, ViewFilterOperand } from 'twenty-shared/types';export const SeeVersionsWorkflowVersionSingleRecordAction = () => {const recordId = useSelectedRecordIdOrThrow();diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeWorkflowWorkflowVersionSingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeWorkflowWorkflowVersionSingleRecordAction.tsxindex 09edcfdb08f..5c888ccc6ce 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeWorkflowWorkflowVersionSingleRecordAction.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/SeeWorkflowWorkflowVersionSingleRecordAction.tsx@@ -2,8 +2,8 @@ import { ActionLink } from '@/action-menu/actions/components/ActionLink';import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions/single-record/hooks/useSelectedRecordIdOrThrow';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';-import { AppPath } from '@/types/AppPath';import { useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';export const SeeWorkflowWorkflowVersionSingleRecordAction = () => {const recordId = useSelectedRecordIdOrThrow();diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/UseAsDraftWorkflowVersionSingleRecordAction.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/UseAsDraftWorkflowVersionSingleRecordAction.tsxindex d26d7f42dee..ba258c153e8 100644--- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/UseAsDraftWorkflowVersionSingleRecordAction.tsx+++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/single-record/workflow-version-actions/components/UseAsDraftWorkflowVersionSingleRecordAction.tsx@@ -1,7 +1,6 @@import { Action } from '@/action-menu/actions/components/Action';import { useSelectedRecordIdOrThrow } from '@/action-menu/actions/record-actions/single-record/hooks/useSelectedRecordIdOrThrow';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';-import { AppPath } from '@/types/AppPath';import { useModal } from '@/ui/layout/modal/hooks/useModal';import { OverrideWorkflowDraftConfirmationModal } from '@/workflow/components/OverrideWorkflowDraftConfirmationModal';import { OVERRIDE_WORKFLOW_DRAFT_CONFIRMATION_MODAL_ID } from '@/workflow/constants/OverrideWorkflowDraftConfirmationModalId';@@ -9,6 +8,7 @@ import { useCreateDraftFromWorkflowVersion } from '@/workflow/hooks/useCreateDraimport { useWorkflowVersion } from '@/workflow/hooks/useWorkflowVersion';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';import { useState } from 'react';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { useNavigateApp } from '~/hooks/useNavigateApp';diff --git a/packages/twenty-front/src/modules/action-menu/components/RecordShowRightDrawerOpenRecordButton.tsx b/packages/twenty-front/src/modules/action-menu/components/RecordShowRightDrawerOpenRecordButton.tsxindex 09891c565ac..ffc93ea89fe 100644--- a/packages/twenty-front/src/modules/action-menu/components/RecordShowRightDrawerOpenRecordButton.tsx+++ b/packages/twenty-front/src/modules/action-menu/components/RecordShowRightDrawerOpenRecordButton.tsx@@ -8,7 +8,6 @@ import { contextStoreRecordShowParentViewComponentState } from '@/context-store/import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';import { type ObjectRecord } from '@/object-record/types/ObjectRecord';-import { AppPath } from '@/types/AppPath';import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';import { getShowPageTabListComponentId } from '@/ui/layout/show-page/utils/getShowPageTabListComponentId';import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';@@ -19,6 +18,7 @@ import { useRecoilComponentCallbackState } from '@/ui/utilities/state/component-import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { useSetRecoilComponentState } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentState';import { useRecoilCallback, useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { IconBrowserMaximize } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';diff --git a/packages/twenty-front/src/modules/action-menu/mock/action-menu-actions.mock.tsx b/packages/twenty-front/src/modules/action-menu/mock/action-menu-actions.mock.tsxindex 9a604888448..8fb3a156674 100644--- a/packages/twenty-front/src/modules/action-menu/mock/action-menu-actions.mock.tsx+++ b/packages/twenty-front/src/modules/action-menu/mock/action-menu-actions.mock.tsx@@ -8,8 +8,8 @@ import { ActionType } from '@/action-menu/actions/types/ActionType';import { ActionViewType } from '@/action-menu/actions/types/ActionViewType';import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';-import { AppPath } from '@/types/AppPath';import { msg } from '@lingui/core/macro';+import { AppPath } from 'twenty-shared/types';import {IconFileExport,IconHeart,diff --git a/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts b/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.tsindex beb8361dccb..ef1e9fca12d 100644--- a/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts+++ b/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts@@ -14,8 +14,8 @@ import { isMatchingLocation } from '~/utils/isMatchingLocation';import { currentUserWorkspaceState } from '@/auth/states/currentUserWorkspaceState';import { appVersionState } from '@/client-config/states/appVersionState';-import { AppPath } from '@/types/AppPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { ApolloFactory, type Options } from '../services/apollo.factory';diff --git a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsxindex b30c958871e..5a9523c48cc 100644--- a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx+++ b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx@@ -3,7 +3,7 @@ import { Route, Routes } from 'react-router-dom';import { SettingsProtectedRouteWrapper } from '@/settings/components/SettingsProtectedRouteWrapper';import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';import { PermissionFlagType } from '~/generated/graphql';const SettingsGraphQLPlayground = lazy(() =>diff --git a/packages/twenty-front/src/modules/app/effect-components/GotoHotkeysEffectsProvider.tsx b/packages/twenty-front/src/modules/app/effect-components/GotoHotkeysEffectsProvider.tsxindex 44975bce357..3b239b70056 100644--- a/packages/twenty-front/src/modules/app/effect-components/GotoHotkeysEffectsProvider.tsx+++ b/packages/twenty-front/src/modules/app/effect-components/GotoHotkeysEffectsProvider.tsx@@ -4,6 +4,8 @@ import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigaimport { navigationDrawerExpandedMemorizedState } from '@/ui/navigation/states/navigationDrawerExpandedMemorizedState';import { useGoToHotkeys } from '@/ui/utilities/hotkey/hooks/useGoToHotkeys';import { useRecoilCallback } from 'recoil';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getAppPath, getSettingsPath } from 'twenty-shared/utils';export const GotoHotkeysEffectsProvider = () => {const { activeNonSystemObjectMetadataItems } =@@ -11,7 +13,7 @@ export const GotoHotkeysEffectsProvider = () => {useGoToHotkeys({key: 's',- location: '/settings/profile',+ location: getSettingsPath(SettingsPath.ProfilePage),preNavigateFunction: useRecoilCallback(({ set }) =>() => {@@ -31,7 +33,9 @@ export const GotoHotkeysEffectsProvider = () => {<GoToHotkeyItemEffectkey={`go-to-hokey-item-${objectMetadataItem.id}`}hotkey={objectMetadataItem.shortcut}- pathToNavigateTo={`/objects/${objectMetadataItem.namePlural}`}+ pathToNavigateTo={getAppPath(AppPath.RecordIndexPage, {+ objectNamePlural: objectMetadataItem.namePlural,+ })}/>);});diff --git a/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx b/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsxindex f31e84d5ffa..79164665a73 100644--- a/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx+++ b/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx@@ -29,12 +29,11 @@ import { useResetTableRowSelection } from '@/object-record/record-table/hooks/inimport { useActiveRecordTableRow } from '@/object-record/record-table/hooks/useActiveRecordTableRow';import { useFocusedRecordTableRow } from '@/object-record/record-table/hooks/useFocusedRecordTableRow';import { getRecordIndexIdFromObjectNamePluralAndViewId } from '@/object-record/utils/getRecordIndexIdFromObjectNamePluralAndViewId';-import { AppBasePath } from '@/types/AppBasePath';-import { AppPath } from '@/types/AppPath';import { PageFocusId } from '@/types/PageFocusId';import { useResetFocusStackToFocusItem } from '@/ui/utilities/focus/hooks/useResetFocusStackToFocusItem';import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';+import { AppBasePath, AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { AnalyticsType } from '~/generated/graphql';import { usePageChangeEffectNavigateLocation } from '~/hooks/usePageChangeEffectNavigateLocation';diff --git a/packages/twenty-front/src/modules/app/hooks/useCreateAppRouter.tsx b/packages/twenty-front/src/modules/app/hooks/useCreateAppRouter.tsxindex f6c4df788c4..5b9c9653bc5 100644--- a/packages/twenty-front/src/modules/app/hooks/useCreateAppRouter.tsx+++ b/packages/twenty-front/src/modules/app/hooks/useCreateAppRouter.tsx@@ -4,9 +4,9 @@ import { VerifyLoginTokenEffect } from '@/auth/components/VerifyLoginTokenEffectimport { VerifyEmailEffect } from '@/auth/components/VerifyEmailEffect';import indexAppPath from '@/navigation/utils/indexAppPath';-import { AppPath } from '@/types/AppPath';import { BlankLayout } from '@/ui/layout/page/components/BlankLayout';import { DefaultLayout } from '@/ui/layout/page/components/DefaultLayout';+import { AppPath } from 'twenty-shared/types';import {createBrowserRouter,diff --git a/packages/twenty-front/src/modules/auth/components/Logo.tsx b/packages/twenty-front/src/modules/auth/components/Logo.tsxindex 4ade282f9ba..957ed33be81 100644--- a/packages/twenty-front/src/modules/auth/components/Logo.tsx+++ b/packages/twenty-front/src/modules/auth/components/Logo.tsx@@ -1,11 +1,11 @@import styled from '@emotion/styled';import { isNonEmptyString } from '@sniptt/guards';+import { AppPath } from 'twenty-shared/types';import { getImageAbsoluteURI, isDefined } from 'twenty-shared/utils';import { Avatar } from 'twenty-ui/display';import { UndecoratedLink } from 'twenty-ui/navigation';import { REACT_APP_SERVER_BASE_URL } from '~/config';import { useRedirectToDefaultDomain } from '~/modules/domain-manager/hooks/useRedirectToDefaultDomain';-import { AppPath } from '~/modules/types/AppPath';type LogoProps = {primaryLogo?: string | null;diff --git a/packages/twenty-front/src/modules/auth/components/TwoFactorAuthenticationProvisionEffect.tsx b/packages/twenty-front/src/modules/auth/components/TwoFactorAuthenticationProvisionEffect.tsxindex b238ec8f4c3..f744d318fe9 100644--- a/packages/twenty-front/src/modules/auth/components/TwoFactorAuthenticationProvisionEffect.tsx+++ b/packages/twenty-front/src/modules/auth/components/TwoFactorAuthenticationProvisionEffect.tsx@@ -2,11 +2,11 @@ import { loginTokenState } from '@/auth/states/loginTokenState';import { qrCodeState } from '@/auth/states/qrCode';import { useOrigin } from '@/domain-manager/hooks/useOrigin';import { useCurrentUserWorkspaceTwoFactorAuthentication } from '@/settings/two-factor-authentication/hooks/useCurrentUserWorkspaceTwoFactorAuthentication';-import { AppPath } from '@/types/AppPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { useLingui } from '@lingui/react/macro';import { useEffect } from 'react';import { useRecoilValue, useSetRecoilState } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { useNavigateApp } from '~/hooks/useNavigateApp';diff --git a/packages/twenty-front/src/modules/auth/components/VerifyEmailEffect.tsx b/packages/twenty-front/src/modules/auth/components/VerifyEmailEffect.tsxindex a2bcf266c8a..90c70373c6e 100644--- a/packages/twenty-front/src/modules/auth/components/VerifyEmailEffect.tsx+++ b/packages/twenty-front/src/modules/auth/components/VerifyEmailEffect.tsx@@ -1,7 +1,7 @@import { useAuth } from '@/auth/hooks/useAuth';-import { AppPath } from '@/types/AppPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { ApolloError } from '@apollo/client';+import { AppPath } from 'twenty-shared/types';import { verifyEmailRedirectPathState } from '@/app/states/verifyEmailRedirectPathState';import { useVerifyLogin } from '@/auth/hooks/useVerifyLogin';diff --git a/packages/twenty-front/src/modules/auth/components/VerifyLoginTokenEffect.tsx b/packages/twenty-front/src/modules/auth/components/VerifyLoginTokenEffect.tsxindex 620636f466d..922bcccde99 100644--- a/packages/twenty-front/src/modules/auth/components/VerifyLoginTokenEffect.tsx+++ b/packages/twenty-front/src/modules/auth/components/VerifyLoginTokenEffect.tsx@@ -4,8 +4,8 @@ import { useSearchParams } from 'react-router-dom';import { useIsLogged } from '@/auth/hooks/useIsLogged';import { useVerifyLogin } from '@/auth/hooks/useVerifyLogin';import { clientConfigApiStatusState } from '@/client-config/states/clientConfigApiStatusState';-import { AppPath } from '@/types/AppPath';import { useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { useNavigateApp } from '~/hooks/useNavigateApp';diff --git a/packages/twenty-front/src/modules/auth/constants/AuthModalConfig.ts b/packages/twenty-front/src/modules/auth/constants/AuthModalConfig.tsindex 32d14192937..31b58c79ce2 100644--- a/packages/twenty-front/src/modules/auth/constants/AuthModalConfig.ts+++ b/packages/twenty-front/src/modules/auth/constants/AuthModalConfig.ts@@ -1,8 +1,8 @@-import { AppPath } from '@/types/AppPath';import {type ModalSize,type ModalVariants,} from '@/ui/layout/modal/components/Modal';+import { AppPath } from 'twenty-shared/types';type AuthModalConfigType = {size: ModalSize;diff --git a/packages/twenty-front/src/modules/auth/hooks/__tests__/useVerifyLogin.test.ts b/packages/twenty-front/src/modules/auth/hooks/__tests__/useVerifyLogin.test.tsindex 8ff6d14941a..7dc00dfaa14 100644--- a/packages/twenty-front/src/modules/auth/hooks/__tests__/useVerifyLogin.test.ts+++ b/packages/twenty-front/src/modules/auth/hooks/__tests__/useVerifyLogin.test.ts@@ -3,8 +3,8 @@ import { I18nProvider } from '@lingui/react';import { renderHook } from '@testing-library/react';import { RecoilRoot } from 'recoil';-import { AppPath } from '@/types/AppPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';+import { AppPath } from 'twenty-shared/types';import { useNavigateApp } from '~/hooks/useNavigateApp';import { useAuth } from '../useAuth';import { useVerifyLogin } from '../useVerifyLogin';diff --git a/packages/twenty-front/src/modules/auth/hooks/useAuth.ts b/packages/twenty-front/src/modules/auth/hooks/useAuth.tsindex 342c20916d2..e401c1ba084 100644--- a/packages/twenty-front/src/modules/auth/hooks/useAuth.ts+++ b/packages/twenty-front/src/modules/auth/hooks/useAuth.ts@@ -1,4 +1,3 @@-import { AppPath } from '@/types/AppPath';import { ApolloError, useApolloClient } from '@apollo/client';import { useCallback } from 'react';import {@@ -8,6 +7,7 @@ import {useRecoilValue,useSetRecoilState,} from 'recoil';+import { AppPath } from 'twenty-shared/types';import { billingState } from '@/client-config/states/billingState';import { clientConfigApiStatusState } from '@/client-config/states/clientConfigApiStatusState';diff --git a/packages/twenty-front/src/modules/auth/hooks/useVerifyLogin.ts b/packages/twenty-front/src/modules/auth/hooks/useVerifyLogin.tsindex 846bbf0fd0b..7aabc0758da 100644--- a/packages/twenty-front/src/modules/auth/hooks/useVerifyLogin.ts+++ b/packages/twenty-front/src/modules/auth/hooks/useVerifyLogin.ts@@ -1,7 +1,7 @@import { useAuth } from '@/auth/hooks/useAuth';-import { AppPath } from '@/types/AppPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { useLingui } from '@lingui/react/macro';+import { AppPath } from 'twenty-shared/types';import { useNavigateApp } from '~/hooks/useNavigateApp';export const useVerifyLogin = () => {diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsxindex 4bad2f26896..1823339e472 100644--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx@@ -12,13 +12,13 @@ import {signInUpStepState,} from '@/auth/states/signInUpStepState';import { useReadCaptchaToken } from '@/captcha/hooks/useReadCaptchaToken';-import { AppPath } from '@/types/AppPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { Trans, useLingui } from '@lingui/react/macro';import { OTPInput, type SlotProps } from 'input-otp';import { useState } from 'react';import { Controller } from 'react-hook-form';import { useRecoilValue, useSetRecoilState } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { MainButton } from 'twenty-ui/input';import { ClickToActionLink } from 'twenty-ui/navigation';import { useNavigateApp } from '~/hooks/useNavigateApp';diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.tsindex fd27bcf141c..9fc736c487a 100644--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.ts+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.ts@@ -12,10 +12,10 @@ import { SignInUpMode } from '@/auth/types/signInUpMode';import { useReadCaptchaToken } from '@/captcha/hooks/useReadCaptchaToken';import { useBuildSearchParamsFromUrlSyncedStates } from '@/domain-manager/hooks/useBuildSearchParamsFromUrlSyncedStates';import { useIsCurrentLocationOnAWorkspace } from '@/domain-manager/hooks/useIsCurrentLocationOnAWorkspace';-import { AppPath } from '@/types/AppPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { ApolloError } from '@apollo/client';import { useRecoilState } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { buildAppPathWithQueryParams } from '~/utils/buildAppPathWithQueryParams';import { isMatchingLocation } from '~/utils/isMatchingLocation';import { useAuth } from '../../hooks/useAuth';diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.tsindex c0ba5e7090f..9182a9dcf2d 100644--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts@@ -1,7 +1,7 @@import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';-import { AppPath } from '@/types/AppPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { type ApolloError } from '@apollo/client';+import { AppPath } from 'twenty-shared/types';import { useSignUpInNewWorkspaceMutation } from '~/generated-metadata/graphql';import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceFromInviteHash.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceFromInviteHash.tsindex e0f535f95f8..79850a1ce1a 100644--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceFromInviteHash.ts+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceFromInviteHash.ts@@ -6,8 +6,8 @@ import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';-import { AppPath } from '@/types/AppPath';import { t } from '@lingui/core/macro';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { useGetWorkspaceFromInviteHashQuery } from '~/generated-metadata/graphql';import { useNavigateApp } from '~/hooks/useNavigateApp';diff --git a/packages/twenty-front/src/modules/auth/utils/availableWorkspacesUtils.ts b/packages/twenty-front/src/modules/auth/utils/availableWorkspacesUtils.tsindex c7cb539a201..0443e47414d 100644--- a/packages/twenty-front/src/modules/auth/utils/availableWorkspacesUtils.ts+++ b/packages/twenty-front/src/modules/auth/utils/availableWorkspacesUtils.ts@@ -1,10 +1,10 @@+import { generatePath } from 'react-router-dom';+import { AppPath } from 'twenty-shared/types';+import { isDefined } from 'twenty-shared/utils';import {- type AvailableWorkspaces,type AvailableWorkspace,+ type AvailableWorkspaces,} from '~/generated/graphql';-import { AppPath } from '@/types/AppPath';-import { isDefined } from 'twenty-shared/utils';-import { generatePath } from 'react-router-dom';export const countAvailableWorkspaces = ({availableWorkspacesForSignIn,diff --git a/packages/twenty-front/src/modules/auth/utils/getAuthModalConfig.ts b/packages/twenty-front/src/modules/auth/utils/getAuthModalConfig.tsindex 41ae7cbfacd..50f3b602876 100644--- a/packages/twenty-front/src/modules/auth/utils/getAuthModalConfig.ts+++ b/packages/twenty-front/src/modules/auth/utils/getAuthModalConfig.ts@@ -1,6 +1,6 @@import { AUTH_MODAL_CONFIG } from '@/auth/constants/AuthModalConfig';-import { AppPath } from '@/types/AppPath';import { type Location } from 'react-router-dom';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { isMatchingLocation } from '~/utils/isMatchingLocation';diff --git a/packages/twenty-front/src/modules/captcha/constants/CaptchaProtectedPaths.ts b/packages/twenty-front/src/modules/captcha/constants/CaptchaProtectedPaths.tsindex d76b50fcc2c..a48182f1452 100644--- a/packages/twenty-front/src/modules/captcha/constants/CaptchaProtectedPaths.ts+++ b/packages/twenty-front/src/modules/captcha/constants/CaptchaProtectedPaths.ts@@ -1,4 +1,4 @@-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';export const CAPTCHA_PROTECTED_PATHS: string[] = [AppPath.SignInUp,diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuRouter.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuRouter.tsxindex 71b5573cf7b..76cef582ccd 100644--- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuRouter.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuRouter.tsx@@ -8,12 +8,12 @@ import { commandMenuPageState } from '@/command-menu/states/commandMenuPageStateimport { CommandMenuPageComponentInstanceContext } from '@/command-menu/states/contexts/CommandMenuPageComponentInstanceContext';import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';-import { SettingsPath } from '@/types/SettingsPath';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { motion } from 'framer-motion';import { useLocation } from 'react-router-dom';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';const StyledCommandMenuContent = styled.div`diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsxindex a185120ef77..d1147f5ee61 100644--- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuTopBar.tsx@@ -20,6 +20,7 @@ import { AnimatePresence, motion } from 'framer-motion';import { useRef } from 'react';import { useLocation } from 'react-router-dom';import { useRecoilState, useRecoilValue } from 'recoil';+import { AppBasePath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { IconChevronLeft, IconX } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';@@ -105,8 +106,8 @@ export const CommandMenuTopBar = () => {const location = useLocation();const isButtonVisible =- !location.pathname.startsWith('/objects/') &&- !location.pathname.startsWith('/object/');+ !location.pathname.startsWith(`${AppBasePath.Root}objects/`) &&+ !location.pathname.startsWith(`${AppBasePath.Root}object/`);const backButtonAnimationDuration =contextChips.length > 0 ? theme.animation.duration.instant : 0;diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuSearchRecords.tsx b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuSearchRecords.tsxindex 138d8424d99..bbd3f312e6d 100644--- a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuSearchRecords.tsx+++ b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuSearchRecords.tsx@@ -10,10 +10,10 @@ import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadatimport { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions';import { getObjectPermissionsFromMapByObjectMetadataId } from '@/settings/roles/role-permissions/objects-permissions/utils/getObjectPermissionsFromMapByObjectMetadataId';-import { AppPath } from '@/types/AppPath';import { t } from '@lingui/core/macro';import { useMemo } from 'react';import { useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { Avatar } from 'twenty-ui/display';import { useDebounce } from 'use-debounce';import { useSearchQuery } from '~/generated/graphql';diff --git a/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutGraphTypeSelect.tsx b/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutGraphTypeSelect.tsxindex ac9d099d614..022f20e6a75 100644--- a/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutGraphTypeSelect.tsx+++ b/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutGraphTypeSelect.tsx@@ -1,7 +1,7 @@import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';-import { usePageLayoutWidgetCreate } from '@/settings/page-layout/hooks/usePageLayoutWidgetCreate';+import { useCreatePageLayoutWidget } from '@/settings/page-layout/hooks/useCreatePageLayoutWidget';import {- GraphSubType,+ GraphType,WidgetType,} from '@/settings/page-layout/mocks/mockWidgets';import styled from '@emotion/styled';@@ -30,22 +30,22 @@ const StyledSectionTitle = styled.div`const graphTypeOptions = [{- type: GraphSubType.BAR,+ type: GraphType.BAR,icon: IconChartBar,title: 'Bar Chart',},{- type: GraphSubType.PIE,+ type: GraphType.PIE,icon: IconChartPie,title: 'Pie Chart',},{- type: GraphSubType.GAUGE,+ type: GraphType.GAUGE,icon: IconGauge,title: 'Gauge',},{- type: GraphSubType.NUMBER,+ type: GraphType.NUMBER,icon: IconNumber,title: 'Number',},@@ -53,10 +53,10 @@ const graphTypeOptions = [export const CommandMenuPageLayoutGraphTypeSelect = () => {const { closeCommandMenu } = useCommandMenu();- const { handleCreateWidget } = usePageLayoutWidgetCreate();+ const { createPageLayoutWidget } = useCreatePageLayoutWidget();- const handleSelectGraphType = (graphType: GraphSubType) => {- handleCreateWidget(WidgetType.GRAPH, graphType);+ const handleSelectGraphType = (graphType: GraphType) => {+ createPageLayoutWidget(WidgetType.GRAPH, graphType);closeCommandMenu();};diff --git a/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutIframeConfig.tsx b/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutIframeConfig.tsxindex 783fd0333d8..cbe7263d64d 100644--- a/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutIframeConfig.tsx+++ b/packages/twenty-front/src/modules/command-menu/pages/page-layout/components/CommandMenuPageLayoutIframeConfig.tsx@@ -1,7 +1,7 @@import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput';import { useCreatePageLayoutIframeWidget } from '@/settings/page-layout/hooks/useCreatePageLayoutIframeWidget';-import { usePageLayoutWidgetUpdate } from '@/settings/page-layout/hooks/usePageLayoutWidgetUpdate';+import { useUpdatePageLayoutWidget } from '@/settings/page-layout/hooks/useUpdatePageLayoutWidget';import { pageLayoutDraftState } from '@/settings/page-layout/states/pageLayoutDraftState';import { pageLayoutEditingWidgetIdState } from '@/settings/page-layout/states/pageLayoutEditingWidgetIdState';import styled from '@emotion/styled';@@ -34,7 +34,7 @@ const StyledButtonContainer = styled.div`export const CommandMenuPageLayoutIframeConfig = () => {const { closeCommandMenu } = useCommandMenu();const { createPageLayoutIframeWidget } = useCreatePageLayoutIframeWidget();- const { handleUpdateWidget } = usePageLayoutWidgetUpdate();+ const { updatePageLayoutWidget } = useUpdatePageLayoutWidget();const [pageLayoutEditingWidgetId, setPageLayoutEditingWidgetId] =useRecoilState(pageLayoutEditingWidgetIdState);const pageLayoutDraft = useRecoilValue(pageLayoutDraftState);@@ -77,7 +77,7 @@ export const CommandMenuPageLayoutIframeConfig = () => {}if (isEditMode && pageLayoutEditingWidgetId !== null) {- handleUpdateWidget(pageLayoutEditingWidgetId, {+ updatePageLayoutWidget(pageLayoutEditingWidgetId, {title: title.trim(),configuration: {...editingWidget?.configuration,diff --git a/packages/twenty-front/src/modules/context-store/components/MainContextStoreProvider.tsx b/packages/twenty-front/src/modules/context-store/components/MainContextStoreProvider.tsxindex 11bd1f6c0e7..787c50822c8 100644--- a/packages/twenty-front/src/modules/context-store/components/MainContextStoreProvider.tsx+++ b/packages/twenty-front/src/modules/context-store/components/MainContextStoreProvider.tsx@@ -3,10 +3,10 @@ import { useIsSettingsPage } from '@/navigation/hooks/useIsSettingsPage';import { useLastVisitedView } from '@/navigation/hooks/useLastVisitedView';import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';import { prefetchIndexViewIdFromObjectMetadataItemFamilySelector } from '@/prefetch/states/selector/prefetchIndexViewIdFromObjectMetadataItemFamilySelector';-import { AppPath } from '@/types/AppPath';import { useShowAuthModal } from '@/ui/layout/hooks/useShowAuthModal';import { useLocation, useParams, useSearchParams } from 'react-router-dom';import { useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { isMatchingLocation } from '~/utils/isMatchingLocation';diff --git a/packages/twenty-front/src/modules/favorites/utils/sortFavorites.ts b/packages/twenty-front/src/modules/favorites/utils/sortFavorites.tsindex 8e8e183c27b..08c8996cb81 100644--- a/packages/twenty-front/src/modules/favorites/utils/sortFavorites.ts+++ b/packages/twenty-front/src/modules/favorites/utils/sortFavorites.ts@@ -4,10 +4,9 @@ import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataIteimport { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';import { type ObjectRecord } from '@/object-record/types/ObjectRecord';import { type ObjectRecordIdentifier } from '@/object-record/types/ObjectRecordIdentifier';-import { AppPath } from '@/types/AppPath';import { type View } from '@/views/types/View';-import { isDefined } from 'twenty-shared/utils';-import { getAppPath } from '~/utils/navigation/getAppPath';+import { AppPath } from 'twenty-shared/types';+import { getAppPath, isDefined } from 'twenty-shared/utils';export type ProcessedFavorite = Favorite & {Icon?: string;diff --git a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerBillingSubscriptionPaused.tsx b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerBillingSubscriptionPaused.tsxindex 3a036646716..9e137bf159f 100644--- a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerBillingSubscriptionPaused.tsx+++ b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerBillingSubscriptionPaused.tsx@@ -1,14 +1,13 @@import { useRedirect } from '@/domain-manager/hooks/useRedirect';import { InformationBanner } from '@/information-banner/components/InformationBanner';import { usePermissionFlagMap } from '@/settings/roles/hooks/usePermissionFlagMap';-import { SettingsPath } from '@/types/SettingsPath';import { t } from '@lingui/core/macro';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import {PermissionFlagType,useBillingPortalSessionQuery,} from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const InformationBannerBillingSubscriptionPaused = () => {const { redirect } = useRedirect();diff --git a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsx b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsxindex b8ef41e3ede..5ae9c1fde31 100644--- a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsx+++ b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsx@@ -1,14 +1,13 @@import { useRedirect } from '@/domain-manager/hooks/useRedirect';import { InformationBanner } from '@/information-banner/components/InformationBanner';import { usePermissionFlagMap } from '@/settings/roles/hooks/usePermissionFlagMap';-import { SettingsPath } from '@/types/SettingsPath';import { t } from '@lingui/core/macro';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import {PermissionFlagType,useBillingPortalSessionQuery,} from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const InformationBannerFailPaymentInfo = () => {const { redirect } = useRedirect();diff --git a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerNoBillingSubscription.tsx b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerNoBillingSubscription.tsxindex 353472624fd..56fdfd88a8c 100644--- a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerNoBillingSubscription.tsx+++ b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerNoBillingSubscription.tsx@@ -2,10 +2,10 @@ import { BILLING_CHECKOUT_SESSION_DEFAULT_VALUE } from '@/billing/constants/Billimport { useHandleCheckoutSession } from '@/billing/hooks/useHandleCheckoutSession';import { InformationBanner } from '@/information-banner/components/InformationBanner';import { usePermissionFlagMap } from '@/settings/roles/hooks/usePermissionFlagMap';-import { SettingsPath } from '@/types/SettingsPath';import { t } from '@lingui/core/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { PermissionFlagType } from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const InformationBannerNoBillingSubscription = () => {const { handleCheckoutSession, isSubmitting } = useHandleCheckoutSession({diff --git a/packages/twenty-front/src/modules/navigation/components/MainNavigationDrawerFixedItems.tsx b/packages/twenty-front/src/modules/navigation/components/MainNavigationDrawerFixedItems.tsxindex d73f3de4694..e513b84a3c5 100644--- a/packages/twenty-front/src/modules/navigation/components/MainNavigationDrawerFixedItems.tsx+++ b/packages/twenty-front/src/modules/navigation/components/MainNavigationDrawerFixedItems.tsx@@ -1,6 +1,5 @@import { useOpenAskAIPageInCommandMenu } from '@/command-menu/hooks/useOpenAskAIPageInCommandMenu';import { useOpenRecordsSearchPageInCommandMenu } from '@/command-menu/hooks/useOpenRecordsSearchPageInCommandMenu';-import { SettingsPath } from '@/types/SettingsPath';import { NavigationDrawerItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';import { navigationDrawerExpandedMemorizedState } from '@/ui/navigation/states/navigationDrawerExpandedMemorizedState';@@ -9,10 +8,11 @@ import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { useLingui } from '@lingui/react/macro';import { useLocation, useNavigate } from 'react-router-dom';import { useRecoilState, useSetRecoilState } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconSearch, IconSettings, IconSparkles } from 'twenty-ui/display';import { useIsMobile } from 'twenty-ui/utilities';import { FeatureFlagKey } from '~/generated/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const MainNavigationDrawerFixedItems = () => {const isMobile = useIsMobile();diff --git a/packages/twenty-front/src/modules/navigation/components/__stories__/AppNavigationDrawer.stories.tsx b/packages/twenty-front/src/modules/navigation/components/__stories__/AppNavigationDrawer.stories.tsxindex 41d4b99c93d..34220894f5d 100644--- a/packages/twenty-front/src/modules/navigation/components/__stories__/AppNavigationDrawer.stories.tsx+++ b/packages/twenty-front/src/modules/navigation/components/__stories__/AppNavigationDrawer.stories.tsx@@ -9,8 +9,8 @@ import { IconsProviderDecorator } from '~/testing/decorators/IconsProviderDecoraimport { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';-import { AppPath } from '@/types/AppPath';import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';+import { AppPath } from 'twenty-shared/types';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';import {AppNavigationDrawer,diff --git a/packages/twenty-front/src/modules/navigation/hooks/__tests__/useDefaultHomePagePath.test.ts b/packages/twenty-front/src/modules/navigation/hooks/__tests__/useDefaultHomePagePath.test.tsindex 56d4599c66d..575f7c3ee9b 100644--- a/packages/twenty-front/src/modules/navigation/hooks/__tests__/useDefaultHomePagePath.test.ts+++ b/packages/twenty-front/src/modules/navigation/hooks/__tests__/useDefaultHomePagePath.test.ts@@ -7,8 +7,8 @@ import { currentUserWorkspaceState } from '@/auth/states/currentUserWorkspaceStaimport { useDefaultHomePagePath } from '@/navigation/hooks/useDefaultHomePagePath';import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';import { AggregateOperations } from '@/object-record/record-table/constants/AggregateOperations';-import { AppPath } from '@/types/AppPath';import { coreViewsState } from '@/views/states/coreViewState';+import { AppPath } from 'twenty-shared/types';import { ViewOpenRecordIn, ViewType } from '~/generated/graphql';import { getMockCompanyObjectMetadataItem } from '~/testing/mock-data/companies';import { mockedUserData } from '~/testing/mock-data/users';diff --git a/packages/twenty-front/src/modules/navigation/hooks/useDefaultHomePagePath.ts b/packages/twenty-front/src/modules/navigation/hooks/useDefaultHomePagePath.tsindex 4fe0447b29a..8ca54e82f77 100644--- a/packages/twenty-front/src/modules/navigation/hooks/useDefaultHomePagePath.ts+++ b/packages/twenty-front/src/modules/navigation/hooks/useDefaultHomePagePath.ts@@ -4,16 +4,13 @@ import { type ObjectPathInfo } from '@/navigation/types/ObjectPathInfo';import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions';import { getObjectPermissionsFromMapByObjectMetadataId } from '@/settings/roles/role-permissions/objects-permissions/utils/getObjectPermissionsFromMapByObjectMetadataId';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { coreViewsState } from '@/views/states/coreViewState';import { convertCoreViewToView } from '@/views/utils/convertCoreViewToView';import isEmpty from 'lodash.isempty';import { useCallback, useMemo } from 'react';import { useRecoilCallback, useRecoilValue } from 'recoil';-import { isDefined } from 'twenty-shared/utils';-import { getAppPath } from '~/utils/navigation/getAppPath';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getAppPath, getSettingsPath, isDefined } from 'twenty-shared/utils';export const useDefaultHomePagePath = () => {const currentUser = useRecoilValue(currentUserState);diff --git a/packages/twenty-front/src/modules/navigation/utils/__tests__/indexAppPath.test.ts b/packages/twenty-front/src/modules/navigation/utils/__tests__/indexAppPath.test.tsindex 294dd6a5fca..bd7c0442140 100644--- a/packages/twenty-front/src/modules/navigation/utils/__tests__/indexAppPath.test.ts+++ b/packages/twenty-front/src/modules/navigation/utils/__tests__/indexAppPath.test.ts@@ -1,4 +1,4 @@-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';import indexAppPath from '../indexAppPath';describe('getIndexAppPath', () => {diff --git a/packages/twenty-front/src/modules/navigation/utils/indexAppPath.ts b/packages/twenty-front/src/modules/navigation/utils/indexAppPath.tsindex 02af3bedc5c..02f039c845b 100644--- a/packages/twenty-front/src/modules/navigation/utils/indexAppPath.ts+++ b/packages/twenty-front/src/modules/navigation/utils/indexAppPath.ts@@ -1,4 +1,4 @@-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';const getIndexAppPath = () => {return AppPath.Index;diff --git a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerItemForObjectMetadataItem.tsx b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerItemForObjectMetadataItem.tsxindex b297df68efd..bbee3cdfed3 100644--- a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerItemForObjectMetadataItem.tsx+++ b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerItemForObjectMetadataItem.tsx@@ -3,7 +3,6 @@ import { contextStoreCurrentViewIdComponentState } from '@/context-store/states/import { lastVisitedViewPerObjectMetadataItemState } from '@/navigation/states/lastVisitedViewPerObjectMetadataItemState';import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';import { prefetchViewsFromObjectMetadataItemFamilySelector } from '@/prefetch/states/selector/prefetchViewsFromObjectMetadataItemFamilySelector';-import { AppPath } from '@/types/AppPath';import { NavigationDrawerItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';import { NavigationDrawerItemsCollapsableContainer } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItemsCollapsableContainer';import { NavigationDrawerSubItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSubItem';@@ -11,9 +10,10 @@ import { getNavigationSubItemLeftAdornment } from '@/ui/navigation/navigation-drimport { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { useLocation } from 'react-router-dom';import { useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';+import { getAppPath } from 'twenty-shared/utils';import { useIcons } from 'twenty-ui/display';import { AnimatedExpandableContainer } from 'twenty-ui/layout';-import { getAppPath } from '~/utils/navigation/getAppPath';export type NavigationDrawerItemForObjectMetadataItemProps = {objectMetadataItem: ObjectMetadataItem;diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenFieldsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenFieldsContent.tsxindex b68bbdbac07..0f19078b04c 100644--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenFieldsContent.tsx+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenFieldsContent.tsx@@ -4,7 +4,6 @@ import { useSetRecoilState } from 'recoil';import { useObjectNamePluralFromSingular } from '@/object-metadata/hooks/useObjectNamePluralFromSingular';import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';-import { SettingsPath } from '@/types/SettingsPath';import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';@@ -13,9 +12,10 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMimport { navigationMemorizedUrlState } from '@/ui/navigation/states/navigationMemorizedUrlState';import { ViewFieldsHiddenDropdownSection } from '@/views/components/ViewFieldsHiddenDropdownSection';import { useLingui } from '@lingui/react/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconChevronLeft, IconSettings } from 'twenty-ui/display';import { MenuItem, UndecoratedLink } from 'twenty-ui/navigation';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const ObjectOptionsDropdownHiddenFieldsContent = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenRecordGroupsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenRecordGroupsContent.tsxindex 1809fe5268b..b7d013a9ff1 100644--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenRecordGroupsContent.tsx+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenRecordGroupsContent.tsx@@ -7,7 +7,6 @@ import { RecordGroupsVisibilityDropdownSection } from '@/object-record/record-grimport { useRecordGroupVisibility } from '@/object-record/record-group/hooks/useRecordGroupVisibility';import { recordGroupFieldMetadataComponentState } from '@/object-record/record-group/states/recordGroupFieldMetadataComponentState';import { hiddenRecordGroupIdsComponentSelector } from '@/object-record/record-group/states/selectors/hiddenRecordGroupIdsComponentSelector';-import { SettingsPath } from '@/types/SettingsPath';import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';@@ -18,9 +17,10 @@ import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hoimport { useLingui } from '@lingui/react/macro';import { useLocation } from 'react-router-dom';import { useSetRecoilState } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconChevronLeft, IconSettings } from 'twenty-ui/display';import { MenuItem, UndecoratedLink } from 'twenty-ui/navigation';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const ObjectOptionsDropdownHiddenRecordGroupsContent = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsxindex f462e1784d2..c262b3a8ecc 100644--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx@@ -8,7 +8,6 @@ import { useSearchRecordGroupField } from '@/object-record/object-options-dropdoimport { recordGroupFieldMetadataComponentState } from '@/object-record/record-group/states/recordGroupFieldMetadataComponentState';import { hiddenRecordGroupIdsComponentSelector } from '@/object-record/record-group/states/selectors/hiddenRecordGroupIdsComponentSelector';import { useHandleRecordGroupField } from '@/object-record/record-index/hooks/useHandleRecordGroupField';-import { SettingsPath } from '@/types/SettingsPath';import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';@@ -21,7 +20,8 @@ import { ViewType } from '@/views/types/ViewType';import { useLingui } from '@lingui/react/macro';import { useLocation } from 'react-router-dom';import { useSetRecoilState } from 'recoil';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { IconChevronLeft, IconSettings, useIcons } from 'twenty-ui/display';import {MenuItem,@@ -29,7 +29,6 @@ import {UndecoratedLink,} from 'twenty-ui/navigation';import { FieldMetadataType } from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const ObjectOptionsDropdownRecordGroupFieldsContent = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSection.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSection.tsxindex 9c371d234a0..b29661e260e 100644--- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSection.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSection.tsx@@ -20,14 +20,13 @@ import { recordStoreFamilySelector } from '@/object-record/record-store/states/simport { AggregateOperations } from '@/object-record/record-table/constants/AggregateOperations';import { type ObjectRecord } from '@/object-record/types/ObjectRecord';import { prefetchIndexViewIdFromObjectMetadataItemFamilySelector } from '@/prefetch/states/selector/prefetchIndexViewIdFromObjectMetadataItemFamilySelector';-import { AppPath } from '@/types/AppPath';import { isDropdownOpenComponentState } from '@/ui/layout/dropdown/states/isDropdownOpenComponentState';import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { useLingui } from '@lingui/react/macro';-import { ViewFilterOperand } from 'twenty-shared/types';+import { AppPath, ViewFilterOperand } from 'twenty-shared/types';+import { getAppPath } from 'twenty-shared/utils';import { RelationType } from '~/generated-metadata/graphql';-import { getAppPath } from '~/utils/navigation/getAppPath';type RecordDetailRelationSectionProps = {loading: boolean;diff --git a/packages/twenty-front/src/modules/object-record/record-group/hooks/useRecordGroupActions.ts b/packages/twenty-front/src/modules/object-record/record-group/hooks/useRecordGroupActions.tsindex 7d4c5613e41..725156087a2 100644--- a/packages/twenty-front/src/modules/object-record/record-group/hooks/useRecordGroupActions.ts+++ b/packages/twenty-front/src/modules/object-record/record-group/hooks/useRecordGroupActions.ts@@ -8,7 +8,6 @@ import { type RecordGroupAction } from '@/object-record/record-group/types/Recorimport { useRecordIndexContextOrThrow } from '@/object-record/record-index/contexts/RecordIndexContext';import { useRecordIndexIdFromCurrentContextStore } from '@/object-record/record-index/hooks/useRecordIndexIdFromCurrentContextStore';import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';-import { SettingsPath } from '@/types/SettingsPath';import { navigationMemorizedUrlState } from '@/ui/navigation/states/navigationMemorizedUrlState';import { useRecoilComponentFamilyValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValue';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';@@ -18,6 +17,7 @@ import { isUndefined } from '@sniptt/guards';import { useCallback, useContext } from 'react';import { useLocation } from 'react-router-dom';import { useSetRecoilState } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import {IconArrowLeft,diff --git a/packages/twenty-front/src/modules/object-record/record-index/hooks/useHandleIndexIdentifierClick.ts b/packages/twenty-front/src/modules/object-record/record-index/hooks/useHandleIndexIdentifierClick.tsindex 589b94b3ce2..e89396200c5 100644--- a/packages/twenty-front/src/modules/object-record/record-index/hooks/useHandleIndexIdentifierClick.ts+++ b/packages/twenty-front/src/modules/object-record/record-index/hooks/useHandleIndexIdentifierClick.ts@@ -1,8 +1,8 @@import { contextStoreCurrentViewIdComponentState } from '@/context-store/states/contextStoreCurrentViewIdComponentState';import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';-import { AppPath } from '@/types/AppPath';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';-import { getAppPath } from '~/utils/navigation/getAppPath';+import { AppPath } from 'twenty-shared/types';+import { getAppPath } from 'twenty-shared/utils';export const useHandleIndexIdentifierClick = ({objectMetadataItem,diff --git a/packages/twenty-front/src/modules/object-record/record-index/hooks/useOpenRecordFromIndexView.ts b/packages/twenty-front/src/modules/object-record/record-index/hooks/useOpenRecordFromIndexView.tsindex 4f2a60b508c..eeae4335a92 100644--- a/packages/twenty-front/src/modules/object-record/record-index/hooks/useOpenRecordFromIndexView.ts+++ b/packages/twenty-front/src/modules/object-record/record-index/hooks/useOpenRecordFromIndexView.ts@@ -7,10 +7,10 @@ import { useRecordIndexContextOrThrow } from '@/object-record/record-index/conteimport { recordIndexOpenRecordInState } from '@/object-record/record-index/states/recordIndexOpenRecordInState';import { currentRecordSortsComponentState } from '@/object-record/record-sort/states/currentRecordSortsComponentState';import { canOpenObjectInSidePanel } from '@/object-record/utils/canOpenObjectInSidePanel';-import { AppPath } from '@/types/AppPath';import { useRecoilComponentCallbackState } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackState';import { ViewOpenRecordInType } from '@/views/types/ViewOpenRecordInType';import { useRecoilCallback } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { useNavigateApp } from '~/hooks/useNavigateApp';export const useOpenRecordFromIndexView = () => {diff --git a/packages/twenty-front/src/modules/object-record/record-merge/hooks/useMergeRecordsActions.ts b/packages/twenty-front/src/modules/object-record/record-merge/hooks/useMergeRecordsActions.tsindex c4cec46fe7a..b4aa2fab02b 100644--- a/packages/twenty-front/src/modules/object-record/record-merge/hooks/useMergeRecordsActions.ts+++ b/packages/twenty-front/src/modules/object-record/record-merge/hooks/useMergeRecordsActions.ts@@ -4,8 +4,8 @@ import { useRecoilValue } from 'recoil';import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { useFindManyRecordsSelectedInContextStore } from '@/context-store/hooks/useFindManyRecordsSelectedInContextStore';import { useMergeManyRecords } from '@/object-record/hooks/useMergeManyRecords';-import { AppPath } from '@/types/AppPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';+import { AppPath } from 'twenty-shared/types';import { useNavigateApp } from '~/hooks/useNavigateApp';import { mergeSettingsState } from '../states/mergeSettingsState';diff --git a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.tsindex 39f1edacfd2..0cdf02db549 100644--- a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts+++ b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts@@ -7,8 +7,8 @@ import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataimport { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';import { lastShowPageRecordIdState } from '@/object-record/record-field/ui/states/lastShowPageRecordId';import { useRecordIdsFromFindManyCacheRootQuery } from '@/object-record/record-show/hooks/useRecordIdsFromFindManyCacheRootQuery';-import { AppPath } from '@/types/AppPath';import { useQueryVariablesFromParentView } from '@/views/hooks/useQueryVariablesFromParentView';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { useNavigateApp } from '~/hooks/useNavigateApp';diff --git a/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyStateRemote.tsx b/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyStateRemote.tsxindex 7d4f3165ce1..6ac0515f024 100644--- a/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyStateRemote.tsx+++ b/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyStateRemote.tsx@@ -1,7 +1,7 @@/* eslint-disable @nx/workspace-no-navigate-prefer-link */import { RecordTableEmptyStateDisplay } from '@/object-record/record-table/empty-state/components/RecordTableEmptyStateDisplay';-import { SettingsPath } from '@/types/SettingsPath';import { t } from '@lingui/core/macro';+import { SettingsPath } from 'twenty-shared/types';import { IconSettings } from 'twenty-ui/display';import { useNavigateSettings } from '~/hooks/useNavigateSettings';diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/useCreateNewIndexRecord.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/useCreateNewIndexRecord.tsindex 0e9785e3d7d..42a45767292 100644--- a/packages/twenty-front/src/modules/object-record/record-table/hooks/useCreateNewIndexRecord.ts+++ b/packages/twenty-front/src/modules/object-record/record-table/hooks/useCreateNewIndexRecord.ts@@ -9,9 +9,9 @@ import { RecordTitleCellContainerType } from '@/object-record/record-title-cell/import { type ObjectRecord } from '@/object-record/types/ObjectRecord';import { canOpenObjectInSidePanel } from '@/object-record/utils/canOpenObjectInSidePanel';import { getRecordFieldInputInstanceId } from '@/object-record/utils/getRecordFieldInputId';-import { AppPath } from '@/types/AppPath';import { ViewOpenRecordInType } from '@/views/types/ViewOpenRecordInType';import { useRecoilCallback } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { v4 } from 'uuid';import { useNavigateApp } from '~/hooks/useNavigateApp';diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderPlusButtonContent.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderPlusButtonContent.tsxindex 23ac2bbfa0b..8953ed16cf2 100644--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderPlusButtonContent.tsx+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderPlusButtonContent.tsx@@ -7,16 +7,16 @@ import { useChangeRecordFieldVisibility } from '@/object-record/record-field/hooimport { type FieldMetadata } from '@/object-record/record-field/ui/types/FieldMetadata';import { useRecordTableContextOrThrow } from '@/object-record/record-table/contexts/RecordTableContext';import { type ColumnDefinition } from '@/object-record/record-table/types/ColumnDefinition';-import { SettingsPath } from '@/types/SettingsPath';import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';import { navigationMemorizedUrlState } from '@/ui/navigation/states/navigationMemorizedUrlState';import { useLingui } from '@lingui/react/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconSettings, useIcons } from 'twenty-ui/display';import { MenuItem, UndecoratedLink } from 'twenty-ui/navigation';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const RecordTableHeaderPlusButtonContent = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsConnectedAccountsListCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsConnectedAccountsListCard.tsxindex 66a2bec2722..8945cc4471f 100644--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsConnectedAccountsListCard.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsConnectedAccountsListCard.tsx@@ -2,9 +2,9 @@ import { type ConnectedAccount } from '@/accounts/types/ConnectedAccount';import { SettingsAccountsListEmptyStateCard } from '@/settings/accounts/components/SettingsAccountsListEmptyStateCard';import { SettingsConnectedAccountsTableHeader } from '@/settings/accounts/components/SettingsConnectedAccountsTableHeader';import { SettingsConnectedAccountsTableRow } from '@/settings/components/SettingsConnectedAccountsTableRow';-import { SettingsPath } from '@/types/SettingsPath';import { Table } from '@/ui/layout/table/components/Table';import styled from '@emotion/styled';+import { SettingsPath } from 'twenty-shared/types';import { useLingui } from '@lingui/react/macro';import { IconPlus } from 'twenty-ui/display';diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsEditImapSmtpCaldavConnection.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsEditImapSmtpCaldavConnection.tsxindex 6067c551896..ff76c533ad2 100644--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsEditImapSmtpCaldavConnection.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsEditImapSmtpCaldavConnection.tsx@@ -5,13 +5,13 @@ import { useParams } from 'react-router-dom';import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';+import { SettingsPath } from 'twenty-shared/types';import { Loader } from 'twenty-ui/feedback';+import { getSettingsPath } from 'twenty-shared/utils';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';import { NotFound } from '~/pages/not-found/NotFound';import { useImapSmtpCaldavConnectionForm } from '../hooks/useImapSmtpCaldavConnectionForm';diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsxindex 70872c7b65e..fe333252626 100644--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx@@ -4,17 +4,16 @@ import { isMicrosoftCalendarEnabledState } from '@/client-config/states/isMicrosimport { isMicrosoftMessagingEnabledState } from '@/client-config/states/isMicrosoftMessagingEnabledState';import { useTriggerApisOAuth } from '@/settings/accounts/hooks/useTriggerApiOAuth';import { SettingsCard } from '@/settings/components/SettingsCard';-import { SettingsPath } from '@/types/SettingsPath';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';import { useRecoilValue } from 'recoil';-import { ConnectedAccountProvider } from 'twenty-shared/types';+import { ConnectedAccountProvider, SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconAt, IconGoogle, IconMicrosoft } from 'twenty-ui/display';import { UndecoratedLink } from 'twenty-ui/navigation';import { FeatureFlagKey } from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledCardsContainer = styled.div`display: flex;diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsNewImapSmtpCaldavConnection.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsNewImapSmtpCaldavConnection.tsxindex 9e00e03497b..8ebd40db187 100644--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsNewImapSmtpCaldavConnection.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsNewImapSmtpCaldavConnection.tsx@@ -3,11 +3,11 @@ import { FormProvider } from 'react-hook-form';import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';import { SettingsAccountsConnectionForm } from '@/settings/accounts/components/SettingsAccountsConnectionForm';import { useImapSmtpCaldavConnectionForm } from '../hooks/useImapSmtpCaldavConnectionForm';diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsxindex d3f9f96361e..d74f3b13522 100644--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx@@ -2,7 +2,6 @@ import { type ConnectedAccount } from '@/accounts/types/ConnectedAccount';import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';import { useDestroyOneRecord } from '@/object-record/hooks/useDestroyOneRecord';import { useTriggerProviderReconnect } from '@/settings/accounts/hooks/useTriggerProviderReconnect';-import { SettingsPath } from '@/types/SettingsPath';import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';@@ -10,7 +9,7 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';import { useModal } from '@/ui/layout/modal/hooks/useModal';import { Trans, useLingui } from '@lingui/react/macro';-import { ConnectedAccountProvider } from 'twenty-shared/types';+import { ConnectedAccountProvider, SettingsPath } from 'twenty-shared/types';import {IconAt,IconCalendarEvent,diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsSettingsSection.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsSettingsSection.tsxindex 91ff7036884..8adf48c1b8d 100644--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsSettingsSection.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsSettingsSection.tsx@@ -1,14 +1,14 @@import styled from '@emotion/styled';import { SettingsCard } from '@/settings/components/SettingsCard';-import { SettingsPath } from '@/types/SettingsPath';import { useTheme } from '@emotion/react';import { useLingui } from '@lingui/react/macro';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title, IconCalendarEvent, IconMailCog } from 'twenty-ui/display';-import { MOBILE_VIEWPORT } from 'twenty-ui/theme';import { Section } from 'twenty-ui/layout';import { UndecoratedLink } from 'twenty-ui/navigation';+import { MOBILE_VIEWPORT } from 'twenty-ui/theme';const StyledCardsContainer = styled.div`display: flex;diff --git a/packages/twenty-front/src/modules/settings/accounts/hooks/__tests__/useTriggerProviderReconnect.test.tsx b/packages/twenty-front/src/modules/settings/accounts/hooks/__tests__/useTriggerProviderReconnect.test.tsxindex 393048dbd0f..a900e091c6d 100644--- a/packages/twenty-front/src/modules/settings/accounts/hooks/__tests__/useTriggerProviderReconnect.test.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/hooks/__tests__/useTriggerProviderReconnect.test.tsx@@ -2,8 +2,7 @@ import { act, renderHook } from '@testing-library/react';import { type ReactNode } from 'react';import { RecoilRoot } from 'recoil';-import { SettingsPath } from '@/types/SettingsPath';-import { ConnectedAccountProvider } from 'twenty-shared/types';+import { ConnectedAccountProvider, SettingsPath } from 'twenty-shared/types';import {CalendarChannelVisibility,MessageChannelVisibility,diff --git a/packages/twenty-front/src/modules/settings/accounts/hooks/useImapSmtpCaldavConnectionForm.ts b/packages/twenty-front/src/modules/settings/accounts/hooks/useImapSmtpCaldavConnectionForm.tsindex d53c3bfb121..59ceb831948 100644--- a/packages/twenty-front/src/modules/settings/accounts/hooks/useImapSmtpCaldavConnectionForm.ts+++ b/packages/twenty-front/src/modules/settings/accounts/hooks/useImapSmtpCaldavConnectionForm.ts@@ -6,8 +6,8 @@ import { useRecoilValue } from 'recoil';import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';-import { SettingsPath } from '@/types/SettingsPath';import { t } from '@lingui/core/macro';+import { SettingsPath } from 'twenty-shared/types';import {type ConnectionParameters,useSaveImapSmtpCaldavAccountMutation,diff --git a/packages/twenty-front/src/modules/settings/accounts/hooks/useTriggerApiOAuth.ts b/packages/twenty-front/src/modules/settings/accounts/hooks/useTriggerApiOAuth.tsindex 7959d7a61a7..bd505adfa04 100644--- a/packages/twenty-front/src/modules/settings/accounts/hooks/useTriggerApiOAuth.ts+++ b/packages/twenty-front/src/modules/settings/accounts/hooks/useTriggerApiOAuth.ts@@ -1,9 +1,8 @@-import { type AppPath } from '@/types/AppPath';import { useCallback } from 'react';+import { type AppPath, ConnectedAccountProvider } from 'twenty-shared/types';import { useRedirect } from '@/domain-manager/hooks/useRedirect';import { CustomError } from '@/error-handler/CustomError';-import { ConnectedAccountProvider } from 'twenty-shared/types';import { REACT_APP_SERVER_BASE_URL } from '~/config';import {type CalendarChannelVisibility,diff --git a/packages/twenty-front/src/modules/settings/accounts/hooks/useTriggerProviderReconnect.ts b/packages/twenty-front/src/modules/settings/accounts/hooks/useTriggerProviderReconnect.tsindex e4297ad2cf2..7d87fdde17a 100644--- a/packages/twenty-front/src/modules/settings/accounts/hooks/useTriggerProviderReconnect.ts+++ b/packages/twenty-front/src/modules/settings/accounts/hooks/useTriggerProviderReconnect.ts@@ -1,8 +1,7 @@import { useCallback } from 'react';-import { ConnectedAccountProvider } from 'twenty-shared/types';+import { ConnectedAccountProvider, SettingsPath } from 'twenty-shared/types';import { useTriggerApisOAuth } from '@/settings/accounts/hooks/useTriggerApiOAuth';-import { SettingsPath } from '@/types/SettingsPath';import { useNavigateSettings } from '~/hooks/useNavigateSettings';export const useTriggerProviderReconnect = () => {diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesRow.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesRow.tsxindex aac9097b357..4b6ef6cbb49 100644--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesRow.tsx+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesRow.tsx@@ -1,11 +1,11 @@-import { SettingsPath } from '@/types/SettingsPath';import { TableCell } from '@/ui/layout/table/components/TableCell';import { TableRow } from '@/ui/layout/table/components/TableRow';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconChevronRight } from 'twenty-ui/display';import { type ConfigVariable } from '~/generated/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';type SettingsAdminConfigVariablesRowProps = {variable: ConfigVariable;diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsHealthStatusListCard.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsHealthStatusListCard.tsxindex 25bc53841cb..a4c429c8102 100644--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsHealthStatusListCard.tsx+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsHealthStatusListCard.tsx@@ -1,6 +1,7 @@import { SettingsListCard } from '@/settings/components/SettingsListCard';-import { SettingsPath } from '@/types/SettingsPath';import { useTheme } from '@emotion/react';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import {IconAppWindow,type IconComponent,@@ -13,7 +14,7 @@ import {HealthIndicatorId,type SystemHealthService,} from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsAdminHealthStatusRightContainer } from './SettingsAdminHealthStatusRightContainer';const HealthStatusIcons: { [k in HealthIndicatorId]: IconComponent } = {diff --git a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useImpersonationRedirect.ts b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useImpersonationRedirect.tsindex 5ecbdfcc216..97d102281d4 100644--- a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useImpersonationRedirect.ts+++ b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useImpersonationRedirect.ts@@ -1,5 +1,5 @@import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';import { type WorkspaceUrls } from '~/generated/graphql';import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';diff --git a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItem.tsx b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItem.tsxindex 45a85910009..d73bbbb6322 100644--- a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItem.tsx+++ b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItem.tsx@@ -4,8 +4,7 @@ import { AdvancedSettingsWrapper } from '@/settings/components/AdvancedSettingsWimport { type SettingsNavigationItem } from '@/settings/hooks/useSettingsNavigationItems';import { NavigationDrawerItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';import { type NavigationDrawerSubItemState } from '@/ui/navigation/navigation-drawer/types/NavigationDrawerSubItemState';-import { isDefined } from 'twenty-shared/utils';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';type SettingsNavigationDrawerItemProps = {item: SettingsNavigationItem;diff --git a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsxindex 68704250efd..5f36df32230 100644--- a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx+++ b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx@@ -10,7 +10,7 @@ import { NavigationDrawerSection } from '@/ui/navigation/navigation-drawer/compoimport { NavigationDrawerSectionTitle } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle';import { getNavigationSubItemLeftAdornment } from '@/ui/navigation/navigation-drawer/utils/getNavigationSubItemLeftAdornment';import { matchPath, resolvePath, useLocation } from 'react-router-dom';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { getSettingsPath } from 'twenty-shared/utils';export const SettingsNavigationDrawerItems = () => {const settingsNavigationItems: SettingsNavigationSection[] =diff --git a/packages/twenty-front/src/modules/settings/components/SettingsPageContainer.tsx b/packages/twenty-front/src/modules/settings/components/SettingsPageContainer.tsxindex 077b899d170..795ebb12306 100644--- a/packages/twenty-front/src/modules/settings/components/SettingsPageContainer.tsx+++ b/packages/twenty-front/src/modules/settings/components/SettingsPageContainer.tsx@@ -1,13 +1,12 @@import { OBJECT_SETTINGS_WIDTH } from '@/settings/data-model/constants/ObjectSettings';-import { SettingsPath } from '@/types/SettingsPath';import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';import { useScrollRestoration } from '@/ui/utilities/scroll/hooks/useScrollRestoration';import styled from '@emotion/styled';import { type ReactNode, useMemo } from 'react';import { matchPath, useLocation } from 'react-router-dom';-import { isDefined } from 'twenty-shared/utils';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';const StyledSettingsPageContainer = styled.div<{width?: number;diff --git a/packages/twenty-front/src/modules/settings/components/SettingsProtectedRouteWrapper.tsx b/packages/twenty-front/src/modules/settings/components/SettingsProtectedRouteWrapper.tsxindex 94cf268d300..dead3f27403 100644--- a/packages/twenty-front/src/modules/settings/components/SettingsProtectedRouteWrapper.tsx+++ b/packages/twenty-front/src/modules/settings/components/SettingsProtectedRouteWrapper.tsx@@ -1,14 +1,14 @@import { useIsLogged } from '@/auth/hooks/useIsLogged';import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';-import { SettingsPath } from '@/types/SettingsPath';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { type ReactNode } from 'react';import { Navigate, Outlet } from 'react-router-dom';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import {type FeatureFlagKey,type PermissionFlagType,} from '~/generated/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';type SettingsProtectedRouteWrapperProps = {children?: ReactNode;diff --git a/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx b/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsxindex 692ad5a3eff..b27897c33a1 100644--- a/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx@@ -1,5 +1,4 @@import { type SettingsFieldType } from '@/settings/data-model/types/SettingsFieldType';-import { SettingsPath } from '@/types/SettingsPath';import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';@@ -8,6 +7,7 @@ import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { t } from '@lingui/core/macro';import { useLocation, useParams, useSearchParams } from 'react-router-dom';+import { SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { IconChevronDown } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsxindex 355910c48f0..bae7cb6e0e1 100644--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx@@ -9,7 +9,6 @@ import { useCurrencySettingsFormInitialValues } from '@/settings/data-model/fielimport { useSelectSettingsFormInitialValues } from '@/settings/data-model/fields/forms/select/hooks/useSelectSettingsFormInitialValues';import { type FieldType } from '@/settings/data-model/types/FieldType';import { type SettingsFieldType } from '@/settings/data-model/types/SettingsFieldType';-import { SettingsPath } from '@/types/SettingsPath';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { useTheme } from '@emotion/react';@@ -18,12 +17,13 @@ import { t } from '@lingui/core/macro';import { Section } from '@react-email/components';import { useState } from 'react';import { Controller, useFormContext } from 'react-hook-form';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title, IconSearch } from 'twenty-ui/display';import { UndecoratedLink } from 'twenty-ui/navigation';import { FieldMetadataType } from '~/generated-metadata/graphql';import { FeatureFlagKey } from '~/generated/graphql';import { type SettingsDataModelFieldTypeFormValues } from '~/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';type SettingsObjectNewFieldSelectorProps = {className?: string;diff --git a/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx b/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsxindex dc5b2d39ad2..24b463d70a7 100644--- a/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx@@ -20,8 +20,8 @@ import {useReactFlow,} from '@xyflow/react';import { useCallback, useState } from 'react';-import { isDefined } from 'twenty-shared/utils';-import { Button, IconButtonGroup } from 'twenty-ui/input';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import {IconLock,IconLockOpen,@@ -30,6 +30,7 @@ import {IconPlus,IconX,} from 'twenty-ui/display';+import { Button, IconButtonGroup } from 'twenty-ui/input';const nodeTypes: NodeTypes = {object: SettingsDataModelOverviewObject,@@ -184,7 +185,10 @@ export const SettingsDataModelOverview = () => {return (<StyledContainer><StyledCloseButton>- <Button Icon={IconX} to="/settings/objects"></Button>+ <Button+ Icon={IconX}+ to={getSettingsPath(SettingsPath.Objects)}+ ></Button></StyledCloseButton><SettingsDataModelOverviewEffectsetEdges={setEdges}diff --git a/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewObject.tsx b/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewObject.tsxindex dd0192ca2b4..b39cc71bb95 100644--- a/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewObject.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewObject.tsx@@ -11,11 +11,11 @@ import { getObjectTypeLabel } from '@/settings/data-model/utils/getObjectTypeLabimport { FieldMetadataType } from '~/generated-metadata/graphql';import { ObjectFieldRowWithoutRelation } from '@/settings/data-model/graph-overview/components/SettingsDataModelOverviewFieldWithoutRelation';-import { SettingsPath } from '@/types/SettingsPath';import '@xyflow/react/dist/style.css';import { useState } from 'react';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconChevronDown, IconChevronUp, useIcons } from 'twenty-ui/display';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';type SettingsDataModelOverviewObjectNode = Node<ObjectMetadataItem, 'object'>;type SettingsDataModelOverviewObjectProps =diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsxindex 3e2bd584a83..d948813077c 100644--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx@@ -8,7 +8,6 @@ import { SettingsObjectFieldActiveActionDropdown } from '@/settings/data-model/oimport { SettingsObjectFieldInactiveActionDropdown } from '@/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown';import { settingsObjectFieldsFamilyState } from '@/settings/data-model/object-details/states/settingsObjectFieldsFamilyState';import { isFieldTypeSupportedInSettings } from '@/settings/data-model/utils/isFieldTypeSupportedInSettings';-import { SettingsPath } from '@/types/SettingsPath';import { TableCell } from '@/ui/layout/table/components/TableCell';import { TableRow } from '@/ui/layout/table/components/TableRow';import { navigationMemorizedUrlState } from '@/ui/navigation/states/navigationMemorizedUrlState';@@ -16,7 +15,9 @@ import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { useMemo } from 'react';import { useRecoilState } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';import {+ getSettingsPath,isDefined,isLabelIdentifierFieldMetadataTypes,} from 'twenty-shared/utils';@@ -26,7 +27,7 @@ import { UndecoratedLink } from 'twenty-ui/navigation';import { RelationType } from '~/generated-metadata/graphql';import { useNavigateSettings } from '~/hooks/useNavigateSettings';import { type SettingsObjectDetailTableItem } from '~/pages/settings/data-model/types/SettingsObjectDetailTableItem';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { RELATION_TYPES } from '../../constants/RelationTypes';import { SettingsObjectFieldDataType } from './SettingsObjectFieldDataType';diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsUpdateDataModelObjectAboutForm.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsUpdateDataModelObjectAboutForm.tsxindex 720a21d7fa5..0d2ce4fdc8f 100644--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsUpdateDataModelObjectAboutForm.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsUpdateDataModelObjectAboutForm.tsx@@ -5,12 +5,12 @@ import {type SettingsDataModelObjectAboutFormValues,settingsDataModelObjectAboutFormSchema,} from '@/settings/data-model/validation-schemas/settingsDataModelObjectAboutFormSchema';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { ApolloError } from '@apollo/client';import { zodResolver } from '@hookform/resolvers/zod';import { FormProvider, useForm } from 'react-hook-form';import { useSetRecoilState } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';import { ZodError } from 'zod';import { useNavigateSettings } from '~/hooks/useNavigateSettings';import { updatedObjectNamePluralState } from '~/pages/settings/data-model/states/updatedObjectNamePluralState';diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectFields.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectFields.tsxindex 4c6ff3f0293..08870d5e029 100644--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectFields.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectFields.tsx@@ -1,7 +1,7 @@import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { SettingsObjectFieldTable } from '~/pages/settings/data-model/SettingsObjectFieldTable';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectSettings.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectSettings.tsxindex e659fc031a2..b1faab31589 100644--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectSettings.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectSettings.tsx@@ -3,9 +3,9 @@ import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataIimport { useUpdateOneObjectMetadataItem } from '@/object-metadata/hooks/useUpdateOneObjectMetadataItem';import { SettingsUpdateDataModelObjectAboutForm } from '@/settings/data-model/object-details/components/SettingsUpdateDataModelObjectAboutForm';import { SettingsDataModelObjectSettingsFormCard } from '@/settings/data-model/objects/forms/components/SettingsDataModelObjectSettingsFormCard';-import { SettingsPath } from '@/types/SettingsPath';import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';+import { SettingsPath } from 'twenty-shared/types';import { H2Title, IconArchive } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectCoverImage.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectCoverImage.tsxindex 4f431df0158..a2891d4566e 100644--- a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectCoverImage.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectCoverImage.tsx@@ -1,11 +1,12 @@import styled from '@emotion/styled';-import { SettingsPath } from '@/types/SettingsPath';import { useLingui } from '@lingui/react/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconEye } from 'twenty-ui/display';import { FloatingButton } from 'twenty-ui/input';import { Card } from 'twenty-ui/layout';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import DarkCoverImage from '../../assets/cover-dark.png';import LightCoverImage from '../../assets/cover-light.png';diff --git a/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysTable.tsx b/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysTable.tsxindex bd6b3003dae..8bdeddd9648 100644--- a/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysTable.tsx+++ b/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysTable.tsx@@ -1,5 +1,4 @@import { SettingsApiKeysFieldItemTableRow } from '@/settings/developers/components/SettingsApiKeysFieldItemTableRow';-import { SettingsPath } from '@/types/SettingsPath';import { Table } from '@/ui/layout/table/components/Table';import { TableBody } from '@/ui/layout/table/components/TableBody';import { TableHeader } from '@/ui/layout/table/components/TableHeader';@@ -7,11 +6,12 @@ import { TableRow } from '@/ui/layout/table/components/TableRow';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import styled from '@emotion/styled';import { Trans } from '@lingui/react/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import {FeatureFlagKey,useGetApiKeysQuery,} from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledTableBody = styled(TableBody)`border-bottom: 1px solid ${({ theme }) => theme.border.color.light};diff --git a/packages/twenty-front/src/modules/settings/developers/components/SettingsDevelopersWebhookForm.tsx b/packages/twenty-front/src/modules/settings/developers/components/SettingsDevelopersWebhookForm.tsxindex b1ef94c7d93..ddb49b160e3 100644--- a/packages/twenty-front/src/modules/settings/developers/components/SettingsDevelopersWebhookForm.tsx+++ b/packages/twenty-front/src/modules/settings/developers/components/SettingsDevelopersWebhookForm.tsx@@ -6,7 +6,6 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContainimport { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';import { type WebhookFormMode } from '@/settings/developers/constants/WebhookFormMode';import { useWebhookForm } from '@/settings/developers/hooks/useWebhookForm';-import { SettingsPath } from '@/types/SettingsPath';import { Select } from '@/ui/input/components/Select';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import { TextArea } from '@/ui/input/components/TextArea';@@ -16,7 +15,9 @@ import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBaimport { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';import styled from '@emotion/styled';import { Trans, useLingui } from '@lingui/react/macro';+import { SettingsPath } from 'twenty-shared/types';import {+ getSettingsPath,getUrlHostnameOrThrow,isDefined,isValidUrl,@@ -32,7 +33,6 @@ import {import { Button, IconButton, type SelectOption } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const OBJECT_DROPDOWN_WIDTH = 340;const ACTION_DROPDOWN_WIDTH = 140;diff --git a/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx b/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsxindex 5d519a96efb..a5e255f520c 100644--- a/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx+++ b/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx@@ -1,13 +1,13 @@import styled from '@emotion/styled';import { SettingsDevelopersWebhookTableRow } from '@/settings/developers/components/SettingsDevelopersWebhookTableRow';-import { SettingsPath } from '@/types/SettingsPath';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 { TableRow } from '@/ui/layout/table/components/TableRow';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { useGetWebhooksQuery } from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledTableBody = styled(TableBody)`border-bottom: 1px solid ${({ theme }) => theme.border.color.light};diff --git a/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts b/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.tsindex 46d1242d6d8..42ab13453a6 100644--- a/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts+++ b/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts@@ -12,10 +12,10 @@ import {webhookFormSchema,type WebhookFormValues,} from '@/settings/developers/validation-schemas/webhookFormSchema';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { ApolloError } from '@apollo/client';import { t } from '@lingui/core/macro';+import { SettingsPath } from 'twenty-shared/types';import {useCreateWebhookMutation,useDeleteWebhookMutation,diff --git a/packages/twenty-front/src/modules/settings/domains/components/SettingsWorkspaceDomainCard.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingsWorkspaceDomainCard.tsxindex f2e7d6494f7..e1870620ff7 100644--- a/packages/twenty-front/src/modules/settings/domains/components/SettingsWorkspaceDomainCard.tsx+++ b/packages/twenty-front/src/modules/settings/domains/components/SettingsWorkspaceDomainCard.tsx@@ -1,12 +1,12 @@import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';import { isMultiWorkspaceEnabledState } from '@/client-config/states/isMultiWorkspaceEnabledState';import { SettingsCard } from '@/settings/components/SettingsCard';-import { SettingsPath } from '@/types/SettingsPath';import { useLingui } from '@lingui/react/macro';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconWorld, Status } from 'twenty-ui/display';import { UndecoratedLink } from 'twenty-ui/navigation';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsWorkspaceDomainCard = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx b/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsxindex abd89f7436e..90418d8ddc0 100644--- a/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx+++ b/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx@@ -1,4 +1,4 @@-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';import { useAuth } from '@/auth/hooks/useAuth';import { currentUserState } from '@/auth/states/currentUserState';diff --git a/packages/twenty-front/src/modules/settings/integrations/constants/SettingsIntegrationMcp.ts b/packages/twenty-front/src/modules/settings/integrations/constants/SettingsIntegrationMcp.tsindex 72b83b77d31..44b8e52ea4a 100644--- a/packages/twenty-front/src/modules/settings/integrations/constants/SettingsIntegrationMcp.ts+++ b/packages/twenty-front/src/modules/settings/integrations/constants/SettingsIntegrationMcp.ts@@ -1,4 +1,6 @@import { type SettingsIntegrationCategory } from '@/settings/integrations/types/SettingsIntegrationCategory';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';export const SETTINGS_INTEGRATION_AI_CATEGORY: SettingsIntegrationCategory = {key: 'ai',@@ -12,7 +14,7 @@ export const SETTINGS_INTEGRATION_AI_CATEGORY: SettingsIntegrationCategory = {},type: 'Add',text: 'Connect MCP Client',- link: '/settings/integrations/mcp',+ link: getSettingsPath(SettingsPath.IntegrationMCP),},],};diff --git a/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionShowContainer.tsx b/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionShowContainer.tsxindex ce7bc776c7f..3c262fd125a 100644--- a/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionShowContainer.tsx+++ b/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionShowContainer.tsx@@ -2,12 +2,12 @@ import { useDeleteOneDatabaseConnection } from '@/databases/hooks/useDeleteOneDaimport { SettingsIntegrationDatabaseConnectionSummaryCard } from '@/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionSummaryCard';import { SettingsIntegrationDatabaseTablesListCard } from '@/settings/integrations/database-connection/components/SettingsIntegrationDatabaseTablesListCard';import { useDatabaseConnection } from '@/settings/integrations/database-connection/hooks/useDatabaseConnection';-import { SettingsPath } from '@/types/SettingsPath';import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';import { Section } from '@react-email/components';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsIntegrationDatabaseConnectionShowContainer = () => {const navigate = useNavigateSettings();diff --git a/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionsListCard.tsx b/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionsListCard.tsxindex ecf772313b6..1968ec42886 100644--- a/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionsListCard.tsx+++ b/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionsListCard.tsx@@ -3,11 +3,11 @@ import styled from '@emotion/styled';import { SettingsListCard } from '@/settings/components/SettingsListCard';import { SettingsIntegrationDatabaseConnectionSyncStatus } from '@/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionSyncStatus';import { type SettingsIntegration } from '@/settings/integrations/types/SettingsIntegration';-import { SettingsPath } from '@/types/SettingsPath';-import { type RemoteServer } from '~/generated-metadata/graphql';-import { useNavigateSettings } from '~/hooks/useNavigateSettings';+import { SettingsPath } from 'twenty-shared/types';import { IconChevronRight } from 'twenty-ui/display';import { LightIconButton } from 'twenty-ui/input';+import { type RemoteServer } from '~/generated-metadata/graphql';+import { useNavigateSettings } from '~/hooks/useNavigateSettings';type SettingsIntegrationDatabaseConnectionsListCardProps = {integration: SettingsIntegration;diff --git a/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationEditDatabaseConnectionContent.tsx b/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationEditDatabaseConnectionContent.tsxindex 1e3195cd5ae..7b1513cc0a3 100644--- a/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationEditDatabaseConnectionContent.tsx+++ b/packages/twenty-front/src/modules/settings/integrations/database-connection/components/SettingsIntegrationEditDatabaseConnectionContent.tsx@@ -8,7 +8,6 @@ import {getFormDefaultValuesFromConnection,} from '@/settings/integrations/database-connection/utils/editDatabaseConnection';import { type SettingsIntegration } from '@/settings/integrations/types/SettingsIntegration';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';import { ApolloError } from '@apollo/client';@@ -17,6 +16,8 @@ import { useLingui } from '@lingui/react/macro';import { Section } from '@react-email/components';import pick from 'lodash.pick';import { FormProvider, useForm } from 'react-hook-form';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title, Info } from 'twenty-ui/display';import { type z } from 'zod';import {@@ -25,7 +26,6 @@ import {RemoteTableStatus,} from '~/generated-metadata/graphql';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsIntegrationEditDatabaseConnectionContent = ({connection,diff --git a/packages/twenty-front/src/modules/settings/integrations/database-connection/hooks/useDatabaseConnection.ts b/packages/twenty-front/src/modules/settings/integrations/database-connection/hooks/useDatabaseConnection.tsindex 3bcb7ccadb7..33245605125 100644--- a/packages/twenty-front/src/modules/settings/integrations/database-connection/hooks/useDatabaseConnection.ts+++ b/packages/twenty-front/src/modules/settings/integrations/database-connection/hooks/useDatabaseConnection.ts@@ -6,7 +6,7 @@ import { useGetDatabaseConnection } from '@/databases/hooks/useGetDatabaseConnecimport { useGetDatabaseConnectionTables } from '@/databases/hooks/useGetDatabaseConnectionTables';import { useIsSettingsIntegrationEnabled } from '@/settings/integrations/hooks/useIsSettingsIntegrationEnabled';import { useSettingsIntegrationCategories } from '@/settings/integrations/hooks/useSettingsIntegrationCategories';-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';import { useNavigateApp } from '~/hooks/useNavigateApp';export const useDatabaseConnection = ({diff --git a/packages/twenty-front/src/modules/settings/integrations/utils/getSettingsIntegrationAll.ts b/packages/twenty-front/src/modules/settings/integrations/utils/getSettingsIntegrationAll.tsindex 3d981bd0a96..b0c607b823b 100644--- a/packages/twenty-front/src/modules/settings/integrations/utils/getSettingsIntegrationAll.ts+++ b/packages/twenty-front/src/modules/settings/integrations/utils/getSettingsIntegrationAll.ts@@ -1,5 +1,7 @@import { type SettingsIntegration } from '@/settings/integrations/types/SettingsIntegration';import { type SettingsIntegrationCategory } from '@/settings/integrations/types/SettingsIntegrationCategory';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';export const getSettingsIntegrationAll = ({isAirtableIntegrationEnabled,@@ -26,7 +28,9 @@ export const getSettingsIntegrationAll = ({},type: isAirtableIntegrationActive ? 'Active' : 'Add',text: 'Airtable',- link: '/settings/integrations/airtable',+ link: getSettingsPath(SettingsPath.IntegrationDatabase, {+ databaseKey: 'airtable',+ }),},isPostgresqlIntegrationEnabled && {from: {@@ -35,7 +39,9 @@ export const getSettingsIntegrationAll = ({},type: isPostgresqlIntegrationActive ? 'Active' : 'Add',text: 'PostgreSQL',- link: '/settings/integrations/postgresql',+ link: getSettingsPath(SettingsPath.IntegrationDatabase, {+ databaseKey: 'postgresql',+ }),},isStripeIntegrationEnabled && {from: {@@ -44,7 +50,9 @@ export const getSettingsIntegrationAll = ({},type: isStripeIntegrationActive ? 'Active' : 'Add',text: 'Stripe',- link: '/settings/integrations/stripe',+ link: getSettingsPath(SettingsPath.IntegrationDatabase, {+ databaseKey: 'stripe',+ }),},].filter(Boolean) as SettingsIntegration[],});diff --git a/packages/twenty-front/src/modules/settings/page-layout/components/GraphWidgetRenderer.tsx b/packages/twenty-front/src/modules/settings/page-layout/components/GraphWidgetRenderer.tsxnew file mode 100644index 00000000000..eaa2215958c--- /dev/null+++ b/packages/twenty-front/src/modules/settings/page-layout/components/GraphWidgetRenderer.tsx@@ -0,0 +1,75 @@+import { GraphWidgetBarChart } from '@/dashboards/widgets/graph/components/GraphWidgetBarChart';+import { GraphWidgetGaugeChart } from '@/dashboards/widgets/graph/components/GraphWidgetGaugeChart';+import { GraphWidgetNumberChart } from '@/dashboards/widgets/graph/components/GraphWidgetNumberChart';+import { GraphWidgetPieChart } from '@/dashboards/widgets/graph/components/GraphWidgetPieChart';+import { GraphType } from '../mocks/mockWidgets';+import { type PageLayoutWidget } from '../states/savedPageLayoutsState';++type GraphWidgetRendererProps = {+ widget: PageLayoutWidget;+};++export const GraphWidgetRenderer = ({ widget }: GraphWidgetRendererProps) => {+ const graphType = widget.configuration?.graphType;++ if (!graphType || typeof graphType !== 'string') {+ return null;+ }++ if (!Object.values(GraphType).includes(graphType as GraphType)) {+ return null;+ }++ switch (graphType as GraphType) {+ case GraphType.NUMBER:+ return (+ <GraphWidgetNumberChart+ value={widget.data.value}+ trendPercentage={widget.data.trendPercentage}+ />+ );++ case GraphType.GAUGE:+ return (+ <GraphWidgetGaugeChart+ data={{+ value: widget.data.value,+ min: widget.data.min,+ max: widget.data.max,+ label: widget.data.label,+ }}+ displayType="percentage"+ showValue+ id={`gauge-chart-${widget.id}`}+ />+ );++ case GraphType.PIE:+ return (+ <GraphWidgetPieChart+ data={widget.data.items}+ showLegend+ displayType="percentage"+ id={`pie-chart-${widget.id}`}+ />+ );++ case GraphType.BAR:+ return (+ <GraphWidgetBarChart+ data={widget.data.items}+ indexBy={widget.data.indexBy}+ keys={widget.data.keys}+ seriesLabels={widget.data.seriesLabels}+ layout={widget.data.layout}+ showLegend+ showGrid+ displayType="number"+ id={`bar-chart-${widget.id}`}+ />+ );++ default:+ return null;+ }+};diff --git a/packages/twenty-front/src/modules/settings/page-layout/components/PageLayoutInitializationEffect.tsx b/packages/twenty-front/src/modules/settings/page-layout/components/PageLayoutInitializationEffect.tsxindex 9b1b2003eda..e334a2ab084 100644--- a/packages/twenty-front/src/modules/settings/page-layout/components/PageLayoutInitializationEffect.tsx+++ b/packages/twenty-front/src/modules/settings/page-layout/components/PageLayoutInitializationEffect.tsx@@ -42,7 +42,6 @@ export const PageLayoutInitializationEffect = ({set(pageLayoutDraftState, {name: layout.name,type: layout.type,- workspaceId: layout.workspaceId,objectMetadataId: layout.objectMetadataId,tabs: layout.tabs,});@@ -82,7 +81,6 @@ export const PageLayoutInitializationEffect = ({set(pageLayoutDraftState, {name: '',type: PageLayoutType.DASHBOARD,- workspaceId: undefined,objectMetadataId: null,tabs: [defaultTab],});diff --git a/packages/twenty-front/src/modules/settings/page-layout/utils/widgetRegistry.tsx b/packages/twenty-front/src/modules/settings/page-layout/components/WidgetRenderer.tsxsimilarity index 71%rename from packages/twenty-front/src/modules/settings/page-layout/utils/widgetRegistry.tsxrename to packages/twenty-front/src/modules/settings/page-layout/components/WidgetRenderer.tsxindex 9adb4324e92..1eb0fedaa08 100644--- a/packages/twenty-front/src/modules/settings/page-layout/utils/widgetRegistry.tsx+++ b/packages/twenty-front/src/modules/settings/page-layout/components/WidgetRenderer.tsx@@ -1,14 +1,17 @@import { IframeWidget } from '@/dashboards/widgets/iframe/components/IframeWidget';import { isString } from '@sniptt/guards';-import { type ReactNode } from 'react';import { WidgetType } from '../mocks/mockWidgets';import { type PageLayoutWidget } from '../states/savedPageLayoutsState';-import { renderGraphWidget } from './graphRegistry';+import { GraphWidgetRenderer } from './GraphWidgetRenderer';-export const renderWidget = (widget: PageLayoutWidget): ReactNode => {+type WidgetRendererProps = {+ widget: PageLayoutWidget;+};++export const WidgetRenderer = ({ widget }: WidgetRendererProps) => {switch (widget.type) {case WidgetType.GRAPH:- return renderGraphWidget(widget);+ return <GraphWidgetRenderer widget={widget} />;case WidgetType.IFRAME: {const url = widget.configuration?.url;diff --git a/packages/twenty-front/src/modules/settings/page-layout/constants/SettingsPageLayoutTabsInstanceId.ts b/packages/twenty-front/src/modules/settings/page-layout/constants/SettingsPageLayoutTabsInstanceId.tsnew file mode 100644index 00000000000..92044d62dee--- /dev/null+++ b/packages/twenty-front/src/modules/settings/page-layout/constants/SettingsPageLayoutTabsInstanceId.ts@@ -0,0 +1,2 @@+export const SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID =+ 'settings-page-layout-tabs';diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useChangePageLayoutDragSelection.test.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useChangePageLayoutDragSelection.test.tsnew file mode 100644index 00000000000..3914c73aed0--- /dev/null+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useChangePageLayoutDragSelection.test.ts@@ -0,0 +1,139 @@+import { act, renderHook } from '@testing-library/react';+import { type ReactNode } from 'react';+import { RecoilRoot, useRecoilValue } from 'recoil';+import { pageLayoutSelectedCellsState } from '../../states/pageLayoutSelectedCellsState';+import { useChangePageLayoutDragSelection } from '../useChangePageLayoutDragSelection';++describe('useChangePageLayoutDragSelection', () => {+ it('should add cell to selection when selected is true', () => {+ const { result } = renderHook(+ () => ({+ changeDragSelection: useChangePageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ }),+ {+ wrapper: ({ children }: { children: ReactNode }) =>+ RecoilRoot({+ initializeState: ({ set }) => {+ set(pageLayoutSelectedCellsState, new Set(['cell-1']));+ },+ children,+ }),+ },+ );++ expect(result.current.selectedCells.size).toBe(1);+ expect(result.current.selectedCells.has('cell-2')).toBe(false);++ act(() => {+ result.current.changeDragSelection.changePageLayoutDragSelection(+ 'cell-2',+ true,+ );+ });++ expect(result.current.selectedCells.size).toBe(2);+ expect(result.current.selectedCells.has('cell-1')).toBe(true);+ expect(result.current.selectedCells.has('cell-2')).toBe(true);+ });++ it('should remove cell from selection when selected is false', () => {+ const { result } = renderHook(+ () => ({+ changeDragSelection: useChangePageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ }),+ {+ wrapper: ({ children }: { children: ReactNode }) =>+ RecoilRoot({+ initializeState: ({ set }) => {+ set(pageLayoutSelectedCellsState, new Set(['cell-1', 'cell-2']));+ },+ children,+ }),+ },+ );++ expect(result.current.selectedCells.size).toBe(2);+ expect(result.current.selectedCells.has('cell-2')).toBe(true);++ act(() => {+ result.current.changeDragSelection.changePageLayoutDragSelection(+ 'cell-2',+ false,+ );+ });++ expect(result.current.selectedCells.size).toBe(1);+ expect(result.current.selectedCells.has('cell-1')).toBe(true);+ expect(result.current.selectedCells.has('cell-2')).toBe(false);+ });++ it('should handle adding same cell multiple times', () => {+ const { result } = renderHook(+ () => ({+ changeDragSelection: useChangePageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ }),+ {+ wrapper: RecoilRoot,+ },+ );++ act(() => {+ result.current.changeDragSelection.changePageLayoutDragSelection(+ 'cell-1',+ true,+ );+ });+ expect(result.current.selectedCells.size).toBe(1);++ act(() => {+ result.current.changeDragSelection.changePageLayoutDragSelection(+ 'cell-1',+ true,+ );+ });+ expect(result.current.selectedCells.size).toBe(1);+ });++ it('should handle removing non-existent cell', () => {+ const { result } = renderHook(+ () => ({+ changeDragSelection: useChangePageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ }),+ {+ wrapper: ({ children }: { children: ReactNode }) =>+ RecoilRoot({+ initializeState: ({ set }) => {+ set(pageLayoutSelectedCellsState, new Set(['cell-1']));+ },+ children,+ }),+ },+ );++ expect(result.current.selectedCells.size).toBe(1);++ act(() => {+ result.current.changeDragSelection.changePageLayoutDragSelection(+ 'cell-99',+ false,+ );+ });++ expect(result.current.selectedCells.size).toBe(1);+ expect(result.current.selectedCells.has('cell-1')).toBe(true);+ });++ it('should return a function', () => {+ const { result } = renderHook(() => useChangePageLayoutDragSelection(), {+ wrapper: RecoilRoot,+ });++ expect(typeof result.current.changePageLayoutDragSelection).toBe(+ 'function',+ );+ });+});diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutTabCreate.test.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useCreatePageLayoutTab.test.tssimilarity index 83%rename from packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutTabCreate.test.tsrename to packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useCreatePageLayoutTab.test.tsindex de03664e2bd..7c938be7cc1 100644--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutTabCreate.test.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useCreatePageLayoutTab.test.ts@@ -2,13 +2,13 @@ import { pageLayoutCurrentLayoutsState } from '@/settings/page-layout/states/pagimport { pageLayoutDraftState } from '@/settings/page-layout/states/pageLayoutDraftState';import { act, renderHook } from '@testing-library/react';import { RecoilRoot, useRecoilValue } from 'recoil';-import { usePageLayoutTabCreate } from '../usePageLayoutTabCreate';+import { useCreatePageLayoutTab } from '../useCreatePageLayoutTab';jest.mock('uuid', () => ({v4: jest.fn(),}));-describe('usePageLayoutTabCreate', () => {+describe('useCreatePageLayoutTab', () => {beforeEach(() => {jest.clearAllMocks();});@@ -18,7 +18,7 @@ describe('usePageLayoutTabCreate', () => {uuidModule.v4.mockReturnValue('mock-uuid');const { result } = renderHook(() => ({- createTab: usePageLayoutTabCreate(),+ createTab: useCreatePageLayoutTab(),pageLayoutCurrentLayouts: useRecoilValue(pageLayoutCurrentLayoutsState),pageLayoutDraft: useRecoilValue(pageLayoutDraftState),}),@@ -29,7 +29,7 @@ describe('usePageLayoutTabCreate', () => {let newTabId: string;act(() => {- newTabId = result.current.createTab.handleCreateTab();+ newTabId = result.current.createTab.createPageLayoutTab();});expect(result.current.pageLayoutDraft.tabs[0].id).toBe('tab-mock-uuid');@@ -50,7 +50,7 @@ describe('usePageLayoutTabCreate', () => {uuidModule.v4.mockReturnValue('mock-uuid');const { result } = renderHook(() => ({- createTab: usePageLayoutTabCreate(),+ createTab: useCreatePageLayoutTab(),pageLayoutDraft: useRecoilValue(pageLayoutDraftState),}),{@@ -59,7 +59,7 @@ describe('usePageLayoutTabCreate', () => {);act(() => {- result.current.createTab.handleCreateTab('Custom Tab Name');+ result.current.createTab.createPageLayoutTab('Custom Tab Name');});expect(result.current.pageLayoutDraft.tabs[0].title).toBe(@@ -74,7 +74,7 @@ describe('usePageLayoutTabCreate', () => {.mockReturnValueOnce('mock-uuid-2');const { result } = renderHook(() => ({- createTab: usePageLayoutTabCreate(),+ createTab: useCreatePageLayoutTab(),pageLayoutDraft: useRecoilValue(pageLayoutDraftState),}),{@@ -83,11 +83,11 @@ describe('usePageLayoutTabCreate', () => {);act(() => {- result.current.createTab.handleCreateTab();+ result.current.createTab.createPageLayoutTab();});act(() => {- result.current.createTab.handleCreateTab();+ result.current.createTab.createPageLayoutTab();});expect(result.current.pageLayoutDraft.tabs).toHaveLength(2);@@ -104,7 +104,7 @@ describe('usePageLayoutTabCreate', () => {.mockReturnValueOnce('mock-uuid-2');const { result } = renderHook(() => ({- createTab: usePageLayoutTabCreate(),+ createTab: useCreatePageLayoutTab(),pageLayoutCurrentLayouts: useRecoilValue(pageLayoutCurrentLayoutsState),}),{@@ -114,12 +114,12 @@ describe('usePageLayoutTabCreate', () => {let tabId1: string = '';act(() => {- tabId1 = result.current.createTab.handleCreateTab();+ tabId1 = result.current.createTab.createPageLayoutTab();});let tabId2: string = '';act(() => {- tabId2 = result.current.createTab.handleCreateTab();+ tabId2 = result.current.createTab.createPageLayoutTab();});expect(result.current.pageLayoutCurrentLayouts[tabId1]).toEqual({diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutWidgetCreate.test.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useCreatePageLayoutWidget.test.tssimilarity index 65%rename from packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutWidgetCreate.test.tsrename to packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useCreatePageLayoutWidget.test.tsindex 836c3e3c1e2..c1098518931 100644--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutWidgetCreate.test.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useCreatePageLayoutWidget.test.ts@@ -1,20 +1,21 @@+import { SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID } from '@/settings/page-layout/constants/SettingsPageLayoutTabsInstanceId';import {- GraphSubType,+ GraphType,WidgetType,} from '@/settings/page-layout/mocks/mockWidgets';import { pageLayoutCurrentLayoutsState } from '@/settings/page-layout/states/pageLayoutCurrentLayoutsState';-import { pageLayoutCurrentTabIdForCreationState } from '@/settings/page-layout/states/pageLayoutCurrentTabIdForCreation';import { pageLayoutDraftState } from '@/settings/page-layout/states/pageLayoutDraftState';import { PageLayoutType } from '@/settings/page-layout/states/savedPageLayoutsState';+import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';import { act, renderHook } from '@testing-library/react';import { RecoilRoot, useRecoilValue, useSetRecoilState } from 'recoil';-import { usePageLayoutWidgetCreate } from '../usePageLayoutWidgetCreate';+import { useCreatePageLayoutWidget } from '../useCreatePageLayoutWidget';jest.mock('uuid', () => ({v4: jest.fn(() => 'mock-uuid'),}));-describe('usePageLayoutWidgetCreate', () => {+describe('useCreatePageLayoutWidget', () => {beforeEach(() => {jest.clearAllMocks();});@@ -23,7 +24,9 @@ describe('usePageLayoutWidgetCreate', () => {const { result } = renderHook(() => {const setActiveTabId = useSetRecoilState(- pageLayoutCurrentTabIdForCreationState,+ activeTabIdComponentState.atomFamily({+ instanceId: SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID,+ }),);const setPageLayoutDraft = useSetRecoilState(pageLayoutDraftState);const pageLayoutDraft = useRecoilValue(pageLayoutDraftState);@@ -31,7 +34,7 @@ describe('usePageLayoutWidgetCreate', () => {const pageLayoutCurrentLayouts = useRecoilValue(pageLayoutCurrentLayoutsState,);- const createWidget = usePageLayoutWidgetCreate();+ const createWidget = useCreatePageLayoutWidget();return {setActiveTabId,setPageLayoutDraft,@@ -49,7 +52,6 @@ describe('usePageLayoutWidgetCreate', () => {result.current.setPageLayoutDraft({name: 'Test Layout',type: PageLayoutType.DASHBOARD,- workspaceId: undefined,objectMetadataId: null,tabs: [{@@ -68,9 +70,9 @@ describe('usePageLayoutWidgetCreate', () => {});act(() => {- result.current.createWidget.handleCreateWidget(+ result.current.createWidget.createPageLayoutWidget(WidgetType.GRAPH,- GraphSubType.BAR,+ GraphType.BAR,);});@@ -89,12 +91,22 @@ describe('usePageLayoutWidgetCreate', () => {() => {const setPageLayoutDraft = useSetRecoilState(pageLayoutDraftState);const setActiveTabId = useSetRecoilState(- pageLayoutCurrentTabIdForCreationState,+ activeTabIdComponentState.atomFamily({+ instanceId: SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID,+ }),);- const createWidget = usePageLayoutWidgetCreate();+ const pageLayoutDraft = useRecoilValue(pageLayoutDraftState);+ const allWidgets = pageLayoutDraft.tabs.flatMap((tab) => tab.widgets);+ const pageLayoutCurrentLayouts = useRecoilValue(+ pageLayoutCurrentLayoutsState,+ );+ const createWidget = useCreatePageLayoutWidget();return {setPageLayoutDraft,setActiveTabId,+ pageLayoutDraft,+ allWidgets,+ pageLayoutCurrentLayouts,createWidget,};},@@ -107,7 +119,6 @@ describe('usePageLayoutWidgetCreate', () => {result.current.setPageLayoutDraft({name: 'Test Layout',type: PageLayoutType.DASHBOARD,- workspaceId: undefined,objectMetadataId: null,tabs: [{@@ -126,24 +137,41 @@ describe('usePageLayoutWidgetCreate', () => {});const graphTypes = [- GraphSubType.NUMBER,- GraphSubType.GAUGE,- GraphSubType.PIE,- GraphSubType.BAR,+ GraphType.NUMBER,+ GraphType.GAUGE,+ GraphType.PIE,+ GraphType.BAR,];graphTypes.forEach((graphType) => {act(() => {- result.current.createWidget.handleCreateWidget(+ result.current.createWidget.createPageLayoutWidget(WidgetType.GRAPH,graphType,);});});- expect(typeof result.current.createWidget.handleCreateWidget).toBe(- 'function',- );+ expect(result.current.allWidgets).toHaveLength(4);++ graphTypes.forEach((graphType, index) => {+ const widget = result.current.allWidgets[index];+ expect(widget.type).toBe(WidgetType.GRAPH);+ expect(widget.pageLayoutTabId).toBe('tab-1');+ expect(widget.configuration?.graphType).toBe(graphType);+ expect(widget.id).toBe('widget-mock-uuid');+ expect(widget.data).toBeDefined();+ });++ expect(result.current.pageLayoutCurrentLayouts['tab-1']).toBeDefined();+ expect(+ result.current.pageLayoutCurrentLayouts['tab-1'].desktop,+ ).toHaveLength(4);+ expect(+ result.current.pageLayoutCurrentLayouts['tab-1'].mobile,+ ).toHaveLength(4);++ expect(result.current.pageLayoutDraft.tabs[0].widgets).toHaveLength(4);});it('should not create widget when activeTabId is null', () => {@@ -154,7 +182,7 @@ describe('usePageLayoutWidgetCreate', () => {const pageLayoutCurrentLayouts = useRecoilValue(pageLayoutCurrentLayoutsState,);- const createWidget = usePageLayoutWidgetCreate();+ const createWidget = useCreatePageLayoutWidget();return { allWidgets, pageLayoutCurrentLayouts, createWidget };},{@@ -163,9 +191,9 @@ describe('usePageLayoutWidgetCreate', () => {);act(() => {- result.current.createWidget.handleCreateWidget(+ result.current.createWidget.createPageLayoutWidget(WidgetType.GRAPH,- GraphSubType.BAR,+ GraphType.BAR,);});diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useDeletePageLayoutWidget.test.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useDeletePageLayoutWidget.test.tsnew file mode 100644index 00000000000..0873d5f1124--- /dev/null+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useDeletePageLayoutWidget.test.ts@@ -0,0 +1,41 @@+import { act, renderHook } from '@testing-library/react';+import { RecoilRoot } from 'recoil';+import { useDeletePageLayoutWidget } from '../useDeletePageLayoutWidget';++describe('useDeletePageLayoutWidget', () => {+ it('should remove widget from all states', () => {+ const { result } = renderHook(() => useDeletePageLayoutWidget(), {+ wrapper: RecoilRoot,+ });++ act(() => {+ result.current.deletePageLayoutWidget('widget-1');+ });++ expect(typeof result.current.deletePageLayoutWidget).toBe('function');+ });++ it('should handle removing non-existent widget', () => {+ const { result } = renderHook(() => useDeletePageLayoutWidget(), {+ wrapper: RecoilRoot,+ });++ act(() => {+ result.current.deletePageLayoutWidget('non-existent-widget');+ });++ expect(typeof result.current.deletePageLayoutWidget).toBe('function');+ });++ it('should handle empty layouts', () => {+ const { result } = renderHook(() => useDeletePageLayoutWidget(), {+ wrapper: RecoilRoot,+ });++ act(() => {+ result.current.deletePageLayoutWidget('any-widget');+ });++ expect(typeof result.current.deletePageLayoutWidget).toBe('function');+ });+});diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useEndPageLayoutDragSelection.test.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useEndPageLayoutDragSelection.test.tsnew file mode 100644index 00000000000..7d24cfd1216--- /dev/null+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useEndPageLayoutDragSelection.test.ts@@ -0,0 +1,208 @@+import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';+import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { act, renderHook } from '@testing-library/react';+import { type ReactNode } from 'react';+import { RecoilRoot, useRecoilValue } from 'recoil';+import { IconAppWindow } from 'twenty-ui/display';+import { pageLayoutDraggedAreaState } from '../../states/pageLayoutDraggedAreaState';+import { pageLayoutSelectedCellsState } from '../../states/pageLayoutSelectedCellsState';+import { calculateGridBoundsFromSelectedCells } from '../../utils/calculateGridBoundsFromSelectedCells';+import { useEndPageLayoutDragSelection } from '../useEndPageLayoutDragSelection';++jest.mock('@/command-menu/hooks/useNavigateCommandMenu');+jest.mock('../../utils/calculateGridBoundsFromSelectedCells');++describe('useEndPageLayoutDragSelection', () => {+ const mockNavigateCommandMenu = jest.fn();++ beforeEach(() => {+ jest.clearAllMocks();+ (useNavigateCommandMenu as jest.Mock).mockReturnValue({+ navigateCommandMenu: mockNavigateCommandMenu,+ });+ });++ it('should handle drag selection end with valid bounds', () => {+ const mockBounds = { x: 0, y: 0, w: 2, h: 2 };+ (calculateGridBoundsFromSelectedCells as jest.Mock).mockReturnValue(+ mockBounds,+ );++ const { result } = renderHook(+ () => ({+ endDragSelection: useEndPageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ draggedArea: useRecoilValue(pageLayoutDraggedAreaState),+ }),+ {+ wrapper: ({ children }: { children: ReactNode }) =>+ RecoilRoot({+ initializeState: ({ set }) => {+ set(+ pageLayoutSelectedCellsState,+ new Set(['0-0', '0-1', '1-0', '1-1']),+ );+ set(pageLayoutDraggedAreaState, null);+ },+ children,+ }),+ },+ );++ expect(result.current.selectedCells.size).toBe(4);+ expect(result.current.draggedArea).toBeNull();++ act(() => {+ result.current.endDragSelection.endPageLayoutDragSelection();+ });++ expect(calculateGridBoundsFromSelectedCells).toHaveBeenCalledWith([+ '0-0',+ '0-1',+ '1-0',+ '1-1',+ ]);++ expect(result.current.draggedArea).toEqual(mockBounds);+ expect(result.current.selectedCells.size).toBe(0);++ expect(mockNavigateCommandMenu).toHaveBeenCalledWith({+ page: CommandMenuPages.PageLayoutWidgetTypeSelect,+ pageTitle: 'Add Widget',+ pageIcon: IconAppWindow,+ resetNavigationStack: true,+ });+ });++ it('should not navigate when no cells are selected', () => {+ (calculateGridBoundsFromSelectedCells as jest.Mock).mockReturnValue(null);++ const { result } = renderHook(+ () => ({+ endDragSelection: useEndPageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ draggedArea: useRecoilValue(pageLayoutDraggedAreaState),+ }),+ {+ wrapper: ({ children }: { children: ReactNode }) =>+ RecoilRoot({+ initializeState: ({ set }) => {+ set(pageLayoutSelectedCellsState, new Set());+ set(pageLayoutDraggedAreaState, null);+ },+ children,+ }),+ },+ );++ act(() => {+ result.current.endDragSelection.endPageLayoutDragSelection();+ });++ expect(calculateGridBoundsFromSelectedCells).not.toHaveBeenCalled();+ expect(mockNavigateCommandMenu).not.toHaveBeenCalled();+ expect(result.current.draggedArea).toBeNull();+ expect(result.current.selectedCells.size).toBe(0);+ });++ it('should not navigate when bounds calculation returns null', () => {+ (calculateGridBoundsFromSelectedCells as jest.Mock).mockReturnValue(null);++ const { result } = renderHook(+ () => ({+ endDragSelection: useEndPageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ draggedArea: useRecoilValue(pageLayoutDraggedAreaState),+ }),+ {+ wrapper: ({ children }: { children: ReactNode }) =>+ RecoilRoot({+ initializeState: ({ set }) => {+ set(pageLayoutSelectedCellsState, new Set(['invalid-cell']));+ set(pageLayoutDraggedAreaState, null);+ },+ children,+ }),+ },+ );++ act(() => {+ result.current.endDragSelection.endPageLayoutDragSelection();+ });++ expect(calculateGridBoundsFromSelectedCells).toHaveBeenCalledWith([+ 'invalid-cell',+ ]);+ expect(mockNavigateCommandMenu).not.toHaveBeenCalled();+ expect(result.current.draggedArea).toBeNull();+ expect(result.current.selectedCells.size).toBe(1);+ });++ it('should return a function', () => {+ const { result } = renderHook(() => useEndPageLayoutDragSelection(), {+ wrapper: RecoilRoot,+ });++ expect(typeof result.current.endPageLayoutDragSelection).toBe('function');+ });++ it('should navigate to widget selection when bounds are valid', () => {+ const mockBounds = { x: 0, y: 0, w: 2, h: 2 };+ (calculateGridBoundsFromSelectedCells as jest.Mock).mockReturnValue(+ mockBounds,+ );++ const { result } = renderHook(+ () => ({+ endDragSelection: useEndPageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ }),+ {+ wrapper: ({ children }: { children: ReactNode }) =>+ RecoilRoot({+ initializeState: ({ set }) => {+ set(pageLayoutSelectedCellsState, new Set(['0-0']));+ },+ children,+ }),+ },+ );++ act(() => {+ result.current.endDragSelection.endPageLayoutDragSelection();+ });++ expect(mockNavigateCommandMenu).toHaveBeenCalled();+ });++ it('should clear selected cells after successful navigation', () => {+ const mockBounds = { x: 0, y: 0, w: 1, h: 1 };+ (calculateGridBoundsFromSelectedCells as jest.Mock).mockReturnValue(+ mockBounds,+ );++ const { result } = renderHook(+ () => ({+ endDragSelection: useEndPageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ }),+ {+ wrapper: ({ children }: { children: ReactNode }) =>+ RecoilRoot({+ initializeState: ({ set }) => {+ set(pageLayoutSelectedCellsState, new Set(['0-0']));+ },+ children,+ }),+ },+ );++ expect(result.current.selectedCells.size).toBe(1);++ act(() => {+ result.current.endDragSelection.endPageLayoutDragSelection();+ });++ expect(result.current.selectedCells.size).toBe(0);+ });+});diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutDraftState.test.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutDraftState.test.tsindex dd60729f8b4..3e9326c82a0 100644--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutDraftState.test.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutDraftState.test.ts@@ -1,5 +1,5 @@import {- GraphSubType,+ GraphType,WidgetType,} from '@/settings/page-layout/mocks/mockWidgets';import { PageLayoutType } from '@/settings/page-layout/states/savedPageLayoutsState';@@ -26,7 +26,6 @@ describe('usePageLayoutDraftState', () => {result.current.setPageLayoutDraft({name: ' ',type: PageLayoutType.DASHBOARD,- workspaceId: undefined,objectMetadataId: null,tabs: [],});@@ -45,7 +44,6 @@ describe('usePageLayoutDraftState', () => {result.current.setPageLayoutDraft({name: 'Updated Name',type: PageLayoutType.DASHBOARD,- workspaceId: undefined,objectMetadataId: null,tabs: [],});@@ -65,7 +63,6 @@ describe('usePageLayoutDraftState', () => {result.current.setPageLayoutDraft({name: 'Test Layout',type: PageLayoutType.DASHBOARD,- workspaceId: undefined,objectMetadataId: null,tabs: [{@@ -83,7 +80,7 @@ describe('usePageLayoutDraftState', () => {title: 'New Widget',type: WidgetType.GRAPH,gridPosition: { row: 2, column: 2, rowSpan: 2, columnSpan: 2 },- configuration: { graphType: GraphSubType.BAR },+ configuration: { graphType: GraphType.BAR },data: {},objectMetadataId: null,createdAt: new Date().toISOString(),diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutDragSelection.test.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutDragSelection.test.tsdeleted file mode 100644index 31de4c80847..00000000000--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutDragSelection.test.ts+++ /dev/null@@ -1,100 +0,0 @@-import { act, renderHook } from '@testing-library/react';-import { RecoilRoot } from 'recoil';-import { usePageLayoutDragSelection } from '../usePageLayoutDragSelection';--describe('usePageLayoutDragSelection', () => {- it('should initialize with empty selected cells', () => {- const { result } = renderHook(() => usePageLayoutDragSelection(), {- wrapper: RecoilRoot,- });-- expect(result.current.pageLayoutSelectedCells).toEqual(new Set());- });-- it('should clear selected cells on drag start', () => {- const { result } = renderHook(() => usePageLayoutDragSelection(), {- wrapper: RecoilRoot,- });-- act(() => {- result.current.handleDragSelectionChange('cell-1', true);- result.current.handleDragSelectionChange('cell-2', true);- });-- expect(result.current.pageLayoutSelectedCells.size).toBe(2);-- act(() => {- result.current.handleDragSelectionStart();- });-- expect(result.current.pageLayoutSelectedCells).toEqual(new Set());- });-- it('should add and remove cells during drag selection', () => {- const { result } = renderHook(() => usePageLayoutDragSelection(), {- wrapper: RecoilRoot,- });-- act(() => {- result.current.handleDragSelectionChange('cell-1', true);- });-- expect(result.current.pageLayoutSelectedCells.has('cell-1')).toBe(true);-- act(() => {- result.current.handleDragSelectionChange('cell-2', true);- });-- expect(result.current.pageLayoutSelectedCells.size).toBe(2);-- act(() => {- result.current.handleDragSelectionChange('cell-1', false);- });-- expect(result.current.pageLayoutSelectedCells.has('cell-1')).toBe(false);- expect(result.current.pageLayoutSelectedCells.size).toBe(1);- });-- it('should handle drag selection end with selected cells', () => {- const { result } = renderHook(() => usePageLayoutDragSelection(), {- wrapper: RecoilRoot,- });-- act(() => {- result.current.handleDragSelectionChange('0-0', true);- result.current.handleDragSelectionChange('1-0', true);- result.current.handleDragSelectionChange('0-1', true);- result.current.handleDragSelectionChange('1-1', true);- });-- expect(result.current.pageLayoutSelectedCells.size).toBe(4);-- act(() => {- result.current.handleDragSelectionEnd();- });-- expect(result.current.pageLayoutSelectedCells).toEqual(new Set());- });-- it('should handle drag selection end with no selected cells', () => {- const { result } = renderHook(() => usePageLayoutDragSelection(), {- wrapper: RecoilRoot,- });-- act(() => {- result.current.handleDragSelectionEnd();- });-- expect(result.current.pageLayoutSelectedCells).toEqual(new Set());- });-- it('should provide all required handler functions', () => {- const { result } = renderHook(() => usePageLayoutDragSelection(), {- wrapper: RecoilRoot,- });-- expect(typeof result.current.handleDragSelectionStart).toBe('function');- expect(typeof result.current.handleDragSelectionChange).toBe('function');- expect(typeof result.current.handleDragSelectionEnd).toBe('function');- });-});diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutWidgetDelete.test.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutWidgetDelete.test.tsdeleted file mode 100644index 53bcfc4d6d9..00000000000--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/usePageLayoutWidgetDelete.test.ts+++ /dev/null@@ -1,41 +0,0 @@-import { act, renderHook } from '@testing-library/react';-import { RecoilRoot } from 'recoil';-import { usePageLayoutWidgetDelete } from '../usePageLayoutWidgetDelete';--describe('usePageLayoutWidgetDelete', () => {- it('should remove widget from all states', () => {- const { result } = renderHook(() => usePageLayoutWidgetDelete(), {- wrapper: RecoilRoot,- });-- act(() => {- result.current.handleRemoveWidget('widget-1');- });-- expect(typeof result.current.handleRemoveWidget).toBe('function');- });-- it('should handle removing non-existent widget', () => {- const { result } = renderHook(() => usePageLayoutWidgetDelete(), {- wrapper: RecoilRoot,- });-- act(() => {- result.current.handleRemoveWidget('non-existent-widget');- });-- expect(typeof result.current.handleRemoveWidget).toBe('function');- });-- it('should handle empty layouts', () => {- const { result } = renderHook(() => usePageLayoutWidgetDelete(), {- wrapper: RecoilRoot,- });-- act(() => {- result.current.handleRemoveWidget('any-widget');- });-- expect(typeof result.current.handleRemoveWidget).toBe('function');- });-});diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useStartPageLayoutDragSelection.test.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useStartPageLayoutDragSelection.test.tsnew file mode 100644index 00000000000..296345a460a--- /dev/null+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/__tests__/useStartPageLayoutDragSelection.test.ts@@ -0,0 +1,73 @@+import { act, renderHook } from '@testing-library/react';+import { type ReactNode } from 'react';+import { RecoilRoot, useRecoilValue } from 'recoil';+import { pageLayoutSelectedCellsState } from '../../states/pageLayoutSelectedCellsState';+import { useStartPageLayoutDragSelection } from '../useStartPageLayoutDragSelection';++describe('useStartPageLayoutDragSelection', () => {+ it('should clear selected cells when starting drag selection', () => {+ const { result } = renderHook(+ () => ({+ startDragSelection: useStartPageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ }),+ {+ wrapper: ({ children }: { children: ReactNode }) =>+ RecoilRoot({+ initializeState: ({ set }) => {+ set(pageLayoutSelectedCellsState, new Set(['cell-1', 'cell-2']));+ },+ children,+ }),+ },+ );++ expect(result.current.selectedCells.size).toBe(2);+ expect(result.current.selectedCells.has('cell-1')).toBe(true);+ expect(result.current.selectedCells.has('cell-2')).toBe(true);++ act(() => {+ result.current.startDragSelection.startPageLayoutDragSelection();+ });++ expect(result.current.selectedCells.size).toBe(0);+ });++ it('should return a function', () => {+ const { result } = renderHook(() => useStartPageLayoutDragSelection(), {+ wrapper: RecoilRoot,+ });++ expect(typeof result.current.startPageLayoutDragSelection).toBe('function');+ });++ it('should handle multiple calls correctly', () => {+ const { result } = renderHook(+ () => ({+ startDragSelection: useStartPageLayoutDragSelection(),+ selectedCells: useRecoilValue(pageLayoutSelectedCellsState),+ }),+ {+ wrapper: ({ children }: { children: ReactNode }) =>+ RecoilRoot({+ initializeState: ({ set }) => {+ set(pageLayoutSelectedCellsState, new Set(['cell-1']));+ },+ children,+ }),+ },+ );++ expect(result.current.selectedCells.size).toBe(1);++ act(() => {+ result.current.startDragSelection.startPageLayoutDragSelection();+ });+ expect(result.current.selectedCells.size).toBe(0);++ act(() => {+ result.current.startDragSelection.startPageLayoutDragSelection();+ });+ expect(result.current.selectedCells.size).toBe(0);+ });+});diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/useChangePageLayoutDragSelection.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/useChangePageLayoutDragSelection.tsnew file mode 100644index 00000000000..07d58859d36--- /dev/null+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/useChangePageLayoutDragSelection.ts@@ -0,0 +1,22 @@+import { useRecoilCallback } from 'recoil';+import { pageLayoutSelectedCellsState } from '../states/pageLayoutSelectedCellsState';++export const useChangePageLayoutDragSelection = () => {+ const changePageLayoutDragSelection = useRecoilCallback(+ ({ set }) =>+ (cellId: string, selected: boolean) => {+ set(pageLayoutSelectedCellsState, (prev) => {+ const newSet = new Set(prev);+ if (selected) {+ newSet.add(cellId);+ } else {+ newSet.delete(cellId);+ }+ return newSet;+ });+ },+ [],+ );++ return { changePageLayoutDragSelection };+};diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/useCreatePageLayoutIframeWidget.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/useCreatePageLayoutIframeWidget.tsindex 05f51655b94..3ff4adccdaa 100644--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/useCreatePageLayoutIframeWidget.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/useCreatePageLayoutIframeWidget.ts@@ -1,8 +1,10 @@+import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';+import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';import { useRecoilCallback } from 'recoil';import { v4 as uuidv4 } from 'uuid';+import { SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID } from '../constants/SettingsPageLayoutTabsInstanceId';import { WidgetType } from '../mocks/mockWidgets';import { pageLayoutCurrentLayoutsState } from '../states/pageLayoutCurrentLayoutsState';-import { pageLayoutCurrentTabIdForCreationState } from '../states/pageLayoutCurrentTabIdForCreation';import { pageLayoutDraftState } from '../states/pageLayoutDraftState';import { pageLayoutDraggedAreaState } from '../states/pageLayoutDraggedAreaState';import { type PageLayoutWidget } from '../states/savedPageLayoutsState';@@ -11,6 +13,11 @@ import { createUpdatedTabLayouts } from '../utils/createUpdatedTabLayouts';import { getDefaultWidgetPosition } from '../utils/getDefaultWidgetPosition';export const useCreatePageLayoutIframeWidget = () => {+ const activeTabId = useRecoilComponentValue(+ activeTabIdComponentState,+ SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID,+ );+const createPageLayoutIframeWidget = useRecoilCallback(({ snapshot, set }) =>(title: string, url: string) => {@@ -21,10 +28,6 @@ export const useCreatePageLayoutIframeWidget = () => {.getLoadable(pageLayoutDraggedAreaState).getValue();- const activeTabId = snapshot- .getLoadable(pageLayoutCurrentTabIdForCreationState)- .getValue();-if (!activeTabId) {return;}@@ -78,7 +81,7 @@ export const useCreatePageLayoutIframeWidget = () => {set(pageLayoutDraggedAreaState, null);},- [],+ [activeTabId],);return { createPageLayoutIframeWidget };diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutTabCreate.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/useCreatePageLayoutTab.tssimilarity index 90%rename from packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutTabCreate.tsrename to packages/twenty-front/src/modules/settings/page-layout/hooks/useCreatePageLayoutTab.tsindex 03f5eb3aef8..e930b42f7b2 100644--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutTabCreate.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/useCreatePageLayoutTab.ts@@ -5,8 +5,8 @@ import { pageLayoutDraftState } from '../states/pageLayoutDraftState';import { type PageLayoutTab } from '../states/savedPageLayoutsState';import { createEmptyTabLayout } from '../utils/createEmptyTabLayout';-export const usePageLayoutTabCreate = () => {- const handleCreateTab = useRecoilCallback(+export const useCreatePageLayoutTab = () => {+ const createPageLayoutTab = useRecoilCallback(({ snapshot, set }) =>(title?: string): string => {const pageLayoutDraft = snapshot@@ -41,5 +41,5 @@ export const usePageLayoutTabCreate = () => {[],);- return { handleCreateTab };+ return { createPageLayoutTab };};diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutWidgetCreate.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/useCreatePageLayoutWidget.tssimilarity index 79%rename from packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutWidgetCreate.tsrename to packages/twenty-front/src/modules/settings/page-layout/hooks/useCreatePageLayoutWidget.tsindex e9582f159bf..7bf4d188531 100644--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutWidgetCreate.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/useCreatePageLayoutWidget.ts@@ -1,8 +1,10 @@+import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';+import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { useRecoilCallback } from 'recoil';import { v4 as uuidv4 } from 'uuid';-import { type GraphSubType, type WidgetType } from '../mocks/mockWidgets';+import { SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID } from '../constants/SettingsPageLayoutTabsInstanceId';+import { type GraphType, type WidgetType } from '../mocks/mockWidgets';import { pageLayoutCurrentLayoutsState } from '../states/pageLayoutCurrentLayoutsState';-import { pageLayoutCurrentTabIdForCreationState } from '../states/pageLayoutCurrentTabIdForCreation';import { pageLayoutDraftState } from '../states/pageLayoutDraftState';import { pageLayoutDraggedAreaState } from '../states/pageLayoutDraggedAreaState';import { type PageLayoutWidget } from '../states/savedPageLayoutsState';@@ -15,10 +17,15 @@ import {} from '../utils/getDefaultWidgetData';import { getDefaultWidgetPosition } from '../utils/getDefaultWidgetPosition';-export const usePageLayoutWidgetCreate = () => {- const handleCreateWidget = useRecoilCallback(+export const useCreatePageLayoutWidget = () => {+ const activeTabId = useRecoilComponentValue(+ activeTabIdComponentState,+ SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID,+ );++ const createPageLayoutWidget = useRecoilCallback(({ snapshot, set }) =>- (widgetType: WidgetType, graphType: GraphSubType) => {+ (widgetType: WidgetType, graphType: GraphType) => {const widgetData = getDefaultWidgetData(graphType);const pageLayoutDraft = snapshot@@ -30,9 +37,6 @@ export const usePageLayoutWidgetCreate = () => {const pageLayoutDraggedArea = snapshot.getLoadable(pageLayoutDraggedAreaState).getValue();- const activeTabId = snapshot- .getLoadable(pageLayoutCurrentTabIdForCreationState)- .getValue();if (!activeTabId) {return;@@ -95,8 +99,8 @@ export const usePageLayoutWidgetCreate = () => {set(pageLayoutDraggedAreaState, null);},- [],+ [activeTabId],);- return { handleCreateWidget };+ return { createPageLayoutWidget };};diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutWidgetDelete.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/useDeletePageLayoutWidget.tssimilarity index 84%rename from packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutWidgetDelete.tsrename to packages/twenty-front/src/modules/settings/page-layout/hooks/useDeletePageLayoutWidget.tsindex faf0b622111..1365f88a7b2 100644--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutWidgetDelete.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/useDeletePageLayoutWidget.ts@@ -1,11 +1,12 @@import { useRecoilCallback } from 'recoil';+import { isDefined } from 'twenty-shared/utils';import { pageLayoutCurrentLayoutsState } from '../states/pageLayoutCurrentLayoutsState';import { pageLayoutDraftState } from '../states/pageLayoutDraftState';import { removeWidgetFromTab } from '../utils/removeWidgetFromTab';import { removeWidgetLayoutFromTab } from '../utils/removeWidgetLayoutFromTab';-export const usePageLayoutWidgetDelete = () => {- const handleRemoveWidget = useRecoilCallback(+export const useDeletePageLayoutWidget = () => {+ const deletePageLayoutWidget = useRecoilCallback(({ snapshot, set }) =>(widgetId: string) => {const pageLayoutDraft = snapshot@@ -20,7 +21,7 @@ export const usePageLayoutWidgetDelete = () => {);const tabId = tabWithWidget?.id;- if (tabId !== undefined) {+ if (isDefined(tabId)) {const updatedLayouts = removeWidgetLayoutFromTab(allTabLayouts,tabId,@@ -37,5 +38,5 @@ export const usePageLayoutWidgetDelete = () => {[],);- return { handleRemoveWidget };+ return { deletePageLayoutWidget };};diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/useEndPageLayoutDragSelection.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/useEndPageLayoutDragSelection.tsnew file mode 100644index 00000000000..5c579f24ec0--- /dev/null+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/useEndPageLayoutDragSelection.ts@@ -0,0 +1,43 @@+import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';+import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';+import { useRecoilCallback } from 'recoil';+import { isDefined } from 'twenty-shared/utils';+import { IconAppWindow } from 'twenty-ui/display';+import { pageLayoutDraggedAreaState } from '../states/pageLayoutDraggedAreaState';+import { pageLayoutSelectedCellsState } from '../states/pageLayoutSelectedCellsState';+import { calculateGridBoundsFromSelectedCells } from '../utils/calculateGridBoundsFromSelectedCells';++export const useEndPageLayoutDragSelection = () => {+ const { navigateCommandMenu } = useNavigateCommandMenu();++ const endPageLayoutDragSelection = useRecoilCallback(+ ({ snapshot, set }) =>+ () => {+ const pageLayoutSelectedCells = snapshot+ .getLoadable(pageLayoutSelectedCellsState)+ .getValue();++ if (pageLayoutSelectedCells.size > 0) {+ const draggedBounds = calculateGridBoundsFromSelectedCells(+ Array.from(pageLayoutSelectedCells),+ );++ if (isDefined(draggedBounds)) {+ set(pageLayoutDraggedAreaState, draggedBounds);++ navigateCommandMenu({+ page: CommandMenuPages.PageLayoutWidgetTypeSelect,+ pageTitle: 'Add Widget',+ pageIcon: IconAppWindow,+ resetNavigationStack: true,+ });++ set(pageLayoutSelectedCellsState, new Set());+ }+ }+ },+ [navigateCommandMenu],+ );++ return { endPageLayoutDragSelection };+};diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutDraftState.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutDraftState.tsindex 45394025041..41c82a8a2c3 100644--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutDraftState.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutDraftState.ts@@ -12,7 +12,6 @@ export const usePageLayoutDraftState = () => {? !isDeeplyEqual(pageLayoutDraft, {name: pageLayoutPersisted.name,type: pageLayoutPersisted.type,- workspaceId: pageLayoutPersisted.workspaceId,objectMetadataId: pageLayoutPersisted.objectMetadataId,tabs: pageLayoutPersisted.tabs,})diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutDragSelection.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutDragSelection.tsdeleted file mode 100644index 25706d0a0ea..00000000000--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutDragSelection.ts+++ /dev/null@@ -1,61 +0,0 @@-import { useNavigateCommandMenu } from '@/command-menu/hooks/useNavigateCommandMenu';-import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';-import { useRecoilState, useSetRecoilState } from 'recoil';-import { IconAppWindow } from 'twenty-ui/display';-import { pageLayoutDraggedAreaState } from '../states/pageLayoutDraggedAreaState';-import { pageLayoutSelectedCellsState } from '../states/pageLayoutSelectedCellsState';-import { calculateGridBoundsFromSelectedCells } from '../utils/calculateGridBoundsFromSelectedCells';--export const usePageLayoutDragSelection = () => {- const [pageLayoutSelectedCells, setPageLayoutSelectedCells] = useRecoilState(- pageLayoutSelectedCellsState,- );- const setPageLayoutDraggedArea = useSetRecoilState(- pageLayoutDraggedAreaState,- );-- const { navigateCommandMenu } = useNavigateCommandMenu();- const handleDragSelectionStart = () => {- setPageLayoutSelectedCells(new Set());- };-- const handleDragSelectionChange = (cellId: string, selected: boolean) => {- setPageLayoutSelectedCells((prev) => {- const newSet = new Set(prev);- if (selected) {- newSet.add(cellId);- } else {- newSet.delete(cellId);- }- return newSet;- });- };-- const handleDragSelectionEnd = () => {- if (pageLayoutSelectedCells.size > 0) {- const draggedBounds = calculateGridBoundsFromSelectedCells(- Array.from(pageLayoutSelectedCells),- );-- if (draggedBounds !== null) {- setPageLayoutDraggedArea(draggedBounds);-- navigateCommandMenu({- page: CommandMenuPages.PageLayoutWidgetTypeSelect,- pageTitle: 'Add Widget',- pageIcon: IconAppWindow,- resetNavigationStack: true,- });-- setPageLayoutSelectedCells(new Set());- }- }- };-- return {- pageLayoutSelectedCells,- handleDragSelectionStart,- handleDragSelectionChange,- handleDragSelectionEnd,- };-};diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutSaveHandler.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutSaveHandler.tsindex 6f837443f7e..03f1a87acb9 100644--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutSaveHandler.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutSaveHandler.ts@@ -1,7 +1,9 @@-import { useNavigate, useParams } from 'react-router-dom';+import { useParams } from 'react-router-dom';import { useRecoilCallback } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { v4 as uuidv4 } from 'uuid';+import { useNavigateSettings } from '~/hooks/useNavigateSettings';import { pageLayoutDraftState } from '../states/pageLayoutDraftState';import { pageLayoutPersistedState } from '../states/pageLayoutPersistedState';import {@@ -11,7 +13,7 @@ import {} from '../states/savedPageLayoutsState';export const usePageLayoutSaveHandler = () => {- const navigate = useNavigate();+ const navigateSettings = useNavigateSettings();const { id } = useParams<{ id: string }>();const isEditMode = id && id !== 'new';@@ -42,7 +44,6 @@ export const usePageLayoutSaveHandler = () => {id: isEditMode ? id : uuidv4(),name: pageLayoutDraft.name,type: pageLayoutDraft.type,- workspaceId: pageLayoutDraft.workspaceId,objectMetadataId: pageLayoutDraft.objectMetadataId,tabs: updatedTabs,createdAt: isEditMode@@ -63,9 +64,9 @@ export const usePageLayoutSaveHandler = () => {set(pageLayoutPersistedState, layoutToSave);- navigate('/settings/page-layout');+ navigateSettings(SettingsPath.PageLayout);},- [isEditMode, id, navigate],+ [isEditMode, id, navigateSettings],);return { savePageLayout };diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/useStartPageLayoutDragSelection.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/useStartPageLayoutDragSelection.tsnew file mode 100644index 00000000000..f109425dcd1--- /dev/null+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/useStartPageLayoutDragSelection.ts@@ -0,0 +1,14 @@+import { useRecoilCallback } from 'recoil';+import { pageLayoutSelectedCellsState } from '../states/pageLayoutSelectedCellsState';++export const useStartPageLayoutDragSelection = () => {+ const startPageLayoutDragSelection = useRecoilCallback(+ ({ set }) =>+ () => {+ set(pageLayoutSelectedCellsState, new Set());+ },+ [],+ );++ return { startPageLayoutDragSelection };+};diff --git a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutWidgetUpdate.ts b/packages/twenty-front/src/modules/settings/page-layout/hooks/useUpdatePageLayoutWidget.tssimilarity index 81%rename from packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutWidgetUpdate.tsrename to packages/twenty-front/src/modules/settings/page-layout/hooks/useUpdatePageLayoutWidget.tsindex ce1c1242d3a..772428991a8 100644--- a/packages/twenty-front/src/modules/settings/page-layout/hooks/usePageLayoutWidgetUpdate.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/hooks/useUpdatePageLayoutWidget.ts@@ -2,8 +2,8 @@ import { useRecoilCallback } from 'recoil';import { type PageLayoutWidget } from '../states/savedPageLayoutsState';import { pageLayoutDraftState } from '../states/pageLayoutDraftState';-export const usePageLayoutWidgetUpdate = () => {- const handleUpdateWidget = useRecoilCallback(+export const useUpdatePageLayoutWidget = () => {+ const updatePageLayoutWidget = useRecoilCallback(({ set }) =>(widgetId: string, updates: Partial<PageLayoutWidget>) => {set(pageLayoutDraftState, (prev) => ({@@ -19,5 +19,5 @@ export const usePageLayoutWidgetUpdate = () => {[],);- return { handleUpdateWidget };+ return { updatePageLayoutWidget };};diff --git a/packages/twenty-front/src/modules/settings/page-layout/mocks/mockWidgets.ts b/packages/twenty-front/src/modules/settings/page-layout/mocks/mockWidgets.tsindex 5a1ba46ed93..f931f28c317 100644--- a/packages/twenty-front/src/modules/settings/page-layout/mocks/mockWidgets.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/mocks/mockWidgets.ts@@ -8,7 +8,7 @@ export enum WidgetType {GRAPH = 'GRAPH',}-export enum GraphSubType {+export enum GraphType {NUMBER = 'NUMBER',GAUGE = 'GAUGE',PIE = 'PIE',@@ -29,7 +29,7 @@ export const mockPageLayoutWidgets: PageLayoutWidget[] = [columnSpan: 3,},configuration: {- graphType: GraphSubType.NUMBER,+ graphType: GraphType.NUMBER,},data: {value: '1,234',@@ -52,7 +52,7 @@ export const mockPageLayoutWidgets: PageLayoutWidget[] = [columnSpan: 3,},configuration: {- graphType: GraphSubType.GAUGE,+ graphType: GraphType.GAUGE,},data: {value: 0.5,@@ -77,7 +77,7 @@ export const mockPageLayoutWidgets: PageLayoutWidget[] = [columnSpan: 6,},configuration: {- graphType: GraphSubType.PIE,+ graphType: GraphType.PIE,},data: {items: [@@ -130,7 +130,7 @@ export const mockPageLayoutWidgets: PageLayoutWidget[] = [columnSpan: 4,},configuration: {- graphType: GraphSubType.BAR,+ graphType: GraphType.BAR,},data: {items: [diff --git a/packages/twenty-front/src/modules/settings/page-layout/states/pageLayoutCurrentTabIdForCreation.ts b/packages/twenty-front/src/modules/settings/page-layout/states/pageLayoutCurrentTabIdForCreation.tsdeleted file mode 100644index cf513be3e61..00000000000--- a/packages/twenty-front/src/modules/settings/page-layout/states/pageLayoutCurrentTabIdForCreation.ts+++ /dev/null@@ -1,8 +0,0 @@-import { createState } from 'twenty-ui/utilities';--export const pageLayoutCurrentTabIdForCreationState = createState<- string | null->({- key: 'pageLayoutCurrentTabIdForCreationState',- defaultValue: null,-});diff --git a/packages/twenty-front/src/modules/settings/page-layout/states/pageLayoutDraftState.ts b/packages/twenty-front/src/modules/settings/page-layout/states/pageLayoutDraftState.tsindex e7b20c5fa6a..e6c21e9a26e 100644--- a/packages/twenty-front/src/modules/settings/page-layout/states/pageLayoutDraftState.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/states/pageLayoutDraftState.ts@@ -11,7 +11,6 @@ export const pageLayoutDraftState = createState<DraftPageLayout>({defaultValue: {name: '',type: PageLayoutType.DASHBOARD,- workspaceId: undefined,objectMetadataId: null,tabs: [],},diff --git a/packages/twenty-front/src/modules/settings/page-layout/states/savedPageLayoutsState.ts b/packages/twenty-front/src/modules/settings/page-layout/states/savedPageLayoutsState.tsindex 29a2a506c29..c73da73da89 100644--- a/packages/twenty-front/src/modules/settings/page-layout/states/savedPageLayoutsState.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/states/savedPageLayoutsState.ts@@ -43,7 +43,6 @@ export type SavedPageLayout = {id: string;name: string;type: PageLayoutType;- workspaceId?: string;objectMetadataId?: string | null;tabs: PageLayoutTab[];createdAt: string;diff --git a/packages/twenty-front/src/modules/settings/page-layout/utils/__tests__/convertLayoutsToWidgets.test.ts b/packages/twenty-front/src/modules/settings/page-layout/utils/__tests__/convertLayoutsToWidgets.test.tsindex b697a866a9c..fc917b473aa 100644--- a/packages/twenty-front/src/modules/settings/page-layout/utils/__tests__/convertLayoutsToWidgets.test.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/utils/__tests__/convertLayoutsToWidgets.test.ts@@ -1,4 +1,4 @@-import { GraphSubType, WidgetType } from '../../mocks/mockWidgets';+import { GraphType, WidgetType } from '../../mocks/mockWidgets';import { type PageLayoutWidget } from '../../states/savedPageLayoutsState';import { convertLayoutsToWidgets } from '../convertLayoutsToWidgets';@@ -17,7 +17,7 @@ describe('convertLayoutsToWidgets', () => {columnSpan: 2,},configuration: {- graphType: GraphSubType.NUMBER,+ graphType: GraphType.NUMBER,},data: { value: 100 },createdAt: '2024-01-01T00:00:00Z',@@ -37,7 +37,7 @@ describe('convertLayoutsToWidgets', () => {columnSpan: 2,},configuration: {- graphType: GraphSubType.PIE,+ graphType: GraphType.PIE,},data: { items: [] },createdAt: '2024-01-01T00:00:00Z',diff --git a/packages/twenty-front/src/modules/settings/page-layout/utils/getDefaultWidgetData.ts b/packages/twenty-front/src/modules/settings/page-layout/utils/getDefaultWidgetData.tsindex 6370e87eeda..ef12e54118e 100644--- a/packages/twenty-front/src/modules/settings/page-layout/utils/getDefaultWidgetData.ts+++ b/packages/twenty-front/src/modules/settings/page-layout/utils/getDefaultWidgetData.ts@@ -1,14 +1,14 @@-import { GraphSubType } from '../mocks/mockWidgets';+import { GraphType } from '../mocks/mockWidgets';-export const getDefaultWidgetData = (graphType: GraphSubType) => {+export const getDefaultWidgetData = (graphType: GraphType) => {switch (graphType) {- case GraphSubType.NUMBER:+ case GraphType.NUMBER:return {value: '1,234',trendPercentage: 15.2,};- case GraphSubType.GAUGE:+ case GraphType.GAUGE:return {value: 0.7,min: 0,@@ -16,7 +16,7 @@ export const getDefaultWidgetData = (graphType: GraphSubType) => {label: 'Progress',};- case GraphSubType.PIE:+ case GraphType.PIE:return {items: [{ id: 'segment1', value: 35, label: 'Segment A' },@@ -26,7 +26,7 @@ export const getDefaultWidgetData = (graphType: GraphSubType) => {],};- case GraphSubType.BAR:+ case GraphType.BAR:return {items: [{ category: 'Jan', value: 45 },@@ -46,29 +46,26 @@ export const getDefaultWidgetData = (graphType: GraphSubType) => {}};-export const getWidgetTitle = (- graphType: GraphSubType,- index: number,-): string => {- const baseNames: Record<GraphSubType, string> = {- [GraphSubType.NUMBER]: 'Number',- [GraphSubType.GAUGE]: 'Gauge',- [GraphSubType.PIE]: 'Pie Chart',- [GraphSubType.BAR]: 'Bar Chart',+export const getWidgetTitle = (graphType: GraphType, index: number): string => {+ const baseNames: Record<GraphType, string> = {+ [GraphType.NUMBER]: 'Number',+ [GraphType.GAUGE]: 'Gauge',+ [GraphType.PIE]: 'Pie Chart',+ [GraphType.BAR]: 'Bar Chart',};return `${baseNames[graphType] || 'Widget'} ${index + 1}`;};-export const getWidgetSize = (graphType: GraphSubType) => {+export const getWidgetSize = (graphType: GraphType) => {switch (graphType) {- case GraphSubType.NUMBER:+ case GraphType.NUMBER:return { w: 3, h: 2 };- case GraphSubType.GAUGE:+ case GraphType.GAUGE:return { w: 3, h: 3 };- case GraphSubType.PIE:+ case GraphType.PIE:return { w: 4, h: 4 };- case GraphSubType.BAR:+ case GraphType.BAR:return { w: 6, h: 4 };default:return { w: 4, h: 4 };diff --git a/packages/twenty-front/src/modules/settings/page-layout/utils/graphRegistry.tsx b/packages/twenty-front/src/modules/settings/page-layout/utils/graphRegistry.tsxdeleted file mode 100644index c9a8547678c..00000000000--- a/packages/twenty-front/src/modules/settings/page-layout/utils/graphRegistry.tsx+++ /dev/null@@ -1,71 +0,0 @@-import { GraphWidgetBarChart } from '@/dashboards/widgets/graph/components/GraphWidgetBarChart';-import { GraphWidgetGaugeChart } from '@/dashboards/widgets/graph/components/GraphWidgetGaugeChart';-import { GraphWidgetNumberChart } from '@/dashboards/widgets/graph/components/GraphWidgetNumberChart';-import { GraphWidgetPieChart } from '@/dashboards/widgets/graph/components/GraphWidgetPieChart';-import { type ReactNode } from 'react';-import { GraphSubType } from '../mocks/mockWidgets';-import { type PageLayoutWidget } from '../states/savedPageLayoutsState';--type GraphRenderer = (widget: PageLayoutWidget) => ReactNode;--const graphRenderers: Record<GraphSubType, GraphRenderer> = {- [GraphSubType.NUMBER]: (widget) => (- <GraphWidgetNumberChart- value={widget.data.value}- trendPercentage={widget.data.trendPercentage}- />- ),- [GraphSubType.GAUGE]: (widget) => (- <GraphWidgetGaugeChart- data={{- value: widget.data.value,- min: widget.data.min,- max: widget.data.max,- label: widget.data.label,- }}- displayType="percentage"- showValue- id={`gauge-chart-${widget.id}`}- />- ),- [GraphSubType.PIE]: (widget) => (- <GraphWidgetPieChart- data={widget.data.items}- showLegend- displayType="percentage"- id={`pie-chart-${widget.id}`}- />- ),- [GraphSubType.BAR]: (widget) => (- <GraphWidgetBarChart- data={widget.data.items}- indexBy={widget.data.indexBy}- keys={widget.data.keys}- seriesLabels={widget.data.seriesLabels}- layout={widget.data.layout}- showLegend- showGrid- displayType="number"- id={`bar-chart-${widget.id}`}- />- ),-};--export const renderGraphWidget = (widget: PageLayoutWidget): ReactNode => {- const graphType = widget.configuration?.graphType;-- if (!graphType || typeof graphType !== 'string') {- return null;- }-- if (!Object.values(GraphSubType).includes(graphType as GraphSubType)) {- return null;- }-- const renderer = graphRenderers[graphType as GraphSubType];- if (!renderer) {- return null;- }-- return renderer(widget);-};diff --git a/packages/twenty-front/src/modules/settings/playground/components/PlaygroundSetupForm.tsx b/packages/twenty-front/src/modules/settings/playground/components/PlaygroundSetupForm.tsxindex b63227f8030..6a5edf89c66 100644--- a/packages/twenty-front/src/modules/settings/playground/components/PlaygroundSetupForm.tsx+++ b/packages/twenty-front/src/modules/settings/playground/components/PlaygroundSetupForm.tsx@@ -3,7 +3,6 @@ import { SETTINGS_PLAYGROUND_FORM_SCHEMA_SELECT_OPTIONS } from '@/settings/playgimport { playgroundApiKeyState } from '@/settings/playground/states/playgroundApiKeyState';import { PlaygroundSchemas } from '@/settings/playground/types/PlaygroundSchemas';import { PlaygroundTypes } from '@/settings/playground/types/PlaygroundTypes';-import { SettingsPath } from '@/types/SettingsPath';import { Select } from '@/ui/input/components/Select';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import styled from '@emotion/styled';@@ -11,6 +10,7 @@ import { zodResolver } from '@hookform/resolvers/zod';import { useLingui } from '@lingui/react/macro';import { Controller, useForm } from 'react-hook-form';import { useRecoilState } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';import { IconApi, IconBrandGraphql } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { z } from 'zod';diff --git a/packages/twenty-front/src/modules/settings/playground/components/RestPlayground.tsx b/packages/twenty-front/src/modules/settings/playground/components/RestPlayground.tsxindex eeecf6745e6..c75574ae9ed 100644--- a/packages/twenty-front/src/modules/settings/playground/components/RestPlayground.tsx+++ b/packages/twenty-front/src/modules/settings/playground/components/RestPlayground.tsx@@ -1,13 +1,13 @@import { playgroundApiKeyState } from '@/settings/playground/states/playgroundApiKeyState';import { type PlaygroundSchemas } from '@/settings/playground/types/PlaygroundSchemas';-import { SettingsPath } from '@/types/SettingsPath';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { lazy, Suspense } from 'react';import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { REACT_APP_SERVER_BASE_URL } from '~/config';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledContainer = styled.div`border: 1px solid ${({ theme }) => theme.border.color.medium};diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesContainer.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesContainer.tsxindex 4af03e09bbb..8cef5dca32c 100644--- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesContainer.tsx+++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesContainer.tsx@@ -1,6 +1,6 @@-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { getSettingsPath } from 'twenty-shared/utils';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { SettingsRoleDefaultRole } from '@/settings/roles/components/SettingsRolesDefaultRole';diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsxindex 6e57cc7a7d9..7c72d597e4c 100644--- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx+++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx@@ -6,13 +6,13 @@ import { SettingsRolesTableHeader } from '@/settings/roles/components/SettingsRoimport { SettingsRolesTableRow } from '@/settings/roles/components/SettingsRolesTableRow';import { ROLES_LIST_TABS } from '@/settings/roles/constants/RolesListTabs';import { settingsAllRolesSelector } from '@/settings/roles/states/settingsAllRolesSelector';-import { SettingsPath } from '@/types/SettingsPath';import { TabList } from '@/ui/layout/tab-list/components/TabList';import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';import { TableCell } from '@/ui/layout/table/components/TableCell';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';import {H2Title,IconKey,diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsxindex d000019792e..adc50264c45 100644--- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx+++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx@@ -1,12 +1,12 @@import { currentWorkspaceMembersState } from '@/auth/states/currentWorkspaceMembersState';-import { SettingsPath } from '@/types/SettingsPath';import { TableCell } from '@/ui/layout/table/components/TableCell';import { TableRow } from '@/ui/layout/table/components/TableRow';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import React from 'react';import { useRecoilValue } from 'recoil';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import {AppTooltip,Avatar,@@ -15,7 +15,7 @@ import {TooltipDelay,useIcons,} from 'twenty-ui/display';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { type RoleWithPartialMembers } from '../types/RoleWithPartialMembers';const StyledAssignedText = styled.div`diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignment.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignment.tsxindex fff11f05f86..20f12b207fd 100644--- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignment.tsx+++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignment.tsx@@ -8,13 +8,13 @@ import { SettingsRoleAssignmentConfirmationModal } from '@/settings/roles/role-aimport { type SettingsRoleAssignmentConfirmationModalSelectedRoleTarget } from '@/settings/roles/role-assignment/types/SettingsRoleAssignmentConfirmationModalSelectedRoleTarget';import { settingsAllRolesSelector } from '@/settings/roles/states/settingsAllRolesSelector';import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';-import { SettingsPath } from '@/types/SettingsPath';import { useModal } from '@/ui/layout/modal/hooks/useModal';import { isModalOpenedComponentState } from '@/ui/layout/modal/states/isModalOpenedComponentState';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { useState } from 'react';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';import {useFindManyAgentsQuery,useGetApiKeysQuery,diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsxindex 417d59e369e..0db7cd7470e 100644--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx@@ -2,12 +2,12 @@import { SettingsCard } from '@/settings/components/SettingsCard';import { useFilterObjectMetadataItemsWithPermissionOverride } from '@/settings/roles/role-permissions/object-level-permissions/hooks/useFilterObjectWithPermissionOverride';import { useObjectMetadataItemsThatCanHavePermission } from '@/settings/roles/role-permissions/object-level-permissions/hooks/useObjectMetadataItemsThatCanHavePermission';-import { SettingsPath } from '@/types/SettingsPath';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { t } from '@lingui/core/macro';import { useState } from 'react';+import { SettingsPath } from 'twenty-shared/types';import { H2Title, IconSearch, useIcons } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';import { useNavigateSettings } from '~/hooks/useNavigateSettings';diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsxindex 65a6a08b6fd..d36717b0288 100644--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx@@ -2,11 +2,11 @@ import { SettingsRolePermissionsObjectLevelTableHeader } from '@/settings/roles/import { SettingsRolePermissionsObjectLevelTableRow } from '@/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRow';import { useFilterObjectMetadataItemsWithPermissionOverride } from '@/settings/roles/role-permissions/object-level-permissions/hooks/useFilterObjectWithPermissionOverride';import { useObjectMetadataItemsThatCanHavePermission } from '@/settings/roles/role-permissions/object-level-permissions/hooks/useObjectMetadataItemsThatCanHavePermission';-import { SettingsPath } from '@/types/SettingsPath';import { Table } from '@/ui/layout/table/components/Table';import { TableCell } from '@/ui/layout/table/components/TableCell';import styled from '@emotion/styled';import { t } from '@lingui/core/macro';+import { SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { IconPlus } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRow.tsxindex dc63d485b29..1e914f6dbae 100644--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRow.tsx+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRow.tsx@@ -3,17 +3,17 @@ import { SettingsRolePermissionsObjectLevelOverrideCellContainer } from '@/settiimport { SettingsRolePermissionsObjectLevelSeeFieldsValueForObject } from '@/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSeeFieldsValueForObject';import { SettingsRolePermissionsObjectLevelUpdateFieldsValueForObject } from '@/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelUpdateFieldsValueForObject';import { OBJECT_LEVEL_PERMISSION_TABLE_GRID_AUTO_COLUMNS } from '@/settings/roles/role-permissions/object-level-permissions/constants/ObjectLevelPermissionTableGridAutoColumns';-import { SettingsPath } from '@/types/SettingsPath';import { TableCell } from '@/ui/layout/table/components/TableCell';import { TableRow } from '@/ui/layout/table/components/TableRow';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import {IconChevronRight,OverflowingTextWithTooltip,useIcons,} from 'twenty-ui/display';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledNameTableCell = styled(TableCell)`color: ${({ theme }) => theme.font.color.primary};diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectForm.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectForm.tsxindex 2be4a072d5b..77e2ead9653 100644--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectForm.tsx+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectForm.tsx@@ -3,12 +3,12 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContainimport { SettingsRolePermissionsObjectLevelObjectFieldPermissionTable } from '@/settings/roles/role-permissions/object-level-permissions/field-permissions/components/SettingsRolePermissionsObjectLevelObjectFieldPermissionTable';import { SettingsRolePermissionsObjectLevelObjectFormObjectLevel } from '@/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevel';import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { t } from '@lingui/core/macro';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { Button } from 'twenty-ui/input';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';type SettingsRolePermissionsObjectLevelObjectFormProps = {roleId: string;diff --git a/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModal.tsx b/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModal.tsxindex 0b5f2a4f421..ecd1c0962eb 100644--- a/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModal.tsx+++ b/packages/twenty-front/src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModal.tsx@@ -1,8 +1,8 @@import { ROLE_SETTINGS_DELETE_ROLE_CONFIRMATION_MODAL_ID } from '@/settings/roles/role-settings/components/constants/RoleSettingsDeleteRoleConfirmationModalId';import { SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle } from '@/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle';-import { SettingsPath } from '@/types/SettingsPath';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';import { t } from '@lingui/core/macro';+import { SettingsPath } from 'twenty-shared/types';import { useDeleteOneRoleMutation } from '~/generated-metadata/graphql';import { useNavigateSettings } from '~/hooks/useNavigateSettings';diff --git a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsxindex 1d8249143c6..047bef5a573 100644--- a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx+++ b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx@@ -10,7 +10,6 @@ import { useSaveDraftRoleToDB } from '@/settings/roles/role/hooks/useSaveDraftRoimport { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';import { settingsPersistedRoleFamilyState } from '@/settings/roles/states/settingsPersistedRoleFamilyState';import { settingsRolesIsLoadingState } from '@/settings/roles/states/settingsRolesIsLoadingState';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { TabList } from '@/ui/layout/tab-list/components/TabList';@@ -20,13 +19,13 @@ import { useLoadCurrentUser } from '@/users/hooks/useLoadCurrentUser';import { t } from '@lingui/core/macro';import { useState } from 'react';import { useRecoilState, useRecoilValue } from 'recoil';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { isDefined, getSettingsPath } from 'twenty-shared/utils';import { IconLockOpen, IconSettings, IconUserPlus } from 'twenty-ui/display';import { useNavigateSettings } from '~/hooks/useNavigateSettings';import { getDirtyFields } from '~/utils/getDirtyFields';import { isDeeplyEqual } from '~/utils/isDeeplyEqual';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';type SettingsRoleProps = {roleId: string;diff --git a/packages/twenty-front/src/modules/settings/roles/role/hooks/useSaveDraftRoleToDB.ts b/packages/twenty-front/src/modules/settings/roles/role/hooks/useSaveDraftRoleToDB.tsindex c2ca8b90481..3c2cb1e488b 100644--- a/packages/twenty-front/src/modules/settings/roles/role/hooks/useSaveDraftRoleToDB.ts+++ b/packages/twenty-front/src/modules/settings/roles/role/hooks/useSaveDraftRoleToDB.ts@@ -6,9 +6,9 @@ import { useRemoveFieldPermissionInDraftRole } from '@/settings/roles/role-permiimport { newFieldPermissionsFilter } from '@/settings/roles/role/hooks/utils/newFieldPermissionsFilter.util';import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';import { settingsPersistedRoleFamilyState } from '@/settings/roles/states/settingsPersistedRoleFamilyState';-import { SettingsPath } from '@/types/SettingsPath';import { getOperationName } from '@apollo/client/utilities';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import {useCreateOneRoleMutation,diff --git a/packages/twenty-front/src/modules/settings/security/components/SSO/SettingsSSOIdentitiesProvidersListCard.tsx b/packages/twenty-front/src/modules/settings/security/components/SSO/SettingsSSOIdentitiesProvidersListCard.tsxindex 0ae5173084f..74efe45e553 100644--- a/packages/twenty-front/src/modules/settings/security/components/SSO/SettingsSSOIdentitiesProvidersListCard.tsx+++ b/packages/twenty-front/src/modules/settings/security/components/SSO/SettingsSSOIdentitiesProvidersListCard.tsx@@ -2,7 +2,7 @@import { Link } from 'react-router-dom';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';import { SettingsCard } from '@/settings/components/SettingsCard';@@ -14,9 +14,9 @@ import isPropValid from '@emotion/is-prop-valid';import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';import { useRecoilState, useRecoilValue } from 'recoil';+import { getSettingsPath } from 'twenty-shared/utils';import { IconKey } from 'twenty-ui/display';import { useGetSsoIdentityProvidersQuery } from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledLink = styled(Link, {shouldForwardProp: (prop) => isPropValid(prop) && prop !== 'isDisabled',diff --git a/packages/twenty-front/src/modules/settings/security/components/SSO/SettingsSSOIdentitiesProvidersListCardWrapper.tsx b/packages/twenty-front/src/modules/settings/security/components/SSO/SettingsSSOIdentitiesProvidersListCardWrapper.tsxindex c6dddf82feb..e5b2c1e67c6 100644--- a/packages/twenty-front/src/modules/settings/security/components/SSO/SettingsSSOIdentitiesProvidersListCardWrapper.tsx+++ b/packages/twenty-front/src/modules/settings/security/components/SSO/SettingsSSOIdentitiesProvidersListCardWrapper.tsx@@ -4,8 +4,8 @@ import { SettingsListCard } from '@/settings/components/SettingsListCard';import { SettingsSSOIdentityProviderRowRightContainer } from '@/settings/security/components/SSO/SettingsSSOIdentityProviderRowRightContainer';import { SSOIdentitiesProvidersState } from '@/settings/security/states/SSOIdentitiesProvidersState';import { guessSSOIdentityProviderIconByUrl } from '@/settings/security/utils/guessSSOIdentityProviderIconByUrl';-import { SettingsPath } from '@/types/SettingsPath';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';import { useNavigateSettings } from '~/hooks/useNavigateSettings';export const SettingsSSOIdentitiesProvidersListCardWrapper = () => {diff --git a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsApprovedAccessDomainsListCard.tsx b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsApprovedAccessDomainsListCard.tsxindex 8c5fb131ae9..a3ab7e9eee8 100644--- a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsApprovedAccessDomainsListCard.tsx+++ b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsApprovedAccessDomainsListCard.tsx@@ -1,6 +1,6 @@import { Link, useNavigate } from 'react-router-dom';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';import { SettingsCard } from '@/settings/components/SettingsCard';import { SettingsListCard } from '@/settings/components/SettingsListCard';@@ -12,11 +12,11 @@ import { ApolloError } from '@apollo/client';import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';import { useRecoilState, useRecoilValue } from 'recoil';+import { getSettingsPath } from 'twenty-shared/utils';import { IconAt, IconMailCog, Status } from 'twenty-ui/display';import { useGetApprovedAccessDomainsQuery } from '~/generated-metadata/graphql';import { dateLocaleState } from '~/localization/states/dateLocaleState';import { beautifyPastDateRelativeToNow } from '~/utils/date-utils';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledLink = styled(Link)`text-decoration: none;diff --git a/packages/twenty-front/src/modules/settings/serverless-functions/components/SettingsServerlessFunctionsTable.tsx b/packages/twenty-front/src/modules/settings/serverless-functions/components/SettingsServerlessFunctionsTable.tsxindex f3330de0cc2..e6ccf1b66fc 100644--- a/packages/twenty-front/src/modules/settings/serverless-functions/components/SettingsServerlessFunctionsTable.tsx+++ b/packages/twenty-front/src/modules/settings/serverless-functions/components/SettingsServerlessFunctionsTable.tsx@@ -2,14 +2,14 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContainimport { SettingsServerlessFunctionsFieldItemTableRow } from '@/settings/serverless-functions/components/SettingsServerlessFunctionsFieldItemTableRow';import { SettingsServerlessFunctionsTableEmpty } from '@/settings/serverless-functions/components/SettingsServerlessFunctionsTableEmpty';import { useGetManyServerlessFunctions } from '@/settings/serverless-functions/hooks/useGetManyServerlessFunctions';-import { SettingsPath } from '@/types/SettingsPath';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 { TableRow } from '@/ui/layout/table/components/TableRow';import styled from '@emotion/styled';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { type ServerlessFunction } from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledTableRow = styled(TableRow)`grid-template-columns: 312px 132px 68px;diff --git a/packages/twenty-front/src/modules/settings/serverless-functions/components/SettingsServerlessFunctionsTableEmpty.tsx b/packages/twenty-front/src/modules/settings/serverless-functions/components/SettingsServerlessFunctionsTableEmpty.tsxindex b28834155f4..052d8e70952 100644--- a/packages/twenty-front/src/modules/settings/serverless-functions/components/SettingsServerlessFunctionsTableEmpty.tsx+++ b/packages/twenty-front/src/modules/settings/serverless-functions/components/SettingsServerlessFunctionsTableEmpty.tsx@@ -1,6 +1,8 @@-import { SettingsPath } from '@/types/SettingsPath';import styled from '@emotion/styled';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';+import { IconPlus } from 'twenty-ui/display';+import { Button } from 'twenty-ui/input';import {AnimatedPlaceholder,AnimatedPlaceholderEmptyContainer,@@ -9,8 +11,6 @@ import {AnimatedPlaceholderEmptyTitle,EMPTY_PLACEHOLDER_TRANSITION_PROPS,} from 'twenty-ui/layout';-import { Button } from 'twenty-ui/input';-import { IconPlus } from 'twenty-ui/display';const StyledEmptyFunctionsContainer = styled.div`height: 60vh;diff --git a/packages/twenty-front/src/modules/settings/serverless-functions/components/tabs/SettingsServerlessFunctionSettingsTab.tsx b/packages/twenty-front/src/modules/settings/serverless-functions/components/tabs/SettingsServerlessFunctionSettingsTab.tsxindex 4fd2a26a22b..1e3a35e1b5a 100644--- a/packages/twenty-front/src/modules/settings/serverless-functions/components/tabs/SettingsServerlessFunctionSettingsTab.tsx+++ b/packages/twenty-front/src/modules/settings/serverless-functions/components/tabs/SettingsServerlessFunctionSettingsTab.tsx@@ -2,9 +2,9 @@ import { SettingsServerlessFunctionNewForm } from '@/settings/serverless-functioimport { SettingsServerlessFunctionTabEnvironmentVariablesSection } from '@/settings/serverless-functions/components/tabs/SettingsServerlessFunctionTabEnvironmentVariablesSection';import { useDeleteOneServerlessFunction } from '@/settings/serverless-functions/hooks/useDeleteOneServerlessFunction';import { type ServerlessFunctionFormValues } from '@/settings/serverless-functions/hooks/useServerlessFunctionUpdateFormState';-import { SettingsPath } from '@/types/SettingsPath';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';import { useModal } from '@/ui/layout/modal/hooks/useModal';+import { SettingsPath } from 'twenty-shared/types';import { H2Title } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';diff --git a/packages/twenty-front/src/modules/settings/two-factor-authentication/components/DeleteTwoFactorAuthenticationMethod.tsx b/packages/twenty-front/src/modules/settings/two-factor-authentication/components/DeleteTwoFactorAuthenticationMethod.tsxindex f57b55f8441..b925563bc02 100644--- a/packages/twenty-front/src/modules/settings/two-factor-authentication/components/DeleteTwoFactorAuthenticationMethod.tsx+++ b/packages/twenty-front/src/modules/settings/two-factor-authentication/components/DeleteTwoFactorAuthenticationMethod.tsx@@ -2,13 +2,13 @@ import { useRecoilValue } from 'recoil';import { useAuth } from '@/auth/hooks/useAuth';import { currentUserState } from '@/auth/states/currentUserState';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';import { useModal } from '@/ui/layout/modal/hooks/useModal';import { useLoadCurrentUser } from '@/users/hooks/useLoadCurrentUser';import { useLingui } from '@lingui/react/macro';import { useParams } from 'react-router-dom';+import { SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';diff --git a/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useTwoFactorVerificationForSettings.ts b/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useTwoFactorVerificationForSettings.tsindex b6e31af4958..c4dd662012f 100644--- a/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useTwoFactorVerificationForSettings.ts+++ b/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useTwoFactorVerificationForSettings.ts@@ -1,12 +1,12 @@import { type OTPFormValues } from '@/auth/sign-in-up/hooks/useTwoFactorAuthenticationForm';import { VERIFY_TWO_FACTOR_AUTHENTICATION_METHOD_FOR_AUTHENTICATED_USER } from '@/settings/two-factor-authentication/graphql/mutations/verifyTwoFactorAuthenticationMethod';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { useLoadCurrentUser } from '@/users/hooks/useLoadCurrentUser';import { useMutation } from '@apollo/client';import { useLingui } from '@lingui/react/macro';import { useState } from 'react';import { useForm } from 'react-hook-form';+import { SettingsPath } from 'twenty-shared/types';import { useNavigateSettings } from '~/hooks/useNavigateSettings';export const useTwoFactorVerificationForSettings = () => {diff --git a/packages/twenty-front/src/modules/sign-in-background-mock/components/SignInAppNavigationDrawerMock.tsx b/packages/twenty-front/src/modules/sign-in-background-mock/components/SignInAppNavigationDrawerMock.tsxindex 67864aae7d8..02259de1c81 100644--- a/packages/twenty-front/src/modules/sign-in-background-mock/components/SignInAppNavigationDrawerMock.tsx+++ b/packages/twenty-front/src/modules/sign-in-background-mock/components/SignInAppNavigationDrawerMock.tsx@@ -4,16 +4,16 @@ import { NavigationDrawerFixedContent } from '@/ui/navigation/navigation-drawer/import { NavigationDrawerSectionForObjectMetadataItems } from '@/object-metadata/components/NavigationDrawerSectionForObjectMetadataItems';import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';-import { SettingsPath } from '@/types/SettingsPath';import { NavigationDrawerItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';import { NavigationDrawerSection } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSection';import { DEFAULT_WORKSPACE_NAME } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceName';import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconSearch, IconSettings } from 'twenty-ui/display';import { getOsControlSymbol, useIsMobile } from 'twenty-ui/utilities';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledMainSection = styled(NavigationDrawerSection)`min-height: fit-content;diff --git a/packages/twenty-front/src/modules/types/ExtractPathParams.ts b/packages/twenty-front/src/modules/types/ExtractPathParams.tsdeleted file mode 100644index d9c14ef2c5b..00000000000--- a/packages/twenty-front/src/modules/types/ExtractPathParams.ts+++ /dev/null@@ -1,6 +0,0 @@-export type ExtractPathParams<V extends string> =- V extends `${string}:${infer Param}/${infer Rest}`- ? Param | ExtractPathParams<`/${Rest}`>- : V extends `${string}:${infer Param}`- ? Param- : never;diff --git a/packages/twenty-front/src/modules/ui/layout/fullscreen/hooks/useShowFullscreen.ts b/packages/twenty-front/src/modules/ui/layout/fullscreen/hooks/useShowFullscreen.tsindex 4a0e0d0c48b..daa3ffc9d9b 100644--- a/packages/twenty-front/src/modules/ui/layout/fullscreen/hooks/useShowFullscreen.ts+++ b/packages/twenty-front/src/modules/ui/layout/fullscreen/hooks/useShowFullscreen.ts@@ -1,7 +1,7 @@import { useMemo } from 'react';-import { SettingsPath } from '@/types/SettingsPath';import { useLocation } from 'react-router-dom';+import { SettingsPath } from 'twenty-shared/types';import { isMatchingLocation } from '~/utils/isMatchingLocation';export const useShowFullscreen = () => {diff --git a/packages/twenty-front/src/modules/ui/layout/hooks/__tests__/useShowAuthModal.test.tsx b/packages/twenty-front/src/modules/ui/layout/hooks/__tests__/useShowAuthModal.test.tsxindex 70e7ec93972..1d67efa241d 100644--- a/packages/twenty-front/src/modules/ui/layout/hooks/__tests__/useShowAuthModal.test.tsx+++ b/packages/twenty-front/src/modules/ui/layout/hooks/__tests__/useShowAuthModal.test.tsx@@ -2,8 +2,8 @@ import { renderHook } from '@testing-library/react';import * as reactRouterDom from 'react-router-dom';import { RecoilRoot } from 'recoil';-import { AppPath } from '@/types/AppPath';import { useShowAuthModal } from '@/ui/layout/hooks/useShowAuthModal';+import { AppPath } from 'twenty-shared/types';import { isMatchingLocation } from '~/utils/isMatchingLocation';jest.mock('react-router-dom', () => ({diff --git a/packages/twenty-front/src/modules/ui/layout/hooks/useShowAuthModal.ts b/packages/twenty-front/src/modules/ui/layout/hooks/useShowAuthModal.tsindex 3e4e498e105..ebfc27ffacd 100644--- a/packages/twenty-front/src/modules/ui/layout/hooks/useShowAuthModal.ts+++ b/packages/twenty-front/src/modules/ui/layout/hooks/useShowAuthModal.ts@@ -1,7 +1,7 @@import { useMemo } from 'react';-import { AppPath } from '@/types/AppPath';import { useLocation } from 'react-router-dom';+import { AppPath } from 'twenty-shared/types';import { isMatchingLocation } from '~/utils/isMatchingLocation';export const useShowAuthModal = () => {diff --git a/packages/twenty-front/src/modules/ui/layout/page/components/DefaultLayout.tsx b/packages/twenty-front/src/modules/ui/layout/page/components/DefaultLayout.tsxindex 39e0c418463..b470b7f3e45 100644--- a/packages/twenty-front/src/modules/ui/layout/page/components/DefaultLayout.tsx+++ b/packages/twenty-front/src/modules/ui/layout/page/components/DefaultLayout.tsx@@ -18,6 +18,8 @@ import { Global, css, useTheme } from '@emotion/react';import styled from '@emotion/styled';import { AnimatePresence, LayoutGroup, motion } from 'framer-motion';import { Outlet, useLocation } from 'react-router-dom';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { useScreenSize } from 'twenty-ui/utilities';const StyledLayout = styled.div`@@ -61,8 +63,10 @@ export const DefaultLayout = () => {const isSettingsPage = useIsSettingsPage();const location = useLocation();const isPageLayoutEditor =- location.pathname.includes('/settings/page-layout/new') ||- location.pathname.match(/\/settings\/page-layout\/[^/]+$/);+ location.pathname.includes(getSettingsPath(SettingsPath.PageLayoutNew)) ||+ location.pathname.match(+ new RegExp(`${getSettingsPath(SettingsPath.PageLayout)}/[^/]+$`),+ );const theme = useTheme();const windowsWidth = useScreenSize().width;const showAuthModal = useShowAuthModal();diff --git a/packages/twenty-front/src/modules/ui/layout/tab-list/components/__stories__/Tablist.stories.tsx b/packages/twenty-front/src/modules/ui/layout/tab-list/components/__stories__/Tablist.stories.tsxindex 7bc98465905..bd6c3766ceb 100644--- a/packages/twenty-front/src/modules/ui/layout/tab-list/components/__stories__/Tablist.stories.tsx+++ b/packages/twenty-front/src/modules/ui/layout/tab-list/components/__stories__/Tablist.stories.tsx@@ -1,5 +1,6 @@import styled from '@emotion/styled';import { type Meta, type StoryObj } from '@storybook/react';+import { useState } from 'react';import {IconCalendar,IconCheckbox,@@ -11,6 +12,8 @@ import {} from 'twenty-ui/display';import { ComponentWithRouterDecorator } from 'twenty-ui/testing';import { TabList } from '../TabList';+import { type TabListProps } from '../../types/TabListProps';+import { type SingleTabProps } from '../../types/SingleTabProps';const tabs = [{ id: 'general', title: 'General', logo: 'https://picsum.photos/200' },@@ -80,3 +83,72 @@ export const Default: Story = {</StyledInteractiveContainer>),};++type TabListWithAddProps = Pick<+ TabListProps,+ 'componentInstanceId' | 'loading' | 'isInRightDrawer' | 'className'+> & {+ initialTabs: SingleTabProps[];+};++const TabListWithAdd = ({+ componentInstanceId,+ loading,+ isInRightDrawer,+ className,+ initialTabs,+}: TabListWithAddProps) => {+ const [currentTabs, setCurrentTabs] = useState<SingleTabProps[]>(initialTabs);+ const [nextTabId, setNextTabId] = useState(initialTabs.length + 1);++ const handleAddTab = () => {+ const newTab: SingleTabProps = {+ id: `new-tab-${nextTabId}`,+ title: `New Tab ${nextTabId}`,+ Icon: IconCheckbox,+ };+ setCurrentTabs([...currentTabs, newTab]);+ setNextTabId(nextTabId + 1);+ };++ return (+ <StyledInteractiveContainer>+ <p>+ <strong>Click the + button to add new tabs!</strong>+ </p>+ <TabList+ tabs={currentTabs}+ componentInstanceId={componentInstanceId}+ loading={loading}+ behaveAsLinks={false}+ isInRightDrawer={isInRightDrawer}+ className={className}+ onAddTab={handleAddTab}+ />+ </StyledInteractiveContainer>+ );+};++export const WithAddTab: Story = {+ args: {+ componentInstanceId: 'tabs-with-add',+ tabs: tabs.slice(0, 3),+ },+ render: (args) => (+ <TabListWithAdd+ componentInstanceId={args.componentInstanceId}+ loading={args.loading}+ isInRightDrawer={args.isInRightDrawer}+ className={args.className}+ initialTabs={args.tabs}+ />+ ),+ parameters: {+ docs: {+ description: {+ story:+ 'TabList with the ability to add new tabs dynamically using the onAddTab callback. Click the + button to add new tabs.',+ },+ },+ },+};diff --git a/packages/twenty-front/src/modules/ui/layout/tab-list/utils/calculateVisibleTabCount.ts b/packages/twenty-front/src/modules/ui/layout/tab-list/utils/calculateVisibleTabCount.tsindex 72e4d4ed35a..fad27106297 100644--- a/packages/twenty-front/src/modules/ui/layout/tab-list/utils/calculateVisibleTabCount.ts+++ b/packages/twenty-front/src/modules/ui/layout/tab-list/utils/calculateVisibleTabCount.ts@@ -2,6 +2,7 @@ import { TAB_LIST_GAP } from '@/ui/layout/tab-list/constants/TabListGap';import { TAB_LIST_LEFT_PADDING } from '@/ui/layout/tab-list/constants/TabListPadding';import { type SingleTabProps } from '@/ui/layout/tab-list/types/SingleTabProps';import { type TabWidthsById } from '@/ui/layout/tab-list/types/TabWidthsById';+import { isDefined } from 'twenty-shared/utils';type CalculateVisibleTabCountParams = {visibleTabs: SingleTabProps[];@@ -22,7 +23,6 @@ export const calculateVisibleTabCount = ({return visibleTabs.length;}- // Subtract add button width if presentconst availableWidth =containerWidth -TAB_LIST_LEFT_PADDING -@@ -33,8 +33,7 @@ export const calculateVisibleTabCount = ({const tab = visibleTabs[i];const tabWidth = tabWidthsById[tab.id];- // Skip if width not measured yet- if (tabWidth === undefined) {+ if (!isDefined(tabWidth)) {return visibleTabs.length;}diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsxindex 3d20125f348..1c6f0234afa 100644--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx@@ -6,8 +6,6 @@ import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';import { countAvailableWorkspaces } from '@/auth/utils/availableWorkspacesUtils';import { useBuildWorkspaceUrl } from '@/domain-manager/hooks/useBuildWorkspaceUrl';import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';@@ -23,6 +21,8 @@ import { type ApolloError } from '@apollo/client';import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';import { useRecoilValue, useSetRecoilState } from 'recoil';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import {Avatar,IconDotsVertical,@@ -42,7 +42,6 @@ import {useSignUpInNewWorkspaceMutation,} from '~/generated-metadata/graphql';import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledDescription = styled.div`color: ${({ theme }) => theme.font.color.light};diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/__stories__/NavigationDrawer.stories.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/__stories__/NavigationDrawer.stories.tsxindex 18d8b198f7a..4cd72e4c77e 100644--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/__stories__/NavigationDrawer.stories.tsx+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/__stories__/NavigationDrawer.stories.tsx@@ -1,11 +1,11 @@-import { expect, within } from '@storybook/test';import { type Meta, type StoryObj } from '@storybook/react';+import { expect, within } from '@storybook/test';import { useEffect } from 'react';import { useSetRecoilState } from 'recoil';import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';import { PrefetchLoadedDecorator } from '~/testing/decorators/PrefetchLoadedDecorator';@@ -17,6 +17,7 @@ import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockOimport { CurrentWorkspaceMemberFavoritesFolders } from '@/favorites/components/CurrentWorkspaceMemberFavoritesFolders';import { NavigationDrawerFixedContent } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerFixedContent';import { NavigationDrawerSubItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSubItem';+import { getSettingsPath } from 'twenty-shared/utils';import {IconAt,IconBell,@@ -36,7 +37,7 @@ import {import { AdvancedSettingsToggle } from 'twenty-ui/navigation';import { getOsControlSymbol } from 'twenty-ui/utilities';import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { NavigationDrawer } from '../NavigationDrawer';import { NavigationDrawerItem } from '../NavigationDrawerItem';import { NavigationDrawerItemGroup } from '../NavigationDrawerItemGroup';diff --git a/packages/twenty-front/src/modules/users/components/UserProvider.tsx b/packages/twenty-front/src/modules/users/components/UserProvider.tsxindex 796f59b4cf8..9f9a762fd10 100644--- a/packages/twenty-front/src/modules/users/components/UserProvider.tsx+++ b/packages/twenty-front/src/modules/users/components/UserProvider.tsx@@ -3,9 +3,9 @@ import { useRecoilValue } from 'recoil';import { isCurrentUserLoadedState } from '@/auth/states/isCurrentUserLoadedState';import { dateTimeFormatState } from '@/localization/states/dateTimeFormatState';-import { AppPath } from '@/types/AppPath';import { UserContext } from '@/users/contexts/UserContext';import { useLocation } from 'react-router-dom';+import { AppPath } from 'twenty-shared/types';import { UserOrMetadataLoader } from '~/loading/components/UserOrMetadataLoader';import { isMatchingLocation } from '~/utils/isMatchingLocation';diff --git a/packages/twenty-front/src/modules/users/components/UserProviderEffect.tsx b/packages/twenty-front/src/modules/users/components/UserProviderEffect.tsxindex f402252d1a5..33a6d0e8799 100644--- a/packages/twenty-front/src/modules/users/components/UserProviderEffect.tsx+++ b/packages/twenty-front/src/modules/users/components/UserProviderEffect.tsx@@ -17,7 +17,6 @@ import { detectTimeFormat } from '@/localization/utils/detectTimeFormat';import { detectTimeZone } from '@/localization/utils/detectTimeZone';import { getDateFormatFromWorkspaceDateFormat } from '@/localization/utils/getDateFormatFromWorkspaceDateFormat';import { getTimeFormatFromWorkspaceTimeFormat } from '@/localization/utils/getTimeFormatFromWorkspaceTimeFormat';-import { AppPath } from '@/types/AppPath';import { getDateFnsLocale } from '@/ui/field/display/utils/getDateFnsLocale.util';import { coreViewsState } from '@/views/states/coreViewState';import { type CoreViewWithRelations } from '@/views/types/CoreViewWithRelations';@@ -26,7 +25,7 @@ import { enUS } from 'date-fns/locale';import { useEffect } from 'react';import { useLocation } from 'react-router-dom';import { type APP_LOCALES, SOURCE_LOCALE } from 'twenty-shared/translations';-import { type ObjectPermissions } from 'twenty-shared/types';+import { AppPath, type ObjectPermissions } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import {type WorkspaceMember,diff --git a/packages/twenty-front/src/modules/views/view-picker/hooks/useGetAvailableFieldsForKanban.ts b/packages/twenty-front/src/modules/views/view-picker/hooks/useGetAvailableFieldsForKanban.tsindex 9738e91b312..6c11b244df8 100644--- a/packages/twenty-front/src/modules/views/view-picker/hooks/useGetAvailableFieldsForKanban.ts+++ b/packages/twenty-front/src/modules/views/view-picker/hooks/useGetAvailableFieldsForKanban.ts@@ -3,10 +3,10 @@ import { useLocation } from 'react-router-dom';import { useRecoilValue, useSetRecoilState } from 'recoil';import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';-import { SettingsPath } from '@/types/SettingsPath';import { navigationMemorizedUrlState } from '@/ui/navigation/states/navigationMemorizedUrlState';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { viewObjectMetadataIdComponentState } from '@/views/states/viewObjectMetadataIdComponentState';+import { SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { FieldMetadataType } from '~/generated-metadata/graphql';import { useNavigateSettings } from '~/hooks/useNavigateSettings';diff --git a/packages/twenty-front/src/modules/workflow/components/OverrideWorkflowDraftConfirmationModal.tsx b/packages/twenty-front/src/modules/workflow/components/OverrideWorkflowDraftConfirmationModal.tsxindex 04630e4ef7b..f342eccb263 100644--- a/packages/twenty-front/src/modules/workflow/components/OverrideWorkflowDraftConfirmationModal.tsx+++ b/packages/twenty-front/src/modules/workflow/components/OverrideWorkflowDraftConfirmationModal.tsx@@ -1,5 +1,4 @@import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';-import { AppPath } from '@/types/AppPath';import {ConfirmationModal,StyledCenteredButton,@@ -8,8 +7,9 @@ import { useModal } from '@/ui/layout/modal/hooks/useModal';import { OVERRIDE_WORKFLOW_DRAFT_CONFIRMATION_MODAL_ID } from '@/workflow/constants/OverrideWorkflowDraftConfirmationModalId';import { useCreateDraftFromWorkflowVersion } from '@/workflow/hooks/useCreateDraftFromWorkflowVersion';import { useLingui } from '@lingui/react/macro';+import { AppPath } from 'twenty-shared/types';+import { getAppPath } from 'twenty-shared/utils';import { useNavigateApp } from '~/hooks/useNavigateApp';-import { getAppPath } from '~/utils/navigation/getAppPath';export const OverrideWorkflowDraftConfirmationModal = ({workflowId,diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionSendEmail.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionSendEmail.tsxindex e7db8c1bdfe..d03272644a6 100644--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionSendEmail.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionSendEmail.tsx@@ -6,7 +6,6 @@ import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput';import { useTriggerApisOAuth } from '@/settings/accounts/hooks/useTriggerApiOAuth';-import { SettingsPath } from '@/types/SettingsPath';import { Select } from '@/ui/input/components/Select';import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';@@ -19,7 +18,7 @@ import { WorkflowVariablePicker } from '@/workflow/workflow-variables/componentsimport { useTheme } from '@emotion/react';import { useEffect, useState } from 'react';import { useRecoilValue } from 'recoil';-import { ConnectedAccountProvider } from 'twenty-shared/types';+import { ConnectedAccountProvider, SettingsPath } from 'twenty-shared/types';import { assertUnreachable, isDefined } from 'twenty-shared/utils';import { IconPlus, useIcons } from 'twenty-ui/display';import { type SelectOption } from 'twenty-ui/input';diff --git a/packages/twenty-front/src/pages/auth/Authorize.tsx b/packages/twenty-front/src/pages/auth/Authorize.tsxindex b57fdd2330f..1c5fad16a76 100644--- a/packages/twenty-front/src/pages/auth/Authorize.tsx+++ b/packages/twenty-front/src/pages/auth/Authorize.tsx@@ -1,7 +1,7 @@-import { AppPath } from '@/types/AppPath';import styled from '@emotion/styled';import { useEffect, useState } from 'react';import { useSearchParams } from 'react-router-dom';+import { AppPath } from 'twenty-shared/types';import { useRedirect } from '@/domain-manager/hooks/useRedirect';import { useLingui } from '@lingui/react/macro';diff --git a/packages/twenty-front/src/pages/auth/PasswordReset.tsx b/packages/twenty-front/src/pages/auth/PasswordReset.tsxindex c02b404f4b0..b5685e3cc5b 100644--- a/packages/twenty-front/src/pages/auth/PasswordReset.tsx+++ b/packages/twenty-front/src/pages/auth/PasswordReset.tsx@@ -6,7 +6,6 @@ import { useIsLogged } from '@/auth/hooks/useIsLogged';import { workspacePublicDataState } from '@/auth/states/workspacePublicDataState';import { PASSWORD_REGEX } from '@/auth/utils/passwordRegex';import { useReadCaptchaToken } from '@/captcha/hooks/useReadCaptchaToken';-import { AppPath } from '@/types/AppPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { TextInput } from '@/ui/input/components/TextInput';import { Modal } from '@/ui/layout/modal/components/Modal';@@ -22,6 +21,7 @@ import { Controller, useForm } from 'react-hook-form';import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';import { useParams } from 'react-router-dom';import { useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { MainButton } from 'twenty-ui/input';import { AnimatedEaseIn } from 'twenty-ui/utilities';import { z } from 'zod';diff --git a/packages/twenty-front/src/pages/auth/__stories__/SignInUp.stories.tsx b/packages/twenty-front/src/pages/auth/__stories__/SignInUp.stories.tsxindex f3176c1ff33..4407df2dae1 100644--- a/packages/twenty-front/src/pages/auth/__stories__/SignInUp.stories.tsx+++ b/packages/twenty-front/src/pages/auth/__stories__/SignInUp.stories.tsx@@ -10,7 +10,7 @@ import {} from '~/testing/decorators/PageDecorator';import { graphqlMocks } from '~/testing/graphqlMocks';-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';import { SignInUp } from '../SignInUp';const meta: Meta<PageDecoratorArgs> = {diff --git a/packages/twenty-front/src/pages/auth/__stories__/SignInUpWithInvite.stories.tsx b/packages/twenty-front/src/pages/auth/__stories__/SignInUpWithInvite.stories.tsxindex 93d50927467..3bb140889d5 100644--- a/packages/twenty-front/src/pages/auth/__stories__/SignInUpWithInvite.stories.tsx+++ b/packages/twenty-front/src/pages/auth/__stories__/SignInUpWithInvite.stories.tsx@@ -11,7 +11,7 @@ import {} from '~/testing/decorators/PageDecorator';import { graphqlMocks } from '~/testing/graphqlMocks';-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';import { SignInUp } from '../SignInUp';const meta: Meta<PageDecoratorArgs> = {diff --git a/packages/twenty-front/src/pages/not-found/NotFound.tsx b/packages/twenty-front/src/pages/not-found/NotFound.tsxindex 2c16a20b3a0..c57c9e87b18 100644--- a/packages/twenty-front/src/pages/not-found/NotFound.tsx+++ b/packages/twenty-front/src/pages/not-found/NotFound.tsx@@ -1,10 +1,11 @@import { SignInBackgroundMockPage } from '@/sign-in-background-mock/components/SignInBackgroundMockPage';-import { AppPath } from '@/types/AppPath';import { Trans, useLingui } from '@lingui/react/macro';+import { AppPath } from 'twenty-shared/types';import { RootStackingContextZIndices } from '@/ui/layout/constants/RootStackingContextZIndices';import { PageTitle } from '@/ui/utilities/page-title/components/PageTitle';import styled from '@emotion/styled';+import { MainButton } from 'twenty-ui/input';import {AnimatedPlaceholder,AnimatedPlaceholderEmptyTextContainer,@@ -12,7 +13,6 @@ import {AnimatedPlaceholderErrorSubTitle,AnimatedPlaceholderErrorTitle,} from 'twenty-ui/layout';-import { MainButton } from 'twenty-ui/input';import { UndecoratedLink } from 'twenty-ui/navigation';const StyledBackDrop = styled.div`diff --git a/packages/twenty-front/src/pages/onboarding/BookCall.tsx b/packages/twenty-front/src/pages/onboarding/BookCall.tsxindex 2c6d16d5378..f1bd45f48d4 100644--- a/packages/twenty-front/src/pages/onboarding/BookCall.tsx+++ b/packages/twenty-front/src/pages/onboarding/BookCall.tsx@@ -5,12 +5,12 @@ import { Link } from 'react-router-dom';import { currentUserState } from '@/auth/states/currentUserState';import { calendarBookingPageIdState } from '@/client-config/states/calendarBookingPageIdState';import { useSetNextOnboardingStatus } from '@/onboarding/hooks/useSetNextOnboardingStatus';-import { AppPath } from '@/types/AppPath';import { Modal } from '@/ui/layout/modal/components/Modal';import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';import { useTheme } from '@emotion/react';import { useLingui } from '@lingui/react/macro';import { useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { IconChevronLeft, IconChevronRightPipe } from 'twenty-ui/display';import { LightButton } from 'twenty-ui/input';import { useIsMobile } from 'twenty-ui/utilities';diff --git a/packages/twenty-front/src/pages/onboarding/BookCallDecision.tsx b/packages/twenty-front/src/pages/onboarding/BookCallDecision.tsxindex 039d4d158c1..78ebb06bb1f 100644--- a/packages/twenty-front/src/pages/onboarding/BookCallDecision.tsx+++ b/packages/twenty-front/src/pages/onboarding/BookCallDecision.tsx@@ -1,11 +1,11 @@import { SubTitle } from '@/auth/components/SubTitle';import { Title } from '@/auth/components/Title';import { useSetNextOnboardingStatus } from '@/onboarding/hooks/useSetNextOnboardingStatus';-import { AppPath } from '@/types/AppPath';import { Modal } from '@/ui/layout/modal/components/Modal';import styled from '@emotion/styled';import { Trans, useLingui } from '@lingui/react/macro';import { Link } from 'react-router-dom';+import { AppPath } from 'twenty-shared/types';import { LightButton, MainButton } from 'twenty-ui/input';import { useSkipBookOnboardingStepMutation } from '~/generated-metadata/graphql';diff --git a/packages/twenty-front/src/pages/onboarding/ChooseYourPlan.tsx b/packages/twenty-front/src/pages/onboarding/ChooseYourPlan.tsxindex df2d1dddce6..58fffef7325 100644--- a/packages/twenty-front/src/pages/onboarding/ChooseYourPlan.tsx+++ b/packages/twenty-front/src/pages/onboarding/ChooseYourPlan.tsx@@ -10,11 +10,11 @@ import { useHandleCheckoutSession } from '@/billing/hooks/useHandleCheckoutSessiimport { isBillingPriceLicensed } from '@/billing/utils/isBillingPriceLicensed';import { billingState } from '@/client-config/states/billingState';import { calendarBookingPageIdState } from '@/client-config/states/calendarBookingPageIdState';-import { AppPath } from '@/types/AppPath';import { Modal } from '@/ui/layout/modal/components/Modal';import styled from '@emotion/styled';import { Trans, useLingui } from '@lingui/react/macro';import { useRecoilState, useRecoilValue } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { Loader } from 'twenty-ui/feedback';import { CardPicker, MainButton } from 'twenty-ui/input';diff --git a/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx b/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsxindex 75e225d53cc..f9afb3d7e92 100644--- a/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx+++ b/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx@@ -2,12 +2,12 @@ import { SubTitle } from '@/auth/components/SubTitle';import { Title } from '@/auth/components/Title';import { currentUserState } from '@/auth/states/currentUserState';import { OnboardingModalCircularIcon } from '@/onboarding/components/OnboardingModalCircularIcon';-import { AppPath } from '@/types/AppPath';import { Modal } from '@/ui/layout/modal/components/Modal';import { useSubscriptionStatus } from '@/workspace/hooks/useSubscriptionStatus';import styled from '@emotion/styled';import { useState } from 'react';import { useSetRecoilState } from 'recoil';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { IconCheck } from 'twenty-ui/display';import { Loader } from 'twenty-ui/feedback';diff --git a/packages/twenty-front/src/pages/onboarding/SyncEmails.tsx b/packages/twenty-front/src/pages/onboarding/SyncEmails.tsxindex 5fe970efb10..24d08a8cfd5 100644--- a/packages/twenty-front/src/pages/onboarding/SyncEmails.tsx+++ b/packages/twenty-front/src/pages/onboarding/SyncEmails.tsx@@ -14,11 +14,10 @@ import { isGoogleMessagingEnabledState } from '@/client-config/states/isGoogleMeimport { isMicrosoftCalendarEnabledState } from '@/client-config/states/isMicrosoftCalendarEnabledState';import { isMicrosoftMessagingEnabledState } from '@/client-config/states/isMicrosoftMessagingEnabledState';import { useTriggerApisOAuth } from '@/settings/accounts/hooks/useTriggerApiOAuth';-import { AppPath } from '@/types/AppPath';import { PageFocusId } from '@/types/PageFocusId';import { Modal } from '@/ui/layout/modal/components/Modal';import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';-import { ConnectedAccountProvider } from 'twenty-shared/types';+import { AppPath, ConnectedAccountProvider } from 'twenty-shared/types';import { IconGoogle, IconMicrosoft } from 'twenty-ui/display';import { MainButton } from 'twenty-ui/input';import { ClickToActionLink } from 'twenty-ui/navigation';diff --git a/packages/twenty-front/src/pages/onboarding/__stories__/ChooseYourPlan.stories.tsx b/packages/twenty-front/src/pages/onboarding/__stories__/ChooseYourPlan.stories.tsxindex 5bc7b640ca7..7e0a49d0a79 100644--- a/packages/twenty-front/src/pages/onboarding/__stories__/ChooseYourPlan.stories.tsx+++ b/packages/twenty-front/src/pages/onboarding/__stories__/ChooseYourPlan.stories.tsx@@ -4,8 +4,8 @@ import { within } from '@storybook/test';import { HttpResponse, graphql } from 'msw';import { BILLING_BASE_PRODUCT_PRICES } from '@/billing/graphql/queries/billingBaseProductPrices';-import { AppPath } from '@/types/AppPath';import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';+import { AppPath } from 'twenty-shared/types';import {BillingPlanKey,OnboardingStatus,diff --git a/packages/twenty-front/src/pages/onboarding/__stories__/CreateProfile.stories.tsx b/packages/twenty-front/src/pages/onboarding/__stories__/CreateProfile.stories.tsxindex 43a790079e4..789b1704b18 100644--- a/packages/twenty-front/src/pages/onboarding/__stories__/CreateProfile.stories.tsx+++ b/packages/twenty-front/src/pages/onboarding/__stories__/CreateProfile.stories.tsx@@ -3,8 +3,8 @@ import { type Meta, type StoryObj } from '@storybook/react';import { within } from '@storybook/test';import { HttpResponse, graphql } from 'msw';-import { AppPath } from '@/types/AppPath';import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';+import { AppPath } from 'twenty-shared/types';import { OnboardingStatus } from '~/generated/graphql';import { CreateProfile } from '~/pages/onboarding/CreateProfile';import {diff --git a/packages/twenty-front/src/pages/onboarding/__stories__/CreateWorkspace.stories.tsx b/packages/twenty-front/src/pages/onboarding/__stories__/CreateWorkspace.stories.tsxindex 667883439e1..50feb6bff6d 100644--- a/packages/twenty-front/src/pages/onboarding/__stories__/CreateWorkspace.stories.tsx+++ b/packages/twenty-front/src/pages/onboarding/__stories__/CreateWorkspace.stories.tsx@@ -3,8 +3,8 @@ import { type Meta, type StoryObj } from '@storybook/react';import { within } from '@storybook/test';import { HttpResponse, graphql } from 'msw';-import { AppPath } from '@/types/AppPath';import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';+import { AppPath } from 'twenty-shared/types';import { OnboardingStatus } from '~/generated/graphql';import { CreateWorkspace } from '~/pages/onboarding/CreateWorkspace';import {diff --git a/packages/twenty-front/src/pages/onboarding/__stories__/InviteTeam.stories.tsx b/packages/twenty-front/src/pages/onboarding/__stories__/InviteTeam.stories.tsxindex 85ede2b3149..2ae4047524b 100644--- a/packages/twenty-front/src/pages/onboarding/__stories__/InviteTeam.stories.tsx+++ b/packages/twenty-front/src/pages/onboarding/__stories__/InviteTeam.stories.tsx@@ -1,8 +1,8 @@-import { AppPath } from '@/types/AppPath';import { getOperationName } from '@apollo/client/utilities';import { type Meta, type StoryObj } from '@storybook/react';import { within } from '@storybook/test';import { HttpResponse, graphql } from 'msw';+import { AppPath } from 'twenty-shared/types';import { OnboardingStatus } from '~/generated/graphql';import { GET_CURRENT_USER } from '~/modules/users/graphql/queries/getCurrentUser';diff --git a/packages/twenty-front/src/pages/onboarding/__stories__/PaymentSuccess.stories.tsx b/packages/twenty-front/src/pages/onboarding/__stories__/PaymentSuccess.stories.tsxindex 28eb9a85cc9..5499d5a8368 100644--- a/packages/twenty-front/src/pages/onboarding/__stories__/PaymentSuccess.stories.tsx+++ b/packages/twenty-front/src/pages/onboarding/__stories__/PaymentSuccess.stories.tsx@@ -3,8 +3,8 @@ import { type Meta, type StoryObj } from '@storybook/react';import { within } from '@storybook/test';import { HttpResponse, graphql } from 'msw';-import { AppPath } from '@/types/AppPath';import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';+import { AppPath } from 'twenty-shared/types';import { OnboardingStatus } from '~/generated/graphql';import { PaymentSuccess } from '~/pages/onboarding/PaymentSuccess';import {diff --git a/packages/twenty-front/src/pages/onboarding/__stories__/SyncEmails.stories.tsx b/packages/twenty-front/src/pages/onboarding/__stories__/SyncEmails.stories.tsxindex 6a8ef7f7cdc..e468830fa87 100644--- a/packages/twenty-front/src/pages/onboarding/__stories__/SyncEmails.stories.tsx+++ b/packages/twenty-front/src/pages/onboarding/__stories__/SyncEmails.stories.tsx@@ -1,8 +1,8 @@-import { AppPath } from '@/types/AppPath';import { getOperationName } from '@apollo/client/utilities';import { type Meta, type StoryObj } from '@storybook/react';import { within } from '@storybook/test';import { HttpResponse, graphql } from 'msw';+import { AppPath } from 'twenty-shared/types';import { OnboardingStatus } from '~/generated/graphql';import { GET_CURRENT_USER } from '~/modules/users/graphql/queries/getCurrentUser';diff --git a/packages/twenty-front/src/pages/settings/SettingsBilling.tsx b/packages/twenty-front/src/pages/settings/SettingsBilling.tsxindex ef166690c4a..b7e963f75f8 100644--- a/packages/twenty-front/src/pages/settings/SettingsBilling.tsx+++ b/packages/twenty-front/src/pages/settings/SettingsBilling.tsx@@ -6,10 +6,10 @@ import { SettingsBillingCreditsSection } from '@/billing/components/SettingsBillimport { SettingsBillingSubscriptionInfo } from '@/billing/components/SettingsBillingSubscriptionInfo';import { useRedirect } from '@/domain-manager/hooks/useRedirect';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useSubscriptionStatus } from '@/workspace/hooks/useSubscriptionStatus';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { H2Title, IconCircleX, IconCreditCard } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';@@ -17,7 +17,6 @@ import {SubscriptionStatus,useBillingPortalSessionQuery,} from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsBilling = () => {const { t } = useLingui();@@ -38,7 +37,7 @@ export const SettingsBilling = () => {const { data, loading } = useBillingPortalSessionQuery({variables: {- returnUrlPath: '/settings/billing',+ returnUrlPath: getSettingsPath(SettingsPath.Billing),},skip: !hasSubscriptions,});diff --git a/packages/twenty-front/src/pages/settings/SettingsProfile.tsx b/packages/twenty-front/src/pages/settings/SettingsProfile.tsxindex 669c65d234e..ab9d70ff599 100644--- a/packages/twenty-front/src/pages/settings/SettingsProfile.tsx+++ b/packages/twenty-front/src/pages/settings/SettingsProfile.tsx@@ -8,12 +8,12 @@ import { EmailField } from '@/settings/profile/components/EmailField';import { NameFields } from '@/settings/profile/components/NameFields';import { ProfilePictureUploader } from '@/settings/profile/components/ProfilePictureUploader';import { useCurrentUserWorkspaceTwoFactorAuthentication } from '@/settings/two-factor-authentication/hooks/useCurrentUserWorkspaceTwoFactorAuthentication';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title, IconShield, Status } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';import { UndecoratedLink } from 'twenty-ui/navigation';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsProfile = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/pages/settings/SettingsTwoFactorAuthenticationMethod.tsx b/packages/twenty-front/src/pages/settings/SettingsTwoFactorAuthenticationMethod.tsxindex 9f7a35b39e0..92a3a974cc9 100644--- a/packages/twenty-front/src/pages/settings/SettingsTwoFactorAuthenticationMethod.tsx+++ b/packages/twenty-front/src/pages/settings/SettingsTwoFactorAuthenticationMethod.tsx@@ -13,14 +13,14 @@ import { TwoFactorAuthenticationVerificationForSettings } from '@/settings/two-fimport { useCurrentUserWorkspaceTwoFactorAuthentication } from '@/settings/two-factor-authentication/hooks/useCurrentUserWorkspaceTwoFactorAuthentication';import { useTwoFactorVerificationForSettings } from '@/settings/two-factor-authentication/hooks/useTwoFactorVerificationForSettings';import { extractSecretFromOtpUri } from '@/settings/two-factor-authentication/utils/extractSecretFromOtpUri';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useTheme } from '@emotion/react';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title, IconCopy } from 'twenty-ui/display';import { Loader } from 'twenty-ui/feedback';import { Section } from 'twenty-ui/layout';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledQRCodeContainer = styled.div`margin: ${({ theme }) => theme.spacing(4)} 0;diff --git a/packages/twenty-front/src/pages/settings/SettingsWorkspace.tsx b/packages/twenty-front/src/pages/settings/SettingsWorkspace.tsxindex 8f576dc179b..2c89710f4f4 100644--- a/packages/twenty-front/src/pages/settings/SettingsWorkspace.tsx+++ b/packages/twenty-front/src/pages/settings/SettingsWorkspace.tsx@@ -4,11 +4,11 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContainimport { DeleteWorkspace } from '@/settings/profile/components/DeleteWorkspace';import { NameField } from '@/settings/workspace/components/NameField';import { WorkspaceLogoUploader } from '@/settings/workspace/components/WorkspaceLogoUploader';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsWorkspace = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/pages/settings/SettingsWorkspaceMembers.tsx b/packages/twenty-front/src/pages/settings/SettingsWorkspaceMembers.tsxindex 0cb8897a362..30945eaa892 100644--- a/packages/twenty-front/src/pages/settings/SettingsWorkspaceMembers.tsx+++ b/packages/twenty-front/src/pages/settings/SettingsWorkspaceMembers.tsx@@ -12,7 +12,6 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSiimport { useDeleteOneRecord } from '@/object-record/hooks/useDeleteOneRecord';import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';@@ -25,7 +24,8 @@ import { WorkspaceInviteLink } from '@/workspace/components/WorkspaceInviteLink'import { WorkspaceInviteTeam } from '@/workspace/components/WorkspaceInviteTeam';import { type ApolloError } from '@apollo/client';import { formatDistanceToNow } from 'date-fns';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import {AppTooltip,Avatar,@@ -40,7 +40,7 @@ import {import { IconButton } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';import { useGetWorkspaceInvitationsQuery } from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { TableCell } from '../../modules/ui/layout/table/components/TableCell';import { TableRow } from '../../modules/ui/layout/table/components/TableRow';import { useDeleteWorkspaceInvitation } from '../../modules/workspace-invitation/hooks/useDeleteWorkspaceInvitation';diff --git a/packages/twenty-front/src/pages/settings/__stories__/SettingsBilling.stories.tsx b/packages/twenty-front/src/pages/settings/__stories__/SettingsBilling.stories.tsxindex dcfc84ab089..24e15667f78 100644--- a/packages/twenty-front/src/pages/settings/__stories__/SettingsBilling.stories.tsx+++ b/packages/twenty-front/src/pages/settings/__stories__/SettingsBilling.stories.tsx@@ -1,7 +1,7 @@import { type Meta, type StoryObj } from '@storybook/react';import { expect, within } from '@storybook/test';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';import {PageDecorator,type PageDecoratorArgs,@@ -9,7 +9,8 @@ import {import { graphqlMocks } from '~/testing/graphqlMocks';import { sleep } from '~/utils/sleep';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { getSettingsPath } from 'twenty-shared/utils';+import { SettingsBilling } from '../SettingsBilling';const meta: Meta<PageDecoratorArgs> = {diff --git a/packages/twenty-front/src/pages/settings/accounts/SettingsAccounts.tsx b/packages/twenty-front/src/pages/settings/accounts/SettingsAccounts.tsxindex e606b37980f..a2364dbb8e5 100644--- a/packages/twenty-front/src/pages/settings/accounts/SettingsAccounts.tsx+++ b/packages/twenty-front/src/pages/settings/accounts/SettingsAccounts.tsx@@ -9,13 +9,13 @@ import { SettingsAccountsBlocklistSection } from '@/settings/accounts/componentsimport { SettingsAccountsConnectedAccountsListCard } from '@/settings/accounts/components/SettingsAccountsConnectedAccountsListCard';import { SettingsAccountsSettingsSection } from '@/settings/accounts/components/SettingsAccountsSettingsSection';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useLingui } from '@lingui/react/macro';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsAccounts = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsCalendars.tsx b/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsCalendars.tsxindex 28e8c4a9e69..3211c3bedf8 100644--- a/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsCalendars.tsx+++ b/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsCalendars.tsx@@ -1,9 +1,9 @@import { SettingsAccountsCalendarChannelsContainer } from '@/settings/accounts/components/SettingsAccountsCalendarChannelsContainer';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { Trans, useLingui } from '@lingui/react/macro';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { Section } from 'twenty-ui/layout';export const SettingsAccountsCalendars = () => {diff --git a/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsEmails.tsx b/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsEmails.tsxindex 0b28f2d84f6..67cdf0bb41e 100644--- a/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsEmails.tsx+++ b/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsEmails.tsx@@ -1,9 +1,9 @@import { SettingsAccountsMessageChannelsContainer } from '@/settings/accounts/components/SettingsAccountsMessageChannelsContainer';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useLingui } from '@lingui/react/macro';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { Section } from 'twenty-ui/layout';export const SettingsAccountsEmails = () => {diff --git a/packages/twenty-front/src/pages/settings/accounts/SettingsNewAccount.tsx b/packages/twenty-front/src/pages/settings/accounts/SettingsNewAccount.tsxindex f76818905c1..15eee8ab15f 100644--- a/packages/twenty-front/src/pages/settings/accounts/SettingsNewAccount.tsx+++ b/packages/twenty-front/src/pages/settings/accounts/SettingsNewAccount.tsx@@ -1,8 +1,8 @@import { SettingsNewAccountSection } from '@/settings/accounts/components/SettingsNewAccountSection';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';export const SettingsNewAccount = () => {return (diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdmin.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdmin.tsxindex 43b4a92e980..e17eba5ec6e 100644--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdmin.tsx+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdmin.tsx@@ -1,9 +1,9 @@import { SettingsAdminContent } from '@/settings/admin-panel/components/SettingsAdminContent';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useLingui } from '@lingui/react/macro';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';export const SettingsAdmin = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminConfigVariableDetails.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminConfigVariableDetails.tsxindex ef2331a8df4..0c7ab8cd865 100644--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminConfigVariableDetails.tsx+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminConfigVariableDetails.tsx@@ -10,20 +10,19 @@ import { useConfigVariableActions } from '@/settings/admin-panel/config-variableimport { useConfigVariableForm } from '@/settings/admin-panel/config-variables/hooks/useConfigVariableForm';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';-import { SettingsPath } from '@/types/SettingsPath';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';import { useModal } from '@/ui/layout/modal/hooks/useModal';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useRecoilValue } from 'recoil';-import { type ConfigVariableValue } from 'twenty-shared/types';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath, type ConfigVariableValue } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { H3Title, IconCheck, IconPencil, IconX } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import {ConfigSource,useGetDatabaseConfigVariableQuery,} from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+const StyledForm = styled(Form)`display: flex;flex-direction: column;diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminIndicatorHealthStatus.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminIndicatorHealthStatus.tsxindex 1508d1bd8fb..77c0c4a2cb5 100644--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminIndicatorHealthStatus.tsx+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminIndicatorHealthStatus.tsx@@ -3,11 +3,12 @@ import { SettingsAdminIndicatorHealthStatusContent } from '@/settings/admin-paneimport { SettingsAdminIndicatorHealthContext } from '@/settings/admin-panel/health-status/contexts/SettingsAdminIndicatorHealthContext';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';import { useParams } from 'react-router-dom';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title, H3Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';import {@@ -15,7 +16,6 @@ import {HealthIndicatorId,useGetIndicatorHealthStatusQuery,} from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledTitleContainer = styled.div`align-items: center;diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsxindex e9447d756dc..808ed01cb2e 100644--- a/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx+++ b/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx@@ -1,12 +1,12 @@import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title, IconPlus } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';import { UndecoratedLink } from 'twenty-ui/navigation';import { useFindManyAgentsQuery } from '~/generated-metadata/graphql';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';import { t } from '@lingui/core/macro';import { SettingsAIAgentsTable } from './components/SettingsAIAgentsTable';diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsAgentForm.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsAgentForm.tsxindex f82421283f9..5097a924854 100644--- a/packages/twenty-front/src/pages/settings/ai/SettingsAgentForm.tsx+++ b/packages/twenty-front/src/pages/settings/ai/SettingsAgentForm.tsx@@ -6,13 +6,12 @@ import { useRecoilValue } from 'recoil';import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { useModal } from '@/ui/layout/modal/hooks/useModal';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { t } from '@lingui/core/macro';-import { isDefined } from 'twenty-shared/utils';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { H2Title, IconTrash } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';@@ -24,7 +23,7 @@ import {} from '~/generated-metadata/graphql';import { useNavigateApp } from '~/hooks/useNavigateApp';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsAgentDeleteConfirmationModal } from './components/SettingsAgentDeleteConfirmationModal';import { SettingsAgentDetailSkeletonLoader } from './components/SettingsAgentDetailSkeletonLoader';import { SettingsAgentHandoffSection } from './components/SettingsAgentHandoffSection';diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentsTable.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentsTable.tsxindex 16f9da3999d..ecb665efcc3 100644--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentsTable.tsx+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentsTable.tsx@@ -2,17 +2,18 @@ import styled from '@emotion/styled';import { useLingui } from '@lingui/react/macro';import { useState } from 'react';-import { SettingsPath } from '@/types/SettingsPath';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';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 { useTheme } from '@emotion/react';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconChevronRight, IconSearch } from 'twenty-ui/display';import { type Agent } from '~/generated-metadata/graphql';import { SETTINGS_AI_AGENT_TABLE_METADATA } from '~/pages/settings/ai/constants/SettingsAiAgentTableMetadata';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import {SettingsAIAgentTableRow,StyledAIAgentTableRow,diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentDeleteConfirmationModal.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentDeleteConfirmationModal.tsxindex e9cd05076d0..2c01b634d2f 100644--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentDeleteConfirmationModal.tsx+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentDeleteConfirmationModal.tsx@@ -5,7 +5,7 @@ import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';import { useModal } from '@/ui/layout/modal/hooks/useModal';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';import { useDeleteOneAgentMutation } from '~/generated-metadata/graphql';import { useNavigateSettings } from '~/hooks/useNavigateSettings';diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsNewObject.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsNewObject.tsxindex a3046023c6b..3909501c392 100644--- a/packages/twenty-front/src/pages/settings/data-model/SettingsNewObject.tsx+++ b/packages/twenty-front/src/pages/settings/data-model/SettingsNewObject.tsx@@ -10,16 +10,16 @@ import {type SettingsDataModelObjectAboutFormValues,settingsDataModelObjectAboutFormSchema,} from '@/settings/data-model/validation-schemas/settingsDataModelObjectAboutFormSchema';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { ApolloError } from '@apollo/client';import { useLingui } from '@lingui/react/macro';import { useState } from 'react';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsNewObject = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectDetailPage.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectDetailPage.tsxindex d94cd4d6b5e..2ea354495bb 100644--- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectDetailPage.tsx+++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectDetailPage.tsx@@ -8,19 +8,18 @@ import { ObjectIndexes } from '@/settings/data-model/object-details/components/timport { ObjectSettings } from '@/settings/data-model/object-details/components/tabs/ObjectSettings';import { SettingsDataModelObjectTypeTag } from '@/settings/data-model/objects/components/SettingsDataModelObjectTypeTag';import { getObjectTypeLabel } from '@/settings/data-model/utils/getObjectTypeLabel';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { TabList } from '@/ui/layout/tab-list/components/TabList';import { isAdvancedModeEnabledState } from '@/ui/navigation/navigation-drawer/states/isAdvancedModeEnabledState';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import styled from '@emotion/styled';import { useRecoilState, useRecoilValue } from 'recoil';+import { AppPath, SettingsPath } from 'twenty-shared/types';import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';import { useLingui } from '@lingui/react/macro';-import { isDefined } from 'twenty-shared/utils';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import {H3Title,IconCodeCircle,@@ -36,7 +35,6 @@ import { FeatureFlagKey } from '~/generated/graphql';import { useNavigateApp } from '~/hooks/useNavigateApp';import { SETTINGS_OBJECT_DETAIL_TABS } from '~/pages/settings/data-model/constants/SettingsObjectDetailTabs';import { updatedObjectNamePluralState } from '~/pages/settings/data-model/states/updatedObjectNamePluralState';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledContentContainer = styled.div`flex: 1;diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldEdit.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldEdit.tsxindex ff908d719e1..392e452317b 100644--- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldEdit.tsx+++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldEdit.tsx@@ -21,20 +21,18 @@ import { SettingsDataModelFieldIconLabelForm } from '@/settings/data-model/fieldimport { SettingsDataModelFieldSettingsFormCard } from '@/settings/data-model/fields/forms/components/SettingsDataModelFieldSettingsFormCard';import { settingsFieldFormSchema } from '@/settings/data-model/fields/forms/validation-schemas/settingsFieldFormSchema';import { type SettingsFieldType } from '@/settings/data-model/types/SettingsFieldType';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { ApolloError } from '@apollo/client';import { useLingui } from '@lingui/react/macro';-import { isDefined } from 'twenty-shared/utils';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { H2Title, IconArchive, IconArchiveOff } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';import { FieldMetadataType } from '~/generated-metadata/graphql';import { useNavigateApp } from '~/hooks/useNavigateApp';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';//TODO: fix this typeexport type SettingsDataModelFieldEditFormValues = z.infer<diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectOverview.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectOverview.tsxindex dd1df96b603..a463d61dd49 100644--- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectOverview.tsx+++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectOverview.tsx@@ -1,9 +1,9 @@import { ReactFlowProvider } from '@xyflow/react';import { SettingsDataModelOverview } from '@/settings/data-model/graph-overview/components/SettingsDataModelOverview';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';export const SettingsObjectOverview = () => {return (@@ -13,7 +13,7 @@ export const SettingsObjectOverview = () => {children: 'Workspace',href: getSettingsPath(SettingsPath.Workspace),},- { children: 'Objects', href: '/settings/objects' },+ { children: 'Objects', href: getSettingsPath(SettingsPath.Objects) },{children: 'Overview',},diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjects.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjects.tsxindex 85062045fa1..c95b2ca80a7 100644--- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjects.tsx+++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjects.tsx@@ -10,7 +10,6 @@ import {import { SettingsObjectCoverImage } from '@/settings/data-model/objects/components/SettingsObjectCoverImage';import { SettingsObjectInactiveMenuDropDown } from '@/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown';import { getObjectTypeLabel } from '@/settings/data-model/utils/getObjectTypeLabel';-import { SettingsPath } from '@/types/SettingsPath';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { SortableTableHeader } from '@/ui/layout/table/components/SortableTableHeader';@@ -23,6 +22,8 @@ import styled from '@emotion/styled';import { Trans, useLingui } from '@lingui/react/macro';import { isNonEmptyArray } from '@sniptt/guards';import { useMemo, useState } from 'react';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import {H2Title,IconChevronRight,@@ -34,7 +35,6 @@ import { Section } from 'twenty-ui/layout';import { UndecoratedLink } from 'twenty-ui/navigation';import { GET_SETTINGS_OBJECT_TABLE_METADATA } from '~/pages/settings/data-model/constants/SettingsObjectTableMetadata';import { type SettingsObjectTableItem } from '~/pages/settings/data-model/types/SettingsObjectTableItem';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledIconChevronRight = styled(IconChevronRight)`color: ${({ theme }) => theme.font.color.tertiary};diff --git a/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsx b/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsxindex 0e5a23ae2db..016b96327ca 100644--- a/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsx+++ b/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsx@@ -10,8 +10,6 @@ import { SettingsDataModelFieldDescriptionForm } from '@/settings/data-model/fieimport { SettingsDataModelFieldIconLabelForm } from '@/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm';import { SettingsDataModelFieldSettingsFormCard } from '@/settings/data-model/fields/forms/components/SettingsDataModelFieldSettingsFormCard';import { settingsFieldFormSchema } from '@/settings/data-model/fields/forms/validation-schemas/settingsFieldFormSchema';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { type View } from '@/views/types/View';@@ -22,6 +20,8 @@ import { useLingui } from '@lingui/react/macro';import { useEffect, useState } from 'react';import { FormProvider, useForm } from 'react-hook-form';import { useParams, useSearchParams } from 'react-router-dom';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';import { type z } from 'zod';@@ -29,7 +29,6 @@ import { FieldMetadataType } from '~/generated-metadata/graphql';import { useNavigateApp } from '~/hooks/useNavigateApp';import { useNavigateSettings } from '~/hooks/useNavigateSettings';import { DEFAULT_ICONS_BY_FIELD_TYPE } from '~/pages/settings/data-model/constants/DefaultIconsByFieldType';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';type SettingsDataModelNewFieldFormValues = z.infer<ReturnType<typeof settingsFieldFormSchema>diff --git a/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect.tsx b/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect.tsxindex 1158bc73516..4df58c1c13d 100644--- a/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect.tsx+++ b/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect.tsx@@ -5,19 +5,17 @@ import { SETTINGS_FIELD_TYPE_CONFIGS } from '@/settings/data-model/constants/Setimport { SettingsObjectNewFieldSelector } from '@/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector';import { type FieldType } from '@/settings/data-model/types/FieldType';import { type SettingsFieldType } from '@/settings/data-model/types/SettingsFieldType';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { zodResolver } from '@hookform/resolvers/zod';import { t } from '@lingui/core/macro';import { useEffect } from 'react';import { FormProvider, useForm } from 'react-hook-form';import { useParams } from 'react-router-dom';-import { isDefined } from 'twenty-shared/utils';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { z } from 'zod';import { FieldMetadataType } from '~/generated-metadata/graphql';import { useNavigateApp } from '~/hooks/useNavigateApp';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const settingsDataModelFieldTypeFormSchema = z.object({type: z.enum(@@ -70,8 +68,11 @@ export const SettingsObjectNewFieldSelect = () => {<SubMenuTopBarContainertitle={t`1. Select a field type`}links={[- { children: t`Workspace`, href: '/settings/general' },- { children: t`Objects`, href: '/settings/objects' },+ {+ children: t`Workspace`,+ href: getSettingsPath(SettingsPath.Workspace),+ },+ { children: t`Objects`, href: getSettingsPath(SettingsPath.Objects) },{children: activeObjectMetadataItem.labelPlural,href: getSettingsPath(SettingsPath.ObjectDetail, {diff --git a/packages/twenty-front/src/pages/settings/developers/__stories__/api-keys/SettingsDevelopersApiKeysNew.stories.tsx b/packages/twenty-front/src/pages/settings/developers/__stories__/api-keys/SettingsDevelopersApiKeysNew.stories.tsxindex 02e4e8e5e21..7c6032df490 100644--- a/packages/twenty-front/src/pages/settings/developers/__stories__/api-keys/SettingsDevelopersApiKeysNew.stories.tsx+++ b/packages/twenty-front/src/pages/settings/developers/__stories__/api-keys/SettingsDevelopersApiKeysNew.stories.tsx@@ -1,14 +1,15 @@-import { SettingsPath } from '@/types/SettingsPath';import { type Meta, type StoryObj } from '@storybook/react';+import { SettingsPath } from 'twenty-shared/types';// TEMP_DISABLED_TEST: Removed unused imports due to commented test+import { getSettingsPath } from 'twenty-shared/utils';import { SettingsDevelopersApiKeysNew } from '~/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew';import {PageDecorator,type PageDecoratorArgs,} from '~/testing/decorators/PageDecorator';import { graphqlMocks } from '~/testing/graphqlMocks';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+// TEMP_DISABLED_TEST: Removed unused import due to commented test// import { sleep } from '~/utils/sleep';diff --git a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsApiKeys.tsx b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsApiKeys.tsxindex 6b0d4e09a10..289ae392af5 100644--- a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsApiKeys.tsx+++ b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsApiKeys.tsx@@ -2,15 +2,15 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContainimport { SettingsApiKeysTable } from '@/settings/developers/components/SettingsApiKeysTable';import { PlaygroundSetupForm } from '@/settings/playground/components/PlaygroundSetupForm';import { StyledSettingsApiPlaygroundCoverImage } from '@/settings/playground/components/SettingsPlaygroundCoverImage';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import styled from '@emotion/styled';import { Trans, useLingui } from '@lingui/react/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title, IconPlus } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';import { MOBILE_VIEWPORT } from 'twenty-ui/theme';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledButtonContainer = styled.div`display: flex;diff --git a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsxindex abe439ee245..dbb0db8555f 100644--- a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx+++ b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx@@ -12,7 +12,6 @@ import { SettingsDevelopersRoleSelector } from '@/settings/developers/componentsimport { apiKeyTokenFamilyState } from '@/settings/developers/states/apiKeyTokenFamilyState';import { computeNewExpirationDate } from '@/settings/developers/utils/computeNewExpirationDate';import { formatExpiration } from '@/settings/developers/utils/formatExpiration';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';@@ -20,7 +19,8 @@ import { useModal } from '@/ui/layout/modal/hooks/useModal';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { Trans, useLingui } from '@lingui/react/macro';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { H2Title, IconRepeat, IconTrash } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';@@ -34,7 +34,6 @@ import {useRevokeApiKeyMutation,} from '~/generated-metadata/graphql';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledInfo = styled.span`color: ${({ theme }) => theme.font.color.light};diff --git a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew.tsx b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew.tsxindex 71cc7d45289..bef2a725cbb 100644--- a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew.tsx+++ b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew.tsx@@ -8,7 +8,6 @@ import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoimport { SettingsDevelopersRoleSelector } from '@/settings/developers/components/SettingsDevelopersRoleSelector';import { EXPIRATION_DATES } from '@/settings/developers/constants/ExpirationDates';import { apiKeyTokenFamilyState } from '@/settings/developers/states/apiKeyTokenFamilyState';-import { SettingsPath } from '@/types/SettingsPath';import { Select } from '@/ui/input/components/Select';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';@@ -16,7 +15,8 @@ import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { useLingui } from '@lingui/react/macro';import { useRecoilCallback, useRecoilValue } from 'recoil';import { Key } from 'ts-key-enum';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';import {@@ -26,7 +26,6 @@ import {useGetRolesQuery,} from '~/generated-metadata/graphql';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsDevelopersApiKeysNew = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/pages/settings/developers/playground/SettingsGraphQLPlayground.tsx b/packages/twenty-front/src/pages/settings/developers/playground/SettingsGraphQLPlayground.tsxindex 410f6324267..fbf75bb9dcb 100644--- a/packages/twenty-front/src/pages/settings/developers/playground/SettingsGraphQLPlayground.tsx+++ b/packages/twenty-front/src/pages/settings/developers/playground/SettingsGraphQLPlayground.tsx@@ -1,12 +1,12 @@import { GraphQLPlayground } from '@/settings/playground/components/GraphQLPlayground';import { PlaygroundSchemas } from '@/settings/playground/types/PlaygroundSchemas';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';import { FullScreenContainer } from '@/ui/layout/fullscreen/components/FullScreenContainer';import { Trans } from '@lingui/react/macro';import { useParams } from 'react-router-dom';+import { getSettingsPath } from 'twenty-shared/utils';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsGraphQLPlayground = () => {const navigateSettings = useNavigateSettings();diff --git a/packages/twenty-front/src/pages/settings/developers/playground/SettingsRestPlayground.tsx b/packages/twenty-front/src/pages/settings/developers/playground/SettingsRestPlayground.tsxindex 55a2c70eac6..723706f619c 100644--- a/packages/twenty-front/src/pages/settings/developers/playground/SettingsRestPlayground.tsx+++ b/packages/twenty-front/src/pages/settings/developers/playground/SettingsRestPlayground.tsx@@ -1,11 +1,11 @@import { RestPlayground } from '@/settings/playground/components/RestPlayground';import { PlaygroundSchemas } from '@/settings/playground/types/PlaygroundSchemas';-import { SettingsPath } from '@/types/SettingsPath';import { FullScreenContainer } from '@/ui/layout/fullscreen/components/FullScreenContainer';import { Trans } from '@lingui/react/macro';import { useParams } from 'react-router-dom';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsRestPlayground = () => {const navigateSettings = useNavigateSettings();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.tsxindex 480221c6808..0e26047bf03 100644--- a/packages/twenty-front/src/pages/settings/developers/webhooks/components/SettingsWebhooks.tsx+++ b/packages/twenty-front/src/pages/settings/developers/webhooks/components/SettingsWebhooks.tsx@@ -1,15 +1,15 @@import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { SettingsWebhooksTable } from '@/settings/developers/components/SettingsWebhooksTable';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';import styled from '@emotion/styled';import { Trans, useLingui } from '@lingui/react/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title, IconPlus } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';import { MOBILE_VIEWPORT } from 'twenty-ui/theme';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledButtonContainer = styled.div`display: flex;diff --git a/packages/twenty-front/src/pages/settings/domains/SettingsDomain.tsx b/packages/twenty-front/src/pages/settings/domains/SettingsDomain.tsxindex 9f0b30fa037..16882ab0282 100644--- a/packages/twenty-front/src/pages/settings/domains/SettingsDomain.tsx+++ b/packages/twenty-front/src/pages/settings/domains/SettingsDomain.tsx@@ -7,7 +7,6 @@ import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtonsimport { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { SettingsCustomDomain } from '@/settings/domains/components/SettingsCustomDomain';import { SettingsSubdomain } from '@/settings/domains/components/SettingsSubdomain';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';import { useModal } from '@/ui/layout/modal/hooks/useModal';@@ -17,11 +16,11 @@ import { zodResolver } from '@hookform/resolvers/zod';import { Trans, useLingui } from '@lingui/react/macro';import { FormProvider, useForm } from 'react-hook-form';import { useRecoilState } from 'recoil';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { z } from 'zod';import { useUpdateWorkspaceMutation } from '~/generated-metadata/graphql';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SUBDOMAIN_CHANGE_CONFIRMATION_MODAL_ID ='subdomain-change-confirmation-modal';diff --git a/packages/twenty-front/src/pages/settings/domains/SettingsDomains.tsx b/packages/twenty-front/src/pages/settings/domains/SettingsDomains.tsxindex 7563bc42670..cdba2fea0a8 100644--- a/packages/twenty-front/src/pages/settings/domains/SettingsDomains.tsx+++ b/packages/twenty-front/src/pages/settings/domains/SettingsDomains.tsx@@ -2,13 +2,13 @@ import styled from '@emotion/styled';import { Trans, useLingui } from '@lingui/react/macro';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';+import { SettingsWorkspaceDomainCard } from '@/settings/domains/components/SettingsWorkspaceDomainCard';import { SettingsApprovedAccessDomainsListCard } from '@/settings/security/components/approvedAccessDomains/SettingsApprovedAccessDomainsListCard';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';-import { SettingsWorkspaceDomainCard } from '@/settings/domains/components/SettingsWorkspaceDomainCard';const StyledMainContent = styled.div`display: flex;diff --git a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationDatabase.tsx b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationDatabase.tsxindex 434cecc1e72..12280fd2f41 100644--- a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationDatabase.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationDatabase.tsx@@ -7,13 +7,12 @@ import { SettingsIntegrationPreview } from '@/settings/integrations/components/Simport { SettingsIntegrationDatabaseConnectionsListCard } from '@/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionsListCard';import { useIsSettingsIntegrationEnabled } from '@/settings/integrations/hooks/useIsSettingsIntegrationEnabled';import { useSettingsIntegrationCategories } from '@/settings/integrations/hooks/useSettingsIntegrationCategories';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';-import { useNavigateApp } from '~/hooks/useNavigateApp';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';+import { useNavigateApp } from '~/hooks/useNavigateApp';export const SettingsIntegrationDatabase = () => {const { databaseKey = '' } = useParams();diff --git a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationEditDatabaseConnection.tsx b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationEditDatabaseConnection.tsxindex 3045d339d0d..f3a20aec39f 100644--- a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationEditDatabaseConnection.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationEditDatabaseConnection.tsx@@ -1,8 +1,8 @@import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { SettingsIntegrationEditDatabaseConnectionContainer } from '@/settings/integrations/database-connection/components/SettingsIntegrationEditDatabaseConnectionContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';export const SettingsIntegrationEditDatabaseConnection = () => {return (diff --git a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationMCPPage.tsx b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationMCPPage.tsxindex 00eb302ae2a..564e8ee1c45 100644--- a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationMCPPage.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationMCPPage.tsx@@ -1,11 +1,11 @@import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsIntegrationMCP } from '@/settings/integrations/components/SettingsIntegrationMCP';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { Trans, useLingui } from '@lingui/react/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';-import { SettingsIntegrationMCP } from '@/settings/integrations/components/SettingsIntegrationMCP';-import { Trans, useLingui } from '@lingui/react/macro';export const SettingsIntegrationMCPPage = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationNewDatabaseConnection.tsx b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationNewDatabaseConnection.tsxindex 1c79a3e98bc..e9dc37ad8c3 100644--- a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationNewDatabaseConnection.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationNewDatabaseConnection.tsx@@ -15,17 +15,17 @@ import {} from '@/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionForm';import { useIsSettingsIntegrationEnabled } from '@/settings/integrations/hooks/useIsSettingsIntegrationEnabled';import { useSettingsIntegrationCategories } from '@/settings/integrations/hooks/useSettingsIntegrationCategories';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { ApolloError } from '@apollo/client';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';import { type CreateRemoteServerInput } from '~/generated-metadata/graphql';import { useNavigateApp } from '~/hooks/useNavigateApp';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const createRemoteServerInputPostgresSchema =settingsIntegrationPostgreSQLConnectionFormSchema.transform<CreateRemoteServerInput>(diff --git a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationShowDatabaseConnection.tsx b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationShowDatabaseConnection.tsxindex 4b3cdaa9af1..164392439cd 100644--- a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationShowDatabaseConnection.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrationShowDatabaseConnection.tsx@@ -1,8 +1,8 @@import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { SettingsIntegrationDatabaseConnectionShowContainer } from '@/settings/integrations/database-connection/components/SettingsIntegrationDatabaseConnectionShowContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';export const SettingsIntegrationShowDatabaseConnection = () => {return (diff --git a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrations.tsx b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrations.tsxindex ff77a4aaf6b..de479876467 100644--- a/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrations.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/SettingsIntegrations.tsx@@ -1,10 +1,10 @@import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { SettingsIntegrationGroup } from '@/settings/integrations/components/SettingsIntegrationGroup';import { useSettingsIntegrationCategories } from '@/settings/integrations/hooks/useSettingsIntegrationCategories';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { Trans, useLingui } from '@lingui/react/macro';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';export const SettingsIntegrations = () => {const { t } = useLingui();diff --git a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationDatabase.stories.tsx b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationDatabase.stories.tsxindex cd421f9b878..1f6b7610863 100644--- a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationDatabase.stories.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationDatabase.stories.tsx@@ -1,14 +1,15 @@// TEMP_DISABLED_TEST: Removed unused imports due to commented testimport { type Meta, type StoryObj } from '@storybook/react';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { SettingsIntegrationDatabase } from '~/pages/settings/integrations/SettingsIntegrationDatabase';import {PageDecorator,type PageDecoratorArgs,} from '~/testing/decorators/PageDecorator';import { graphqlMocks } from '~/testing/graphqlMocks';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+// TEMP_DISABLED_TEST: Removed unused import due to commented test// import { sleep } from '~/utils/sleep';diff --git a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationShowDatabaseConnection.stories.tsx b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationShowDatabaseConnection.stories.tsxindex 1801432ad7f..06d2b51c9ce 100644--- a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationShowDatabaseConnection.stories.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationShowDatabaseConnection.stories.tsx@@ -1,14 +1,15 @@import { type Meta, type StoryObj } from '@storybook/react';import { within } from '@storybook/test';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { SettingsIntegrationShowDatabaseConnection } from '~/pages/settings/integrations/SettingsIntegrationShowDatabaseConnection';import {PageDecorator,type PageDecoratorArgs,} from '~/testing/decorators/PageDecorator';import { graphqlMocks } from '~/testing/graphqlMocks';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { sleep } from '~/utils/sleep';const meta: Meta<PageDecoratorArgs> = {diff --git a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrations.stories.tsx b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrations.stories.tsxindex b70683d36b4..0471f1f7f4d 100644--- a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrations.stories.tsx+++ b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrations.stories.tsx@@ -1,14 +1,15 @@import { type Meta, type StoryObj } from '@storybook/react';import { within } from '@storybook/test';-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { SettingsIntegrations } from '~/pages/settings/integrations/SettingsIntegrations';import {PageDecorator,type PageDecoratorArgs,} from '~/testing/decorators/PageDecorator';import { graphqlMocks } from '~/testing/graphqlMocks';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { sleep } from '~/utils/sleep';const meta: Meta<PageDecoratorArgs> = {diff --git a/packages/twenty-front/src/pages/settings/page-layout/SettingsPageLayoutEdit.tsx b/packages/twenty-front/src/pages/settings/page-layout/SettingsPageLayoutEdit.tsxindex a8effe2c50a..d49670f9e8e 100644--- a/packages/twenty-front/src/pages/settings/page-layout/SettingsPageLayoutEdit.tsx+++ b/packages/twenty-front/src/pages/settings/page-layout/SettingsPageLayoutEdit.tsx@@ -4,28 +4,29 @@ import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtonsimport { SettingsPageFullWidthContainer } from '@/settings/components/SettingsPageFullWidthContainer';import { PageLayoutInitializationEffect } from '@/settings/page-layout/components/PageLayoutInitializationEffect';import { PageLayoutWidgetPlaceholder } from '@/settings/page-layout/components/PageLayoutWidgetPlaceholder';+import { WidgetRenderer } from '@/settings/page-layout/components/WidgetRenderer';import { EMPTY_LAYOUT } from '@/settings/page-layout/constants/EmptyLayout';import {PAGE_LAYOUT_CONFIG,type PageLayoutBreakpoint,} from '@/settings/page-layout/constants/PageLayoutBreakpoints';+import { SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID } from '@/settings/page-layout/constants/SettingsPageLayoutTabsInstanceId';+import { useChangePageLayoutDragSelection } from '@/settings/page-layout/hooks/useChangePageLayoutDragSelection';+import { useCreatePageLayoutTab } from '@/settings/page-layout/hooks/useCreatePageLayoutTab';+import { useDeletePageLayoutWidget } from '@/settings/page-layout/hooks/useDeletePageLayoutWidget';+import { useEndPageLayoutDragSelection } from '@/settings/page-layout/hooks/useEndPageLayoutDragSelection';import { usePageLayoutDraftState } from '@/settings/page-layout/hooks/usePageLayoutDraftState';-import { usePageLayoutDragSelection } from '@/settings/page-layout/hooks/usePageLayoutDragSelection';import { usePageLayoutHandleLayoutChange } from '@/settings/page-layout/hooks/usePageLayoutHandleLayoutChange';import { usePageLayoutSaveHandler } from '@/settings/page-layout/hooks/usePageLayoutSaveHandler';-import { usePageLayoutTabCreate } from '@/settings/page-layout/hooks/usePageLayoutTabCreate';-import { usePageLayoutWidgetDelete } from '@/settings/page-layout/hooks/usePageLayoutWidgetDelete';+import { useStartPageLayoutDragSelection } from '@/settings/page-layout/hooks/useStartPageLayoutDragSelection';import { WidgetType } from '@/settings/page-layout/mocks/mockWidgets';import { pageLayoutCurrentBreakpointState } from '@/settings/page-layout/states/pageLayoutCurrentBreakpointState';import { pageLayoutCurrentLayoutsState } from '@/settings/page-layout/states/pageLayoutCurrentLayoutsState';-import { pageLayoutCurrentTabIdForCreationState } from '@/settings/page-layout/states/pageLayoutCurrentTabIdForCreation';import { pageLayoutEditingWidgetIdState } from '@/settings/page-layout/states/pageLayoutEditingWidgetIdState';import { pageLayoutSelectedCellsState } from '@/settings/page-layout/states/pageLayoutSelectedCellsState';import { type PageLayoutWidget } from '@/settings/page-layout/states/savedPageLayoutsState';import { calculateTotalGridRows } from '@/settings/page-layout/utils/calculateTotalGridRows';import { generateCellId } from '@/settings/page-layout/utils/generateCellId';-import { renderWidget } from '@/settings/page-layout/utils/widgetRegistry';-import { SettingsPath } from '@/types/SettingsPath';import { TitleInput } from '@/ui/input/components/TitleInput';import { TabList } from '@/ui/layout/tab-list/components/TabList';import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';@@ -44,10 +45,11 @@ import 'react-grid-layout/css/styles.css';import 'react-resizable/css/styles.css';import { useParams } from 'react-router-dom';import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconAppWindow, IconPlus } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledGridContainer = styled.div`background: ${({ theme }) => theme.background.secondary};@@ -143,9 +145,6 @@ export const SettingsPageLayoutEdit = () => {const pageLayoutCurrentLayouts = useRecoilValue(pageLayoutCurrentLayoutsState,);- const setPageLayoutCurrentTabIdForCreation = useSetRecoilState(- pageLayoutCurrentTabIdForCreationState,- );const { navigateCommandMenu } = useNavigateCommandMenu();const setPageLayoutEditingWidgetId = useSetRecoilState(pageLayoutEditingWidgetIdState,@@ -155,7 +154,13 @@ export const SettingsPageLayoutEdit = () => {const activeTabId = useRecoilComponentValue(activeTabIdComponentState,- 'page-layout-tabs',+ SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID,+ );++ const setActiveTabId = useSetRecoilState(+ activeTabIdComponentState.atomFamily({+ instanceId: SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID,+ }),);const activeTabWidgets = useMemo(() => {@@ -171,25 +176,22 @@ export const SettingsPageLayoutEdit = () => {[pageLayoutDraft.tabs],);- const {- handleDragSelectionStart,- handleDragSelectionChange,- handleDragSelectionEnd,- } = usePageLayoutDragSelection();+ const { startPageLayoutDragSelection } = useStartPageLayoutDragSelection();+ const { changePageLayoutDragSelection } = useChangePageLayoutDragSelection();+ const { endPageLayoutDragSelection } = useEndPageLayoutDragSelection();const handleOpenAddWidget = useCallback(() => {- setPageLayoutCurrentTabIdForCreation(activeTabId);navigateCommandMenu({page: CommandMenuPages.PageLayoutWidgetTypeSelect,pageTitle: 'Add Widget',pageIcon: IconAppWindow,resetNavigationStack: true,});- }, [navigateCommandMenu, activeTabId, setPageLayoutCurrentTabIdForCreation]);+ }, [navigateCommandMenu]);- const { handleRemoveWidget } = usePageLayoutWidgetDelete();+ const { deletePageLayoutWidget } = useDeletePageLayoutWidget();const { handleLayoutChange } = usePageLayoutHandleLayoutChange(activeTabId);- const { handleCreateTab } = usePageLayoutTabCreate();+ const { createPageLayoutTab } = useCreatePageLayoutTab();const handleEditWidget = useCallback((widgetId: string) => {@@ -197,9 +199,6 @@ export const SettingsPageLayoutEdit = () => {if (!widget) return;setPageLayoutEditingWidgetId(widgetId);- setPageLayoutCurrentTabIdForCreation(- widget.pageLayoutTabId || activeTabId,- );if (widget.type === WidgetType.IFRAME) {navigateCommandMenu({@@ -210,13 +209,7 @@ export const SettingsPageLayoutEdit = () => {});}},- [- allWidgets,- setPageLayoutEditingWidgetId,- navigateCommandMenu,- setPageLayoutCurrentTabIdForCreation,- activeTabId,- ],+ [allWidgets, setPageLayoutEditingWidgetId, navigateCommandMenu],);const isEmptyState = activeTabWidgets.length === 0;@@ -233,16 +226,10 @@ export const SettingsPageLayoutEdit = () => {navigateSettings(SettingsPath.PageLayout);};- const setActiveTabId = useSetRecoilState(- activeTabIdComponentState.atomFamily({- instanceId: 'page-layout-tabs',- }),- );-const handleAddTab = useCallback(() => {- const newTabId = handleCreateTab();+ const newTabId = createPageLayoutTab();setActiveTabId(newTabId);- }, [handleCreateTab, setActiveTabId]);+ }, [createPageLayoutTab, setActiveTabId]);const tabListTabs: SingleTabProps[] = useMemo(() => {return [...pageLayoutDraft.tabs]@@ -290,7 +277,7 @@ export const SettingsPageLayoutEdit = () => {},{children: t`Page Layouts`,- href: '/settings/page-layout',+ href: getSettingsPath(SettingsPath.PageLayout),},{children: (@@ -334,7 +321,7 @@ export const SettingsPageLayoutEdit = () => {<StyledTabListtabs={tabListTabs}behaveAsLinks={false}- componentInstanceId="page-layout-tabs"+ componentInstanceId={SETTINGS_PAGE_LAYOUT_TABS_INSTANCE_ID}onAddTab={handleAddTab}/>)}@@ -394,10 +381,10 @@ export const SettingsPageLayoutEdit = () => {<div key={widget.id} data-select-disable="true"><PageLayoutWidgetPlaceholdertitle={widget.title}- onRemove={() => handleRemoveWidget(widget.id)}+ onRemove={() => deletePageLayoutWidget(widget.id)}onEdit={() => handleEditWidget(widget.id)}>- {renderWidget(widget)}+ <WidgetRenderer widget={widget} /></PageLayoutWidgetPlaceholder></div>))@@ -406,9 +393,9 @@ export const SettingsPageLayoutEdit = () => {{pageLayoutCurrentBreakpoint !== 'mobile' && (<DragSelectselectableItemsContainerRef={gridContainerRef}- onDragSelectionStart={handleDragSelectionStart}- onDragSelectionChange={handleDragSelectionChange}- onDragSelectionEnd={handleDragSelectionEnd}+ onDragSelectionStart={startPageLayoutDragSelection}+ onDragSelectionChange={changePageLayoutDragSelection}+ onDragSelectionEnd={endPageLayoutDragSelection}/>)}</StyledGridContainer>diff --git a/packages/twenty-front/src/pages/settings/page-layout/SettingsPageLayouts.tsx b/packages/twenty-front/src/pages/settings/page-layout/SettingsPageLayouts.tsxindex a5d35649531..2b4e69f7c34 100644--- a/packages/twenty-front/src/pages/settings/page-layout/SettingsPageLayouts.tsx+++ b/packages/twenty-front/src/pages/settings/page-layout/SettingsPageLayouts.tsx@@ -1,6 +1,5 @@import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { savedPageLayoutsState } from '@/settings/page-layout/states/savedPageLayoutsState';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { Table } from '@/ui/layout/table/components/Table';import { TableCell } from '@/ui/layout/table/components/TableCell';@@ -10,6 +9,8 @@ import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { Trans, useLingui } from '@lingui/react/macro';import { useRecoilState } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import {H2Title,IconChevronRight,@@ -20,7 +21,6 @@ import {import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';import { UndecoratedLink } from 'twenty-ui/navigation';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledTableRow = styled(TableRow)`grid-template-columns: 1fr 180px 80px 80px 36px 36px;@@ -59,7 +59,7 @@ export const SettingsPageLayouts = () => {<SubMenuTopBarContainertitle={t`Page Layouts`}actionButton={- <UndecoratedLink to="/settings/page-layout/new">+ <UndecoratedLink to={getSettingsPath(SettingsPath.PageLayoutNew)}><ButtonIcon={IconPlus}title={t`Add layout`}@@ -92,7 +92,9 @@ export const SettingsPageLayouts = () => {{savedPageLayouts.map((layout) => (<StyledTableRowkey={layout.id}- to={`/settings/page-layout/${layout.id}`}+ to={getSettingsPath(SettingsPath.PageLayoutEdit, {+ id: layout.id,+ })}><StyledNameTableCell><IconLayoutListdiff --git a/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsExperience.tsx b/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsExperience.tsxindex 5ca9e8fa868..c3082f3ac75 100644--- a/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsExperience.tsx+++ b/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsExperience.tsx@@ -1,15 +1,15 @@import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useColorScheme } from '@/ui/theme/hooks/useColorScheme';+import { SettingsPath } from 'twenty-shared/types';import { Trans, useLingui } from '@lingui/react/macro';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { ColorSchemePicker } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';import { DateTimeSettings } from '~/pages/settings/profile/appearance/components/DateTimeSettings';import { LocalePicker } from '~/pages/settings/profile/appearance/components/LocalePicker';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsExperience = () => {const { colorScheme, setColorScheme } = useColorScheme();diff --git a/packages/twenty-front/src/pages/settings/releases/SettingsReleases.tsx b/packages/twenty-front/src/pages/settings/releases/SettingsReleases.tsxindex 6ec22846309..56beaf9b6ab 100644--- a/packages/twenty-front/src/pages/settings/releases/SettingsReleases.tsx+++ b/packages/twenty-front/src/pages/settings/releases/SettingsReleases.tsx@@ -1,10 +1,11 @@import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { TabList } from '@/ui/layout/tab-list/components/TabList';import { t } from '@lingui/core/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconFlask, IconRocket } from 'twenty-ui/display';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsReleasesTabContent } from './components';import { SETTINGS_RELEASES_TABS, SETTINGS_RELEASES_TABS_ID } from './constants';diff --git a/packages/twenty-front/src/pages/settings/roles/SettingsRoleAddObjectLevel.tsx b/packages/twenty-front/src/pages/settings/roles/SettingsRoleAddObjectLevel.tsxindex fc516182660..76e40a64a1c 100644--- a/packages/twenty-front/src/pages/settings/roles/SettingsRoleAddObjectLevel.tsx+++ b/packages/twenty-front/src/pages/settings/roles/SettingsRoleAddObjectLevel.tsx@@ -2,12 +2,12 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContainimport { SettingsRolesQueryEffect } from '@/settings/roles/components/SettingsRolesQueryEffect';import { SettingsRolePermissionsObjectLevelObjectPicker } from '@/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker';import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { t } from '@lingui/core/macro';import { Navigate, useParams } from 'react-router-dom';import { useRecoilValue } from 'recoil';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';export const SettingsRoleAddObjectLevel = () => {const { roleId } = useParams();@@ -25,14 +25,14 @@ export const SettingsRoleAddObjectLevel = () => {<SubMenuTopBarContainertitle={t`1. Select an object`}links={[- { children: t`Roles`, href: '/settings/roles' },+ { children: t`Roles`, href: getSettingsPath(SettingsPath.Roles) },{children: settingsDraftRole.label ?? '',- href: `/settings/roles/${roleId}`,+ href: getSettingsPath(SettingsPath.RoleDetail, { roleId }),},{children: t`Add object permission`,- href: `/settings/roles/${roleId}/add-object-permission`,+ href: getSettingsPath(SettingsPath.RoleAddObjectLevel, { roleId }),},]}>diff --git a/packages/twenty-front/src/pages/settings/roles/SettingsRoleEdit.tsx b/packages/twenty-front/src/pages/settings/roles/SettingsRoleEdit.tsxindex 0e5d36f05d4..8bc00fc81dc 100644--- a/packages/twenty-front/src/pages/settings/roles/SettingsRoleEdit.tsx+++ b/packages/twenty-front/src/pages/settings/roles/SettingsRoleEdit.tsx@@ -1,12 +1,11 @@import { SettingsRolesQueryEffect } from '@/settings/roles/components/SettingsRolesQueryEffect';import { SettingsRole } from '@/settings/roles/role/components/SettingsRole';import { SettingsRoleEditEffect } from '@/settings/roles/role/components/SettingsRoleEditEffect';-import { SettingsPath } from '@/types/SettingsPath';import { Navigate, useParams } from 'react-router-dom';import { useRecoilValue } from 'recoil';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { settingsPersistedRoleFamilyState } from '~/modules/settings/roles/states/settingsPersistedRoleFamilyState';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsRoleEdit = () => {const { roleId } = useParams();diff --git a/packages/twenty-front/src/pages/settings/roles/SettingsRoleObjectLevel.tsx b/packages/twenty-front/src/pages/settings/roles/SettingsRoleObjectLevel.tsxindex 3d8109ed2a9..3d8713e09f9 100644--- a/packages/twenty-front/src/pages/settings/roles/SettingsRoleObjectLevel.tsx+++ b/packages/twenty-front/src/pages/settings/roles/SettingsRoleObjectLevel.tsx@@ -1,9 +1,8 @@import { SettingsRolesQueryEffect } from '@/settings/roles/components/SettingsRolesQueryEffect';import { SettingsRolePermissionsObjectLevelObjectForm } from '@/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectForm';-import { SettingsPath } from '@/types/SettingsPath';import { Navigate, useParams } from 'react-router-dom';-import { isDefined } from 'twenty-shared/utils';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';export const SettingsRoleObjectLevel = () => {const { roleId, objectMetadataId } = useParams();diff --git a/packages/twenty-front/src/pages/settings/security/SettingsSecurity.tsx b/packages/twenty-front/src/pages/settings/security/SettingsSecurity.tsxindex cd535a0c937..11b929cadac 100644--- a/packages/twenty-front/src/pages/settings/security/SettingsSecurity.tsx+++ b/packages/twenty-front/src/pages/settings/security/SettingsSecurity.tsx@@ -7,13 +7,13 @@ import { SettingsSSOIdentitiesProvidersListCard } from '@/settings/security/compimport { SettingsSecurityAuthProvidersOptionsList } from '@/settings/security/components/SettingsSecurityAuthProvidersOptionsList';import { ToggleImpersonate } from '@/settings/workspace/components/ToggleImpersonate';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useRecoilValue } from 'recoil';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { Tag } from 'twenty-ui/components';import { H2Title, IconLock } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledContainer = styled.div`width: 100%;diff --git a/packages/twenty-front/src/pages/settings/security/SettingsSecurityApprovedAccessDomain.tsx b/packages/twenty-front/src/pages/settings/security/SettingsSecurityApprovedAccessDomain.tsxindex ac0b51c9c4d..8b394b20877 100644--- a/packages/twenty-front/src/pages/settings/security/SettingsSecurityApprovedAccessDomain.tsx+++ b/packages/twenty-front/src/pages/settings/security/SettingsSecurityApprovedAccessDomain.tsx@@ -1,6 +1,5 @@import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';@@ -8,12 +7,13 @@ import { ApolloError } from '@apollo/client';import { zodResolver } from '@hookform/resolvers/zod';import { Trans, useLingui } from '@lingui/react/macro';import { Controller, useForm } from 'react-hook-form';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title } from 'twenty-ui/display';import { Section } from 'twenty-ui/layout';import { z } from 'zod';import { useCreateApprovedAccessDomainMutation } from '~/generated-metadata/graphql';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsSecurityApprovedAccessDomain = () => {const navigate = useNavigateSettings();diff --git a/packages/twenty-front/src/pages/settings/security/SettingsSecuritySSOIdentifyProvider.tsx b/packages/twenty-front/src/pages/settings/security/SettingsSecuritySSOIdentifyProvider.tsxindex fff9bcc8951..1f15b0c1e87 100644--- a/packages/twenty-front/src/pages/settings/security/SettingsSecuritySSOIdentifyProvider.tsx+++ b/packages/twenty-front/src/pages/settings/security/SettingsSecuritySSOIdentifyProvider.tsx@@ -6,7 +6,6 @@ import { useCreateSSOIdentityProvider } from '@/settings/security/hooks/useCreatimport { type SettingSecurityNewSSOIdentityFormValues } from '@/settings/security/types/SSOIdentityProvider';import { sSOIdentityProviderDefaultValues } from '@/settings/security/utils/sSOIdentityProviderDefaultValues';import { SSOIdentitiesProvidersParamsSchema } from '@/settings/security/validation-schemas/SSOIdentityProviderSchema';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { ApolloError } from '@apollo/client';@@ -15,8 +14,9 @@ import { t } from '@lingui/core/macro';import { Trans } from '@lingui/react/macro';import pick from 'lodash.pick';import { FormProvider, useForm } from 'react-hook-form';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsSecuritySSOIdentifyProvider = () => {const navigate = useNavigateSettings();diff --git a/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionDetail.tsx b/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionDetail.tsxindex 5bc055faf5f..4004327c8d2 100644--- a/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionDetail.tsx+++ b/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionDetail.tsx@@ -7,7 +7,6 @@ import { useGetOneServerlessFunctionSourceCode } from '@/settings/serverless-funimport { usePublishOneServerlessFunction } from '@/settings/serverless-functions/hooks/usePublishOneServerlessFunction';import { useServerlessFunctionUpdateFormState } from '@/settings/serverless-functions/hooks/useServerlessFunctionUpdateFormState';import { useUpdateOneServerlessFunction } from '@/settings/serverless-functions/hooks/useUpdateOneServerlessFunction';-import { SettingsPath } from '@/types/SettingsPath';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { TabList } from '@/ui/layout/tab-list/components/TabList';@@ -16,12 +15,12 @@ import { useRecoilComponentState } from '@/ui/utilities/state/component-state/hoimport { ApolloError } from '@apollo/client';import { useState } from 'react';import { useParams } from 'react-router-dom';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { IconCode, IconSettings, IconTestPipe } from 'twenty-ui/display';import { useDebouncedCallback } from 'use-debounce';import { getErrorMessageFromApolloError } from '~/utils/get-error-message-from-apollo-error.util';import { isDeeplyEqual } from '~/utils/isDeeplyEqual';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const SERVERLESS_FUNCTION_DETAIL_ID = 'serverless-function-detail';diff --git a/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctions.tsx b/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctions.tsxindex a8dddeb8123..88e5cc8b0ee 100644--- a/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctions.tsx+++ b/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctions.tsx@@ -1,9 +1,9 @@import { SettingsServerlessFunctionsTable } from '@/settings/serverless-functions/components/SettingsServerlessFunctionsTable';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';-import { Button } from 'twenty-ui/input';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { IconPlus } from 'twenty-ui/display';+import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';import { UndecoratedLink } from 'twenty-ui/navigation';diff --git a/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionsNew.tsx b/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionsNew.tsxindex 00c3c1da8e6..4f78b5a860d 100644--- a/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionsNew.tsx+++ b/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionsNew.tsx@@ -5,11 +5,10 @@ import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBaimport { SettingsServerlessFunctionNewForm } from '@/settings/serverless-functions/components/SettingsServerlessFunctionNewForm';import { useCreateOneServerlessFunction } from '@/settings/serverless-functions/hooks/useCreateOneServerlessFunction';import { type ServerlessFunctionNewFormValues } from '@/settings/serverless-functions/hooks/useServerlessFunctionUpdateFormState';-import { SettingsPath } from '@/types/SettingsPath';import { useState } from 'react';-import { isDefined } from 'twenty-shared/utils';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';import { useNavigateSettings } from '~/hooks/useNavigateSettings';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';export const SettingsServerlessFunctionsNew = () => {const navigate = useNavigateSettings();diff --git a/packages/twenty-front/src/pages/settings/workspace/SettingsApiWebhooks.tsx b/packages/twenty-front/src/pages/settings/workspace/SettingsApiWebhooks.tsxindex 376c9fee2d8..00c557d7773 100644--- a/packages/twenty-front/src/pages/settings/workspace/SettingsApiWebhooks.tsx+++ b/packages/twenty-front/src/pages/settings/workspace/SettingsApiWebhooks.tsx@@ -3,16 +3,16 @@ import { SettingsApiKeysTable } from '@/settings/developers/components/SettingsAimport { SettingsWebhooksTable } from '@/settings/developers/components/SettingsWebhooksTable';import { PlaygroundSetupForm } from '@/settings/playground/components/PlaygroundSetupForm';import { StyledSettingsApiPlaygroundCoverImage } from '@/settings/playground/components/SettingsPlaygroundCoverImage';-import { SettingsPath } from '@/types/SettingsPath';import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';import styled from '@emotion/styled';import { Trans, useLingui } from '@lingui/react/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { H2Title, IconPlus } from 'twenty-ui/display';import { Button } from 'twenty-ui/input';import { Section } from 'twenty-ui/layout';import { MOBILE_VIEWPORT } from 'twenty-ui/theme';-import { getSettingsPath } from '~/utils/navigation/getSettingsPath';const StyledButtonContainer = styled.div`display: flex;diff --git a/packages/twenty-front/src/testing/constants/UntestedAppPaths.ts b/packages/twenty-front/src/testing/constants/UntestedAppPaths.tsindex dd39b62d81f..e9392c4f9b1 100644--- a/packages/twenty-front/src/testing/constants/UntestedAppPaths.ts+++ b/packages/twenty-front/src/testing/constants/UntestedAppPaths.ts@@ -1,3 +1,3 @@-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';export const UNTESTED_APP_PATHS = [AppPath.Settings, AppPath.Developers];diff --git a/packages/twenty-front/src/utils/__tests__/buildAppPathWithQueryParams.test.ts b/packages/twenty-front/src/utils/__tests__/buildAppPathWithQueryParams.test.tsindex 13da7e08122..78793ff968b 100644--- a/packages/twenty-front/src/utils/__tests__/buildAppPathWithQueryParams.test.ts+++ b/packages/twenty-front/src/utils/__tests__/buildAppPathWithQueryParams.test.ts@@ -1,4 +1,4 @@-import { AppPath } from '@/types/AppPath';+import { AppPath } from 'twenty-shared/types';import { buildAppPathWithQueryParams } from '~/utils/buildAppPathWithQueryParams';describe('buildAppPathWithQueryParams', () => {diff --git a/packages/twenty-front/src/utils/__tests__/isMatchingLocation.test.tsx b/packages/twenty-front/src/utils/__tests__/isMatchingLocation.test.tsxindex 11a4bd50340..863298485ac 100644--- a/packages/twenty-front/src/utils/__tests__/isMatchingLocation.test.tsx+++ b/packages/twenty-front/src/utils/__tests__/isMatchingLocation.test.tsx@@ -1,4 +1,4 @@-import { AppBasePath } from '@/types/AppBasePath';+import { AppBasePath } from 'twenty-shared/types';import { isMatchingLocation } from '../isMatchingLocation';describe('isMatchingLocation', () => {diff --git a/packages/twenty-front/src/utils/buildAppPathWithQueryParams.ts b/packages/twenty-front/src/utils/buildAppPathWithQueryParams.tsindex 77977534e4f..80270afd22b 100644--- a/packages/twenty-front/src/utils/buildAppPathWithQueryParams.ts+++ b/packages/twenty-front/src/utils/buildAppPathWithQueryParams.ts@@ -1,4 +1,4 @@-import { type AppPath } from '@/types/AppPath';+import { type AppPath } from 'twenty-shared/types';export const buildAppPathWithQueryParams = (path: AppPath,diff --git a/packages/twenty-front/src/utils/isMatchingLocation.ts b/packages/twenty-front/src/utils/isMatchingLocation.tsindex 07153eac825..9c63a072fa5 100644--- a/packages/twenty-front/src/utils/isMatchingLocation.ts+++ b/packages/twenty-front/src/utils/isMatchingLocation.ts@@ -1,7 +1,7 @@import { type Location, matchPath } from 'react-router-dom';-import { type AppBasePath } from '@/types/AppBasePath';import { isNonEmptyString } from '@sniptt/guards';+import { type AppBasePath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';const addTrailingSlash = (path: string) =>diff --git a/packages/twenty-front/src/utils/title-utils.ts b/packages/twenty-front/src/utils/title-utils.tsindex b0e1ae43a45..33adc7bc95b 100644--- a/packages/twenty-front/src/utils/title-utils.ts+++ b/packages/twenty-front/src/utils/title-utils.ts@@ -1,7 +1,5 @@-import { AppBasePath } from '@/types/AppBasePath';-import { AppPath } from '@/types/AppPath';-import { SettingsPath } from '@/types/SettingsPath';import { t } from '@lingui/core/macro';+import { AppBasePath, AppPath, SettingsPath } from 'twenty-shared/types';enum SettingsPathPrefixes {Accounts = `${AppBasePath.Settings}/${SettingsPath.Accounts}`,diff --git a/packages/twenty-server/src/engine/api/rest/core/query-builder/core-query-builder.factory.ts b/packages/twenty-server/src/engine/api/rest/core/query-builder/core-query-builder.factory.tsindex 97916683b90..3f48b90b40a 100644--- a/packages/twenty-server/src/engine/api/rest/core/query-builder/core-query-builder.factory.ts+++ b/packages/twenty-server/src/engine/api/rest/core/query-builder/core-query-builder.factory.ts@@ -1,6 +1,8 @@import { BadRequestException, Injectable } from '@nestjs/common';import { type Request } from 'express';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { CreateManyQueryFactory } from 'src/engine/api/rest/core/query-builder/factories/create-many-query.factory';import { CreateVariablesFactory } from 'src/engine/api/rest/core/query-builder/factories/create-variables.factory';@@ -70,7 +72,7 @@ export class CoreQueryBuilderFactory {`No object was found for the workspace associated with this API key. You may generate a new one here ${this.domainManagerService.buildWorkspaceURL({workspace,- pathname: '/settings/apis',+ pathname: getSettingsPath(SettingsPath.ApiWebhooks),}).toString()}`,);diff --git a/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.service.ts b/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.service.tsindex f6d8cc538ee..34b2e22ed2c 100644--- a/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.service.ts+++ b/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.service.ts@@ -6,6 +6,8 @@ import crypto from 'crypto';import { t } from '@lingui/core/macro';import { render } from '@react-email/render';import { SendApprovedAccessDomainValidation } from 'twenty-emails';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { Repository } from 'typeorm';import { ApprovedAccessDomain as ApprovedAccessDomainEntity } from 'src/engine/core-modules/approved-access-domain/approved-access-domain.entity';@@ -59,7 +61,7 @@ export class ApprovedAccessDomainService {const link = this.domainManagerService.buildWorkspaceURL({workspace,- pathname: `settings/security`,+ pathname: getSettingsPath(SettingsPath.Domains),searchParams: {wtdId: approvedAccessDomain.id,validationToken: this.generateUniqueHash(approvedAccessDomain),diff --git a/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.spec.ts b/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.spec.tsindex cd5886e9b86..420f4b75ca6 100644--- a/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.spec.ts@@ -1,6 +1,8 @@import { Test, type TestingModule } from '@nestjs/testing';import { getRepositoryToken } from '@nestjs/typeorm';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { type DeleteResult, type Repository } from 'typeorm';import { ApprovedAccessDomain } from 'src/engine/core-modules/approved-access-domain/approved-access-domain.entity';@@ -282,7 +284,7 @@ describe('ApprovedAccessDomainService', () => {expect(domainManagerService.buildWorkspaceURL).toHaveBeenCalledWith({workspace: workspace,- pathname: 'settings/security',+ pathname: getSettingsPath(SettingsPath.Domains),searchParams: { validationToken: expect.any(String) },});diff --git a/packages/twenty-server/src/engine/core-modules/auth/controllers/google-apis-auth.controller.ts b/packages/twenty-server/src/engine/core-modules/auth/controllers/google-apis-auth.controller.tsindex e45132f7107..2f35204063a 100644--- a/packages/twenty-server/src/engine/core-modules/auth/controllers/google-apis-auth.controller.ts+++ b/packages/twenty-server/src/engine/core-modules/auth/controllers/google-apis-auth.controller.ts@@ -9,6 +9,8 @@ import {import { InjectRepository } from '@nestjs/typeorm';import { Response } from 'express';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { Repository } from 'typeorm';import {@@ -115,7 +117,8 @@ export class GoogleAPIsAuthController {this.domainManagerService.buildWorkspaceURL({workspace,- pathname: redirectLocation || '/settings/accounts',+ pathname:+ redirectLocation || getSettingsPath(SettingsPath.Accounts),}).toString(),);@@ -127,7 +130,7 @@ export class GoogleAPIsAuthController {subdomain: this.twentyConfigService.get('DEFAULT_SUBDOMAIN'),customDomain: null,},- pathname: '/settings/accounts',+ pathname: getSettingsPath(SettingsPath.Accounts),}),);}diff --git a/packages/twenty-server/src/engine/core-modules/auth/controllers/microsoft-apis-auth.controller.ts b/packages/twenty-server/src/engine/core-modules/auth/controllers/microsoft-apis-auth.controller.tsindex 0a9602c9032..f8732b73e45 100644--- a/packages/twenty-server/src/engine/core-modules/auth/controllers/microsoft-apis-auth.controller.ts+++ b/packages/twenty-server/src/engine/core-modules/auth/controllers/microsoft-apis-auth.controller.ts@@ -9,6 +9,8 @@ import {import { InjectRepository } from '@nestjs/typeorm';import { Response } from 'express';+import { AppPath, SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';import { Repository } from 'typeorm';import {@@ -122,7 +124,8 @@ export class MicrosoftAPIsAuthController {this.domainManagerService.buildWorkspaceURL({workspace,- pathname: redirectLocation || '/settings/accounts',+ pathname:+ redirectLocation || getSettingsPath(SettingsPath.Accounts),}).toString(),);@@ -134,7 +137,7 @@ export class MicrosoftAPIsAuthController {subdomain: this.twentyConfigService.get('DEFAULT_SUBDOMAIN'),customDomain: null,},- pathname: '/verify',+ pathname: AppPath.Verify,}),);}diff --git a/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.ts b/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.tsindex 7afb4806326..9a3c7ad4fcd 100644--- a/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.ts+++ b/packages/twenty-server/src/engine/core-modules/auth/controllers/sso-auth.controller.ts@@ -13,6 +13,7 @@ import { InjectRepository } from '@nestjs/typeorm';import { generateServiceProviderMetadata } from '@node-saml/node-saml';import { Response } from 'express';+import { AppPath } from 'twenty-shared/types';import { Repository } from 'typeorm';import {@@ -162,7 +163,7 @@ export class SSOAuthController {this.domainManagerService.getSubdomainAndCustomDomainFromWorkspaceFallbackOnDefaultSubdomain(workspaceIdentityProvider?.workspace,),- pathname: '/verify',+ pathname: AppPath.Verify,}),);}diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.tsindex 4630a463f05..853ba28a12b 100644--- a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts+++ b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts@@ -9,6 +9,7 @@ import { render } from '@react-email/render';import { addMilliseconds } from 'date-fns';import ms from 'ms';import { PasswordUpdateNotifyEmail } from 'twenty-emails';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { Repository } from 'typeorm';@@ -527,7 +528,7 @@ export class AuthService {}) {const url = this.domainManagerService.buildWorkspaceURL({workspace,- pathname: '/verify',+ pathname: AppPath.Verify,searchParams: {loginToken,...(billingCheckoutSessionState ? { billingCheckoutSessionState } : {}),@@ -739,7 +740,7 @@ export class AuthService {));const url = this.domainManagerService.buildBaseUrl({- pathname: '/welcome',+ pathname: AppPath.SignInUp,searchParams: {tokenPair: JSON.stringify({accessOrWorkspaceAgnosticToken:@@ -827,7 +828,7 @@ export class AuthService {this.domainManagerService.getSubdomainAndCustomDomainFromWorkspaceFallbackOnDefaultSubdomain(currentWorkspace,),- pathname: '/verify',+ pathname: AppPath.Verify,});}}diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/reset-password.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/reset-password.service.tsindex 0a32de194a2..482818ca62a 100644--- a/packages/twenty-server/src/engine/core-modules/auth/services/reset-password.service.ts+++ b/packages/twenty-server/src/engine/core-modules/auth/services/reset-password.service.ts@@ -10,6 +10,8 @@ import { addMilliseconds, differenceInMilliseconds } from 'date-fns';import ms from 'ms';import { PasswordResetLinkEmail } from 'twenty-emails';import { type APP_LOCALES } from 'twenty-shared/translations';+import { AppPath } from 'twenty-shared/types';+import { getAppPath } from 'twenty-shared/utils';import { IsNull, MoreThan, Repository } from 'typeorm';import {@@ -139,7 +141,9 @@ export class ResetPasswordService {const link = this.domainManagerService.buildWorkspaceURL({workspace,- pathname: `/reset-password/${resetToken.passwordResetToken}`,+ pathname: getAppPath(AppPath.ResetPassword, {+ passwordResetToken: resetToken.passwordResetToken,+ }),});const emailData = {diff --git a/packages/twenty-server/src/engine/core-modules/email-verification/services/email-verification.service.ts b/packages/twenty-server/src/engine/core-modules/email-verification/services/email-verification.service.tsindex bd1d4f3c037..5a6f2519566 100644--- a/packages/twenty-server/src/engine/core-modules/email-verification/services/email-verification.service.ts+++ b/packages/twenty-server/src/engine/core-modules/email-verification/services/email-verification.service.ts@@ -8,6 +8,7 @@ import { addMilliseconds, differenceInMilliseconds } from 'date-fns';import ms from 'ms';import { SendEmailVerificationLinkEmail } from 'twenty-emails';import { type APP_LOCALES } from 'twenty-shared/translations';+import { AppPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { Repository } from 'typeorm';@@ -55,7 +56,7 @@ export class EmailVerificationService {await this.emailVerificationTokenService.generateToken(userId, email);const linkPathnameAndSearchParams = {- pathname: 'verify-email',+ pathname: AppPath.VerifyEmail,searchParams: {emailVerificationToken,email,diff --git a/packages/twenty-server/src/engine/core-modules/guard-redirect/services/guard-redirect.service.ts b/packages/twenty-server/src/engine/core-modules/guard-redirect/services/guard-redirect.service.tsindex d276760e57f..408d8f6fa06 100644--- a/packages/twenty-server/src/engine/core-modules/guard-redirect/services/guard-redirect.service.ts+++ b/packages/twenty-server/src/engine/core-modules/guard-redirect/services/guard-redirect.service.ts@@ -1,6 +1,7 @@import { type ExecutionContext, Injectable } from '@nestjs/common';import { type Request } from 'express';+import { AppPath } from 'twenty-shared/types';import {AuthException,@@ -28,7 +29,7 @@ export class GuardRedirectService {customDomain: string | null;isCustomDomainEnabled?: boolean;},- pathname = '/verify',+ pathname = AppPath.Verify,) {if ('contextType' in context && context.contextType === 'graphql') {throw error;diff --git a/packages/twenty-server/src/engine/core-modules/workspace-invitation/services/workspace-invitation.service.ts b/packages/twenty-server/src/engine/core-modules/workspace-invitation/services/workspace-invitation.service.tsindex d2dc8b0ff88..89743f15838 100644--- a/packages/twenty-server/src/engine/core-modules/workspace-invitation/services/workspace-invitation.service.ts+++ b/packages/twenty-server/src/engine/core-modules/workspace-invitation/services/workspace-invitation.service.ts@@ -9,6 +9,8 @@ import { render } from '@react-email/render';import { addMilliseconds } from 'date-fns';import ms from 'ms';import { SendInviteLinkEmail } from 'twenty-emails';+import { AppPath } from 'twenty-shared/types';+import { getAppPath } from 'twenty-shared/utils';import { IsNull, Repository } from 'typeorm';import {@@ -278,7 +280,9 @@ export class WorkspaceInvitationService {if (invitation.status === 'fulfilled') {const link = this.domainManagerService.buildWorkspaceURL({workspace,- pathname: `invite/${workspace?.inviteHash}`,+ pathname: getAppPath(AppPath.Invite, {+ workspaceInviteHash: workspace?.inviteHash,+ }),searchParams: invitation.value.isPersonalInvitation? {inviteToken: invitation.value.appToken.value,diff --git a/packages/twenty-server/src/engine/metadata-modules/agent/agent-execution.service.ts b/packages/twenty-server/src/engine/metadata-modules/agent/agent-execution.service.tsindex 9fada99bf6d..a070fa65757 100644--- a/packages/twenty-server/src/engine/metadata-modules/agent/agent-execution.service.ts+++ b/packages/twenty-server/src/engine/metadata-modules/agent/agent-execution.service.ts@@ -12,8 +12,11 @@ import {ToolSet,type UserContent,} from 'ai';+import { AppPath } from 'twenty-shared/types';+import { getAppPath } from 'twenty-shared/utils';import { In, Repository } from 'typeorm';+import { AIBillingService } from 'src/engine/core-modules/ai/services/ai-billing.service';import { AiModelRegistryService } from 'src/engine/core-modules/ai/services/ai-model-registry.service';import { DomainManagerService } from 'src/engine/core-modules/domain-manager/services/domain-manager.service';import { FileEntity } from 'src/engine/core-modules/file/entities/file.entity';@@ -31,7 +34,6 @@ import { type RecordIdsByObjectMetadataNameSingularType } from 'src/engine/metadimport { WorkspacePermissionsCacheService } from 'src/engine/metadata-modules/workspace-permissions-cache/workspace-permissions-cache.service';import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';import { streamToBuffer } from 'src/utils/stream-to-buffer';-import { AIBillingService } from 'src/engine/core-modules/ai/services/ai-billing.service';import { AgentToolGeneratorService } from './agent-tool-generator.service';import { AgentEntity } from './agent.entity';@@ -204,7 +206,11 @@ export class AgentExecutionService {...record,resourceUrl: this.domainManagerService.buildWorkspaceURL({workspace,- pathname: `object/${recordsWithObjectMetadataNameSingular.objectMetadataNameSingular}/${record.id}`,+ pathname: getAppPath(AppPath.RecordShowPage, {+ objectNameSingular:+ recordsWithObjectMetadataNameSingular.objectMetadataNameSingular,+ objectRecordId: record.id,+ }),}),};});diff --git a/packages/twenty-shared/package.json b/packages/twenty-shared/package.jsonindex 62ce22e1c2d..2c9d9e5612c 100644--- a/packages/twenty-shared/package.json+++ b/packages/twenty-shared/package.json@@ -28,6 +28,8 @@"@sniptt/guards": "^0.2.0","handlebars": "^4.7.8","libphonenumber-js": "^1.10.26",+ "qs": "^6.11.2",+ "react-router-dom": "^6.4.4","zod": "3.23.8"},"exports": {diff --git a/packages/twenty-front/src/modules/types/AppBasePath.ts b/packages/twenty-shared/src/types/AppBasePath.tssimilarity index 100%rename from packages/twenty-front/src/modules/types/AppBasePath.tsrename to packages/twenty-shared/src/types/AppBasePath.tsdiff --git a/packages/twenty-front/src/modules/types/AppPath.ts b/packages/twenty-shared/src/types/AppPath.tssimilarity index 100%rename from packages/twenty-front/src/modules/types/AppPath.tsrename to packages/twenty-shared/src/types/AppPath.tsdiff --git a/packages/twenty-front/src/modules/types/SettingsPath.ts b/packages/twenty-shared/src/types/SettingsPath.tssimilarity index 100%rename from packages/twenty-front/src/modules/types/SettingsPath.tsrename to packages/twenty-shared/src/types/SettingsPath.tsdiff --git a/packages/twenty-shared/src/types/index.ts b/packages/twenty-shared/src/types/index.tsindex 49528838a06..d298fa231a5 100644--- a/packages/twenty-shared/src/types/index.ts+++ b/packages/twenty-shared/src/types/index.ts@@ -9,6 +9,8 @@export type { AllowedAddressSubField } from './AddressFieldsType';export { ALLOWED_ADDRESS_SUBFIELDS } from './AddressFieldsType';+export { AppBasePath } from './AppBasePath';+export { AppPath } from './AppPath';export type { ConfigVariableValue } from './ConfigVariableValue';export { ConnectedAccountProvider } from './ConnectedAccountProvider';export type { EnumFieldMetadataType } from './EnumFieldMetadataType';@@ -34,6 +36,7 @@ export type {export { DEFAULT_RELATIVE_DATE_VALUE } from './RelativeDateValue';export type { RestrictedFieldPermissions } from './RestrictedFieldPermissions';export type { RestrictedFieldsPermissions } from './RestrictedFieldsPermissions';+export { SettingsPath } from './SettingsPath';export type { StepFilterGroup, StepFilter } from './StepFilters';export { StepLogicalOperator } from './StepFilters';export { TwoFactorAuthenticationStrategy } from './TwoFactorAuthenticationStrategy';diff --git a/packages/twenty-shared/src/utils/index.ts b/packages/twenty-shared/src/utils/index.tsindex 5f769833934..2d20512d961 100644--- a/packages/twenty-shared/src/utils/index.ts+++ b/packages/twenty-shared/src/utils/index.ts@@ -24,6 +24,8 @@ export {getLogoUrlFromDomainName,} from './image/getLogoUrlFromDomainName';export { getUniqueConstraintsFields } from './indexMetadata/getUniqueConstraintsFields';+export { getAppPath } from './navigation/getAppPath';+export { getSettingsPath } from './navigation/getSettingsPath';export { parseJson } from './parseJson';export { removePropertiesFromRecord } from './removePropertiesFromRecord';export { removeUndefinedFields } from './removeUndefinedFields';diff --git a/packages/twenty-front/src/utils/navigation/__tests__/getAppPath.test.ts b/packages/twenty-shared/src/utils/navigation/__tests__/getAppPath.test.tssimilarity index 98%rename from packages/twenty-front/src/utils/navigation/__tests__/getAppPath.test.tsrename to packages/twenty-shared/src/utils/navigation/__tests__/getAppPath.test.tsindex 23011c23407..3ff131d8978 100644--- a/packages/twenty-front/src/utils/navigation/__tests__/getAppPath.test.ts+++ b/packages/twenty-shared/src/utils/navigation/__tests__/getAppPath.test.ts@@ -1,4 +1,4 @@-import { AppPath } from '@/types/AppPath';+import { AppPath } from '../../../types';import { getAppPath } from '../getAppPath';describe('getAppPath', () => {diff --git a/packages/twenty-front/src/utils/navigation/__tests__/getSettingsPath.test.ts b/packages/twenty-shared/src/utils/navigation/__tests__/getSettingsPath.test.tssimilarity index 98%rename from packages/twenty-front/src/utils/navigation/__tests__/getSettingsPath.test.tsrename to packages/twenty-shared/src/utils/navigation/__tests__/getSettingsPath.test.tsindex 3f03c25286a..800b1e167f3 100644--- a/packages/twenty-front/src/utils/navigation/__tests__/getSettingsPath.test.ts+++ b/packages/twenty-shared/src/utils/navigation/__tests__/getSettingsPath.test.ts@@ -1,4 +1,4 @@-import { SettingsPath } from '@/types/SettingsPath';+import { SettingsPath } from '../../../types';import { getSettingsPath } from '../getSettingsPath';describe('getSettingsPath', () => {diff --git a/packages/twenty-front/src/utils/navigation/getAppPath.ts b/packages/twenty-shared/src/utils/navigation/getAppPath.tssimilarity index 86%rename from packages/twenty-front/src/utils/navigation/getAppPath.tsrename to packages/twenty-shared/src/utils/navigation/getAppPath.tsindex 478a88b8883..e95e416cb37 100644--- a/packages/twenty-front/src/utils/navigation/getAppPath.ts+++ b/packages/twenty-shared/src/utils/navigation/getAppPath.ts@@ -1,7 +1,7 @@-import { type AppPath } from '@/types/AppPath';import qs from 'qs';import { generatePath, type PathParam } from 'react-router-dom';-import { isDefined } from 'twenty-shared/utils';+import { type AppPath } from '../../types';+import { isDefined } from '../validation';export const getAppPath = <T extends AppPath>(to: T,diff --git a/packages/twenty-front/src/utils/navigation/getSettingsPath.ts b/packages/twenty-shared/src/utils/navigation/getSettingsPath.tssimilarity index 85%rename from packages/twenty-front/src/utils/navigation/getSettingsPath.tsrename to packages/twenty-shared/src/utils/navigation/getSettingsPath.tsindex c487c62c90a..01a4cbb9f68 100644--- a/packages/twenty-front/src/utils/navigation/getSettingsPath.ts+++ b/packages/twenty-shared/src/utils/navigation/getSettingsPath.ts@@ -1,8 +1,7 @@-import { AppPath } from '@/types/AppPath';-import { type SettingsPath } from '@/types/SettingsPath';import qs from 'qs';import { generatePath, type PathParam } from 'react-router-dom';-import { isDefined } from 'twenty-shared/utils';+import { AppPath, type SettingsPath } from '../../types';+import { isDefined } from '../validation';export const getSettingsPath = <T extends SettingsPath>(to: T,diff --git a/yarn.lock b/yarn.lockindex 1ab41c22ed3..530b2db1f1f 100644--- a/yarn.lock+++ b/yarn.lock@@ -51266,6 +51266,8 @@ __metadata:glob: "npm:^11.0.1"handlebars: "npm:^4.7.8"libphonenumber-js: "npm:^1.10.26"+ qs: "npm:^6.11.2"+ react-router-dom: "npm:^6.4.4"tsx: "npm:^4.19.3"vite: "npm:^7.0.0"vite-plugin-dts: "npm:3.8.1"