Commit dfccabab by Jonas Hahnfeld

singlestat: Fix optimization in setTableColumnToSensibleDefault

tableColumnOptions is an associative array that has no property length.
Use tableData.columns as in the default case which works just fine.
parent e3dbef75
......@@ -159,8 +159,8 @@ class SingleStatCtrl extends MetricsPanelCtrl {
}
setTableColumnToSensibleDefault(tableData) {
if (this.tableColumnOptions.length === 1) {
this.panel.tableColumn = this.tableColumnOptions[0];
if (tableData.columns.length === 1) {
this.panel.tableColumn = tableData.columns[0].text;
} else {
this.panel.tableColumn = _.find(tableData.columns, col => {
return col.type !== 'time';
......
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