Skip to content

Commit

Permalink
[Entity Store] Add enablement errors to entity store management page (e…
Browse files Browse the repository at this point in the history
…lastic#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 4a0a736)
  • Loading branch information
tiansivive committed Nov 4, 2024
1 parent 0f9cfea commit 2234c2f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const EntityStoreDashboardPanelsComponent = () => {

const { mutate: initRiskEngine } = useInitRiskEngineMutation();

const callouts = entityStore.errors.map((err, i) => (
const callouts = entityStore.errors.map((err) => (
<EuiCallOut
title={
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,21 @@ export const EntityStoreManagementPage = () => {
stopEntityEngineMutation.isLoading ||
deleteEntityEngineMutation.isLoading;

const callouts = entityStoreStatus.errors.map((error) => (
<EuiCallOut
title={
<FormattedMessage
id="xpack.securitySolution.entityAnalytics.entityStoreManagementPage.errors.title"
defaultMessage={'An error occurred during entity store resource initialization'}
/>
}
color="danger"
iconType="alert"
>
<p>{error.message}</p>
</EuiCallOut>
));

return (
<>
<EuiPageHeader
Expand Down Expand Up @@ -300,6 +315,39 @@ export const EntityStoreManagementPage = () => {
<FileUploadSection />
<EuiFlexItem grow={2}>
<EuiFlexGroup direction="column">
{initEntityEngineMutation.isError && (
<EuiCallOut
title={
<FormattedMessage
id="xpack.securitySolution.entityAnalytics.entityStoreManagementPage.errors.initErrorTitle"
defaultMessage={'There was a problem initializing the entity store'}
/>
}
color="danger"
iconType="alert"
>
<p>
{(initEntityEngineMutation.error as { body: { message: string } }).body.message}
</p>
</EuiCallOut>
)}
{deleteEntityEngineMutation.isError && (
<EuiCallOut
title={
<FormattedMessage
id="xpack.securitySolution.entityAnalytics.entityStoreManagementPage.errors.deleteErrorTitle"
defaultMessage={'There was a problem deleting the entity store'}
/>
}
color="danger"
iconType="alert"
>
<p>
{(deleteEntityEngineMutation.error as { body: { message: string } }).body.message}
</p>
</EuiCallOut>
)}
{callouts}
<WhatIsAssetCriticalityPanel />
{!isEntityStoreFeatureFlagDisabled && canDeleteEntityEngine && <ClearEntityDataPanel />}
</EuiFlexGroup>
Expand Down

0 comments on commit 2234c2f

Please sign in to comment.