mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-17 14:08:19 +00:00
feat: split Host Alerts into Host Alerts, Container Alerts, and Stacks guardrails (#1461)
* feat: split Host Alerts into Host Alerts, Container Alerts, and Stacks guardrails Move global_crash from Host Alerts to new Monitoring > Container Alerts section. Move health gate and env deploy guardrails from Host Alerts to Infrastructure > Stacks > Deploy Guardrails subsection. Host Alerts now contains only host threshold settings (CPU, RAM, disk, alert suppression, and the master host_alerts_enabled toggle). Stacks gains a Deploy Guardrails subsection (node-scoped, admin-gated) alongside the existing Workflow controls (browser-local). Dashboard Crash detection row now routes to Container Alerts. * docs: update crash detection toggle description to match new Container Alerts section
This commit is contained in:
@@ -216,7 +216,7 @@ export function ConfigurationStatus({ onOpenSection }: ConfigurationStatusProps
|
||||
<Row
|
||||
label="Crash detection"
|
||||
value={thresholds.globalCrash ? 'On' : 'Off'}
|
||||
onClick={open('host-alerts')}
|
||||
onClick={open('container-alerts')}
|
||||
/>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { render, screen, fireEvent } from '@testing-library/react';
|
||||
|
||||
const useConfigurationStatusMock = vi.fn();
|
||||
vi.mock('../useConfigurationStatus', () => ({
|
||||
@@ -147,3 +147,18 @@ describe('ConfigurationStatus threshold display', () => {
|
||||
expect(badge?.textContent?.trim()).toBe('OFF');
|
||||
});
|
||||
});
|
||||
|
||||
describe('ConfigurationStatus click targets', () => {
|
||||
it('routes Crash detection to container-alerts', () => {
|
||||
const onOpenSection = vi.fn();
|
||||
useConfigurationStatusMock.mockReturnValue({
|
||||
status: makePayload(),
|
||||
loading: false,
|
||||
});
|
||||
render(<ConfigurationStatus onOpenSection={onOpenSection} />);
|
||||
const crashRow = screen.getByText('Crash detection').closest('button');
|
||||
expect(crashRow).toBeDefined();
|
||||
fireEvent.click(crashRow!);
|
||||
expect(onOpenSection).toHaveBeenCalledWith('container-alerts');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user