fix(ui,auth): modals dim instead of blanking + role parser covers all variants #95
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
psa-systems/mokosh-apps!95
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/modal-overlay-and-billing-perm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two unrelated SPA bugs that surfaced together while triaging mokosh:
Add Note / Add Task / New Appointment / Schedule Appointment (every modal that uses
components::Modalorcomponents::SlideOver) rendered the page fully black behind the dialog instead of a 75% gray dim. The Tailwind v4 upgrade removedbg-opacity-*; the existing classes resolved tobg-gray-500with no alpha, so the backdrop was opaque gray over the whole viewport. Switching to the v4 slash-alpha syntax (bg-gray-500/75) restores the dim. Same fix applied to the mobile sidebar backdrop and the LoadingOverlay incomponents::layoutso nothing else regresses behind the same removal.hooks::auth::rehydrate_from_storageandrefresh_user_from_mematched the role string against"admin" | "manager" | "finance"only. Any other server-returned role (super_admin / technician / dispatcher / sales) fell through to the catch-all and the user was silently coerced to the Technician default. Super_admin users hit it the hardest: they have full server-side permissions but the SPA saw them as Technician and denied billing / invoices / payments with "You do not have permission to access billing pages". Both sites now delegate toUserRole::from_strwhich already enumerates every variant, so all seven roles round-trip cleanly.Note on the billing page itself: a Technician seeing the no-permission card IS the intended behaviour - the gate is
UserRole::can_manage_billingwhich matches SuperAdmin / Admin / Finance only. The bug was the parser silently downgrading non-Technicians, not the gate.