Commit d6eefcb5 by Suzana Pescador Committed by Torkel Ödegaard

Can't remove default avg column in table #4515 (#8335)

Avg column was being added at every rendering, if the table was empty.
Now the column will be added once as an initialization when selecting a
'timeseries_aggregations' transform.
parent ee8799de
......@@ -53,6 +53,10 @@ export class TablePanelEditorCtrl {
transformChanged() {
this.panel.columns = [];
if (this.panel.transform === 'timeseries_aggregations') {
this.panel.columns.push({text: 'Avg', value: 'avg'});
}
this.render();
}
......
......@@ -89,10 +89,6 @@ transformers['timeseries_aggregations'] = {
var i, y;
model.columns.push({text: 'Metric'});
if (panel.columns.length === 0) {
panel.columns.push({text: 'Avg', value: 'avg'});
}
for (i = 0; i < panel.columns.length; i++) {
model.columns.push({text: panel.columns[i].text});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment