From 71c4d3bc5af2767ae02f6cf132efce37cb626004 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 31 Dec 2024 12:40:51 +0100 Subject: [PATCH 1/2] Fix width when default --- packages/frontend-core/src/components/grid/stores/columns.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/stores/columns.ts b/packages/frontend-core/src/components/grid/stores/columns.ts index 70b93d93e6..f54e8067b2 100644 --- a/packages/frontend-core/src/components/grid/stores/columns.ts +++ b/packages/frontend-core/src/components/grid/stores/columns.ts @@ -182,7 +182,7 @@ export const initialise = (context: StoreContext) => { name: field, label: fieldSchema.displayName || field, schema: fieldSchema, - width: fieldSchema.width || oldColumn?.width || DefaultColumnWidth, + width: fieldSchema.width || DefaultColumnWidth, visible: fieldSchema.visible ?? true, readonly: fieldSchema.readonly, order: fieldSchema.order ?? oldColumn?.order, From 511592bf6c0a83be4674711d5d646352904b901f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 31 Dec 2024 12:43:16 +0100 Subject: [PATCH 2/2] Fix order between views --- packages/frontend-core/src/components/grid/stores/columns.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/columns.ts b/packages/frontend-core/src/components/grid/stores/columns.ts index f54e8067b2..1b3f6624e1 100644 --- a/packages/frontend-core/src/components/grid/stores/columns.ts +++ b/packages/frontend-core/src/components/grid/stores/columns.ts @@ -161,7 +161,7 @@ export const initialise = (context: StoreContext) => { columns.set([]) return } - const $columns = get(columns) + const $displayColumn = get(displayColumn) // Find primary display @@ -176,7 +176,6 @@ export const initialise = (context: StoreContext) => { Object.keys($enrichedSchema) .map(field => { const fieldSchema = $enrichedSchema[field] - const oldColumn = $columns?.find(col => col.name === field) const column: UIColumn = { type: fieldSchema.type, name: field, @@ -185,7 +184,7 @@ export const initialise = (context: StoreContext) => { width: fieldSchema.width || DefaultColumnWidth, visible: fieldSchema.visible ?? true, readonly: fieldSchema.readonly, - order: fieldSchema.order ?? oldColumn?.order, + order: fieldSchema.order, conditions: fieldSchema.conditions, related: fieldSchema.related, calculationType: fieldSchema.calculationType,