Skip to content

Add staff users and staff roles pages to ui-staff user management section#257

Open
ttrang-nguyen wants to merge 186 commits into
mainfrom
rohit-r-kumar/issue250
Open

Add staff users and staff roles pages to ui-staff user management section#257
ttrang-nguyen wants to merge 186 commits into
mainfrom
rohit-r-kumar/issue250

Conversation

@ttrang-nguyen
Copy link
Copy Markdown
Contributor

@ttrang-nguyen ttrang-nguyen commented May 15, 2026

This pull request introduces significant improvements to staff user authentication, authorization, and theming in the UI. The main changes include the addition of a robust permissions hook for staff users, refactoring of staff route logic to use these permissions for access control and default routing, and enhancements to theme management via a shared utility. There are also updates to code generation and testing configurations.

Staff authentication and permissions:

  • Introduced a new useStaffPermissions hook that fetches the current staff user's roles and permissions from the backend, normalizes them, and exposes them for use throughout the app. This ensures consistent and centralized permission checks.
  • Refactored staff route logic in App.tsx to use the new permissions hook, providing permission-based routing and default route selection for staff users. The new StaffRoutes and StaffSection components dynamically render routes based on permissions and show a loading spinner while permissions are loading. [1] [2] [3]
  • Updated the AuthLanding component to use the new permissions hook, redirecting users to the appropriate landing page based on their permissions or to /unauthorized if access is denied.

Theme management improvements:

  • Added a new theme-storage.ts module to @cellix/ui-core that provides loadStoredTheme and saveStoredTheme utilities for consistent theme persistence. [1] [2]
  • Updated theme context implementations in both ui-community and ui-staff apps to use these new utilities, improving type safety and code reuse. Theme type is now strictly typed and stored/retrieved via the shared utility. [1] [2] [3] [4] [5] [6]

Code generation and testing configuration:

  • Expanded GraphQL code generation in codegen.yml to include staff user types and generate hooks for shared staff components, supporting improved type safety and developer experience. [1] [2]
  • Updated vitest.config.ts to exclude e2e tests from the test suite, improving test performance and accuracy.

Other improvements:

  • Added support types and questions for staff UI acceptance tests, enabling test actors to determine the correct staff landing route. [1] [2]
  • Minor: Renamed the Docusaurus clear script to clean for consistency.

These changes collectively improve the maintainability, security, and user experience of the staff-facing UI.

Rohit Kumar and others added 30 commits April 22, 2026 23:35
ttrang-nguyen and others added 30 commits May 29, 2026 10:34
…r components, update package dependencies and remove duplicate dependency
…es in pnpm-lock.yaml and pnpm-workspace.yaml
…router and react-router-dom to version 7.14.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add staff users and staff roles pages to ui-staff user management section

3 participants