Ensure data section grid sort column options are properly filtered down
This commit is contained in:
parent
fb69c3a0da
commit
05133d7e69
|
@ -1,6 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { getContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
import { ActionButton, Popover, Select } from "@budibase/bbui"
|
import { ActionButton, Popover, Select } from "@budibase/bbui"
|
||||||
|
import { canBeSortColumn } from "@budibase/shared-core"
|
||||||
|
|
||||||
const { sort, columns, stickyColumn } = getContext("grid")
|
const { sort, columns, stickyColumn } = getContext("grid")
|
||||||
|
|
||||||
|
@ -19,7 +20,7 @@
|
||||||
type: stickyColumn.schema?.type,
|
type: stickyColumn.schema?.type,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return [
|
options = [
|
||||||
...options,
|
...options,
|
||||||
...columns.map(col => ({
|
...columns.map(col => ({
|
||||||
label: col.label || col.name,
|
label: col.label || col.name,
|
||||||
|
@ -27,6 +28,7 @@
|
||||||
type: col.schema?.type,
|
type: col.schema?.type,
|
||||||
})),
|
})),
|
||||||
]
|
]
|
||||||
|
return options.filter(col => canBeSortColumn(col.type))
|
||||||
}
|
}
|
||||||
|
|
||||||
const getOrderOptions = (column, columnOptions) => {
|
const getOrderOptions = (column, columnOptions) => {
|
||||||
|
|
Loading…
Reference in New Issue