From d166e01176226619504df8f3b59e4438759c185b Mon Sep 17 00:00:00 2001 From: somebody1234 Date: Fri, 13 Dec 2024 16:48:58 +1000 Subject: [PATCH] Edit text for "delete asset" modal --- app/common/src/text/english.json | 4 ++- app/common/src/text/index.ts | 2 ++ .../dashboard/layouts/AssetContextMenu.tsx | 3 ++- .../layouts/AssetsTableContextMenu.tsx | 2 +- .../dashboard/modals/ConfirmDeleteModal.tsx | 25 ++++++++++++------- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/app/common/src/text/english.json b/app/common/src/text/english.json index a89c0135bc24..32e6d5d1bb5d 100644 --- a/app/common/src/text/english.json +++ b/app/common/src/text/english.json @@ -400,6 +400,7 @@ "thisFolderFailedToFetch": "This folder failed to fetch.", "yourTrashIsEmpty": "Your trash is empty.", "deleteTheAssetTypeTitle": "delete the $0 '$1'", + "deleteTheAssetTypeTitleForever": "permanently delete the $0 '$1'", "trashTheAssetTypeTitle": "move the $0 '$1' to Trash", "notImplemetedYet": "Not implemented yet.", "newLabelButtonLabel": "New label", @@ -445,7 +446,8 @@ "youHaveNoRecentProjects": "You have no recent projects. Switch to another category to create a project.", "youHaveNoFiles": "This folder is empty. You can create a project using the buttons above.", "placeholderChatPrompt": "Login or register to access live chat with our support team.", - "confirmPrompt": "Are you sure you want to $0?", + "confirmPrompt": "Do you really want to $0?", + "confirmPromptCannotUndo": "Do you really want to $0? This operation is final and cannot be undone.", "couldNotInviteUser": "Could not invite user $0", "inviteFormSeatsLeft": "You have $0 seats left on your plan. Upgrade to invite more", "inviteFormSeatsLeftError": "You have exceed the number of seats on your plan by $0", diff --git a/app/common/src/text/index.ts b/app/common/src/text/index.ts index 8c532137d50e..1a3eb3d03354 100644 --- a/app/common/src/text/index.ts +++ b/app/common/src/text/index.ts @@ -43,8 +43,10 @@ interface PlaceholderOverrides { readonly deleteUserGroupActionText: [groupName: string] readonly removeUserFromUserGroupActionText: [userName: string, groupName: string] readonly confirmPrompt: [action: string] + readonly confirmPromptCannotUndo: [action: string] readonly trashTheAssetTypeTitle: [assetType: string, assetName: string] readonly deleteTheAssetTypeTitle: [assetType: string, assetName: string] + readonly deleteTheAssetTypeTitleForever: [assetType: string, assetName: string] readonly couldNotInviteUser: [userEmail: string] readonly filesWithoutConflicts: [fileCount: number] readonly projectsWithoutConflicts: [projectCount: number] diff --git a/app/gui/src/dashboard/layouts/AssetContextMenu.tsx b/app/gui/src/dashboard/layouts/AssetContextMenu.tsx index 440ac70788e3..753fb7bbb945 100644 --- a/app/gui/src/dashboard/layouts/AssetContextMenu.tsx +++ b/app/gui/src/dashboard/layouts/AssetContextMenu.tsx @@ -209,7 +209,8 @@ export default function AssetContextMenu(props: AssetContextMenuProps) { setModal( { const ids = new Set([asset.id]) dispatchAssetEvent({ type: AssetEventType.deleteForever, ids }) diff --git a/app/gui/src/dashboard/layouts/AssetsTableContextMenu.tsx b/app/gui/src/dashboard/layouts/AssetsTableContextMenu.tsx index 09c5496f9bd5..b0f43adfd313 100644 --- a/app/gui/src/dashboard/layouts/AssetsTableContextMenu.tsx +++ b/app/gui/src/dashboard/layouts/AssetsTableContextMenu.tsx @@ -155,7 +155,7 @@ export default function AssetsTableContextMenu(props: AssetsTableContextMenuProp if (category.type === 'trash') { return ( - selectedKeys.size !== 0 && ( + selectedKeys.size > 1 && (