Skip to content

Commit 177e416

Browse files
committed
fixup
1 parent 72e9146 commit 177e416

File tree

1 file changed

+30
-29
lines changed

1 file changed

+30
-29
lines changed

x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_health_callout.tsx

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { i18n } from '@kbn/i18n';
1111
import { FormattedMessage } from '@kbn/i18n-react';
1212
import kbnRison from '@kbn/rison';
1313
import type { SLOWithSummaryResponse } from '@kbn/slo-schema';
14-
import { values } from 'lodash';
1514
import React from 'react';
1615
import { getSLOSummaryTransformId, getSLOTransformId } from '../../../../common/constants';
1716
import { useActionModal } from '../../../context/action_modal';
@@ -85,20 +84,21 @@ export function SloHealthCallout({ slo }: { slo: SLOWithSummaryResponse }) {
8584
values={{ count }}
8685
/>
8786
<ul>
88-
{(rollup.unhealthy || rollup.stopped) && !!rollupUrl && (
89-
<li>
90-
<ContentWithInspectCta
91-
textSize="s"
92-
content={
93-
rollup.unhealthy
94-
? getUnhealthyText(rollupTransformId)
95-
: getStoppedText(rollupTransformId)
96-
}
97-
url={rollupUrl}
98-
/>
99-
</li>
100-
)}
101-
{rollup.missing && (
87+
{(health.rollup.status === 'unhealthy' || health.rollup.stateMatches === false) &&
88+
!!rollupUrl && (
89+
<li>
90+
<ContentWithInspectCta
91+
textSize="s"
92+
content={
93+
health.rollup.status === 'unhealthy'
94+
? getUnhealthyText(rollupTransformId)
95+
: getStoppedText(rollupTransformId) // TODO: Change here based on stateMatches and SLO.enabled
96+
}
97+
url={rollupUrl}
98+
/>
99+
</li>
100+
)}
101+
{health.rollup.missing && (
102102
<li>
103103
<ContentWithResetCta
104104
textSize="s"
@@ -108,20 +108,21 @@ export function SloHealthCallout({ slo }: { slo: SLOWithSummaryResponse }) {
108108
</li>
109109
)}
110110

111-
{(summary.unhealthy || summary.stopped) && !!summaryUrl && (
112-
<li>
113-
<ContentWithInspectCta
114-
textSize="s"
115-
content={
116-
summary.unhealthy
117-
? getUnhealthyText(summaryTransformId)
118-
: getStoppedText(summaryTransformId)
119-
}
120-
url={summaryUrl}
121-
/>
122-
</li>
123-
)}
124-
{summary.missing && (
111+
{(health.summary.status === 'unhealthy' || health.summary.stateMatches === false) &&
112+
!!summaryUrl && (
113+
<li>
114+
<ContentWithInspectCta
115+
textSize="s"
116+
content={
117+
health.summary.status === 'unhealthy'
118+
? getUnhealthyText(summaryTransformId)
119+
: getStoppedText(summaryTransformId)
120+
}
121+
url={summaryUrl}
122+
/>
123+
</li>
124+
)}
125+
{health.summary.missing && (
125126
<li>
126127
<ContentWithResetCta
127128
textSize="s"

0 commit comments

Comments
 (0)