fix(backoffice): add error+retry states to Users, Monitoring, Analytics, Reports
Phase 8 (RC-01): these 4 list/dashboard pages had no error-state handling on their primary data-load subscriptions — on a gateway error, `loading` was either never reset (Users, Monitoring, Analytics: genuine infinite- spinner risk, nested subscribe chain in Analytics never resolved on failure) or there was no loading/empty/error handling at all (Reports queue: raw table with zero skeleton or fallback). - admin-users.facade.ts, admin-monitoring.facade.ts: add `error` signal, error callback on the primary load subscribe so `loading` always resolves. - admin-analytics.facade.ts: add `error` signal; every level of the 4-deep nested gateway subscribe chain (orders -> products -> categories -> reviews) now has an error handler that resolves loading instead of leaving it stuck true. - admin-moderation.facade.ts: add `reportsLoading`/`reportsError` signals (reports list had none previously). - Templates: reuse existing `app-skeleton`/`app-empty-state`/`app-button` primitives for the new error branch, `common.retry` label, two new generic `common.errorTitle`/`common.errorDescription` i18n keys added to en/ru/hy (reused across all 4 fixes instead of one-off per-page copy). Verified: tsc --noEmit clean, `npm run build` green (pre-existing bundle- budget warning only, unrelated). Live-checked Home (375px) and Backoffice Products (1024px) — no console errors, tables/cards render without overflow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,8 @@ export class AdminModerationFacade {
|
||||
readonly loading = signal(false);
|
||||
readonly selected = signal<AdminReview | null>(null);
|
||||
readonly reports = signal<AdminReport[]>([]);
|
||||
readonly reportsLoading = signal(false);
|
||||
readonly reportsError = signal(false);
|
||||
|
||||
readonly viewMode = signal<AdminModerationViewMode>((this.localStorage.getItem(VIEW_MODE_KEY) as AdminModerationViewMode) || 'table');
|
||||
readonly density = signal<AdminModerationDensity>((this.localStorage.getItem(DENSITY_KEY) as AdminModerationDensity) || 'comfortable');
|
||||
@@ -167,7 +169,12 @@ export class AdminModerationFacade {
|
||||
}
|
||||
|
||||
loadReports(): void {
|
||||
this.gateway.loadReports().pipe(take(1)).subscribe({ next: reports => this.reports.set(reports) });
|
||||
this.reportsLoading.set(true);
|
||||
this.reportsError.set(false);
|
||||
this.gateway.loadReports().pipe(take(1)).subscribe({
|
||||
next: reports => { this.reports.set(reports); this.reportsLoading.set(false); },
|
||||
error: () => { this.reports.set([]); this.reportsLoading.set(false); this.reportsError.set(true); }
|
||||
});
|
||||
}
|
||||
|
||||
setReportStatus(id: string, status: AdminReportStatus): void {
|
||||
|
||||
Reference in New Issue
Block a user