Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Filter out historical detectors on monitor creation page #229

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -40,12 +40,14 @@ class AnomalyDetectors extends React.Component {
try {
const response = await httpClient.post('../api/alerting/detectors/_search');
if (response.ok) {
const detectorOptions = response.detectors.map((detector) => ({
label: detector.name,
value: detector.id,
features: detector.featureAttributes,
interval: detector.detectionInterval,
}));
const detectorOptions = response.detectors
.filter((detector) => detector.detectionDateRange === undefined)
.map((detector) => ({
label: detector.name,
value: detector.id,
features: detector.featureAttributes,
interval: detector.detectionInterval,
}));
this.setState({ detectorOptions });
} else {
// TODO: 'response.ok' is 'false' when there is no anomaly-detection config index in the cluster, and notification should not be shown to new Anomaly-Detection users
Expand Down