From 0b2b9ae1ac3a299f63ae5a67e3dbc891638a9b93 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 11:36:37 +0100 Subject: [PATCH 01/17] Initial viewport conversion --- .../grid/stores/{viewport.js => viewport.ts} | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) rename packages/frontend-core/src/components/grid/stores/{viewport.js => viewport.ts} (87%) diff --git a/packages/frontend-core/src/components/grid/stores/viewport.js b/packages/frontend-core/src/components/grid/stores/viewport.ts similarity index 87% rename from packages/frontend-core/src/components/grid/stores/viewport.js rename to packages/frontend-core/src/components/grid/stores/viewport.ts index 0797f38b55..3cc5c11000 100644 --- a/packages/frontend-core/src/components/grid/stores/viewport.js +++ b/packages/frontend-core/src/components/grid/stores/viewport.ts @@ -1,7 +1,15 @@ -import { derived } from "svelte/store" +import { derived, Readable } from "svelte/store" import { MinColumnWidth } from "../lib/constants" +import { Store as StoreContext } from "." -export const deriveStores = context => { +interface ViewportDerivedStore { + scrolledRowCount: Readable + visualRowCapacity: Readable + renderedRows: Readable + columnRenderMap: Readable +} + +export const deriveStores = (context: StoreContext): ViewportDerivedStore => { const { rowHeight, scrollableColumns, From 66e71caf1bc5987fb7e05aaa4839a2d8305b4d19 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:12:20 +0100 Subject: [PATCH 02/17] Type anys --- packages/frontend-core/src/components/grid/stores/viewport.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/viewport.ts b/packages/frontend-core/src/components/grid/stores/viewport.ts index 3cc5c11000..47cfc55d36 100644 --- a/packages/frontend-core/src/components/grid/stores/viewport.ts +++ b/packages/frontend-core/src/components/grid/stores/viewport.ts @@ -6,7 +6,7 @@ interface ViewportDerivedStore { scrolledRowCount: Readable visualRowCapacity: Readable renderedRows: Readable - columnRenderMap: Readable + columnRenderMap: Readable> } export const deriveStores = (context: StoreContext): ViewportDerivedStore => { @@ -85,7 +85,7 @@ export const deriveStores = (context: StoreContext): ViewportDerivedStore => { leftEdge += $scrollableColumns[endColIdx].width endColIdx++ } - let next = {} + let next: Record = {} $scrollableColumns .slice(Math.max(0, startColIdx), endColIdx) .forEach(col => { From d68bc44249c2c6596fc591d82cc1f58da8297678 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:13:19 +0100 Subject: [PATCH 03/17] Type anys --- .../frontend-core/src/components/grid/stores/viewport.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/viewport.ts b/packages/frontend-core/src/components/grid/stores/viewport.ts index 47cfc55d36..b7e6279db2 100644 --- a/packages/frontend-core/src/components/grid/stores/viewport.ts +++ b/packages/frontend-core/src/components/grid/stores/viewport.ts @@ -1,11 +1,12 @@ import { derived, Readable } from "svelte/store" import { MinColumnWidth } from "../lib/constants" import { Store as StoreContext } from "." +import { Row } from "@budibase/types" interface ViewportDerivedStore { - scrolledRowCount: Readable - visualRowCapacity: Readable - renderedRows: Readable + scrolledRowCount: Readable + visualRowCapacity: Readable + renderedRows: Readable columnRenderMap: Readable> } From 901e3eaba4a06fc1e07d5901937b1085ce0a46c6 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:14:51 +0100 Subject: [PATCH 04/17] Type bounds --- .../src/components/grid/stores/{bounds.js => bounds.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/frontend-core/src/components/grid/stores/{bounds.js => bounds.ts} (100%) diff --git a/packages/frontend-core/src/components/grid/stores/bounds.js b/packages/frontend-core/src/components/grid/stores/bounds.ts similarity index 100% rename from packages/frontend-core/src/components/grid/stores/bounds.js rename to packages/frontend-core/src/components/grid/stores/bounds.ts From 350c91012f43d71948b548dc917587dabe521a06 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:21:06 +0100 Subject: [PATCH 05/17] Type cache --- .../grid/stores/{cache.js => cache.ts} | 27 ++++++++++++++----- .../src/components/grid/stores/index.ts | 3 ++- 2 files changed, 23 insertions(+), 7 deletions(-) rename packages/frontend-core/src/components/grid/stores/{cache.js => cache.ts} (63%) diff --git a/packages/frontend-core/src/components/grid/stores/cache.js b/packages/frontend-core/src/components/grid/stores/cache.ts similarity index 63% rename from packages/frontend-core/src/components/grid/stores/cache.js rename to packages/frontend-core/src/components/grid/stores/cache.ts index cf4690f15b..999a3ea11d 100644 --- a/packages/frontend-core/src/components/grid/stores/cache.js +++ b/packages/frontend-core/src/components/grid/stores/cache.ts @@ -1,16 +1,31 @@ -export const createActions = context => { +import { FindTableResponse } from "@budibase/types" +import { Store as StoreContext } from "." + +interface CacheActionStore { + cache: { + actions: { + getPrimaryDisplayForTableId: (tableId: string) => Promise + getTable: (tableId: string) => Promise + resetCache: () => any + } + } +} + +export type Store = CacheActionStore + +export const createActions = (context: StoreContext): CacheActionStore => { const { API } = context // Cache for the primary display columns of different tables. // If we ever need to cache table definitions for other purposes then we can // expand this to be a more generic cache. - let tableCache = {} + let tableCache: Record> = {} const resetCache = () => { tableCache = {} } - const fetchTable = async tableId => { + const fetchTable = async (tableId: string) => { // If we've never encountered this tableId before then store a promise that // resolves to the primary display so that subsequent invocations before the // promise completes can reuse this promise @@ -21,13 +36,13 @@ export const createActions = context => { return await tableCache[tableId] } - const getPrimaryDisplayForTableId = async tableId => { + const getPrimaryDisplayForTableId = async (tableId: string) => { const table = await fetchTable(tableId) const display = table?.primaryDisplay || table?.schema?.[0]?.name return display } - const getTable = async tableId => { + const getTable = async (tableId: string) => { const table = await fetchTable(tableId) return table } @@ -43,7 +58,7 @@ export const createActions = context => { } } -export const initialise = context => { +export const initialise = (context: StoreContext) => { const { datasource, cache } = context // Wipe the caches whenever the datasource changes to ensure we aren't diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index 9581f9ff7c..755e69a0fa 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -106,7 +106,8 @@ export type Store = BaseStore & Reorder.Store & Resize.Store & Config.Store & - Conditions.Store + Conditions.Store & + Cache.Store export const attachStores = (context: Store): Store => { // Atomic store creation From bee3a4b2336c5db90e8be49b0ca5f5c86ee1d62e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:22:15 +0100 Subject: [PATCH 06/17] Type notifications --- .../grid/stores/{notifications.js => notifications.ts} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename packages/frontend-core/src/components/grid/stores/{notifications.js => notifications.ts} (87%) diff --git a/packages/frontend-core/src/components/grid/stores/notifications.js b/packages/frontend-core/src/components/grid/stores/notifications.ts similarity index 87% rename from packages/frontend-core/src/components/grid/stores/notifications.js rename to packages/frontend-core/src/components/grid/stores/notifications.ts index 4e8b49414d..05c8039704 100644 --- a/packages/frontend-core/src/components/grid/stores/notifications.js +++ b/packages/frontend-core/src/components/grid/stores/notifications.ts @@ -1,7 +1,8 @@ import { notifications as BBUINotifications } from "@budibase/bbui" import { derived } from "svelte/store" +import { Store as StoreContext } from "." -export const createStores = context => { +export const createStores = (context: StoreContext) => { const { notifySuccess, notifyError } = context // Normally we would not derive a store in "createStores" as it should be From 4ffb365c647bd76b25dbc2d1339eff60562af173 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:23:10 +0100 Subject: [PATCH 07/17] Type pagination --- packages/frontend-core/src/components/grid/stores/index.ts | 3 ++- .../components/grid/stores/{pagination.js => pagination.ts} | 3 ++- packages/frontend-core/src/components/grid/stores/viewport.ts | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) rename packages/frontend-core/src/components/grid/stores/{pagination.js => pagination.ts} (89%) diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index 755e69a0fa..753266f893 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -107,7 +107,8 @@ export type Store = BaseStore & Resize.Store & Config.Store & Conditions.Store & - Cache.Store + Cache.Store & + Viewport.Store export const attachStores = (context: Store): Store => { // Atomic store creation diff --git a/packages/frontend-core/src/components/grid/stores/pagination.js b/packages/frontend-core/src/components/grid/stores/pagination.ts similarity index 89% rename from packages/frontend-core/src/components/grid/stores/pagination.js rename to packages/frontend-core/src/components/grid/stores/pagination.ts index bcf10ee3df..5a97031147 100644 --- a/packages/frontend-core/src/components/grid/stores/pagination.js +++ b/packages/frontend-core/src/components/grid/stores/pagination.ts @@ -1,6 +1,7 @@ import { derived } from "svelte/store" +import { Store as StoreContext } from "." -export const initialise = context => { +export const initialise = (context: StoreContext) => { const { scrolledRowCount, rows, visualRowCapacity } = context // Derive how many rows we have in total diff --git a/packages/frontend-core/src/components/grid/stores/viewport.ts b/packages/frontend-core/src/components/grid/stores/viewport.ts index b7e6279db2..25620c33ef 100644 --- a/packages/frontend-core/src/components/grid/stores/viewport.ts +++ b/packages/frontend-core/src/components/grid/stores/viewport.ts @@ -10,6 +10,8 @@ interface ViewportDerivedStore { columnRenderMap: Readable> } +export type Store = ViewportDerivedStore + export const deriveStores = (context: StoreContext): ViewportDerivedStore => { const { rowHeight, From 4d784b530a85145927a03bc07c47a5bdad4ee641 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:27:58 +0100 Subject: [PATCH 08/17] Types notification --- .../src/components/grid/stores/index.ts | 4 ++-- .../src/components/grid/stores/notifications.ts | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index 753266f893..d55002186f 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -98,7 +98,6 @@ export type Store = BaseStore & sort: Writable subscribe: any dispatch: (event: string, data: any) => any - notifications: Writable width: Writable bounds: Readable height: Readable @@ -108,7 +107,8 @@ export type Store = BaseStore & Config.Store & Conditions.Store & Cache.Store & - Viewport.Store + Viewport.Store & + Notifications.Store export const attachStores = (context: Store): Store => { // Atomic store creation diff --git a/packages/frontend-core/src/components/grid/stores/notifications.ts b/packages/frontend-core/src/components/grid/stores/notifications.ts index 05c8039704..429760ed50 100644 --- a/packages/frontend-core/src/components/grid/stores/notifications.ts +++ b/packages/frontend-core/src/components/grid/stores/notifications.ts @@ -1,8 +1,17 @@ import { notifications as BBUINotifications } from "@budibase/bbui" -import { derived } from "svelte/store" +import { derived, Readable } from "svelte/store" import { Store as StoreContext } from "." -export const createStores = (context: StoreContext) => { +interface NotificationStore { + notifications: Readable<{ + success: (message: string) => void + error: (message: string) => void + }> +} + +export type Store = NotificationStore + +export const createStores = (context: StoreContext): NotificationStore => { const { notifySuccess, notifyError } = context // Normally we would not derive a store in "createStores" as it should be From 078053a417e0d6016801dd4789e62f390d6040cc Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:28:59 +0100 Subject: [PATCH 09/17] Convert sort --- .../src/components/grid/stores/{sort.js => sort.ts} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename packages/frontend-core/src/components/grid/stores/{sort.js => sort.ts} (88%) diff --git a/packages/frontend-core/src/components/grid/stores/sort.js b/packages/frontend-core/src/components/grid/stores/sort.ts similarity index 88% rename from packages/frontend-core/src/components/grid/stores/sort.js rename to packages/frontend-core/src/components/grid/stores/sort.ts index 9ab393b11f..474de59e7b 100644 --- a/packages/frontend-core/src/components/grid/stores/sort.js +++ b/packages/frontend-core/src/components/grid/stores/sort.ts @@ -1,8 +1,9 @@ import { derived, get } from "svelte/store" import { memo } from "../../../utils" import { SortOrder } from "@budibase/types" +import { Store as StoreContext } from "." -export const createStores = context => { +export const createStores = (context: StoreContext) => { const { props } = context const $props = get(props) @@ -17,7 +18,7 @@ export const createStores = context => { } } -export const initialise = context => { +export const initialise = (context: StoreContext) => { const { sort, initialSortColumn, initialSortOrder, schema } = context // Reset sort when initial sort props change From 56fe3ce6feeeb4c0ebcf6dacad8340931195f3df Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:40:52 +0100 Subject: [PATCH 10/17] Type sort store --- .../components/grid/stores/datasources/viewV2.ts | 2 +- .../src/components/grid/stores/index.ts | 4 ++-- .../src/components/grid/stores/sort.ts | 13 +++++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts b/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts index 71c22e6866..6a788d3ec6 100644 --- a/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts +++ b/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts @@ -173,7 +173,7 @@ export const initialise = (context: StoreContext) => { await datasource.actions.saveDefinition({ ...$view, sort: { - field: $sort.column, + field: $sort.column!, order: $sort.order || SortOrder.ASCENDING, }, }) diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index d55002186f..8a4d40976d 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -95,7 +95,6 @@ export type Store = BaseStore & Clipboard.Store & Scroll.Store & { // TODO while typing the rest of stores - sort: Writable subscribe: any dispatch: (event: string, data: any) => any width: Writable @@ -108,7 +107,8 @@ export type Store = BaseStore & Conditions.Store & Cache.Store & Viewport.Store & - Notifications.Store + Notifications.Store & + Sort.Store export const attachStores = (context: Store): Store => { // Atomic store creation diff --git a/packages/frontend-core/src/components/grid/stores/sort.ts b/packages/frontend-core/src/components/grid/stores/sort.ts index 474de59e7b..ab58d7dabe 100644 --- a/packages/frontend-core/src/components/grid/stores/sort.ts +++ b/packages/frontend-core/src/components/grid/stores/sort.ts @@ -1,9 +1,18 @@ -import { derived, get } from "svelte/store" +import { derived, get, Writable } from "svelte/store" import { memo } from "../../../utils" import { SortOrder } from "@budibase/types" import { Store as StoreContext } from "." -export const createStores = (context: StoreContext) => { +interface SortStore { + sort: Writable<{ + column: string | null | undefined + order: SortOrder + }> +} + +export type Store = SortStore + +export const createStores = (context: StoreContext): SortStore => { const { props } = context const $props = get(props) From 0c937e0827688313ea479249fd45a56d54f5f58b Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:44:43 +0100 Subject: [PATCH 11/17] Type bounds --- .../src/components/grid/stores/bounds.ts | 17 +++++++++++++++-- .../src/components/grid/stores/index.ts | 8 +++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/bounds.ts b/packages/frontend-core/src/components/grid/stores/bounds.ts index c0939f7389..0050555f96 100644 --- a/packages/frontend-core/src/components/grid/stores/bounds.ts +++ b/packages/frontend-core/src/components/grid/stores/bounds.ts @@ -1,6 +1,19 @@ -import { derived, writable } from "svelte/store" +import { derived, Readable, Writable, writable } from "svelte/store" -export const createStores = () => { +interface BoundsStore { + bounds: Writable<{ + left: number + top: number + width: number + height: number + }> + height: Readable + width: Readable +} + +export type Store = BoundsStore + +export const createStores = (): BoundsStore => { const bounds = writable({ left: 0, top: 0, diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index 8a4d40976d..1b5e2a48c1 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -1,4 +1,4 @@ -import { Readable, Writable } from "svelte/store" +import { Writable } from "svelte/store" import type { APIClient } from "../../../api/types" import * as Bounds from "./bounds" @@ -97,9 +97,6 @@ export type Store = BaseStore & // TODO while typing the rest of stores subscribe: any dispatch: (event: string, data: any) => any - width: Writable - bounds: Readable - height: Readable } & Rows.Store & Reorder.Store & Resize.Store & @@ -108,7 +105,8 @@ export type Store = BaseStore & Cache.Store & Viewport.Store & Notifications.Store & - Sort.Store + Sort.Store & + Bounds.Store export const attachStores = (context: Store): Store => { // Atomic store creation From d476a5c5cd519fa0427cbca4dc833d1eb22970c8 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 13:59:08 +0100 Subject: [PATCH 12/17] Type event store --- .../src/components/grid/lib/{events.js => events.ts} | 6 +++--- .../frontend-core/src/components/grid/stores/index.ts | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) rename packages/frontend-core/src/components/grid/lib/{events.js => events.ts} (78%) diff --git a/packages/frontend-core/src/components/grid/lib/events.js b/packages/frontend-core/src/components/grid/lib/events.ts similarity index 78% rename from packages/frontend-core/src/components/grid/lib/events.js rename to packages/frontend-core/src/components/grid/lib/events.ts index 1c486858b2..7fd826954a 100644 --- a/packages/frontend-core/src/components/grid/lib/events.js +++ b/packages/frontend-core/src/components/grid/lib/events.ts @@ -2,11 +2,11 @@ import { createEventDispatcher } from "svelte" export const createEventManagers = () => { const svelteDispatch = createEventDispatcher() - let subscribers = {} + let subscribers: Record void)[]> = {} // Dispatches an event, notifying subscribers and also emitting a normal // svelte event - const dispatch = (event, payload) => { + const dispatch = (event: string, payload: any) => { svelteDispatch(event, payload) const subs = subscribers[event] || [] for (let i = 0; i < subs.length; i++) { @@ -15,7 +15,7 @@ export const createEventManagers = () => { } // Subscribes to events - const subscribe = (event, callback) => { + const subscribe = (event: string, callback: () => void) => { const subs = subscribers[event] || [] subscribers[event] = [...subs, callback] diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index 1b5e2a48c1..422b264473 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -79,6 +79,8 @@ export interface BaseStore { API: APIClient gridID: string props: Writable + subscribe: any + dispatch: (event: string, data: any) => any } export type Store = BaseStore & @@ -93,11 +95,8 @@ export type Store = BaseStore & Filter.Store & UI.Store & Clipboard.Store & - Scroll.Store & { - // TODO while typing the rest of stores - subscribe: any - dispatch: (event: string, data: any) => any - } & Rows.Store & + Scroll.Store & + Rows.Store & Reorder.Store & Resize.Store & Config.Store & From 51c7fe8c5b98ca009e3e143b87756b4843a942c2 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 14:05:17 +0100 Subject: [PATCH 13/17] Type grid svelte file --- .../src/components/grid/layout/Grid.svelte | 11 +++++------ .../frontend-core/src/components/grid/stores/index.ts | 5 ++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/frontend-core/src/components/grid/layout/Grid.svelte b/packages/frontend-core/src/components/grid/layout/Grid.svelte index c0ad5810b7..bd630e9908 100644 --- a/packages/frontend-core/src/components/grid/layout/Grid.svelte +++ b/packages/frontend-core/src/components/grid/layout/Grid.svelte @@ -1,4 +1,4 @@ - diff --git a/tsconfig.build.json b/tsconfig.build.json index d51625a34f..a05fa2c976 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -19,7 +19,8 @@ "@budibase/pro": ["./packages/pro/src"], "@budibase/string-templates": ["./packages/string-templates/src"], "@budibase/string-templates/*": ["./packages/string-templates/*"], - "@budibase/frontend-core": ["./packages/frontend-core/src"] + "@budibase/frontend-core": ["./packages/frontend-core/src"], + "@budibase/bbui": ["./packages/bbui/src"] } }, "exclude": [] From 405c0184057b78cfaa46afe3702b47e69aff053d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 22:30:23 +0100 Subject: [PATCH 16/17] Allow client to consume frontend-core svelte.ts --- packages/client/svelte.config.mjs | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/client/svelte.config.mjs diff --git a/packages/client/svelte.config.mjs b/packages/client/svelte.config.mjs new file mode 100644 index 0000000000..af7d74ea4b --- /dev/null +++ b/packages/client/svelte.config.mjs @@ -0,0 +1,7 @@ +import { vitePreprocess } from "@sveltejs/vite-plugin-svelte" + +const config = { + preprocess: vitePreprocess(), +} + +export default config From aa07af596be8ef9bed524aab25fbccb9d40311f4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 31 Dec 2024 12:24:26 +0100 Subject: [PATCH 17/17] Fix types --- .../src/components/grid/stores/datasources/nonPlus.ts | 2 +- .../src/components/grid/stores/datasources/table.ts | 2 +- .../src/components/grid/stores/datasources/viewV2.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/datasources/nonPlus.ts b/packages/frontend-core/src/components/grid/stores/datasources/nonPlus.ts index ae8f187278..6e81ff3e48 100644 --- a/packages/frontend-core/src/components/grid/stores/datasources/nonPlus.ts +++ b/packages/frontend-core/src/components/grid/stores/datasources/nonPlus.ts @@ -122,7 +122,7 @@ export const initialise = (context: StoreContext) => { } $fetch?.update({ sortOrder: $sort.order || SortOrder.ASCENDING, - sortColumn: $sort.column, + sortColumn: $sort.column ?? undefined, }) }) ) diff --git a/packages/frontend-core/src/components/grid/stores/datasources/table.ts b/packages/frontend-core/src/components/grid/stores/datasources/table.ts index e52faef5cc..27fa638596 100644 --- a/packages/frontend-core/src/components/grid/stores/datasources/table.ts +++ b/packages/frontend-core/src/components/grid/stores/datasources/table.ts @@ -139,7 +139,7 @@ export const initialise = (context: StoreContext) => { } $fetch.update({ sortOrder: $sort.order || SortOrder.ASCENDING, - sortColumn: $sort.column, + sortColumn: $sort.column ?? undefined, }) }) ) diff --git a/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts b/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts index 6a788d3ec6..4dc5a44fd5 100644 --- a/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts +++ b/packages/frontend-core/src/components/grid/stores/datasources/viewV2.ts @@ -187,7 +187,7 @@ export const initialise = (context: StoreContext) => { } $fetch.update({ sortOrder: $sort.order, - sortColumn: $sort.column, + sortColumn: $sort.column ?? undefined, }) }) )