feat(spa): retrofit remaining data-driven pages onto explicit server-down UX #415
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/MAPPS-357-retrofit-remote-resource-pages"
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?
Completes the MAPPS-351 AC1 invariant across the whole app: every data-driven page now renders an explicit "server unreachable" state during an outage instead of empty tables / zero counts (the "content itself lies" failure mode), and disables its write controls while the server is down. Previously only dashboard/approvals/admin were retrofitted; the remaining pages still used the
use_resource(...) + .ok().unwrap_or_default()swallow pattern.Two patterns applied per page, mirroring the existing references: read-only primaries use
use_remote_resource+ContentUnavailablegated onis_unavailable()(like dashboard.rs); primaries that are.restart()ed after a mutation keepuse_resourcebut preserve the failure (.ok()/ rawResult, never.unwrap_or_default()), subscribe touse_server_reachable()inside the fetcher for auto-refetch on reconnect, and gateContentUnavailableonfetch_failed && !reachable(like approvals.rs). Mutating controls are disabled viause_can_mutate()with an explanatory tooltip. Secondary/lookup resources keep degrading to defaults, documented inline per page.Pages retrofitted: billing, time, tickets, contracts, portal, sla, reports, projects, team, contacts, calendar, assets, audit_log, knowledge_base, settings, profile, big_view, dashboards, dashboards_view.
Special cases: system_status is marked N/A inline (it is the diagnostics page that reports connectivity, so it must render while the server is down and already preserves each probe as an explicit Result). portal pages use a new portal-native
PortalUnavailablepanel insidePortalLayoutinstead of the sharedContentUnavailable, which mounts the internal-agentAppLayoutand would leak internal chrome to client-portal users. big_view kiosk pages render an inline unavailable panel insideBigLayoutfor the same reason. sla moved its AppLayout + tab-bar chrome into a newSlaShellwrapper so a tab can return the full-pageContentUnavailablewithout nesting a second AppLayout.AC5 coverage: added a down -> reconnect
classify_remotetest on a concretely-retrofitted page (dashboards.rs saved-dashboards list), extending the coverage pattern from hooks/remote_data.rs so a regression that reintroduced the swallow would fail the suite.Known follow-up (not a data-loss bug; the page swaps to the unavailable state before these modals can open during a full outage): shared modal/picker components (SettingFormModal, AssetPicker, CompanyPicker, ContactPicker) expose no
disabled/can_mutateprop, so their in-modal Save/Delete cannot be gated from a single page file; hardening them needs a prop added to those shared components, which is broader than this page-scoped change.#MAPPS-357