Improve sorting logic

This commit is contained in:
Andrew Kingston 2024-10-11 16:43:24 +01:00
parent 865eb3169f
commit 838f9e9c56
No known key found for this signature in database
4 changed files with 4 additions and 6 deletions

View File

@ -9,13 +9,11 @@
let anchor
$: columnOptions = $columns
.filter(col => canBeSortColumn(col.schema))
.map(col => ({
label: col.label || col.name,
value: col.name,
type: col.schema?.type,
related: col.related,
}))
.filter(col => canBeSortColumn(col))
$: orderOptions = getOrderOptions($sort.column, columnOptions)
const getOrderOptions = (column, columnOptions) => {

View File

@ -35,7 +35,7 @@ const TypeComponentMap = {
[FieldType.BB_REFERENCE_SINGLE]: BBReferenceSingleCell,
}
export const getCellRenderer = column => {
if (column.calculation) {
if (column.calculationType) {
return NumberCell
}
return (

View File

@ -160,7 +160,7 @@ export const initialise = context => {
order: fieldSchema.order ?? oldColumn?.order,
conditions: fieldSchema.conditions,
related: fieldSchema.related,
calculation: fieldSchema.calculationType != null,
calculationType: fieldSchema.calculationType,
}
// Override a few properties for primary display
if (field === primaryDisplay) {

View File

@ -5,7 +5,7 @@ export const getColumnIcon = column => {
if (column.schema.icon) {
return column.schema.icon
}
if (column.calculation) {
if (column.calculationType) {
return "Calculator"
}
if (column.schema.autocolumn) {