The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Rename native account apps to built-in account apps (#28403)
nitin0809fda46750
diff --git a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsxindex f7eef0891b8..8210ea6dc46 100644--- a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx+++ b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx@@ -442,10 +442,10 @@ const SettingsAccountDetail = lazy(() =>})),);-const SettingsNativeAccountApp = lazy(() =>- import('~/pages/settings/accounts/SettingsNativeAccountApp').then(+const SettingsBuiltInAccountApp = lazy(() =>+ import('~/pages/settings/accounts/SettingsBuiltInAccountApp').then((module) => ({- default: module.SettingsNativeAccountApp,+ default: module.SettingsBuiltInAccountApp,}),),);@@ -804,8 +804,8 @@ const createSettingsRouteElements = ({element={<SettingsAccountDetail />}/><Route- path={SettingsPath.NativeAccountApp}- element={<SettingsNativeAccountApp />}+ path={SettingsPath.BuiltInAccountApp}+ element={<SettingsBuiltInAccountApp />}/><Routepath={SettingsPath.ApplicationPreferences}diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupTableRow.tsx b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupTableRow.tsxindex f839acab52d..d0accd32fbc 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupTableRow.tsx+++ b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupTableRow.tsx@@ -2,10 +2,10 @@ import { SettingsAccountGroupUsedBy } from '@/settings/app-preferences/componentimport { SettingsAppPreferencesRowDropdownMenu } from '@/settings/app-preferences/components/SettingsAppPreferencesRowDropdownMenu';import { SettingsConnectedAccountIcon } from '@/settings/accounts/components/SettingsConnectedAccountIcon';import { SettingsConnectedAccountSyncStatus } from '@/settings/app-preferences/components/SettingsConnectedAccountSyncStatus';-import { SettingsNativeAccountAppPermissionsCell } from '@/settings/app-preferences/components/SettingsNativeAccountAppPermissionsCell';+import { SettingsBuiltInAccountAppPermissionsCell } from '@/settings/app-preferences/components/SettingsBuiltInAccountAppPermissionsCell';import { SyncStatus } from '@/settings/accounts/constants/SyncStatus';import { type ConnectedAccountGroup } from '@/settings/app-preferences/types/ConnectedAccountGroup';-import { type NativeAccountApp } from '@/settings/app-preferences/types/NativeAccountApp';+import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';import { computeSyncStatus } from '@/settings/accounts/utils/computeSyncStatus';import { getConnectedAccountSettingsChannels } from '@/settings/app-preferences/utils/getConnectedAccountSettingsChannels';import { TableCell } from '@/ui/layout/table/components/TableCell';@@ -25,31 +25,31 @@ const SYNC_STATUSES_NEEDING_ACTION: ReadonlySet<SyncStatus> = new Set([type SettingsAccountGroupTableRowProps = {group: ConnectedAccountGroup;gridTemplateColumns: string;- nativeAccountApp?: NativeAccountApp;+ builtInAccountApp?: BuiltInAccountApp;};export const SettingsAccountGroupTableRow = ({group,gridTemplateColumns,- nativeAccountApp,+ builtInAccountApp,}: SettingsAccountGroupTableRowProps) => {const theme = useTheme();const navigateSettings = useNavigateSettings();- const { nativeAccount } = group;+ const { builtInAccount } = group;const ProviderIcon = SettingsConnectedAccountIcon({- account: nativeAccount ?? group.appAccounts[0],+ account: builtInAccount ?? group.appAccounts[0],});const { messageChannel, calendarChannel } =- getConnectedAccountSettingsChannels(nativeAccount);+ getConnectedAccountSettingsChannels(builtInAccount);const hasSettings = isDefined(messageChannel) || isDefined(calendarChannel);const needsAction =- isDefined(nativeAccount) &&- (isDefined(nativeAccount.archivedAt) ||+ isDefined(builtInAccount) &&+ (isDefined(builtInAccount.archivedAt) ||SYNC_STATUSES_NEEDING_ACTION.has(computeSyncStatus(- nativeAccount.messageChannels[0],- nativeAccount.calendarChannels[0],+ builtInAccount.messageChannels[0],+ builtInAccount.calendarChannels[0],),));@@ -62,7 +62,7 @@ export const SettingsAccountGroupTableRow = ({<ProviderIcon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} /><OverflowingTextWithTooltip text={group.handle} />{needsAction && (- <SettingsConnectedAccountSyncStatus account={nativeAccount} />+ <SettingsConnectedAccountSyncStatus account={builtInAccount} />)}</TableCell>);@@ -91,10 +91,10 @@ export const SettingsAccountGroupTableRow = ({) : (accountCell)}- {isDefined(nativeAccountApp) ? (- <SettingsNativeAccountAppPermissionsCell- nativeAccountApp={nativeAccountApp}- account={nativeAccount}+ {isDefined(builtInAccountApp) ? (+ <SettingsBuiltInAccountAppPermissionsCell+ builtInAccountApp={builtInAccountApp}+ account={builtInAccount}/>) : (<TableCell align="right">@@ -102,8 +102,8 @@ export const SettingsAccountGroupTableRow = ({</TableCell>)}<TableCell align="right" onClick={(event) => event.stopPropagation()}>- {isDefined(nativeAccount) && (- <SettingsAppPreferencesRowDropdownMenu account={nativeAccount} />+ {isDefined(builtInAccount) && (+ <SettingsAppPreferencesRowDropdownMenu account={builtInAccount} />)}</TableCell></TableRow>diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupUsedBy.tsx b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupUsedBy.tsxindex 9ecbcf7f6cf..fb24bb5f727 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupUsedBy.tsx+++ b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupUsedBy.tsx@@ -2,7 +2,7 @@ import { AppChip } from '@/applications/components/AppChip';import { getApplicationDisplayName } from '@/applications/utils/getApplicationDisplayName';import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';import { type ConnectedAccountGroup } from '@/settings/app-preferences/types/ConnectedAccountGroup';-import { getNativeAccountAppsUsingAccount } from '@/settings/app-preferences/utils/getNativeAccountAppsUsingAccount';+import { getBuiltInAccountAppsUsingAccount } from '@/settings/app-preferences/utils/getBuiltInAccountAppsUsingAccount';import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';import { styled } from '@linaria/react';import { useLingui } from '@lingui/react/macro';@@ -38,8 +38,8 @@ export const SettingsAccountGroupUsedBy = ({const theme = useTheme();const currentWorkspace = useAtomStateValue(currentWorkspaceState);- const nativeUsages = getNativeAccountAppsUsingAccount(- group.nativeAccount,+ const builtInAccountAppUsages = getBuiltInAccountAppsUsingAccount(+ group.builtInAccount,).map((app): Usage => ({key: app.id,title: t(app.name),@@ -66,13 +66,15 @@ export const SettingsAccountGroupUsedBy = ({return (<StyledUsedBy>- {[...nativeUsages, ...appUsages].map(({ key, title, icon }) => (- <Tooltip key={key} content={title}>- <StyledUsage role="img" aria-label={title}>- {icon}- </StyledUsage>- </Tooltip>- ))}+ {[...builtInAccountAppUsages, ...appUsages].map(+ ({ key, title, icon }) => (+ <Tooltip key={key} content={title}>+ <StyledUsage role="img" aria-label={title}>+ {icon}+ </StyledUsage>+ </Tooltip>+ ),+ )}</StyledUsedBy>);};diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupsSection.tsx b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupsSection.tsxindex bdb8f902776..592fc07129d 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupsSection.tsx+++ b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAccountGroupsSection.tsx@@ -1,10 +1,10 @@import { SettingsAccountGroupTableRow } from '@/settings/app-preferences/components/SettingsAccountGroupTableRow';import { SettingsAppPreferencesListEmptyStateCard } from '@/settings/app-preferences/components/SettingsAppPreferencesListEmptyStateCard';import { SETTINGS_ACCOUNT_GROUP_TABLE_GRID_TEMPLATE_COLUMNS } from '@/settings/app-preferences/constants/SettingsAccountGroupTableGridTemplateColumns';-import { SETTINGS_NATIVE_ACCOUNT_APP_ACCOUNT_GROUP_TABLE_GRID_TEMPLATE_COLUMNS } from '@/settings/app-preferences/constants/SettingsNativeAccountAppAccountGroupTableGridTemplateColumns';+import { SETTINGS_BUILT_IN_ACCOUNT_APP_ACCOUNT_GROUP_TABLE_GRID_TEMPLATE_COLUMNS } from '@/settings/app-preferences/constants/SettingsBuiltInAccountAppAccountGroupTableGridTemplateColumns';import { useMyAccountGroups } from '@/settings/app-preferences/hooks/useMyAccountGroups';-import { type NativeAccountApp } from '@/settings/app-preferences/types/NativeAccountApp';-import { getNativeAccountAppsUsingAccount } from '@/settings/app-preferences/utils/getNativeAccountAppsUsingAccount';+import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';+import { getBuiltInAccountAppsUsingAccount } from '@/settings/app-preferences/utils/getBuiltInAccountAppsUsingAccount';import { SettingsTableRowsSkeletonLoader } from '@/settings/components/SettingsTableRowsSkeletonLoader';import { Table } from '@/ui/layout/table/components/Table';import { TableHeader } from '@/ui/layout/table/components/TableHeader';@@ -32,32 +32,32 @@ const StyledAddAccountContainer = styled.div``;type SettingsAccountGroupsSectionProps = {- nativeAccountApp?: NativeAccountApp;+ builtInAccountApp?: BuiltInAccountApp;};export const SettingsAccountGroupsSection = ({- nativeAccountApp,+ builtInAccountApp,}: SettingsAccountGroupsSectionProps) => {const { t } = useLingui();const navigateSettings = useNavigateSettings();const { groups: allGroups, loading } = useMyAccountGroups();- const groups = isDefined(nativeAccountApp)+ const groups = isDefined(builtInAccountApp)? allGroups.filter((group) =>- getNativeAccountAppsUsingAccount(group.nativeAccount).some(- (app) => app.id === nativeAccountApp.id,+ getBuiltInAccountAppsUsingAccount(group.builtInAccount).some(+ (app) => app.id === builtInAccountApp.id,),): allGroups;- const gridTemplateColumns = isDefined(nativeAccountApp)- ? SETTINGS_NATIVE_ACCOUNT_APP_ACCOUNT_GROUP_TABLE_GRID_TEMPLATE_COLUMNS+ const gridTemplateColumns = isDefined(builtInAccountApp)+ ? SETTINGS_BUILT_IN_ACCOUNT_APP_ACCOUNT_GROUP_TABLE_GRID_TEMPLATE_COLUMNS: SETTINGS_ACCOUNT_GROUP_TABLE_GRID_TEMPLATE_COLUMNS;const tableHeaderRow = (<TableRow gridTemplateColumns={gridTemplateColumns}><TableHeader>{t`Account`}</TableHeader>- {isDefined(nativeAccountApp) ? (+ {isDefined(builtInAccountApp) ? (<TableHeader>{t`Permissions`}</TableHeader>) : (<TableHeader align="right">{t`Used by`}</TableHeader>@@ -79,7 +79,7 @@ export const SettingsAccountGroupsSection = ({gridTemplateColumns={gridTemplateColumns}columns={[{},- isDefined(nativeAccountApp)+ isDefined(builtInAccountApp)? { width: 140 }: { align: 'right', width: 48 },{},@@ -88,7 +88,7 @@ export const SettingsAccountGroupsSection = ({</Table>) : groups.length === 0 ? (<SettingsAppPreferencesListEmptyStateCard- provider={nativeAccountApp?.provider}+ provider={builtInAccountApp?.provider}/>) : (<>@@ -100,7 +100,7 @@ export const SettingsAccountGroupsSection = ({key={group.id}group={group}gridTemplateColumns={gridTemplateColumns}- nativeAccountApp={nativeAccountApp}+ builtInAccountApp={builtInAccountApp}/>))}</StyledTableRows>diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppNameCell.tsx b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppNameCell.tsxindex 524ecdf8f8f..8676008d092 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppNameCell.tsx+++ b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppNameCell.tsx@@ -29,13 +29,13 @@ export const SettingsAppPreferencesAppNameCell = ({const currentWorkspace = useAtomStateValue(currentWorkspaceState);const { to, icon, name } =- item.type === 'native'+ item.type === 'builtIn'? {- to: getSettingsPath(SettingsPath.NativeAccountApp, {- nativeAccountAppId: item.nativeAccountApp.id,+ to: getSettingsPath(SettingsPath.BuiltInAccountApp, {+ builtInAccountAppId: item.builtInAccountApp.id,}),- icon: <item.nativeAccountApp.Icon size={theme.icon.size.md} />,- name: t(item.nativeAccountApp.name),+ icon: <item.builtInAccountApp.Icon size={theme.icon.size.md} />,+ name: t(item.builtInAccountApp.name),}: {to: getSettingsPath(SettingsPath.ApplicationPreferences, {diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppStatusCell.tsx b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppStatusCell.tsxindex 11a173002cf..0fd9fcbf1c4 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppStatusCell.tsx+++ b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppStatusCell.tsx@@ -1,6 +1,6 @@import { useMyAccountGroups } from '@/settings/app-preferences/hooks/useMyAccountGroups';import { type AppPreferencesRow } from '@/settings/app-preferences/types/AppPreferencesRow';-import { getNativeAccountAppsUsingAccount } from '@/settings/app-preferences/utils/getNativeAccountAppsUsingAccount';+import { getBuiltInAccountAppsUsingAccount } from '@/settings/app-preferences/utils/getBuiltInAccountAppsUsingAccount';import { useLingui } from '@lingui/react/macro';import { isNonEmptyArray } from 'twenty-shared/utils';import { Status } from 'twenty-ui/primitives/data-display';@@ -26,8 +26,8 @@ export const SettingsAppPreferencesAppStatusCell = ({}const hasAccount = groups.some((group) =>- getNativeAccountAppsUsingAccount(group.nativeAccount).some(- (app) => app.id === item.nativeAccountApp.id,+ getBuiltInAccountAppsUsingAccount(group.builtInAccount).some(+ (app) => app.id === item.builtInAccountApp.id,),);diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppsSection.tsx b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppsSection.tsxindex c2adaee9830..79d18ba0ce3 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppsSection.tsx+++ b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppsSection.tsx@@ -1,7 +1,7 @@import { SettingsAppPreferencesAppNameCell } from '@/settings/app-preferences/components/SettingsAppPreferencesAppNameCell';import { SettingsAppPreferencesAppStatusCell } from '@/settings/app-preferences/components/SettingsAppPreferencesAppStatusCell';import { useApplicationsWithPreferences } from '@/settings/app-preferences/hooks/useApplicationsWithPreferences';-import { useEnabledNativeAccountApps } from '@/settings/app-preferences/hooks/useEnabledNativeAccountApps';+import { useEnabledBuiltInAccountApps } from '@/settings/app-preferences/hooks/useEnabledBuiltInAccountApps';import { type AppPreferencesRow } from '@/settings/app-preferences/types/AppPreferencesRow';import { SettingsApplicationLoadErrorBanner } from '@/settings/applications/components/SettingsApplicationLoadErrorBanner';import { SettingsTableListSection } from '@/settings/components/SettingsTableListSection';@@ -18,16 +18,18 @@ const StyledToolbar = styled.div`export const SettingsAppPreferencesAppsSection = () => {const { t } = useLingui();const navigateSettings = useNavigateSettings();- const { enabledNativeAccountApps } = useEnabledNativeAccountApps();+ const { enabledBuiltInAccountApps } = useEnabledBuiltInAccountApps();const { applicationsWithPreferences, hasApplicationsLoadError, refetch } =useApplicationsWithPreferences();const rows: AppPreferencesRow[] = [- ...enabledNativeAccountApps.map((nativeAccountApp): AppPreferencesRow => ({- type: 'native',- id: nativeAccountApp.id,- nativeAccountApp,- })),+ ...enabledBuiltInAccountApps.map(+ (builtInAccountApp): AppPreferencesRow => ({+ type: 'builtIn',+ id: builtInAccountApp.id,+ builtInAccountApp,+ }),+ ),...applicationsWithPreferences.map((applicationWithPreferences): AppPreferencesRow => ({type: 'installed',@@ -63,9 +65,9 @@ export const SettingsAppPreferencesAppsSection = () => {gridAutoColumns="1fr 1fr"showRowChevrononRowClick={(row) =>- row.type === 'native'- ? navigateSettings(SettingsPath.NativeAccountApp, {- nativeAccountAppId: row.nativeAccountApp.id,+ row.type === 'builtIn'+ ? navigateSettings(SettingsPath.BuiltInAccountApp, {+ builtInAccountAppId: row.builtInAccountApp.id,}): navigateSettings(SettingsPath.ApplicationPreferences, {applicationId: row.applicationWithPreferences.application.id,diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesSections.tsx b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesSections.tsxindex cd5bb01d3a3..19d88373ae3 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesSections.tsx+++ b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesSections.tsx@@ -2,23 +2,23 @@ import { SettingsAccountsBlocklistSection } from '@/settings/accounts/componentsimport { SettingsAccountGroupsSection } from '@/settings/app-preferences/components/SettingsAccountGroupsSection';import { SettingsAppPreferencesAppsSection } from '@/settings/app-preferences/components/SettingsAppPreferencesAppsSection';import { useApplicationsWithPreferences } from '@/settings/app-preferences/hooks/useApplicationsWithPreferences';-import { useEnabledNativeAccountApps } from '@/settings/app-preferences/hooks/useEnabledNativeAccountApps';+import { useEnabledBuiltInAccountApps } from '@/settings/app-preferences/hooks/useEnabledBuiltInAccountApps';import { isNonEmptyArray } from 'twenty-shared/utils';export const SettingsAppPreferencesSections = () => {- const { enabledNativeAccountApps } = useEnabledNativeAccountApps();+ const { enabledBuiltInAccountApps } = useEnabledBuiltInAccountApps();const { applicationsWithPreferences, hasApplicationsLoadError } =useApplicationsWithPreferences();- const hasNativeAccountApps = isNonEmptyArray(enabledNativeAccountApps);+ const hasBuiltInAccountApps = isNonEmptyArray(enabledBuiltInAccountApps);return (<><SettingsAccountGroupsSection />- {(hasNativeAccountApps ||+ {(hasBuiltInAccountApps ||isNonEmptyArray(applicationsWithPreferences) ||hasApplicationsLoadError) && <SettingsAppPreferencesAppsSection />}- {!hasNativeAccountApps && <SettingsAccountsBlocklistSection />}+ {!hasBuiltInAccountApps && <SettingsAccountsBlocklistSection />}</>);};diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsNativeAccountAppPermissionsCell.tsx b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsBuiltInAccountAppPermissionsCell.tsxsimilarity index 65%rename from packages/twenty-front/src/modules/settings/app-preferences/components/SettingsNativeAccountAppPermissionsCell.tsxrename to packages/twenty-front/src/modules/settings/app-preferences/components/SettingsBuiltInAccountAppPermissionsCell.tsxindex 4f1afbc08de..6555a55f709 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsNativeAccountAppPermissionsCell.tsx+++ b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsBuiltInAccountAppPermissionsCell.tsx@@ -1,22 +1,22 @@import { type ConnectedAccount } from '@/accounts/types/ConnectedAccount';-import { type NativeAccountApp } from '@/settings/app-preferences/types/NativeAccountApp';+import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';import { TableCell } from '@/ui/layout/table/components/TableCell';import { useLingui } from '@lingui/react/macro';import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';-type SettingsNativeAccountAppPermissionsCellProps = {- nativeAccountApp: NativeAccountApp;+type SettingsBuiltInAccountAppPermissionsCellProps = {+ builtInAccountApp: BuiltInAccountApp;account: Pick<ConnectedAccount, 'scopes'> | undefined;};-export const SettingsNativeAccountAppPermissionsCell = ({- nativeAccountApp,+export const SettingsBuiltInAccountAppPermissionsCell = ({+ builtInAccountApp,account,-}: SettingsNativeAccountAppPermissionsCellProps) => {+}: SettingsBuiltInAccountAppPermissionsCellProps) => {const { t } = useLingui();const grantedScopes = account?.scopes ?? [];- const permissionLabels = nativeAccountApp.permissions+ const permissionLabels = builtInAccountApp.permissions.filter((permission) =>permission.scopes.some((scope) => grantedScopes.includes(scope)),)diff --git a/packages/twenty-front/src/modules/settings/app-preferences/constants/NativeAccountApps.ts b/packages/twenty-front/src/modules/settings/app-preferences/constants/BuiltInAccountApps.tssimilarity index 90%rename from packages/twenty-front/src/modules/settings/app-preferences/constants/NativeAccountApps.tsrename to packages/twenty-front/src/modules/settings/app-preferences/constants/BuiltInAccountApps.tsindex 8bfb7219e5d..0fa4767605f 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/constants/NativeAccountApps.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/constants/BuiltInAccountApps.ts@@ -1,9 +1,9 @@-import { type NativeAccountApp } from '@/settings/app-preferences/types/NativeAccountApp';+import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';import { msg } from '@lingui/core/macro';import { ConnectedAccountProvider } from 'twenty-shared/types';import { IconAt, IconGoogle, IconMicrosoftOutlook } from 'twenty-ui/icon';-export const NATIVE_ACCOUNT_APPS: NativeAccountApp[] = [+export const BUILT_IN_ACCOUNT_APPS: BuiltInAccountApp[] = [{id: 'google',name: msg`Gmail and Calendar`,diff --git a/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsBuiltInAccountAppAccountGroupTableGridTemplateColumns.ts b/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsBuiltInAccountAppAccountGroupTableGridTemplateColumns.tsnew file mode 100644index 00000000000..01d1f358b31--- /dev/null+++ b/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsBuiltInAccountAppAccountGroupTableGridTemplateColumns.ts@@ -0,0 +1,3 @@+import { themeCssVariables } from 'twenty-ui/theme';++export const SETTINGS_BUILT_IN_ACCOUNT_APP_ACCOUNT_GROUP_TABLE_GRID_TEMPLATE_COLUMNS = `200px minmax(0, 1fr) ${themeCssVariables.spacing[8]}`;diff --git a/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsBuiltInAccountAppTabListComponentId.ts b/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsBuiltInAccountAppTabListComponentId.tsnew file mode 100644index 00000000000..c6dedccb1af--- /dev/null+++ b/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsBuiltInAccountAppTabListComponentId.ts@@ -0,0 +1,2 @@+export const SETTINGS_BUILT_IN_ACCOUNT_APP_TAB_LIST_COMPONENT_ID =+ 'settings-built-in-account-app-tab-list';diff --git a/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsNativeAccountAppAccountGroupTableGridTemplateColumns.ts b/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsNativeAccountAppAccountGroupTableGridTemplateColumns.tsdeleted file mode 100644index 84c5a5e1c5c..00000000000--- a/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsNativeAccountAppAccountGroupTableGridTemplateColumns.ts+++ /dev/null@@ -1,3 +0,0 @@-import { themeCssVariables } from 'twenty-ui/theme';--export const SETTINGS_NATIVE_ACCOUNT_APP_ACCOUNT_GROUP_TABLE_GRID_TEMPLATE_COLUMNS = `200px minmax(0, 1fr) ${themeCssVariables.spacing[8]}`;diff --git a/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsNativeAccountAppTabListComponentId.ts b/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsNativeAccountAppTabListComponentId.tsdeleted file mode 100644index 2617c74ba47..00000000000--- a/packages/twenty-front/src/modules/settings/app-preferences/constants/SettingsNativeAccountAppTabListComponentId.ts+++ /dev/null@@ -1,2 +0,0 @@-export const SETTINGS_NATIVE_ACCOUNT_APP_TAB_LIST_COMPONENT_ID =- 'settings-native-account-app-tab-list';diff --git a/packages/twenty-front/src/modules/settings/app-preferences/hooks/useEnabledNativeAccountApps.ts b/packages/twenty-front/src/modules/settings/app-preferences/hooks/useEnabledBuiltInAccountApps.tssimilarity index 77%rename from packages/twenty-front/src/modules/settings/app-preferences/hooks/useEnabledNativeAccountApps.tsrename to packages/twenty-front/src/modules/settings/app-preferences/hooks/useEnabledBuiltInAccountApps.tsindex 8cb5382f7ab..46e351bb800 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/hooks/useEnabledNativeAccountApps.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/hooks/useEnabledBuiltInAccountApps.ts@@ -3,11 +3,11 @@ import { isGoogleMessagingEnabledState } from '@/client-config/states/isGoogleMeimport { isImapSmtpCaldavEnabledState } from '@/client-config/states/isImapSmtpCaldavEnabledState';import { isMicrosoftCalendarEnabledState } from '@/client-config/states/isMicrosoftCalendarEnabledState';import { isMicrosoftMessagingEnabledState } from '@/client-config/states/isMicrosoftMessagingEnabledState';-import { NATIVE_ACCOUNT_APPS } from '@/settings/app-preferences/constants/NativeAccountApps';-import { type NativeAccountApp } from '@/settings/app-preferences/types/NativeAccountApp';+import { BUILT_IN_ACCOUNT_APPS } from '@/settings/app-preferences/constants/BuiltInAccountApps';+import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';-export const useEnabledNativeAccountApps = () => {+export const useEnabledBuiltInAccountApps = () => {const isGoogleMessagingEnabled = useAtomStateValue(isGoogleMessagingEnabledState,);@@ -24,19 +24,19 @@ export const useEnabledNativeAccountApps = () => {isImapSmtpCaldavEnabledState,);- const isEmailsEnabled: Record<NativeAccountApp['id'], boolean> = {+ const isEmailsEnabled: Record<BuiltInAccountApp['id'], boolean> = {google: isGoogleMessagingEnabled,outlook: isMicrosoftMessagingEnabled,imap: isImapSmtpCaldavEnabled,};- const isCalendarEnabled: Record<NativeAccountApp['id'], boolean> = {+ const isCalendarEnabled: Record<BuiltInAccountApp['id'], boolean> = {google: isGoogleCalendarEnabled,outlook: isMicrosoftCalendarEnabled,imap: isImapSmtpCaldavEnabled,};return {- enabledNativeAccountApps: NATIVE_ACCOUNT_APPS.map((app) => ({+ enabledBuiltInAccountApps: BUILT_IN_ACCOUNT_APPS.map((app) => ({...app,hasEmails: app.hasEmails && isEmailsEnabled[app.id],hasCalendar: app.hasCalendar && isCalendarEnabled[app.id],diff --git a/packages/twenty-front/src/modules/settings/app-preferences/hooks/useMyAccountGroups.ts b/packages/twenty-front/src/modules/settings/app-preferences/hooks/useMyAccountGroups.tsindex a60262bafc7..8668e59e8c3 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/hooks/useMyAccountGroups.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/hooks/useMyAccountGroups.ts@@ -1,6 +1,6 @@import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';import { useMyConnectedAccounts } from '@/settings/accounts/hooks/useMyConnectedAccounts';-import { groupConnectedAccountsByNativeAccount } from '@/settings/app-preferences/utils/groupConnectedAccountsByNativeAccount';+import { groupConnectedAccountsByBuiltInAccount } from '@/settings/app-preferences/utils/groupConnectedAccountsByBuiltInAccount';import { isPersonalConnectedAccount } from '@/settings/app-preferences/utils/isPersonalConnectedAccount';import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';import { ConnectedAccountProvider } from 'twenty-shared/types';@@ -28,7 +28,7 @@ export const useMyAccountGroups = () => {: [];return {- groups: groupConnectedAccountsByNativeAccount(personalAccounts),+ groups: groupConnectedAccountsByBuiltInAccount(personalAccounts),loading,};};diff --git a/packages/twenty-front/src/modules/settings/app-preferences/types/AppPreferencesRow.ts b/packages/twenty-front/src/modules/settings/app-preferences/types/AppPreferencesRow.tsindex 9f8996c508f..b4fbac3d922 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/types/AppPreferencesRow.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/types/AppPreferencesRow.ts@@ -1,8 +1,8 @@import { type ApplicationWithPreferences } from '@/settings/app-preferences/types/ApplicationWithPreferences';-import { type NativeAccountApp } from '@/settings/app-preferences/types/NativeAccountApp';+import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';export type AppPreferencesRow =- | { type: 'native'; id: string; nativeAccountApp: NativeAccountApp }+ | { type: 'builtIn'; id: string; builtInAccountApp: BuiltInAccountApp }| {type: 'installed';id: string;diff --git a/packages/twenty-front/src/modules/settings/app-preferences/types/NativeAccountApp.ts b/packages/twenty-front/src/modules/settings/app-preferences/types/BuiltInAccountApp.tssimilarity index 64%rename from packages/twenty-front/src/modules/settings/app-preferences/types/NativeAccountApp.tsrename to packages/twenty-front/src/modules/settings/app-preferences/types/BuiltInAccountApp.tsindex adde2946196..a5be7643a46 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/types/NativeAccountApp.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/types/BuiltInAccountApp.ts@@ -1,14 +1,14 @@-import { type NativeAccountAppPermission } from '@/settings/app-preferences/types/NativeAccountAppPermission';+import { type BuiltInAccountAppPermission } from '@/settings/app-preferences/types/BuiltInAccountAppPermission';import { type MessageDescriptor } from '@lingui/core';import { type ConnectedAccountProvider } from 'twenty-shared/types';import { type IconComponent } from 'twenty-ui/icon';-export type NativeAccountApp = {+export type BuiltInAccountApp = {id: 'google' | 'outlook' | 'imap';name: MessageDescriptor;Icon: IconComponent;provider: ConnectedAccountProvider;hasEmails: boolean;hasCalendar: boolean;- permissions: NativeAccountAppPermission[];+ permissions: BuiltInAccountAppPermission[];};diff --git a/packages/twenty-front/src/modules/settings/app-preferences/types/NativeAccountAppPermission.ts b/packages/twenty-front/src/modules/settings/app-preferences/types/BuiltInAccountAppPermission.tssimilarity index 70%rename from packages/twenty-front/src/modules/settings/app-preferences/types/NativeAccountAppPermission.tsrename to packages/twenty-front/src/modules/settings/app-preferences/types/BuiltInAccountAppPermission.tsindex 548679c7575..f39c73325e6 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/types/NativeAccountAppPermission.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/types/BuiltInAccountAppPermission.ts@@ -1,6 +1,6 @@import { type MessageDescriptor } from '@lingui/core';-export type NativeAccountAppPermission = {+export type BuiltInAccountAppPermission = {label: MessageDescriptor;scopes: string[];};diff --git a/packages/twenty-front/src/modules/settings/app-preferences/types/ConnectedAccountGroup.ts b/packages/twenty-front/src/modules/settings/app-preferences/types/ConnectedAccountGroup.tsindex a2f32533bba..538b5062906 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/types/ConnectedAccountGroup.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/types/ConnectedAccountGroup.ts@@ -3,6 +3,6 @@ import { type ConnectedAccount } from '@/accounts/types/ConnectedAccount';export type ConnectedAccountGroup<TConnectedAccount = ConnectedAccount> = {id: string;handle: string;- nativeAccount?: TConnectedAccount;+ builtInAccount?: TConnectedAccount;appAccounts: TConnectedAccount[];};diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getNativeAccountAppChannelTabsVisibility.test.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getBuiltInAccountAppChannelTabsVisibility.test.tssimilarity index 84%rename from packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getNativeAccountAppChannelTabsVisibility.test.tsrename to packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getBuiltInAccountAppChannelTabsVisibility.test.tsindex 57b84737a12..da519ca8a3f 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getNativeAccountAppChannelTabsVisibility.test.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getBuiltInAccountAppChannelTabsVisibility.test.ts@@ -1,4 +1,4 @@-import { getNativeAccountAppChannelTabsVisibility } from '@/settings/app-preferences/utils/getNativeAccountAppChannelTabsVisibility';+import { getBuiltInAccountAppChannelTabsVisibility } from '@/settings/app-preferences/utils/getBuiltInAccountAppChannelTabsVisibility';import {CalendarChannelSyncStage,MessageChannelSyncStage,@@ -21,10 +21,10 @@ const PENDING_CALENDAR = {};const OUTLOOK = { hasEmails: true, hasCalendar: true };-describe('getNativeAccountAppChannelTabsVisibility', () => {+describe('getBuiltInAccountAppChannelTabsVisibility', () => {it('shows the tabs the app supports when there are no accounts', () => {expect(- getNativeAccountAppChannelTabsVisibility({+ getBuiltInAccountAppChannelTabsVisibility({app: OUTLOOK,accounts: [],isLoading: false,@@ -37,7 +37,7 @@ describe('getNativeAccountAppChannelTabsVisibility', () => {it('hides the tabs the app does not support', () => {expect(- getNativeAccountAppChannelTabsVisibility({+ getBuiltInAccountAppChannelTabsVisibility({app: { hasEmails: true, hasCalendar: false },accounts: [{@@ -52,7 +52,7 @@ describe('getNativeAccountAppChannelTabsVisibility', () => {it('hides a tab whose accounts are all pending setup', () => {expect(- getNativeAccountAppChannelTabsVisibility({+ getBuiltInAccountAppChannelTabsVisibility({app: OUTLOOK,accounts: [{@@ -67,7 +67,7 @@ describe('getNativeAccountAppChannelTabsVisibility', () => {it('keeps a tab when one account is ready and another is pending setup', () => {expect(- getNativeAccountAppChannelTabsVisibility({+ getBuiltInAccountAppChannelTabsVisibility({app: OUTLOOK,accounts: [{ messageChannels: [PENDING_MAILBOX], calendarChannels: [] },@@ -83,7 +83,7 @@ describe('getNativeAccountAppChannelTabsVisibility', () => {it('hides a tab once loaded when the accounts have no channel for it', () => {expect(- getNativeAccountAppChannelTabsVisibility({+ getBuiltInAccountAppChannelTabsVisibility({app: OUTLOOK,accounts: [{ messageChannels: [READY_MAILBOX], calendarChannels: [] }],isLoading: false,@@ -93,7 +93,7 @@ describe('getNativeAccountAppChannelTabsVisibility', () => {it('keeps a tab while channels may still be loading', () => {expect(- getNativeAccountAppChannelTabsVisibility({+ getBuiltInAccountAppChannelTabsVisibility({app: OUTLOOK,accounts: [{ messageChannels: [], calendarChannels: [] }],isLoading: true,@@ -103,7 +103,7 @@ describe('getNativeAccountAppChannelTabsVisibility', () => {it('hides every tab without an app', () => {expect(- getNativeAccountAppChannelTabsVisibility({+ getBuiltInAccountAppChannelTabsVisibility({app: undefined,accounts: [],isLoading: false,diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getNativeAccountAppsUsingAccount.test.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getBuiltInAccountAppsUsingAccount.test.tssimilarity index 90%rename from packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getNativeAccountAppsUsingAccount.test.tsrename to packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getBuiltInAccountAppsUsingAccount.test.tsindex 1a06cb94fb0..257fb490a87 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getNativeAccountAppsUsingAccount.test.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getBuiltInAccountAppsUsingAccount.test.ts@@ -1,4 +1,4 @@-import { getNativeAccountAppsUsingAccount } from '@/settings/app-preferences/utils/getNativeAccountAppsUsingAccount';+import { getBuiltInAccountAppsUsingAccount } from '@/settings/app-preferences/utils/getBuiltInAccountAppsUsingAccount';import {CalendarChannelSyncStage,ConnectedAccountProvider,@@ -23,10 +23,10 @@ const groupInbox = {};const getAppIds = (- account: Parameters<typeof getNativeAccountAppsUsingAccount>[0],-) => getNativeAccountAppsUsingAccount(account).map((app) => app.id);+ account: Parameters<typeof getBuiltInAccountAppsUsingAccount>[0],+) => getBuiltInAccountAppsUsingAccount(account).map((app) => app.id);-describe('getNativeAccountAppsUsingAccount', () => {+describe('getBuiltInAccountAppsUsingAccount', () => {it('lists Google once for a Google account with mail and calendar', () => {expect(getAppIds({diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/groupConnectedAccountsByNativeAccount.test.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/groupConnectedAccountsByBuiltInAccount.test.tssimilarity index 69%rename from packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/groupConnectedAccountsByNativeAccount.test.tsrename to packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/groupConnectedAccountsByBuiltInAccount.test.tsindex 6a70c9ea39d..a11a978d295 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/groupConnectedAccountsByNativeAccount.test.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/groupConnectedAccountsByBuiltInAccount.test.ts@@ -1,8 +1,8 @@-import { groupConnectedAccountsByNativeAccount } from '@/settings/app-preferences/utils/groupConnectedAccountsByNativeAccount';+import { groupConnectedAccountsByBuiltInAccount } from '@/settings/app-preferences/utils/groupConnectedAccountsByBuiltInAccount';import { ConnectedAccountProvider } from 'twenty-shared/types';-describe('groupConnectedAccountsByNativeAccount', () => {- it('attaches app connections to the native account with the same email, ignoring case and spaces', () => {+describe('groupConnectedAccountsByBuiltInAccount', () => {+ it('attaches app connections to the built-in account with the same email, ignoring case and spaces', () => {const google = {id: 'google',handle: '[email protected]',@@ -14,17 +14,17 @@ describe('groupConnectedAccountsByNativeAccount', () => {provider: ConnectedAccountProvider.APP,};- expect(groupConnectedAccountsByNativeAccount([fathom, google])).toEqual([+ expect(groupConnectedAccountsByBuiltInAccount([fathom, google])).toEqual([{id: 'google',handle: '[email protected]',- nativeAccount: google,+ builtInAccount: google,appAccounts: [fathom],},]);});- it('keeps native accounts with the same email on separate rows', () => {+ it('keeps built-in accounts with the same email on separate rows', () => {const google = {id: 'google',handle: '[email protected]',@@ -42,24 +42,24 @@ describe('groupConnectedAccountsByNativeAccount', () => {};expect(- groupConnectedAccountsByNativeAccount([google, imap, fathom]),+ groupConnectedAccountsByBuiltInAccount([google, imap, fathom]),).toEqual([{id: 'google',handle: '[email protected]',- nativeAccount: google,+ builtInAccount: google,appAccounts: [fathom],},{id: 'imap',handle: '[email protected]',- nativeAccount: imap,+ builtInAccount: imap,appAccounts: [],},]);});- it('groups app connections without a native account by email', () => {+ it('groups app connections without a built-in account by email', () => {const fathom = {id: 'fathom',handle: '[email protected]',@@ -77,7 +77,7 @@ describe('groupConnectedAccountsByNativeAccount', () => {};expect(- groupConnectedAccountsByNativeAccount([fathom, granola, otherFathom]),+ groupConnectedAccountsByBuiltInAccount([fathom, granola, otherFathom]),).toEqual([{id: 'fathom',diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/isPersonalConnectedAccount.test.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/isPersonalConnectedAccount.test.tsindex 2e33b535cd1..2d58b895e2e 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/isPersonalConnectedAccount.test.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/isPersonalConnectedAccount.test.ts@@ -13,7 +13,7 @@ const isMine = (});describe('isPersonalConnectedAccount', () => {- it('keeps my native account', () => {+ it('keeps my built-in account', () => {expect(isMine({provider: ConnectedAccountProvider.GOOGLE,@@ -53,7 +53,7 @@ describe('isPersonalConnectedAccount', () => {).toBe(false);});- it('drops a teammate native account', () => {+ it('drops a teammate built-in account', () => {expect(isMine({provider: ConnectedAccountProvider.MICROSOFT,@@ -63,7 +63,7 @@ describe('isPersonalConnectedAccount', () => {).toBe(false);});- it('keeps my native account that is shared with the workspace', () => {+ it('keeps my built-in account that is shared with the workspace', () => {expect(isMine({provider: ConnectedAccountProvider.GOOGLE,diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/getNativeAccountAppChannelTabsVisibility.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppChannelTabsVisibility.tssimilarity index 87%rename from packages/twenty-front/src/modules/settings/app-preferences/utils/getNativeAccountAppChannelTabsVisibility.tsrename to packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppChannelTabsVisibility.tsindex ec2ddd2c33d..c0800c362b9 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/getNativeAccountAppChannelTabsVisibility.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppChannelTabsVisibility.ts@@ -1,6 +1,6 @@import { type CalendarChannel } from '@/accounts/types/CalendarChannel';import { type MessageChannel } from '@/accounts/types/MessageChannel';-import { type NativeAccountApp } from '@/settings/app-preferences/types/NativeAccountApp';+import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';import { getConnectedAccountSettingsChannels } from '@/settings/app-preferences/utils/getConnectedAccountSettingsChannels';import { isDefined } from 'twenty-shared/utils';@@ -9,8 +9,8 @@ type AccountWithChannels = {calendarChannels: Pick<CalendarChannel, 'syncStage'>[];};-type GetNativeAccountAppChannelTabsVisibilityArgs = {- app: Pick<NativeAccountApp, 'hasEmails' | 'hasCalendar'> | undefined;+type GetBuiltInAccountAppChannelTabsVisibilityArgs = {+ app: Pick<BuiltInAccountApp, 'hasEmails' | 'hasCalendar'> | undefined;accounts: AccountWithChannels[];isLoading: boolean;};@@ -47,11 +47,11 @@ const isChannelTabVisible = ({return isLoading || !hasAccounts;};-export const getNativeAccountAppChannelTabsVisibility = ({+export const getBuiltInAccountAppChannelTabsVisibility = ({app,accounts,isLoading,-}: GetNativeAccountAppChannelTabsVisibilityArgs) => {+}: GetBuiltInAccountAppChannelTabsVisibilityArgs) => {if (!isDefined(app)) {return { isEmailsTabVisible: false, isCalendarTabVisible: false };}diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/getNativeAccountAppsUsingAccount.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppsUsingAccount.tssimilarity index 80%rename from packages/twenty-front/src/modules/settings/app-preferences/utils/getNativeAccountAppsUsingAccount.tsrename to packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppsUsingAccount.tsindex 57b6c99f496..bc321889447 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/getNativeAccountAppsUsingAccount.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppsUsingAccount.ts@@ -1,12 +1,12 @@import { type CalendarChannel } from '@/accounts/types/CalendarChannel';import { type MessageChannel } from '@/accounts/types/MessageChannel';-import { NATIVE_ACCOUNT_APPS } from '@/settings/app-preferences/constants/NativeAccountApps';+import { BUILT_IN_ACCOUNT_APPS } from '@/settings/app-preferences/constants/BuiltInAccountApps';import {type ConnectedAccountProvider,MessageChannelType,} from 'twenty-shared/types';-export const getNativeAccountAppsUsingAccount = (+export const getBuiltInAccountAppsUsingAccount = (account:| {provider: ConnectedAccountProvider;@@ -21,7 +21,7 @@ export const getNativeAccountAppsUsingAccount = () ?? false;const hasCalendar = (account?.calendarChannels.length ?? 0) > 0;- return NATIVE_ACCOUNT_APPS.filter(+ return BUILT_IN_ACCOUNT_APPS.filter((app) =>app.provider === account?.provider &&((app.hasEmails && hasMailbox) || (app.hasCalendar && hasCalendar)),diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/groupConnectedAccountsByNativeAccount.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/groupConnectedAccountsByBuiltInAccount.tssimilarity index 87%rename from packages/twenty-front/src/modules/settings/app-preferences/utils/groupConnectedAccountsByNativeAccount.tsrename to packages/twenty-front/src/modules/settings/app-preferences/utils/groupConnectedAccountsByBuiltInAccount.tsindex c3cdb2c28d6..bdd7639d4ab 100644--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/groupConnectedAccountsByNativeAccount.ts+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/groupConnectedAccountsByBuiltInAccount.ts@@ -5,7 +5,7 @@ import { isDefined } from 'twenty-shared/utils';const normalizeHandle = (handle: string) => handle.trim().toLowerCase();-export const groupConnectedAccountsByNativeAccount = <+export const groupConnectedAccountsByBuiltInAccount = <TConnectedAccount extends Pick<ConnectedAccount,'id' | 'handle' | 'provider'@@ -15,10 +15,10 @@ export const groupConnectedAccountsByNativeAccount = <): ConnectedAccountGroup<TConnectedAccount>[] => {const groups: ConnectedAccountGroup<TConnectedAccount>[] = accounts.filter((account) => account.provider !== ConnectedAccountProvider.APP)- .map((nativeAccount) => ({- id: nativeAccount.id,- handle: nativeAccount.handle,- nativeAccount,+ .map((builtInAccount) => ({+ id: builtInAccount.id,+ handle: builtInAccount.handle,+ builtInAccount,appAccounts: [],}));diff --git a/packages/twenty-front/src/pages/settings/accounts/SettingsAccountDetail.tsx b/packages/twenty-front/src/pages/settings/accounts/SettingsAccountDetail.tsxindex b17541f53d5..8d3e2c56a27 100644--- a/packages/twenty-front/src/pages/settings/accounts/SettingsAccountDetail.tsx+++ b/packages/twenty-front/src/pages/settings/accounts/SettingsAccountDetail.tsx@@ -29,11 +29,11 @@ export const SettingsAccountDetail = () => {const { groups, loading } = useMyAccountGroups();const tabListComponentInstanceId = `${SETTINGS_ACCOUNT_GROUP_TAB_LIST_COMPONENT_ID}-${connectedAccountId}`;- const nativeAccount = groups.find(- (group) => group.nativeAccount?.id === connectedAccountId,- )?.nativeAccount;+ const builtInAccount = groups.find(+ (group) => group.builtInAccount?.id === connectedAccountId,+ )?.builtInAccount;const { messageChannel, calendarChannel } =- getConnectedAccountSettingsChannels(nativeAccount);+ getConnectedAccountSettingsChannels(builtInAccount);const tabs = [isDefined(messageChannel)@@ -53,11 +53,13 @@ export const SettingsAccountDetail = () => {return <Navigate to={getSettingsPath(SettingsPath.Accounts)} replace />;}- if (!isDefined(nativeAccount)) {+ if (!isDefined(builtInAccount)) {return <SettingsSkeletonLoader />;}- const ProviderIcon = SettingsConnectedAccountIcon({ account: nativeAccount });+ const ProviderIcon = SettingsConnectedAccountIcon({+ account: builtInAccount,+ });const renderContent = () => {if (activeTabId === 'emails' && isDefined(messageChannel)) {@@ -81,7 +83,7 @@ export const SettingsAccountDetail = () => {return (<SettingsPageLayout- title={nativeAccount.handle}+ title={builtInAccount.handle}icon={<ProviderIcon size={theme.icon.size.md} />}links={[{@@ -92,7 +94,7 @@ export const SettingsAccountDetail = () => {children: t`App preferences`,href: getSettingsPath(SettingsPath.Accounts),},- { children: nativeAccount.handle },+ { children: builtInAccount.handle },]}secondaryBar={tabs.length > 0 ? (diff --git a/packages/twenty-front/src/pages/settings/accounts/SettingsNativeAccountApp.tsx b/packages/twenty-front/src/pages/settings/accounts/SettingsBuiltInAccountApp.tsxsimilarity index 86%rename from packages/twenty-front/src/pages/settings/accounts/SettingsNativeAccountApp.tsxrename to packages/twenty-front/src/pages/settings/accounts/SettingsBuiltInAccountApp.tsxindex c7c4262fd1b..94fae30368d 100644--- a/packages/twenty-front/src/pages/settings/accounts/SettingsNativeAccountApp.tsx+++ b/packages/twenty-front/src/pages/settings/accounts/SettingsBuiltInAccountApp.tsx@@ -5,11 +5,11 @@ import { SettingsAccountsBlocklistSection } from '@/settings/accounts/componentsimport { SettingsAccountsCalendarChannelDetails } from '@/settings/accounts/components/SettingsAccountsCalendarChannelDetails';import { SettingsAppPreferencesSelectedMessageChannelDetails } from '~/pages/settings/accounts/SettingsAppPreferencesSelectedMessageChannelDetails';import { SettingsConnectedAccountIcon } from '@/settings/accounts/components/SettingsConnectedAccountIcon';-import { SETTINGS_NATIVE_ACCOUNT_APP_TAB_LIST_COMPONENT_ID } from '@/settings/app-preferences/constants/SettingsNativeAccountAppTabListComponentId';-import { useEnabledNativeAccountApps } from '@/settings/app-preferences/hooks/useEnabledNativeAccountApps';+import { SETTINGS_BUILT_IN_ACCOUNT_APP_TAB_LIST_COMPONENT_ID } from '@/settings/app-preferences/constants/SettingsBuiltInAccountAppTabListComponentId';+import { useEnabledBuiltInAccountApps } from '@/settings/app-preferences/hooks/useEnabledBuiltInAccountApps';import { useMyAccountGroups } from '@/settings/app-preferences/hooks/useMyAccountGroups';import { getConnectedAccountSettingsChannels } from '@/settings/app-preferences/utils/getConnectedAccountSettingsChannels';-import { getNativeAccountAppChannelTabsVisibility } from '@/settings/app-preferences/utils/getNativeAccountAppChannelTabsVisibility';+import { getBuiltInAccountAppChannelTabsVisibility } from '@/settings/app-preferences/utils/getBuiltInAccountAppChannelTabsVisibility';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { SettingsSectionSkeletonLoader } from '@/settings/components/SettingsSectionSkeletonLoader';import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';@@ -26,24 +26,24 @@ import { IconCalendarEvent, IconMail, IconSettings } from 'twenty-ui/icon';import { useTheme } from 'twenty-ui/theme';import { FeatureFlagKey } from '~/generated-metadata/graphql';-export const SettingsNativeAccountApp = () => {+export const SettingsBuiltInAccountApp = () => {const { t } = useLingui();const theme = useTheme();const isAppPreferencesEnabled = useIsFeatureEnabled(FeatureFlagKey.IS_APP_PREFERENCES_ENABLED,);- const { nativeAccountAppId } = useParams<{ nativeAccountAppId: string }>();- const { enabledNativeAccountApps } = useEnabledNativeAccountApps();- const app = enabledNativeAccountApps.find(- (enabledApp) => enabledApp.id === nativeAccountAppId,+ const { builtInAccountAppId } = useParams<{ builtInAccountAppId: string }>();+ const { enabledBuiltInAccountApps } = useEnabledBuiltInAccountApps();+ const app = enabledBuiltInAccountApps.find(+ (enabledApp) => enabledApp.id === builtInAccountAppId,);const { groups, loading } = useMyAccountGroups();const [selectedAccountId, setSelectedAccountId] = useState<string>();- const tabListComponentInstanceId = `${SETTINGS_NATIVE_ACCOUNT_APP_TAB_LIST_COMPONENT_ID}-${nativeAccountAppId}`;+ const tabListComponentInstanceId = `${SETTINGS_BUILT_IN_ACCOUNT_APP_TAB_LIST_COMPONENT_ID}-${builtInAccountAppId}`;const providerAccounts = groups- .map((group) => group.nativeAccount)+ .map((group) => group.builtInAccount).filter(isDefined).filter((account) => account.provider === app?.provider);const emailAccounts = app?.hasEmails@@ -57,7 +57,7 @@ export const SettingsNativeAccountApp = () => {): [];const { isEmailsTabVisible, isCalendarTabVisible } =- getNativeAccountAppChannelTabsVisibility({+ getBuiltInAccountAppChannelTabsVisibility({app,accounts: providerAccounts,isLoading: loading,@@ -94,7 +94,7 @@ export const SettingsNativeAccountApp = () => {selectedAccount: ConnectedAccount,) => (<Select- dropdownId="settings-native-account-app-account"+ dropdownId="settings-built-in-account-app-account"label={t`Account`}fullWidthvalue={selectedAccount.id}@@ -166,7 +166,7 @@ export const SettingsNativeAccountApp = () => {return (<>- <SettingsAccountGroupsSection nativeAccountApp={app} />+ <SettingsAccountGroupsSection builtInAccountApp={app} /><SettingsAccountsBlocklistSection /></>);diff --git a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccounts.stories.tsx b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccounts.stories.tsxindex ec7fb441d0a..773646c37a7 100644--- a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccounts.stories.tsx+++ b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccounts.stories.tsx@@ -454,46 +454,47 @@ export const AppPreferencesListLoadErrorOffersRetry: Story = {},};-export const InstalledAppsKeepBlocklistWhenNoNativeAppIsEnabled: Story = {- ...accountGroupsStory,- beforeEach: async () => {- await seedApplicationPreferencesStory();- jotaiStore.set(isGoogleMessagingEnabledState.atom, false);- jotaiStore.set(isGoogleCalendarEnabledState.atom, false);- jotaiStore.set(isMicrosoftMessagingEnabledState.atom, false);- jotaiStore.set(isMicrosoftCalendarEnabledState.atom, false);- },- parameters: {- msw: {- handlers: [- // The client config can load after beforeEach and would re-enable them- http.get(`${REACT_APP_SERVER_BASE_URL}/client-config`, () =>- HttpResponse.json({- ...mockedClientConfig,- isGoogleMessagingEnabled: false,- isGoogleCalendarEnabled: false,- isMicrosoftMessagingEnabled: false,- isMicrosoftCalendarEnabled: false,- }),+export const InstalledAppsKeepBlocklistWhenNoBuiltInAccountAppIsEnabled: Story =+ {+ ...accountGroupsStory,+ beforeEach: async () => {+ await seedApplicationPreferencesStory();+ jotaiStore.set(isGoogleMessagingEnabledState.atom, false);+ jotaiStore.set(isGoogleCalendarEnabledState.atom, false);+ jotaiStore.set(isMicrosoftMessagingEnabledState.atom, false);+ jotaiStore.set(isMicrosoftCalendarEnabledState.atom, false);+ },+ parameters: {+ msw: {+ handlers: [+ // The client config can load after beforeEach and would re-enable them+ http.get(`${REACT_APP_SERVER_BASE_URL}/client-config`, () =>+ HttpResponse.json({+ ...mockedClientConfig,+ isGoogleMessagingEnabled: false,+ isGoogleCalendarEnabled: false,+ isMicrosoftMessagingEnabled: false,+ isMicrosoftCalendarEnabled: false,+ }),+ ),+ ...APPLICATION_PREFERENCES_GRAPHQL_HANDLERS,+ ],+ },+ },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);++ expect(+ await canvas.findByText('Fathom', undefined, { timeout: 3000 }),+ ).toBeVisible();+ expect(+ canvas.getByText(+ 'Choose your preferences for the apps installed on your workspace by the admin',),- ...APPLICATION_PREFERENCES_GRAPHQL_HANDLERS,- ],+ ).toBeVisible();+ expect(await canvas.findByText('Blocklist')).toBeVisible();+ expect(+ canvas.queryByRole('link', { name: 'Gmail and Calendar' }),+ ).not.toBeInTheDocument();},- },- play: async ({ canvasElement }) => {- const canvas = within(canvasElement);-- expect(- await canvas.findByText('Fathom', undefined, { timeout: 3000 }),- ).toBeVisible();- expect(- canvas.getByText(- 'Choose your preferences for the apps installed on your workspace by the admin',- ),- ).toBeVisible();- expect(await canvas.findByText('Blocklist')).toBeVisible();- expect(- canvas.queryByRole('link', { name: 'Gmail and Calendar' }),- ).not.toBeInTheDocument();- },-};+ };diff --git a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsNativeAccountApp.stories.tsx b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsBuiltInAccountApp.stories.tsxsimilarity index 91%rename from packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsNativeAccountApp.stories.tsxrename to packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsBuiltInAccountApp.stories.tsxindex 87641f30a28..40407a604e9 100644--- a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsNativeAccountApp.stories.tsx+++ b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsBuiltInAccountApp.stories.tsx@@ -9,7 +9,7 @@ import {import { isMicrosoftCalendarEnabledState } from '@/client-config/states/isMicrosoftCalendarEnabledState';import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';-import { SettingsNativeAccountApp } from '~/pages/settings/accounts/SettingsNativeAccountApp';+import { SettingsBuiltInAccountApp } from '~/pages/settings/accounts/SettingsBuiltInAccountApp';import {ACCOUNT_GROUPS_GRAPHQL_HANDLERS,CALENDAR_CHANNELS,@@ -19,12 +19,12 @@ import {} from '~/pages/settings/accounts/__stories__/mockedAccountGroups';const meta: Meta<PageDecoratorArgs> = {- title: 'Pages/Settings/Accounts/SettingsNativeAccountApp',- component: SettingsNativeAccountApp,+ title: 'Pages/Settings/Accounts/SettingsBuiltInAccountApp',+ component: SettingsBuiltInAccountApp,decorators: [PageDecorator],args: {- routePath: '/settings/accounts/apps/:nativeAccountAppId',- routeParams: { ':nativeAccountAppId': 'google' },+ routePath: '/settings/accounts/apps/:builtInAccountAppId',+ routeParams: { ':builtInAccountAppId': 'google' },additionalRoutes: ['/settings/accounts'],},beforeEach: seedAccountGroupsStory,@@ -36,7 +36,7 @@ const meta: Meta<PageDecoratorArgs> = {export default meta;-export type Story = StoryObj<typeof SettingsNativeAccountApp>;+export type Story = StoryObj<typeof SettingsBuiltInAccountApp>;export const GoogleGeneralShowsAccountsAndBlocklist: Story = {play: async ({ canvasElement }) => {@@ -129,7 +129,7 @@ export const GoogleCalendarTabShowsCalendarSettings: Story = {export const OutlookHasEmailsAndCalendarTabs: Story = {args: {- routeParams: { ':nativeAccountAppId': 'outlook' },+ routeParams: { ':builtInAccountAppId': 'outlook' },},play: async ({ canvasElement }) => {const canvas = within(canvasElement);@@ -155,7 +155,7 @@ export const OutlookHasEmailsAndCalendarTabs: Story = {export const OutlookWithoutCalendarServiceHasNoCalendarTab: Story = {args: {- routeParams: { ':nativeAccountAppId': 'outlook' },+ routeParams: { ':builtInAccountAppId': 'outlook' },},beforeEach: async () => {await seedAccountGroupsStory();@@ -173,7 +173,7 @@ export const OutlookWithoutCalendarServiceHasNoCalendarTab: Story = {export const CalendarPendingSetupHidesCalendarTab: Story = {args: {- routeParams: { ':nativeAccountAppId': 'outlook' },+ routeParams: { ':builtInAccountAppId': 'outlook' },},parameters: {msw: {@@ -206,7 +206,7 @@ export const CalendarPendingSetupHidesCalendarTab: Story = {export const DisabledAppGoesBackToAccounts: Story = {args: {- routeParams: { ':nativeAccountAppId': 'imap' },+ routeParams: { ':builtInAccountAppId': 'imap' },},play: async ({ canvasElement }) => {const canvas = within(canvasElement);@@ -221,7 +221,7 @@ export const DisabledAppGoesBackToAccounts: Story = {export const OutlookWithoutAccountOffersMicrosoftOnly: Story = {args: {- routeParams: { ':nativeAccountAppId': 'outlook' },+ routeParams: { ':builtInAccountAppId': 'outlook' },},parameters: {msw: {diff --git a/packages/twenty-shared/src/types/SettingsPath.ts b/packages/twenty-shared/src/types/SettingsPath.tsindex 8224dea736d..2ca8023bd0a 100644--- a/packages/twenty-shared/src/types/SettingsPath.ts+++ b/packages/twenty-shared/src/types/SettingsPath.ts@@ -4,7 +4,7 @@ export enum SettingsPath {Experience = 'experience',Accounts = 'accounts',AccountDetail = 'accounts/detail/:connectedAccountId',- NativeAccountApp = 'accounts/apps/:nativeAccountAppId',+ BuiltInAccountApp = 'accounts/apps/:builtInAccountAppId',ApplicationPreferences = 'accounts/applications/:applicationId',NewAccount = 'accounts/new',AccountsConfiguration = 'accounts/configuration/:connectedAccountId',