From df950c6033a4155f0168315072008d36abfbb406 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 14 Apr 2024 14:24:13 +0300 Subject: [PATCH] Add Discord URL to tournament page --- .../tournament-bracket/core/tests/mocks.ts | 3 +++ .../tournament-bracket/core/tests/test-utils.ts | 1 + .../tournament/TournamentRepository.server.ts | 1 + .../tournament/routes/to.$id.register.tsx | 15 +++++++++++++++ 4 files changed, 20 insertions(+) diff --git a/app/features/tournament-bracket/core/tests/mocks.ts b/app/features/tournament-bracket/core/tests/mocks.ts index a19616be2..885475ec3 100644 --- a/app/features/tournament-bracket/core/tests/mocks.ts +++ b/app/features/tournament-bracket/core/tests/mocks.ts @@ -2269,6 +2269,7 @@ export const PADDLING_POOL_257 = () => isRanked: true, }, showMapListGenerator: 0, + discordUrl: null, castTwitchAccounts: ["dappleproductions"], castedMatchesInfo: { castedMatches: [ @@ -8083,6 +8084,7 @@ export const PADDLING_POOL_255 = () => teamsPerGroup: 4, }, showMapListGenerator: 0, + discordUrl: null, castTwitchAccounts: ["dappleproductions"], castedMatchesInfo: { castedMatches: [ @@ -14224,6 +14226,7 @@ export const IN_THE_ZONE_32 = () => ], }, showMapListGenerator: 0, + discordUrl: null, castTwitchAccounts: ["dappleproductions", "kyochandxd"], castedMatchesInfo: null, mapPickingStyle: "AUTO_SZ", diff --git a/app/features/tournament-bracket/core/tests/test-utils.ts b/app/features/tournament-bracket/core/tests/test-utils.ts index 83398c04c..b286f6629 100644 --- a/app/features/tournament-bracket/core/tests/test-utils.ts +++ b/app/features/tournament-bracket/core/tests/test-utils.ts @@ -42,6 +42,7 @@ export const testTournament = ( id: 1, description: null, rules: null, + discordUrl: null, startTime: 1705858842, isFinalized: 0, name: "test", diff --git a/app/features/tournament/TournamentRepository.server.ts b/app/features/tournament/TournamentRepository.server.ts index 8bb78e2f3..096def210 100644 --- a/app/features/tournament/TournamentRepository.server.ts +++ b/app/features/tournament/TournamentRepository.server.ts @@ -18,6 +18,7 @@ export async function findById(id: number) { .select(({ eb, exists, selectFrom }) => [ "Tournament.id", "CalendarEvent.id as eventId", + "CalendarEvent.discordUrl", "Tournament.settings", "Tournament.showMapListGenerator", "Tournament.castTwitchAccounts", diff --git a/app/features/tournament/routes/to.$id.register.tsx b/app/features/tournament/routes/to.$id.register.tsx index a3aab5fdc..ef02efa78 100644 --- a/app/features/tournament/routes/to.$id.register.tsx +++ b/app/features/tournament/routes/to.$id.register.tsx @@ -78,6 +78,7 @@ import { NewTabs } from "~/components/NewTabs"; import { useSearchParamState } from "~/hooks/useSearchParamState"; import * as TeamRepository from "~/features/team/TeamRepository.server"; import { Toggle } from "~/components/Toggle"; +import { DiscordIcon } from "~/components/icons/Discord"; export const action: ActionFunction = async ({ request, params }) => { const user = await requireUser(request); @@ -385,6 +386,20 @@ function TournamentRegisterInfoTabs() { key: "description", element: (