Repository navigation
Commit 39e9a82
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_
Fixes #36409
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
-
列表视图下拉的「添加视图」里,「共享」这个选项现在只给真正能保存共享视图的管理员;组织管理员以前能看到这个选项,点了却被服务器拒绝,现在不再显示。管理员新建的共享视图保存后立刻对所有人可见,不用另外发布。打开的视图如果已经不存在,会提示一次,然后显示默认视图。
-
属于「列表专题」,按维护者定的规则「只有管理员可以在前端界面创建共享视图」和「保存即生效」;把已有视图设为共享或取消共享,维护者说暂时不考虑,本
PR 不做。
- 若出错,影响的是管理员新建共享视图这一步:保存被拒时会提示原因,不会发布任何东西;本改动可以整体撤回,已存的视图不受影响。
- 无
## What changes
#36371 closed as not planned: the rule it asked for already holds
(correction 7077377066), and sharing or unsharing an existing view is
not wanted now. Building it measured three real faults at `origin/main`
3faabd2, which #36409 files; this PR fixes those three and nothing
else. The 「设为共享」 / 「取消共享」 row actions an earlier head carried are gone
(code, keys, tests, docs).
- **The server refusal already holds.** A shared view is `view` metadata
written through `PUT /api/v1/meta/view/:name`; that door, the publish
and the delete refuse any caller without `manage_metadata`
(`metaSaveVerdict`, ADR-0066 D1), answering `403 FORBIDDEN`. No server
code changes; the refusal is pinned with the shipped permission sets
(below).
1. **Who is offered Shared** (`mayShareViews`,
`objectViewViewSharing.ts`): an administrator whose session holds
`manage_metadata` (`useCanAuthorMetadata`). Add view used to ask
`isAdmin` alone, which is true for an organization administrator, who
does not hold the capability: they were offered Shared and the save
answered `403`.
2. **Shared at once.** A view created Shared used to be saved as a draft
(ADR-0034), invisible to everyone until someone published it. It is now
saved and published in one act through the door #35955 uses
(`saveAndPublishRuntimeMetadata`, ruling record 7058616478, the
maintainer's 「保存即生效」). That helper now saves a new view into the app's
package when the caller passes the app, as `createRuntimeMetadata` does
(objectstack#35624); existing callers pass none and are unchanged. A
refused save publishes nothing.
3. **A view that is gone.** A reader whose address names a view the
server answers `not_found` for is told so once, and the list shows its
default view, as it already did silently. `useMetaItemRefusal` gains
`absent` for that verdict.
Two new `@object-ui/i18n` keys under `view.switcher` (`shareNameTaken`,
`viewGone`) in every pack (zh-Hant regenerated), so `Clause-②: yes
(widening)`. `content/docs/ui/views.mdx` gains a Shared views paragraph.
No published skill describes this surface (`git grep` of `skills/` for
My views / shared view: zero hits), so no `Skills-docs:` line is owed.
Not done here: 「设为共享」 / 「取消共享」 on existing views (not now, per the
maintainer), saving into a shared view (#35955 step 2), the Manage views
page.
## Tests
- `packages/rest/src/meta-write-door-capability-enumeration.test.ts`,
new describe `#36409`: with the systemPermissions the shipped sets grant
(`securityDefaultPermissionSets`), a member (`member_default`) and an
organization administrator (`member_default` + `organization_admin`) are
refused the view's save, publish and delete `403 FORBIDDEN` with the
protocol never reached; the control, `admin_full_access`, reaches all
three.
- `ui/packages/app-shell/src/views/objectViewViewSharing.test.tsx`
(new): who is offered Shared (an administrator holding
`manage_metadata`; neither half alone); Create shared saves with the
first-write pin and publishes, then opens the view; a refused save is
said, reported unsaved, and publishes nothing; a name an unpublished
draft already holds is said (`shareNameTaken`) and nothing is published,
refreshed or opened.
-
`ui/packages/app-shell/src/views/runtime-metadata-persistence.saveAndPublishIntoApp-36409.test.ts`
(new, a real `MetadataClient` over the package doors' measured bodies):
with an app, a writable app package is named on the save; an installed
one gets the pair the ensure door returns; an unlisted one, `packageId:
null` or no app gets none; the publish and a refused publish's discard
name no package (ADR-0146 D8); a `dashboard` call ignores the app and
asks no package door.
### Readings at head b09dc55 (main ff60149 merged); `65544511` adds
the two pins
- `objectViewViewSharing.test.tsx` 3/3; `@object-ui/i18n` with the
switcher, sharing, in-place-create and census tests: 110 files, 2,032
passed; every `ObjectView*` test with `runtime-metadata-persistence`,
the census, the switcher, the sharing and in-place-create tests: 114
files, 1,021 passed. `meta-write-door-capability-enumeration.test.ts`:
72 passed.
- Ablation: `mayShareViews` reduced to `return isAdmin;` turns the
organization-administrator test red (1 failed / 2 passed); restored,
green.
- Derived gates (`dispatch-gates.mjs --ran`): 96 derived, 94 run, 2 NOT
MEASURED, 0 unrun. NOT MEASURED (prerequisite exit 3), left to CI:
`check-plugin-teardown-shape --self-test` (shallow-clone fixture) and
spec `check:skill-examples` (needs client-react declarations). `ui
vitest run scripts/`, spec `check:docs` and `check:dts-closure` were red
only until `@objectstack/spec` was rebuilt with declarations after the
main merge, then green. `check:dual-build-cjs-loads` stays red on this
container's tree alone: 75 findings, each a `.d.ts`/`.d.cts` of a
package this PR does not touch (`core`, the drivers, …) never emitted
here; CI's build is its reading.
- `overlap-check.mjs`: clean against main and every open PR head.
- At `65544511`: the new package pins 5/5 and the sharing test 4/4;
`runtime-metadata-persistence*` 8 files, 63 passed. Ablations:
`saveAndPublishRuntimeMetadata` reading `ctx.app` for every type turns
the dashboard pin red; resolving no package turns the four view pins
red; `publishNew` ignoring `'pending-draft'` turns the `shareNameTaken`
pin red; each restored, green. The test-reading gate families (27)
re-run at this tree: green but the one NOT MEASURED above.
## Acceptance notes
- **Organization administrators elsewhere on the list page: #36448.**
Manage views, the view settings panel and the Create View dialog still
gate on `isAdmin` alone, so an organization administrator without
`manage_metadata` is still offered those and refused by the server. This
PR narrows only the Shared choice #36409 names; #36448 carries the rest.
- **Organization administrators** were not driven live: the showcase
seeds no organization-administrator persona. Their gate is the unit pin
above and the server's `403` pin.
- **The de quote-pair count pin** (`de-quote-pairing-3876.test.ts`) is
no longer touched: the dropped German strings were the ones with quotes,
so #36387 owns that pin alone.
## Screenshots
Taken at `a0dfe1a4` in a live Console (`ui/apps/console` Vite against
`examples/app-showcase` `objectstack dev --seed-admin`), 1400×900 at 2×,
two accounts: the dev administrator `admin@objectos.ai` and the seeded
member persona `auditor.demo@example.com`, on Projects. That head still
carried the dropped row actions; the shots below show only what this PR
keeps, which the slimming did not change. The files are kept with the
project, named here as they are attached there.
- `a2-admin-addview-shared.png`: administrator, Add view with **My views
/ Shared**, Shared chosen, the hint under it. Created, it opened at once
as `showcase_project.key_projects`.
- `m1-member-menu.png`, `m2-member-addview.png`: the member, opening
that view by its address, finds it under Shared views straight away (no
publish step), and Add view has no My views / Shared choice.
- `m3-member-view-gone.png`: the member reloads the address of a view
that was removed: 「The view you opened is no longer available, so the
list shows its default view.」 over All Projects.
## Verification
Two-minute check: as a platform administrator, open a list's view
dropdown, Add view, choose Shared and create; sign in as a member and
open the list: the view is under Shared views at once, and Add view
offers no Shared choice.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jTPMb2q2wRssyREqhQ)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jTPMb2q2wRssyREqhQ -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent c13af73 commit 39e9a82
20 files changed
Lines changed: 568 additions & 7 deletions
File tree
- .changeset
- content/docs/ui
- packages/rest/src
- ui/packages
- app-shell/src
- hooks
- views
- i18n/src/locales
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
472 | 479 | | |
473 | 480 | | |
474 | 481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
703 | 704 | | |
704 | 705 | | |
705 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | | - | |
56 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
| |||
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
| 89 | + | |
82 | 90 | | |
83 | | - | |
| 91 | + | |
84 | 92 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
717 | 719 | | |
718 | 720 | | |
719 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
720 | 733 | | |
721 | 734 | | |
722 | 735 | | |
| |||
1143 | 1156 | | |
1144 | 1157 | | |
1145 | 1158 | | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1146 | 1177 | | |
1147 | 1178 | | |
1148 | 1179 | | |
| |||
1175 | 1206 | | |
1176 | 1207 | | |
1177 | 1208 | | |
1178 | | - | |
| 1209 | + | |
1179 | 1210 | | |
1180 | 1211 | | |
1181 | | - | |
| 1212 | + | |
1182 | 1213 | | |
1183 | 1214 | | |
1184 | 1215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
0 commit comments