fix(tree): render with object-shaped columns + offer Tree in Create View dialog - #2009
Merged
Conversation
…iew dialog
ObjectTree crashed ('e.replace is not a function') when a host like ListView
passed its columns as field *objects* ({name,label,...}) rather than bare
strings — fieldLabel() called .replace() on the object. Normalize every field
entry to its string key in getTreeConfig (parentField/labelField/fields).
The Create View dialog had a hardcoded type list with no 'tree' entry, so
users couldn't create a tree view from the UI. Add a Tree card (ListTree icon)
with a required parentField picker (self-referencing tree/lookup/master_detail
field) and zh/en i18n.
Regression test covers the object-shaped-columns crash.
|
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.
问题
object-tree渲染崩溃 —Component "object-tree" failed to render: e.replace is not a function。ListView 把视图列以字段对象(
{name,label,…})而非字符串数组传给 ObjectTree,而fieldLabel()直接对其调用.replace()→ 抛错。新建视图弹窗看不到 tree —
CreateViewDialog的视图类型列表是写死的 8 项,没有 tree,所以无法从 UI 创建树形视图。修复
getTreeConfig新增fieldKey()归一化,parentField/labelField/fields同时接受字符串和字段对象(name|fieldName|field|key),不再崩溃。ListTree图标)+ 必填的"父级字段"选择器(限自引用tree/lookup/master_detail字段),并补 zh/en 文案。对象没有自引用字段时该卡片自动置灰("当前对象不支持"),与其它视图类型一致。验证
pnpm --filter @object-ui/plugin-tree test→ 6 passed(原 5 + 新增 1)。