mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 17:26:36 +00:00
Improve multi-env error message
This commit is contained in:
+10
-4
@@ -175,6 +175,15 @@ export const SelectionPanel = ({
|
|||||||
const results = await Promise.allSettled(promises);
|
const results = await Promise.allSettled(promises);
|
||||||
const areAllEntriesDeleted = results.every((result) => result.status === "fulfilled");
|
const areAllEntriesDeleted = results.every((result) => result.status === "fulfilled");
|
||||||
const areSomeEntriesDeleted = results.some((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) {
|
if (processedEntries === 0) {
|
||||||
handlePopUpClose("bulkDeleteEntries");
|
handlePopUpClose("bulkDeleteEntries");
|
||||||
createNotification({
|
createNotification({
|
||||||
@@ -191,10 +200,7 @@ export const SelectionPanel = ({
|
|||||||
} else if (areSomeEntriesDeleted) {
|
} else if (areSomeEntriesDeleted) {
|
||||||
createNotification({
|
createNotification({
|
||||||
type: "warning",
|
type: "warning",
|
||||||
text: `Successfully deleted selected secrets and folders on environments: ${results
|
text: `Deletion partially completed. The following environments could not be processed due to conflicts: ${failedEnvs.join(", ")}.`
|
||||||
.filter((result) => result.status === "fulfilled")
|
|
||||||
.map((result) => result.value.environment)
|
|
||||||
.join(", ")} but failed on the other environments`
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
createNotification({
|
createNotification({
|
||||||
|
|||||||
Reference in New Issue
Block a user