From ff487735cc4a90e9b7e1cd38e41bc2ab8ebf98f4 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 23 Oct 2024 14:13:43 +0100 Subject: [PATCH] Update frontend type names to match changes I've made. --- packages/builder/src/stores/builder/viewsV2.js | 8 ++++---- .../frontend-core/src/components/CoreFilterBuilder.svelte | 4 ++-- .../frontend-core/src/components/grid/stores/filter.js | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/stores/builder/viewsV2.js b/packages/builder/src/stores/builder/viewsV2.js index 7c0a940c1b..3d67686344 100644 --- a/packages/builder/src/stores/builder/viewsV2.js +++ b/packages/builder/src/stores/builder/viewsV2.js @@ -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 diff --git a/packages/frontend-core/src/components/CoreFilterBuilder.svelte b/packages/frontend-core/src/components/CoreFilterBuilder.svelte index c711a57e1c..002d6fadb8 100644 --- a/packages/frontend-core/src/components/CoreFilterBuilder.svelte +++ b/packages/frontend-core/src/components/CoreFilterBuilder.svelte @@ -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: [], } diff --git a/packages/frontend-core/src/components/grid/stores/filter.js b/packages/frontend-core/src/components/grid/stores/filter.js index 6e6c37da87..e7adc356ae 100644 --- a/packages/frontend-core/src/components/grid/stores/filter.js +++ b/packages/frontend-core/src/components/grid/stores/filter.js @@ -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, }, ],