Merge branch 'develop' into chore/form-refactor

This commit is contained in:
Alexander Holliday authored and GitHub committed 2026-08-12 10:15:10 -07:00
commit b088101160
15 files changed
+375 -6

No files matched your search

-2
View File
@@ -8,8 +8,6 @@ interface UseNotificationFormOptions {
}
function buildDefaults(data: Notification | null): NotificationFormData {
// Every channel field defaults to "" (not undefined) so untouched required
// fields fail zod with their custom messages instead of a type error.
return {
type: data?.type ?? "email",
notificationName: data?.notificationName || "",
+1
View File
@@ -3,6 +3,7 @@ export const NotificationChannels = [
"slack",
"discord",
"webhook",
"rocket_chat",
"pager_duty",
"matrix",
"teams",
+9
View File
@@ -30,6 +30,14 @@ const webhookSchema = baseSchema.extend({
address: z.string().min(1, "Webhook URL is required").url("Please enter a valid URL"),
});
const rocketChatSchema = baseSchema.extend({
type: z.literal("rocket_chat"),
address: z
.string()
.min(1, "Webhook URL is required")
.url({ protocol: /^https?$/, message: "Please enter a valid URL" }),
});
const pagerDutySchema = baseSchema.extend({
type: z.literal("pager_duty"),
address: z.string().min(1, "Integration key is required"),
@@ -81,6 +89,7 @@ export const notificationSchema = z.discriminatedUnion("type", [
slackSchema,
discordSchema,
webhookSchema,
rocketChatSchema,
pagerDutySchema,
matrixSchema,
teamsSchema,