refactor(core): prepare frontend for backend integration
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> - Fix AdminLayoutComponent.readRouteData crash: leaf route snapshot/data is now optional with dashboard-title fallback, so admin deep links never crash the shell when route metadata is missing (root cause of every blocked browser test since Sprint 12) - Never-settling promises fixed: all gateway ensureData() bridges (products, categories, moderation) and the catalog category resolver now resolve with an empty list on transport failure instead of hanging forever, so API outages surface as empty states with guidance rather than permanent skeletons plus global console errors - Request de-duplication: BackofficeDataService caches products/categories with shareReplay - one in-flight request per endpoint shared by all consuming gateways (was 5+ duplicate requests per admin page load); failures clear the cache so the next call retries - Gateway contract audit: all 8 admin gateways (products, categories, orders, customers/moderation, transactions, users, dashboard metrics, monitoring) now implement an explicit *Gateway interface - added the missing AdminMonitoringGateway; media already swaps via the abstract MediaRepository DI class - Mock mode untouched: provider selection still flows through RuntimeProviderStrategyService/BACKOFFICE_DATA_PROVIDER
This commit is contained in:
@@ -130,7 +130,10 @@ export class AdminLayoutComponent {
|
||||
while (leaf.firstChild) {
|
||||
leaf = leaf.firstChild;
|
||||
}
|
||||
const data = leaf.snapshot.data as {
|
||||
// Route metadata is optional: during the initial navigation (or for routes
|
||||
// registered without `data`) the leaf snapshot may not exist yet. Fall back
|
||||
// to dashboard defaults instead of crashing the whole admin shell.
|
||||
const data = (leaf.snapshot?.data ?? {}) as {
|
||||
titleKey?: string;
|
||||
descriptionKey?: string;
|
||||
breadcrumb?: AdminBreadcrumbEntry[];
|
||||
|
||||
Reference in New Issue
Block a user