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 { ...@@ -159,8 +159,8 @@ class SingleStatCtrl extends MetricsPanelCtrl {
} }
setTableColumnToSensibleDefault(tableData) { setTableColumnToSensibleDefault(tableData) {
if (this.tableColumnOptions.length === 1) { if (tableData.columns.length === 1) {
this.panel.tableColumn = this.tableColumnOptions[0]; this.panel.tableColumn = tableData.columns[0].text;
} else { } else {
this.panel.tableColumn = _.find(tableData.columns, col => { this.panel.tableColumn = _.find(tableData.columns, col => {
return col.type !== 'time'; 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