Files
Zeke Zhang acb6871c43 fix(plugin-multi-portal): restore fixed Portal layout route names (#10535)
* fix(multi-portal): restore fixed portal route names

The fixed Admin and Mobile Portals were registered with a
`multiPortalLayout_<uid>` layout route name, so routes registered by core and
other plugins under the `admin.*` / `mobile.*` namespaces were rendered
outside the layout shell. The workflow task center, for example, lost its
header.

Register both fixed Portals with the built-in UI Layout route names again and
keep the uid based route name for user-created Portals only.

* test(plugin-map): fix partial flow-engine mock

The flow-engine mock in Map.test.tsx exposed only useFlowContext, so the
observer re-export went missing once the module graph reached core client-v2
components (Map -> settingsLink -> @nocobase/client-v2 barrel).

Spread the real module and override just useFlowContext, matching the
partial-mock pattern used by other client-v2 suites.
2026-09-23 07:26:36 +08:00

1.6 KiB

@nocobase/plugin-multi-portal

@nocobase/plugin-multi-portal is the built-in Portal registration and permission layer built on top of @nocobase/plugin-ui-layout. A Portal stores its device type in uiLayoutUid: admin-layout-model means Desktop and mobile-layout-model means Mobile. Portal availability depends on the Portal's own enabled state, not on a matching UI Layout record.

For Client V2, enabled No-code Portals are the only source of registered Portal routes. Fresh applications use Portal-scoped entry and route permissions. The fixed Admin and Mobile Portals created while upgrading an existing application continue to use UI Layout route ownership and role permissions, so Client V1 and Client V2 share the same route tree without copying ACL data. Because of that ownership, the fixed Admin and Mobile Portals are registered with the built-in UI Layout route names (admin and mobile). Core and other plugins register routes inside those namespaces (for example admin.workflow.tasks), so the names must stay stable. Portals created by users can share a UI Layout and therefore get the multiPortalLayout_<uid> route name.

UI Layout remains the layout and route-model base, and Client V1 keeps its existing UI Layout registration behavior. AI Portals remain separate /x entries and do not register No-code layouts in Client V2.

The authCheck route option is not a complete public-access solution. Public portals or layouts must be implemented by plugin code that explicitly registers the route and provides matching public APIs, permission boundaries, and resource validation.