The tournament host (and anyone with the necessary permissions) must be able to update the tournament's settings.
How?
Using the tournament related procedures (lib/server/procedures.ts) the frontend has provide a UI to update different fields within the Tournament and TournamentDates tables.
Only users with host, debug or manage_tournament permissions are able to view this page.
The tournament related tRPC procedures must be carefully checked that all of the below conditions for each item is met and add any missing functionality.
Tournament
Only the host change the following:
name and acronym are fields that are able to be updated at any time without any major restrictions, just ask the user if they're sure about updating these settings once the tournament is public, notifying them that changing this will impact the tournament's discoverability.
urlSlug can be updated at any time, but the frontend must ask the user if they're sure if they want to update it, warning them about the fact that this will heavily affect how the tournament's URLs and URLs with the old slug won't work.
Only the host change the following + Can only be updated while the tournament isn't public, after it's public, it shouldn't be possible to update these value. The UI must communicate this to the user:
type.
teamSettings.
rankRange must provide a switch to toggle between open rank and rank restricted. If rank restricted, provide inputs for the user to type in the desired rank range, if open rank, disable these inputs.
bwsValues must provide a switch to toggle between using BWS or not. If BWS is used, provide inputs for the x, y and z values, if no BWS will be used, disable these inputs.
Users with host, debug or manage_tournament permissions can update the following:
rules will be updated in a separate page, but there must be a button somewhere linking the user to said page. The page will be at m/[tournament_slug]/rules.
links can be updated via a UI where users are able to create, modify and delete links.
refereeSettings can be updated via a UI where users are able to update this JSON fields' properties.
TournamentDates
The following conditions applies for every column in this table (except for other).
Only the host can update.
The user must be warned and asked if they're sure if they want to update one of these fields, but only ask if the date they inputted a date that is equal or less than 24 hours into the future.
The user is not able to update these fields if they input a date that is equal or less than 1 hour into the future.
The user can't update the respective column once the column's date is in the present or in the past.
The other column, similarly to the link column in Tournament can be updated at any date or time, as they're just for the sake of display, not being tied to important functionality. Can be updated via UI that allows the user to create, modify and delete dates. Users with host, debug or manage_tournament permissions can update this column.
"Danger Zone"
At the bottom of the page, there should be a "Danger Zone" section that only the host is able to see, in which the following functionality is present:
A button for deleting the tournament, asking the user if they're sure about the deletion, then, asking one last time while also asking the user to input the tournament's URL slug to confirm the delete on, after which, they'll be redirected to the dashboard after the tournament's deleted.
A button to grant another user the host role and remove it from themselves. There should be a UI where all the users with the manage_tournament permission are displayed, from which the user can select who to delegate host to, after which, asking for confirmation that they want to delegate host to that user and making them type the tournament's URL slug.
Absolutely none of these settings can be changed once the tournament is concluded, which includes the inability to delete the tournament and grant host to another staff member.
Why?
The tournament host (and anyone with the necessary permissions) must be able to update the tournament's settings.
How?
Using the tournament related procedures (
lib/server/procedures.ts
) the frontend has provide a UI to update different fields within theTournament
andTournamentDates
tables.Only users with
host
,debug
ormanage_tournament
permissions are able to view this page.The tournament related tRPC procedures must be carefully checked that all of the below conditions for each item is met and add any missing functionality.
Tournament
Only the host change the following:
name
andacronym
are fields that are able to be updated at any time without any major restrictions, just ask the user if they're sure about updating these settings once the tournament is public, notifying them that changing this will impact the tournament's discoverability.urlSlug
can be updated at any time, but the frontend must ask the user if they're sure if they want to update it, warning them about the fact that this will heavily affect how the tournament's URLs and URLs with the old slug won't work.Only the host change the following + Can only be updated while the tournament isn't public, after it's public, it shouldn't be possible to update these value. The UI must communicate this to the user:
type
.teamSettings
.rankRange
must provide a switch to toggle between open rank and rank restricted. If rank restricted, provide inputs for the user to type in the desired rank range, if open rank, disable these inputs.bwsValues
must provide a switch to toggle between using BWS or not. If BWS is used, provide inputs for thex
,y
andz
values, if no BWS will be used, disable these inputs.Users with
host
,debug
ormanage_tournament
permissions can update the following:rules
will be updated in a separate page, but there must be a button somewhere linking the user to said page. The page will be atm/[tournament_slug]/rules
.links
can be updated via a UI where users are able to create, modify and delete links.refereeSettings
can be updated via a UI where users are able to update this JSON fields' properties.TournamentDates
The following conditions applies for every column in this table (except for
other
).The
other
column, similarly to thelink
column inTournament
can be updated at any date or time, as they're just for the sake of display, not being tied to important functionality. Can be updated via UI that allows the user to create, modify and delete dates. Users withhost
,debug
ormanage_tournament
permissions can update this column."Danger Zone"
At the bottom of the page, there should be a "Danger Zone" section that only the host is able to see, in which the following functionality is present:
manage_tournament
permission are displayed, from which the user can select who to delegate host to, after which, asking for confirmation that they want to delegate host to that user and making them type the tournament's URL slug.Absolutely none of these settings can be changed once the tournament is concluded, which includes the inability to delete the tournament and grant host to another staff member.