Fix some code issues from eslint
This commit is contained in:
parent
7f28252ae8
commit
38e24a2ec1
|
|
@ -300,10 +300,10 @@ const reducerTournamentStatistics = (state = defaultStateTournamentStatistics, a
|
|||
return Object.assign({}, state, action.parameters.tournamentInfo);
|
||||
case actionTypesTournamentStatistics.REQUEST_TOURNAMENT_STATISTICS_SUCCESS:
|
||||
action.parameters.successCallback();
|
||||
return Object.assign({}, state, tournamentStatistics);
|
||||
return Object.assign({}, state, action.parameters.tournamentStatistics);
|
||||
default: return state;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const reducerTournamentlist = (state = defaultStateTournamentlist, action) => {
|
||||
switch (action.type) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import {
|
|||
} from 'reactstrap';
|
||||
|
||||
export class DominanceShower extends React.Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Card className="shadow-sm">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import {
|
|||
import {rangedmap} from '../utils/rangedmap';
|
||||
|
||||
export class StandingsTable extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
|
|
@ -21,7 +20,7 @@ export class StandingsTable extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
let performances = this.props.data.group_phase_performances;
|
||||
const performances = this.props.data.group_phase_performances;
|
||||
|
||||
return (
|
||||
<Card className="shadow-sm">
|
||||
|
|
@ -38,18 +37,21 @@ export class StandingsTable extends React.Component {
|
|||
</thead>
|
||||
<tbody>
|
||||
{ rangedmap(performances, (team, index) => (
|
||||
<TeamRow className={(index % 2 === 0)? 'bg-light' : 'bg-white'} key={index} teamToShow={team}/>
|
||||
<TeamRow className={(index % 2 === 0)? 'bg-light' : 'bg-white'}
|
||||
key={index} teamToShow={team}/>
|
||||
), 0, 3) }
|
||||
</tbody>
|
||||
<Collapse isOpen={ this.state.showFullTable } tag="tbody">
|
||||
{ rangedmap(performances, (team, index) => (
|
||||
<TeamRow className={(index % 2 === 0)? 'bg-light' : 'bg-white'} key={index} teamToShow={team}/>
|
||||
<TeamRow className={(index % 2 === 0)? 'bg-light' : 'bg-white'}
|
||||
key={index} teamToShow={team}/>
|
||||
), 3) }
|
||||
</Collapse>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colSpan='4'>
|
||||
<TableButton isFullTableShown={this.state.showFullTable} onToggle={this.toggleShowFullTable}/>
|
||||
<TableButton isFullTableShown={this.state.showFullTable}
|
||||
onToggle={this.toggleShowFullTable}/>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
|
@ -82,7 +84,6 @@ class TeamRow extends React.Component {
|
|||
}
|
||||
|
||||
class TableButton extends React.Component {
|
||||
|
||||
render() {
|
||||
const {isFullTableShown} = this.props;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import {
|
|||
|
||||
|
||||
class PrivateTournamentInformationView extends React.Component {
|
||||
|
||||
render() {
|
||||
const {tournament, isSignedIn, username, currentpage} = this.props;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,14 +61,14 @@ export function transformTournamentStatsToStatistics(data) {
|
|||
};
|
||||
|
||||
for (let i = 0; i < data.group_scores.length; i++) {
|
||||
let score = data.group_scores[i];
|
||||
const score = data.group_scores[i];
|
||||
|
||||
statistics.group_phase_performances[i] = {
|
||||
win_loss_differential: score.group_points,
|
||||
point_differential: score.scored_points - score.received_points,
|
||||
rank: i + 1,
|
||||
team_name: score.team.name
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return statistics;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import { Footer } from '../js/components/Footer';
|
|||
import {requestTournamentStatistics} from '../js/api';
|
||||
|
||||
class StatisticsTournamentPage extends React.Component {
|
||||
|
||||
static async getInitialProps({query}) {
|
||||
return {query};
|
||||
}
|
||||
|
|
@ -51,10 +50,12 @@ function StatisticsView(props) {
|
|||
<Container className="py-5">
|
||||
<Row>
|
||||
<Col xs="6">
|
||||
<DominanceShower stats={props.tournamentStatistics.most_dominant_team} title="Stärkstes Team"/>
|
||||
<DominanceShower stats={props.tournamentStatistics.most_dominant_team}
|
||||
title="Stärkstes Team"/>
|
||||
</Col>
|
||||
<Col xs="6">
|
||||
<DominanceShower stats={props.tournamentStatistics.least_dominant_team} title="Schwächstes Team"/>
|
||||
<DominanceShower stats={props.tournamentStatistics.least_dominant_team}
|
||||
title="Schwächstes Team"/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Container>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import Head from 'next/head';
|
||||
import React from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {Col, Container, ListGroup, ListGroupItem, Row} from 'reactstrap';
|
||||
import {Col, Container, Row} from 'reactstrap';
|
||||
|
||||
import {ErrorPageComponent} from '../js/components/ErrorComponents';
|
||||
import {Footer} from '../js/components/Footer';
|
||||
|
|
@ -19,14 +19,14 @@ import {Match} from '../js/components/Match';
|
|||
|
||||
class PrivateTournamentPage extends React.Component {
|
||||
render() {
|
||||
const {owner_username, playoffStages} = this.props.tournament;
|
||||
const {ownerUsername, playoffStages} = this.props.tournament;
|
||||
const {isSignedIn, username} = this.props;
|
||||
|
||||
// TODO: Change href-prop of the anchor tag to contain the tournament code
|
||||
return (<div className='pb-5'>
|
||||
<TournamentInformationView tournament={this.props.tournament} currentpage='tournament'/>
|
||||
<div className='stages pt-5'>
|
||||
{playoffStages.map(stage => <Stage isSignedIn={isSignedIn} isOwner={username === owner_username}
|
||||
{playoffStages.map(stage => <Stage isSignedIn={isSignedIn} isOwner={username === ownerUsername}
|
||||
level={getLevelName(stage.level)} matches={stage.matches}
|
||||
key={stage.level}/>)}
|
||||
</div>
|
||||
|
|
@ -85,7 +85,7 @@ function convertTournament(apiTournament) {
|
|||
description: apiTournament.description,
|
||||
name: apiTournament.name,
|
||||
isPublic: apiTournament.public,
|
||||
owner_username: apiTournament.owner_username,
|
||||
ownerUsername: apiTournament.owner_username,
|
||||
groupStage: groupStage,
|
||||
playoffStages: playoffStages
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3291,7 +3291,7 @@ eslint-visitor-keys@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
|
||||
integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==
|
||||
|
||||
eslint@^5.9.0:
|
||||
eslint@^5.16.0:
|
||||
version "5.16.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea"
|
||||
integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==
|
||||
|
|
|
|||
Loading…
Reference in New Issue