-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nicer display of Host Control Panel, internal fixes #853
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
bakert
commented
Nov 21, 2024
- Switch to river-style SQL in Deck constructor
- Tighten up nullability on Deck
- Remove some error checking we have typesafed out of existence
- Remove a test that has been typesafed away
- Update phpstan baseline after recent improvements
- Update psalm baseline after fixing some props in Deck constructor
- Componentize MonthDropMenu
- Componentize EntryListItem
- Componentize UnverifiedPlayerCell
- Stop confusing the typechecker with too-specific types
- Accomodate events that don't have any final rounds
- *Remove all remaining Args funcs that return arrays in favor of Components
- Return assoc array when returning more than one var
- Remove a couple rogue colors in favor of vars
- Types for medallists
- Split event display into Pending, Active, Upcoming and Past Events
Used in the list of registered players on event.php. This was one of the first things converted to the Page system and I later decided on a more componentized and less "pass horking great big objects into mustache templates" style.
Set the medals correctly and don't error upon event conclusion if, say, you only have 4 rounds Single Elimination as mainrounds with no finalrounds. This used to work in the old code but I didn't quite translate it right when refactoring: ``` // Assigns trophies based on the finals matches which are entered. public function assignTropiesFromMatches() { $t8 = []; $t4 = []; $sec = ''; $win = ''; if ($this->finalrounds > 0) { $quarter_finals = $this->finalrounds >= 3; if ($quarter_finals) { $quart_round = $this->mainrounds + $this->finalrounds - 2; $matches = $this->getRoundMatches($quart_round); foreach ($matches as $match) { $t8[] = $match->getLoser(); } } $semi_finals = $this->finalrounds >= 2; if ($semi_finals) { $semi_round = $this->mainrounds + $this->finalrounds - 1; $matches = $this->getRoundMatches($semi_round); foreach ($matches as $match) { $t4[] = $match->getLoser(); } } $finalmatches = $this->getRoundMatches($this->mainrounds + $this->finalrounds); $finalmatch = $finalmatches[0]; $sec = $finalmatch->getLoser(); $win = $finalmatch->getWinner(); } else { $quarter_finals = $this->mainrounds >= 3; if ($quarter_finals) { $quart_round = $this->mainrounds - 2; $matches = $this->getRoundMatches($quart_round); foreach ($matches as $match) { $t8[] = $match->getLoser(); } } $semi_finals = $this->mainrounds >= 2; if ($semi_finals) { $semi_round = $this->mainrounds - 1; $matches = $this->getRoundMatches($semi_round); foreach ($matches as $match) { $t4[] = $match->getLoser(); } } $finalmatches = $this->getRoundMatches($this->mainrounds); $finalmatch = $finalmatches[0]; $sec = $finalmatch->getLoser(); $win = $finalmatch->getWinner(); } $this->setFinalists($win, $sec, $t4, $t8); } ```
That's what we do elsewhere so let's stay consistent. This is more self- describing if a bit more verbose.
Events that need to be started are most important, event that are running are next most important, events in the future are next, and old events are least; now the hierarchy of the page reflects that. Remove a bunch of not-super-useful columns from event display. This'll work better on mobile and "k value" and "host/cohost" were not super useful columns. "Finalized" is now implied by location on the page and can go too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.