fix(fields): lookup「浏览全部记录」记录选择器 select 列按 schema options 解析 label(#3333) - #3347
Draft
baozhoutao wants to merge 1 commit into
Draft
fix(fields): lookup「浏览全部记录」记录选择器 select 列按 schema options 解析 label(#3333)#3347baozhoutao wants to merge 1 commit into
baozhoutao wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…chema fieldsMeta (#3333) The lookup "Browse all records" Record Picker handed cell renderers a bare { name, type } descriptor, so a select column had no options and fell back to title-casing the raw stored value (manufacturing -> "Manufacturing") while the list view and detail page showed the authored label. RecordPickerDialog now accepts fieldsMeta (the referenced object's schema fields map) and enriches each column's field descriptor from it — options (through the shared i18n option translation), currency, scale, precision, format, reference_to — mirroring the list view's column enrichment. String lookup_columns without a type inherit the schema field's type. LookupField passes the referenced object schema it already fetches for titleFormat. Fixes #3333 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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 free
to 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.
Fixes #3333
问题
新建/编辑表单里 lookup 字段打开的「浏览全部记录」记录选择器中,select 类型的列不解析 options label,直接渲染首字母大写的裸 value(
manufacturing→Manufacturing),而同一字段在列表视图和记录详情页均正确显示03 制造。根因
RecordPickerDialog.renderCellContent只把{ name, type }裸描述符交给共享 cell renderer;SelectCellRenderer拿不到options,落入humanizeLabel兜底(裸 value + title-case)。列表视图(ObjectGrid)则会从对象 schema 为列富化options(并过 i18n option 翻译),两个面因此不一致。修复(复用列表视图同一套字段格式化,不造一次性 formatter)
RecordPickerDialog新增可选fieldsMetaprop(引用对象 schema 的fieldsmap),按 ObjectGrid 同样的方式为每列富化字段描述符:options(经useSafeFieldLabel().translateOptions走 i18n)、currency/scale/precision/format/reference_to等;lookup_columns(列 def 无type)继承 schema 字段的type,与 typed 列格式一致;LookupField把它已为titleFormat拉取的refObjectSchema.fields传入;fieldsMeta的调用方行为完全不变(plugin-detail RelatedList 等在途 PR fix(plugin-detail): RelatedList 批量 lookup 标签走 ADR-0079 统一解析器,修复权限集列闪变为 API name (#3330) #3331 涉及面未触碰)。验证
RecordPickerDialog.selectLabel.test.tsx3 例:typed 列解析 label、字符串列继承 schema type 后解析 label、无 fieldsMeta 保持旧兜底;pnpm vitest run(新文件 3/3,LookupField×3 + deriveLookupColumns 共 23/23 通过);pnpm type-check(fields)通过;eslint 0 error;@object-ui/fieldspatch)。相关
🤖 Generated with Claude Code