Uh oh!
There was an error while loading. Please reload this page.
refactor(fields): migrate CurrencyField to the shared currency resolver - #1857
Merged
Conversation
Phase 2b migration (batch 1). `CurrencyField` (the currency form input + readonly display) read ONLY `field.currency`, so a field declaring its currency via `currencyConfig.defaultCurrency`, or relying on the tenant default, rendered symbol-less. - Extract `resolveFieldCurrency` from the giant `index.tsx` into a leaf `fields/src/currency.ts` (re-exported) so widget components can import it without an `index ↔ widget` cycle. Better hygiene; no API change. - `CurrencyField` now resolves via `resolveFieldCurrency(field, useLocalization() .currency)` — field currency → currencyConfig → tenant default → plain number. Tests: resolveFieldCurrency 4 + standard-widgets 18 pass; type-check green. Behavior unchanged when no provider / explicit field currency (the common case). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2b migration — batch 1
Follows the foundation #1856.
CurrencyField(currency form input + readonly display) read onlyfield.currency, so a field declaring its currency viacurrencyConfig.defaultCurrency— or relying on the tenant default — rendered symbol-less.resolveFieldCurrencyfrom the ~2k-lineindex.tsxinto a leaffields/src/currency.ts(re-exported from index, no API change), so widget components can import it without anindex ↔ widgetcircular import.CurrencyFieldnow resolves viaresolveFieldCurrency(field, useLocalization().currency)— field currency →currencyConfig→ tenant default → plain number.Remaining (staged, each a small mechanical swap onto the helper)
MetricWidget/ObjectDataTable(has i18n+fields).DetailView(plugin-detail),useColumnSummary(plugin-grid, + its stale "defaults to USD" comment),ObjectGantt,ObjectGrid,FieldFactory(react),elements:number(components),formatValue/PivotTable.formatCurrency(i18nenvs fieldsen-US) into one with a single locale.Tests
resolveFieldCurrency(4) +standard-widgets(18) pass;type-checkgreen. No behavior change with no provider or an explicit field currency (the common case).🤖 Generated with Claude Code