Skip to content

Commit

Permalink
front: fix empty sorting columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackmorse committed May 17, 2024
1 parent 06ea905 commit 6be6095
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion front/src/common/tables/player/PlayerCardsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ return <TableSection<LevelProps, PlayerCards>
TableColumns.leagueUnitTableColumn(pc => pc.playerSortingKey),
TableColumns.role(pc => pc.role),
TableColumns.ageTableColumn(pc => pc.age, 'age'),
TableColumns.simpleNumber(pc => pc.games, t('table.games')),
TableColumns.simpleNumber(pc => pc.games, { title: t('table.games_abbr'), poppedHint: t('table.games') }, "games"),
TableColumns.yellowCards(pc => pc.yellowCards, 'yellow_cards'),
TableColumns.redCards(pc => pc.redCards, 'red_cards')
]}
Expand Down
10 changes: 5 additions & 5 deletions front/src/common/tables/player/PlayerGoalsGamesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ const PlayerGoalsGamesTable = <LevelProps extends LevelDataProps>(props: LevelDa
TableColumns.teamTableColumn(pgg => pgg.playerSortingKey, props.showCountryFlags),
TableColumns.leagueUnitTableColumn(pgg => pgg.playerSortingKey),
TableColumns.role(pgg => pgg.role),
TableColumns.ageTableColumn(pgg => pgg.age),
TableColumns.simpleNumber(pgg => pgg.games, t('table.games'), 'games'),
TableColumns.simpleNumber(pgg => pgg.playedMinutes, t('table.minutes'), 'played'),
TableColumns.simpleNumber(pgg => pgg.scored, t('table.scored'), 'scored'),
TableColumns.ageTableColumn(pgg => pgg.age, 'age'),
TableColumns.simpleNumber(pgg => pgg.games, { title: t('table.games_abbr'), poppedHint: t('table.games') }, 'games'),
TableColumns.simpleNumber(pgg => pgg.playedMinutes, { title: t('table.minutes_abbr'), poppedHint: t('table.minutes') }, 'played'),
TableColumns.simpleNumber(pgg => pgg.scored, { title: t('table.scored') }, 'scored'),
{
columnHeader: { title: t('table.minutes_per_goal_abbr'), sortingField: 'goal_rate', poppedHint: t('table.minutes_per_goal_abbr'), center: true },
columnHeader: { title: t('table.minutes_per_goal_abbr'), sortingField: 'goal_rate', poppedHint: t('table.minutes_per_goal'), center: true },
columnValue: { provider: (pgg) => Math.floor(pgg.goalRate).toString(), center: true }
}
]}
Expand Down
2 changes: 1 addition & 1 deletion front/src/common/tables/team/TeamAgeInjuryTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const TeamAgeInjuryTable = <LevelProps extends LevelDataProps>(props: LevelDataP
columnHeader: { title: t('table.total_injury_weeks'), sortingField: 'injury', center: true },
columnValue: { provider: tai => injuryFormatter(tai.injury), center: true }
},
TableColumns.simpleNumber(tai => tai.injuryCount, t('table.total_injury_number'), 'injury_count')
TableColumns.simpleNumber(tai => tai.injuryCount, { title: t('table.total_injury_number_abbr'), poppedHint: t('table.total_injury_number') }, 'injury_count')
]}
/>
}
Expand Down
8 changes: 4 additions & 4 deletions front/src/common/tables/team/TeamFanclubFlagsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const TeamFanclubFlagsTable = <LevelProps extends LevelDataProps>(props: LevelDa
TableColumns.postitionsTableColumn(),
TableColumns.teamTableColumn(tff => tff.teamSortingKey, props.showCountryFlags),
TableColumns.leagueUnitTableColumn(tff => tff.teamSortingKey),
TableColumns.simpleNumber(tff => tff.fanclubSize, t('table.fanclub_size'), 'fanclub_size'),
TableColumns.simpleNumber(tff => tff.homeFlags, t('table.home_flags'), 'home_flags'),
TableColumns.simpleNumber(tff => tff.awayFlags, t('table.away_flags'), 'away_flags'),
TableColumns.simpleNumber(tff => tff.allFlags, t('table.all_flags'), 'all_flags')
TableColumns.simpleNumber(tff => tff.fanclubSize, { title: t('table.fanclub_size') }, 'fanclub_size'),
TableColumns.simpleNumber(tff => tff.homeFlags, { title: t('table.home_flags') }, 'home_flags'),
TableColumns.simpleNumber(tff => tff.awayFlags, { title: t('table.away_flags') }, 'away_flags'),
TableColumns.simpleNumber(tff => tff.allFlags, { title: t('table.all_flags') }, 'all_flags')
]}
/>
}
Expand Down
6 changes: 3 additions & 3 deletions front/src/common/tables/team/TeamStreakTrophiesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const TeamStreakTrophiesTable = <LevelProps extends LevelDataProps>(props: Level
TableColumns.postitionsTableColumn(),
TableColumns.teamTableColumn(tst => tst.teamSortingKey, props.showCountryFlags),
TableColumns.leagueUnitTableColumn(tst => tst.teamSortingKey),
TableColumns.simpleNumber(tst => tst.trophiesNumber, t('table.trophies'), 'trophies_number'),
TableColumns.simpleNumber(tst => tst.numberOfVictories, t('table.victories'), 'number_of_victories'),
TableColumns.simpleNumber(tst => tst.numberOfUndefeated, t('table.undefeated'), 'number_of_undefeated')
TableColumns.simpleNumber(tst => tst.trophiesNumber, { title: t('table.trophies') }, 'trophies_number'),
TableColumns.simpleNumber(tst => tst.numberOfVictories, { title: t('table.victories') }, 'number_of_victories'),
TableColumns.simpleNumber(tst => tst.numberOfUndefeated, { title: t('table.undefeated') }, 'number_of_undefeated')
]}
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import models.web.{PlayersParameters, RestStatisticsParameters}
import sqlbuilder.{Select, SqlBuilder}

object PlayerGamesGoalsRequest extends ClickhousePlayerStatsRequest[PlayerGamesGoals] {
override val sortingColumns: Seq[String] = Seq("games", "played", "scored", "goal_rate")
override val sortingColumns: Seq[String] = Seq("games", "played", "scored", "goal_rate", "age")
override val rowParser: RowParser[PlayerGamesGoals] = PlayerGamesGoals.mapper

override def buildSql(orderingKeyPath: OrderingKeyPath,
Expand Down

0 comments on commit 6be6095

Please sign in to comment.