From fafa0472d74b851793778adaa1adb14a0510bd41 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 10:58:07 +0100 Subject: [PATCH] Fix definition types --- packages/frontend-core/src/components/grid/stores/columns.ts | 4 ++-- .../frontend-core/src/components/grid/stores/datasource.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/columns.ts b/packages/frontend-core/src/components/grid/stores/columns.ts index 8073988323..70b93d93e6 100644 --- a/packages/frontend-core/src/components/grid/stores/columns.ts +++ b/packages/frontend-core/src/components/grid/stores/columns.ts @@ -156,11 +156,11 @@ export const initialise = (context: StoreContext) => { // Merge new schema fields with existing schema in order to preserve widths const processColumns = ($enrichedSchema: any) => { - if (!$enrichedSchema) { + const $definition = get(definition) + if (!$enrichedSchema || !$definition) { columns.set([]) return } - const $definition = get(definition) const $columns = get(columns) const $displayColumn = get(displayColumn) diff --git a/packages/frontend-core/src/components/grid/stores/datasource.ts b/packages/frontend-core/src/components/grid/stores/datasource.ts index d9dd2fb279..55af9c016a 100644 --- a/packages/frontend-core/src/components/grid/stores/datasource.ts +++ b/packages/frontend-core/src/components/grid/stores/datasource.ts @@ -17,7 +17,7 @@ import { DatasourceActions } from "./datasources" import { ConfigStore } from "./config" interface DatasourceStore { - definition: Writable + definition: Writable schemaMutations: Writable> subSchemaMutations: Writable>> } @@ -219,7 +219,7 @@ export const createActions = (context: StoreContext): ActionDatasourceStore => { // Updates the datasources primary display column const changePrimaryDisplay = async (column: string) => { - let newDefinition = cloneDeep(get(definition)) + let newDefinition = cloneDeep(get(definition)!) // Update primary display newDefinition.primaryDisplay = column