From d79b41663cfe054c71bde4fa15df514c88f85719 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 9 Oct 2023 13:05:57 +0200 Subject: [PATCH 1/4] Don't allow users column as primary display --- .../components/grid/cells/HeaderCell.svelte | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte index a58b4c8fe42..18b014131bc 100644 --- a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte @@ -1,5 +1,6 @@ @@ -231,8 +246,7 @@ Use as display column From 07b82187ddc8364b53b7b3ef1834d32237731fa3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 9 Oct 2023 15:28:27 +0200 Subject: [PATCH 2/4] Process formulas after processing complex fields --- packages/server/src/utilities/rowProcessor/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/server/src/utilities/rowProcessor/index.ts b/packages/server/src/utilities/rowProcessor/index.ts index 0bdaaa393e1..298cc42f7b4 100644 --- a/packages/server/src/utilities/rowProcessor/index.ts +++ b/packages/server/src/utilities/rowProcessor/index.ts @@ -219,9 +219,6 @@ export async function outputProcessing( ? await linkRows.attachFullLinkedDocs(table, safeRows) : safeRows - // process formulas - enriched = processFormulas(table, enriched, { dynamic: true }) as Row[] - // set the attachments URLs for (let [property, column] of Object.entries(table.schema)) { if (column.type === FieldTypes.ATTACHMENT) { @@ -242,6 +239,10 @@ export async function outputProcessing( } } } + + // process formulas + enriched = processFormulas(table, enriched, { dynamic: true }) as Row[] + if (opts.squash) { enriched = (await linkRows.squashLinksToPrimaryDisplay( table, From e94ad2717cc042e2c9dc407e58220253da7827d3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 9 Oct 2023 15:36:17 +0200 Subject: [PATCH 3/4] Simplify --- .../components/grid/cells/HeaderCell.svelte | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte index 18b014131bc..9f58dc9f9fb 100644 --- a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte @@ -1,6 +1,6 @@ @@ -246,7 +233,8 @@ Use as display column From 6c8c0b640110a2b8f38d0797ccfb55c6b6047aa3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 9 Oct 2023 15:37:42 +0200 Subject: [PATCH 4/4] Add comments --- packages/server/src/utilities/rowProcessor/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/utilities/rowProcessor/index.ts b/packages/server/src/utilities/rowProcessor/index.ts index 298cc42f7b4..d6aa5e682a9 100644 --- a/packages/server/src/utilities/rowProcessor/index.ts +++ b/packages/server/src/utilities/rowProcessor/index.ts @@ -219,7 +219,7 @@ export async function outputProcessing( ? await linkRows.attachFullLinkedDocs(table, safeRows) : safeRows - // set the attachments URLs + // process complex types: attachements, bb references... for (let [property, column] of Object.entries(table.schema)) { if (column.type === FieldTypes.ATTACHMENT) { for (let row of enriched) { @@ -240,7 +240,7 @@ export async function outputProcessing( } } - // process formulas + // process formulas after the complex types had been processed enriched = processFormulas(table, enriched, { dynamic: true }) as Row[] if (opts.squash) {