FIX: ensures we don't apply charts options to other modes (#13570)

This reverts commit 1f74ea0f08.
This commit is contained in:
Joffrey JAFFEUX 2021-06-29 21:58:35 +02:00 committed by GitHub
parent 4b27de8c4b
commit 33464cb07e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 8 deletions

View File

@ -300,6 +300,7 @@ export default Component.extend({
return;
}
}
if (report.error === "not_found") {
this.set("showFilteringUI", false);
}
@ -382,17 +383,13 @@ export default Component.extend({
return EmberObject.create(
Object.assign(tableOptions, this.get("reportOptions.table") || {})
);
} else {
} else if (mode === "chart") {
const chartOptions = JSON.parse(JSON.stringify(CHART_OPTIONS));
let chartGrouping = this.get("reportOptions.chartGrouping");
if (!chartGrouping && report.chartData) {
chartGrouping = Report.groupingForDatapoints(report.chartData.length);
}
return EmberObject.create(
Object.assign(chartOptions, this.get("reportOptions.chart") || {}, {
chartGrouping,
chartGrouping:
this.get("reportOptions.chartGrouping") ||
Report.groupingForDatapoints(report.chartData.length),
})
);
}