Improve sorting logic
This commit is contained in:
parent
865eb3169f
commit
838f9e9c56
|
@ -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) => {
|
||||
|
|
|
@ -35,7 +35,7 @@ const TypeComponentMap = {
|
|||
[FieldType.BB_REFERENCE_SINGLE]: BBReferenceSingleCell,
|
||||
}
|
||||
export const getCellRenderer = column => {
|
||||
if (column.calculation) {
|
||||
if (column.calculationType) {
|
||||
return NumberCell
|
||||
}
|
||||
return (
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue