From efffac2a1aa1810865dea7b440b6f06febd4dad4 Mon Sep 17 00:00:00 2001 From: Ajay A Adsule <103304466+AjayAdsule@users.noreply.github.com> Date: Tue, 13 May 2025 17:30:15 +0530 Subject: [PATCH] Deleted view disable delete btn (#11990) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR updates the defaultRecordActionConfig for the SingleRecordActionKeys.DELETE action. A condition !isSoftDeleteFilterActive was added to the shouldBeRegistered function to ensure the delete button is only visible when the deleted records view is not selected. This prevents the delete button from appearing when viewing deleted records. #11974 ![Screenshot 2025-05-12 at 9 41 30 PM](https://github.com/user-attachments/assets/ab7c1f61-d5ab-4315-9f39-50108d11438c) ![Screenshot 2025-05-12 at 9 42 11 PM](https://github.com/user-attachments/assets/82a9843b-4d5e-406c-8186-dce5b7b16bf3) --- .../record-actions/constants/DefaultRecordActionsConfig.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/DefaultRecordActionsConfig.tsx b/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/DefaultRecordActionsConfig.tsx index 98d12d6a0..4876d3401 100644 --- a/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/DefaultRecordActionsConfig.tsx +++ b/packages/twenty-front/src/modules/action-menu/actions/record-actions/constants/DefaultRecordActionsConfig.tsx @@ -180,8 +180,10 @@ export const DEFAULT_RECORD_ACTIONS_CONFIG: Record< Icon: IconTrash, accent: 'default', isPinned: true, - shouldBeRegistered: ({ selectedRecord }) => - isDefined(selectedRecord) && !selectedRecord.isRemote, + shouldBeRegistered: ({ selectedRecord, isSoftDeleteFilterActive }) => + isDefined(selectedRecord) && + !selectedRecord.isRemote && + !isSoftDeleteFilterActive, availableOn: [ ActionViewType.INDEX_PAGE_SINGLE_RECORD_SELECTION, ActionViewType.SHOW_PAGE,