[COMMAND MENU ITEMS] Remove deprecated code (#19199)

This PR is the first one of a cleanup after upgrading command menu items
to V2.
This commit is contained in:
Raphaël Bosi
2026-04-01 17:56:52 +02:00
committed by GitHub
parent e6fe48b66d
commit 9f95c4763c
137 changed files with 2216 additions and 6613 deletions
@@ -7,11 +7,13 @@ import { expect, userEvent, waitFor, within } from 'storybook/test';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { metadataStoreState } from '@/metadata-store/states/metadataStoreState';
import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';
import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';
import { graphqlMocks } from '~/testing/graphqlMocks';
import { mockedBackendCommandMenuItems } from '~/testing/mock-data/command-menu-items';
import {
mockCurrentWorkspace,
mockedLimitedPermissionsUserData,
@@ -40,7 +42,6 @@ import { sidePanelPageState } from '@/side-panel/states/sidePanelPageState';
import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
import { HttpResponse, graphql } from 'msw';
import { SidePanelPages } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconDotsVertical, IconPlus } from 'twenty-ui/display';
import { JestContextStoreSetter } from '~/testing/jest/JestContextStoreSetter';
@@ -80,6 +81,11 @@ const meta: Meta<typeof SidePanelRootPage> = {
decorators: [
(Story) => {
jotaiStore.set(currentWorkspaceState.atom, mockCurrentWorkspace);
jotaiStore.set(metadataStoreState.atomFamily('commandMenuItems'), {
current: mockedBackendCommandMenuItems,
draft: [],
status: 'up-to-date',
});
jotaiStore.set(
currentWorkspaceMemberState.atom,
mockedWorkspaceMemberData,
@@ -108,21 +114,24 @@ const meta: Meta<typeof SidePanelRootPage> = {
const companyMetadataItem = objectMetadataItems.find(
(item) => item.nameSingular === 'company',
);
if (isDefined(companyMetadataItem)) {
jotaiStore.set(
contextStoreCurrentObjectMetadataItemIdComponentState.atomFamily({
instanceId: MAIN_CONTEXT_STORE_INSTANCE_ID,
}),
companyMetadataItem.id,
);
jotaiStore.set(
contextStoreCurrentViewTypeComponentState.atomFamily({
instanceId: MAIN_CONTEXT_STORE_INSTANCE_ID,
}),
ContextStoreViewType.Table,
);
if (companyMetadataItem === undefined) {
return <Story />;
}
jotaiStore.set(
contextStoreCurrentObjectMetadataItemIdComponentState.atomFamily({
instanceId: MAIN_CONTEXT_STORE_INSTANCE_ID,
}),
companyMetadataItem.id,
);
jotaiStore.set(
contextStoreCurrentViewTypeComponentState.atomFamily({
instanceId: MAIN_CONTEXT_STORE_INSTANCE_ID,
}),
ContextStoreViewType.Table,
);
return <Story />;
},
ContextStoreDecorator,
@@ -215,8 +224,6 @@ export const NoResultsSearchFallback: Story = {
await sleep(openTimeout);
await userEvent.type(searchInput, 'input without results');
expect(await canvas.findByText('No results found')).toBeVisible();
const searchRecordsButton = await canvas.findByText('Search records');
expect(searchRecordsButton).toBeVisible();
},
parameters: {
msw: {