show No anomalies found instead of empty cells (#141098)

This commit is contained in:
Dima Arnautov 2022-09-20 18:30:08 +02:00 committed by GitHub
parent e46863227f
commit 6dcaa00ebf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,19 +93,14 @@ export const AnomalyDetectionTable: FC<Props> = ({ items, statsBarData, chartsSe
if (!swimLaneData) return null;
const hasResults = swimLaneData.points.length > 0;
const noDatWarning = hasResults ? (
<FormattedMessage
id="xpack.ml.overview.anomalyDetection.noAnomaliesFoundMessage"
defaultMessage="No anomalies found"
/>
) : (
<FormattedMessage
id="xpack.ml.overview.anomalyDetection.noResultsFoundMessage"
defaultMessage="No results found"
/>
);
if (swimLaneData.points.length > 0 && swimLaneData.points.every((v) => v.value === 0)) {
return (
<FormattedMessage
id="xpack.ml.overview.anomalyDetection.noAnomaliesFoundMessage"
defaultMessage="No anomalies found"
/>
);
}
return (
<SwimlaneContainer
@ -118,7 +113,12 @@ export const AnomalyDetectionTable: FC<Props> = ({ items, statsBarData, chartsSe
showTimeline={false}
showYAxis={false}
showLegend={false}
noDataWarning={noDatWarning}
noDataWarning={
<FormattedMessage
id="xpack.ml.overview.anomalyDetection.noResultsFoundMessage"
defaultMessage="No results found"
/>
}
chartsService={chartsService}
/>
);