Fix charts processing if no field or module found
This commit is contained in:
@@ -115,11 +115,11 @@ export default {
|
||||
const [dimension = {}] = report.dimensions
|
||||
let { field } = dimension
|
||||
|
||||
if (!module) return
|
||||
if (!module) throw new Error('Module not found')
|
||||
|
||||
field = fields.find(({ name }) => name === field)
|
||||
|
||||
if (!field) return
|
||||
if (!field) throw new Error('Dimension field not found')
|
||||
|
||||
if (field.kind === 'Bool') {
|
||||
const { trueLabel, falseLabel } = field.options
|
||||
@@ -206,8 +206,11 @@ export default {
|
||||
this.processing = false
|
||||
this.toastErrorHandler(this.$t('chart.optionsBuildFailed'))(e)
|
||||
}
|
||||
this.processing = false
|
||||
this.$emit('updated')
|
||||
|
||||
setTimeout(() => {
|
||||
this.processing = false
|
||||
this.$emit('updated')
|
||||
}, 300)
|
||||
},
|
||||
|
||||
drillDown (e) {
|
||||
|
||||
@@ -125,6 +125,10 @@ export class BaseChart {
|
||||
d.modifier = '(no grouping / buckets)'
|
||||
}
|
||||
|
||||
if (d.field === 'created_at') {
|
||||
d.field = 'createdAt'
|
||||
}
|
||||
|
||||
return _.merge(this.defDimension(), d)
|
||||
})
|
||||
report.metrics = metrics.map(m => _.merge(this.defMetrics(), m))
|
||||
|
||||
Reference in New Issue
Block a user