@fastbaas/admin-pages
v0.1.0-beta.1
Published
Reusable FastBaaS user and role administration pages for React applications.
Readme
@fastbaas/admin-pages
Reusable FastBaaS administration pages for React applications. The package contains the production user list, user editor, role list, role editor, and role permission workbench used by FastBaaS Dashboard.
The package does not own routing or a FastBaaS client singleton. The host
provides an AdminPagesApi, translation function, current user, and page route
metadata through FastBaaSAdminPagesProvider.
import { FastBaaSAdminPagesProvider } from "@fastbaas/admin-pages/provider";
import { FastBaaSUsersPage } from "@fastbaas/admin-pages/users";
import "@fastbaas/admin-ui/styles.css";
import "@fastbaas/admin-pages/styles.css";
<FastBaaSAdminPagesProvider
api={adminPagesApi}
currentUser={user}
locale="zh-CN"
translate={translate}
pageRoutes={adminMenuRoutes}
>
<FastBaaSUsersPage
search={{ page: 1, q: "" }}
onSearchChange={(search) => updateUrl(search)}
/>
</FastBaaSAdminPagesProvider>;Use FastBaaSRolesPage, FastBaaSRoleEditor, and
FastBaaSRoleEditPage in the same provider. Routing callbacks stay in the host,
so TanStack Router, React Router, Next.js, and a custom desktop shell can all
reuse the same pages.
pageRoutes may include a group label and extensionId. The role editor keeps
page permissions in the existing role Permission collection, displays them by
host extension or navigation section, and migrates legacy API-only roles to the
configured page-permission namespace on save. After saving, the provider's
refreshCurrentUser/onCurrentUserChange flow should invalidate the host route
guard so newly granted or revoked visibility takes effect immediately.
Prefer the ./users, ./roles, ./role-editor, and ./role-edit subpath
exports in route modules. They preserve route-level code splitting in dev and
production builds. The package root remains available for non-lazy consumers.
