From 53b23d25901eb6a0ad4603e8a23b504763fd7097 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 2 Apr 2024 07:15:20 -0400 Subject: [PATCH] Add extended standings table, add table to standings view, add additional records to standings object --- components.d.ts | 1 + src/components/ExtendedStandingsTable.vue | 98 +++++++++++++++++++++++ src/services/standingsService.ts | 16 ++++ src/views/StandingsView.vue | 12 ++- 4 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 src/components/ExtendedStandingsTable.vue diff --git a/components.d.ts b/components.d.ts index 12df73b..09af641 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,6 +10,7 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { CardImagesDisplay: typeof import('./src/components/CardImagesDisplay.vue')['default'] + ExtendedStandingsTable: typeof import('./src/components/ExtendedStandingsTable.vue')['default'] IconCommunity: typeof import('./src/components/icons/IconCommunity.vue')['default'] IconDocumentation: typeof import('./src/components/icons/IconDocumentation.vue')['default'] IconEcosystem: typeof import('./src/components/icons/IconEcosystem.vue')['default'] diff --git a/src/components/ExtendedStandingsTable.vue b/src/components/ExtendedStandingsTable.vue new file mode 100644 index 0000000..cb75ba5 --- /dev/null +++ b/src/components/ExtendedStandingsTable.vue @@ -0,0 +1,98 @@ + + + diff --git a/src/services/standingsService.ts b/src/services/standingsService.ts index a0b6335..c5ac8ec 100644 --- a/src/services/standingsService.ts +++ b/src/services/standingsService.ts @@ -44,6 +44,14 @@ export interface TeamStanding { losses: number winPercentage: string, last8Record: string, + pythagRecord: string, + oneRunRecord: string, + homeRecord: string, + awayRecord: string, + division1Record: string, + division2Record: string, + division3Record: string, + division4Record: string, streak: string divisionGamesBack: string divisionEliminationNumber: string @@ -104,6 +112,14 @@ function normalizeStanding(standing: TeamStandingRaw): TeamStanding { losses: standing.losses, winPercentage, last8Record: `${standing.last8_wins}-${standing.last8_losses}`, + pythagRecord: `${standing.pythag_wins}-${standing.pythag_losses}`, + oneRunRecord: `${standing.one_run_wins}-${standing.one_run_losses}`, + homeRecord: `${standing.home_wins}-${standing.home_losses}`, + awayRecord: `${standing.away_wins}-${standing.away_losses}`, + division1Record: `${standing.div1_wins}-${standing.div1_losses}`, + division2Record: `${standing.div2_wins}-${standing.div2_losses}`, + division3Record: `${standing.div3_wins}-${standing.div3_losses}`, + division4Record: `${standing.div4_wins}-${standing.div4_losses}`, streak: `${standing.streak_wl.toUpperCase()}${standing.streak_num}`, divisionGamesBack: parseGamesBack(standing.div_gb), divisionEliminationNumber: parseEliminationNumber(standing.div_e_num), diff --git a/src/views/StandingsView.vue b/src/views/StandingsView.vue index 1f25ade..ff71ffe 100644 --- a/src/views/StandingsView.vue +++ b/src/views/StandingsView.vue @@ -28,10 +28,14 @@
- Extended Standings +
+

Extended Standings

+
- 🚧 Coming soon 🚧 +
+ +
@@ -39,6 +43,7 @@