diff --git a/messages/en-US.json b/messages/en-US.json index 9b14cee39..29e904416 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -1371,7 +1371,7 @@ "alertingColumnTrigger": "Trigger", "alertingColumnActions": "Actions", "alertingColumnEnabled": "Enabled", - "alertingDeleteQuestion": "Delete this alert rule? This cannot be undone.", + "alertingDeleteQuestion": "Please confirm you want to delete this alert rule.", "alertingDeleteRule": "Delete alert rule", "alertingRuleDeleted": "Alert rule deleted", "alertingRuleSaved": "Alert rule saved", @@ -1489,7 +1489,7 @@ "standaloneHcNameLabel": "Name", "standaloneHcNamePlaceholder": "My HTTP Monitor", "standaloneHcDeleteTitle": "Delete health check", - "standaloneHcDeleteQuestion": "Delete this health check? This cannot be undone.", + "standaloneHcDeleteQuestion": "Please confirm you want to delete this health check.", "standaloneHcDeleted": "Health check deleted", "standaloneHcSaved": "Health check saved", "standaloneHcColumnHealth": "Health", diff --git a/src/components/alert-rule-editor/AlertRuleFields.tsx b/src/components/alert-rule-editor/AlertRuleFields.tsx index 0228b30bc..bb99d57f3 100644 --- a/src/components/alert-rule-editor/AlertRuleFields.tsx +++ b/src/components/alert-rule-editor/AlertRuleFields.tsx @@ -1156,6 +1156,7 @@ export function AlertRuleSourceFields({ ( ( ( buildFormSchema(t), [t]); const form = useForm({ - resolver: zodResolver(schema), + resolver: zodResolver(schema) as Resolver, defaultValues: initialValues ?? defaultFormValues() }); diff --git a/src/lib/alertRuleForm.ts b/src/lib/alertRuleForm.ts index 115c9fcf5..426a6d309 100644 --- a/src/lib/alertRuleForm.ts +++ b/src/lib/alertRuleForm.ts @@ -142,12 +142,12 @@ export function buildFormSchema(t: (k: string) => string) { .min(1, { message: t("alertingErrorNameRequired") }), enabled: z.boolean(), sourceType: z.enum(["site", "health_check", "resource"]), - allSites: z.boolean(), - siteIds: z.array(z.number()), - allHealthChecks: z.boolean(), - healthCheckIds: z.array(z.number()), - allResources: z.boolean(), - resourceIds: z.array(z.number()), + allSites: z.boolean().default(true), + siteIds: z.array(z.number()).default([]), + allHealthChecks: z.boolean().default(true), + healthCheckIds: z.array(z.number()).default([]), + allResources: z.boolean().default(true), + resourceIds: z.array(z.number()).default([]), trigger: z.enum([ "site_online", "site_offline", @@ -332,8 +332,8 @@ export function apiResponseToFormValues( const sourceType = rule.eventType.startsWith("site_") ? "site" : rule.eventType.startsWith("resource_") - ? "resource" - : "health_check"; + ? "resource" + : "health_check"; // Collect notify recipients into a single notify action (if any) const userTags = rule.recipients