Skip to content

Commit 12d8d3b

Browse files
committed
docs(plugin-form): the record-form stamp names the hosts it reaches; changeset for the cross-currency pick follow-ups
Claude-Session: https://claude.ai/code/session_01WGufzhoBbwh8URjwQHde8v Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c113cb9 commit 12d8d3b

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/fields': patch
3+
'@object-ui/i18n': patch
4+
'@object-ui/plugin-form': patch
5+
---
6+
7+
fix(fields): a lookup pick that keeps an amount says so over a filled field too, a create form's opening fill no longer waits for ever on a parent it cannot read, and a pick that fills a currency code and an amount in it copies both
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
Three follow-ups to the cross-currency pick rule (a pick copies an amount only into a field in the same currency). Nothing is converted, and no metadata changes.
13+
14+
- **A pick over a filled amount says why it kept it.** When a pick would replace an amount that already holds a value (a re-pick in a line-item grid, or a declared pair with `overwrite: true`) and the picked amount is in another currency, the earlier value stays and the note now shows there too, ending "Unit Price still holds its earlier value." Before, the note showed only over an empty field, so the earlier product's price sat under the new product with nothing said. The note goes away once somebody edits the field.
15+
- **The opening fill of a create form no longer waits for ever.** A form opened with a lookup already holding a record (a related list's New, a URL prefill) fills its declared targets from it. When an amount there follows the currency of a parent the record names, the fill waited for that parent's read and never ran if the read failed, the data source cannot read single records (`findOne`), or the form names no parent object. Now the wait ends when the read answers, fails or cannot run: the other targets (a description) fill, and the amount is left empty with the note "the currency here could not be read".
16+
- **A pick that fills a code field and its amount together copies both.** An amount that follows the record's own code field (`currencyMode: 'record'`) is now judged against the line or record with the same pick's write to that code field applied, in the line-item grid and in the record form. Picking a product that carries `currency_code: EUR` and a price in it onto a fresh line now fills the code and the price, where the price was withheld with a "no currency is chosen" note beside the code the same pick had just written.
17+
18+
Also in `@object-ui/fields`: new exports `declaredPickWrites`, `judgePickWrites`, `withheldStillStands` and the type `PickWrite`; `AmountCurrency` gains the kind `unread`, `WithheldAutofill` the reason `targetCurrencyUnread` and the optional `held` (the value a target kept); `amountCurrencyOf` takes an optional third argument, the pick's own writes; `AutofillCurrencyContext.targetCurrency` is handed them as an optional second argument. In `@object-ui/i18n`: two new `lookup.*` sentences, `autofillCurrencyUnread` and `autofillKept`, in every locale pack. In `@object-ui/plugin-form`: the record-form stamp's documentation lists the hosts the rule reaches; no behaviour changes there.

‎ui/packages/plugin-form/src/recordFormStamp.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
* (objectstack#36249), and a target's currency is its definition's. A
3333
* target the form draws carries the name the form shows for it, so the
3434
* note about a target it did not fill names it the same way.
35+
* - The hosts this reaches are every record-form layout: `ObjectForm`'s
36+
* simple and sectioned arms, `TabbedForm`, `WizardForm`, `ModalForm` and
37+
* `DrawerForm`, and the forms drawn through `ObjectForm` (`MasterDetailForm`'s
38+
* header and line form, `EmbeddableForm`). A line-item grid judges its own
39+
* picks (`GridField`). A standalone `form` node drawn outside these hosts
40+
* holds no object field map, is not stamped, and its lookup copies as it
41+
* always did.
3542
*/
3643
import { RECORD_BEING_EDITED_KEY, withLookupAutofillTargets, withRecordBeingEdited } from '@object-ui/fields';
3744

0 commit comments

Comments
 (0)