From a1c44bd7a20ad0fcb4e7363738ce3f837a5e8b17 Mon Sep 17 00:00:00 2001 From: Carlos Monastyrski Date: Wed, 2 Jul 2025 17:40:37 -0300 Subject: [PATCH] Improve multi-env error message --- .../components/SelectionPanel/SelectionPanel.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/SelectionPanel.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/SelectionPanel.tsx index aa5fa4e2c..1adc59b38 100644 --- a/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/SelectionPanel.tsx +++ b/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/SelectionPanel.tsx @@ -175,6 +175,15 @@ export const SelectionPanel = ({ const results = await Promise.allSettled(promises); const areAllEntriesDeleted = results.every((result) => result.status === "fulfilled"); const areSomeEntriesDeleted = results.some((result) => result.status === "fulfilled"); + + const failedEnvs = userAvailableEnvs + .filter( + (env) => + !results.some( + (result) => result.status === "fulfilled" && result.value.environment === env.slug + ) + ) + .map((env) => env.slug); if (processedEntries === 0) { handlePopUpClose("bulkDeleteEntries"); createNotification({ @@ -191,10 +200,7 @@ export const SelectionPanel = ({ } else if (areSomeEntriesDeleted) { createNotification({ type: "warning", - text: `Successfully deleted selected secrets and folders on environments: ${results - .filter((result) => result.status === "fulfilled") - .map((result) => result.value.environment) - .join(", ")} but failed on the other environments` + text: `Deletion partially completed. The following environments could not be processed due to conflicts: ${failedEnvs.join(", ")}.` }); } else { createNotification({