Feature #10971
openClient Management — Role-Based Filtering for Assigned Manager and Assigned To Selection
0%
Description
Designed, developed, and deployed an enhanced role-based filtering interface for the client management module across customer creation and edit workflows (ClientForm.tsx, CreateClient.tsx).
Background & Operational Need:
In the customer management workflow, assigning project managers and site representatives required searching through an unstructured, growing global list of company users. As the organization expanded, searching by name alone became prone to selection errors and inefficiencies, especially across large departments. Furthermore, an investigation of the UI revealed that the existing role filter was artificially hardcoded to only 3 roles (Admin, Office Manager, Site Manager), completely excluding other internal operational roles.
Technical Implementation & Architecture:
1. Dynamic Role Filter Component:
- Added a dedicated "Filter by Role" dropdown above both the "Assigned Manager" and "Assigned To" search autocomplete inputs.
- Staff can now constrain the user search space to a specific role before executing a name search, ensuring only qualified personnel are assigned.
2. Complete Internal Staff Role Integration:
- Audited the backend user search endpoint (/users/search) and confirmed it accepts dynamic role parameters without restrictions.
- Expanded frontend role definitions to cover all 12 internal staff roles: SuperAdmin, Admin, Project Manager, Site Manager, Office Manager, Sales Representative, Surveyor, Electrical Engineer, Permit Specialist, Field Staff, Finance, and Support.
3. State Synchronization & Cleanup:
- Built reactive lifecycle hooks: selecting or changing a role immediately clears mismatched previous selections, re-triggers the filtered user query, and prevents orphaned state.
- Implemented debounced query dispatching to optimize API calls during rapid typing.
4. Testing & Verification:
- Verified that role filtering correctly restricts search results across all 12 roles.
- Validated keyboard navigation, screen reader accessibility, and UI responsiveness across desktop, tablet, and mobile displays.
Subtasks
Related issues