Update frontend type names to match changes I've made.

This commit is contained in:
Sam Rose 2024-10-23 14:13:43 +01:00
parent 17c9d9f9e1
commit ff487735cc
No known key found for this signature in database
3 changed files with 9 additions and 9 deletions

View File

@ -4,7 +4,7 @@ import { API } from "api"
import { dataFilters } from "@budibase/shared-core"
function convertToSearchFilters(view) {
// convert from SearchFilterGroup type
// convert from UISearchFilter type
if (view?.query) {
return {
...view,
@ -15,7 +15,7 @@ function convertToSearchFilters(view) {
return view
}
function convertToSearchFilterGroup(view) {
function convertToUISearchFilter(view) {
if (view?.queryUI) {
return {
...view,
@ -36,7 +36,7 @@ export function createViewsV2Store() {
const views = Object.values(table?.views || {}).filter(view => {
return view.version === 2
})
list = list.concat(views.map(view => convertToSearchFilterGroup(view)))
list = list.concat(views.map(view => convertToUISearchFilter(view)))
})
return {
...$store,
@ -77,7 +77,7 @@ export function createViewsV2Store() {
if (!viewId) {
return
}
view = convertToSearchFilterGroup(view)
view = convertToUISearchFilter(view)
const existingView = get(derivedStore).list.find(view => view.id === viewId)
const tableIndex = get(tables).list.findIndex(table => {
return table._id === view?.tableId || table._id === existingView?.tableId

View File

@ -10,7 +10,7 @@
} from "@budibase/bbui"
import {
FieldType,
FilterGroupLogicalOperator,
UILogicalOperator,
EmptyFilterOption,
} from "@budibase/types"
import { QueryUtils, Constants } from "@budibase/frontend-core"
@ -220,7 +220,7 @@
} else if (addGroup) {
if (!editable?.groups?.length) {
editable = {
logicalOperator: FilterGroupLogicalOperator.ALL,
logicalOperator: UILogicalOperator.ALL,
onEmptyFilter: EmptyFilterOption.RETURN_NONE,
groups: [],
}

View File

@ -1,5 +1,5 @@
import { get, derived } from "svelte/store"
import { FieldType, FilterGroupLogicalOperator } from "@budibase/types"
import { FieldType, UILogicalOperator } from "@budibase/types"
import { memo } from "../../../utils/memo"
export const createStores = context => {
@ -25,10 +25,10 @@ export const deriveStores = context => {
return $filter
}
let allFilters = {
logicalOperator: FilterGroupLogicalOperator.ALL,
logicalOperator: UILogicalOperator.ALL,
groups: [
{
logicalOperator: FilterGroupLogicalOperator.ALL,
logicalOperator: UILogicalOperator.ALL,
filters: $inlineFilters,
},
],