Repository navigation
fix(app-shell): list a package's draft objects in the Access matrix, badged as drafts - #27064
Conversation
…badged as drafts The package door read the published object list only, so a package whose objects were all drafts showed "0 objects" and could not be secured before its first publish. Under a packageId the matrix now reads the draft-overlaid list and each object's definition through MetadataClient.withPreviewDrafts, as the object picker does, and marks a draft row with the picker's draft mark. The environment door keeps the published reads. Co-Authored-By: Claude <noreply@anthropic.com>
… draft-overlaid read Co-Authored-By: Claude <noreply@anthropic.com>
…fts with the client Co-Authored-By: Claude <noreply@anthropic.com>
席位核对ACCEPT · seat 席位意见:包作用域下的访问矩阵改走草稿叠加读取,草稿对象能列出、能展开字段、能授权,行上用对象选择器同款的「(草稿)」标记;环境作用域不变。
Generated by Claude Code |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 40637014766 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Warren · project thread
Fixes #26840
Clause-②: no
Metadata-protocol: none
维护者速读
PermissionMatrixEditor.tsx的对象列表读取与readObjectDefinition;新测试PermissionMatrixEditor.draftObjects-26840.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.draftObjects-26840,预期 5 个测试全绿。What changes
packageId, the matrix lists its objects throughMetadataClient.withPreviewDrafts(true)(the?preview=draftdoor the object picker'suseObjectCataloguses), so a package whose objects are all drafts lists them instead of "0 objects"._draft: true, the picker's signal) carries the picker's draft mark: a muteddata-draft-markerspan readingengine.inspector.draftSuffix("(draft)" / "(草稿)"), in both the page table and the Studio layout. No new marker, no new i18n key.ensureFields, andloadObjectFieldsfor the RLS and field-condition CEL editors) go through the same door under apackageId, via one helperreadObjectDefinition. Without it a draft-only object expands to "no fields".packageId) keeps the published reads unchanged; only the package door authors drafts. Pinned by a test that asserts no preview read and no draft row there.withPreviewDrafts() { return this; }(the Studio tests' existing precedent); five typed doubles widenFakeClientto=> unknownbecause that method returns the client, not a promise.Why
Triage ruling 6450953786: list draft objects too (with
preview=draft), badged as drafts, so a new package can be secured before its first publish.Tests
PermissionMatrixEditor.draftObjects-26840.test.tsx, 5 tests: a draft-only object is listed and badged (page and Studio layouts); a published object has no badge; toggling the draft object's Read writesobjects.a_invoice.allowReadinto the set draft (mode: 'draft',packageId: 'app.a'); its fields come from its draft; the environment door keeps the published list.PermissionMatrixEditPageplus 35StudioDesignSurfacetests naming the Access pillar, 73 files after dedupe): Test Files 73 passed, Tests 690 passed.pnpm --filter @object-ui/app-shell run type-check: exit 0.scripts/ablation-replace.mjs, anchor hit 1 to 0, blob f8f9c813 to 36feb5f1 and back,git diff HEADempty after restore): replacing the package-door list read with plainclient.listturns 4 of the 5 new tests red; the environment-door test stays green, as it should.Acceptance notes
origin/mainwas merged into this branch twice, the last time at3230bdbf._draft: trueand so carries the draft mark, the same as in the object picker.Verification
Derived gates (
dispatch-gates --commands) and their exits are in the os-dev report on #26840.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (CI)main, one pull request.@object-ui/app-shellis private:skip-changeset)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbYLTHkXTxBf89Sud8r
Generated by Claude Code