Optimize table loading (#866)
* wip * wip * Ok * Deleted unused code * Fixed lint * Minor fixes * Minor fixes * Minor Fixes * Minor merge fixes * Ok * Fix storybook tests * Removed console.log * Fix login * asd * Fixed storybook * Added await * Fixed await * Added sleep for failing test * Fix sleep * Fix test * Fix tests --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,13 +1,12 @@
|
||||
import { Decorator } from '@storybook/react';
|
||||
|
||||
import { RecoilScope } from '../../modules/ui/recoil-scope/components/RecoilScope';
|
||||
import { CellContext } from '../../modules/ui/table/states/CellContext';
|
||||
import { RowContext } from '../../modules/ui/table/states/RowContext';
|
||||
import { ColumnIndexContext } from '../../modules/ui/table/states/ColumnIndexContext';
|
||||
import { RowIndexContext } from '../../modules/ui/table/states/RowIndexContext';
|
||||
|
||||
export const CellPositionDecorator: Decorator = (Story) => (
|
||||
<RecoilScope SpecificContext={RowContext}>
|
||||
<RecoilScope SpecificContext={CellContext}>
|
||||
<RowIndexContext.Provider value={1}>
|
||||
<ColumnIndexContext.Provider value={1}>
|
||||
<Story />
|
||||
</RecoilScope>
|
||||
</RecoilScope>
|
||||
</ColumnIndexContext.Provider>
|
||||
</RowIndexContext.Provider>
|
||||
);
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
import { HotkeysProvider } from 'react-hotkeys-hook';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { Decorator } from '@storybook/react';
|
||||
|
||||
import { ClientConfigProvider } from '../../modules/client-config/components/ClientConfigProvider';
|
||||
import { INITIAL_HOTKEYS_SCOPES } from '../../modules/ui/hotkey/constants';
|
||||
import { DefaultLayout } from '../../modules/ui/layout/components/DefaultLayout';
|
||||
import { UserProvider } from '../../modules/users/components/UserProvider';
|
||||
import { ClientConfigProvider } from '~/modules/client-config/components/ClientConfigProvider';
|
||||
import { DefaultLayout } from '~/modules/ui/layout/components/DefaultLayout';
|
||||
import { UserProvider } from '~/modules/users/components/UserProvider';
|
||||
|
||||
import { FullHeightStorybookLayout } from '../FullHeightStorybookLayout';
|
||||
|
||||
export type PageDecoratorArgs = { currentPath: string };
|
||||
@ -16,15 +15,13 @@ export const PageDecorator: Decorator<{ currentPath: string }> = (
|
||||
) => (
|
||||
<UserProvider>
|
||||
<ClientConfigProvider>
|
||||
<HotkeysProvider initiallyActiveScopes={INITIAL_HOTKEYS_SCOPES}>
|
||||
<MemoryRouter initialEntries={[args.currentPath]}>
|
||||
<FullHeightStorybookLayout>
|
||||
<DefaultLayout>
|
||||
<Story />
|
||||
</DefaultLayout>
|
||||
</FullHeightStorybookLayout>
|
||||
</MemoryRouter>
|
||||
</HotkeysProvider>
|
||||
<MemoryRouter initialEntries={[args.currentPath]}>
|
||||
<FullHeightStorybookLayout>
|
||||
<DefaultLayout>
|
||||
<Story />
|
||||
</DefaultLayout>
|
||||
</FullHeightStorybookLayout>
|
||||
</MemoryRouter>
|
||||
</ClientConfigProvider>
|
||||
</UserProvider>
|
||||
);
|
||||
|
||||
@ -2,11 +2,13 @@ import { ApolloProvider } from '@apollo/client';
|
||||
import { Decorator } from '@storybook/react';
|
||||
import { RecoilRoot } from 'recoil';
|
||||
|
||||
import { InitializeHotkeyStorybookHook } from '../InitializeHotkeyStorybookHook';
|
||||
import { mockedClient } from '../mockedClient';
|
||||
|
||||
export const RootDecorator: Decorator = (Story) => (
|
||||
<RecoilRoot>
|
||||
<ApolloProvider client={mockedClient}>
|
||||
<InitializeHotkeyStorybookHook />
|
||||
<Story />
|
||||
</ApolloProvider>
|
||||
</RecoilRoot>
|
||||
|
||||
Reference in New Issue
Block a user