Making form and lang better

This commit is contained in:
Owen
2026-04-20 18:14:30 -07:00
parent 1a36475afa
commit 49b3163bbe
5 changed files with 21 additions and 19 deletions

View File

@@ -1383,13 +1383,15 @@
"alertingTrigger": "When to alert",
"alertingTriggerSiteOnline": "Site online",
"alertingTriggerSiteOffline": "Site offline",
"alertingTriggerSiteToggle": "Site toggled",
"alertingTriggerSiteToggle": "Site status changes",
"alertingTriggerHcHealthy": "Health check healthy",
"alertingTriggerHcUnhealthy": "Health check unhealthy",
"alertingTriggerHcToggle": "Health check toggled",
"alertingTriggerHcToggle": "Health check status changes",
"alertingTriggerResourceHealthy": "Resource healthy",
"alertingTriggerResourceUnhealthy": "Resource unhealthy",
"alertingTriggerResourceToggle": "Resource toggled",
"alertingSearchHealthChecks": "Search health checks…",
"alertingHealthChecksEmpty": "No health checks available.",
"alertingTriggerResourceToggle": "Resource status changes",
"alertingSourceResource": "Resource",
"alertingSectionActions": "Actions",
"alertingAddAction": "Add action",

View File

@@ -73,13 +73,13 @@ function buildSubject(context: AlertContext): string {
case "site_offline":
return "[Alert] Site Offline";
case "site_toggle":
return "[Alert] Site Toggled";
return "[Alert] Site Status Changed";
case "health_check_healthy":
return "[Alert] Health Check Recovered";
case "health_check_unhealthy":
return "[Alert] Health Check Failing";
case "health_check_toggle":
return "[Alert] Health Check Toggled";
return "[Alert] Health Check Status Changed";
case "resource_healthy":
return "[Alert] Resource Healthy";
case "resource_unhealthy":

View File

@@ -978,7 +978,7 @@ export function AlertRuleSourceFields({
curTrigger !== "site_offline" &&
curTrigger !== "site_toggle"
) {
setValue("trigger", "site_offline", {
setValue("trigger", "site_toggle", {
shouldValidate: true
});
}
@@ -990,7 +990,7 @@ export function AlertRuleSourceFields({
) {
setValue(
"trigger",
"resource_unhealthy",
"resource_toggle",
{ shouldValidate: true }
);
}
@@ -1001,7 +1001,7 @@ export function AlertRuleSourceFields({
) {
setValue(
"trigger",
"health_check_unhealthy",
"health_check_toggle",
{ shouldValidate: true }
);
}
@@ -1110,39 +1110,39 @@ export function AlertRuleTriggerFields({
<SelectContent>
{sourceType === "site" ? (
<>
<SelectItem value="site_toggle">
{t("alertingTriggerSiteToggle")}
</SelectItem>
<SelectItem value="site_online">
{t("alertingTriggerSiteOnline")}
</SelectItem>
<SelectItem value="site_offline">
{t("alertingTriggerSiteOffline")}
</SelectItem>
<SelectItem value="site_toggle">
{t("alertingTriggerSiteToggle")}
</SelectItem>
</>
) : sourceType === "resource" ? (
<>
<SelectItem value="resource_toggle">
{t("alertingTriggerResourceToggle")}
</SelectItem>
<SelectItem value="resource_healthy">
{t("alertingTriggerResourceHealthy")}
</SelectItem>
<SelectItem value="resource_unhealthy">
{t("alertingTriggerResourceUnhealthy")}
</SelectItem>
<SelectItem value="resource_toggle">
{t("alertingTriggerResourceToggle")}
</SelectItem>
</>
) : (
<>
<SelectItem value="health_check_toggle">
{t("alertingTriggerHcToggle")}
</SelectItem>
<SelectItem value="health_check_healthy">
{t("alertingTriggerHcHealthy")}
</SelectItem>
<SelectItem value="health_check_unhealthy">
{t("alertingTriggerHcUnhealthy")}
</SelectItem>
<SelectItem value="health_check_toggle">
{t("alertingTriggerHcToggle")}
</SelectItem>
</>
)}
</SelectContent>

View File

@@ -354,7 +354,7 @@ export default function AlertRuleGraphEditor({
useWatch({ control: form.control, name: "resourceIds" }) ?? [];
const wTrigger =
useWatch({ control: form.control, name: "trigger" }) ??
"site_offline";
"site_toggle";
const wActions =
useWatch({ control: form.control, name: "actions" }) ?? [];

View File

@@ -298,7 +298,7 @@ export function defaultFormValues(): AlertRuleFormValues {
siteIds: [],
healthCheckIds: [],
resourceIds: [],
trigger: "site_offline",
trigger: "site_toggle",
actions: [
{
type: "notify",