diff --git a/app/client/modules/notifications/components/create-notification-form.tsx b/app/client/modules/notifications/components/create-notification-form.tsx index 21997451..66451dc1 100644 --- a/app/client/modules/notifications/components/create-notification-form.tsx +++ b/app/client/modules/notifications/components/create-notification-form.tsx @@ -59,7 +59,6 @@ type Props = { initialValues?: Partial; formId?: string; className?: string; - readOnly?: boolean; }; const defaultValuesForType = { @@ -123,14 +122,7 @@ const defaultValuesForType = { }, }; -export const CreateNotificationForm = ({ - onSubmit, - mode = "create", - initialValues, - formId, - className, - readOnly = false, -}: Props) => { +export const CreateNotificationForm = ({ onSubmit, mode = "create", initialValues, formId, className }: Props) => { const form = useForm({ resolver: zodResolver(formSchema, undefined, { raw: true }), defaultValues: initialValues || { @@ -153,7 +145,7 @@ export const CreateNotificationForm = ({ onSubmit={form.handleSubmit(onSubmit, scrollToFirstError)} className={cn("space-y-4", className)} > -
+
Name - + Unique identifier for this notification destination. @@ -186,10 +178,10 @@ export const CreateNotificationForm = ({ } }} value={field.value ?? ""} - disabled={mode === "update" || readOnly} + disabled={mode === "update"} > - + @@ -211,14 +203,14 @@ export const CreateNotificationForm = ({ )} /> - {watchedType === "email" && } + {watchedType === "email" && } {watchedType === "slack" && } {watchedType === "discord" && } {watchedType === "gotify" && } - {watchedType === "ntfy" && } - {watchedType === "pushover" && } + {watchedType === "ntfy" && } + {watchedType === "pushover" && } {watchedType === "telegram" && } - {watchedType === "generic" && } + {watchedType === "generic" && } {watchedType === "custom" && }
diff --git a/app/client/modules/notifications/components/notification-forms/email-form.tsx b/app/client/modules/notifications/components/notification-forms/email-form.tsx index 9843b556..6231b5e3 100644 --- a/app/client/modules/notifications/components/notification-forms/email-form.tsx +++ b/app/client/modules/notifications/components/notification-forms/email-form.tsx @@ -7,10 +7,9 @@ import type { NotificationFormValues } from "../create-notification-form"; type Props = { form: UseFormReturn; - readOnly?: boolean; }; -export const EmailForm = ({ form, readOnly = false }: Props) => { +export const EmailForm = ({ form }: Props) => { return ( <> { render={({ field }) => ( - +
Use TLS diff --git a/app/client/modules/notifications/components/notification-forms/generic-form.tsx b/app/client/modules/notifications/components/notification-forms/generic-form.tsx index 15558340..a62ce1e7 100644 --- a/app/client/modules/notifications/components/notification-forms/generic-form.tsx +++ b/app/client/modules/notifications/components/notification-forms/generic-form.tsx @@ -10,7 +10,6 @@ import type { NotificationFormValues } from "../create-notification-form"; type Props = { form: UseFormReturn; - readOnly?: boolean; }; const WebhookPreview = ({ values }: { values: Partial }) => { @@ -49,7 +48,7 @@ ${body}`; ); }; -export const GenericForm = ({ form, readOnly = false }: Props) => { +export const GenericForm = ({ form }: Props) => { const watchedValues = useWatch({ control: form.control }); const useJson = useWatch({ control: form.control, name: "useJson" }); @@ -75,7 +74,7 @@ export const GenericForm = ({ form, readOnly = false }: Props) => { render={({ field }) => ( Method - @@ -128,11 +127,7 @@ export const GenericForm = ({ form, readOnly = false }: Props) => { render={({ field }) => ( - field.onChange(checked)} - /> + field.onChange(checked)} />
Use JSON Template diff --git a/app/client/modules/notifications/components/notification-forms/ntfy-form.tsx b/app/client/modules/notifications/components/notification-forms/ntfy-form.tsx index 979f2901..16ecec98 100644 --- a/app/client/modules/notifications/components/notification-forms/ntfy-form.tsx +++ b/app/client/modules/notifications/components/notification-forms/ntfy-form.tsx @@ -7,10 +7,9 @@ import type { NotificationFormValues } from "../create-notification-form"; type Props = { form: UseFormReturn; - readOnly?: boolean; }; -export const NtfyForm = ({ form, readOnly = false }: Props) => { +export const NtfyForm = ({ form }: Props) => { return ( <> { render={({ field }) => ( Priority - diff --git a/app/client/modules/notifications/components/notification-forms/pushover-form.tsx b/app/client/modules/notifications/components/notification-forms/pushover-form.tsx index 1dfd1f5a..e49dd2e6 100644 --- a/app/client/modules/notifications/components/notification-forms/pushover-form.tsx +++ b/app/client/modules/notifications/components/notification-forms/pushover-form.tsx @@ -7,10 +7,9 @@ import type { NotificationFormValues } from "../create-notification-form"; type Props = { form: UseFormReturn; - readOnly?: boolean; }; -export const PushoverForm = ({ form, readOnly = false }: Props) => { +export const PushoverForm = ({ form }: Props) => { return ( <> { Priority