Update frontend type names to match changes I've made.
This commit is contained in:
parent
17c9d9f9e1
commit
ff487735cc
|
@ -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
|
||||
|
|
|
@ -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: [],
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue