Admin Hub Fixes: Create Buttons, User Entity Labels, and Live Inbox Counts
Executive summary
This release resolves three QA-reported defects in the Admin Hub and Inbox. The "New Document Type", "Create Folder", and "New Organization" buttons now reliably open their dialogs, user pick-lists now show which organization each user belongs to, and inbox status counters now refresh automatically when you return to the tab.
Why this was needed
QA found that the create-action buttons on three Admin Hub tabs (Document Types, Folders, Organization) silently did nothing when clicked, because the page was registering the dialog-open handler in a way React misinterpreted, so the handler was never stored. Separately, when assigning users to folders there was no way to tell users apart across organizations, and inbox status counts could show stale numbers after switching away and back to the tab.
Client / user impact
- Admins can once again create document types, folders, and organizations from the Admin Hub action buttons.
- When assigning or bulk-assigning users (and in the folder user list), each user now shows a label with their organization/entity name, reducing the risk of assigning the wrong person.
- Inbox status counters stay accurate, refreshing on tab focus and after the network reconnects, so users no longer see outdated counts.
Technical scope
- Admin Hub modal registration fix (
document-types/page.tsx,folders/page.tsx,organization/page.tsx): changed the registered action state from a bare(() => void)callback to an object{ openCreateModal: () => void }. Storing a function directly via the state setter caused React to treat it as a state-updater function, so the open handler was never registered; buttons now callactions?.openCreateModal(). - User entity labels: added
entity_name/entity_type(fromuser.entity_details) to the option objects inAddFolderModal.tsx,AssignUserModal.tsx, andBulkAssignUserModal.tsx;UserItem.tsxnow renders the entity name in a blueBadgenext to the username. - Live inbox counts (
Mail.queries.ts): setstaleTime: 0,refetchOnWindowFocus: true, andrefetchOnReconnect: trueon theuseGetInboxStatusCountquery. - Scope is small and frontend-only: 8 files, +38/-11 lines, no API or schema changes.
Risk & mitigation
Low risk. Changes are isolated frontend edits with no backend or data-model impact. The modal fix restores previously working behavior; the entity badge only renders when entity_name is present (gracefully absent otherwise). The added refetch triggers increase request frequency on the inbox count endpoint slightly, but it is a lightweight counter call. Mitigation: verify the three Admin Hub create flows and confirm inbox counts behave correctly under normal navigation.
QA validation focus
- Click "New Document Type", "Create Folder", and "New Organization" on the respective Admin Hub tabs and confirm each dialog opens.
- Open the Add Folder, Assign User, and Bulk Assign User flows; confirm users display an organization/entity badge where applicable and that users without entity details still render cleanly.
- Confirm assigning a user still works and submits the correct user ID.
- Open the Inbox, switch to another browser tab, return, and confirm status counts refresh; optionally toggle network connectivity and confirm counts re-fetch on reconnect.