[FEAT] RecordAction destroy many record (#9991)
# Introduction Added the `RecordAction` destroy multiple record ## Repro Select multiples `deletedRecords`, you should be able to see the `Destroy` pinned CTA ( iso short label with the destroy one ), open control panel and fin new CTA `Permanently delete records` https://github.com/user-attachments/assets/31ee8738-9d61-4dec-9a1f-41bb6785e018 ## TODO - [ ] Gain granularity within tests to assert the action should be registered only when filtering by deleted ## Conclusion Closes https://github.com/twentyhq/core-team-issues/issues/110
This commit is contained in:
@ -1,23 +1,22 @@
|
||||
import { ActionMenuComponentInstanceContext } from '@/action-menu/states/contexts/ActionMenuComponentInstanceContext';
|
||||
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
|
||||
import { ContextStoreTargetedRecordsRule } from '@/context-store/states/contextStoreTargetedRecordsRuleComponentState';
|
||||
import { RecordFiltersComponentInstanceContext } from '@/object-record/record-filter/states/context/RecordFiltersComponentInstanceContext';
|
||||
import { MockedResponse } from '@apollo/client/testing';
|
||||
import { ReactNode } from 'react';
|
||||
import { MutableSnapshot } from 'recoil';
|
||||
import { getJestMetadataAndApolloMocksWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksWrapper';
|
||||
import { JestContextStoreSetter } from '~/testing/jest/JestContextStoreSetter';
|
||||
import {
|
||||
JestContextStoreSetter,
|
||||
JestContextStoreSetterMocks,
|
||||
} from '~/testing/jest/JestContextStoreSetter';
|
||||
|
||||
export type GetJestMetadataAndApolloMocksAndActionMenuWrapperProps = {
|
||||
apolloMocks:
|
||||
| readonly MockedResponse<Record<string, any>, Record<string, any>>[]
|
||||
| undefined;
|
||||
onInitializeRecoilSnapshot?: (snapshot: MutableSnapshot) => void;
|
||||
contextStoreTargetedRecordsRule?: ContextStoreTargetedRecordsRule;
|
||||
contextStoreNumberOfSelectedRecords?: number;
|
||||
contextStoreCurrentObjectMetadataNameSingular?: string;
|
||||
componentInstanceId: string;
|
||||
};
|
||||
} & JestContextStoreSetterMocks;
|
||||
|
||||
export const getJestMetadataAndApolloMocksAndActionMenuWrapper = ({
|
||||
apolloMocks,
|
||||
@ -25,6 +24,7 @@ export const getJestMetadataAndApolloMocksAndActionMenuWrapper = ({
|
||||
contextStoreTargetedRecordsRule,
|
||||
contextStoreNumberOfSelectedRecords,
|
||||
contextStoreCurrentObjectMetadataNameSingular,
|
||||
contextStoreFilters,
|
||||
componentInstanceId,
|
||||
}: GetJestMetadataAndApolloMocksAndActionMenuWrapperProps) => {
|
||||
const Wrapper = getJestMetadataAndApolloMocksWrapper({
|
||||
@ -48,6 +48,7 @@ export const getJestMetadataAndApolloMocksAndActionMenuWrapper = ({
|
||||
}}
|
||||
>
|
||||
<JestContextStoreSetter
|
||||
contextStoreFilters={contextStoreFilters}
|
||||
contextStoreTargetedRecordsRule={contextStoreTargetedRecordsRule}
|
||||
contextStoreNumberOfSelectedRecords={
|
||||
contextStoreNumberOfSelectedRecords
|
||||
|
||||
Reference in New Issue
Block a user