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

Commit

Permalink
Filter out historical detectors on monitor creation page (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohltyler authored Dec 28, 2020
1 parent 1666076 commit b9cdf6d
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
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

0 comments on commit b9cdf6d

Please sign in to comment.