Skip to content

The open alternative to Salesforce, designed for AI.

Reorganize files properly (#14262)

martmull7c195b3bfd0d
diff --git a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
index 0f207290d69..b30c958871e 100644
--- a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
+++ b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
@@ -125,11 +125,17 @@ const SettingsWorkspace = lazy(() =>
);
const SettingsDomains = lazy(() =>
- import('~/pages/settings/domains').then((module) => ({
+ import('~/pages/settings/domains/SettingsDomains').then((module) => ({
default: module.SettingsDomains,
})),
);
+const SettingsDomain = lazy(() =>
+ import('~/pages/settings/domains/SettingsDomain').then((module) => ({
+ default: module.SettingsDomain,
+ })),
+);
+
const SettingsApiWebhooks = lazy(() =>
import('~/pages/settings/workspace/SettingsApiWebhooks').then((module) => ({
default: module.SettingsApiWebhooks,
@@ -148,12 +154,6 @@ const SettingsAgentForm = lazy(() =>
})),
);
-const SettingsDomain = lazy(() =>
- import('~/pages/settings/workspace/SettingsDomain').then((module) => ({
- default: module.SettingsDomain,
- })),
-);
-
const SettingsWorkspaceMembers = lazy(() =>
import('~/pages/settings/SettingsWorkspaceMembers').then((module) => ({
default: module.SettingsWorkspaceMembers,
diff --git a/packages/twenty-front/src/pages/settings/workspace/CheckCustomDomainValidRecordsEffect.tsx b/packages/twenty-front/src/modules/settings/domains/CheckCustomDomainValidRecordsEffect.tsx
similarity index 77%
rename from packages/twenty-front/src/pages/settings/workspace/CheckCustomDomainValidRecordsEffect.tsx
rename to packages/twenty-front/src/modules/settings/domains/CheckCustomDomainValidRecordsEffect.tsx
index 3e9195ef57e..0e4e579bf62 100644
--- a/packages/twenty-front/src/pages/settings/workspace/CheckCustomDomainValidRecordsEffect.tsx
+++ b/packages/twenty-front/src/modules/settings/domains/CheckCustomDomainValidRecordsEffect.tsx
@@ -1,6 +1,6 @@
/* @license Enterprise */
-import { useCheckCustomDomainValidRecords } from '~/pages/settings/workspace/hooks/useCheckCustomDomainValidRecords';
import { useEffect } from 'react';
+import { useCheckCustomDomainValidRecords } from '@/settings/domains/hooks/useCheckCustomDomainValidRecords';
export const CheckCustomDomainValidRecordsEffect = () => {
const { checkCustomDomainRecords } = useCheckCustomDomainValidRecords();
diff --git a/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomain.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingsCustomDomain.tsx
similarity index 87%
rename from packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomain.tsx
rename to packages/twenty-front/src/modules/settings/domains/components/SettingsCustomDomain.tsx
index 05973873a44..80c37e24abc 100644
--- a/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomain.tsx
+++ b/packages/twenty-front/src/modules/settings/domains/components/SettingsCustomDomain.tsx
@@ -8,10 +8,10 @@ import { useRecoilValue } from 'recoil';
import { H2Title, IconReload, IconTrash } from 'twenty-ui/display';
import { Button, ButtonGroup } from 'twenty-ui/input';
import { Section } from 'twenty-ui/layout';
-import { CheckCustomDomainValidRecordsEffect } from '~/pages/settings/workspace/CheckCustomDomainValidRecordsEffect';
-import { SettingsCustomDomainRecords } from '~/pages/settings/workspace/SettingsCustomDomainRecords';
-import { useCheckCustomDomainValidRecords } from '~/pages/settings/workspace/hooks/useCheckCustomDomainValidRecords';
-import { customDomainRecordsState } from '~/pages/settings/workspace/states/customDomainRecordsState';
+import { SettingsCustomDomainRecords } from '@/settings/domains/components/SettingsCustomDomainRecords';
+import { CheckCustomDomainValidRecordsEffect } from '@/settings/domains/CheckCustomDomainValidRecordsEffect';
+import { useCheckCustomDomainValidRecords } from '@/settings/domains/hooks/useCheckCustomDomainValidRecords';
+import { customDomainRecordsState } from '@/settings/domains/states/customDomainRecordsState';
const StyledDomainFormWrapper = styled.div`
display: flex;
diff --git a/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomainRecords.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingsCustomDomainRecords.tsx
similarity index 97%
rename from packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomainRecords.tsx
rename to packages/twenty-front/src/modules/settings/domains/components/SettingsCustomDomainRecords.tsx
index c3c4f0148ab..a13aa151c59 100644
--- a/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomainRecords.tsx
+++ b/packages/twenty-front/src/modules/settings/domains/components/SettingsCustomDomainRecords.tsx
@@ -13,10 +13,10 @@ import {
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
import { capitalize } from 'twenty-shared/utils';
import { useRecoilValue } from 'recoil';
-import { customDomainRecordsState } from '~/pages/settings/workspace/states/customDomainRecordsState';
import { type ThemeColor } from 'twenty-ui/theme';
import { Status } from 'twenty-ui/display';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
+import { customDomainRecordsState } from '@/settings/domains/states/customDomainRecordsState';
const StyledTable = styled(Table)`
border-bottom: 1px solid ${({ theme }) => theme.border.color.light};
diff --git a/packages/twenty-front/src/pages/settings/workspace/SettingsSubdomain.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingsSubdomain.tsx
similarity index 100%
rename from packages/twenty-front/src/pages/settings/workspace/SettingsSubdomain.tsx
rename to packages/twenty-front/src/modules/settings/domains/components/SettingsSubdomain.tsx
diff --git a/packages/twenty-front/src/pages/settings/domains/components/SettingsWorkspaceDomainCard.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingsWorkspaceDomainCard.tsx
similarity index 100%
rename from packages/twenty-front/src/pages/settings/domains/components/SettingsWorkspaceDomainCard.tsx
rename to packages/twenty-front/src/modules/settings/domains/components/SettingsWorkspaceDomainCard.tsx
diff --git a/packages/twenty-front/src/pages/settings/workspace/hooks/useCheckCustomDomainValidRecords.ts b/packages/twenty-front/src/modules/settings/domains/hooks/useCheckCustomDomainValidRecords.ts
similarity index 92%
rename from packages/twenty-front/src/pages/settings/workspace/hooks/useCheckCustomDomainValidRecords.ts
rename to packages/twenty-front/src/modules/settings/domains/hooks/useCheckCustomDomainValidRecords.ts
index 4c5fcf9db12..78d66ff963e 100644
--- a/packages/twenty-front/src/pages/settings/workspace/hooks/useCheckCustomDomainValidRecords.ts
+++ b/packages/twenty-front/src/modules/settings/domains/hooks/useCheckCustomDomainValidRecords.ts
@@ -1,8 +1,8 @@
-import { customDomainRecordsState } from '~/pages/settings/workspace/states/customDomainRecordsState';
import { useCheckCustomDomainValidRecordsMutation } from '~/generated-metadata/graphql';
import { useSetRecoilState } from 'recoil';
import { isDefined } from 'twenty-shared/utils';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { customDomainRecordsState } from '@/settings/domains/states/customDomainRecordsState';
export const useCheckCustomDomainValidRecords = () => {
const [checkCustomDomainValidRecords] =
diff --git a/packages/twenty-front/src/pages/settings/workspace/states/customDomainRecordsState.ts b/packages/twenty-front/src/modules/settings/domains/states/customDomainRecordsState.ts
similarity index 100%
rename from packages/twenty-front/src/pages/settings/workspace/states/customDomainRecordsState.ts
rename to packages/twenty-front/src/modules/settings/domains/states/customDomainRecordsState.ts
diff --git a/packages/twenty-front/src/modules/types/SettingsPath.ts b/packages/twenty-front/src/modules/types/SettingsPath.ts
index 98c1d678fa6..908d93df7b1 100644
--- a/packages/twenty-front/src/modules/types/SettingsPath.ts
+++ b/packages/twenty-front/src/modules/types/SettingsPath.ts
@@ -21,8 +21,9 @@ export enum SettingsPath {
ServerlessFunctionDetail = 'functions/:serverlessFunctionId',
WorkspaceMembersPage = 'members',
Workspace = 'general',
- Domain = 'general/domain',
Domains = 'domains',
+ Domain = 'domains/domain',
+ NewApprovedAccessDomain = 'domains/approved-access-domain/new',
Releases = 'releases',
AI = 'ai',
AINewAgent = 'ai/new-agent',
@@ -42,7 +43,6 @@ export enum SettingsPath {
IntegrationNewDatabaseConnection = 'integrations/:databaseKey/new',
Security = 'security',
NewSSOIdentityProvider = 'security/sso/new',
- NewApprovedAccessDomain = 'security/approved-access-domain/new',
AdminPanel = 'admin-panel',
AdminPanelHealthStatus = 'admin-panel#health-status',
diff --git a/packages/twenty-front/src/pages/settings/workspace/SettingsDomain.tsx b/packages/twenty-front/src/pages/settings/domains/SettingsDomain.tsx
similarity index 97%
rename from packages/twenty-front/src/pages/settings/workspace/SettingsDomain.tsx
rename to packages/twenty-front/src/pages/settings/domains/SettingsDomain.tsx
index 15f92f1fd8a..13cc4a31e7c 100644
--- a/packages/twenty-front/src/pages/settings/workspace/SettingsDomain.tsx
+++ b/packages/twenty-front/src/pages/settings/domains/SettingsDomain.tsx
@@ -19,8 +19,8 @@ import { isDefined } from 'twenty-shared/utils';
import { z } from 'zod';
import { useUpdateWorkspaceMutation } from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
-import { SettingsCustomDomain } from '~/pages/settings/workspace/SettingsCustomDomain';
-import { SettingsSubdomain } from '~/pages/settings/workspace/SettingsSubdomain';
+import { SettingsCustomDomain } from '@/settings/domains/components/SettingsCustomDomain';
+import { SettingsSubdomain } from '@/settings/domains/components/SettingsSubdomain';
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
export const SUBDOMAIN_CHANGE_CONFIRMATION_MODAL_ID =
diff --git a/packages/twenty-front/src/pages/settings/domains/SettingsDomains.tsx b/packages/twenty-front/src/pages/settings/domains/SettingsDomains.tsx
index 96a4fdbd37e..7563bc42670 100644
--- a/packages/twenty-front/src/pages/settings/domains/SettingsDomains.tsx
+++ b/packages/twenty-front/src/pages/settings/domains/SettingsDomains.tsx
@@ -8,7 +8,7 @@ import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBa
import { H2Title } from 'twenty-ui/display';
import { Section } from 'twenty-ui/layout';
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
-import { SettingsWorkspaceDomainCard } from './components';
+import { SettingsWorkspaceDomainCard } from '@/settings/domains/components/SettingsWorkspaceDomainCard';
const StyledMainContent = styled.div`
display: flex;
diff --git a/packages/twenty-front/src/pages/settings/domains/components/index.ts b/packages/twenty-front/src/pages/settings/domains/components/index.ts
deleted file mode 100644
index 1d79856ba45..00000000000
--- a/packages/twenty-front/src/pages/settings/domains/components/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { SettingsWorkspaceDomainCard } from './SettingsWorkspaceDomainCard';
diff --git a/packages/twenty-front/src/pages/settings/domains/index.ts b/packages/twenty-front/src/pages/settings/domains/index.ts
deleted file mode 100644
index b2acb9460ce..00000000000
--- a/packages/twenty-front/src/pages/settings/domains/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { SettingsDomains } from './SettingsDomains';