Ensure data section grid sort column options are properly filtered down

This commit is contained in:
Andrew Kingston 2023-10-18 15:44:27 +01:00
parent fb69c3a0da
commit 05133d7e69
1 changed files with 3 additions and 1 deletions

View File

@ -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) => {