diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md index 9a6f064e3..7d25151ed 100644 --- a/docs/release-control/v6/internal/subsystems/alerts.md +++ b/docs/release-control/v6/internal/subsystems/alerts.md @@ -256,8 +256,12 @@ owns webhook load/mutate/test flow, destination test actions plus retry orchestration around that webhook runtime, while `frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx` stays the -destinations render shell. Future config cleanup should extend the config -transport hook, the config model, the override-projection hook, or the +destinations render shell and composes +`frontend-modern/src/features/alerts/AlertEmailDestinationsSection.tsx`, +`frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx`, +`frontend-modern/src/features/alerts/AlertWebhookDestinationsSection.tsx`, and +the dedicated load/error wrappers. Future config cleanup should extend the +config transport hook, the config model, the override-projection hook, or the destinations runtime hook based on which subsystem actually owns the behavior instead of letting the broader configuration hook absorb all four concerns again. diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md index 348f555bc..6f91f69aa 100644 --- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md +++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md @@ -456,9 +456,11 @@ owns webhook runtime, and `frontend-modern/src/features/alerts/useAlertDestinationsTabState.ts` now owns destination test actions plus retry orchestration while `frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx` stays the -render shell. Future cleanup should extend the transport hook, config model, -override hook, or destinations runtime hook based on the true owner, not move -config control flow back into the top-level page shell. +render shell and should compose the dedicated email, Apprise, webhook, and +load/error section owners instead of carrying those panels inline. Future +cleanup should extend the transport hook, config model, override hook, or +destinations runtime hook based on the true owner, not move config control +flow back into the top-level page shell. The alert email provider picker now also follows the shell/runtime split: `frontend-modern/src/components/Alerts/useEmailProviderSelectState.ts` owns provider-catalog loading and provider-default application, while diff --git a/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx b/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx new file mode 100644 index 000000000..4abd92e40 --- /dev/null +++ b/frontend-modern/src/features/alerts/AlertAppriseDestinationsSection.tsx @@ -0,0 +1,251 @@ +import { Show } from 'solid-js'; + +import { SettingsPanel } from '@/components/shared/SettingsPanel'; +import { Toggle } from '@/components/shared/Toggle'; +import { + formControl, + formField, + formHelpText, + labelClass, +} from '@/components/shared/Form'; +import type { UIAppriseConfig } from './types'; +import { + ALERT_DESTINATIONS_APPRISE_API_KEY_HEADER_HELP, + ALERT_DESTINATIONS_APPRISE_API_KEY_HEADER_LABEL, + ALERT_DESTINATIONS_APPRISE_API_KEY_HEADER_PLACEHOLDER, + ALERT_DESTINATIONS_APPRISE_API_KEY_HELP, + ALERT_DESTINATIONS_APPRISE_API_KEY_LABEL, + ALERT_DESTINATIONS_APPRISE_API_KEY_PLACEHOLDER, + ALERT_DESTINATIONS_APPRISE_CLI_PATH_HELP, + ALERT_DESTINATIONS_APPRISE_CLI_PATH_LABEL, + ALERT_DESTINATIONS_APPRISE_CLI_PATH_PLACEHOLDER, + ALERT_DESTINATIONS_APPRISE_CONFIG_KEY_HELP, + ALERT_DESTINATIONS_APPRISE_CONFIG_KEY_LABEL, + ALERT_DESTINATIONS_APPRISE_CONFIG_KEY_PLACEHOLDER, + ALERT_DESTINATIONS_APPRISE_MODE_CLI_LABEL, + ALERT_DESTINATIONS_APPRISE_MODE_HELP, + ALERT_DESTINATIONS_APPRISE_MODE_HTTP_LABEL, + ALERT_DESTINATIONS_APPRISE_MODE_LABEL, + ALERT_DESTINATIONS_APPRISE_PANEL_DESCRIPTION, + ALERT_DESTINATIONS_APPRISE_PANEL_TITLE, + ALERT_DESTINATIONS_APPRISE_SERVER_URL_HELP, + ALERT_DESTINATIONS_APPRISE_SERVER_URL_LABEL, + ALERT_DESTINATIONS_APPRISE_SERVER_URL_PLACEHOLDER, + ALERT_DESTINATIONS_APPRISE_TARGETS_LABEL, + ALERT_DESTINATIONS_APPRISE_TARGETS_PLACEHOLDER, + ALERT_DESTINATIONS_APPRISE_TIMEOUT_HELP, + ALERT_DESTINATIONS_APPRISE_TIMEOUT_LABEL, + ALERT_DESTINATIONS_APPRISE_TLS_CHECKBOX_LABEL, + ALERT_DESTINATIONS_APPRISE_TLS_HELP, + ALERT_DESTINATIONS_APPRISE_TLS_LABEL, + getAlertDestinationsAppriseTargetsHelp, + getAlertDestinationsAppriseTestLabel, + getAlertDestinationsStatusLabel, +} from '@/utils/alertDestinationsPresentation'; + +interface AlertAppriseDestinationsSectionProps { + config: UIAppriseConfig; + updateApprise: (partial: Partial) => void; + setHasUnsavedChanges: (value: boolean) => void; + onTest: () => void; + testing: boolean; +} + +export function AlertAppriseDestinationsSection(props: AlertAppriseDestinationsSectionProps) { + return ( + + { + props.updateApprise({ enabled: event.currentTarget.checked }); + props.setHasUnsavedChanges(true); + }} + label={ + + {getAlertDestinationsStatusLabel(props.config.enabled)} + + } + /> + + + } + class="min-w-0" + bodyClass="space-y-4" + > +
+
+ + +

{ALERT_DESTINATIONS_APPRISE_MODE_HELP}

+
+ +
+ +