fix: fixed shortcuts population (#7016)
This PR fixes #6776 Screenshots: <img width="1728" alt="image" src="https://github.com/user-attachments/assets/ca061c30-ddb7-40ff-8c54-8b0d85d40864"> --------- Co-authored-by: sid0-0 <a@b.com> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
32
packages/twenty-front/src/modules/app/components/App.tsx
Normal file
32
packages/twenty-front/src/modules/app/components/App.tsx
Normal file
@ -0,0 +1,32 @@
|
||||
import { AppRouter } from '@/app/components/AppRouter';
|
||||
import { CaptchaProvider } from '@/captcha/components/CaptchaProvider';
|
||||
import { ApolloDevLogEffect } from '@/debug/components/ApolloDevLogEffect';
|
||||
import { RecoilDebugObserverEffect } from '@/debug/components/RecoilDebugObserver';
|
||||
import { AppErrorBoundary } from '@/error-handler/components/AppErrorBoundary';
|
||||
import { ExceptionHandlerProvider } from '@/error-handler/components/ExceptionHandlerProvider';
|
||||
import { SnackBarProviderScope } from '@/ui/feedback/snack-bar-manager/scopes/SnackBarProviderScope';
|
||||
import { HelmetProvider } from 'react-helmet-async';
|
||||
import { RecoilRoot } from 'recoil';
|
||||
import { IconsProvider } from 'twenty-ui';
|
||||
|
||||
export const App = () => {
|
||||
return (
|
||||
<RecoilRoot>
|
||||
<AppErrorBoundary>
|
||||
<CaptchaProvider>
|
||||
<RecoilDebugObserverEffect />
|
||||
<ApolloDevLogEffect />
|
||||
<SnackBarProviderScope snackBarManagerScopeId="snack-bar-manager">
|
||||
<IconsProvider>
|
||||
<ExceptionHandlerProvider>
|
||||
<HelmetProvider>
|
||||
<AppRouter />
|
||||
</HelmetProvider>
|
||||
</ExceptionHandlerProvider>
|
||||
</IconsProvider>
|
||||
</SnackBarProviderScope>
|
||||
</CaptchaProvider>
|
||||
</AppErrorBoundary>
|
||||
</RecoilRoot>
|
||||
);
|
||||
};
|
||||
@ -0,0 +1,27 @@
|
||||
import { createAppRouter } from '@/app/utils/createAppRouter';
|
||||
import { billingState } from '@/client-config/states/billingState';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { RouterProvider } from 'react-router-dom';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
export const AppRouter = () => {
|
||||
const billing = useRecoilValue(billingState);
|
||||
const isFreeAccessEnabled = useIsFeatureEnabled('IS_FREE_ACCESS_ENABLED');
|
||||
const isCRMMigrationEnabled = useIsFeatureEnabled('IS_CRM_MIGRATION_ENABLED');
|
||||
const isServerlessFunctionSettingsEnabled = useIsFeatureEnabled(
|
||||
'IS_FUNCTION_SETTINGS_ENABLED',
|
||||
);
|
||||
|
||||
const isBillingPageEnabled =
|
||||
billing?.isBillingEnabled && !isFreeAccessEnabled;
|
||||
|
||||
return (
|
||||
<RouterProvider
|
||||
router={createAppRouter(
|
||||
isBillingPageEnabled,
|
||||
isCRMMigrationEnabled,
|
||||
isServerlessFunctionSettingsEnabled,
|
||||
)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@ -0,0 +1,66 @@
|
||||
import { ApolloProvider } from '@/apollo/components/ApolloProvider';
|
||||
import { CommandMenuEffect } from '@/app/effect-components/CommandMenuEffect';
|
||||
import { GotoHotkeys } from '@/app/effect-components/GotoHotkeysEffect';
|
||||
import { PageChangeEffect } from '@/app/effect-components/PageChangeEffect';
|
||||
import { AuthProvider } from '@/auth/components/AuthProvider';
|
||||
import { ChromeExtensionSidecarEffect } from '@/chrome-extension-sidecar/components/ChromeExtensionSidecarEffect';
|
||||
import { ChromeExtensionSidecarProvider } from '@/chrome-extension-sidecar/components/ChromeExtensionSidecarProvider';
|
||||
import { ClientConfigProvider } from '@/client-config/components/ClientConfigProvider';
|
||||
import { ClientConfigProviderEffect } from '@/client-config/components/ClientConfigProviderEffect';
|
||||
import { PromiseRejectionEffect } from '@/error-handler/components/PromiseRejectionEffect';
|
||||
import { ApolloMetadataClientProvider } from '@/object-metadata/components/ApolloMetadataClientProvider';
|
||||
import { ObjectMetadataItemsProvider } from '@/object-metadata/components/ObjectMetadataItemsProvider';
|
||||
import { PrefetchDataProvider } from '@/prefetch/components/PrefetchDataProvider';
|
||||
import { DialogManager } from '@/ui/feedback/dialog-manager/components/DialogManager';
|
||||
import { DialogManagerScope } from '@/ui/feedback/dialog-manager/scopes/DialogManagerScope';
|
||||
import { SnackBarProvider } from '@/ui/feedback/snack-bar-manager/components/SnackBarProvider';
|
||||
import { AppThemeProvider } from '@/ui/theme/components/AppThemeProvider';
|
||||
import { PageTitle } from '@/ui/utilities/page-title/PageTitle';
|
||||
import { UserProvider } from '@/users/components/UserProvider';
|
||||
import { UserProviderEffect } from '@/users/components/UserProviderEffect';
|
||||
import { StrictMode } from 'react';
|
||||
import { Outlet, useLocation } from 'react-router-dom';
|
||||
import { getPageTitleFromPath } from '~/utils/title-utils';
|
||||
|
||||
export const AppRouterProviders = () => {
|
||||
const { pathname } = useLocation();
|
||||
const pageTitle = getPageTitleFromPath(pathname);
|
||||
|
||||
return (
|
||||
<ApolloProvider>
|
||||
<ClientConfigProviderEffect />
|
||||
<ClientConfigProvider>
|
||||
<ChromeExtensionSidecarEffect />
|
||||
<ChromeExtensionSidecarProvider>
|
||||
<UserProviderEffect />
|
||||
<UserProvider>
|
||||
<AuthProvider>
|
||||
<ApolloMetadataClientProvider>
|
||||
<ObjectMetadataItemsProvider>
|
||||
<PrefetchDataProvider>
|
||||
<AppThemeProvider>
|
||||
<SnackBarProvider>
|
||||
<DialogManagerScope dialogManagerScopeId="dialog-manager">
|
||||
<DialogManager>
|
||||
<StrictMode>
|
||||
<PromiseRejectionEffect />
|
||||
<CommandMenuEffect />
|
||||
<GotoHotkeys />
|
||||
<PageTitle title={pageTitle} />
|
||||
<Outlet />
|
||||
</StrictMode>
|
||||
</DialogManager>
|
||||
</DialogManagerScope>
|
||||
</SnackBarProvider>
|
||||
</AppThemeProvider>
|
||||
</PrefetchDataProvider>
|
||||
<PageChangeEffect />
|
||||
</ObjectMetadataItemsProvider>
|
||||
</ApolloMetadataClientProvider>
|
||||
</AuthProvider>
|
||||
</UserProvider>
|
||||
</ChromeExtensionSidecarProvider>
|
||||
</ClientConfigProvider>
|
||||
</ApolloProvider>
|
||||
);
|
||||
};
|
||||
@ -0,0 +1,362 @@
|
||||
import { lazy, Suspense } from 'react';
|
||||
import { Route, Routes } from 'react-router-dom';
|
||||
|
||||
import { AppPath } from '@/types/AppPath';
|
||||
import { SettingsPath } from '@/types/SettingsPath';
|
||||
|
||||
const SettingsAccountsCalendars = lazy(() =>
|
||||
import('~/pages/settings/accounts/SettingsAccountsCalendars').then(
|
||||
(module) => ({
|
||||
default: module.SettingsAccountsCalendars,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const SettingsAccountsEmails = lazy(() =>
|
||||
import('~/pages/settings/accounts/SettingsAccountsEmails').then((module) => ({
|
||||
default: module.SettingsAccountsEmails,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsNewAccount = lazy(() =>
|
||||
import('~/pages/settings/accounts/SettingsNewAccount').then((module) => ({
|
||||
default: module.SettingsNewAccount,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsNewObject = lazy(() =>
|
||||
import('~/pages/settings/data-model/SettingsNewObject').then((module) => ({
|
||||
default: module.SettingsNewObject,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsObjectDetailPage = lazy(() =>
|
||||
import('~/pages/settings/data-model/SettingsObjectDetailPage').then(
|
||||
(module) => ({
|
||||
default: module.SettingsObjectDetailPage,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const SettingsObjectOverview = lazy(() =>
|
||||
import('~/pages/settings/data-model/SettingsObjectOverview').then(
|
||||
(module) => ({
|
||||
default: module.SettingsObjectOverview,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const SettingsDevelopersApiKeyDetail = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail'
|
||||
).then((module) => ({
|
||||
default: module.SettingsDevelopersApiKeyDetail,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsDevelopersApiKeysNew = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew'
|
||||
).then((module) => ({
|
||||
default: module.SettingsDevelopersApiKeysNew,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsDevelopersWebhooksNew = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/developers/webhooks/SettingsDevelopersWebhooksNew'
|
||||
).then((module) => ({
|
||||
default: module.SettingsDevelopersWebhooksNew,
|
||||
})),
|
||||
);
|
||||
|
||||
const Releases = lazy(() =>
|
||||
import('~/pages/settings/Releases').then((module) => ({
|
||||
default: module.Releases,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsServerlessFunctions = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/serverless-functions/SettingsServerlessFunctions'
|
||||
).then((module) => ({ default: module.SettingsServerlessFunctions })),
|
||||
);
|
||||
|
||||
const SettingsServerlessFunctionDetailWrapper = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/serverless-functions/SettingsServerlessFunctionDetailWrapper'
|
||||
).then((module) => ({
|
||||
default: module.SettingsServerlessFunctionDetailWrapper,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsServerlessFunctionsNew = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/serverless-functions/SettingsServerlessFunctionsNew'
|
||||
).then((module) => ({
|
||||
default: module.SettingsServerlessFunctionsNew,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsWorkspace = lazy(() =>
|
||||
import('~/pages/settings/SettingsWorkspace').then((module) => ({
|
||||
default: module.SettingsWorkspace,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsWorkspaceMembers = lazy(() =>
|
||||
import('~/pages/settings/SettingsWorkspaceMembers').then((module) => ({
|
||||
default: module.SettingsWorkspaceMembers,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsProfile = lazy(() =>
|
||||
import('~/pages/settings/SettingsProfile').then((module) => ({
|
||||
default: module.SettingsProfile,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsAppearance = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/profile/appearance/components/SettingsAppearance'
|
||||
).then((module) => ({
|
||||
default: module.SettingsAppearance,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsAccounts = lazy(() =>
|
||||
import('~/pages/settings/accounts/SettingsAccounts').then((module) => ({
|
||||
default: module.SettingsAccounts,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsBilling = lazy(() =>
|
||||
import('~/pages/settings/SettingsBilling').then((module) => ({
|
||||
default: module.SettingsBilling,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsDevelopers = lazy(() =>
|
||||
import('~/pages/settings/developers/SettingsDevelopers').then((module) => ({
|
||||
default: module.SettingsDevelopers,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsObjectEdit = lazy(() =>
|
||||
import('~/pages/settings/data-model/SettingsObjectEdit').then((module) => ({
|
||||
default: module.SettingsObjectEdit,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsIntegrations = lazy(() =>
|
||||
import('~/pages/settings/integrations/SettingsIntegrations').then(
|
||||
(module) => ({
|
||||
default: module.SettingsIntegrations,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const SettingsObjects = lazy(() =>
|
||||
import('~/pages/settings/data-model/SettingsObjects').then((module) => ({
|
||||
default: module.SettingsObjects,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsDevelopersWebhooksDetail = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/developers/webhooks/SettingsDevelopersWebhookDetail'
|
||||
).then((module) => ({
|
||||
default: module.SettingsDevelopersWebhooksDetail,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsIntegrationDatabase = lazy(() =>
|
||||
import('~/pages/settings/integrations/SettingsIntegrationDatabase').then(
|
||||
(module) => ({
|
||||
default: module.SettingsIntegrationDatabase,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const SettingsIntegrationNewDatabaseConnection = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/integrations/SettingsIntegrationNewDatabaseConnection'
|
||||
).then((module) => ({
|
||||
default: module.SettingsIntegrationNewDatabaseConnection,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsIntegrationEditDatabaseConnection = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/integrations/SettingsIntegrationEditDatabaseConnection'
|
||||
).then((module) => ({
|
||||
default: module.SettingsIntegrationEditDatabaseConnection,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsIntegrationShowDatabaseConnection = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/integrations/SettingsIntegrationShowDatabaseConnection'
|
||||
).then((module) => ({
|
||||
default: module.SettingsIntegrationShowDatabaseConnection,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsObjectNewFieldStep1 = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep1'
|
||||
).then((module) => ({
|
||||
default: module.SettingsObjectNewFieldStep1,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsObjectNewFieldStep2 = lazy(() =>
|
||||
import(
|
||||
'~/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep2'
|
||||
).then((module) => ({
|
||||
default: module.SettingsObjectNewFieldStep2,
|
||||
})),
|
||||
);
|
||||
|
||||
const SettingsObjectFieldEdit = lazy(() =>
|
||||
import('~/pages/settings/data-model/SettingsObjectFieldEdit').then(
|
||||
(module) => ({
|
||||
default: module.SettingsObjectFieldEdit,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const SettingsCRMMigration = lazy(() =>
|
||||
import('~/pages/settings/crm-migration/SettingsCRMMigration').then(
|
||||
(module) => ({
|
||||
default: module.SettingsCRMMigration,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
type SettingsRoutesProps = {
|
||||
isBillingEnabled?: boolean;
|
||||
isCRMMigrationEnabled?: boolean;
|
||||
isServerlessFunctionSettingsEnabled?: boolean;
|
||||
};
|
||||
|
||||
export const SettingsRoutes = ({
|
||||
isBillingEnabled,
|
||||
isCRMMigrationEnabled,
|
||||
isServerlessFunctionSettingsEnabled,
|
||||
}: SettingsRoutesProps) => (
|
||||
<Suspense fallback={null}>
|
||||
<Routes>
|
||||
<Route path={SettingsPath.ProfilePage} element={<SettingsProfile />} />
|
||||
<Route path={SettingsPath.Appearance} element={<SettingsAppearance />} />
|
||||
<Route path={SettingsPath.Accounts} element={<SettingsAccounts />} />
|
||||
<Route path={SettingsPath.NewAccount} element={<SettingsNewAccount />} />
|
||||
<Route
|
||||
path={SettingsPath.AccountsCalendars}
|
||||
element={<SettingsAccountsCalendars />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.AccountsEmails}
|
||||
element={<SettingsAccountsEmails />}
|
||||
/>
|
||||
{isBillingEnabled && (
|
||||
<Route path={SettingsPath.Billing} element={<SettingsBilling />} />
|
||||
)}
|
||||
<Route
|
||||
path={SettingsPath.WorkspaceMembersPage}
|
||||
element={<SettingsWorkspaceMembers />}
|
||||
/>
|
||||
<Route path={SettingsPath.Workspace} element={<SettingsWorkspace />} />
|
||||
<Route path={SettingsPath.Objects} element={<SettingsObjects />} />
|
||||
<Route
|
||||
path={SettingsPath.ObjectOverview}
|
||||
element={<SettingsObjectOverview />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.ObjectDetail}
|
||||
element={<SettingsObjectDetailPage />}
|
||||
/>
|
||||
<Route path={SettingsPath.ObjectEdit} element={<SettingsObjectEdit />} />
|
||||
<Route path={SettingsPath.NewObject} element={<SettingsNewObject />} />
|
||||
<Route path={SettingsPath.Developers} element={<SettingsDevelopers />} />
|
||||
{isCRMMigrationEnabled && (
|
||||
<Route
|
||||
path={SettingsPath.CRMMigration}
|
||||
element={<SettingsCRMMigration />}
|
||||
/>
|
||||
)}
|
||||
<Route
|
||||
path={AppPath.DevelopersCatchAll}
|
||||
element={
|
||||
<Routes>
|
||||
<Route
|
||||
path={SettingsPath.DevelopersNewApiKey}
|
||||
element={<SettingsDevelopersApiKeysNew />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.DevelopersApiKeyDetail}
|
||||
element={<SettingsDevelopersApiKeyDetail />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.DevelopersNewWebhook}
|
||||
element={<SettingsDevelopersWebhooksNew />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.DevelopersNewWebhookDetail}
|
||||
element={<SettingsDevelopersWebhooksDetail />}
|
||||
/>
|
||||
</Routes>
|
||||
}
|
||||
/>
|
||||
{isServerlessFunctionSettingsEnabled && (
|
||||
<>
|
||||
<Route
|
||||
path={SettingsPath.ServerlessFunctions}
|
||||
element={<SettingsServerlessFunctions />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.NewServerlessFunction}
|
||||
element={<SettingsServerlessFunctionsNew />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.ServerlessFunctionDetail}
|
||||
element={<SettingsServerlessFunctionDetailWrapper />}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<Route
|
||||
path={SettingsPath.Integrations}
|
||||
element={<SettingsIntegrations />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.IntegrationDatabase}
|
||||
element={<SettingsIntegrationDatabase />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.IntegrationNewDatabaseConnection}
|
||||
element={<SettingsIntegrationNewDatabaseConnection />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.IntegrationEditDatabaseConnection}
|
||||
element={<SettingsIntegrationEditDatabaseConnection />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.IntegrationDatabaseConnection}
|
||||
element={<SettingsIntegrationShowDatabaseConnection />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.ObjectNewFieldStep1}
|
||||
element={<SettingsObjectNewFieldStep1 />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.ObjectNewFieldStep2}
|
||||
element={<SettingsObjectNewFieldStep2 />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.ObjectFieldEdit}
|
||||
element={<SettingsObjectFieldEdit />}
|
||||
/>
|
||||
<Route path={SettingsPath.Releases} element={<Releases />} />
|
||||
</Routes>
|
||||
</Suspense>
|
||||
);
|
||||
Reference in New Issue
Block a user