From 1bb191668d42f747d7b5c5f128d9170d975d6ded Mon Sep 17 00:00:00 2001 From: Jordan Medrano Date: Wed, 12 Jan 2022 22:32:47 -0600 Subject: [PATCH 01/16] added toggleable team name to PlayerTeamDisplay.vue --- .../src/components/broadcast/auction/PlayerTeamDisplay.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/src/components/broadcast/auction/PlayerTeamDisplay.vue b/website/src/components/broadcast/auction/PlayerTeamDisplay.vue index 3964d7f6..7a87f194 100644 --- a/website/src/components/broadcast/auction/PlayerTeamDisplay.vue +++ b/website/src/components/broadcast/auction/PlayerTeamDisplay.vue @@ -1,5 +1,7 @@ + + diff --git a/website/src/router/broadcast.js b/website/src/router/broadcast.js index c1256dda..11827682 100644 --- a/website/src/router/broadcast.js +++ b/website/src/router/broadcast.js @@ -29,6 +29,7 @@ import SeasonHistoryOverlay from "@/components/broadcast/roots/SeasonHistoryOver import IframeOverlay from "@/components/broadcast/roots/IframeOverlay"; import TallyTransmitter from "@/components/broadcast/roots/TallyTransmitter"; import TallyViewer from "@/components/broadcast/roots/TallyViewer"; +import PlayerHistory from "@/components/broadcast/PlayerHistory"; export default [ { path: "ingame", component: IngameOverlay, props: route => ({ codes: route.query.codes }) }, @@ -86,5 +87,6 @@ export default [ { path: "auction", component: AuctionOverlay, props: route => ({ category: route.query.category }) }, { path: "ad-read", component: AdReadOverlay, props: route => ({ extraDelay: route.query.delay }) }, { path: "logos", component: LogoAdOverlay }, - { path: "staff", component: StaffOverlay } + { path: "staff", component: StaffOverlay }, + { path: "player-history", component: PlayerHistory, props: route => ({ showMinor: route.query.minor }) } ]; From 20fe6478749e3f5acb019cb41169576acb11a739 Mon Sep 17 00:00:00 2001 From: Jordan Medrano Date: Thu, 13 Jan 2022 03:24:02 -0600 Subject: [PATCH 03/16] add a fallback if a team's ranking is empty (return N/A) --- .../src/components/broadcast/auction/PlayerTeamDisplay.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/src/components/broadcast/auction/PlayerTeamDisplay.vue b/website/src/components/broadcast/auction/PlayerTeamDisplay.vue index 7a87f194..08758654 100644 --- a/website/src/components/broadcast/auction/PlayerTeamDisplay.vue +++ b/website/src/components/broadcast/auction/PlayerTeamDisplay.vue @@ -7,7 +7,7 @@
-
{{ team.ranking_text }}
+
{{ rankingText }}
@@ -29,6 +29,10 @@ export default { }, eventLogo() { return cssImage("backgroundImage", this.team?.event?.theme, ["small_logo", "default_logo"], 100); + }, + rankingText() { + if (!this.team?.ranking_text) return "N/A"; + return this.team?.ranking_text; } } }; From 64c1a896870bcc49f5a2d6f9abcd6d6c9d536990 Mon Sep 17 00:00:00 2001 From: Jordan Medrano Date: Thu, 13 Jan 2022 03:54:33 -0600 Subject: [PATCH 04/16] create a generic component that displays a hero's name, role, and portrait --- .../src/components/broadcast/PlayerHero.vue | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 website/src/components/broadcast/PlayerHero.vue diff --git a/website/src/components/broadcast/PlayerHero.vue b/website/src/components/broadcast/PlayerHero.vue new file mode 100644 index 00000000..489aa9dd --- /dev/null +++ b/website/src/components/broadcast/PlayerHero.vue @@ -0,0 +1,62 @@ + + + + + From 12899a8eadaec2de30f50922fcf3d38a922fa56c Mon Sep 17 00:00:00 2001 From: Jordan Medrano Date: Thu, 13 Jan 2022 04:01:44 -0600 Subject: [PATCH 05/16] remove british (was intended to swap spelling) --- website/src/components/broadcast/PlayerHero.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/components/broadcast/PlayerHero.vue b/website/src/components/broadcast/PlayerHero.vue index 489aa9dd..228fba44 100644 --- a/website/src/components/broadcast/PlayerHero.vue +++ b/website/src/components/broadcast/PlayerHero.vue @@ -10,7 +10,7 @@ export default { name: "PlayerHero", - props: ["hero", "british"], + props: ["hero"], computed: { heroName() { if (!this.hero?.name) return null; From ca0a517ab14ac076d9db3504cb48126326e92661 Mon Sep 17 00:00:00 2001 From: Jordan Medrano Date: Thu, 13 Jan 2022 20:14:20 -0600 Subject: [PATCH 06/16] update PlayerHistory.vue to display a player's favorite hero if one is present --- .../components/broadcast/PlayerHistory.vue | 53 +++++++++++++++++-- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/website/src/components/broadcast/PlayerHistory.vue b/website/src/components/broadcast/PlayerHistory.vue index 62f63b6e..f2f4ccab 100644 --- a/website/src/components/broadcast/PlayerHistory.vue +++ b/website/src/components/broadcast/PlayerHistory.vue @@ -1,8 +1,21 @@ @@ -12,10 +25,11 @@ import GenericOverlay from "@/components/broadcast/roots/GenericOverlay"; import { sortEvents } from "@/utils/sorts"; import { ReactiveArray, ReactiveRoot, ReactiveThing } from "@/utils/reactive"; import PlayerTeamDisplay from "@/components/broadcast/auction/PlayerTeamDisplay"; +import PlayerHero from "@/components/broadcast/PlayerHero"; export default { name: "PlayerHistory", - components: { PlayerTeamDisplay, GenericOverlay }, - props: ["title", "broadcast", "showMinor"], + components: { PlayerTeamDisplay, GenericOverlay, PlayerHero }, + props: ["title", "broadcast", "showMinor", "britishSpelling"], computed: { customTitle() { if (this.player?.name) return (this.player.name + "'s Career"); @@ -32,10 +46,13 @@ export default { event: ReactiveThing("event", { theme: ReactiveThing("theme") }) - }) }); }, + hero() { + if (!this.player?.favourite_hero) return null; + return ReactiveRoot(this.player?.favourite_hero[0]); // british spelling MyEyes + }, playerTeams() { if (!this.player?.member_of) return []; return this.player.member_of.filter(t => { @@ -46,10 +63,36 @@ export default { return true; }).sort((a, b) => sortEvents(a.event, b.event)); } + // TODO: Get a list of all events a player has participated in, sort by date, and display the start date of the earliest event as "Player Since" } }; From af0f00dccca6a4444240a5ba20a0a9a0f3468ea6 Mon Sep 17 00:00:00 2001 From: Jordan Medrano Date: Mon, 17 Jan 2022 17:15:09 -0600 Subject: [PATCH 07/16] don't display a broken image icon if there is no hero portrait available --- website/src/components/broadcast/PlayerHero.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/components/broadcast/PlayerHero.vue b/website/src/components/broadcast/PlayerHero.vue index 228fba44..0461cc57 100644 --- a/website/src/components/broadcast/PlayerHero.vue +++ b/website/src/components/broadcast/PlayerHero.vue @@ -2,7 +2,7 @@
{{heroName}}
{{heroRole}}
-
+
From 0138d637ed2a075a6673fdc17e0333da890b8878 Mon Sep 17 00:00:00 2001 From: Jordan Medrano Date: Mon, 17 Jan 2022 17:16:12 -0600 Subject: [PATCH 08/16] implement change suggestion from https://github.com/slmnio/slmngg-sfc/pull/92#discussion_r784521631 --- website/src/components/broadcast/PlayerHero.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/website/src/components/broadcast/PlayerHero.vue b/website/src/components/broadcast/PlayerHero.vue index 0461cc57..64bc9567 100644 --- a/website/src/components/broadcast/PlayerHero.vue +++ b/website/src/components/broadcast/PlayerHero.vue @@ -13,8 +13,7 @@ export default { props: ["hero"], computed: { heroName() { - if (!this.hero?.name) return null; - return this.hero.name; + return this.hero?.name || null; }, heroRole() { if (!this.hero?.name) return null; From 8a1a2023816d3e9c70cfc34a2663fa7a4d68db50 Mon Sep 17 00:00:00 2001 From: Jordan Medrano Date: Mon, 17 Jan 2022 17:18:02 -0600 Subject: [PATCH 09/16] use optional chaining to simplify logic --- website/src/components/broadcast/PlayerHero.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/website/src/components/broadcast/PlayerHero.vue b/website/src/components/broadcast/PlayerHero.vue index 64bc9567..000d25d4 100644 --- a/website/src/components/broadcast/PlayerHero.vue +++ b/website/src/components/broadcast/PlayerHero.vue @@ -31,8 +31,7 @@ export default { return null; }, heroPortraitURL() { - if (!this.hero?.main_image) return null; - return this.hero?.main_image[0].url; + return this.hero?.main_image?.[0]?.url; } } From 373a8fbac5c338683f9759c36be4204277e30b8c Mon Sep 17 00:00:00 2001 From: Jordan Medrano Date: Mon, 17 Jan 2022 17:18:40 -0600 Subject: [PATCH 10/16] import and use getRoleSVG method for role icons instead of FontAwesome --- website/src/components/broadcast/PlayerHero.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/src/components/broadcast/PlayerHero.vue b/website/src/components/broadcast/PlayerHero.vue index 000d25d4..3de58a6b 100644 --- a/website/src/components/broadcast/PlayerHero.vue +++ b/website/src/components/broadcast/PlayerHero.vue @@ -8,6 +8,8 @@ diff --git a/website/src/components/broadcast/PlayerHistory.vue b/website/src/components/broadcast/PlayerHistory.vue index dba7ae80..4ddb0f64 100644 --- a/website/src/components/broadcast/PlayerHistory.vue +++ b/website/src/components/broadcast/PlayerHistory.vue @@ -2,14 +2,12 @@
-
Favorite Hero -
-
+
+
-
Team History -
+
Team History
@@ -69,43 +67,36 @@ export default { From 00d114d5240794df062b947eb84da34d77038acf Mon Sep 17 00:00:00 2001 From: Solomon Cammack Date: Tue, 18 Jan 2022 20:05:23 +0000 Subject: [PATCH 15/16] Replace some hardcoded sizes with dynamic styling --- .../components/broadcast/PlayerHistory.vue | 39 ++++++++----------- .../broadcast/auction/PlayerTeamDisplay.vue | 24 +++++++----- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/website/src/components/broadcast/PlayerHistory.vue b/website/src/components/broadcast/PlayerHistory.vue index 4ddb0f64..a641327f 100644 --- a/website/src/components/broadcast/PlayerHistory.vue +++ b/website/src/components/broadcast/PlayerHistory.vue @@ -1,21 +1,19 @@ diff --git a/website/src/views/lists/NewEventDisplay.vue b/website/src/views/lists/NewEventDisplay.vue index 7019872b..743cf3be 100644 --- a/website/src/views/lists/NewEventDisplay.vue +++ b/website/src/views/lists/NewEventDisplay.vue @@ -46,7 +46,7 @@ export default {