[ML] Keep the edit rule flyout open if there are multiple rules (#68174)
This commit is contained in:
parent
c5546f4a39
commit
a8f04f8304
5 changed files with 11 additions and 10 deletions
|
@ -402,7 +402,14 @@ class RuleEditorFlyoutUI extends Component {
|
|||
}
|
||||
)
|
||||
);
|
||||
this.closeFlyout();
|
||||
const updatedJob = mlJobService.getJob(anomaly.jobId);
|
||||
const updatedDetector = updatedJob.analysis_config.detectors[detectorIndex];
|
||||
const updatedRules = updatedDetector.custom_rules;
|
||||
if (!updatedRules) {
|
||||
this.closeFlyout();
|
||||
} else {
|
||||
this.setState({ job: { ...updatedJob } });
|
||||
}
|
||||
} else {
|
||||
toasts.addDanger(
|
||||
i18n.translate(
|
||||
|
|
|
@ -32,7 +32,7 @@ export function SelectRuleAction({
|
|||
if (rules.length > 0) {
|
||||
ruleActionPanels = rules.map((rule, index) => {
|
||||
return (
|
||||
<React.Fragment key={`rule_panel_${index}`}>
|
||||
<React.Fragment key={`rule_panel_${index}_${rules.length}`}>
|
||||
<RuleActionPanel
|
||||
job={job}
|
||||
ruleIndex={index}
|
||||
|
|
|
@ -518,7 +518,6 @@ function processRecordsForDisplay(anomalyRecords) {
|
|||
}
|
||||
});
|
||||
|
||||
console.log('explorer charts aggregatedData is:', aggregatedData);
|
||||
let recordsForSeries = [];
|
||||
// Convert to an array of the records with the highest record_score per unique series.
|
||||
_.each(aggregatedData, (detectorsForJob) => {
|
||||
|
|
|
@ -715,7 +715,6 @@ export async function loadDataForCharts(
|
|||
(selectedCells !== undefined && Object.keys(selectedCells).length > 0) ||
|
||||
influencersFilterQuery !== undefined
|
||||
) {
|
||||
console.log('Explorer anomaly charts data set:', resp.records);
|
||||
resolve(resp.records);
|
||||
}
|
||||
|
||||
|
@ -764,7 +763,6 @@ export function loadOverallData(selectedJobs, interval, bounds) {
|
|||
interval.asSeconds()
|
||||
);
|
||||
|
||||
console.log('Explorer overall swimlane data set:', overallSwimlaneData);
|
||||
resolve({
|
||||
loading: false,
|
||||
overallSwimlaneData,
|
||||
|
@ -795,7 +793,6 @@ export function loadViewBySwimlane(
|
|||
getSwimlaneContainerWidth(noInfluencersConfigured)
|
||||
).asSeconds()
|
||||
);
|
||||
console.log('Explorer view by swimlane data set:', viewBySwimlaneData);
|
||||
|
||||
resolve({
|
||||
viewBySwimlaneData,
|
||||
|
@ -879,7 +876,6 @@ export async function loadTopInfluencers(
|
|||
)
|
||||
.then((resp) => {
|
||||
// TODO - sort the influencers keys so that the partition field(s) are first.
|
||||
console.log('Explorer top influencers data set:', resp.influencers);
|
||||
resolve(resp.influencers);
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -412,8 +412,7 @@ class JobService {
|
|||
// return the promise chain
|
||||
return ml
|
||||
.updateJob({ jobId, job })
|
||||
.then((resp) => {
|
||||
console.log('update job', resp);
|
||||
.then(() => {
|
||||
return { success: true };
|
||||
})
|
||||
.catch((err) => {
|
||||
|
@ -423,7 +422,7 @@ class JobService {
|
|||
values: { jobId },
|
||||
})
|
||||
);
|
||||
console.log('update job', err);
|
||||
console.error('update job', err);
|
||||
return { success: false, message: err.message };
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue