From 7b7afd27ea0bc9b220bb069d9e12ba04406a251c Mon Sep 17 00:00:00 2001 From: Zemill <33404722+Zemill@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:16:44 -0400 Subject: [PATCH 1/3] Adds game map filter --- .../Player/PlayerHeroesMapsRolesController.php | 3 ++- .../Player/Heroes/PlayerHeroSingleStats.vue | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php b/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php index de754a5e..9ce3d984 100644 --- a/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php +++ b/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php @@ -75,6 +75,7 @@ public function getData(Request $request) $page = $request['page']; $role = $request['role']; $game_map = $request['game_map'] ? Map::where('name', $request['game_map'])->pluck('map_id')->first() : null; + $season = $request['season']; $result = Replay::join('player', 'player.replayID', '=', 'replay.replayID') @@ -106,7 +107,7 @@ public function getData(Request $request) ->when($type == 'single' && $page == 'role', function ($query) use ($role) { return $query->where('new_role', $role); }) - ->when($type == 'single' && $page == 'map', function ($query) use ($game_map) { + ->when($type == 'single' && ($page == 'map' || $page == 'hero'), function ($query) use ($game_map) { return $query->where('game_map', $game_map); }) ->when(! is_null($season), function ($query) use ($season) { diff --git a/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue b/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue index ad3ae916..c73202e6 100644 --- a/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue +++ b/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue @@ -7,6 +7,7 @@
+ @@ -214,6 +215,7 @@ isLoading: false, modifiedgametype: null, modifiedseason: null, + modifiedgamemap: null, data: null, disableFilterInput: null, sections: [ @@ -320,6 +322,12 @@ updatedList.unshift(newValue); return updatedList; }, + gameMapWithAll() { + const newValue = { code: 'All', name: 'All' }; + const updatedList = [...this.filters.game_maps]; + updatedList.unshift(newValue); + return updatedList; + }, isOwner(){ if(this.battletag == "Zemill" && this.blizzid == 67280 && this.region == 1){ return true; @@ -346,6 +354,7 @@ region: this.region, game_type: this.modifiedgametype, season: this.modifiedseason, + game_map: this.modifiedgamemap, hero: this.hero, type: "single", page: "hero", @@ -384,6 +393,15 @@ this.modifiedseason = eventPayload.value; } } + + if(eventPayload.field == "Game Map"){ + if(eventPayload.value == "All"){ + this.modifiedgamemap = null; + }else{ + this.modifiedgamemap = eventPayload.value; + } + } + }, applyFilter(){ if(!this.isLoading){ From 2a4deb2303d386f0174f7a4ba2258057230adbb7 Mon Sep 17 00:00:00 2001 From: Tasha Millhouse Date: Sun, 8 Sep 2024 09:01:56 -0400 Subject: [PATCH 2/3] Fixed playerherosinglestats on mobile --- resources/js/components/GameSummaryBox.vue | 2 +- .../Player/Heroes/PlayerHeroSingleStats.vue | 120 +++++++++--------- 2 files changed, 63 insertions(+), 59 deletions(-) diff --git a/resources/js/components/GameSummaryBox.vue b/resources/js/components/GameSummaryBox.vue index 6bbc8006..2a66feca 100644 --- a/resources/js/components/GameSummaryBox.vue +++ b/resources/js/components/GameSummaryBox.vue @@ -40,7 +40,7 @@
-
+
diff --git a/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue b/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue index c73202e6..367c8455 100644 --- a/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue +++ b/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue @@ -4,7 +4,7 @@ -
+
@@ -16,11 +16,13 @@
-
-
+
+
- +
+ +
@@ -66,77 +68,79 @@
-
-
-
-

Quick Match

- - - -
+
+
+
+

Quick Match

+ + + +
-
-

Unranked Draft

- - - -
+
+

Unranked Draft

+ + + +
-
-

Hero league

- - - -
+
+

Hero league

+ + + +
-
-

Team league

- - - -
+
+

Team league

+ + + +
-
-

Storm league

- - - -
+
+

Storm league

+ + + +
-
-

ARAM

- - - -
-
- -
-
- -
+
+

ARAM

+ + + +
+ + + + +
+ + +
-
-
+
+

Party Size Win Rates

-
+
SoloTotal Games: {{ (data.stack_size_one_wins + data.stack_size_one_losses).toLocaleString('en-US') }}
-
+
Two StackTotal Games: {{ (data.stack_size_two_wins + data.stack_size_two_losses).toLocaleString('en-US') }}
-
+
Three StackTotal Games: {{ (data.stack_size_three_wins + data.stack_size_three_losses).toLocaleString('en-US') }}
-
+
Four StackTotal Games: {{ (data.stack_size_four_wins + data.stack_size_four_losses).toLocaleString('en-US') }}
-
+
Five StackTotal Games: {{ (data.stack_size_five_wins + data.stack_size_five_losses).toLocaleString('en-US') }}
@@ -157,7 +161,7 @@

Advanced Stats

- +
@@ -168,7 +172,7 @@ - + @@ -275,7 +279,7 @@ ], }, { - title: 'Defense/Healing', + title: 'Defense/ Healing', rows: [ { label: 'Healing', key: 'healing' }, { label: 'Self Healing', key: 'self_healing' }, From 9e958a71e8110d1d6f9b24ca1458d4a00fd6ea02 Mon Sep 17 00:00:00 2001 From: Zemill <33404722+Zemill@users.noreply.github.com> Date: Sun, 8 Sep 2024 17:02:46 -0400 Subject: [PATCH 3/3] Fixes it so it doesnt try and filter when map is null --- app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php b/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php index 9ce3d984..022f7281 100644 --- a/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php +++ b/app/Http/Controllers/Player/PlayerHeroesMapsRolesController.php @@ -107,7 +107,7 @@ public function getData(Request $request) ->when($type == 'single' && $page == 'role', function ($query) use ($role) { return $query->where('new_role', $role); }) - ->when($type == 'single' && ($page == 'map' || $page == 'hero'), function ($query) use ($game_map) { + ->when($game_map && $type == 'single' && ($page == 'map' || $page == 'hero'), function ($query) use ($game_map) { return $query->where('game_map', $game_map); }) ->when(! is_null($season), function ($query) use ($season) {
{{ section.title }}
{{ row.label }}{{ row.label }} {{ formatValue(row.key, this.data["sum_" + row.key])}} {{ formatValue(row.key, this.data["avg_" + row.key]) }} {{ formatValue(row.key, this.data["max_" + row.key]) }}