[ML] Removing alerting_rules from general job list items (#131936) (#131998)

(cherry picked from commit b5737981aa)

Co-authored-by: James Gowdy <jgowdy@elastic.co>
This commit is contained in:
Kibana Machine 2022-05-12 03:23:31 -05:00 committed by GitHub
parent cb782d984c
commit 37c712f8fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,6 +99,14 @@ export function extractJobDetails(job, basePath, refreshJobList) {
return ['', <EditAlertRule initialAlert={v} onSave={refreshJobList} />];
}),
};
if (job.alerting_rules) {
// remove the alerting_rules list from the general section
// so not to show it twice.
const i = general.items.findIndex((item) => item[0] === 'alerting_rules');
if (i >= 0) {
general.items.splice(i, 1);
}
}
const detectors = {
id: 'detectors',