Add error message and prevent submit on tournament creation if not all groups are 100% full
This commit is contained in:
parent
0c1f896360
commit
d421cb2974
|
|
@ -120,6 +120,7 @@ class CreateTournamentForm extends React.Component {
|
|||
decrementText="-1" decrementCallback={this.decreaseGroupSize}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<WarningPopup text='Es gibt noch unvollständige Gruppen.' shown={this.areGroupsIncomplete()}/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Label for="teams-group-to-playoff">Wie viele Teams sollen nach der Gruppenphase
|
||||
|
|
@ -155,6 +156,10 @@ class CreateTournamentForm extends React.Component {
|
|||
</div>);
|
||||
}
|
||||
|
||||
areGroupsIncomplete() {
|
||||
return this.state.groups.filter(group => group.length !== this.state.groupSize).length !== 0;
|
||||
}
|
||||
|
||||
teamListUpdate(list) {
|
||||
this.setState({teams: list});
|
||||
}
|
||||
|
|
@ -222,7 +227,7 @@ class CreateTournamentForm extends React.Component {
|
|||
}
|
||||
|
||||
valuesAreCredible() {
|
||||
return this.state.teams.length >= this.state.groupAdvance;
|
||||
return this.state.teams.length >= this.state.groupAdvance && !this.areGroupsIncomplete();
|
||||
}
|
||||
|
||||
generateTournamentCreationObject() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue