fix(plugin-detail): related-list Add picker honours add.picker.labelField (#3365) - #3396
Merged
Merged
Conversation
…ield (#3365) The record:related_list Add dialog handed RecordPickerDialog only the target objectName, so the dialog fell back to displayField='name' with a single title-cased NAME column — assigning positions / granting permission sets showed machine names (admin_full_access) even though the platform page metadata declared picker.labelField: 'label'. The picker now leads with add.picker.labelField, lazily fetches the picker object's schema on first open, derives multi-column layout and headers via the shared deriveLookupColumns (now exported from @object-ui/fields), and formats cells type-aware via fieldsMeta + getCellRenderer — matching LookupField's picker behaviour. Without a schema the labelField column alone still replaces the machine-name fallback. Co-Authored-By: Claude Fable 5 <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 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.
Closes #3365
问题
record:related_list的 Add 记录选择器打开RecordPickerDialog时只透传了add.picker.object,页面元数据声明的picker.labelField从未传下去。弹窗于是落回组件默认displayField = 'name'+ 单列titleCase('name')表头:给用户「分配岗位 / 授予权限集」只能看着机器名(ehr_appr_qc_director、admin_full_access)猜要选哪个。除 issue 点名的用户记录页「岗位 / 权限集」两个页签外,岗位记录页「权限集」页签的「绑定权限集」(
sys-position.page.ts同样声明labelField: 'label')走同一通路,必然同症——本修复一并覆盖(platform-objects 全部 5 个add.picker入口共用这一个渲染点)。修法
packages/plugin-detail/src/RelatedList.tsx:displayField取add.picker.labelField(缺省仍'name')——即使 schema 拉不到,候选行也已显示业务可读名称;deriveLookupColumns派生多列布局,表头取字段声明的 label 而非titleCase(fieldName),与LookupField的记录选择器行为完全对齐;fieldsMeta+getCellRenderer,select/日期等列走类型感知渲染(与 [console] lookup「浏览全部记录」记录选择器:select 字段列不解析选项 label,显示首字母大写的裸 value(manufacturing → Manufacturing) #3333 同路)。packages/fields/src/index.tsx:导出deriveLookupColumns(其文档本来就写明 "shared with the detail-page related list",此前仅 LookupField 内部可用)。测试
RelatedList.addPickerLabelField.test.tsx:用sys_permission_set真实形状(name为机器名、label为显示名)断言弹窗显示「管理员完全访问」而非admin_full_access、表头取 schema 字段 label;另测 schema 拉取失败时 labelField 仍生效。已做红/绿验证(撤掉修复 2 测试全红)。🤖 Generated with Claude Code