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"
|
import { dataFilters } from "@budibase/shared-core"
|
||||||
|
|
||||||
function convertToSearchFilters(view) {
|
function convertToSearchFilters(view) {
|
||||||
// convert from SearchFilterGroup type
|
// convert from UISearchFilter type
|
||||||
if (view?.query) {
|
if (view?.query) {
|
||||||
return {
|
return {
|
||||||
...view,
|
...view,
|
||||||
|
@ -15,7 +15,7 @@ function convertToSearchFilters(view) {
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertToSearchFilterGroup(view) {
|
function convertToUISearchFilter(view) {
|
||||||
if (view?.queryUI) {
|
if (view?.queryUI) {
|
||||||
return {
|
return {
|
||||||
...view,
|
...view,
|
||||||
|
@ -36,7 +36,7 @@ export function createViewsV2Store() {
|
||||||
const views = Object.values(table?.views || {}).filter(view => {
|
const views = Object.values(table?.views || {}).filter(view => {
|
||||||
return view.version === 2
|
return view.version === 2
|
||||||
})
|
})
|
||||||
list = list.concat(views.map(view => convertToSearchFilterGroup(view)))
|
list = list.concat(views.map(view => convertToUISearchFilter(view)))
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
...$store,
|
...$store,
|
||||||
|
@ -77,7 +77,7 @@ export function createViewsV2Store() {
|
||||||
if (!viewId) {
|
if (!viewId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
view = convertToSearchFilterGroup(view)
|
view = convertToUISearchFilter(view)
|
||||||
const existingView = get(derivedStore).list.find(view => view.id === viewId)
|
const existingView = get(derivedStore).list.find(view => view.id === viewId)
|
||||||
const tableIndex = get(tables).list.findIndex(table => {
|
const tableIndex = get(tables).list.findIndex(table => {
|
||||||
return table._id === view?.tableId || table._id === existingView?.tableId
|
return table._id === view?.tableId || table._id === existingView?.tableId
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import {
|
import {
|
||||||
FieldType,
|
FieldType,
|
||||||
FilterGroupLogicalOperator,
|
UILogicalOperator,
|
||||||
EmptyFilterOption,
|
EmptyFilterOption,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import { QueryUtils, Constants } from "@budibase/frontend-core"
|
import { QueryUtils, Constants } from "@budibase/frontend-core"
|
||||||
|
@ -220,7 +220,7 @@
|
||||||
} else if (addGroup) {
|
} else if (addGroup) {
|
||||||
if (!editable?.groups?.length) {
|
if (!editable?.groups?.length) {
|
||||||
editable = {
|
editable = {
|
||||||
logicalOperator: FilterGroupLogicalOperator.ALL,
|
logicalOperator: UILogicalOperator.ALL,
|
||||||
onEmptyFilter: EmptyFilterOption.RETURN_NONE,
|
onEmptyFilter: EmptyFilterOption.RETURN_NONE,
|
||||||
groups: [],
|
groups: [],
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { get, derived } from "svelte/store"
|
import { get, derived } from "svelte/store"
|
||||||
import { FieldType, FilterGroupLogicalOperator } from "@budibase/types"
|
import { FieldType, UILogicalOperator } from "@budibase/types"
|
||||||
import { memo } from "../../../utils/memo"
|
import { memo } from "../../../utils/memo"
|
||||||
|
|
||||||
export const createStores = context => {
|
export const createStores = context => {
|
||||||
|
@ -25,10 +25,10 @@ export const deriveStores = context => {
|
||||||
return $filter
|
return $filter
|
||||||
}
|
}
|
||||||
let allFilters = {
|
let allFilters = {
|
||||||
logicalOperator: FilterGroupLogicalOperator.ALL,
|
logicalOperator: UILogicalOperator.ALL,
|
||||||
groups: [
|
groups: [
|
||||||
{
|
{
|
||||||
logicalOperator: FilterGroupLogicalOperator.ALL,
|
logicalOperator: UILogicalOperator.ALL,
|
||||||
filters: $inlineFilters,
|
filters: $inlineFilters,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue