Skip to content

Commit 69991ff

Browse files
fix(plugin-grid, plugin-detail): a returnType currency formula reads as money in list cells and on the record page (#27689)
domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC <!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgP6XkfpjCfyzzG2KwQPUZfy)_ Fixes #27494 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:列表网格的三条列构建路径和记录页的字段补全,现在把公式字段声明的 `returnType` 一并传给单元格;`returnType: 'currency'` 的公式(如演示应用的「Budget Remaining」)按货币显示 `$180,000.00`,与旁边的货币列一致。 - 为什么改:公式单元格本来就会把声明为 currency 的结果交给货币单元格渲染,但列表和记录页在重建字段时只挑了 `currencyConfig`、`scale` 等键,漏了 `returnType`,单元格以为是未声明类型的数字,显示成裸数字 `180,000.00`。 - 风险与回滚:只多传一个已有的 spec 键,共 4 行;不新增格式化函数、不改 spec、不改服务端;声明 `number` 或未声明的公式照旧显示数字。回滚即 revert 本 PR。 - 先看:`ui/packages/plugin-grid/src/objectGridGenerateColumns.tsx`(三处 `fieldMeta.returnType`)→ `ui/packages/plugin-detail/src/fieldEnrichment.ts`(`ENRICHED_FIELD_METADATA_KEYS` 加 `returnType`)→ 新测试 `gridFormulaCurrency-27494.test.tsx`。 - 两分钟验证:`pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/gridFormulaCurrency-27494.test.tsx packages/plugin-detail/src/__tests__/formulaReturnTypeRelay-27494.test.tsx`,预期 13/13 通过。 - 需要你做的:无,席位落地。 ## What changes `FormulaCellRenderer` (the table face) and `FormulaField` (the form face) already draw a formula declaring `returnType: 'currency'` through the currency field's own faces (`CurrencyCellRenderer` / `CurrencyField`, `formatCurrency`), reading the formula's own `currencyConfig`. The renderers were never reached with that key: the hosts that rebuild a field bag from a picked key list carried `currencyConfig` and `scale` but not `returnType`. The cell then saw an undeclared formula holding a JS number and drew the number face at `scale: 2`, which is the `90,000.00` the card reports beside `$150,000.00`. - **`plugin-grid`, `objectGridGenerateColumns.tsx`.** The three configured-column paths (ListColumn objects, a string column list, inline rows with a `fields` projection) now copy `returnType` verbatim beside `currencyConfig` into the cell's `fieldMeta`. The auto-generated (object-schema) path already hands the whole def and is unchanged. - **`plugin-detail`, `fieldEnrichment.ts`.** `ENRICHED_FIELD_METADATA_KEYS`, shared by `DetailSection`, `HeaderHighlight` and the summary chips, gains `returnType`, so a section entry naming the field (`{ name }`) reaches the formula cell with its declared type. A view entry that declares its own `returnType` still wins (the list's existing fill-the-gaps rule). The list is not exported from the package entry, so no published surface moves. - No second money formatter, no spec change, no new key: `returnType` and `currencyConfig` are the spec's existing formula keys (#22727). ## Tests - New `ui/packages/plugin-grid/src/__tests__/gridFormulaCurrency-27494.test.tsx`, under a EUR tenant so the `$` can only come from the formula's own fixed `currencyConfig`: on each of the three configured paths, the currency formula reads `$90,000.00` beside the currency field's `$150,000.00`; controls, a `returnType: 'number'` formula at `scale: 2` reads `1,234.50` and an undeclared formula reads `4,321`; every formula cell reads what the whole-def `FormulaCellRenderer` reads; the auto-generated columns are the reference face. - New `ui/packages/plugin-detail/src/__tests__/formulaReturnTypeRelay-27494.test.tsx`: the fixture is a spec-valid formula def (`FieldSchema.safeParse`); `enrichDetailField` copies `returnType` and a view-entry one wins; `DetailSection` draws `$90,000.00` beside `$150,000.00`, and a number formula stays `1,234.50`. ## Acceptance notes - **Measured premise (both halves of the order's step 1).** (a) The served metadata carries the keys: on a fresh `examples/app-showcase` boot, `GET /api/v1/meta/object/showcase_project` returned `budget_remaining` as `{ type: 'formula', returnType: 'currency', currencyConfig: { currencyMode: 'fixed', defaultCurrency: 'USD' }, scale: 2 }`. (b) The renderers: the list cell is `FormulaCellRenderer` reached from `objectGridGenerateColumns`' configured-column paths; the related-list cell is `FormulaCellRenderer` reached from `RelatedList`'s `makeCell` bag; the record page's field is `FormulaCellRenderer` reached through `enrichDetailField`. None goes through `FormulaField`, and none needed a renderer change. - **#27430 row 1, the related-list cell, is deferred** (Refs #27430, row 1 only). `RelatedList.tsx`'s `makeCell` builds the same picked-key bag and drops `returnType` the same way; the one-line fix is a `returnType` spread beside its `currencyConfig: def.currencyConfig` spread. That file is being rewritten by an open PR (#27636), so the seat holds it until that lands; this PR does not pin the related list. Rows 2 to 4 of #27430 are not touched. - **Same family, not in this diff.** `RecordDetailPanel`'s `buildRecordDetailFields` (the quick-look overlay) also builds its field from a picked list (`currencyConfig`, `scale`, …) without `returnType`. Reported to the seat with the related-list site; not changed here. - On the live showcase the record page's layout does not place Budget Remaining, so the record-page half is pinned by the `DetailSection` test only. ## Verification <details><summary>Live console, Showcase → Projects (fresh boot, 1440×900)</summary> Branch console (`ui/apps/console` vite) against the branch's `objectstack dev --seed-admin --fresh`. Rows read from the list's table, columns Budget / Budget Remaining: - grid fix ablated (the three `fieldMeta.returnType` copies renamed through `ablation-replace --hold`): `$600,000.00` / `180,000.00`, `$50,000.00` / `2,000.00`, `$200,000.00` / `200,000.00` - this branch: `$600,000.00` / `$180,000.00`, `$50,000.00` / `$2,000.00`, `$200,000.00` / `$200,000.00` Restored after the reading: blob == HEAD, `git diff HEAD` empty. </details> <details><summary>Ablation (each fix removed, then restored)</summary> `@object-ui/*` resolves to source in ui vitest, so no rebuild between legs. - Grid: `node scripts/ablation-replace.mjs --file ui/packages/plugin-grid/src/objectGridGenerateColumns.tsx --anchor "fieldMeta.returnType = " --expect 3 --replacement "fieldMeta.ablated27494 = " -- …gridFormulaCurrency-27494.test.tsx`. Landed: anchor 3 → 0, blob `90f02baa3e9c` → `6aac6616f1bb`. Red: `Tests 6 failed | 4 passed (10)`, the three "reads as money" cases and the three agreement cases, with grid cells `["1Open","Tower","$150,000.00","90,000.00","1,234.50","4,321"]`; the four controls and the reference stayed green, as predicted. Restored: blob == HEAD, `git diff HEAD` empty. - Detail: `--file ui/packages/plugin-detail/src/fieldEnrichment.ts --anchor " 'returnType'," --replacement " 'ablated27494',"`. Landed: anchor 1 → 0, blob `910282667aac` → `35f03459ed4a`. Red: `Tests 2 failed | 1 passed (3)` (`expected undefined to be 'currency'`; section text `…remaining90,000.00…`). Restored: blob == HEAD, `git diff HEAD` empty. A first grid leg was refused by the tool (`ANCHOR AMBIGUOUS`, nothing written) and re-run with `--expect 3`; the reading above is the second run. </details> <details><summary>Tests, type-check and gates</summary> All on the merged head `0191a4f9` (origin/main merged once, no file of `plugin-grid`, `plugin-detail` or `fields` moved by it; `@objectstack/spec` rebuilt after the merge). - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-grid/ packages/plugin-detail/` → `Test Files 595 passed | 1 skipped (596)`, `Tests 5347 passed | 18 skipped (5365)` (lock VERDICT command-exit 0). - `pnpm --filter @object-ui/plugin-grid run type-check` → exit 0; `pnpm --filter @object-ui/plugin-detail run type-check` → exit 0 (each runs `tsc --noEmit && tsc -p tsconfig.test.json`). - Derived gates (`node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`): 34 derived, 34 run, every one exit 0, reconciled with `--ran` (0 NOT-MEASURED, 0 UNRUN). `node scripts/check-sdui-manifest.mjs` and its `--self-test` are among them. `pnpm check:type-check-debt` first answered exit 3 (PREREQUISITE NOT MET: its closure build queued behind this branch's own test run on the shared lock) and was re-run alone under the lock: exit 0, 0 ledger entries above their recorded number. `pnpm --dir ui exec vitest run scripts/` → `Test Files 169 passed | 2 skipped (171)`. - `pnpm check:new-line-citations` (ui) → 0 new citations. - The families CI runs over the whole tree (the type-check lanes, `Lint UI`, `Test UI`, `Build & E2E UI`) are this PR's check-runs. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6CYFYwzxE4fR2Vr1sQo)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent fe9e856 commit 69991ff

5 files changed

Lines changed: 281 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/plugin-grid': patch
3+
'@object-ui/plugin-detail': patch
4+
---
5+
6+
fix(plugin-grid, plugin-detail): a formula declaring `returnType: 'currency'` reads as money in list cells and on the record page
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
A `Field.formula` with `returnType: 'currency'` and its own `currencyConfig` read as a bare grouped number (`90,000.00`) beside the currency fields it was computed from (`$150,000.00`). The formula cell already draws a declared currency through the currency cell, but the grid's configured columns and the record page's field enrichment rebuilt the field from a picked key list that left `returnType` out, so the cell never saw it. Both now hand `returnType` through beside `currencyConfig`, and the formula reads `$90,000.00`. A formula declaring `number`, or nothing, keeps the bare number.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/**
2+
* ObjectUI
3+
* Copyright (c) 2024-present ObjectStack Inc.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
/**
10+
* objectstack#27494: a formula's declared `returnType` reaches the record
11+
* page's cells through `ENRICHED_FIELD_METADATA_KEYS` (`enrichDetailField`),
12+
* the list `DetailSection`, `HeaderHighlight` and the summary chips share.
13+
*
14+
* The formula cell picks its face from `returnType`, and a `currency` one
15+
* draws through the currency cell with the formula's own `currencyConfig`.
16+
* The key list carried `currencyConfig` and `scale` but not `returnType`, so
17+
* a section entry naming the field (`{ name }`) handed the cell an undeclared
18+
* formula holding a JS number, and it read as a bare `90,000.00`.
19+
*
20+
* ── Directions on the base tree (predicted before the first run) ─────────
21+
* currency formula, enrichment and DetailSection RED (no returnType / `90,000.00`)
22+
* number formula control GREEN (the number face is right)
23+
*/
24+
25+
import { describe, it, expect, afterEach } from 'vitest';
26+
import { render, cleanup } from '@testing-library/react';
27+
import '@testing-library/jest-dom';
28+
import * as React from 'react';
29+
import { FieldSchema } from '@objectstack/spec/data';
30+
31+
import '@object-ui/components';
32+
import type { DetailViewSection } from '@object-ui/types';
33+
import { DetailSection } from '../DetailSection';
34+
import { enrichDetailField } from '../fieldEnrichment';
35+
36+
afterEach(cleanup);
37+
38+
const USD_FIXED = { currencyMode: 'fixed', defaultCurrency: 'USD' } as const;
39+
40+
const FIELDS = {
41+
budget: { type: 'currency', label: 'Budget', currencyConfig: USD_FIXED },
42+
// The showcase's Budget Remaining, as `project.object.ts` declares it.
43+
remaining: { type: 'formula', label: 'Budget Remaining', returnType: 'currency', currencyConfig: USD_FIXED, scale: 2 },
44+
// The control: a declared number keeps the bare grouped number.
45+
ratio: { type: 'formula', label: 'Burn Ratio', returnType: 'number', scale: 2 },
46+
};
47+
48+
const RECORD = { id: 'p1', budget: 150000, remaining: 90000, ratio: 1234.5 };
49+
50+
describe('a formula returnType reaches the record page cells (objectstack#27494)', () => {
51+
it('CONTROL: the fixture is a spec-valid formula field def', () => {
52+
expect(FieldSchema.safeParse({ name: 'remaining', expression: 'record.budget', ...FIELDS.remaining }).success).toBe(true);
53+
});
54+
55+
it('enrichDetailField copies returnType from the object field, and a view-entry one wins', () => {
56+
expect(enrichDetailField({ name: 'remaining' }, FIELDS.remaining).returnType).toBe('currency');
57+
expect(enrichDetailField({ name: 'remaining', returnType: 'number' }, FIELDS.remaining).returnType).toBe('number');
58+
});
59+
60+
it('DetailSection: the currency formula reads $90,000.00 beside the currency field; a number formula stays bare', () => {
61+
const section = {
62+
title: 'S',
63+
fields: [{ name: 'budget' }, { name: 'remaining' }, { name: 'ratio' }],
64+
} as unknown as DetailViewSection;
65+
const { container } = render(
66+
<DetailSection section={section} data={RECORD} objectSchema={{ fields: FIELDS }} />,
67+
);
68+
const text = container.textContent ?? '';
69+
expect(text).toContain('$150,000.00');
70+
expect(text).toContain('$90,000.00');
71+
expect(text, 'CONTROL: a number formula keeps the bare grouped number').toContain('1,234.50');
72+
expect(text).not.toContain('$1,234.50');
73+
});
74+
});

‎ui/packages/plugin-detail/src/fieldEnrichment.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ export const ENRICHED_FIELD_METADATA_KEYS = [
216216
// The SPEC channel for a per-field currency (a bare `currency` key is
217217
// designer/DB-only) — resolveFieldCurrency reads it second (#2548).
218218
'currencyConfig',
219+
// A formula's declared result type, which picks its face in the formula
220+
// cell: `currency` draws through the currency cell with the
221+
// `currencyConfig` above. Without it a money formula read as a bare number.
222+
'returnType',
219223
'precision',
220224
'scale',
221225
// The author's digit-grouping hint, which overrides `scale`'s scale-0
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
/**
2+
* ObjectUI
3+
* Copyright (c) 2024-present ObjectStack Inc.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
/**
10+
* objectstack#27494: a formula declaring `returnType: 'currency'` reads as
11+
* money on the grid cell, the same face as the currency field beside it.
12+
*
13+
* The formula cell (`FormulaCellRenderer`) picks its face from the declared
14+
* `returnType`, and a `currency` one draws through `CurrencyCellRenderer` with
15+
* the formula's own `currencyConfig`. The three configured-column paths built
16+
* the cell's `fieldMeta` bag from a picked key list that carried
17+
* `currencyConfig` and `scale` but not `returnType`, so the cell saw an
18+
* undeclared formula holding a JS number and drew the number face: the
19+
* showcase's Budget Remaining read `90,000.00` beside Budget's `$150,000.00`.
20+
*
21+
* The tenant is EUR on purpose: the formula's `$` can then only come from its
22+
* own `fixed` `currencyConfig`, never from a tenant fallback.
23+
*
24+
* ── Directions on the base tree (predicted before the first run) ─────────
25+
* currency formula, each of the three paths RED (`90,000.00`)
26+
* agreement with the whole-def formula cell RED (the currency row)
27+
* number formula / undeclared formula GREEN (the number face is right)
28+
* auto-generated columns (whole def, no bag) GREEN (the reference face)
29+
*/
30+
31+
import React from 'react';
32+
import { describe, it, expect, beforeAll, afterEach, vi } from 'vitest';
33+
import { render, screen, waitFor, cleanup } from '@testing-library/react';
34+
import '@testing-library/jest-dom';
35+
import { I18nProvider, LocalizationProvider } from '@object-ui/i18n';
36+
import { FormulaCellRenderer, registerAllFields } from '@object-ui/fields';
37+
import { ActionProvider, SchemaRendererProvider } from '@object-ui/react';
38+
import { ObjectGrid } from '../ObjectGrid';
39+
40+
registerAllFields();
41+
42+
beforeAll(() => {
43+
if (!Element.prototype.scrollIntoView) {
44+
Element.prototype.scrollIntoView = vi.fn() as unknown as Element['scrollIntoView'];
45+
}
46+
});
47+
48+
afterEach(cleanup);
49+
50+
/** A EUR tenant: a `$` in a cell is the field's own fixed currency. */
51+
const TENANT = { currency: 'EUR', locale: 'en' };
52+
53+
const OBJECT = 'os_27494_project';
54+
55+
const USD_FIXED = { currencyMode: 'fixed', defaultCurrency: 'USD' };
56+
57+
const FIELDS: Record<string, Record<string, unknown>> = {
58+
id: { type: 'text' },
59+
name: { type: 'text', label: 'Project Name' },
60+
budget: { type: 'currency', label: 'Budget', currencyConfig: USD_FIXED },
61+
// The showcase's Budget Remaining, as `project.object.ts` declares it.
62+
remaining: {
63+
type: 'formula',
64+
label: 'Budget Remaining',
65+
returnType: 'currency',
66+
currencyConfig: USD_FIXED,
67+
scale: 2,
68+
},
69+
// Controls: a declared number, and a formula declaring nothing.
70+
ratio: { type: 'formula', label: 'Burn Ratio', returnType: 'number', scale: 2 },
71+
bare: { type: 'formula', label: 'Bare Result' },
72+
};
73+
74+
const ROW = { id: 'p1', name: 'Tower', budget: 150000, remaining: 90000, ratio: 1234.5, bare: 4321 };
75+
const FORMULA_FIELDS = ['remaining', 'ratio', 'bare'] as const;
76+
const SHOWN = ['budget', ...FORMULA_FIELDS] as const;
77+
78+
function Providers({ children }: { children: React.ReactNode }) {
79+
return (
80+
<I18nProvider config={{ defaultLanguage: 'en', detectBrowserLanguage: false }} persistLanguage={false}>
81+
<LocalizationProvider value={TENANT}>{children}</LocalizationProvider>
82+
</I18nProvider>
83+
);
84+
}
85+
86+
/** What the formula cell renders for `field` when handed the WHOLE def. */
87+
function wholeDefCell(field: string): string {
88+
const { container, unmount } = render(
89+
<Providers>
90+
<FormulaCellRenderer value={ROW[field as keyof typeof ROW]} field={{ name: field, ...FIELDS[field] } as any} />
91+
</Providers>,
92+
);
93+
const text = container.textContent ?? '';
94+
unmount();
95+
return text;
96+
}
97+
98+
function makeDataSource() {
99+
return {
100+
find: vi.fn(async () => ({ data: [ROW], total: 1, hasMore: false, pageSize: 50 })),
101+
getObjectSchema: async (name: string) => ({ name, fields: structuredClone(FIELDS) }),
102+
} as never;
103+
}
104+
105+
/**
106+
* Render the grid and wait for the ENRICHED columns: the header reads the
107+
* def's label in the same memo pass that builds the cell bag, so it is the
108+
* signal that the bag was built from the object schema.
109+
*/
110+
async function renderGrid(schemaExtra: Record<string, unknown>) {
111+
const ds = makeDataSource();
112+
const utils = render(
113+
<Providers>
114+
<ActionProvider>
115+
<SchemaRendererProvider dataSource={ds}>
116+
<ObjectGrid
117+
schema={{
118+
type: 'object-grid',
119+
objectName: OBJECT,
120+
data: { provider: 'value', items: [ROW] },
121+
pagination: { pageSize: 50 },
122+
...schemaExtra,
123+
} as never}
124+
dataSource={ds}
125+
/>
126+
</SchemaRendererProvider>
127+
</ActionProvider>
128+
</Providers>,
129+
);
130+
await waitFor(() => expect(screen.getAllByText('Budget Remaining').length).toBeGreaterThan(0));
131+
return utils;
132+
}
133+
134+
function cellTexts(container: HTMLElement): string[] {
135+
return Array.from(container.querySelectorAll('tbody td')).map((td) => (td.textContent ?? '').trim());
136+
}
137+
138+
/** The three configured-column paths that build a `fieldMeta` bag. */
139+
const PATHS: Array<[string, Record<string, unknown>]> = [
140+
['ListColumn objects', { columns: [{ field: 'name' }, ...SHOWN.map((field) => ({ field }))] }],
141+
['string columns', { columns: ['name', ...SHOWN] }],
142+
['inline rows + fields projection', { fields: ['name', ...SHOWN] }],
143+
];
144+
145+
describe('a returnType currency formula reads as money on the grid cell (objectstack#27494)', () => {
146+
it.each(PATHS)('%s: the currency formula reads as money beside the currency field', async (_path, schemaExtra) => {
147+
const { container } = await renderGrid(schemaExtra);
148+
const cells = cellTexts(container);
149+
expect(cells, `cells: ${JSON.stringify(cells)}`).toContain('$150,000.00');
150+
expect(cells).toContain('$90,000.00');
151+
expect(cells).not.toContain('90,000.00');
152+
});
153+
154+
it.each(PATHS)('%s: control, a number formula and an undeclared one keep the bare number', async (_path, schemaExtra) => {
155+
const { container } = await renderGrid(schemaExtra);
156+
const cells = cellTexts(container);
157+
expect(cells, `cells: ${JSON.stringify(cells)}`).toContain('1,234.50');
158+
expect(cells).toContain('4,321');
159+
});
160+
161+
it.each(PATHS)('%s: every formula cell reads what the whole-def formula cell reads', async (_path, schemaExtra) => {
162+
const { container } = await renderGrid(schemaExtra);
163+
const cells = cellTexts(container);
164+
cleanup();
165+
for (const field of FORMULA_FIELDS) {
166+
const expected = wholeDefCell(field);
167+
expect(cells, `${field}: whole-def cell reads ${expected}; grid cells ${JSON.stringify(cells)}`).toContain(expected);
168+
}
169+
});
170+
});
171+
172+
describe('the reference the configured paths now match (objectstack#27494)', () => {
173+
// The auto-generated columns hand the cell the WHOLE field def and build no
174+
// bag, so they read the declared face on the base tree. GREEN there by
175+
// design: it names the face the three configured paths disagreed with.
176+
it('auto-generated columns: the currency formula reads as money', async () => {
177+
const { container } = await renderGrid({});
178+
const cells = cellTexts(container);
179+
expect(cells).toContain('$90,000.00');
180+
expect(cells).toContain('1,234.50');
181+
});
182+
});

‎ui/packages/plugin-grid/src/objectGridGenerateColumns.tsx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,12 @@ export function useObjectGridGenerateColumns({
340340
// Dropped, the cell fell through to the tenant currency while the
341341
// metric tile and every whole-def cell read the field's own.
342342
if (objectDefField.currencyConfig) fieldMeta.currencyConfig = objectDefField.currencyConfig;
343+
// A formula's declared `returnType` picks its face in the
344+
// formula cell (`FormulaCellRenderer`): `currency` draws through
345+
// the currency cell with the `currencyConfig` above. Dropped
346+
// here, a money formula fell to its value's JS type and read as a
347+
// bare number (`90,000.00`) beside its currency sources.
348+
if (objectDefField.returnType !== undefined) fieldMeta.returnType = objectDefField.returnType;
343349
if (objectDefField.precision !== undefined) fieldMeta.precision = objectDefField.precision;
344350
if ((objectDefField as any).scale !== undefined) (fieldMeta as any).scale = (objectDefField as any).scale;
345351
// objectui#11026 — the author's digit-grouping hint rides beside
@@ -602,6 +608,8 @@ export function useObjectGridGenerateColumns({
602608
if (fieldDef.currency) fieldMeta.currency = fieldDef.currency;
603609
// Verbatim, as the ListColumn path copies it (objectui#10354).
604610
if (fieldDef.currencyConfig) fieldMeta.currencyConfig = fieldDef.currencyConfig;
611+
// The formula's face, as path A copies it.
612+
if (fieldDef.returnType !== undefined) fieldMeta.returnType = fieldDef.returnType;
605613
if (fieldDef.precision !== undefined) fieldMeta.precision = fieldDef.precision;
606614
if ((fieldDef as any).scale !== undefined) fieldMeta.scale = (fieldDef as any).scale;
607615
// Beside `scale`, as path A copies it (objectui#11026).
@@ -791,6 +799,8 @@ export function useObjectGridGenerateColumns({
791799
if (fieldDef.currency) fieldMeta.currency = fieldDef.currency;
792800
// Verbatim, as the ListColumn path copies it (objectui#10354).
793801
if (fieldDef.currencyConfig) fieldMeta.currencyConfig = fieldDef.currencyConfig;
802+
// The formula's face, as path A copies it.
803+
if (fieldDef.returnType !== undefined) fieldMeta.returnType = fieldDef.returnType;
794804
if (fieldDef.precision !== undefined) fieldMeta.precision = fieldDef.precision;
795805
if ((fieldDef as any).scale !== undefined) fieldMeta.scale = (fieldDef as any).scale;
796806
// Beside `scale`, as path A copies it (objectui#11026).

0 commit comments

Comments
 (0)