From f44ebde3a4c6959ecbd6c4bbda247bfa35db4a20 Mon Sep 17 00:00:00 2001 From: Malaber Date: Fri, 15 Sep 2023 15:15:42 +0200 Subject: [PATCH 1/4] Reorganize convertMatch --- js/redux/tournamentApi.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/redux/tournamentApi.js b/js/redux/tournamentApi.js index 2a35483..50bb15c 100644 --- a/js/redux/tournamentApi.js +++ b/js/redux/tournamentApi.js @@ -106,7 +106,9 @@ function convertGroup(apiGroup) { function convertMatch(apiMatch, allowUndecided) { 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, position: apiMatch.position + 1 }; From 584e4d1c816a3792f6a0e69dc91599646c8b38d4 Mon Sep 17 00:00:00 2001 From: Malaber Date: Fri, 15 Sep 2023 15:23:51 +0200 Subject: [PATCH 2/4] Sort matches on fullscreen page by position as well --- pages/tournament-fullscreen.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/tournament-fullscreen.js b/pages/tournament-fullscreen.js index b5dd732..5819389 100644 --- a/pages/tournament-fullscreen.js +++ b/pages/tournament-fullscreen.js @@ -7,6 +7,7 @@ import { Spinner } from 'reactstrap'; import {Match} from '../js/components/Match'; +import {sortMatchesByPositionAscending} from '../js/utils/sorting'; function FullscreenPage(props) { @@ -27,7 +28,9 @@ function Matches(props) { matches = (
keine Matches
); } else { matches = ( - {props.matches.map(match => )} + {props.matches.sort(sortMatchesByPositionAscending()).map( + match => + )} ); } return (
From 7de56ea1954b913154f1899699b14271e45567d4 Mon Sep 17 00:00:00 2001 From: Malaber Date: Fri, 15 Sep 2023 15:25:24 +0200 Subject: [PATCH 3/4] Render group information per match --- js/components/Match.js | 10 +++++++++- js/redux/tournamentApi.js | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/js/components/Match.js b/js/components/Match.js index d9f3211..7396122 100644 --- a/js/components/Match.js +++ b/js/components/Match.js @@ -118,13 +118,21 @@ export class Match extends React.Component { smallMessage = 'Spiel kann gestartet werden'; break; } + + const groupInformation = this.state.match.group ? +
Gr. {this.state.match.group.number}
: + ''; + return (
- {this.state.match.position} + + {groupInformation} +
Sp. {this.state.match.position}
+
{smallMessage} diff --git a/js/redux/tournamentApi.js b/js/redux/tournamentApi.js index 50bb15c..a216d1d 100644 --- a/js/redux/tournamentApi.js +++ b/js/redux/tournamentApi.js @@ -110,7 +110,8 @@ function convertMatch(apiMatch, allowUndecided) { state: apiMatch.state, allowUndecided: allowUndecided, winnerTeamId: apiMatch.winner === null ? null : apiMatch.winner.id, - position: apiMatch.position + 1 + position: apiMatch.position + 1, + group: apiMatch.group ? {id: apiMatch.group.id, number: apiMatch.group.number} : null }; if (apiMatch.match_scores.length === 2) { From 9966bb0d18b17e9f0929960b3e224bdf351eec84 Mon Sep 17 00:00:00 2001 From: Malaber Date: Fri, 15 Sep 2023 15:31:01 +0200 Subject: [PATCH 4/4] Add tooltips to group table heading --- js/components/GroupStage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/components/GroupStage.js b/js/components/GroupStage.js index 7b0ac40..ae2d73c 100644 --- a/js/components/GroupStage.js +++ b/js/components/GroupStage.js @@ -80,9 +80,9 @@ function GroupScoresTable(props) { Team - Pkt. - Gew. - Kas. + Pkt. + Gew. + Kas.