From 1971ff69e310c296bbf262f7ff7c128bc0d195a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LAGACHE?= <43389096+Asuniia@users.noreply.github.com> Date: Mon, 13 Jul 2026 15:33:46 +0200 Subject: [PATCH] Feat/test channel (#371) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add: test btn * fix * fix --------- Co-authored-by: Théo LAGACHE --- .../components/channel-add-edit-modal.tsx | 2 +- .../components/channel-edit-button.tsx | 6 +-- .../channel/components/channel-form.tsx | 12 ++--- .../components/channel-test-button.tsx | 3 +- .../channel/components/channels-helpers.tsx | 24 +++++----- .../{ => discord}/discord.form.tsx | 0 .../{ => discord}/discord.schema.ts | 0 .../notifications/{ => discord}/discord.ts | 0 .../components/notifications/discord/index.ts | 1 + .../{ => gotify}/gotify.form.tsx | 0 .../{ => gotify}/gotify.schema.ts | 0 .../notifications/{ => gotify}/gotify.ts | 0 .../components/notifications/gotify/index.ts | 1 + .../notifications/nextcloud/index.ts | 1 + .../{ => nextcloud}/nextcloud.form.tsx | 0 .../{ => nextcloud}/nextcloud.schema.ts | 0 .../{ => nextcloud}/nextcloud.ts | 0 .../components/notifications/ntfy/index.ts | 1 + .../notifications/{ => ntfy}/ntfy.form.tsx | 0 .../notifications/{ => ntfy}/ntfy.schema.ts | 0 .../notifications/{ => ntfy}/ntfy.ts | 0 .../notifications/pushover/index.ts | 1 + .../{ => pushover}/pushover.form.tsx | 2 +- .../{ => pushover}/pushover.schema.ts | 0 .../notifications/{ => pushover}/pushover.ts | 0 .../components/notifications/slack/index.ts | 1 + .../notifications/{ => slack}/slack.form.tsx | 0 .../notifications/{ => slack}/slack.schema.ts | 0 .../notifications/{ => slack}/slack.ts | 0 .../components/notifications/smtp/index.ts | 1 + .../notifications/{ => smtp}/smtp.form.tsx | 0 .../notifications/{ => smtp}/smtp.schema.ts | 0 .../notifications/{ => smtp}/smtp.ts | 0 .../components/notifications/teams/index.ts | 1 + .../notifications/{ => teams}/teams.form.tsx | 0 .../notifications/{ => teams}/teams.schema.ts | 0 .../notifications/{ => teams}/teams.ts | 0 .../notifications/telegram/index.ts | 1 + .../{ => telegram}/telegram.form.tsx | 0 .../{ => telegram}/telegram.schema.ts | 0 .../notifications/{ => telegram}/telegram.ts | 0 .../components/notifications/webhook/index.ts | 1 + .../{ => webhook}/webhook.form.tsx | 0 .../{ => webhook}/webhook.schema.ts | 0 .../notifications/{ => webhook}/webhook.ts | 0 .../storages/{ => az-blob}/az-blob.form.tsx | 0 .../storages/{ => az-blob}/az-blob.schema.ts | 0 .../storages/{ => az-blob}/az-blob.ts | 0 .../components/storages/az-blob/index.ts | 1 + .../components/storages/local/index.ts | 1 + .../storages/{ => local}/local.schema.ts | 0 .../components/storages/{ => local}/local.ts | 0 .../channel/components/storages/s3/index.ts | 1 + .../components/storages/{ => s3}/s3.form.tsx | 0 .../components/storages/{ => s3}/s3.schema.ts | 0 .../components/storages/{ => s3}/s3.ts | 0 .../channel/schemas/channel-form.schema.ts | 26 +++++----- .../utils/notifications.dispatch.ts | 48 +++++++++++-------- 58 files changed, 78 insertions(+), 58 deletions(-) rename src/features/channel/components/notifications/{ => discord}/discord.form.tsx (100%) rename src/features/channel/components/notifications/{ => discord}/discord.schema.ts (100%) rename src/features/channel/components/notifications/{ => discord}/discord.ts (100%) create mode 100644 src/features/channel/components/notifications/discord/index.ts rename src/features/channel/components/notifications/{ => gotify}/gotify.form.tsx (100%) rename src/features/channel/components/notifications/{ => gotify}/gotify.schema.ts (100%) rename src/features/channel/components/notifications/{ => gotify}/gotify.ts (100%) create mode 100644 src/features/channel/components/notifications/gotify/index.ts create mode 100644 src/features/channel/components/notifications/nextcloud/index.ts rename src/features/channel/components/notifications/{ => nextcloud}/nextcloud.form.tsx (100%) rename src/features/channel/components/notifications/{ => nextcloud}/nextcloud.schema.ts (100%) rename src/features/channel/components/notifications/{ => nextcloud}/nextcloud.ts (100%) create mode 100644 src/features/channel/components/notifications/ntfy/index.ts rename src/features/channel/components/notifications/{ => ntfy}/ntfy.form.tsx (100%) rename src/features/channel/components/notifications/{ => ntfy}/ntfy.schema.ts (100%) rename src/features/channel/components/notifications/{ => ntfy}/ntfy.ts (100%) create mode 100644 src/features/channel/components/notifications/pushover/index.ts rename src/features/channel/components/notifications/{ => pushover}/pushover.form.tsx (99%) rename src/features/channel/components/notifications/{ => pushover}/pushover.schema.ts (100%) rename src/features/channel/components/notifications/{ => pushover}/pushover.ts (100%) create mode 100644 src/features/channel/components/notifications/slack/index.ts rename src/features/channel/components/notifications/{ => slack}/slack.form.tsx (100%) rename src/features/channel/components/notifications/{ => slack}/slack.schema.ts (100%) rename src/features/channel/components/notifications/{ => slack}/slack.ts (100%) create mode 100644 src/features/channel/components/notifications/smtp/index.ts rename src/features/channel/components/notifications/{ => smtp}/smtp.form.tsx (100%) rename src/features/channel/components/notifications/{ => smtp}/smtp.schema.ts (100%) rename src/features/channel/components/notifications/{ => smtp}/smtp.ts (100%) create mode 100644 src/features/channel/components/notifications/teams/index.ts rename src/features/channel/components/notifications/{ => teams}/teams.form.tsx (100%) rename src/features/channel/components/notifications/{ => teams}/teams.schema.ts (100%) rename src/features/channel/components/notifications/{ => teams}/teams.ts (100%) create mode 100644 src/features/channel/components/notifications/telegram/index.ts rename src/features/channel/components/notifications/{ => telegram}/telegram.form.tsx (100%) rename src/features/channel/components/notifications/{ => telegram}/telegram.schema.ts (100%) rename src/features/channel/components/notifications/{ => telegram}/telegram.ts (100%) create mode 100644 src/features/channel/components/notifications/webhook/index.ts rename src/features/channel/components/notifications/{ => webhook}/webhook.form.tsx (100%) rename src/features/channel/components/notifications/{ => webhook}/webhook.schema.ts (100%) rename src/features/channel/components/notifications/{ => webhook}/webhook.ts (100%) rename src/features/channel/components/storages/{ => az-blob}/az-blob.form.tsx (100%) rename src/features/channel/components/storages/{ => az-blob}/az-blob.schema.ts (100%) rename src/features/channel/components/storages/{ => az-blob}/az-blob.ts (100%) create mode 100644 src/features/channel/components/storages/az-blob/index.ts create mode 100644 src/features/channel/components/storages/local/index.ts rename src/features/channel/components/storages/{ => local}/local.schema.ts (100%) rename src/features/channel/components/storages/{ => local}/local.ts (100%) create mode 100644 src/features/channel/components/storages/s3/index.ts rename src/features/channel/components/storages/{ => s3}/s3.form.tsx (100%) rename src/features/channel/components/storages/{ => s3}/s3.schema.ts (100%) rename src/features/channel/components/storages/{ => s3}/s3.ts (100%) diff --git a/src/features/channel/components/channel-add-edit-modal.tsx b/src/features/channel/components/channel-add-edit-modal.tsx index 4f8e1164..90bb8ff1 100644 --- a/src/features/channel/components/channel-add-edit-modal.tsx +++ b/src/features/channel/components/channel-add-edit-modal.tsx @@ -43,7 +43,7 @@ export const ChannelAddEditModal = ({ }: ChannelAddModalProps) => { const isMobile = useIsMobile(); const [openInternal, setOpen] = useState(open); - const isLocalSystem = channel?.provider == "local"; + const isLocalSystem = channel?.provider === "local"; const isCreate = !Boolean(channel); diff --git a/src/features/channel/components/channel-edit-button.tsx b/src/features/channel/components/channel-edit-button.tsx index 37ece12d..e997df52 100644 --- a/src/features/channel/components/channel-edit-button.tsx +++ b/src/features/channel/components/channel-edit-button.tsx @@ -33,7 +33,7 @@ export const EditChannelButton = ({ }: EditChannelButtonProps) => { const router = useRouter(); const [isAddModalOpen, setIsAddModalOpen] = useState(false); - const isLocalSystem = channel.provider == "local"; + const isLocalSystem = channel.provider === "local"; const mutation = useMutation({ @@ -51,10 +51,10 @@ export const EditChannelButton = ({ }; let result: any; - if (kind == "notification") { + if (kind === "notification") { // @ts-expect-error — payload type varies between notification and storage result = await updateNotificationChannelAction(payload) - } else if (kind == "storage") { + } else if (kind === "storage") { // @ts-expect-error — payload type varies between notification and storage result = await updateStorageChannelAction(payload) } else { diff --git a/src/features/channel/components/channel-form.tsx b/src/features/channel/components/channel-form.tsx index 979130b7..4a0457c7 100644 --- a/src/features/channel/components/channel-form.tsx +++ b/src/features/channel/components/channel-form.tsx @@ -224,13 +224,11 @@ export const ChannelForm = ({onSuccessAction, organization, defaultValues, kind}
- {(!isCreate || kind == "storage") && ( - - )} +