Error {caught.status}
- {caught.data ? ( -{JSON.stringify(caught.data, null, 2)}
- ) : null}
{JSON.stringify(JSON.parse(caught.data), null, 2)}
+ ) : null}
From ef78d3a2c28e019ce616caf20bc1423bcc244dda Mon Sep 17 00:00:00 2001
From: Kalle <38327916+Sendouc@users.noreply.github.com>
Date: Mon, 15 May 2023 22:37:43 +0300
Subject: [PATCH] Tournament full (#1373)
* Got something going
* Style overwrites
* width != height
* More playing with lines
* Migrations
* Start bracket initial
* Unhardcode stage generation params
* Link to match page
* Matches page initial
* Support directly adding seed to map list generator
* Add docs
* Maps in matches page
* Add invariant about tie breaker map pool
* Fix PICNIC lacking tie breaker maps
* Only link in bracket when tournament has started
* Styled tournament roster inputs
* Prefer IGN in tournament match page
* ModeProgressIndicator
* Some conditional rendering
* Match action initial + better error display
* Persist bestOf in DB
* Resolve best of ahead of time
* Move brackets-manager to core
* Score reporting works
* Clear winner on score report
* ModeProgressIndicator: highlight winners
* Fix inconsistent input
* Better text when submitting match
* mapCountPlayedInSetWithCertainty that works
* UNDO_REPORT_SCORE implemented
* Permission check when starting tournament
* Remove IGN from upsert
* View match results page
* Source in DB
* Match page waiting for teams
* Move tournament bracket to feature folder
* REOPEN_MATCH initial
* Handle proper resetting of match
* Inline bracket-manager
* Syncify
* Transactions
* Handle match is locked gracefully
* Match page auto refresh
* Fix match refresh called "globally"
* Bracket autoupdate
* Move fillWithNullTillPowerOfTwo to utils with testing
* Fix map lists not visible after tournament started
* Optimize match events
* Show UI while in progress to members
* Fix start tournament alert not being responsive
* Teams can check in
* Fix map list 400
* xxx -> TODO
* Seeds page
* Remove map icons for team page
* Don't display link to seeds after tournament has started
* Admin actions initial
* Change captain admin action
* Make all hooks ts
* Admin actions functioning
* Fix validate error not displaying in CatchBoundary
* Adjust validate args order
* Remove admin loader
* Make delete team button menancing
* Only include checked in teams to bracket
* Optimize to.id route loads
* Working show map list generator toggle
* Update full tournaments flow
* Make full tournaments work with many start times
* Handle undefined in crud
* Dynamic stage banner
* Handle default strat if map list generation fails
* Fix crash on brackets if less than 2 teams
* Add commented out test for reference
* Add TODO
* Add players from team during register
* TrustRelationship
* Prefers not to host feature
* Last before merge
* Rename some vars
* More renames
---
app/components/Catcher.tsx | 10 +-
app/components/Divider.tsx | 3 +
app/components/Draggable.tsx | 35 +
app/components/Image.tsx | 4 +-
app/components/icons/Checkmark.tsx | 9 +-
app/db/models/calendar/create.sql | 6 +-
app/db/models/calendar/createTournament.sql | 4 +
app/db/models/calendar/eventsToReport.sql | 3 +-
.../calendar/findAllBetweenTwoTimestamps.sql | 3 +-
app/db/models/calendar/findById.sql | 5 +-
app/db/models/calendar/queries.server.ts | 75 +-
app/db/models/calendar/update.sql | 6 +-
app/db/seed/index.ts | 105 +-
app/db/types.ts | 136 +-
.../build-analyzer/routes/analyzer.tsx | 4 +-
.../img-upload/routes/upload.admin.tsx | 2 +-
app/features/img-upload/routes/upload.tsx | 14 +-
.../team/routes/t.$customUrl.edit.tsx | 2 +-
.../team/routes/t.$customUrl.join.tsx | 3 +-
.../team/routes/t.$customUrl.roster.tsx | 4 +-
app/features/team/routes/t.$customUrl.tsx | 5 +-
app/features/team/routes/t.tsx | 6 +-
.../tournament-bracket/brackets-viewer.css | 48 +
.../components/ScoreReporter.tsx | 336 +++
.../components/ScoreReporterRosters.tsx | 153 ++
.../components/TeamRosterInputs.tsx | 200 ++
.../tournament-bracket/core/bestOf.server.ts | 55 +
.../core/brackets-manager/crud-db.server.ts | 475 ++++
.../core/brackets-manager/crud.server.ts | 347 +++
.../core/brackets-manager/index.ts | 1 +
.../core/brackets-manager/manager.ts | 13 +
.../core/emitters.server.ts | 10 +
...eteTournamentMatchGameResultById.server.ts | 10 +
.../findAllMatchesByTournamentId.server.ts | 25 +
.../queries/findMatchById.server.ts | 29 +
.../queries/findResultsByMatchId.server.ts | 43 +
.../insertTournamentMatchGameResult.server.ts | 16 +
...namentMatchGameResultParticipant.server.ts | 15 +
.../queries/setBestOf.server.ts | 11 +
.../routes/to.$id.brackets.subscribe.tsx | 30 +
.../routes/to.$id.brackets.tsx | 260 +++
.../routes/to.$id.matches.$mid.subscribe.tsx | 28 +
.../routes/to.$id.matches.$mid.tsx | 481 ++++
.../tournament-bracket-schemas.server.ts | 36 +
.../tournament-bracket-utils.test.ts | 68 +
.../tournament-bracket-utils.ts | 143 ++
.../tournament-bracket/tournament-bracket.css | 242 ++
app/features/tournament/index.ts | 11 +
.../queries/changeTeamOwner.server.ts | 30 +
.../tournament/queries/checkIn.server.ts | 12 +
.../tournament/queries/checkOut.server.ts | 10 +
.../tournament/queries/createTeam.server.ts | 19 +-
.../tournament/queries/deleteTeam.server.ts | 10 +
.../queries/findByIdentifier.server.ts | 59 +-
.../tournament/queries/findOwnTeam.server.ts | 22 +-
.../queries/findTeamByInviteCode.server.ts | 4 +-
...r.ts => findTeamsByTournamentId.server.ts} | 27 +-
.../queries/findTrustedPlayers.server.ts | 37 +
.../tournament/queries/giveTrust.server.ts | 21 +
.../queries/hasTournamentStarted.server.ts | 12 +
...Team.server.ts => joinLeaveTeam.server.ts} | 24 +
.../tournament/queries/maxXPowers.server.ts | 21 +
.../queries/updateIsBeforeStart.server.ts | 20 -
.../updateShowMapListGenerator.server.ts | 20 +
.../queries/updateTeamInfo.server.ts | 6 +-
.../queries/updateTeamSeeds.server.ts | 26 +
.../tournament/routes/to.$id.admin.tsx | 411 +++-
.../tournament/routes/to.$id.index.tsx | 18 +-
.../tournament/routes/to.$id.join.tsx | 105 +-
.../tournament/routes/to.$id.maps.tsx | 21 +-
.../tournament/routes/to.$id.register.tsx | 498 +++-
.../tournament/routes/to.$id.seeds.tsx | 316 +++
.../tournament/routes/to.$id.teams.tsx | 51 +-
app/features/tournament/routes/to.$id.tsx | 106 +-
.../tournament/tournament-constants.ts | 2 +-
app/features/tournament/tournament-hooks.ts | 4 +-
.../tournament/tournament-schemas.server.ts | 52 +-
app/features/tournament/tournament-utils.ts | 88 +-
app/features/tournament/tournament.css | 101 +-
...teListEntry.tsx => useAnimateListEntry.ts} | 0
app/hooks/useAutoRerender.ts | 16 +
...hParamState.tsx => useSearchParamState.ts} | 0
app/hooks/useTimeoutState.ts | 33 +
app/modules/brackets-manager/README.md | 1 +
app/modules/brackets-manager/base/getter.ts | 667 ++++++
app/modules/brackets-manager/base/updater.ts | 436 ++++
app/modules/brackets-manager/create.ts | 1033 +++++++++
app/modules/brackets-manager/delete.ts | 59 +
app/modules/brackets-manager/find.ts | 164 ++
app/modules/brackets-manager/get.ts | 473 ++++
app/modules/brackets-manager/helpers.ts | 2022 +++++++++++++++++
app/modules/brackets-manager/index.ts | 32 +
app/modules/brackets-manager/manager.ts | 142 ++
app/modules/brackets-manager/ordering.ts | 114 +
app/modules/brackets-manager/reset.ts | 98 +
app/modules/brackets-manager/types.ts | 230 ++
app/modules/brackets-manager/update.ts | 319 +++
app/modules/brackets-memory-db/README.md | 1 +
app/modules/brackets-memory-db/index.ts | 250 ++
.../constants.ts | 2 +
.../generation.test.ts | 122 +-
.../tournament-map-list-generator/index.ts | 2 +
.../tournament-map-list.ts | 8 +-
.../tournament-map-list-generator/types.ts | 10 +-
app/permissions.ts | 30 +-
app/root.tsx | 5 +
app/routes/badges/$id.tsx | 2 +-
app/routes/calendar/$id/index.tsx | 8 +-
app/routes/calendar/$id/report-winners.tsx | 4 +-
app/routes/calendar/index.tsx | 31 +-
app/routes/calendar/new.tsx | 45 +-
app/routes/calendar/tags.json | 3 +
app/routes/patrons.tsx | 2 +-
app/routes/seed.tsx | 19 +-
app/styles/common.css | 24 +
app/styles/layout.css | 2 -
app/styles/utils.css | 16 +
app/styles/vars.css | 2 +
app/utils/playwright.ts | 39 +-
app/utils/remix.ts | 17 +-
app/utils/sql.ts | 4 +
app/utils/strings.ts | 4 +
app/utils/urls.ts | 26 +-
e2e/tournament.spec.ts | 194 ++
migrations/014-full-tournament.js | 1 -
migrations/026-full-tournament-v2.js | 234 ++
package-lock.json | 200 +-
package.json | 7 +-
public/locales/da/tournament.json | 5 +-
public/locales/de/tournament.json | 5 +-
public/locales/en/calendar.json | 4 +-
public/locales/en/common.json | 2 +
public/locales/en/tournament.json | 9 +-
public/locales/fr/tournament.json | 5 +-
public/locales/it/tournament.json | 5 +-
public/locales/ja/tournament.json | 5 +-
public/locales/pl/tournament.json | 5 +-
public/locales/ru/tournament.json | 5 +-
public/locales/zh/tournament.json | 5 +-
remix.config.js | 18 +
scripts/create-analyzer-json.ts | 6 -
tsconfig.json | 2 +-
142 files changed, 12284 insertions(+), 633 deletions(-)
create mode 100644 app/components/Divider.tsx
create mode 100644 app/components/Draggable.tsx
create mode 100644 app/db/models/calendar/createTournament.sql
create mode 100644 app/features/tournament-bracket/brackets-viewer.css
create mode 100644 app/features/tournament-bracket/components/ScoreReporter.tsx
create mode 100644 app/features/tournament-bracket/components/ScoreReporterRosters.tsx
create mode 100644 app/features/tournament-bracket/components/TeamRosterInputs.tsx
create mode 100644 app/features/tournament-bracket/core/bestOf.server.ts
create mode 100644 app/features/tournament-bracket/core/brackets-manager/crud-db.server.ts
create mode 100644 app/features/tournament-bracket/core/brackets-manager/crud.server.ts
create mode 100644 app/features/tournament-bracket/core/brackets-manager/index.ts
create mode 100644 app/features/tournament-bracket/core/brackets-manager/manager.ts
create mode 100644 app/features/tournament-bracket/core/emitters.server.ts
create mode 100644 app/features/tournament-bracket/queries/deleteTournamentMatchGameResultById.server.ts
create mode 100644 app/features/tournament-bracket/queries/findAllMatchesByTournamentId.server.ts
create mode 100644 app/features/tournament-bracket/queries/findMatchById.server.ts
create mode 100644 app/features/tournament-bracket/queries/findResultsByMatchId.server.ts
create mode 100644 app/features/tournament-bracket/queries/insertTournamentMatchGameResult.server.ts
create mode 100644 app/features/tournament-bracket/queries/insertTournamentMatchGameResultParticipant.server.ts
create mode 100644 app/features/tournament-bracket/queries/setBestOf.server.ts
create mode 100644 app/features/tournament-bracket/routes/to.$id.brackets.subscribe.tsx
create mode 100644 app/features/tournament-bracket/routes/to.$id.brackets.tsx
create mode 100644 app/features/tournament-bracket/routes/to.$id.matches.$mid.subscribe.tsx
create mode 100644 app/features/tournament-bracket/routes/to.$id.matches.$mid.tsx
create mode 100644 app/features/tournament-bracket/tournament-bracket-schemas.server.ts
create mode 100644 app/features/tournament-bracket/tournament-bracket-utils.test.ts
create mode 100644 app/features/tournament-bracket/tournament-bracket-utils.ts
create mode 100644 app/features/tournament-bracket/tournament-bracket.css
create mode 100644 app/features/tournament/index.ts
create mode 100644 app/features/tournament/queries/changeTeamOwner.server.ts
create mode 100644 app/features/tournament/queries/checkIn.server.ts
create mode 100644 app/features/tournament/queries/checkOut.server.ts
create mode 100644 app/features/tournament/queries/deleteTeam.server.ts
rename app/features/tournament/queries/{findTeamsByEventId.server.ts => findTeamsByTournamentId.server.ts} (70%)
create mode 100644 app/features/tournament/queries/findTrustedPlayers.server.ts
create mode 100644 app/features/tournament/queries/giveTrust.server.ts
create mode 100644 app/features/tournament/queries/hasTournamentStarted.server.ts
rename app/features/tournament/queries/{joinTeam.server.ts => joinLeaveTeam.server.ts} (63%)
create mode 100644 app/features/tournament/queries/maxXPowers.server.ts
delete mode 100644 app/features/tournament/queries/updateIsBeforeStart.server.ts
create mode 100644 app/features/tournament/queries/updateShowMapListGenerator.server.ts
create mode 100644 app/features/tournament/queries/updateTeamSeeds.server.ts
create mode 100644 app/features/tournament/routes/to.$id.seeds.tsx
rename app/hooks/{useAnimateListEntry.tsx => useAnimateListEntry.ts} (100%)
create mode 100644 app/hooks/useAutoRerender.ts
rename app/hooks/{useSearchParamState.tsx => useSearchParamState.ts} (100%)
create mode 100644 app/hooks/useTimeoutState.ts
create mode 100644 app/modules/brackets-manager/README.md
create mode 100644 app/modules/brackets-manager/base/getter.ts
create mode 100644 app/modules/brackets-manager/base/updater.ts
create mode 100644 app/modules/brackets-manager/create.ts
create mode 100644 app/modules/brackets-manager/delete.ts
create mode 100644 app/modules/brackets-manager/find.ts
create mode 100644 app/modules/brackets-manager/get.ts
create mode 100644 app/modules/brackets-manager/helpers.ts
create mode 100644 app/modules/brackets-manager/index.ts
create mode 100644 app/modules/brackets-manager/manager.ts
create mode 100644 app/modules/brackets-manager/ordering.ts
create mode 100644 app/modules/brackets-manager/reset.ts
create mode 100644 app/modules/brackets-manager/types.ts
create mode 100644 app/modules/brackets-manager/update.ts
create mode 100644 app/modules/brackets-memory-db/README.md
create mode 100644 app/modules/brackets-memory-db/index.ts
create mode 100644 e2e/tournament.spec.ts
create mode 100644 migrations/026-full-tournament-v2.js
diff --git a/app/components/Catcher.tsx b/app/components/Catcher.tsx
index 1f049dffb..ef49848aa 100644
--- a/app/components/Catcher.tsx
+++ b/app/components/Catcher.tsx
@@ -62,10 +62,14 @@ export function Catcher() {
return (
Error {caught.status}
- {caught.data ? (
- {JSON.stringify(caught.data, null, 2)}
- ) : null}
{JSON.stringify(JSON.parse(caught.data), null, 2)}
+ ) : null}
+ Please choose exactly {TOURNAMENT.TEAM_MIN_MEMBERS_FOR_FULL}+ + {TOURNAMENT.TEAM_MIN_MEMBERS_FOR_FULL} players to report score +
+ ); + } + + if (!winnerName) { + return ( ++ Please select the winner of this map +
+ ); + } + + return ( +