Merge branch 'match_position' into 'master'

Add match position to matches

See merge request turniere/turniere-frontend!32
This commit is contained in:
Daniel Schädler 2022-07-01 23:09:02 +00:00
commit c032228519
2 changed files with 8 additions and 4 deletions

View File

@ -119,9 +119,12 @@ export class Match extends React.Component {
} }
return (<div className='mb-3'> return (<div className='mb-3'>
<Card className={'shadow-sm match '} onClick={this.toggleModal}> <Card className={'shadow-sm match '} onClick={this.toggleModal}>
<CardBody className={borderClass + ' border py-2 ' + cardClass + ' ' + styles.match_bg}> <div className="d-flex flex-row">
<MatchTable match={this.state.match} borderColor={borderClass}/> <CardBody className={borderClass + ' border py-2 ' + cardClass + ' ' + styles.match_bg}>
</CardBody> <MatchTable match={this.state.match} borderColor={borderClass}/>
</CardBody>
<span className="badge bg-secondary align-items-center">{this.state.match.position}</span>
</div>
</Card> </Card>
<small className='text-muted'>{smallMessage}</small> <small className='text-muted'>{smallMessage}</small>
<MatchModal title='Match' isOpen={this.state.modal} toggle={this.toggleModal} match={this.state.match} <MatchModal title='Match' isOpen={this.state.modal} toggle={this.toggleModal} match={this.state.match}

View File

@ -88,7 +88,8 @@ function convertGroup(apiGroup) {
function convertMatch(apiMatch, allowUndecided) { function convertMatch(apiMatch, allowUndecided) {
const result = { const result = {
id: apiMatch.id, state: apiMatch.state, allowUndecided: allowUndecided, id: apiMatch.id, state: apiMatch.state, allowUndecided: allowUndecided,
winnerTeamId: apiMatch.winner === null ? null : apiMatch.winner.id winnerTeamId: apiMatch.winner === null ? null : apiMatch.winner.id,
position: apiMatch.position + 1
}; };
if (apiMatch.match_scores.length === 2) { if (apiMatch.match_scores.length === 2) {