Adjust names of the used data to the (expected) backend names

This commit is contained in:
Jonny 2019-05-07 11:32:45 +02:00 committed by JP1998
parent a05cc768fd
commit abfded9e0f
3 changed files with 52 additions and 52 deletions

View File

@ -21,8 +21,8 @@ export class DominanceShower extends React.Component {
<th colSpan="2" className="h3 text-center">{findTeam(this.props.teams, this.props.stats.id).name}</th> <th colSpan="2" className="h3 text-center">{findTeam(this.props.teams, this.props.stats.id).name}</th>
</tr> </tr>
<tr> <tr>
<td className="h4 text-success pb-0">{this.props.stats.pointsMade}</td> <td className="h4 text-success pb-0">{this.props.stats.points_made}</td>
<td className="h4 text-danger text-right pb-0">{this.props.stats.pointsReceived}</td> <td className="h4 text-danger text-right pb-0">{this.props.stats.points_received}</td>
</tr> </tr>
<tr> <tr>
<td className="smaller pt-0">Punkte erzielt</td> <td className="smaller pt-0">Punkte erzielt</td>

View File

@ -23,7 +23,7 @@ export class StandingsTable extends React.Component {
} }
render() { render() {
let performances = this.props.data.groupPhasePerformances; let performances = this.props.data.group_phase_performances;
/** /**
* comparison(p1, p2) < 0 => p1 < p2 * comparison(p1, p2) < 0 => p1 < p2
@ -83,8 +83,8 @@ class TeamRow extends React.Component {
<tr className={this.props.className}> <tr className={this.props.className}>
<td>{ this.props.teamToShow.rank }</td> <td>{ this.props.teamToShow.rank }</td>
<td className="w-100">{findTeam(this.props.teams, this.props.teamToShow.team).name}</td> <td className="w-100">{findTeam(this.props.teams, this.props.teamToShow.team).name}</td>
<td className="text-center">{ this.props.teamToShow.winlossdifferential }</td> <td className="text-center">{ this.props.teamToShow.win_loss_differential }</td>
<td className="text-center">{ this.props.teamToShow.pointDifferential }</td> <td className="text-center">{ this.props.teamToShow.point_differential }</td>
</tr> </tr>
); );
} }

View File

@ -52,118 +52,118 @@ class StatisticsTournamentPage extends React.Component {
{ id: 0x1246, name: 'Washington Justice' }, { id: 0x1246, name: 'Washington Justice' },
{ id: 0x1247, name: 'Guangzhou Charge' } { id: 0x1247, name: 'Guangzhou Charge' }
], ],
groupPhasePerformances: [ group_phase_performances: [
{ {
winlossdifferential: 7, win_loss_differential: 7,
pointDifferential: 16, point_differential: 16,
rank: 2, rank: 2,
team: 0x1234 // New York Excelsior team: 0x1234 // New York Excelsior
}, },
{ {
winlossdifferential: -1, win_loss_differential: -1,
pointDifferential: 1, point_differential: 1,
rank: 10, rank: 10,
team: 0x1235 // Los Angeles Gladiators team: 0x1235 // Los Angeles Gladiators
}, },
{ {
winlossdifferential: 1, win_loss_differential: 1,
pointDifferential: 5, point_differential: 5,
rank: 6, rank: 6,
team: 0x1236 // San Francisco Shock team: 0x1236 // San Francisco Shock
}, },
{ {
winlossdifferential: 7, win_loss_differential: 7,
pointDifferential: 18, point_differential: 18,
rank: 1, rank: 1,
team: 0x1237 // Vancouver Titans team: 0x1237 // Vancouver Titans
}, },
{ {
winlossdifferential: -1, win_loss_differential: -1,
pointDifferential: -4, point_differential: -4,
rank: 13, rank: 13,
team: 0x1238 // London Spitfire team: 0x1238 // London Spitfire
}, },
{ {
winlossdifferential: 1, win_loss_differential: 1,
pointDifferential: 0, point_differential: 0,
rank: 9, rank: 9,
team: 0x1239 //Dallas Fuel team: 0x1239 //Dallas Fuel
}, },
{ {
winlossdifferential: -1, win_loss_differential: -1,
pointDifferential: -8, point_differential: -8,
rank: 16, rank: 16,
team: 0x123a // Chengdu Hunters team: 0x123a // Chengdu Hunters
}, },
{ {
winlossdifferential: 1, win_loss_differential: 1,
pointDifferential: 3, point_differential: 3,
rank: 8, rank: 8,
team: 0x123b // Boston Uprising team: 0x123b // Boston Uprising
}, },
{ {
winlossdifferential: -1, win_loss_differential: -1,
pointDifferential: -8, point_differential: -8,
rank: 17, rank: 17,
team: 0x123c // Paris Eternal team: 0x123c // Paris Eternal
}, },
{ {
winlossdifferential: 3, win_loss_differential: 3,
pointDifferential: 5, point_differential: 5,
rank: 3, rank: 3,
team: 0x123d // Philadelphia Fusion team: 0x123d // Philadelphia Fusion
}, },
{ {
winlossdifferential: -1, win_loss_differential: -1,
pointDifferential: -4, point_differential: -4,
rank: 14, rank: 14,
team: 0x123e // Hangzhou Spark team: 0x123e // Hangzhou Spark
}, },
{ {
winlossdifferential: -1, win_loss_differential: -1,
pointDifferential: -3, point_differential: -3,
rank: 12, rank: 12,
team: 0x123f // Houston Outlaws team: 0x123f // Houston Outlaws
}, },
{ {
winlossdifferential: -1, win_loss_differential: -1,
pointDifferential: -4, point_differential: -4,
rank: 15, rank: 15,
team: 0x1240 // Shanghai Dragons team: 0x1240 // Shanghai Dragons
}, },
{ {
winlossdifferential: -7, win_loss_differential: -7,
pointDifferential: -9, point_differential: -9,
rank: 20, rank: 20,
team: 0x1241 // Los Angeles Valiant team: 0x1241 // Los Angeles Valiant
}, },
{ {
winlossdifferential: 1, win_loss_differential: 1,
pointDifferential: 5, point_differential: 5,
rank: 7, rank: 7,
team: 0x1242 // Seoul Dynasty team: 0x1242 // Seoul Dynasty
}, },
{ {
winlossdifferential: 1, win_loss_differential: 1,
pointDifferential: 6, point_differential: 6,
rank: 5, rank: 5,
team: 0x1243 // Atlanta Reign team: 0x1243 // Atlanta Reign
}, },
{ {
winlossdifferential: 3, win_loss_differential: 3,
pointDifferential: 5, point_differential: 5,
rank: 4, rank: 4,
team: 0x1244 // Toronto Defiant team: 0x1244 // Toronto Defiant
}, },
{ {
winlossdifferential: -5, win_loss_differential: -5,
pointDifferential: -12, point_differential: -12,
rank: 19, rank: 19,
team: 0x1245 // Florida Mayhem team: 0x1245 // Florida Mayhem
}, },
{ {
winlossdifferential: -5, win_loss_differential: -5,
pointDifferential: -11, point_differential: -11,
rank: 18, rank: 18,
team: 0x1246 // Washington Justice team: 0x1246 // Washington Justice
}, },
@ -174,15 +174,15 @@ class StatisticsTournamentPage extends React.Component {
team: 0x1247 // Guangzhou Charge team: 0x1247 // Guangzhou Charge
} }
], ],
mostDominantTeam: { most_dominant_team: {
id: 0x1234, id: 0x1234,
pointsMade: 94, points_made: 94,
pointsReceived: 3 points_received: 3
}, },
leastDominantTeam: { least_dominant_team: {
id: 0x1240, id: 0x1240,
pointsMade: 2, points_made: 2,
pointsReceived: 103 points_received: 103
} }
}; };
@ -198,10 +198,10 @@ class StatisticsTournamentPage extends React.Component {
<Container className="py-5"> <Container className="py-5">
<Row> <Row>
<Col xs="6"> <Col xs="6">
<DominanceShower teams={tournamentStatistics.teams} stats={tournamentStatistics.mostDominantTeam} title="Stärkstes Team"/> <DominanceShower teams={tournamentStatistics.teams} stats={tournamentStatistics.most_dominant_team} title="Stärkstes Team"/>
</Col> </Col>
<Col xs="6"> <Col xs="6">
<DominanceShower teams={tournamentStatistics.teams} stats={tournamentStatistics.leastDominantTeam} title="Schwächstes Team"/> <DominanceShower teams={tournamentStatistics.teams} stats={tournamentStatistics.least_dominant_team} title="Schwächstes Team"/>
</Col> </Col>
</Row> </Row>
</Container> </Container>