From 6be6095a71c0197e15b2a5ca9521ce4e138c99ec Mon Sep 17 00:00:00 2001 From: Blackmorse Date: Fri, 17 May 2024 16:18:56 +0400 Subject: [PATCH] front: fix empty sorting columns --- front/src/common/tables/player/PlayerCardsTable.tsx | 2 +- .../src/common/tables/player/PlayerGoalsGamesTable.tsx | 10 +++++----- front/src/common/tables/team/TeamAgeInjuryTable.tsx | 2 +- front/src/common/tables/team/TeamFanclubFlagsTable.tsx | 8 ++++---- .../src/common/tables/team/TeamStreakTrophiesTable.tsx | 6 +++--- .../player/stats/PlayerGamesGoalsRequest.scala | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/front/src/common/tables/player/PlayerCardsTable.tsx b/front/src/common/tables/player/PlayerCardsTable.tsx index 1c238f06..2c70817f 100644 --- a/front/src/common/tables/player/PlayerCardsTable.tsx +++ b/front/src/common/tables/player/PlayerCardsTable.tsx @@ -29,7 +29,7 @@ return 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') ]} diff --git a/front/src/common/tables/player/PlayerGoalsGamesTable.tsx b/front/src/common/tables/player/PlayerGoalsGamesTable.tsx index 3024e71e..50e3484e 100644 --- a/front/src/common/tables/player/PlayerGoalsGamesTable.tsx +++ b/front/src/common/tables/player/PlayerGoalsGamesTable.tsx @@ -29,12 +29,12 @@ const PlayerGoalsGamesTable = (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 } } ]} diff --git a/front/src/common/tables/team/TeamAgeInjuryTable.tsx b/front/src/common/tables/team/TeamAgeInjuryTable.tsx index 1d250204..c95f83a2 100644 --- a/front/src/common/tables/team/TeamAgeInjuryTable.tsx +++ b/front/src/common/tables/team/TeamAgeInjuryTable.tsx @@ -31,7 +31,7 @@ const TeamAgeInjuryTable = (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') ]} /> } diff --git a/front/src/common/tables/team/TeamFanclubFlagsTable.tsx b/front/src/common/tables/team/TeamFanclubFlagsTable.tsx index 9d310e48..f1665fb3 100644 --- a/front/src/common/tables/team/TeamFanclubFlagsTable.tsx +++ b/front/src/common/tables/team/TeamFanclubFlagsTable.tsx @@ -25,10 +25,10 @@ const TeamFanclubFlagsTable = (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') ]} /> } diff --git a/front/src/common/tables/team/TeamStreakTrophiesTable.tsx b/front/src/common/tables/team/TeamStreakTrophiesTable.tsx index f8bd7e90..3b500876 100644 --- a/front/src/common/tables/team/TeamStreakTrophiesTable.tsx +++ b/front/src/common/tables/team/TeamStreakTrophiesTable.tsx @@ -25,9 +25,9 @@ const TeamStreakTrophiesTable = (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') ]} /> } diff --git a/web/app/databases/requests/playerstats/player/stats/PlayerGamesGoalsRequest.scala b/web/app/databases/requests/playerstats/player/stats/PlayerGamesGoalsRequest.scala index 38d1d8b0..3f0db9d3 100644 --- a/web/app/databases/requests/playerstats/player/stats/PlayerGamesGoalsRequest.scala +++ b/web/app/databases/requests/playerstats/player/stats/PlayerGamesGoalsRequest.scala @@ -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,