diff --git a/packages/frontend-core/src/components/grid/stores/columns.ts b/packages/frontend-core/src/components/grid/stores/columns.ts index 44f9039de5..881c4dff6f 100644 --- a/packages/frontend-core/src/components/grid/stores/columns.ts +++ b/packages/frontend-core/src/components/grid/stores/columns.ts @@ -1,6 +1,6 @@ import { derived, get, Writable, writable } from "svelte/store" import { DefaultColumnWidth, GutterWidth } from "../lib/constants" -import { FieldSchema } from "@budibase/types" +import { CalculationType, FieldSchema } from "@budibase/types" import { StoreContext } from "." export interface Store { @@ -8,15 +8,18 @@ export interface Store { } type Column = FieldSchema & { + label: string + readonly: boolean + conditions: any related?: { field: string subField: string } - primaryDisplay: boolean - + primaryDisplay?: boolean schema?: { autocolumn: boolean } + calculationType: CalculationType } export const createStores = (): Store => { @@ -169,7 +172,8 @@ export const initialise = (context: StoreContext) => { .map(field => { const fieldSchema = $enrichedSchema[field] const oldColumn = $columns?.find(col => col.name === field) - const column = { + const column: Column = { + type: fieldSchema.type, name: field, label: fieldSchema.displayName || field, schema: fieldSchema, diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index 80898713e5..fdbd6b4f91 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -1,3 +1,5 @@ +import { Writable } from "svelte/store" + import * as Bounds from "./bounds" import * as Columns from "./columns" import * as Menu from "./menu" @@ -75,7 +77,7 @@ export const attachStores = context => { export interface StoreContext { columns: Columns.Store["columns"] datasource: any - definition: any - displayColumn: any + definition: Writable + displayColumn: Writable enrichedSchema: any }