Generalised the fix as not all calculations will have a groupby per PR feedback

This commit is contained in:
Dean 2023-10-25 12:08:56 +01:00
parent 66fda3db09
commit b952892c42
2 changed files with 4 additions and 15 deletions

View File

@ -28,7 +28,9 @@
$: if (schema) {
parsedSchema = Object.keys(schema).reduce((acc, key) => {
acc[key] = { ...schema[key] }
acc[key] =
typeof schema[key] === "string" ? { type: schema[key] } : schema[key]
if (!canBeSortColumn(acc[key].type)) {
acc[key].sortable = false
}

View File

@ -19,21 +19,8 @@
let loading = false
let type = "internal"
// Grouped views have a fixed schema layout
const parseSchema = view => {
if (!view.groupBy) {
return view.schema
}
const { group, field, value } = view.schema
return {
group,
field: { type: field },
value: { type: value },
}
}
$: name = view.name
$: schema = parseSchema(view)
$: schema = view.schema
$: calculation = view.calculation
$: supportedFormats = Object.values(ROW_EXPORT_FORMATS).filter(key => {