FeatureTogglePage
Component Detail
Description
Administrative UI page that displays all available platform modules as toggleable switches for Organization Admins. Each toggle row shows the module name, current enabled state, and a confirmation mechanism before persisting changes. The page reads the current enabled set at load time and reflects changes optimistically while awaiting server confirmation.
feature-toggle-page
Sources & reasoning
Lines 232-248 define the module-toggle architecture as the core mechanism for serving four divergent organizations from one codebase. The Feature Toggles page is the sole configuration surface for this system. Always-on status (line 241) and the circular-dependency constraint confirm no deferral is possible - this is MVP.
-
docs/source/likeperson.md · line 232-235Module = Area. The canonical areas defined in the area taxonomy (section 8) are the unit of toggling. Each area ID (e.g. expense-reimbursement, encrypted-assignments, certification-training) is a module that can be enabled or disabled per tenant.
-
docs/source/likeperson.md · line 241admin-organization is always-on because it hosts the Feature Toggles UI itself - disabling it would remove the only place toggles can be re-enabled (circular dependency).
-
docs/source/likeperson.md · line 237-238Backend is the source of truth. The API exposes the enabled module set for the current user's tenant as part of the session/bootstrap response. Every endpoint that belongs to a module checks the tenant's enabled set before executing
Responsibilities
- Render the full list of platform modules with their current enabled/disabled state
- Provide toggle controls restricted to users with the Organization Admin role
- Confirm destructive toggle-off actions before submitting to the service layer
- Display success and error feedback after each toggle operation
- Prevent toggling of the Feature Toggles module itself (always-on enforcement)
Interfaces
loadModuleStates(): Promise<ModuleToggleState[]>
handleToggle(moduleId: string, enabled: boolean): Promise<void>
renderToggleRow(module: ModuleToggleState): ReactNode
Related Data Entities (2)
Data entities managed by this component