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.

Load the report schedule editor only when needed

rcourtmanc9a201b8ba48
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 7814950fa0..09f0800370 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -1507,7 +1507,7 @@ removal/failure retention and containing publication remain separate evidence.
44. `frontend-modern/src/components/Settings/UpdateInstallGuide.tsx`
45. `frontend-modern/src/components/Settings/updatesSettingsModel.ts`
46. `frontend-modern/src/components/Settings/UpdatesSettingsPanel.tsx`
-47. `frontend-modern/src/components/Settings/ReportingPanel.tsx`
+47. `frontend-modern/src/components/Settings/ReportingPanel.tsx`, `frontend-modern/src/components/Settings/ReportScheduleEditor.tsx` and `frontend-modern/src/components/Settings/ReportingFormField.tsx`
48. `frontend-modern/src/components/Settings/reportingPanelModel.ts`
48a. `frontend-modern/src/components/Settings/reportingSchedulesModel.ts`
49. `frontend-modern/src/components/Settings/reportingInventoryExportModel.ts`
@@ -8155,6 +8155,14 @@ The report list keeps status and Run/Retry visible at every width. Scope,
recipients, file paths, Edit and Delete share the full-width details disclosure.
Keyed store reconciliation preserves row identity, open details and keyboard
focus across background refreshes.
+The schedule editor is loaded only when a schedule is created or edited, with a
+visible loading state. It shares the reporting field primitive with the main
+report builder. Edit-only code stays out of the initial ReportingPanel bundle,
+and the existing bundle budget remains enforced. The Reports browser proof covers
+the deferred editor and its full form after the chunk loads.
+Responsive reporting actions are verified through the rendered reporting tests
+and browser interactions. Architecture checks do not require the retired
+schedule table columns or separate mobile action menu.
The settings navigation model now exposes a single `infrastructure-systems`
sidebar entry for the infrastructure settings area. The former
`infrastructure-connections` and `infrastructure-install` entries have been
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index ac9bcf8f62..7184dd069c 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -5329,9 +5329,11 @@
"frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx",
"frontend-modern/src/components/Settings/OperationsPanel.tsx",
"frontend-modern/src/components/Settings/RecoverySettingsPanel.tsx",
+ "frontend-modern/src/components/Settings/ReportingFormField.tsx",
"frontend-modern/src/components/Settings/ReportingPanel.tsx",
"frontend-modern/src/components/Settings/reportingPanelModel.ts",
"frontend-modern/src/components/Settings/reportingSchedulesModel.ts",
+ "frontend-modern/src/components/Settings/ReportScheduleEditor.tsx",
"frontend-modern/src/components/Settings/ResourcePicker.tsx",
"frontend-modern/src/components/Settings/SecurityAuthPanel.tsx",
"frontend-modern/src/components/Settings/SecurityOverviewPanel.tsx",
@@ -5698,9 +5700,11 @@
"match_files": [
"frontend-modern/scripts/header-audit.mjs",
"frontend-modern/src/components/Settings/AvailabilitySettingsPanel.tsx",
+ "frontend-modern/src/components/Settings/ReportingFormField.tsx",
"frontend-modern/src/components/Settings/ReportingPanel.tsx",
"frontend-modern/src/components/Settings/reportingPanelModel.ts",
"frontend-modern/src/components/Settings/reportingSchedulesModel.ts",
+ "frontend-modern/src/components/Settings/ReportScheduleEditor.tsx",
"frontend-modern/src/components/Settings/ResourcePicker.tsx",
"frontend-modern/src/components/Settings/SystemLogsPanel.tsx",
"frontend-modern/src/components/Settings/useReportingPanelState.ts",
diff --git a/frontend-modern/browser-verification/3d9a3eecc00de548.json b/frontend-modern/browser-verification/3d9a3eecc00de548.json
new file mode 100644
index 0000000000..26739a8cd9
--- /dev/null
+++ b/frontend-modern/browser-verification/3d9a3eecc00de548.json
@@ -0,0 +1,56 @@
+{
+ "version": 1,
+ "base_sha": "c4189614d84073ab7469d289876202187fb658f4",
+ "verified_at": "2026-10-17T10:17:31.567Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Settings/ReportScheduleEditor.tsx",
+ "frontend-modern/src/components/Settings/ReportingFormField.tsx",
+ "frontend-modern/src/components/Settings/ReportingPanel.tsx"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/components/Settings/ReportScheduleEditor.tsx": "fdd8485a6466a7b03f5c2cfed56a964933d9a0d41c726f06846ba9cd7fe2357d",
+ "frontend-modern/src/components/Settings/ReportingFormField.tsx": "58abe22d28c2d7a8a3831501b32bdd861d151b28c7a28932f41c24aa84c62856",
+ "frontend-modern/src/components/Settings/ReportingPanel.tsx": "3db3f0149262a74b12cba646098cb7421cee42c6b0db8358cda8265d42bd007b"
+ },
+ "routes": [
+ "/settings/support/reporting",
+ "/alerts/notifications"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 1000
+ },
+ {
+ "width": 820,
+ "height": 844
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "states": [
+ "Schedule editor absent from initial network requests while the report list remains usable",
+ "Deferred editor loading visible beside its toolbar while the module request is held",
+ "Loaded create/edit form with name-field focus, weekly and monthly controls, resource selection, disk/email and PDF/CSV choices, attachment and recipient states",
+ "Confirmed empty list, initial loading and load failure without a false empty claim",
+ "Saved disk output, accepted email, running, retrying, permanent failure and unconfirmed delivery",
+ "Real CSV email delivery, a persisted 451 retry recovering once after a process restart with its original window, deliberate recovery after 550 rejection and uncertain acknowledgement",
+ "Real disk PDF generation without mail, disabled schedule and confirmed/cancelled deletion"
+ ],
+ "interactions": [
+ "Open Create schedule: assert no editor request before the click, hold its chunk, inspect visible loading, then release and verify name-field focus before typing",
+ "Edit the existing schedule, switch delivery and format, save/cancel, enable/disable and reload",
+ "Inspect Run/Retry visibility, hover, keyboard focus and actual pointer hit testing at every width",
+ "Expand report details, saved path and controls, preserve expansion through background polling",
+ "Navigate email-configuration remedy to Notifications; refresh list loading/failure/recovery",
+ "Cancel uncertain retry without another send, accept the duplicate warning for deliberate retry, and verify successful recovery",
+ "Inspect actual desktop, intermediate and mobile screenshots for text wrapping, action placement, editor loading and form states"
+ ],
+ "environment": "Private runtime built from the verified working tree over base_sha, ephemeral signed Pro grant, dev/mock modes disabled. Synthetic infrastructure and local SMTP only.",
+ "evidence": "/opt/pulse-release-worker/task-proofs/scheduled-reporting-20261017/browser-evidence",
+ "bundle_check": "Existing bundle budget passed: ReportingPanel 10.94 kB gzip against 11.63 kB maximum. Total JS, CSS and preload checks passed.",
+ "pixel_review": "Reviewed current-build desktop list, intermediate expanded details, narrow accepted/retry/unconfirmed states and deferred-editor loading/disk/email forms. Full outcomes, controls and form fields remain readable."
+}
diff --git a/frontend-modern/src/components/Settings/ReportScheduleEditor.tsx b/frontend-modern/src/components/Settings/ReportScheduleEditor.tsx
new file mode 100644
index 0000000000..caaf8b722f
--- /dev/null
+++ b/frontend-modern/src/components/Settings/ReportScheduleEditor.tsx
@@ -0,0 +1,284 @@
+import { For, Show, onMount } from 'solid-js';
+import Save from 'lucide-solid/icons/save';
+import X from 'lucide-solid/icons/x';
+import { Button } from '@/components/shared/Button';
+import { formControl } from '@/components/shared/Form';
+import { FormSelect } from '@/components/shared/FormSelect';
+import type { ReportingFormat } from './reportingCatalogModel';
+import { reportScheduleKindLabel, type ReportScheduleKind } from './reportingSchedulesModel';
+import type { useReportingPanelState } from './useReportingPanelState';
+import { ReportingFormField as FormField } from './ReportingFormField';
+import { ResourcePicker } from './ResourcePicker';
+
+type EditorState = Pick<
+ ReturnType<typeof useReportingPanelState>,
+ | 'closeScheduleForm'
+ | 'patrolDigestAvailable'
+ | 'reportingCatalog'
+ | 'saveReportSchedule'
+ | 'savingSchedule'
+ | 'scheduleForm'
+ | 'scheduleResources'
+ | 'setScheduleKind'
+ | 'setScheduleResources'
+ | 'updateScheduleForm'
+>;
+
+const WEEKDAY_OPTIONS = [
+ 'monday',
+ 'tuesday',
+ 'wednesday',
+ 'thursday',
+ 'friday',
+ 'saturday',
+ 'sunday',
+];
+
+export default function ReportScheduleEditor(props: { state: EditorState }) {
+ let nameInput: HTMLInputElement | undefined;
+ onMount(() => nameInput?.focus());
+ const {
+ closeScheduleForm,
+ patrolDigestAvailable,
+ reportingCatalog,
+ saveReportSchedule,
+ savingSchedule,
+ scheduleForm,
+ scheduleResources,
+ setScheduleKind,
+ setScheduleResources,
+ updateScheduleForm,
+ } = props.state;
+ const performanceReport = () => reportingCatalog()?.performanceReport ?? null;
+ const isDigestForm = () => scheduleForm().kind === 'patrol_digest';
+ // Existing digest schedules stay editable after Patrol is switched off.
+ const showReportTypeSelect = () => patrolDigestAvailable() || isDigestForm();
+ return (
+ <section class="space-y-4 border-y border-base-300 py-4">
+ <Show when={showReportTypeSelect()}>
+ <div class="grid grid-cols-1 gap-4 md:grid-cols-2">
+ <FormSelect
+ label="Report type"
+ value={scheduleForm().kind}
+ onChange={(e) => setScheduleKind(e.currentTarget.value as ReportScheduleKind)}
+ help={
+ isDigestForm()
+ ? 'Emails what Patrol checked, found, fixed, and spent over the last seven days. Nothing is saved to disk.'
+ : 'A performance report for the resources you pick, as a PDF or CSV.'
+ }
+ >
+ <option value="resources">{reportScheduleKindLabel('resources')}</option>
+ <option value="patrol_digest">{reportScheduleKindLabel('patrol_digest')}</option>
+ </FormSelect>
+ </div>
+ </Show>
+ <div class="grid grid-cols-1 gap-4 md:grid-cols-2">
+ <FormField label="Schedule name">
+ <input
+ ref={nameInput}
+ aria-label="Schedule name"
+ type="text"
+ class={formControl}
+ value={scheduleForm().name}
+ onInput={(e) => updateScheduleForm({ name: e.currentTarget.value })}
+ placeholder={isDigestForm() ? 'Patrol weekly summary' : 'Monthly client report'}
+ />
+ </FormField>
+ <FormField label="Timezone">
+ <input
+ aria-label="Timezone"
+ type="text"
+ class={formControl}
+ value={scheduleForm().timezone}
+ onInput={(e) => updateScheduleForm({ timezone: e.currentTarget.value })}
+ placeholder="Europe/London"
+ />
+ </FormField>
+ </div>
+
+ <div
+ class={
+ isDigestForm()
+ ? 'grid grid-cols-1 gap-4 md:grid-cols-2'
+ : 'grid grid-cols-1 gap-4 md:grid-cols-4'
+ }
+ >
+ <Show when={!isDigestForm()}>
+ <FormSelect
+ label="Cadence"
+ value={scheduleForm().cadenceType}
+ onChange={(e) =>
+ updateScheduleForm({
+ cadenceType: e.currentTarget.value as 'monthly' | 'weekly',
+ })
+ }
+ >
+ <option value="monthly">Monthly</option>
+ <option value="weekly">Weekly</option>
+ </FormSelect>
+ </Show>
+ <Show
+ when={scheduleForm().cadenceType === 'monthly' && !isDigestForm()}
+ fallback={
+ <FormSelect
+ label="Weekday"
+ value={scheduleForm().weekday}
+ onChange={(e) => updateScheduleForm({ weekday: e.currentTarget.value })}
+ >
+ <For each={WEEKDAY_OPTIONS}>
+ {(day) => <option value={day}>{day[0].toUpperCase() + day.slice(1)}</option>}
+ </For>
+ </FormSelect>
+ }
+ >
+ <FormField label="Day of month">
+ <input
+ aria-label="Day of month"
+ type="number"
+ min="1"
+ max="28"
+ class={formControl}
+ value={scheduleForm().dayOfMonth}
+ onInput={(e) => updateScheduleForm({ dayOfMonth: Number(e.currentTarget.value) })}
+ />
+ </FormField>
+ </Show>
+ <FormField label="Time">
+ <input
+ aria-label="Time"
+ type="time"
+ class={formControl}
+ value={scheduleForm().time}
+ onInput={(e) => updateScheduleForm({ time: e.currentTarget.value })}
+ />
+ </FormField>
+ <Show when={!isDigestForm()}>
+ <FormSelect
+ label="Format"
+ value={scheduleForm().format}
+ onChange={(e) =>
+ updateScheduleForm({ format: e.currentTarget.value as ReportingFormat })
+ }
+ >
+ <option value="pdf">PDF</option>
+ <option value="csv">CSV</option>
+ </FormSelect>
+ </Show>
+ </div>
+
+ <Show when={!isDigestForm()}>
+ <FormField
+ label="Resources"
+ helpText="Use explicit resources, tags, or both. Scheduled reports use the previous reporting boundary."
+ >
+ <ResourcePicker
+ maxSelection={performanceReport()?.multiResourceMax}
+ selected={scheduleResources}
+ onSelectionChange={setScheduleResources}
+ />
+ </FormField>
+ </Show>
+
+ <Show when={!isDigestForm()}>
+ <div class="grid grid-cols-1 gap-4 md:grid-cols-3">
+ <FormField label="Tag filter" helpText="Comma-separated tags">
+ <input
+ aria-label="Tag filter"
+ type="text"
+ class={formControl}
+ value={scheduleForm().tagFilter}
+ onInput={(e) => updateScheduleForm({ tagFilter: e.currentTarget.value })}
+ placeholder="production, customer-facing"
+ />
+ </FormField>
+ <FormSelect
+ label="Delivery"
+ value={scheduleForm().deliveryMethod}
+ onChange={(e) =>
+ updateScheduleForm({
+ deliveryMethod: e.currentTarget.value as 'email' | 'disk',
+ })
+ }
+ >
+ <option value="email">Email recipients</option>
+ <option value="disk">Save to disk</option>
+ </FormSelect>
+ <FormField label="Retention" helpText="Generated files kept on this server">
+ <input
+ aria-label="Retention"
+ type="number"
+ min="1"
+ max="120"
+ class={formControl}
+ value={scheduleForm().retentionCount}
+ onInput={(e) => updateScheduleForm({ retentionCount: Number(e.currentTarget.value) })}
+ />
+ </FormField>
+ </div>
+ </Show>
+
+ <div class="grid grid-cols-1 gap-4 md:grid-cols-2">
+ <FormField
+ label="Email recipients"
+ helpText="Blank uses the existing email notification recipients"
+ >
+ <input
+ aria-label="Email recipients"
+ type="text"
+ class={formControl}
+ value={scheduleForm().recipients}
+ onInput={(e) => updateScheduleForm({ recipients: e.currentTarget.value })}
+ disabled={scheduleForm().deliveryMethod !== 'email'}
+ />
+ </FormField>
+ <div class="grid grid-cols-1 gap-3 pt-6 sm:grid-cols-2">
+ <label class="inline-flex items-center gap-2 text-sm text-muted">
+ <input
+ type="checkbox"
+ checked={scheduleForm().enabled}
+ onChange={(e) => updateScheduleForm({ enabled: e.currentTarget.checked })}
+ />
+ Enabled
+ </label>
+ <Show when={!isDigestForm()}>
+ <label class="inline-flex items-center gap-2 text-sm text-muted">
+ <input
+ type="checkbox"
+ checked={scheduleForm().attach}
+ onChange={(e) => updateScheduleForm({ attach: e.currentTarget.checked })}
+ disabled={scheduleForm().deliveryMethod !== 'email'}
+ />
+ Attach report
+ </label>
+ </Show>
+ </div>
+ </div>
+
+ <Show when={!isDigestForm()}>
+ <p class="text-xs text-muted">
+ Generated reports are saved on this Pulse server. With Attach report off, email sends a
+ notice containing the saved path.
+ </p>
+ </Show>
+
+ <div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
+ <Button variant="secondary" size="md" class="gap-2" onClick={closeScheduleForm}>
+ <X size={16} />
+ Cancel
+ </Button>
+ <Button
+ variant="primary"
+ size="md"
+ class="gap-2"
+ isLoading={savingSchedule()}
+ disabled={savingSchedule()}
+ onClick={saveReportSchedule}
+ >
+ <Save size={16} />
+ Save schedule
+ </Button>
+ </div>
+ </section>
+ );
+}
diff --git a/frontend-modern/src/components/Settings/ReportingFormField.tsx b/frontend-modern/src/components/Settings/ReportingFormField.tsx
new file mode 100644
index 0000000000..ebd3f93827
--- /dev/null
+++ b/frontend-modern/src/components/Settings/ReportingFormField.tsx
@@ -0,0 +1,18 @@
+import type { JSX } from 'solid-js';
+import { formField, formHelpText, formLabel } from '@/components/shared/Form';
+
+interface FormFieldProps {
+ label: string;
+ helpText?: string;
+ children: JSX.Element;
+}
+
+export function ReportingFormField(props: FormFieldProps) {
+ return (
+ <div class={formField} role="group" aria-label={props.label}>
+ <span class={formLabel}>{props.label}</span>
+ {props.children}
+ {props.helpText && <span class={formHelpText}>{props.helpText}</span>}
+ </div>
+ );
+}
diff --git a/frontend-modern/src/components/Settings/ReportingPanel.tsx b/frontend-modern/src/components/Settings/ReportingPanel.tsx
index 5d891d0263..49852c715a 100644
--- a/frontend-modern/src/components/Settings/ReportingPanel.tsx
+++ b/frontend-modern/src/components/Settings/ReportingPanel.tsx
@@ -1,4 +1,4 @@
-import { For, JSX, Show } from 'solid-js';
+import { For, Show, Suspense, lazy } from 'solid-js';
import FileText from 'lucide-solid/icons/file-text';
import Download from 'lucide-solid/icons/download';
import BarChart from 'lucide-solid/icons/bar-chart';
@@ -8,14 +8,11 @@ import Pencil from 'lucide-solid/icons/pencil';
import Play from 'lucide-solid/icons/play';
import RefreshCw from 'lucide-solid/icons/refresh-cw';
import Trash2 from 'lucide-solid/icons/trash-2';
-import Save from 'lucide-solid/icons/save';
-import X from 'lucide-solid/icons/x';
import OperationsPanel from '@/components/Settings/OperationsPanel';
import { Button } from '@/components/shared/Button';
import { CalloutCard } from '@/components/shared/CalloutCard';
-import { formControl, formField, formHelpText, formLabel } from '@/components/shared/Form';
+import { formControl } from '@/components/shared/Form';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
-import { FormSelect } from '@/components/shared/FormSelect';
import { FeatureGateSection } from '@/components/shared/FeatureGateSection';
import { useReportingPanelState } from '@/components/Settings/useReportingPanelState';
import type { ReportingFormat } from '@/components/Settings/reportingCatalogModel';
@@ -24,50 +21,25 @@ import {
formatReportScheduleTime,
reportScheduleCadenceLabel,
reportScheduleDeliveryLabel,
- reportScheduleKindLabel,
reportScheduleLastRunLabel,
reportScheduleOutcomeDetail,
reportScheduleRunActionLabel,
reportScheduleScopeLabel,
type ReportSchedule,
- type ReportScheduleKind,
} from '@/components/Settings/reportingSchedulesModel';
import { ResourcePicker } from './ResourcePicker';
+import { ReportingFormField as FormField } from './ReportingFormField';
const REPORTING_FORMAT_ICONS: Record<ReportingFormat, typeof FileText> = {
csv: BarChart,
pdf: FileText,
};
-interface FormFieldProps {
- label: string;
- helpText?: string;
- children: JSX.Element;
-}
-
-function FormField(props: FormFieldProps) {
- return (
- <div class={formField} role="group" aria-label={props.label}>
- <span class={formLabel}>{props.label}</span>
- {props.children}
- {props.helpText && <span class={formHelpText}>{props.helpText}</span>}
- </div>
- );
-}
-
-const WEEKDAY_OPTIONS = [
- 'monday',
- 'tuesday',
- 'wednesday',
- 'thursday',
- 'friday',
- 'saturday',
- 'sunday',
-];
+const ReportScheduleEditor = lazy(() => import('./ReportScheduleEditor'));
export function ReportingPanel() {
+ const state = useReportingPanelState();
const {
- closeScheduleForm,
deleteReportSchedule,
deletingScheduleID,
exportingInventory,
@@ -90,17 +62,11 @@ export function ReportingPanel() {
reloadReportSchedules,
runReportScheduleNow,
runningScheduleID,
- saveReportSchedule,
- savingSchedule,
- scheduleForm,
scheduleFormOpen,
- scheduleResources,
selectedResources,
setFormat,
setMetricType,
setRange,
- setScheduleKind,
- setScheduleResources,
setSelectedResources,
setTitle,
showUpgradePrompts,
@@ -108,19 +74,14 @@ export function ReportingPanel() {
startEditSchedule,
title,
toggleReportSchedule,
- updateScheduleForm,
upgradeDestination,
- } = useReportingPanelState();
+ } = state;
const visibleOutcome = (schedule: ReportSchedule): ReportSchedule =>
runningScheduleID() === schedule.id
? { ...schedule, last_run_status: 'running', last_error: '' }
: schedule;
const performanceReport = () => reportingCatalog()?.performanceReport ?? null;
- const isDigestForm = () => scheduleForm().kind === 'patrol_digest';
- // Offer the Patrol weekly summary only while Patrol can run; an existing
- // digest schedule still shows its type so it can be edited after AI is off.
- const showReportTypeSelect = () => patrolDigestAvailable() || isDigestForm();
const inventoryDefinition = () => reportingCatalog()?.vmInventoryExport ?? null;
const lockedState = () => {
const catalog = reportingCatalog();
@@ -347,6 +308,12 @@ export function ReportingPanel() {
</div>
</div>
+ <Show when={scheduleFormOpen()}>
+ <Suspense fallback={<p class="text-sm text-muted">Loading schedule editor...</p>}>
+ <ReportScheduleEditor state={state} />
+ </Suspense>
+ </Show>
+
<Show when={reportSchedulesLoading()}>
<p class="text-sm text-muted">Loading report schedules...</p>
</Show>
@@ -521,248 +488,6 @@ export function ReportingPanel() {
</For>
</ul>
</Show>
-
- <Show when={scheduleFormOpen()}>
- <section class="space-y-4 border-y border-base-300 py-4">
- <Show when={showReportTypeSelect()}>
- <div class="grid grid-cols-1 gap-4 md:grid-cols-2">
- <FormSelect
- label="Report type"
- value={scheduleForm().kind}
- onChange={(e) =>
- setScheduleKind(e.currentTarget.value as ReportScheduleKind)
- }
- help={
- isDigestForm()
- ? 'Emails what Patrol checked, found, fixed, and spent over the last seven days. Nothing is saved to disk.'
- : 'A performance report for the resources you pick, as a PDF or CSV.'
- }
- >
- <option value="resources">{reportScheduleKindLabel('resources')}</option>
- <option value="patrol_digest">
- {reportScheduleKindLabel('patrol_digest')}
- </option>
- </FormSelect>
- </div>
- </Show>
- <div class="grid grid-cols-1 gap-4 md:grid-cols-2">
- <FormField label="Schedule name">
- <input
- aria-label="Schedule name"
- type="text"
- class={formControl}
- value={scheduleForm().name}
- onInput={(e) => updateScheduleForm({ name: e.currentTarget.value })}
- placeholder={
- isDigestForm() ? 'Patrol weekly summary' : 'Monthly client report'
- }
- />
- </FormField>
- <FormField label="Timezone">
- <input
- aria-label="Timezone"
- type="text"
- class={formControl}
- value={scheduleForm().timezone}
- onInput={(e) => updateScheduleForm({ timezone: e.currentTarget.value })}
- placeholder="Europe/London"
- />
- </FormField>
- </div>
-
- <div
- class={
- isDigestForm()
- ? 'grid grid-cols-1 gap-4 md:grid-cols-2'
- : 'grid grid-cols-1 gap-4 md:grid-cols-4'
- }
- >
- <Show when={!isDigestForm()}>
- <FormSelect
- label="Cadence"
- value={scheduleForm().cadenceType}
- onChange={(e) =>
- updateScheduleForm({
- cadenceType: e.currentTarget.value as 'monthly' | 'weekly',
- })
- }
- >
- <option value="monthly">Monthly</option>
- <option value="weekly">Weekly</option>
- </FormSelect>
- </Show>
- <Show
- when={scheduleForm().cadenceType === 'monthly' && !isDigestForm()}
- fallback={
- <FormSelect
- label="Weekday"
- value={scheduleForm().weekday}
- onChange={(e) => updateScheduleForm({ weekday: e.currentTarget.value })}
- >
- <For each={WEEKDAY_OPTIONS}>
- {(day) => (
- <option value={day}>{day[0].toUpperCase() + day.slice(1)}</option>
- )}
- </For>
- </FormSelect>
- }
- >
- <FormField label="Day of month">
- <input
- aria-label="Day of month"
- type="number"
- min="1"
- max="28"
- class={formControl}
- value={scheduleForm().dayOfMonth}
- onInput={(e) =>
- updateScheduleForm({ dayOfMonth: Number(e.currentTarget.value) })
- }
- />
- </FormField>
- </Show>
- <FormField label="Time">
- <input
- aria-label="Time"
- type="time"
- class={formControl}
- value={scheduleForm().time}
- onInput={(e) => updateScheduleForm({ time: e.currentTarget.value })}
- />
- </FormField>
- <Show when={!isDigestForm()}>
- <FormSelect
- label="Format"
- value={scheduleForm().format}
- onChange={(e) =>
- updateScheduleForm({ format: e.currentTarget.value as ReportingFormat })
- }
- >
- <option value="pdf">PDF</option>
- <option value="csv">CSV</option>
- </FormSelect>
- </Show>
- </div>
-
- <Show when={!isDigestForm()}>
- <FormField
- label="Resources"
- helpText="Use explicit resources, tags, or both. Scheduled reports use the previous reporting boundary."
- >
- <ResourcePicker
- maxSelection={performanceReport()?.multiResourceMax}
- selected={scheduleResources}
- onSelectionChange={setScheduleResources}
- />
- </FormField>
- </Show>
-
- <Show when={!isDigestForm()}>
- <div class="grid grid-cols-1 gap-4 md:grid-cols-3">
- <FormField label="Tag filter" helpText="Comma-separated tags">
- <input
- aria-label="Tag filter"
- type="text"
- class={formControl}
- value={scheduleForm().tagFilter}
- onInput={(e) => updateScheduleForm({ tagFilter: e.currentTarget.value })}
- placeholder="production, customer-facing"
- />
- </FormField>
- <FormSelect
- label="Delivery"
- value={scheduleForm().deliveryMethod}
- onChange={(e) =>
- updateScheduleForm({
- deliveryMethod: e.currentTarget.value as 'email' | 'disk',
- })
- }
- >
- <option value="email">Email recipients</option>
- <option value="disk">Save to disk</option>
- </FormSelect>
- <FormField label="Retention" helpText="Generated files kept on this server">
- <input
- aria-label="Retention"
- type="number"
- min="1"
- max="120"
- class={formControl}
- value={scheduleForm().retentionCount}
- onInput={(e) =>
- updateScheduleForm({ retentionCount: Number(e.currentTarget.value) })
- }
- />
- </FormField>
- </div>
- </Show>
-
- <div class="grid grid-cols-1 gap-4 md:grid-cols-2">
- <FormField
- label="Email recipients"
- helpText="Blank uses the existing email notification recipients"
- >
- <input
- aria-label="Email recipients"
- type="text"
- class={formControl}
- value={scheduleForm().recipients}
- onInput={(e) => updateScheduleForm({ recipients: e.currentTarget.value })}
- disabled={scheduleForm().deliveryMethod !== 'email'}
- />
- </FormField>
- <div class="grid grid-cols-1 gap-3 pt-6 sm:grid-cols-2">
- <label class="inline-flex items-center gap-2 text-sm text-muted">
- <input
- type="checkbox"
- checked={scheduleForm().enabled}
- onChange={(e) => updateScheduleForm({ enabled: e.currentTarget.checked })}
- />
- Enabled
- </label>
- <Show when={!isDigestForm()}>
- <label class="inline-flex items-center gap-2 text-sm text-muted">
- <input
- type="checkbox"
- checked={scheduleForm().attach}
- onChange={(e) =>
- updateScheduleForm({ attach: e.currentTarget.checked })
- }
- disabled={scheduleForm().deliveryMethod !== 'email'}
- />
- Attach report
- </label>
- </Show>
- </div>
- </div>
-
- <Show when={!isDigestForm()}>
- <p class="text-xs text-muted">
- Generated reports are saved on this Pulse server. With Attach report off,
- email sends a notice containing the saved path.
- </p>
- </Show>
-
- <div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
- <Button variant="secondary" size="md" class="gap-2" onClick={closeScheduleForm}>
- <X size={16} />
- Cancel
- </Button>
- <Button
- variant="primary"
- size="md"
- class="gap-2"
- isLoading={savingSchedule()}
- disabled={savingSchedule()}
- onClick={saveReportSchedule}
- >
- <Save size={16} />
- Save schedule
- </Button>
- </div>
- </section>
- </Show>
</section>
<Show when={inventoryDefinition()}>
diff --git a/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx
index 5f4b29c94d..7aabfc6a3d 100644
--- a/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx
@@ -183,21 +183,23 @@ describe('ReportingPanel', () => {
).toBeVisible();
});
- it('keeps the schedule form free of the report type choice while Patrol cannot run', () => {
+ it('keeps the schedule form free of the report type choice while Patrol cannot run', async () => {
useReportingPanelStateMock.mockReturnValue(
buildState({ scheduleFormOpen: () => true, patrolDigestAvailable: () => false }),
);
render(() => <ReportingPanel />);
+ await screen.findByLabelText('Schedule name', { selector: 'input' });
expect(screen.queryByLabelText('Report type')).not.toBeInTheDocument();
+ expect(screen.getByLabelText('Schedule name', { selector: 'input' })).toHaveFocus();
expect(screen.queryByText(/Patrol weekly summary can also be emailed/)).not.toBeInTheDocument();
expect(screen.getByLabelText('Cadence')).toBeInTheDocument();
// One picker for on-demand reports, one in the schedule form.
expect(screen.getAllByText('Mock Resource Picker')).toHaveLength(2);
});
- it('offers the Patrol weekly summary as a report type when Patrol can run', () => {
+ it('offers the Patrol weekly summary as a report type when Patrol can run', async () => {
const setScheduleKind = vi.fn();
useReportingPanelStateMock.mockReturnValue(
buildState({
@@ -208,6 +210,7 @@ describe('ReportingPanel', () => {
);
render(() => <ReportingPanel />);
+ await screen.findByLabelText('Schedule name', { selector: 'input' });
expect(screen.getByText(/Patrol weekly summary can also be emailed/)).toBeInTheDocument();
const select = screen.getByLabelText('Report type') as HTMLSelectElement;
@@ -225,7 +228,7 @@ describe('ReportingPanel', () => {
expect(setScheduleKind).toHaveBeenCalledWith('patrol_digest');
});
- it('reduces the form to weekday, time and recipients for a Patrol weekly summary', () => {
+ it('reduces the form to weekday, time and recipients for a Patrol weekly summary', async () => {
const base = buildState();
useReportingPanelStateMock.mockReturnValue(
buildState({
@@ -244,6 +247,7 @@ describe('ReportingPanel', () => {
);
render(() => <ReportingPanel />);
+ await screen.findByLabelText('Schedule name', { selector: 'input' });
// An existing digest schedule stays editable even when Patrol is off now.
const select = screen.getByLabelText('Report type') as HTMLSelectElement;
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 0ecdaf1eef..1bdeeb76aa 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -817,11 +817,8 @@ describe('settings architecture guardrails', () => {
'<span class="hidden sm:inline">Manage Access</span>',
);
expect(userAssignmentsPanelSource).toContain('<span class="hidden sm:inline">Remove</span>');
- expect(reportingPanelSource).toContain('hidden w-[16%] px-3 py-2 font-semibold sm:table-cell');
- expect(reportingPanelSource).toContain('text-xs font-normal text-muted sm:hidden');
- expect(reportingPanelSource).toContain('<details class="group sm:hidden">');
- expect(reportingPanelSource).toContain('aria-label={`Actions for ${schedule.name}`}');
- expect(reportingPanelSource).toContain('class="hidden justify-end gap-1 sm:flex"');
+ // Scheduled reports use a list. ReportingPanel.test.tsx and the Reports
+ // browser matrix verify visible recovery actions instead of table markup.
});
it('keeps settings loading skeletons on the shared skeleton primitive', () => {