Updating filter settings - getting fields correctly.

This commit is contained in:
mike12345567 2024-05-24 14:19:53 +01:00
parent b18ca2670a
commit cf89c6fbde
2 changed files with 7 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<script>
import { Multiselect } from "@budibase/bbui"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import { selectedScreen, tables } from "stores/builder"
import { selectedScreen } from "stores/builder"
import { createEventDispatcher } from "svelte"
import { getFields } from "helpers/searchFields"
@ -20,10 +20,7 @@
if (!ds?.tableId) {
return base.map(field => field.name)
}
const currentTable = $tables.list.find(table => table._id === ds.tableId)
return getFields(base, { allowLinks: currentTable?.sql }).map(
field => field.name
)
return getFields(base, { allowLinks: true }).map(field => field.name)
}
function getSelectedOption(selectedOptions, allOptions) {

View File

@ -16,6 +16,7 @@
import { LuceneUtils, Constants } from "@budibase/frontend-core"
import { getContext } from "svelte"
import FilterUsers from "./FilterUsers.svelte"
import { getFields } from "@budibase/builder/src/helpers/searchFields"
const { OperatorOptions } = Constants
@ -45,12 +46,12 @@
const context = getContext("context")
$: fieldOptions = (schemaFields ?? [])
.filter(field => getValidOperatorsForType(field).length)
.map(field => ({
$: fieldOptions = getFields(schemaFields || [], { allowLinks: true }).map(
field => ({
label: field.displayName || field.name,
value: field.name,
}))
})
)
const addFilter = () => {
filters = [