From 70d60105761b560ff8528b82ac2dc21c148d993d Mon Sep 17 00:00:00 2001 From: Tiago Vila Verde Date: Mon, 4 Nov 2024 14:57:32 +0100 Subject: [PATCH] [Entity Store] Add enablement errors to entity store management page (#198668) ## Summary This PR adds callouts for any errors that occur during entity store enablement and deletion from the management page. These are the same callouts as currently seen in the Entity Analytics dashboard. ![Screenshot 2024-11-01 at 13 31 47](https://github.com/user-attachments/assets/162074c2-e977-4e12-a9a1-50efbd7f74b0) (cherry picked from commit 4a0a73674e5f51d4296e121537dd59dd63eef589) --- .../components/dashboard_panels.tsx | 2 +- .../pages/entity_store_management_page.tsx | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_panels.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_panels.tsx index 63ffcf7b9eae1..d70eb9fe34b51 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_panels.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_panels.tsx @@ -55,7 +55,7 @@ const EntityStoreDashboardPanelsComponent = () => { const { mutate: initRiskEngine } = useInitRiskEngineMutation(); - const callouts = entityStore.errors.map((err, i) => ( + const callouts = entityStore.errors.map((err) => ( { stopEntityEngineMutation.isLoading || deleteEntityEngineMutation.isLoading; + const callouts = entityStoreStatus.errors.map((error) => ( + + } + color="danger" + iconType="alert" + > +

{error.message}

+
+ )); + return ( <> { + {initEntityEngineMutation.isError && ( + + } + color="danger" + iconType="alert" + > +

+ {(initEntityEngineMutation.error as { body: { message: string } }).body.message} +

+
+ )} + {deleteEntityEngineMutation.isError && ( + + } + color="danger" + iconType="alert" + > +

+ {(deleteEntityEngineMutation.error as { body: { message: string } }).body.message} +

+
+ )} + {callouts} {!isEntityStoreFeatureFlagDisabled && canDeleteEntityEngine && }