Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SecuritySolution] Fix dashboard page when the entity store state is stopped #198645

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -141,6 +141,7 @@ const EntityStoreDashboardPanelsComponent = () => {
);
}

// TODO Rename variable because the Risk score could be installed but disabled
const isRiskScoreAvailable =
riskEngineStatus.data &&
riskEngineStatus.data.risk_engine_status !== RiskEngineStatusEnum.NOT_INSTALLED;
@@ -199,35 +200,37 @@ const EntityStoreDashboardPanelsComponent = () => {
</>
)}

{entityStore.status === 'not_installed' && !isRiskScoreAvailable && (
// TODO: Move modal inside EnableEntityStore component, eliminating the onEnable prop in favour of forwarding the riskScoreEnabled status
<EnableEntityStore
enablements="both"
onEnable={() => setModalState({ visible: true })}
loadingRiskEngine={riskEngineInitializing}
/>
)}
{(entityStore.status === 'not_installed' || entityStore.status === 'stopped') &&
Copy link
Member Author

@machadoum machadoum Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff is weird. But this is the only change I made here: || entityStore.status === 'stopped'

!isRiskScoreAvailable && (
// TODO: Move modal inside EnableEntityStore component, eliminating the onEnable prop in favour of forwarding the riskScoreEnabled status
<EnableEntityStore
enablements="both"
onEnable={() => setModalState({ visible: true })}
loadingRiskEngine={riskEngineInitializing}
/>
)}

{entityStore.status === 'not_installed' && isRiskScoreAvailable && (
<>
<EuiFlexItem>
<EnableEntityStore
enablements="store"
onEnable={() =>
setModalState({
visible: true,
})
}
/>
</EuiFlexItem>
<EuiFlexItem>
<EntityAnalyticsRiskScores riskEntity={RiskScoreEntity.user} />
</EuiFlexItem>
<EuiFlexItem>
<EntityAnalyticsRiskScores riskEntity={RiskScoreEntity.host} />
</EuiFlexItem>
</>
)}
{(entityStore.status === 'not_installed' || entityStore.status === 'stopped') &&
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff is weird. But this is the only change I made here: || entityStore.status === 'stopped'

isRiskScoreAvailable && (
<>
<EuiFlexItem>
<EnableEntityStore
enablements="store"
onEnable={() =>
setModalState({
visible: true,
})
}
/>
</EuiFlexItem>
<EuiFlexItem>
<EntityAnalyticsRiskScores riskEntity={RiskScoreEntity.user} />
</EuiFlexItem>
<EuiFlexItem>
<EntityAnalyticsRiskScores riskEntity={RiskScoreEntity.host} />
</EuiFlexItem>
</>
)}

<EntityStoreEnablementModal
visible={modal.visible}