Skip to content

Commit

Permalink
[8.x] [Entity Store] Add enablement errors to entity store management…
Browse files Browse the repository at this point in the history
… page (#198668) (#198785)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Entity Store] Add enablement errors to entity store management page
(#198668)](#198668)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tiago Vila
Verde","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-04T13:57:32Z","message":"[Entity
Store] Add enablement errors to entity store management page
(#198668)\n\n## Summary\r\n\r\nThis PR adds callouts for any errors that
occur during entity store\r\nenablement and deletion from the management
page. These are the same\r\ncallouts as currently seen in the Entity
Analytics dashboard.\r\n\r\n![Screenshot 2024-11-01 at 13
31\r\n47](https://github.com/user-attachments/assets/162074c2-e977-4e12-a9a1-50efbd7f74b0)","sha":"4a0a73674e5f51d4296e121537dd59dd63eef589","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Entity
Analytics","v8.16.0","backport:version","v8.17.0"],"title":"[Entity
Store] Add enablement errors to entity store management
page","number":198668,"url":"https://github.com/elastic/kibana/pull/198668","mergeCommit":{"message":"[Entity
Store] Add enablement errors to entity store management page
(#198668)\n\n## Summary\r\n\r\nThis PR adds callouts for any errors that
occur during entity store\r\nenablement and deletion from the management
page. These are the same\r\ncallouts as currently seen in the Entity
Analytics dashboard.\r\n\r\n![Screenshot 2024-11-01 at 13
31\r\n47](https://github.com/user-attachments/assets/162074c2-e977-4e12-a9a1-50efbd7f74b0)","sha":"4a0a73674e5f51d4296e121537dd59dd63eef589"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198668","number":198668,"mergeCommit":{"message":"[Entity
Store] Add enablement errors to entity store management page
(#198668)\n\n## Summary\r\n\r\nThis PR adds callouts for any errors that
occur during entity store\r\nenablement and deletion from the management
page. These are the same\r\ncallouts as currently seen in the Entity
Analytics dashboard.\r\n\r\n![Screenshot 2024-11-01 at 13
31\r\n47](https://github.com/user-attachments/assets/162074c2-e977-4e12-a9a1-50efbd7f74b0)","sha":"4a0a73674e5f51d4296e121537dd59dd63eef589"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Tiago Vila Verde <[email protected]>
  • Loading branch information
kibanamachine and tiansivive authored Nov 8, 2024
1 parent d46d04a commit 8a81c04
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 @@ -256,6 +256,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 @@ -312,6 +327,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 &&
privileges?.has_all_required &&
Expand Down

0 comments on commit 8a81c04

Please sign in to comment.