Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Point two alert overview source guards at the new layout

rcourtmanab593173587a
diff --git a/frontend-modern/src/utils/__tests__/alertOverviewPresentation.coverage.test.ts b/frontend-modern/src/utils/__tests__/alertOverviewPresentation.coverage.test.ts
index 87646cb1ea..7690f675c6 100644
--- a/frontend-modern/src/utils/__tests__/alertOverviewPresentation.coverage.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertOverviewPresentation.coverage.test.ts
@@ -25,45 +25,44 @@ describe('alertOverviewPresentation coverage', () => {
const presentation = getAlertOverviewCardPresentation('critical', true, false);
expect(presentation.cardClassName).toBe(
- 'border rounded-md p-3 sm:p-4 transition-all opacity-60 border-border bg-surface-alt',
+ 'border border-l-4 rounded-md px-3 py-2.5 transition-all opacity-60 border-border border-l-border bg-surface-alt',
);
expect(presentation.iconClassName).toBe(
- 'mr-3 mt-0.5 transition-all text-green-600 dark:text-green-400',
+ 'mr-2.5 mt-0.5 shrink-0 transition-all text-green-600 dark:text-green-400',
);
expect(presentation.resourceClassName).toBe(
- 'text-sm font-medium truncate text-red-700 dark:text-red-400',
+ 'text-sm font-semibold truncate text-base-content',
);
});
it('projects an unacknowledged warning onto the warning palette', () => {
const presentation = getAlertOverviewCardPresentation('warning', false, false);
+ // Severity rides on the left edge and icon; the card itself stays neutral.
expect(presentation.cardClassName).toBe(
- 'border rounded-md p-3 sm:p-4 transition-all border-yellow-300 dark:border-yellow-800 bg-yellow-50 dark:bg-yellow-900/25',
+ 'border border-l-4 rounded-md px-3 py-2.5 transition-all border-border border-l-yellow-500 dark:border-l-yellow-400 bg-surface',
);
expect(presentation.iconClassName).toBe(
- 'mr-3 mt-0.5 transition-all text-yellow-600 dark:text-yellow-400',
+ 'mr-2.5 mt-0.5 shrink-0 transition-all text-yellow-600 dark:text-yellow-400',
);
expect(presentation.resourceClassName).toBe(
- 'text-sm font-medium truncate text-yellow-700 dark:text-yellow-400',
+ 'text-sm font-semibold truncate text-base-content',
);
});
it('projects an unacknowledged informational alert onto the informational palette', () => {
const presentation = getAlertOverviewCardPresentation('info', false, false);
- expect(presentation.cardClassName).toContain('border-blue-300');
+ expect(presentation.cardClassName).toContain('border-l-blue-500');
expect(presentation.iconClassName).toContain('text-blue-600');
- expect(presentation.resourceClassName).toContain('text-blue-700');
});
it('fails safe to warning for an unrecognized severity string', () => {
const presentation = getAlertOverviewCardPresentation('notice', false, false);
- expect(presentation.cardClassName).toContain('border-yellow-300');
- expect(presentation.cardClassName).not.toContain('border-red-300');
+ expect(presentation.cardClassName).toContain('border-l-yellow-500');
+ expect(presentation.cardClassName).not.toContain('border-l-red-500');
expect(presentation.iconClassName).toContain('text-yellow-600');
- expect(presentation.resourceClassName).toContain('text-yellow-700');
});
});
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 4908b77492..d7f19e6bae 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -2815,7 +2815,7 @@ describe('frontend resource type boundaries', () => {
"import { HistoryTab } from '@/features/alerts/tabs/HistoryTab';",
);
expect(alertsPageSource).not.toContain('function HistoryTab(');
- expect(alertOverviewTabSource).toContain('AlertOverviewStatsCards');
+ expect(alertOverviewActiveAlertsSectionSource).toContain('AlertOverviewStatsCards');
expect(alertOverviewTabSource).toContain('AlertOverviewActiveAlertsSection');
expect(alertOverviewTabSource).toContain('useAlertIncidentTimelineState');
expect(alertHistoryTabSource).toContain('useAlertHistoryState');
@@ -3961,7 +3961,8 @@ describe('frontend resource type boundaries', () => {
expect(alertOverviewStateSource).not.toContain('AlertsAPI.unacknowledge');
expect(alertOverviewStatsCardsSource).toContain('props.state.alertStats().acknowledged');
expect(alertOverviewStatsCardsSource).toContain('props.state.alertStats().total24h');
- expect(alertOverviewStatsCardsSource).toContain('props.state.alertStats().overrides');
+ // Override count is configuration, not alert status; it left the overview.
+ expect(alertOverviewStatsCardsSource).not.toContain('alertStats().overrides');
expect(alertOverviewActiveAlertsSectionSource).toContain('AlertOverviewAlertCard');
expect(alertOverviewActiveAlertsSectionSource).toContain('getAlertListEmptyState');
expect(alertOverviewAlertCardSource).toContain('IncidentTimelinePanel');