fix(app-shell,plugin-grid,i18n): autonumber/readonly fields become match-only import targets so "update if the record number exists" works - #3061
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…tch-only import targets so "update if the record number exists" works
ObjectView dropped computed AND readonly/autonumber fields from the
ImportWizard's target list wholesale, so a record number (autonumber) could
never be mapped — and since match fields must be mapped columns, it could
never be the update/upsert match key either ("编号存在则更新" was impossible
from the UI even though the server import accepts any stored column as a
matchField).
The derivation (extracted to importTargetFields for unit tests) now keeps
storage-backed non-writable fields — autonumber and readonly, FLS-read
gated — as `matchOnly` targets: mappable, rendered with a "(match only)"
hint, never counted as a required write column. Their values still travel
in the rows (the server needs them to locate the record; the engine strips
readonly values from updates and respects explicitly-seeded values on
insert). Computed formula/summary fields stay excluded — no storage column
to match on. FLS-write-denied but readable fields degrade to match-only
instead of disappearing.
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.
问题
导入无法做「编号存在则更新」(EHR 真机复测 020):ObjectView 把 autonumber/readonly 字段整体排除出可映射字段,而匹配键只能从已映射列里选 → 记录编号(autonumber)永远进不了映射下拉、也永远当不了 update/upsert 匹配键。服务端导入其实不设限:任意存储列都可作
matchFields,引擎 update 自动剥 readonly 值、insert 尊重显式提供的编号——纯 UI 缺口。修复
packages/app-shell/src/views/importTargetFields.ts(可单测):ImportWizardfields 类型加matchOnly?: boolean,映射下拉渲染后缀;匹配键沿用现有「已映射列」推导,自动纳入。grid.import.matchOnlyField补齐 10 个语言包 + wizard 内置英文回退表(parity 门禁通过)。配合已有写入模式:映射编号列 →
Update existing→ Match on 勾编号,即得「编号存在则更新」。测试
importTargetFields.test.ts4 例(写入/仅匹配/computed 排除/FLS 读写门控/无权限通道回退)。🤖 Generated with Claude Code