Repository navigation
Commit 67103cc
feat(setup): Setup's metadata pages open Studio's All metadata area; the catalog's Active switch moves to each item's page (#28818)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbB5em8iozkeVyx4gPsLp6Qf)_
Fixes #28578
PR 2 of 2. PR 1, #28785, retired Packaged automation's flows half and
landed as `0aaad18f`. This PR carries Wanted 1, 2, 4 and 5 and the
card's tests. The split is recorded in claim amendment 6561871570.
## 维护者速读
- **改了什么**:设置里的元数据页面全部改为跳转到 Studio
的"全部元数据"区域,每条路由和旧别名都在一跳内到达,`?package`、`?scope`、`?review`
原样保留。数据源例外,仍留在设置。设置导航移除岗位、能力、权限集、声明式共享规则四项。主页移除"对象管理"侧边栏入口和"管理对象"卡片。目录的启用开关移到每个条目自己的页面上。Studio
不再链接到设置的元数据页面。旧的打包自动化书签现在跳到对应软件包的自动化栏。
- **为什么改**:ADR-0146 D1 规定设置不再有元数据编辑器和元数据目录,这些都由 Studio
的"全部元数据"区域承担。开关放在条目页面,依据的是 M-1 裁定 6554738464。
- **风险与回滚**:只有 `setup.access`、没有 `studio.access` 的管理员,今后要在 Studio
里切换这些条目,需要给他们补授 `studio.access`。changeset 里写了这一点。旧书签和外部链接会被重定向,不会失效。回滚就是
revert 本 PR。
-
**先看**:`ui/packages/app-shell/src/views/studio-design/setupMetadataRedirect.ts`、`ui/packages/app-shell/src/console/AppContent.tsx`(`SetupMetadataRoute`、`LegacyMetadataRedirect`、`PackagedAutomationRedirect`)、`ui/packages/app-shell/src/views/metadata-admin/CatalogActiveSwitch.tsx`。
- **两分钟验证**:打开 `/apps/setup/metadata/position?scope=environment`,应跳到
`/studio/~all/metadata/position?scope=environment`。打开一个岗位,页面上有"启用"开关。打开
`/apps/setup/metadata/datasource`,仍停留在设置。
- **需要你做的**:确认发布说明里关于 `studio.access` 的提示是否足够。
## What changes
- **Every Setup metadata route redirects** (`@object-ui/app-shell`). All
of the `/apps/<app>/metadata` routes, on both `AppContent` branches,
render `SetupMetadataRoute`: the index, `_diagnostics`, `:type`,
`:type/new`, `:type/:name` and `:type/:name/history`. It navigates to
`setupMetadataStudioPath(rest, search, hash)`, which keeps the path
below `metadata`, keeps the query, and puts the URL on the leg its query
names through `areaLocationRedirect`. That leg is `?package=X` for X's
leg, and `?scope=environment` or `?package=all` for `~all`. The area
adds no second hop. `LegacyMetadataRedirect`
(`component/metadata/{directory,resource/*}`) now goes to Studio
directly. The `metadata*` rows leave `APP_ROUTE_CHUNKS`.
- **The datasource stays.** `setupMetadataStudioPath` returns `null` for
`datasource…`, so those routes render the metadata-admin pages they
always did. The area's own `datasource/*` route sends them back to
Setup, so redirecting them would loop.
- **The console's aliases** (`@object-ui/console`). `ObjectRedirect`,
`MetadataRedirect` and `SystemCatalogRedirect` call the same helper,
exported from `@object-ui/app-shell`, so `system/objects`,
`system/metadata` and `system/{roles,positions,permissions}` land in
Studio in one hop.
- **Retired Packaged automation bookmarks** (the seat asked for this
after #28785). `component/automation/packaged` is a static route ahead
of `component/:ns/:name`. It opens `/studio/<package>/automations` with
the query kept when `?package=` names a package. When no package is
named, it opens `/studio/~all/metadata/flow`, the area's cross-package
flow list, because the pillar is per package.
- **The review hop.** `DraftReviewNavigator` (the chat's "Review N
changes") opens `…/metadata/<type>/<name>?review=1` in Studio.
- **Nav and Home.** `plugin-security` drops its `group_access_control`
contribution (`nav_positions`, `nav_capabilities`,
`nav_permission_sets`), and `plugin-sharing` drops
`nav_declared_sharing_rules`. Their labels leave the four locales and
the source-hash files, and the four ids join the dead-key tombstone.
`UnifiedSidebar` drops `sys-objects`, and `QuickActions` drops the
Manage Objects card.
- **The Active switch moves to the item's page** (M-1 ruling A, comment
6554738464). The list's switch, its confirm dialog and its ledger cell
move into `CatalogActiveSwitch.tsx`. `CatalogItemActiveSwitch` is that
switch for one item: it reads the ledger, runs the holder-count confirm
for permission sets and positions, writes, and toasts. The area's item
pages mount it: position and sharing rule through `ResourceEditPage`'s
area sections, and permission set through `PermissionMatrixEditor`. The
area's list keeps its column.
- **Studio stops linking into Setup.** `BuilderLanding` drops
`overlayPath` and the "Open in Setup" overlay link, along with its two
Studio-namespace strings. `StudioReadOnlyLink` links the item's page in
the area.
- **Live specs** (`ui/e2e/live`). `studio-object-designer`,
`studio-editor` and the nightly `declared-sharing-rules-reach-13091` now
open Studio URLs.
## Why
ADR-0146 D1 says Setup carries no metadata editor and no metadata
catalog, and Studio's "All metadata" area (#28561) serves those pages.
Old Setup links should land there rather than break. The datasource is
runtime configuration, so it stays in Setup.
## Tests
- New `AppContent.setupMetadataStudio-28578.test.tsx` holds the redirect
table over every route and alias. It runs on the with-app branch (as
`setup` and as `crm`) and the zero-app branch. Every row asserts the
whole chain, which shows one hop. The table covers `?package`, `?scope`,
`?review` and the hash. It checks that the datasource routes and the
`?type=datasource` alias stay on their pages, and that
`metadata/package/*` keeps its target. It pins the Packaged automation
bookmark, with a control that `automation:packaged-actions` still
resolves.
- New `setupMetadataRedirect.test.ts` covers the helper. It includes a
check that each target is already on its leg, so the area adds no second
hop, and it covers `packagedAutomationStudioPath`.
- New `noSetupMetadataLink-28578.test.ts` is the source grep pin. It
reads every non-test file under `views/studio-design/` with comments
masked and refuses any `/apps/<app>/metadata` spelling. The datasource
is exempt. The matcher has a control. Run against the `272fec05` copies
of `StudioDesignSurface.tsx` and `BuilderLanding.tsx`, it catches the
base's links.
- New `CatalogActiveSwitch.itemPage-28578.test.tsx` checks the switch
for each type. Off asks with the holder count, Cancel writes nothing,
and on writes at once. A sharing rule writes with no holder read. A
viewer who cannot author gets no click, and a refused read is stated in
words. A source pin checks where the item pages mount the switch.
- Inverted nav pins:
- `people-org-assignment-nav-contribution.test.ts`: the catalog entries
are gone;
- `systemNavObjectsHop.test.tsx`: there is no Object Manager entry;
- `systemNavSettingsTarget.test.tsx`: eight entries;
- `QuickActions.settingsTarget.test.tsx`: there is no Manage Objects
card.
- The extended tombstone has four ids.
- Route tests are re-pointed at Studio: `pseudoRouteSegments`,
`noAppComponentRoutes`, `bootRedirectCoverage`,
`emptyNavigationLanding-12079`, `setupItemRoutesVerdict-12706`, and the
console's `legacyRedirects` and `systemHubRoutes`. Studio tests are
updated for the removed link: `readonlyRoutes-11808`, `setupExit-12513`,
`environmentOverlayCopy-12171`, `StudioReadOnlyLink.overlay-27356` and
`metadataAreaHost.gates-28561`.
## Verification
Head `50d583ef` on `0aaad18f`.
- ui: 332 test files in two locked batches (`--maxWorkers=2`) on the
rebased head, 3594 tests, all green. The set is every app-shell and
console test that names the touched modules or a Setup metadata URL
(`AppContent`, `setupMetadataRedirect`, `UnifiedSidebar`,
`QuickActions`, `BuilderLanding`, `StudioReadOnlyLink`,
`CatalogActiveSwitch`, `ResourceListPage`, `ResourceEditPage`,
`PermissionMatrixEditor`, `catalog-activation`, `apps/setup/metadata`,
`automation/packaged`, …). The full app-shell suite is left to CI's Test
UI shards.
- `@objectstack/platform-objects`: 107 files and 1497 tests.
`@objectstack/plugin-security`: 238 files and 5126 tests.
`@objectstack/plugin-sharing`: 59 files and 1305 tests. All green.
- Type-check: `@object-ui/app-shell` and `@object-ui/console` are green
after `turbo run build --filter='@object-ui/console^...'` on the new
main.
- `node scripts/pm/dispatch-gates.mjs --commands`: 67 commands, 66 exit
0, including `check-sdui-manifest`, `check:i18n` (bundles in sync),
`check:platform-checklist`, `check:dual-build-cjs-loads` and `pnpm --dir
ui exec vitest run scripts/`. `check-plugin-teardown-shape --self-test`
exits 3 because this clone is shallow, so it is left to CI.
- `eslint` on the changed ui files: 0 errors.
- PR-body gates on this body: `check-changeset-no-major`,
`check-adr-0087-registration`, `check-closing-keyword-parity` and
`check-partof-closing-keyword` are green.
Clause-②: no
Metadata-protocol: none
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(`packages/spec` untouched.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request. (PR 2 of 2 for #28578; the split is the seat's call, recorded
on the card.)
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English, except the 维护者速读
section, which the lane writes in Chinese for the maintainer.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QsR2jRKMRpKnN9FkAvSWGr
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3b920f6 commit 67103cc
63 files changed
Lines changed: 1617 additions & 768 deletions
File tree
- .changeset
- docs/adr
- packages
- platform-objects/src/apps/translations
- plugins
- plugin-security/src
- plugin-sharing/src
- ui
- apps/console/src
- __tests__
- components
- e2e/live
- packages
- app-shell/src
- console
- __tests__
- home
- __tests__
- layout
- __tests__
- views
- metadata-admin
- studio-design
- i18n/src
- __tests__
- locales
- namespaces/studio
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 98 | | |
102 | | - | |
103 | 99 | | |
104 | 100 | | |
105 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 95 | | |
99 | | - | |
100 | 96 | | |
101 | 97 | | |
102 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 65 | | |
69 | | - | |
70 | 66 | | |
71 | 67 | | |
72 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 95 | | |
99 | | - | |
100 | 96 | | |
101 | 97 | | |
102 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 65 | | |
69 | | - | |
70 | 66 | | |
71 | 67 | | |
72 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
60 | 74 | | |
61 | 75 | | |
62 | 76 | | |
| |||
100 | 114 | | |
101 | 115 | | |
102 | 116 | | |
| 117 | + | |
| 118 | + | |
103 | 119 | | |
104 | 120 | | |
105 | 121 | | |
106 | 122 | | |
| 123 | + | |
| 124 | + | |
107 | 125 | | |
108 | 126 | | |
109 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 95 | | |
99 | | - | |
100 | 96 | | |
101 | 97 | | |
102 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 68 | | |
72 | | - | |
73 | 69 | | |
74 | 70 | | |
75 | 71 | | |
| |||
0 commit comments