From dadee81175c4bfcdae123f28330df5f2539ee0be Mon Sep 17 00:00:00 2001 From: Paul Rastoin <45004772+prastoin@users.noreply.github.com> Date: Wed, 5 Feb 2025 16:16:13 +0100 Subject: [PATCH] [FEAT] Destroy many Workflow actions (#10028) # Introduction Added destroy many records to the `WorkflowActionConfig` ## Repro: - Filter by deleted workflow - Select mulitple rows - Click on destroy # Pinned action standardization After discussion with @Bonapara and @bosiraphael we landed on a standardization of the pinned actions between `DefaultActionsConfigV2` and `WorkflowActionConfig` which means that now are pinned the `DELETE` and `DESTROY` for both `single/multiple` modes for both features Related to https://github.com/twentyhq/twenty/pull/9991 --- .../constants/WorkflowActionsConfig.ts | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowActionsConfig.ts b/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowActionsConfig.ts index fd94d56d2..b87008a4e 100644 --- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowActionsConfig.ts +++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/WorkflowActionsConfig.ts @@ -1,4 +1,5 @@ import { useDeleteMultipleRecordsAction } from '@/action-menu/actions/record-actions/multiple-records/hooks/useDeleteMultipleRecordsAction'; +import { useDestroyMultipleRecordsAction } from '@/action-menu/actions/record-actions/multiple-records/hooks/useDestroyMultipleRecordsAction'; import { useExportMultipleRecordsAction } from '@/action-menu/actions/record-actions/multiple-records/hooks/useExportMultipleRecordsAction'; import { MultipleRecordsActionKeys } from '@/action-menu/actions/record-actions/multiple-records/types/MultipleRecordsActionKeys'; import { useCreateNewTableRecordNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useCreateNewTableRecordNoSelectionRecordAction'; @@ -192,7 +193,7 @@ export const WORKFLOW_ACTIONS_CONFIG: Record< label: msg`Add to favorites`, shortLabel: msg`Add to favorites`, position: 10, - isPinned: false, + isPinned: true, Icon: IconHeart, availableOn: [ ActionViewType.INDEX_PAGE_SINGLE_RECORD_SELECTION, @@ -224,7 +225,7 @@ export const WORKFLOW_ACTIONS_CONFIG: Record< position: 12, Icon: IconTrash, accent: 'danger', - isPinned: false, + isPinned: true, availableOn: [ ActionViewType.INDEX_PAGE_SINGLE_RECORD_SELECTION, ActionViewType.SHOW_PAGE, @@ -253,7 +254,7 @@ export const WORKFLOW_ACTIONS_CONFIG: Record< position: 14, Icon: IconTrashX, accent: 'danger', - isPinned: false, + isPinned: true, availableOn: [ ActionViewType.INDEX_PAGE_SINGLE_RECORD_SELECTION, ActionViewType.SHOW_PAGE, @@ -286,4 +287,17 @@ export const WORKFLOW_ACTIONS_CONFIG: Record< availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION], useAction: useExportMultipleRecordsAction, }, + destroyMultipleRecords: { + type: ActionMenuEntryType.Standard, + scope: ActionMenuEntryScope.RecordSelection, + key: MultipleRecordsActionKeys.DESTROY, + label: msg`Permanently destroy records`, + shortLabel: msg`Destroy`, + position: 17, + Icon: IconTrashX, + accent: 'danger', + isPinned: true, + availableOn: [ActionViewType.INDEX_PAGE_BULK_SELECTION], + useAction: useDestroyMultipleRecordsAction, + }, };