@@ -59,6 +59,7 @@ function TournamentForm({
5959 const [ formData , setFormData ] = useState ( {
6060 name : initialValues . name || "" ,
6161 description : initialValues . description || "" ,
62+ moderator_ids : initialValues . moderator_ids || "" ,
6263 starts_at : initialValues . starts_at || "" ,
6364 access_type : initialValues . access_type || "public" ,
6465 task_provider : initialValues . task_provider || "level" ,
@@ -97,6 +98,10 @@ function TournamentForm({
9798 e . preventDefault ( ) ;
9899
99100 const payload = { ...formData } ;
101+ payload . moderator_ids = formData . moderator_ids
102+ . split ( / [ \s , ] + / )
103+ . map ( ( id ) => id . trim ( ) )
104+ . filter ( Boolean ) ;
100105 payload . round_timeout_seconds =
101106 formData . timeout_mode === "per_round" ? formData . round_timeout_seconds : null ;
102107
@@ -168,6 +173,28 @@ function TournamentForm({
168173 />
169174 { renderError ( "description" ) }
170175 </ div >
176+
177+ < div className = "form-group mb-0" >
178+ < label htmlFor = "moderator_ids" className = "form-label text-white" >
179+ Moderator IDs
180+ </ label >
181+ < textarea
182+ id = "moderator_ids"
183+ name = "moderator_ids"
184+ className = { cn ( "form-control cb-bg-panel cb-border-color text-white cb-rounded" , {
185+ "is-invalid" : errors . moderator_ids ,
186+ } ) }
187+ value = { formData . moderator_ids }
188+ onChange = { handleChange }
189+ rows = { 3 }
190+ placeholder = "42, 1337"
191+ />
192+ < div className = "form-text text-muted" >
193+ Enter user IDs separated by commas or spaces. The creator is always treated as a
194+ moderator and does not need to be listed here.
195+ </ div >
196+ { renderError ( "moderator_ids" ) }
197+ </ div >
171198 </ div >
172199 </ div >
173200
@@ -609,6 +636,7 @@ TournamentForm.propTypes = {
609636 initialValues : PropTypes . shape ( {
610637 name : PropTypes . string ,
611638 description : PropTypes . string ,
639+ moderator_ids : PropTypes . string ,
612640 starts_at : PropTypes . string ,
613641 access_type : PropTypes . string ,
614642 task_provider : PropTypes . string ,
@@ -633,6 +661,7 @@ TournamentForm.propTypes = {
633661 base : PropTypes . string ,
634662 name : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . arrayOf ( PropTypes . string ) ] ) ,
635663 description : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . arrayOf ( PropTypes . string ) ] ) ,
664+ moderator_ids : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . arrayOf ( PropTypes . string ) ] ) ,
636665 starts_at : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . arrayOf ( PropTypes . string ) ] ) ,
637666 access_type : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . arrayOf ( PropTypes . string ) ] ) ,
638667 task_provider : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . arrayOf ( PropTypes . string ) ] ) ,
0 commit comments