diff --git a/packages/twenty-front/src/loading/components/__stories__/PrefetchLoading.stories.tsx b/packages/twenty-front/src/loading/components/__stories__/PrefetchLoading.stories.tsx new file mode 100644 index 0000000000..919b284a4c --- /dev/null +++ b/packages/twenty-front/src/loading/components/__stories__/PrefetchLoading.stories.tsx @@ -0,0 +1,47 @@ +import { expect } from '@storybook/jest'; +import { Meta, StoryObj } from '@storybook/react'; +import { within } from '@storybook/test'; + +import { RecordIndexPage } from '~/pages/object-record/RecordIndexPage'; +import { + PageDecorator, + PageDecoratorArgs, +} from '~/testing/decorators/PageDecorator'; +import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; +import { graphqlMocks } from '~/testing/graphqlMocks'; + +const meta: Meta = { + title: 'App/Loading/PrefetchLoading', + component: RecordIndexPage, + args: { + routePath: '/objects/:objectNamePlural', + routeParams: { + ':objectNamePlural': 'companies', + }, + }, + parameters: { + msw: graphqlMocks, + }, +}; + +export default meta; + +export type Story = StoryObj; + +export const Default: Story = { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + decorators: [PrefetchLoadingDecorator, PageDecorator], + play: async ({ canvasElement }) => { + const canvas = within(canvasElement); + + await canvas.findByText('Search'); + await canvas.findByText('Settings'); + await canvas.findByText('Tasks'); + + expect(canvas.queryByText('People')).toBeNull(); + expect(canvas.queryByText('Opportunities')).toBeNull(); + expect(canvas.queryByText('Listings')).toBeNull(); + expect(canvas.queryByText('My Customs')).toBeNull(); + }, +}; diff --git a/packages/twenty-front/src/loading/components/__stories__/UserOrMetadataLoader.stories.tsx b/packages/twenty-front/src/loading/components/__stories__/UserOrMetadataLoader.stories.tsx new file mode 100644 index 0000000000..15c18390f6 --- /dev/null +++ b/packages/twenty-front/src/loading/components/__stories__/UserOrMetadataLoader.stories.tsx @@ -0,0 +1,87 @@ +import { getOperationName } from '@apollo/client/utilities'; +import { expect } from '@storybook/jest'; +import { Meta, StoryObj } from '@storybook/react'; +import { within } from '@storybook/test'; +import { graphql, HttpResponse } from 'msw'; + +import { GET_CLIENT_CONFIG } from '@/client-config/graphql/queries/getClientConfig'; +import { FIND_MANY_OBJECT_METADATA_ITEMS } from '@/object-metadata/graphql/queries'; +import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser'; +import { RecordIndexPage } from '~/pages/object-record/RecordIndexPage'; +import { + PageDecorator, + PageDecoratorArgs, +} from '~/testing/decorators/PageDecorator'; +import { graphqlMocks, metadataGraphql } from '~/testing/graphqlMocks'; +import { mockedClientConfig } from '~/testing/mock-data/config'; +import { mockedUsersData } from '~/testing/mock-data/users'; + +const userMetadataLoaderMocks = { + msw: { + handlers: [ + graphql.query(getOperationName(GET_CURRENT_USER) ?? '', () => { + return HttpResponse.json({ + data: { + currentUser: mockedUsersData[0], + }, + }); + }), + graphql.query(getOperationName(GET_CLIENT_CONFIG) ?? '', () => { + return HttpResponse.json({ + data: { + clientConfig: mockedClientConfig, + }, + }); + }), + metadataGraphql.query( + getOperationName(FIND_MANY_OBJECT_METADATA_ITEMS) ?? '', + () => { + return HttpResponse.json({ + data: { + objects: { + // simulate no metadata items + edges: [], + }, + }, + }); + }, + ), + ], + }, +}; + +const meta: Meta = { + title: 'App/Loading/UserOrMetadataLoader', + component: RecordIndexPage, + args: { + routePath: '/objects/:objectNamePlural', + routeParams: { + ':objectNamePlural': 'companies', + }, + }, + parameters: { + msw: graphqlMocks, + }, +}; + +export default meta; + +export type Story = StoryObj; + +export const Default: Story = { + parameters: userMetadataLoaderMocks, + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + decorators: [PageDecorator], + play: async ({ canvasElement }) => { + const canvas = within(canvasElement); + + expect(canvas.queryByText('Search')).toBeNull(); + expect(canvas.queryByText('Settings')).toBeNull(); + expect(canvas.queryByText('Tasks')).toBeNull(); + expect(canvas.queryByText('People')).toBeNull(); + expect(canvas.queryByText('Opportunities')).toBeNull(); + expect(canvas.queryByText('Listings')).toBeNull(); + expect(canvas.queryByText('My Customs')).toBeNull(); + }, +}; diff --git a/packages/twenty-front/src/modules/object-metadata/components/__stories__/ObjectMetadataNavItems.stories.tsx b/packages/twenty-front/src/modules/object-metadata/components/__stories__/ObjectMetadataNavItems.stories.tsx index 0edf2a2098..6efdf175bb 100644 --- a/packages/twenty-front/src/modules/object-metadata/components/__stories__/ObjectMetadataNavItems.stories.tsx +++ b/packages/twenty-front/src/modules/object-metadata/components/__stories__/ObjectMetadataNavItems.stories.tsx @@ -6,7 +6,6 @@ import { ComponentWithRecoilScopeDecorator } from '~/testing/decorators/Componen import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator'; import { IconsProviderDecorator } from '~/testing/decorators/IconsProviderDecorator'; import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; @@ -21,7 +20,6 @@ const meta: Meta = { ComponentWithRouterDecorator, ComponentWithRecoilScopeDecorator, SnackBarDecorator, - PrefetchLoadingDecorator, ], parameters: { msw: graphqlMocks, diff --git a/packages/twenty-front/src/modules/support/components/__stories__/SupportChat.stories.tsx b/packages/twenty-front/src/modules/support/components/__stories__/SupportChat.stories.tsx index 57b5abbe0c..7da0223065 100644 --- a/packages/twenty-front/src/modules/support/components/__stories__/SupportChat.stories.tsx +++ b/packages/twenty-front/src/modules/support/components/__stories__/SupportChat.stories.tsx @@ -7,7 +7,6 @@ import { currentUserState } from '@/auth/states/currentUserState'; import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState'; import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState'; import { supportChatState } from '@/client-config/states/supportChatState'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockDefaultWorkspace, @@ -36,7 +35,6 @@ const meta: Meta = { return ; }, - PrefetchLoadingDecorator, ], parameters: { msw: graphqlMocks, diff --git a/packages/twenty-front/src/pages/auth/__stories__/ChooseYourPlan.stories.tsx b/packages/twenty-front/src/pages/auth/__stories__/ChooseYourPlan.stories.tsx index 17b5b4b6a0..b0c92f84e2 100644 --- a/packages/twenty-front/src/pages/auth/__stories__/ChooseYourPlan.stories.tsx +++ b/packages/twenty-front/src/pages/auth/__stories__/ChooseYourPlan.stories.tsx @@ -9,7 +9,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockedOnboardingUsersData } from '~/testing/mock-data/users'; import { sleep } from '~/testing/sleep'; @@ -19,7 +18,7 @@ import { ChooseYourPlan } from '../ChooseYourPlan'; const meta: Meta = { title: 'Pages/Auth/ChooseYourPlan', component: ChooseYourPlan, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: AppPath.PlanRequired }, parameters: { msw: { diff --git a/packages/twenty-front/src/pages/auth/__stories__/CreateProfile.stories.tsx b/packages/twenty-front/src/pages/auth/__stories__/CreateProfile.stories.tsx index e9f7292f36..302883712f 100644 --- a/packages/twenty-front/src/pages/auth/__stories__/CreateProfile.stories.tsx +++ b/packages/twenty-front/src/pages/auth/__stories__/CreateProfile.stories.tsx @@ -9,7 +9,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockedOnboardingUsersData } from '~/testing/mock-data/users'; @@ -18,7 +17,7 @@ import { CreateProfile } from '../CreateProfile'; const meta: Meta = { title: 'Pages/Auth/CreateProfile', component: CreateProfile, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: AppPath.CreateProfile }, parameters: { msw: { diff --git a/packages/twenty-front/src/pages/auth/__stories__/CreateWorkspace.stories.tsx b/packages/twenty-front/src/pages/auth/__stories__/CreateWorkspace.stories.tsx index 2a4ff62678..61d2f8316f 100644 --- a/packages/twenty-front/src/pages/auth/__stories__/CreateWorkspace.stories.tsx +++ b/packages/twenty-front/src/pages/auth/__stories__/CreateWorkspace.stories.tsx @@ -11,7 +11,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockedOnboardingUsersData } from '~/testing/mock-data/users'; @@ -26,7 +25,6 @@ const meta: Meta = { setCurrentWorkspace(mockedOnboardingUsersData[1].defaultWorkspace); return ; }, - PrefetchLoadingDecorator, PageDecorator, ], args: { routePath: AppPath.CreateWorkspace }, diff --git a/packages/twenty-front/src/pages/auth/__stories__/PasswordReset.stories.tsx b/packages/twenty-front/src/pages/auth/__stories__/PasswordReset.stories.tsx index e0f0a5191d..234b06e795 100644 --- a/packages/twenty-front/src/pages/auth/__stories__/PasswordReset.stories.tsx +++ b/packages/twenty-front/src/pages/auth/__stories__/PasswordReset.stories.tsx @@ -10,14 +10,13 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockedOnboardingUsersData } from '~/testing/mock-data/users'; const meta: Meta = { title: 'Pages/Auth/PasswordReset', component: PasswordReset, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/reset-password/:passwordResetToken', routeParams: { ':passwordResetToken': 'MOCKED_TOKEN' }, diff --git a/packages/twenty-front/src/pages/auth/__stories__/PaymentSuccess.stories.tsx b/packages/twenty-front/src/pages/auth/__stories__/PaymentSuccess.stories.tsx index 571cb92449..dec1d3e816 100644 --- a/packages/twenty-front/src/pages/auth/__stories__/PaymentSuccess.stories.tsx +++ b/packages/twenty-front/src/pages/auth/__stories__/PaymentSuccess.stories.tsx @@ -9,7 +9,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockedOnboardingUsersData } from '~/testing/mock-data/users'; @@ -18,7 +17,7 @@ import { PaymentSuccess } from '../PaymentSuccess'; const meta: Meta = { title: 'Pages/Auth/PaymentSuccess', component: PaymentSuccess, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: AppPath.PlanRequiredSuccess }, parameters: { msw: { diff --git a/packages/twenty-front/src/pages/auth/__stories__/SignInUp.stories.tsx b/packages/twenty-front/src/pages/auth/__stories__/SignInUp.stories.tsx index b93645edec..3805d33ad5 100644 --- a/packages/twenty-front/src/pages/auth/__stories__/SignInUp.stories.tsx +++ b/packages/twenty-front/src/pages/auth/__stories__/SignInUp.stories.tsx @@ -9,7 +9,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { SignInUp } from '../SignInUp'; @@ -17,7 +16,7 @@ import { SignInUp } from '../SignInUp'; const meta: Meta = { title: 'Pages/Auth/SignInUp', component: SignInUp, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: AppPath.SignInUp }, parameters: { msw: { diff --git a/packages/twenty-front/src/pages/impersonate/__stories__/ImpersonateEffect.stories.tsx b/packages/twenty-front/src/pages/impersonate/__stories__/ImpersonateEffect.stories.tsx index 64b9499e4c..f70ed94415 100644 --- a/packages/twenty-front/src/pages/impersonate/__stories__/ImpersonateEffect.stories.tsx +++ b/packages/twenty-front/src/pages/impersonate/__stories__/ImpersonateEffect.stories.tsx @@ -5,7 +5,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; @@ -14,7 +13,7 @@ import { ImpersonateEffect } from '../ImpersonateEffect'; const meta: Meta = { title: 'Pages/Impersonate/Impersonate', component: ImpersonateEffect, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: AppPath.Impersonate, routeParams: { ':userId': '1' }, diff --git a/packages/twenty-front/src/pages/object-record/__stories__/RecordIndexPage.stories.tsx b/packages/twenty-front/src/pages/object-record/__stories__/RecordIndexPage.stories.tsx index cee0497a34..a8ecfda08e 100644 --- a/packages/twenty-front/src/pages/object-record/__stories__/RecordIndexPage.stories.tsx +++ b/packages/twenty-front/src/pages/object-record/__stories__/RecordIndexPage.stories.tsx @@ -1,4 +1,3 @@ -import { expect } from '@storybook/jest'; import { Meta, StoryObj } from '@storybook/react'; import { within } from '@storybook/test'; @@ -6,7 +5,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { RecordIndexPage } from '../RecordIndexPage'; @@ -31,7 +29,6 @@ export default meta; export type Story = StoryObj; export const Default: Story = { - decorators: [PrefetchLoadingDecorator], play: async ({ canvasElement }) => { const canvas = within(canvasElement); @@ -42,14 +39,3 @@ export const Default: Story = { await canvas.findByText('My Customs'); }, }; - -export const Loading: Story = { - play: async ({ canvasElement }) => { - const canvas = within(canvasElement); - - expect(canvas.queryByText('People')).toBeNull(); - expect(canvas.queryByText('Opportunities')).toBeNull(); - expect(canvas.queryByText('Listings')).toBeNull(); - expect(canvas.queryByText('My Customs')).toBeNull(); - }, -}; diff --git a/packages/twenty-front/src/pages/object-record/__stories__/RecordShowPage.stories.tsx b/packages/twenty-front/src/pages/object-record/__stories__/RecordShowPage.stories.tsx index bb2365b197..57741d149f 100644 --- a/packages/twenty-front/src/pages/object-record/__stories__/RecordShowPage.stories.tsx +++ b/packages/twenty-front/src/pages/object-record/__stories__/RecordShowPage.stories.tsx @@ -7,7 +7,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockedPeopleData } from '~/testing/mock-data/people'; import { mockedWorkspaceMemberData } from '~/testing/mock-data/users'; @@ -84,7 +83,7 @@ export type Story = StoryObj; export const Default: Story = { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], play: async ({ canvasElement }) => { const canvas = within(canvasElement); diff --git a/packages/twenty-front/src/pages/settings/__stories__/SettingsAppearance.stories.tsx b/packages/twenty-front/src/pages/settings/__stories__/SettingsAppearance.stories.tsx index fdea2004da..5bb3a33ea0 100644 --- a/packages/twenty-front/src/pages/settings/__stories__/SettingsAppearance.stories.tsx +++ b/packages/twenty-front/src/pages/settings/__stories__/SettingsAppearance.stories.tsx @@ -4,7 +4,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { SettingsAppearance } from '../SettingsAppearance'; @@ -12,7 +11,7 @@ import { SettingsAppearance } from '../SettingsAppearance'; const meta: Meta = { title: 'Pages/Settings/SettingsAppearance', component: SettingsAppearance, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/appearance' }, parameters: { msw: graphqlMocks, diff --git a/packages/twenty-front/src/pages/settings/__stories__/SettingsBilling.stories.tsx b/packages/twenty-front/src/pages/settings/__stories__/SettingsBilling.stories.tsx index 467c6045ed..6be6ad9fb7 100644 --- a/packages/twenty-front/src/pages/settings/__stories__/SettingsBilling.stories.tsx +++ b/packages/twenty-front/src/pages/settings/__stories__/SettingsBilling.stories.tsx @@ -7,7 +7,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; @@ -16,7 +15,7 @@ import { SettingsBilling } from '../SettingsBilling'; const meta: Meta = { title: 'Pages/Settings/SettingsBilling', component: SettingsBilling, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: getSettingsPagePath(SettingsPath.Billing) }, parameters: { msw: graphqlMocks, diff --git a/packages/twenty-front/src/pages/settings/__stories__/SettingsProfile.stories.tsx b/packages/twenty-front/src/pages/settings/__stories__/SettingsProfile.stories.tsx index 23bf9b6694..4c674e3526 100644 --- a/packages/twenty-front/src/pages/settings/__stories__/SettingsProfile.stories.tsx +++ b/packages/twenty-front/src/pages/settings/__stories__/SettingsProfile.stories.tsx @@ -5,7 +5,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { SettingsProfile } from '../SettingsProfile'; @@ -13,7 +12,7 @@ import { SettingsProfile } from '../SettingsProfile'; const meta: Meta = { title: 'Pages/Settings/SettingsProfile', component: SettingsProfile, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/profile', additionalRoutes: ['/welcome'], diff --git a/packages/twenty-front/src/pages/settings/__stories__/SettingsWorkspace.stories.tsx b/packages/twenty-front/src/pages/settings/__stories__/SettingsWorkspace.stories.tsx index ac4016170d..1858e3f04d 100644 --- a/packages/twenty-front/src/pages/settings/__stories__/SettingsWorkspace.stories.tsx +++ b/packages/twenty-front/src/pages/settings/__stories__/SettingsWorkspace.stories.tsx @@ -4,7 +4,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { SettingsWorkspace } from '../SettingsWorkspace'; @@ -12,7 +11,7 @@ import { SettingsWorkspace } from '../SettingsWorkspace'; const meta: Meta = { title: 'Pages/Settings/SettingsWorkspace', component: SettingsWorkspace, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/workspace' }, parameters: { msw: graphqlMocks, diff --git a/packages/twenty-front/src/pages/settings/__stories__/SettingsWorkspaceMembers.stories.tsx b/packages/twenty-front/src/pages/settings/__stories__/SettingsWorkspaceMembers.stories.tsx index 5c72331547..655bab8ea7 100644 --- a/packages/twenty-front/src/pages/settings/__stories__/SettingsWorkspaceMembers.stories.tsx +++ b/packages/twenty-front/src/pages/settings/__stories__/SettingsWorkspaceMembers.stories.tsx @@ -5,7 +5,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; @@ -14,7 +13,7 @@ import { SettingsWorkspaceMembers } from '../SettingsWorkspaceMembers'; const meta: Meta = { title: 'Pages/Settings/SettingsWorkspaceMembers', component: SettingsWorkspaceMembers, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/workspace-members' }, parameters: { msw: graphqlMocks, 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.tsx index b77371c7b4..747a43b24a 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 @@ -5,7 +5,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { SettingsAccounts } from '../SettingsAccounts'; @@ -13,7 +12,7 @@ import { SettingsAccounts } from '../SettingsAccounts'; const meta: Meta = { title: 'Pages/Settings/Accounts/SettingsAccounts', component: SettingsAccounts, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/accounts', }, diff --git a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendars.stories.tsx b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendars.stories.tsx index c4c8296abd..e53cef2cb5 100644 --- a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendars.stories.tsx +++ b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendars.stories.tsx @@ -7,7 +7,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; @@ -16,7 +15,7 @@ import { SettingsAccountsCalendars } from '../SettingsAccountsCalendars'; const meta: Meta = { title: 'Pages/Settings/Accounts/SettingsAccountsCalendars', component: SettingsAccountsCalendars, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: getSettingsPagePath(SettingsPath.AccountsCalendars), }, diff --git a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendarsSettings.stories.tsx b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendarsSettings.stories.tsx index 341ba269e1..c88b24cb34 100644 --- a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendarsSettings.stories.tsx +++ b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendarsSettings.stories.tsx @@ -8,7 +8,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockedConnectedAccounts } from '~/testing/mock-data/accounts'; import { sleep } from '~/testing/sleep'; @@ -18,7 +17,7 @@ import { SettingsAccountsCalendarsSettings } from '../SettingsAccountsCalendarsS const meta: Meta = { title: 'Pages/Settings/Accounts/SettingsAccountsCalendarsSettings', component: SettingsAccountsCalendarsSettings, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: getSettingsPagePath(SettingsPath.AccountsCalendarsSettings), routeParams: { ':accountUuid': mockedConnectedAccounts[0].id }, diff --git a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmails.stories.tsx b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmails.stories.tsx index 0f8f4b5aea..21bede0eb5 100644 --- a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmails.stories.tsx +++ b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmails.stories.tsx @@ -4,7 +4,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { SettingsAccountsEmails } from '../SettingsAccountsEmails'; @@ -12,7 +11,7 @@ import { SettingsAccountsEmails } from '../SettingsAccountsEmails'; const meta: Meta = { title: 'Pages/Settings/Accounts/SettingsAccountsEmails', component: SettingsAccountsEmails, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/accounts/emails', }, diff --git a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmailsInboxSettings.stories.tsx b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmailsInboxSettings.stories.tsx index 5d55a97ee6..d508072ddb 100644 --- a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmailsInboxSettings.stories.tsx +++ b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmailsInboxSettings.stories.tsx @@ -7,13 +7,12 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; const meta: Meta = { title: 'Pages/Settings/Accounts/SettingsAccountsEmailsInboxSettings', component: SettingsAccountsEmailsInboxSettings, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/accounts/emails/:accountUuid', routeParams: { ':accountUuid': '123' }, diff --git a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsNewAccount.stories.tsx b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsNewAccount.stories.tsx index e34bbc26e9..7460933921 100644 --- a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsNewAccount.stories.tsx +++ b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsNewAccount.stories.tsx @@ -5,13 +5,12 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; const meta: Meta = { title: 'Pages/Settings/Accounts/SettingsNewAccount', component: SettingsNewAccount, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/accounts/new', }, diff --git a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsNewObject.stories.tsx b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsNewObject.stories.tsx index bf7ad4cbf3..a90160ea13 100644 --- a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsNewObject.stories.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsNewObject.stories.tsx @@ -5,7 +5,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { SettingsNewObject } from '../SettingsNewObject'; @@ -13,7 +12,7 @@ import { SettingsNewObject } from '../SettingsNewObject'; const meta: Meta = { title: 'Pages/Settings/DataModel/SettingsNewObject', component: SettingsNewObject, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/objects/new', }, diff --git a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectDetail.stories.tsx b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectDetail.stories.tsx index 0f515c895b..6fe42cba88 100644 --- a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectDetail.stories.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectDetail.stories.tsx @@ -5,7 +5,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; @@ -14,7 +13,7 @@ import { SettingsObjectDetail } from '../SettingsObjectDetail'; const meta: Meta = { title: 'Pages/Settings/DataModel/SettingsObjectDetail', component: SettingsObjectDetail, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/objects/:objectSlug', routeParams: { ':objectSlug': 'companies' }, diff --git a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectEdit.stories.tsx b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectEdit.stories.tsx index b3f81df373..0e7d926d34 100644 --- a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectEdit.stories.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectEdit.stories.tsx @@ -4,7 +4,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; @@ -13,7 +12,7 @@ import { SettingsObjectEdit } from '../SettingsObjectEdit'; const meta: Meta = { title: 'Pages/Settings/DataModel/SettingsObjectEdit', component: SettingsObjectEdit, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/objects/:objectSlug/edit', routeParams: { ':objectSlug': 'companies' }, diff --git a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectFieldEdit.stories.tsx b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectFieldEdit.stories.tsx index 366a8875e1..d760d89608 100644 --- a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectFieldEdit.stories.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectFieldEdit.stories.tsx @@ -4,7 +4,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { SettingsObjectFieldEdit } from '../SettingsObjectFieldEdit'; @@ -12,7 +11,7 @@ import { SettingsObjectFieldEdit } from '../SettingsObjectFieldEdit'; const meta: Meta = { title: 'Pages/Settings/DataModel/SettingsObjectFieldEdit', component: SettingsObjectFieldEdit, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/objects/:objectSlug/:fieldSlug', routeParams: { ':objectSlug': 'companies', ':fieldSlug': 'name' }, diff --git a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep1.stories.tsx b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep1.stories.tsx index 0a5ccc2c54..d54dd9f4db 100644 --- a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep1.stories.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep1.stories.tsx @@ -5,7 +5,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { SettingsObjectNewFieldStep1 } from '../../SettingsObjectNewField/SettingsObjectNewFieldStep1'; @@ -14,7 +13,7 @@ const meta: Meta = { title: 'Pages/Settings/DataModel/SettingsObjectNewField/SettingsObjectNewFieldStep1', component: SettingsObjectNewFieldStep1, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/objects/:objectSlug/new-field/step-1', routeParams: { ':objectSlug': 'companies' }, diff --git a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep2.stories.tsx b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep2.stories.tsx index 6ebfa5ee35..0329f11103 100644 --- a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep2.stories.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep2.stories.tsx @@ -5,7 +5,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { SettingsObjectNewFieldStep2 } from '../../SettingsObjectNewField/SettingsObjectNewFieldStep2'; @@ -14,7 +13,7 @@ const meta: Meta = { title: 'Pages/Settings/DataModel/SettingsObjectNewField/SettingsObjectNewFieldStep2', component: SettingsObjectNewFieldStep2, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/objects/:objectSlug/new-field/step-2', routeParams: { ':objectSlug': 'companies' }, diff --git a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjects.stories.tsx b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjects.stories.tsx index 27dd839172..2e00e15b28 100644 --- a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjects.stories.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjects.stories.tsx @@ -5,7 +5,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; @@ -14,7 +13,7 @@ import { SettingsObjects } from '../SettingsObjects'; const meta: Meta = { title: 'Pages/Settings/DataModel/SettingsObjects', component: SettingsObjects, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/objects' }, parameters: { msw: graphqlMocks, diff --git a/packages/twenty-front/src/pages/settings/developers/__stories__/SettingsDevelopers.stories.tsx b/packages/twenty-front/src/pages/settings/developers/__stories__/SettingsDevelopers.stories.tsx index b2f6ee29f3..dcc2c25810 100644 --- a/packages/twenty-front/src/pages/settings/developers/__stories__/SettingsDevelopers.stories.tsx +++ b/packages/twenty-front/src/pages/settings/developers/__stories__/SettingsDevelopers.stories.tsx @@ -6,14 +6,13 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; const meta: Meta = { title: 'Pages/Settings/Developers/SettingsDevelopers', component: SettingsDevelopers, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/developers' }, parameters: { msw: graphqlMocks, diff --git a/packages/twenty-front/src/pages/settings/developers/__stories__/api-keys/SettingsDevelopersApiKeysDetail.stories.tsx b/packages/twenty-front/src/pages/settings/developers/__stories__/api-keys/SettingsDevelopersApiKeysDetail.stories.tsx index b5a6a096a4..cb59020517 100644 --- a/packages/twenty-front/src/pages/settings/developers/__stories__/api-keys/SettingsDevelopersApiKeysDetail.stories.tsx +++ b/packages/twenty-front/src/pages/settings/developers/__stories__/api-keys/SettingsDevelopersApiKeysDetail.stories.tsx @@ -7,13 +7,12 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; const meta: Meta = { title: 'Pages/Settings/Developers/ApiKeys/SettingsDevelopersApiKeyDetail', component: SettingsDevelopersApiKeyDetail, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/developers/api-keys/:apiKeyId', routeParams: { 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.tsx index e537b717c4..ec5630ab87 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 @@ -6,13 +6,12 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; const meta: Meta = { title: 'Pages/Settings/Developers/ApiKeys/SettingsDevelopersApiKeysNew', component: SettingsDevelopersApiKeysNew, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/developers/api-keys/new' }, parameters: { msw: graphqlMocks, diff --git a/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsDevelopersWebhooksDetail.stories.tsx b/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsDevelopersWebhooksDetail.stories.tsx index 25e05a8b7a..b3b387a922 100644 --- a/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsDevelopersWebhooksDetail.stories.tsx +++ b/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsDevelopersWebhooksDetail.stories.tsx @@ -7,13 +7,12 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; const meta: Meta = { title: 'Pages/Settings/Developers/Webhooks/SettingsDevelopersWebhooksDetail', component: SettingsDevelopersWebhooksDetail, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/developers/webhooks/:webhookId', routeParams: { ':webhookId': '1234' }, diff --git a/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsDevelopersWebhooksNew.stories.tsx b/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsDevelopersWebhooksNew.stories.tsx index 64d0adcda5..dd4adfb713 100644 --- a/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsDevelopersWebhooksNew.stories.tsx +++ b/packages/twenty-front/src/pages/settings/developers/__stories__/webhooks/SettingsDevelopersWebhooksNew.stories.tsx @@ -6,13 +6,12 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; const meta: Meta = { title: 'Pages/Settings/Developers/Webhooks/SettingsDevelopersWebhooksNew', component: SettingsDevelopersWebhooksNew, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/developers' }, parameters: { msw: graphqlMocks, 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.tsx index 7d40100556..be0983ca22 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 @@ -8,14 +8,13 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; const meta: Meta = { title: 'Pages/Settings/Integrations/SettingsIntegrationDatabase', component: SettingsIntegrationDatabase, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: getSettingsPagePath(SettingsPath.IntegrationDatabase), routeParams: { ':databaseKey': 'postgresql' }, diff --git a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationEditDatabaseConnection.stories.tsx b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationEditDatabaseConnection.stories.tsx index b4d15c7209..00e09088c0 100644 --- a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationEditDatabaseConnection.stories.tsx +++ b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationEditDatabaseConnection.stories.tsx @@ -6,7 +6,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; @@ -14,7 +13,7 @@ const meta: Meta = { title: 'Pages/Settings/Integrations/SettingsIntegrationEditDatabaseConnection', component: SettingsIntegrationEditDatabaseConnection, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/integrations/:databaseKey/edit', routeParams: { diff --git a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationNewDatabaseConnection.stories.tsx b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationNewDatabaseConnection.stories.tsx index 332432a12e..96f5f88f26 100644 --- a/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationNewDatabaseConnection.stories.tsx +++ b/packages/twenty-front/src/pages/settings/integrations/__stories__/SettingsIntegrationNewDatabaseConnection.stories.tsx @@ -6,14 +6,13 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; const meta: Meta = { title: 'Pages/Settings/Integrations/SettingsIntegrationNewDatabaseConnection', component: SettingsIntegrationNewDatabaseConnection, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: '/settings/integrations/:databaseKey/new', routeParams: { ':databaseKey': 'postgresql' }, 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.tsx index ac4d758df8..b81e246101 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 @@ -8,7 +8,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; @@ -16,7 +15,7 @@ const meta: Meta = { title: 'Pages/Settings/Integrations/SettingsIntegrationShowDatabaseConnection', component: SettingsIntegrationShowDatabaseConnection, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: getSettingsPagePath(SettingsPath.IntegrationDatabaseConnection), routeParams: { 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.tsx index 786a19d692..bc11b4f619 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 @@ -8,14 +8,13 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { sleep } from '~/testing/sleep'; const meta: Meta = { title: 'Pages/Settings/Integrations/SettingsIntegrations', component: SettingsIntegrations, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: getSettingsPagePath(SettingsPath.Integrations) }, parameters: { msw: graphqlMocks, diff --git a/packages/twenty-front/src/pages/tasks/__stories__/Tasks.stories.tsx b/packages/twenty-front/src/pages/tasks/__stories__/Tasks.stories.tsx index 9af47c861f..3cef9ef7ed 100644 --- a/packages/twenty-front/src/pages/tasks/__stories__/Tasks.stories.tsx +++ b/packages/twenty-front/src/pages/tasks/__stories__/Tasks.stories.tsx @@ -6,7 +6,6 @@ import { PageDecorator, PageDecoratorArgs, } from '~/testing/decorators/PageDecorator'; -import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockedWorkspaceMemberData } from '~/testing/mock-data/users'; import { sleep } from '~/testing/sleep'; @@ -16,7 +15,7 @@ import { Tasks } from '../Tasks'; const meta: Meta = { title: 'Pages/Tasks/Default', component: Tasks, - decorators: [PrefetchLoadingDecorator, PageDecorator], + decorators: [PageDecorator], args: { routePath: AppPath.TasksPage }, parameters: { msw: { diff --git a/packages/twenty-front/src/testing/decorators/PrefetchLoadingDecorator.tsx b/packages/twenty-front/src/testing/decorators/PrefetchLoadingDecorator.tsx index 0f5c901ffa..12290c724b 100644 --- a/packages/twenty-front/src/testing/decorators/PrefetchLoadingDecorator.tsx +++ b/packages/twenty-front/src/testing/decorators/PrefetchLoadingDecorator.tsx @@ -12,8 +12,8 @@ export const PrefetchLoadingDecorator: Decorator = (Story) => { prefetchIsLoadedFamilyState(PrefetchKey.AllFavorites), ); - setAreViewsPrefetched(true); - setAreFavoritesPrefetched(true); + setAreViewsPrefetched(false); + setAreFavoritesPrefetched(false); return ; }; diff --git a/packages/twenty-front/src/testing/graphqlMocks.ts b/packages/twenty-front/src/testing/graphqlMocks.ts index 00bda770da..60cd918f02 100644 --- a/packages/twenty-front/src/testing/graphqlMocks.ts +++ b/packages/twenty-front/src/testing/graphqlMocks.ts @@ -22,7 +22,9 @@ import { mockedPeopleData } from './mock-data/people'; import { mockedRemoteServers } from './mock-data/remote-servers'; import { mockedViewFieldsData } from './mock-data/view-fields'; -const metadataGraphql = graphql.link(`${REACT_APP_SERVER_BASE_URL}/metadata`); +export const metadataGraphql = graphql.link( + `${REACT_APP_SERVER_BASE_URL}/metadata`, +); export const graphqlMocks = { handlers: [