Add base form action without logic (#10811)
<img width="1298" alt="Capture d’écran 2025-03-12 à 15 32 27" src="https://github.com/user-attachments/assets/8a3140e5-e165-445e-a718-748aa76b525c" />
This commit is contained in:
@ -26,27 +26,12 @@ import { RecordFiltersComponentInstanceContext } from '@/object-record/record-fi
|
||||
import { RecordSortsComponentInstanceContext } from '@/object-record/record-sort/states/context/RecordSortsComponentInstanceContext';
|
||||
import { HttpResponse, graphql } from 'msw';
|
||||
import { IconDotsVertical } from 'twenty-ui';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';
|
||||
import { JestContextStoreSetter } from '~/testing/jest/JestContextStoreSetter';
|
||||
import { CommandMenu } from '../CommandMenu';
|
||||
|
||||
const openTimeout = 50;
|
||||
|
||||
// Mock workspace with feature flag enabled
|
||||
const mockWorkspaceWithFeatureFlag = {
|
||||
...mockCurrentWorkspace,
|
||||
featureFlags: [
|
||||
...(mockCurrentWorkspace.featureFlags || []),
|
||||
{
|
||||
id: 'mock-id',
|
||||
key: FeatureFlagKey.IsCommandMenuV2Enabled,
|
||||
value: true,
|
||||
workspaceId: mockCurrentWorkspace.id,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const ContextStoreDecorator: Decorator = (Story) => {
|
||||
return (
|
||||
<RecordFilterGroupsComponentInstanceContext.Provider
|
||||
@ -92,7 +77,7 @@ const meta: Meta<typeof CommandMenu> = {
|
||||
commandMenuNavigationStackState,
|
||||
);
|
||||
|
||||
setCurrentWorkspace(mockWorkspaceWithFeatureFlag);
|
||||
setCurrentWorkspace(mockCurrentWorkspace);
|
||||
setCurrentWorkspaceMember(mockedWorkspaceMemberData);
|
||||
setIsCommandMenuOpened(true);
|
||||
setCommandMenuNavigationStack([
|
||||
|
||||
@ -4,7 +4,9 @@ import { RightDrawerWorkflowSelectStepTitle } from '@/workflow/workflow-steps/co
|
||||
import { useCreateStep } from '@/workflow/workflow-steps/hooks/useCreateStep';
|
||||
import { OTHER_ACTIONS } from '@/workflow/workflow-steps/workflow-actions/constants/OtherActions';
|
||||
import { RECORD_ACTIONS } from '@/workflow/workflow-steps/workflow-actions/constants/RecordActions';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { MenuItemCommand, useIcons } from 'twenty-ui';
|
||||
import { FeatureFlagKey } from '~/generated-metadata/graphql';
|
||||
|
||||
export const CommandMenuWorkflowSelectActionContent = ({
|
||||
workflow,
|
||||
@ -15,6 +17,9 @@ export const CommandMenuWorkflowSelectActionContent = ({
|
||||
const { createStep } = useCreateStep({
|
||||
workflow,
|
||||
});
|
||||
const isWorkflowFormActionEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IsWorkflowFormActionEnabled,
|
||||
);
|
||||
|
||||
return (
|
||||
<RightDrawerStepListContainer>
|
||||
@ -32,7 +37,9 @@ export const CommandMenuWorkflowSelectActionContent = ({
|
||||
<RightDrawerWorkflowSelectStepTitle>
|
||||
Other
|
||||
</RightDrawerWorkflowSelectStepTitle>
|
||||
{OTHER_ACTIONS.map((action) => (
|
||||
{OTHER_ACTIONS.filter(
|
||||
(action) => isWorkflowFormActionEnabled || action.type !== 'FORM',
|
||||
).map((action) => (
|
||||
<MenuItemCommand
|
||||
key={action.type}
|
||||
LeftIcon={getIcon(action.icon)}
|
||||
|
||||
Reference in New Issue
Block a user