QA Release: Tenant API field alignment, simplified role-permission search, and folder management fixes
Executive summary
This QA release bundles three frontend workstreams across the Admin and Mail apps: aligning user/batch API fields to the backend's new tenant_* naming, replacing the dual-input permission search in the role editor with a single global search plus smoother loading, and a set of folder-management fixes covering system-folder protection, department assignment, and grid display. Net change is +151/-101 lines across 18 files; no new features, primarily corrections and UX polish to keep the UI in sync with backend changes.
Why this was needed
The backend renamed its user/batch response and query fields (entity_id/entity_details -> tenant_id/tenant_details), so the frontend had to follow or those screens would read undefined data. Separately, the role-permission editor had usability and data-consistency problems: two separate search boxes, a skeleton 'flash' on every keystroke, and stale permissions briefly appearing when switching roles. Folder editing also had several concrete bugs: status updates sent the wrong field name, system folders could be edited and silently reverted, successful bulk updates sometimes showed a false 'skipped' warning, department lists raced with async data, and grid cells showed '-' instead of a legitimate value of 0.
Client / user impact
- Tenant-linked screens keep working: batch grid, mail/batch forms, and user-assignment modals correctly read tenant name/type after the backend rename, avoiding blank or missing organization labels.
- Clearer role editing: admins get one permission search box that filters both Available and Assigned columns at once, with a subtle inline 'Loading...' indicator instead of a jarring skeleton flash; switching between roles no longer briefly shows another role's permissions.
- Safer, more accurate folder management: system folders can no longer have their name/status changed (with an explanatory message), bulk folder activate/deactivate hits the right backend field, successful bulk updates no longer trigger a false warning toast, in-progress department assignments are no longer clobbered by late-arriving data, and grid columns now display 0 correctly.
Technical scope
Bundles feature PRs #853, #855, #856, #872. Key changes grounded in the diff:
- Tenant rename (PR #872):
EntityDetails->TenantDetailsandUserDetailsType.entity_details->tenant_detailsinuser.type.ts; six consumers updated (BatchForm,MailForm,AssignUserModal,BulkAssignUserModal,BulkAssignDepartmentsUsersModal,AddFolderModal);GetAllBatcheParams.entity_id->tenant_id. - Role permission search (PRs #855/#856): removed per-column
assigned_search/available_searchanduseDebounce, replaced with onepermissionSearch-> backendsearchparam inRoleFormDialog;RoleDetailParamsupdated accordingly; skeleton replaced with aLoader2overlay driven byisFetching;useRoleDetailaddsplaceholderDatascoped to the same role ID to prevent cross-role data leaks. - Folder fixes (PR #853):
handleToggleStatus,bulkActivateFolders/bulkDeactivateFolders, andBulkFolderStatusRequest/UpdateFolderRequestnow sendis_activeinstead ofstatus;EditFolderModalcollapses tenant/subtenant into a singleupdate_tenant_idand adds skipped-update detection with a word-boundary regex (\b0 successful\b) to fix the '10 successful' false-positive;FolderDetailsStepdisables name/status for system folders;AssignDepartmentsStepsyncs from props only when the user has not interacted; folder gridcolumns.tsxuses an explicit null/undefined/empty-string check so0renders instead of '-'.
Risk & mitigation
Low-to-moderate, contained to Admin and Mail UI. The main risk is the field-rename: if any backend endpoint still returns the old entity_* keys, affected screens would show blank tenant info — this hinges on the backend deploy matching. The folder status -> is_active and update_tenant_id payload changes similarly depend on backend acceptance of the new field names. Mitigation: changes are mechanical and type-checked, and QA should verify against the QA backend where the corresponding API changes are expected to be live; revert is straightforward since changes are isolated and additive-light.
QA validation focus
- Confirm tenant name/type render correctly in the batch grid, Add/Edit Batch and Mail forms, and the Assign/Bulk-Assign User and Add Folder modals.
- In the Admin role editor: search permissions and verify both Available and Assigned columns filter from the single box; confirm an inline 'Loading...' indicator (no full skeleton flash) during search/pagination; switch between roles and confirm no other role's permissions flash in.
- Folder management: toggle a folder's active status and run bulk activate/deactivate, confirming the change persists; verify a fully successful bulk update shows a success (not warning) toast; verify open editing a system folder disables Name and Status with the explanatory text.
- Department assignment: move departments around, let async data settle, and confirm in-progress selections are not reset; confirm a folder field whose value is 0 shows '0' in the grid, not '-'.