From cc7e1d6428ae3a342687bb3d372722ec37563663 Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Mon, 6 Dec 2021 23:05:41 +0200 Subject: [PATCH] Add overview tab --- README.md | 2 +- app/routes/to/$organization.$tournament.tsx | 3 ++- app/routes/to/$organization.$tournament/index.tsx | 9 +++++++++ .../migration.sql | 2 +- prisma/schema.prisma | 2 +- prisma/seed/script.ts | 3 ++- 6 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 app/routes/to/$organization.$tournament/index.tsx rename prisma/migrations/{20211206153625_initial => 20211206205152_initial}/migration.sql (99%) diff --git a/README.md b/README.md index 5c278a820..0e1a50429 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Prerequisites: [Node.js 16.13](https://nodejs.org/en/) - [x] Captain can remove players from roster - [ ] Add info about architecture to README -- [ ] Make description mandatory + overview tab +- [x] Make description mandatory + overview tab - [x] Captain can check in - [ ] Admin can check teams in (and out) - [ ] Admin can drop people out (show on bracket somehow that they dropped) diff --git a/app/routes/to/$organization.$tournament.tsx b/app/routes/to/$organization.$tournament.tsx index 18f5cfa3e..785f994a3 100644 --- a/app/routes/to/$organization.$tournament.tsx +++ b/app/routes/to/$organization.$tournament.tsx @@ -61,7 +61,7 @@ export default function TournamentPage() { const navLinks = (() => { const result: { code: string; text: string }[] = [ - { code: "overview", text: "Overview" }, + { code: "", text: "Overview" }, { code: "map-pool", text: "Map Pool" }, { code: "teams", text: `Teams (${data.teams.length})` }, ]; @@ -106,6 +106,7 @@ export default function TournamentPage() { to={code} data-cy={`${code}-nav-link`} prefetch="intent" + end > {text} diff --git a/app/routes/to/$organization.$tournament/index.tsx b/app/routes/to/$organization.$tournament/index.tsx new file mode 100644 index 000000000..ac9b96512 --- /dev/null +++ b/app/routes/to/$organization.$tournament/index.tsx @@ -0,0 +1,9 @@ +import { useMatches } from "remix"; +import type { FindTournamentByNameForUrlI } from "~/services/tournament"; + +export default function DefaultTab() { + const [, parentRoute] = useMatches(); + const { description } = parentRoute.data as FindTournamentByNameForUrlI; + + return
{description}
; +} diff --git a/prisma/migrations/20211206153625_initial/migration.sql b/prisma/migrations/20211206205152_initial/migration.sql similarity index 99% rename from prisma/migrations/20211206153625_initial/migration.sql rename to prisma/migrations/20211206205152_initial/migration.sql index f07482841..cfc4922d5 100644 --- a/prisma/migrations/20211206153625_initial/migration.sql +++ b/prisma/migrations/20211206205152_initial/migration.sql @@ -36,7 +36,7 @@ CREATE TABLE "Tournament" ( "id" TEXT NOT NULL, "name" TEXT NOT NULL, "nameForUrl" TEXT NOT NULL, - "description" TEXT, + "description" TEXT NOT NULL, "startTime" TIMESTAMP(3) NOT NULL, "checkInStartTime" TIMESTAMP(3) NOT NULL, "bannerBackground" TEXT NOT NULL, diff --git a/prisma/schema.prisma b/prisma/schema.prisma index b075aecfd..2074a6eb5 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -43,7 +43,7 @@ model Tournament { name String /// Name in lower case to show in URL nameForUrl String - description String? + description String startTime DateTime checkInStartTime DateTime /// CSS for tournament banner's background value diff --git a/prisma/seed/script.ts b/prisma/seed/script.ts index 93c5acd2b..a37b102b9 100644 --- a/prisma/seed/script.ts +++ b/prisma/seed/script.ts @@ -232,7 +232,8 @@ export async function seed(variation?: "check-in") { name: "In The Zone X", nameForUrl: "in-the-zone-x", organizerId: organizationId, - description: "In The Zone eXtreme", + description: + "In The Zone eXtreme\n\nCroissant cookie jelly macaroon caramels. Liquorice icing bonbon fruitcake wafer. Fruitcake pudding icing biscuit pie pie macaroon carrot cake shortbread. Soufflé dessert powder marshmallow biscuit.\n\nJelly-o wafer chocolate bar tootsie roll cheesecake chocolate bar. Icing candy canes cookie chocolate bar sesame snaps sugar plum cheesecake lollipop biscuit. Muffin marshmallow sweet soufflé bonbon pudding gummies sweet apple pie.\n\nSoufflé cookie sugar plum sesame snaps muffin cupcake wafer jelly-o carrot cake. Ice cream danish jelly-o dragée marzipan croissant. Shortbread cheesecake marshmallow biscuit gummi bears.", }, }); }