Fix metric drill down not working for metrics with no labels

This commit is contained in:
Jože Fortun
2023-08-22 12:11:15 +02:00
parent 218a807b38
commit 95ae09e80c
2 changed files with 10 additions and 6 deletions
@@ -182,7 +182,7 @@ export default {
* Based on drill down configuration, either changes the linked block on the page
* or opens it in a modal wit the filter and dimensions from the chart and the clicked value
*/
drillDown ({ label: name, filter, moduleID, drillDown }, metricIndex) {
drillDown ({ label: name = '', filter, moduleID, drillDown }, metricIndex) {
if (!drillDown.enabled) {
return
}
@@ -186,6 +186,7 @@
:reduce="f => f.name"
:calculate-position="calculateDropdownPosition"
class="bg-white"
@input="onMetricFieldChange"
/>
</b-form-group>
@@ -415,11 +416,6 @@ export default {
this.edit.dateFormat = this.edit.dateFormat || 'YYYY-MM-DD'
}
},
'edit.metricField': function (mf) {
if (mf === 'count') {
this.edit.operation = undefined
}
},
},
created () {
@@ -472,6 +468,14 @@ export default {
return operation
},
onMetricFieldChange (field) {
if (field === 'count') {
this.edit.operation = undefined
} else if (!this.edit.operation) {
this.edit.operation = this.aggregationOperations[0].operation
}
},
setDefaultValues () {
this.edit = undefined
this.dimensionModifiers = []