From 4d4c51dd46d6306754002093f7c9f9e199f29edf Mon Sep 17 00:00:00 2001 From: Flegma Date: Fri, 13 Mar 2026 13:14:43 +0100 Subject: [PATCH 1/3] Add tournament Discord voice channel settings UI Add Discord Server ID and Enable Voice Channels controls to the tournament notifications settings page, with corresponding i18n keys and GraphQL query fields. --- .../tournament/TournamentNotifications.vue | 74 ++++++++++++++++++- i18n/locales/en.json | 6 ++ pages/tournaments/[tournamentId]/index.vue | 2 + 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/components/tournament/TournamentNotifications.vue b/components/tournament/TournamentNotifications.vue index 1ef3cec7..18eb0d04 100644 --- a/components/tournament/TournamentNotifications.vue +++ b/components/tournament/TournamentNotifications.vue @@ -66,6 +66,62 @@ + +
+
+

+ {{ $t("tournament.voice.title") }} +

+

+ {{ $t("tournament.voice.description") }} +

+
+ +
+
+ +
+
+ +
+ {{ + $t("tournament.voice.enable_voice") + }} + +
+
+
+
@@ -287,6 +343,8 @@ const DISCORD_FIELDS = [ "discord_notifications_enabled", "discord_webhook", "discord_role_id", + "discord_guild_id", + "discord_voice_enabled", "discord_notify_PickingPlayers", "discord_notify_Scheduled", "discord_notify_WaitingForCheckIn", @@ -367,7 +425,11 @@ export default { buildForm(tournament: Record) { const form: Record = {}; for (const field of DISCORD_FIELDS) { - form[field] = tournament[field] ?? null; + if (field === "discord_voice_enabled") { + form[field] = tournament[field] ?? false; + } else { + form[field] = tournament[field] ?? null; + } } return form; }, @@ -425,14 +487,20 @@ export default { for (const field of DISCORD_FIELDS) { let value = this.form[field]; if ( - (field === "discord_webhook" || field === "discord_role_id") && + (field === "discord_webhook" || + field === "discord_role_id" || + field === "discord_guild_id") && value === "" ) { value = null; } variables[field] = value; - if (field === "discord_webhook" || field === "discord_role_id") { + if ( + field === "discord_webhook" || + field === "discord_role_id" || + field === "discord_guild_id" + ) { _set[field] = $(field, "String"); } else { _set[field] = $(field, "Boolean"); diff --git a/i18n/locales/en.json b/i18n/locales/en.json index 2310e1ac..b04d80bb 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -1167,6 +1167,12 @@ "Surrendered": "Surrendered" } }, + "voice": { + "title": "Voice Channels", + "description": "Automatically create Discord voice channels for tournament matches. Players are moved to team channels when matches begin.", + "guild_id_placeholder": "Discord Server ID", + "enable_voice": "Enable Voice Channels" + }, "table": { "tournament": "Tournament", "status": "Status", diff --git a/pages/tournaments/[tournamentId]/index.vue b/pages/tournaments/[tournamentId]/index.vue index 1f94829a..53b0046e 100644 --- a/pages/tournaments/[tournamentId]/index.vue +++ b/pages/tournaments/[tournamentId]/index.vue @@ -661,7 +661,9 @@ export default { description: true, }, description: true, + discord_guild_id: true, discord_notifications_enabled: true, + discord_voice_enabled: true, discord_webhook: true, discord_role_id: true, discord_notify_PickingPlayers: true, From b3051544c3daf24248ce21f519060052702b25fd Mon Sep 17 00:00:00 2001 From: Flegma Date: Fri, 13 Mar 2026 13:55:00 +0100 Subject: [PATCH 2/3] Rename tournament Notifications tab to Discord --- i18n/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/locales/en.json b/i18n/locales/en.json index b04d80bb..e88df525 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -1136,7 +1136,7 @@ } }, "notifications": { - "title": "Notifications", + "title": "Discord", "description": "Override global Discord notification settings for this tournament. Leave empty to use global defaults.", "webhook": "Webhook URL", "webhook_placeholder": "Leave empty to use global default", From 87ced26418402f02578bef25946268421a426df6 Mon Sep 17 00:00:00 2001 From: Flegma Date: Fri, 13 Mar 2026 14:54:12 +0100 Subject: [PATCH 3/3] fix: validate Discord guild ID input to numeric characters only Strip non-numeric characters from the guild ID input and add inputmode/pattern attributes for better mobile UX. --- components/tournament/TournamentNotifications.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/tournament/TournamentNotifications.vue b/components/tournament/TournamentNotifications.vue index 18eb0d04..89732b1e 100644 --- a/components/tournament/TournamentNotifications.vue +++ b/components/tournament/TournamentNotifications.vue @@ -82,8 +82,10 @@