Skip to content

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

Open
ttrang-nguyen wants to merge 154 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 154 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
@rohit-r-kumar
Copy link
Copy Markdown
Contributor

@copilot review

Copy link
Copy Markdown
Contributor

Copilot AI commented May 25, 2026

@copilot review

Reviewed the branch at d1930992 and ran targeted validation in changed core areas (@ocom/application-services, @ocom/domain, @ocom/persistence, @ocom/graphql) plus workspace build; all passed with no regressions found. No additional code changes are required from this comment.

Rohit Kumar and others added 10 commits May 25, 2026 20:23
- Introduced ActivityLogEntry interface and updated StaffUserDetail to display activity logs.
- Enhanced StaffUserDetailContainer to manage and pass activity log data.
- Updated GraphQL schema to include activityByStaffUserDisplayName.
- Refactored tests to cover new activity log functionality.
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