From 49f40cc8c005d440d56576fba6a7e28584076430 Mon Sep 17 00:00:00 2001 From: Zemill <33404722+Zemill@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:12:41 -0500 Subject: [PATCH] Added code for new settings and updates Added new filters and updated them so that there is a single select game type and multi select game type filter for the pages where there is only 1 option to pick or multiple options to pick Also added build type This should be fully working now --- app/Http/Controllers/CompareController.php | 2 +- .../Controllers/Esports/EsportsController.php | 5 -- .../Global/GlobalCompositionsController.php | 2 +- .../Global/GlobalDraftController.php | 2 +- .../Global/GlobalHeroMapStatsController.php | 2 +- .../GlobalHeroMatchupStatsController.php | 2 +- .../GlobalHeroMatchupsTalentsController.php | 2 +- .../Global/GlobalHeroStatsController.php | 2 +- .../Global/GlobalLeaderboardController.php | 2 +- .../Global/GlobalPartyStatsController.php | 2 +- .../Global/GlobalTalentBuilderController.php | 2 +- .../Global/GlobalTalentStatsController.php | 2 +- .../Player/FriendFoeController.php | 2 +- .../Controllers/Player/PlayerController.php | 6 +-- .../Player/PlayerHeroesController.php | 2 + .../Player/PlayerMMRController.php | 2 +- .../Player/PlayerMapsController.php | 4 ++ .../Controllers/Player/PlayerMatchHistory.php | 2 +- .../Player/PlayerMatchupsController.php | 2 + .../Player/PlayerRolesController.php | 4 ++ .../Player/PlayerTalentsController.php | 1 + app/Http/Controllers/ProfileController.php | 22 ++++++-- app/Services/GlobalDataService.php | 51 ++++++++++++++----- resources/js/components/Filtering/Filters.vue | 3 +- .../Global/Hero/GlobalHeroStats.vue | 6 ++- .../Global/Talents/GlobalTalentsStats.vue | 1 - resources/js/components/Player/FriendFoe.vue | 32 ++++-------- .../Player/Heroes/PlayerHeroSingleStats.vue | 6 ++- .../Player/Heroes/PlayerHeroesAllStats.vue | 4 +- .../Player/Maps/PlayerMapSingleStats.vue | 7 ++- .../Player/Maps/PlayerMapsAllStats.vue | 5 +- .../components/Player/PlayerMatchHistory.vue | 4 +- .../js/components/Player/PlayerMatchup.vue | 6 ++- .../js/components/Player/PlayerStats.vue | 10 ++-- .../js/components/Player/PlayerTalents.vue | 5 +- .../Player/Roles/PlayerRoleSingleStats.vue | 7 ++- .../Player/Roles/PlayerRolesAllStats.vue | 5 +- .../js/components/Profile/ProfileSettings.vue | 51 +++++++++++-------- .../Player/Heroes/allHeroesData.blade.php | 2 + .../Player/Heroes/singleHeroData.blade.php | 2 + .../views/Player/Maps/allMapData.blade.php | 2 + .../views/Player/Maps/singleMapData.blade.php | 2 + .../views/Player/Roles/allRoleData.blade.php | 2 + .../Player/Roles/singleRoleData.blade.php | 2 + resources/views/Player/matchupData.blade.php | 2 + resources/views/Player/player.blade.php | 2 +- resources/views/Player/talentData.blade.php | 2 + resources/views/layouts/app.blade.php | 2 +- 48 files changed, 194 insertions(+), 103 deletions(-) diff --git a/app/Http/Controllers/CompareController.php b/app/Http/Controllers/CompareController.php index b2166759..ba61bdd0 100644 --- a/app/Http/Controllers/CompareController.php +++ b/app/Http/Controllers/CompareController.php @@ -35,7 +35,7 @@ public function show(Request $request, $hero = null) 'regions' => $this->globalDataService->getRegionIDtoString(), 'userinput' => $userinput, 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("single"), ]); } diff --git a/app/Http/Controllers/Esports/EsportsController.php b/app/Http/Controllers/Esports/EsportsController.php index 805f0ded..1a902ba6 100644 --- a/app/Http/Controllers/Esports/EsportsController.php +++ b/app/Http/Controllers/Esports/EsportsController.php @@ -45,11 +45,6 @@ public function show(Request $request) return view('Esports.esportsMain') ->with([ 'regions' => $this->globalDataService->getRegionIDtoString(), - //'filters' => $this->globalDataService->getFilterData(), - //'gametypedefault' => $this->globalDataService->getGameTypeDefault(), - //'defaulttimeframetype' => $this->globalDataService->getDefaultTimeframeType(), - //'defaulttimeframe' => [$this->globalDataService->getDefaultTimeframe()], - //'defaultbuildtype' => $this->globalDataService->getDefaultBuildType() ]); } diff --git a/app/Http/Controllers/Global/GlobalCompositionsController.php b/app/Http/Controllers/Global/GlobalCompositionsController.php index 83f5f087..4dd80deb 100644 --- a/app/Http/Controllers/Global/GlobalCompositionsController.php +++ b/app/Http/Controllers/Global/GlobalCompositionsController.php @@ -19,7 +19,7 @@ public function show(Request $request) ->with([ 'regions' => $this->globalDataService->getRegionIDtoString(), 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'advancedfiltering' => $this->globalDataService->getAdvancedFilterShowDefault(), 'defaulttimeframetype' => $this->globalDataService->getDefaultTimeframeType(), 'defaulttimeframe' => [$this->globalDataService->getDefaultTimeframe()], diff --git a/app/Http/Controllers/Global/GlobalDraftController.php b/app/Http/Controllers/Global/GlobalDraftController.php index 1adea5f3..5f962745 100644 --- a/app/Http/Controllers/Global/GlobalDraftController.php +++ b/app/Http/Controllers/Global/GlobalDraftController.php @@ -31,7 +31,7 @@ public function show(Request $request, $hero = null) 'regions' => $this->globalDataService->getRegionIDtoString(), 'userinput' => $userinput, 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'advancedfiltering' => $this->globalDataService->getAdvancedFilterShowDefault(), 'defaulttimeframetype' => $this->globalDataService->getDefaultTimeframeType(), 'defaulttimeframe' => [$this->globalDataService->getDefaultTimeframe()], diff --git a/app/Http/Controllers/Global/GlobalHeroMapStatsController.php b/app/Http/Controllers/Global/GlobalHeroMapStatsController.php index 67c9ec27..22f1ca7c 100644 --- a/app/Http/Controllers/Global/GlobalHeroMapStatsController.php +++ b/app/Http/Controllers/Global/GlobalHeroMapStatsController.php @@ -33,7 +33,7 @@ public function show(Request $request, $hero = null) 'regions' => $this->globalDataService->getRegionIDtoString(), 'userinput' => $userinput, 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'advancedfiltering' => $this->globalDataService->getAdvancedFilterShowDefault(), 'defaulttimeframetype' => $this->globalDataService->getDefaultTimeframeType(), 'defaulttimeframe' => [$this->globalDataService->getDefaultTimeframe()], diff --git a/app/Http/Controllers/Global/GlobalHeroMatchupStatsController.php b/app/Http/Controllers/Global/GlobalHeroMatchupStatsController.php index 2189e7d1..1fca0eb4 100644 --- a/app/Http/Controllers/Global/GlobalHeroMatchupStatsController.php +++ b/app/Http/Controllers/Global/GlobalHeroMatchupStatsController.php @@ -33,7 +33,7 @@ public function show(Request $request, $hero = null, $allyenemy = null) 'regions' => $this->globalDataService->getRegionIDtoString(), 'userinput' => $userinput, 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'advancedfiltering' => $this->globalDataService->getAdvancedFilterShowDefault(), 'defaulttimeframetype' => $this->globalDataService->getDefaultTimeframeType(), 'defaulttimeframe' => [$this->globalDataService->getDefaultTimeframe()], diff --git a/app/Http/Controllers/Global/GlobalHeroMatchupsTalentsController.php b/app/Http/Controllers/Global/GlobalHeroMatchupsTalentsController.php index 4bb3160e..717b05f6 100644 --- a/app/Http/Controllers/Global/GlobalHeroMatchupsTalentsController.php +++ b/app/Http/Controllers/Global/GlobalHeroMatchupsTalentsController.php @@ -62,7 +62,7 @@ public function show(Request $request, $hero = null, $allyenemy = null) 'regions' => $this->globalDataService->getRegionIDtoString(), 'heroes' => $this->globalDataService->getHeroes(), 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'defaulttimeframetype' => $this->globalDataService->getDefaultTimeframeType(), 'advancedfiltering' => $this->globalDataService->getAdvancedFilterShowDefault(), 'defaulttimeframe' => [$this->globalDataService->getDefaultTimeframe()], diff --git a/app/Http/Controllers/Global/GlobalHeroStatsController.php b/app/Http/Controllers/Global/GlobalHeroStatsController.php index 83a249a9..a4d61b82 100644 --- a/app/Http/Controllers/Global/GlobalHeroStatsController.php +++ b/app/Http/Controllers/Global/GlobalHeroStatsController.php @@ -21,7 +21,7 @@ public function show(Request $request) ->with([ 'regions' => $this->globalDataService->getRegionIDtoString(), 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'advancedfiltering' => $this->globalDataService->getAdvancedFilterShowDefault(), 'defaulttimeframetype' => $this->globalDataService->getDefaultTimeframeType(), 'defaulttimeframe' => [$this->globalDataService->getDefaultTimeframe()], diff --git a/app/Http/Controllers/Global/GlobalLeaderboardController.php b/app/Http/Controllers/Global/GlobalLeaderboardController.php index d5c7a9cb..05064f73 100644 --- a/app/Http/Controllers/Global/GlobalLeaderboardController.php +++ b/app/Http/Controllers/Global/GlobalLeaderboardController.php @@ -29,7 +29,7 @@ public function show(Request $request) return view('Global.Leaderboard.globalLeaderboard')->with([ 'regions' => $this->globalDataService->getRegionIDtoString(), 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("single"), 'advancedfiltering' => $this->globalDataService->getAdvancedFilterShowDefault(), 'defaultseason' => (string) $this->globalDataService->getDefaultSeason(), 'weekssincestart' => $this->globalDataService->getWeeksSinceSeasonStart(), diff --git a/app/Http/Controllers/Global/GlobalPartyStatsController.php b/app/Http/Controllers/Global/GlobalPartyStatsController.php index 99012d92..9abd1609 100644 --- a/app/Http/Controllers/Global/GlobalPartyStatsController.php +++ b/app/Http/Controllers/Global/GlobalPartyStatsController.php @@ -17,7 +17,7 @@ public function show(Request $request) ->with([ 'regions' => $this->globalDataService->getRegionIDtoString(), 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'defaulttimeframetype' => $this->globalDataService->getDefaultTimeframeType(), 'advancedfiltering' => $this->globalDataService->getAdvancedFilterShowDefault(), 'defaulttimeframe' => [$this->globalDataService->getDefaultTimeframe()], diff --git a/app/Http/Controllers/Global/GlobalTalentBuilderController.php b/app/Http/Controllers/Global/GlobalTalentBuilderController.php index 417bf2e9..401a5247 100644 --- a/app/Http/Controllers/Global/GlobalTalentBuilderController.php +++ b/app/Http/Controllers/Global/GlobalTalentBuilderController.php @@ -33,7 +33,7 @@ public function show(Request $request, $hero = null) 'regions' => $this->globalDataService->getRegionIDtoString(), 'userinput' => $userinput, 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'defaulttimeframetype' => $this->globalDataService->getDefaultTimeframeType(), 'advancedfiltering' => $this->globalDataService->getAdvancedFilterShowDefault(), 'defaulttimeframe' => [$this->globalDataService->getDefaultTimeframe()], diff --git a/app/Http/Controllers/Global/GlobalTalentStatsController.php b/app/Http/Controllers/Global/GlobalTalentStatsController.php index 664e93de..1d5b1bff 100644 --- a/app/Http/Controllers/Global/GlobalTalentStatsController.php +++ b/app/Http/Controllers/Global/GlobalTalentStatsController.php @@ -37,7 +37,7 @@ public function show(Request $request, $hero = null) 'heroes' => $this->globalDataService->getHeroes(), 'userinput' => $userinput, 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'defaulttimeframetype' => $this->globalDataService->getDefaultTimeframeType(), 'advancedfiltering' => $this->globalDataService->getAdvancedFilterShowDefault(), 'defaulttimeframe' => [$this->globalDataService->getDefaultTimeframe()], diff --git a/app/Http/Controllers/Player/FriendFoeController.php b/app/Http/Controllers/Player/FriendFoeController.php index eeeaae37..126eed2e 100644 --- a/app/Http/Controllers/Player/FriendFoeController.php +++ b/app/Http/Controllers/Player/FriendFoeController.php @@ -57,7 +57,7 @@ public function show(Request $request, $battletag, $blizz_id, $region) 'season' => $season, 'game_type' => $game_type, 'game_map' => $game_map, - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'filters' => $this->globalDataService->getFilterData(), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), ]); diff --git a/app/Http/Controllers/Player/PlayerController.php b/app/Http/Controllers/Player/PlayerController.php index c54f6493..0d5a56c9 100644 --- a/app/Http/Controllers/Player/PlayerController.php +++ b/app/Http/Controllers/Player/PlayerController.php @@ -34,9 +34,6 @@ public function show(Request $request, $battletag, $blizz_id, $region) 'region' => 'required|integer', ]; - if (request()->has('game_type')) { - $validationRules['game_type'] = ['sometimes', 'nullable', new GameTypeInputValidation()]; - } if (request()->has('season')) { $validationRules['season'] = ['sometimes', 'nullable', new SeasonInputValidation()]; } @@ -64,7 +61,6 @@ public function show(Request $request, $battletag, $blizz_id, $region) } $season = $request['season']; - $game_type = $request['game_type']; return view('Player.player')->with([ 'regions' => $this->globalDataService->getRegionIDtoString(), @@ -73,7 +69,7 @@ public function show(Request $request, $battletag, $blizz_id, $region) 'blizz_id' => $blizz_id, 'region' => $region, 'season' => $season, - 'game_type' => $game_type, + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("single"), 'filters' => $this->globalDataService->getFilterData(), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), ]); diff --git a/app/Http/Controllers/Player/PlayerHeroesController.php b/app/Http/Controllers/Player/PlayerHeroesController.php index 3b06b504..cbfd8d8f 100644 --- a/app/Http/Controllers/Player/PlayerHeroesController.php +++ b/app/Http/Controllers/Player/PlayerHeroesController.php @@ -41,6 +41,7 @@ public function showAll(Request $request, $battletag, $blizz_id, $region) 'region' => $region, 'filters' => $this->globalDataService->getFilterData(), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), ]); } @@ -73,6 +74,7 @@ public function showSingle(Request $request, $battletag, $blizz_id, $region, $he 'filters' => $this->globalDataService->getFilterData(), 'regions' => $this->globalDataService->getRegionIDtoString(), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("single"), ]); } } diff --git a/app/Http/Controllers/Player/PlayerMMRController.php b/app/Http/Controllers/Player/PlayerMMRController.php index 1e8c693a..44d0048a 100644 --- a/app/Http/Controllers/Player/PlayerMMRController.php +++ b/app/Http/Controllers/Player/PlayerMMRController.php @@ -39,7 +39,7 @@ public function show(Request $request, $battletag, $blizz_id, $region) 'blizz_id' => $blizz_id, 'region' => $region, 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("single"), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), ]); } diff --git a/app/Http/Controllers/Player/PlayerMapsController.php b/app/Http/Controllers/Player/PlayerMapsController.php index 3d8267c1..a0793e2d 100644 --- a/app/Http/Controllers/Player/PlayerMapsController.php +++ b/app/Http/Controllers/Player/PlayerMapsController.php @@ -42,6 +42,8 @@ public function showAll(Request $request, $battletag, $blizz_id, $region) 'region' => $region, 'filters' => $this->globalDataService->getFilterData(), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), + ]); } @@ -76,6 +78,8 @@ public function showSingle(Request $request, $battletag, $blizz_id, $region, $ma 'filters' => $this->globalDataService->getFilterData(), 'regions' => $this->globalDataService->getRegionIDtoString(), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("single"), + ]); } } diff --git a/app/Http/Controllers/Player/PlayerMatchHistory.php b/app/Http/Controllers/Player/PlayerMatchHistory.php index 96654522..e61049d9 100644 --- a/app/Http/Controllers/Player/PlayerMatchHistory.php +++ b/app/Http/Controllers/Player/PlayerMatchHistory.php @@ -40,7 +40,7 @@ public function show(Request $request, $battletag, $blizz_id, $region) 'blizz_id' => $blizz_id, 'region' => $region, 'filters' => $this->globalDataService->getFilterData(), - 'gametypedefault' => $this->globalDataService->getGameTypeDefault(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), ]); } diff --git a/app/Http/Controllers/Player/PlayerMatchupsController.php b/app/Http/Controllers/Player/PlayerMatchupsController.php index 7e466923..2c99af26 100644 --- a/app/Http/Controllers/Player/PlayerMatchupsController.php +++ b/app/Http/Controllers/Player/PlayerMatchupsController.php @@ -39,6 +39,8 @@ public function show(Request $request, $battletag, $blizz_id, $region) 'region' => $region, 'filters' => $this->globalDataService->getFilterData(), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), + ]); } diff --git a/app/Http/Controllers/Player/PlayerRolesController.php b/app/Http/Controllers/Player/PlayerRolesController.php index 3465179e..2d853ba9 100644 --- a/app/Http/Controllers/Player/PlayerRolesController.php +++ b/app/Http/Controllers/Player/PlayerRolesController.php @@ -36,6 +36,8 @@ public function showAll(Request $request, $battletag, $blizz_id, $region) 'region' => $region, 'filters' => $this->globalDataService->getFilterData(), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), + ]); } @@ -66,6 +68,8 @@ public function showSingle(Request $request, $battletag, $blizz_id, $region, $ro 'filters' => $this->globalDataService->getFilterData(), 'regions' => $this->globalDataService->getRegionIDtoString(), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("single"), + ]); } } diff --git a/app/Http/Controllers/Player/PlayerTalentsController.php b/app/Http/Controllers/Player/PlayerTalentsController.php index ea93b317..23747b39 100644 --- a/app/Http/Controllers/Player/PlayerTalentsController.php +++ b/app/Http/Controllers/Player/PlayerTalentsController.php @@ -52,6 +52,7 @@ public function show(Request $request, $battletag, $blizz_id, $region) 'talentimages' => $this->globalDataService->getPreloadTalentImageUrls(), 'patreon' => $this->globalDataService->checkIfSiteFlair($blizz_id, $region), 'heroes' => $this->globalDataService->getHeroes(), + 'gametypedefault' => $this->globalDataService->getGameTypeDefault("multi"), ]); } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 1c0cd664..4dd26a3c 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -62,21 +62,33 @@ public function saveSettings(Request $request) ['value' => $userhero] ); } - + if (! is_null($request['usergametype'])) { $user = BattlenetAccount::find($request['userid']); - $userGameTypes = $request['usergametype']; + $usergametype = $request['usergametype']; + + $user->userSettings()->updateOrCreate( + ['setting' => 'game_type'], + ['value' => $usergametype] + ); + } + + + if (! is_null($request['usermultigametype'])) { + $user = BattlenetAccount::find($request['userid']); + + $userGameTypes = $request['usermultigametype']; $existingGameTypes = GameType::whereIn('short_name', $userGameTypes)->pluck('short_name')->all(); if (count($existingGameTypes) === count($userGameTypes)) { - $usergametype = $request['usergametype']; + $usergametype = $request['usermultigametype']; } else { return ['success' => false]; } $user->userSettings()->updateOrCreate( - ['setting' => 'game_type'], - ['value' => implode(',', $usergametype)] + ['setting' => 'multi_game_type'], + ['value' => implode(',', $userGameTypes)] ); } diff --git a/app/Services/GlobalDataService.php b/app/Services/GlobalDataService.php index 900348b4..700d0643 100644 --- a/app/Services/GlobalDataService.php +++ b/app/Services/GlobalDataService.php @@ -22,12 +22,9 @@ class GlobalDataService { - private $filtersMinimumPatch; - public function __construct() { - //can add modifier here for patreons to reduce what they can filter on - $this->filtersMinimumPatch = '2.53.0.83004'; + } public function getHeaderAlert() @@ -84,6 +81,12 @@ public function getDefaultBuildType() { if (Auth::check()) { $user = Auth::user(); + + + $talentbuildtype = $user->userSettings->firstWhere('setting', 'talentbuildtype'); + + return $talentbuildtype ? $talentbuildtype->value : 'Popular'; + } return 'Popular'; @@ -236,21 +239,28 @@ public function getAdvancedFilterShowDefault() } - public function getGameTypeDefault() + public function getGameTypeDefault($type) { if (Auth::check()) { $user = Auth::user(); - $gameTypeSetting = $user->userSettings->firstWhere('setting', 'game_type'); - - if ($gameTypeSetting) { - $gameTypeValue = $gameTypeSetting->value; - - return explode(',', $gameTypeSetting->value); + if($type == "single"){ + $gameTypeSetting = $user->userSettings->firstWhere('setting', 'game_type'); + if ($gameTypeSetting) { + return [$gameTypeSetting->value]; + } + }else{ + $gameTypeSetting = $user->userSettings->firstWhere('setting', 'multi_game_type'); + if ($gameTypeSetting) { + $gameTypeValue = $gameTypeSetting->value; + + return explode(',', $gameTypeSetting->value); + } } - } + + } return ['sl']; } @@ -261,6 +271,15 @@ public function getDefaultSeason() public function getFilterData() { + $filtersMinimumPatch = '2.53.0.83004'; + if (Auth::check()) { + $user = Auth::user(); + + if($this->checkIfSiteFlair($user->blizz_id, $user->region) || $this->isOwner($user->blizz_id, $user->region)){ + $filtersMinimumPatch = '2.52.0.81700'; + } + } + $filterData = new \stdClass; $filterData->timeframe_type = [ @@ -269,7 +288,7 @@ public function getFilterData() ]; $filterData->timeframes = SeasonGameVersion::select('game_version') - ->where('game_version', '>=', $this->filtersMinimumPatch) + ->where('game_version', '>=', $filtersMinimumPatch) ->orderBy('game_version', 'DESC') ->get() ->map(function ($item) { @@ -277,7 +296,7 @@ public function getFilterData() }); $filterData->timeframes_grouped = SeasonGameVersion::select('game_version') - ->where('game_version', '>=', $this->filtersMinimumPatch) + ->where('game_version', '>=', $filtersMinimumPatch) ->orderBy('game_version', 'DESC') ->get() ->groupBy(function ($date) { @@ -696,4 +715,8 @@ public function checkIfSiteFlair($blizz_id, $region) return false; } + + public function isOwner($blizz_id, $region){ + return ($blizz_id == 67280 and $region == 1) ? true : false; + } } diff --git a/resources/js/components/Filtering/Filters.vue b/resources/js/components/Filtering/Filters.vue index c3322f67..8b3ee507 100644 --- a/resources/js/components/Filtering/Filters.vue +++ b/resources/js/components/Filtering/Filters.vue @@ -181,7 +181,7 @@ :values="filters.talent_build_types" :text="'Talent Build Type'" @input-changed="handleInputChange" - :defaultValue="filters.talent_build_types[0].code" + :defaultValue="buildtypedefault" > @@ -302,6 +302,7 @@ advancedfiltering: Boolean, defaultHero: Number, defaultRole: String, + buildtypedefault: String, }, data(){ diff --git a/resources/js/components/Global/Hero/GlobalHeroStats.vue b/resources/js/components/Global/Hero/GlobalHeroStats.vue index 8677cd8a..14cf4525 100644 --- a/resources/js/components/Global/Hero/GlobalHeroStats.vue +++ b/resources/js/components/Global/Hero/GlobalHeroStats.vue @@ -24,6 +24,7 @@ :includemirror="true" :includetalentbuildtype="true" :advancedfiltering="advancedfiltering" + :buildtypedefault="defaultbuildtype" > @@ -184,11 +185,11 @@ export default { required: true }, gametypedefault: Array, - defaultbuildtype: String, defaulttimeframetype: String, defaulttimeframe: Array, advancedfiltering: Boolean, patreonUser: Boolean, + defaultbuildtype: String, }, data(){ return { @@ -200,7 +201,7 @@ export default { togglechart: false, toggletalentbuilds: {}, talentbuilddata: {}, - selectedbuildtype: "Popular", + selectedbuildtype: null, cancelTokenSource: null, @@ -227,6 +228,7 @@ export default { this.timeframe = this.defaulttimeframe; this.talentbuildtype = this.defaultbuildtype; this.timeframetype = this.defaulttimeframetype; + this.getData(); }, mounted() { diff --git a/resources/js/components/Global/Talents/GlobalTalentsStats.vue b/resources/js/components/Global/Talents/GlobalTalentsStats.vue index 19cd14bc..5ccfb124 100644 --- a/resources/js/components/Global/Talents/GlobalTalentsStats.vue +++ b/resources/js/components/Global/Talents/GlobalTalentsStats.vue @@ -129,7 +129,6 @@ } }, created(){ - this.preloadTalentImages(this.inputhero); }, mounted() { diff --git a/resources/js/components/Player/FriendFoe.vue b/resources/js/components/Player/FriendFoe.vue index 0633afd3..cc63d014 100644 --- a/resources/js/components/Player/FriendFoe.vue +++ b/resources/js/components/Player/FriendFoe.vue @@ -40,26 +40,15 @@ - -
-
- -
-
- -
- {{ row.battletag }} -
- - - - - - - - - - +
+
+ +
+
+ +
+ {{ row.battletag }} +
@@ -146,7 +135,7 @@ export default { enemySortKey: '', enemySortDir: 'desc', - gametype: ["qm", "ud", "hl", "tl", "sl", "ar"], + gametype: null, gamemap: null, season: null, friendCancelTokenSource: null, @@ -154,6 +143,7 @@ export default { } }, created(){ + this.gametype = this.gametypedefault; }, mounted() { Promise.allSettled([ diff --git a/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue b/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue index ffb4395b..6c2b8f93 100644 --- a/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue +++ b/resources/js/components/Player/Heroes/PlayerHeroSingleStats.vue @@ -5,7 +5,7 @@
- +
@@ -197,6 +197,7 @@ regionsmap: Object, isPatreon: Boolean, patreonUser: Boolean, + gametypedefault: Array, }, data(){ return { @@ -283,6 +284,9 @@ } }, created(){ + if(this.gametypedefault && this.gametypedefault.length > 0){ + this.modifiedgametype = this.gametypedefault[0]; + } }, mounted() { this.getData(); diff --git a/resources/js/components/Player/Heroes/PlayerHeroesAllStats.vue b/resources/js/components/Player/Heroes/PlayerHeroesAllStats.vue index 43eb20e5..1069b3ee 100644 --- a/resources/js/components/Player/Heroes/PlayerHeroesAllStats.vue +++ b/resources/js/components/Player/Heroes/PlayerHeroesAllStats.vue @@ -123,6 +123,7 @@ export default { accountlevel: Number, isPatreon: Boolean, patreonUser: Boolean, + gametypedefault: Array, }, data(){ return { @@ -131,7 +132,7 @@ export default { matchIsLoading: false, cancelTokenSource: null, infoText: "Select a hero below to view detailed stats for that hero. Use the search box above to filter the list of heroes. Or scroll down to the advanced section for table view.", - gametype: ["qm", "ud", "hl", "tl", "sl", "ar"], + gametype: null, data: null, sortKey: '', sortDir: 'desc', @@ -228,6 +229,7 @@ export default { } }, created(){ + this.gametype = this.gametypedefault; }, mounted() { this.getData(); diff --git a/resources/js/components/Player/Maps/PlayerMapSingleStats.vue b/resources/js/components/Player/Maps/PlayerMapSingleStats.vue index abecfafd..22117d74 100644 --- a/resources/js/components/Player/Maps/PlayerMapSingleStats.vue +++ b/resources/js/components/Player/Maps/PlayerMapSingleStats.vue @@ -6,7 +6,7 @@
- +
@@ -120,6 +120,8 @@ export default { mapobject: Object, isPatreon: Boolean, patreonUser: Boolean, + gametypedefault: Array, + }, data(){ return { @@ -133,6 +135,9 @@ export default { }, created(){ this.inputmap = this.map; + if(this.gametypedefault && this.gametypedefault.length > 0){ + this.modifiedgametype = this.gametypedefault[0]; + } }, mounted() { this.getData(); diff --git a/resources/js/components/Player/Maps/PlayerMapsAllStats.vue b/resources/js/components/Player/Maps/PlayerMapsAllStats.vue index bc7f0a7d..fc658d7c 100644 --- a/resources/js/components/Player/Maps/PlayerMapsAllStats.vue +++ b/resources/js/components/Player/Maps/PlayerMapsAllStats.vue @@ -109,6 +109,8 @@ export default { accountlevel: Number, isPatreon: Boolean, patreonUser: Boolean, + gametypedefault: Array, + }, data(){ return { @@ -116,7 +118,7 @@ export default { showOptions: false, isLoading: false, infoText: "Select a hero below to view detailed stats for that hero. Use the search box above to filter the list of heroes. Or scroll down to the advanced section for table view.", - gametype: ["qm", "ud", "hl", "tl", "sl", "ar"], + gametype: null, data: null, sortKey: '', sortDir: 'desc', @@ -212,6 +214,7 @@ export default { } }, created(){ + this.gametype = this.gametypedefault; }, mounted() { this.getData(); diff --git a/resources/js/components/Player/PlayerMatchHistory.vue b/resources/js/components/Player/PlayerMatchHistory.vue index 464d97ea..a005167a 100644 --- a/resources/js/components/Player/PlayerMatchHistory.vue +++ b/resources/js/components/Player/PlayerMatchHistory.vue @@ -118,6 +118,7 @@ export default { regionsmap: Object, isPatreon: Boolean, patreonUser: Boolean, + gametypedefault: Array, }, data(){ return { @@ -131,10 +132,11 @@ export default { season: null, sortKey: '', sortDir: 'desc', - gametype: ["qm", "ud", "hl", "tl", "sl", "ar"], + gametype: null, } }, created(){ + this.gametype = this.gametypedefault; }, mounted() { this.getData(1); diff --git a/resources/js/components/Player/PlayerMatchup.vue b/resources/js/components/Player/PlayerMatchup.vue index e50cb108..38fdd714 100644 --- a/resources/js/components/Player/PlayerMatchup.vue +++ b/resources/js/components/Player/PlayerMatchup.vue @@ -83,13 +83,15 @@ region: String, isPatreon: Boolean, patreonUser: Boolean, + gametypedefault: Array, + }, data(){ return { cancelTokenSource: null, isLoading: false, infotext: "Hero Matchups provide information on which heroes " + this.battletag + " is good with and against", - gametype: ["qm", "ud", "hl", "tl", "sl", "ar"], + gametype: null, data: null, sortKey: '', sortDir: 'desc', @@ -98,6 +100,8 @@ } }, created(){ + this.gametype = this.gametypedefault; + }, mounted() { this.getData(); diff --git a/resources/js/components/Player/PlayerStats.vue b/resources/js/components/Player/PlayerStats.vue index af42d313..0f2774bc 100644 --- a/resources/js/components/Player/PlayerStats.vue +++ b/resources/js/components/Player/PlayerStats.vue @@ -3,7 +3,7 @@
- +
@@ -205,10 +205,11 @@ blizzid: String, region: String, season: Number, - gametype: Array, regionsmap: Object, isPatreon: Boolean, patreonUser: Boolean, + gametypedefault: Array, + }, data(){ return { @@ -223,8 +224,11 @@ } }, created(){ - this.modifiedgametype = this.gametype; this.modifiedseason = this.season; + + if(this.gametypedefault && this.gametypedefault.length > 0){ + this.modifiedgametype = this.gametypedefault[0]; + } }, mounted() { if(this.settinghero){ diff --git a/resources/js/components/Player/PlayerTalents.vue b/resources/js/components/Player/PlayerTalents.vue index 8823401d..843c23d9 100644 --- a/resources/js/components/Player/PlayerTalents.vue +++ b/resources/js/components/Player/PlayerTalents.vue @@ -62,12 +62,14 @@ export default { regionsmap: Object, isPatreon: Boolean, patreonUser: Boolean, + gametypedefault: Array, + }, data(){ return { cancelTokenSource: null, isLoading: false, - gametype: ["qm", "ud", "hl", "tl", "sl", "ar"], + gametype: null, selectedHero: null, data: null, talentdetaildata: null, @@ -78,6 +80,7 @@ export default { } }, created(){ + this.gametype = this.gametypedefault; }, mounted() { if(this.inputhero){ diff --git a/resources/js/components/Player/Roles/PlayerRoleSingleStats.vue b/resources/js/components/Player/Roles/PlayerRoleSingleStats.vue index a59b1017..6d3a3326 100644 --- a/resources/js/components/Player/Roles/PlayerRoleSingleStats.vue +++ b/resources/js/components/Player/Roles/PlayerRoleSingleStats.vue @@ -7,7 +7,7 @@
- +
@@ -141,6 +141,8 @@ regionsmap: Object, isPatreon: Boolean, patreonUser: Boolean, + gametypedefault: Array, + }, data(){ return { @@ -154,6 +156,9 @@ }, created(){ this.inputrole = this.hero; + if(this.gametypedefault && this.gametypedefault.length > 0){ + this.modifiedgametype = this.gametypedefault[0]; + } }, mounted() { this.getData(); diff --git a/resources/js/components/Player/Roles/PlayerRolesAllStats.vue b/resources/js/components/Player/Roles/PlayerRolesAllStats.vue index 97908064..6d93389f 100644 --- a/resources/js/components/Player/Roles/PlayerRolesAllStats.vue +++ b/resources/js/components/Player/Roles/PlayerRolesAllStats.vue @@ -105,6 +105,8 @@ accountlevel: Number, isPatreon: Boolean, patreonUser: Boolean, + gametypedefault: Array, + }, data(){ return { @@ -112,7 +114,7 @@ showOptions: false, isLoading: false, infoText: "Select a hero below to view detailed stats for that hero. Use the search box above to filter the list of heroes. Or scroll down to the advanced section for table view.", - gametype: ["qm", "ud", "hl", "tl", "sl", "ar"], + gametype: null, data: null, sortKey: '', sortDir: 'desc', @@ -208,6 +210,7 @@ } }, created(){ + this.gametype = this.gametypedefault; }, mounted() { this.getData(); diff --git a/resources/js/components/Profile/ProfileSettings.vue b/resources/js/components/Profile/ProfileSettings.vue index 47a394eb..9d9dabd8 100644 --- a/resources/js/components/Profile/ProfileSettings.vue +++ b/resources/js/components/Profile/ProfileSettings.vue @@ -10,7 +10,7 @@ :text="'Game Type'" @dropdown-closed="saveSettings()" @input-changed="handleInputChange" - :defaultValue="defaultGameType" + :defaultValue="defaultMultiGameType" :trackclosure="true" > @@ -19,7 +19,7 @@

Default Game Type:

- - +
@@ -102,6 +102,7 @@ export default { return { userhero: null, usergametype: null, + usermultigametype: null, advancedfilteringoptions: [ { code: 'true', name: 'Show' }, { code: 'false', name: "Don't Show" } @@ -122,9 +123,7 @@ export default { this.accountVisibility = "false"; } - console.log(this.defaultBuiltType); - - + console.log(this.user.user_settings); }, mounted() { this.advancedfiltering = this.defaultAdvancedFiltering; @@ -132,34 +131,40 @@ export default { computed: { defaultHero(){ if (this.user.user_settings.length > 0){ - let hero = this.user.user_settings.find(item => item.setting === 'hero').value; - return hero ? hero : null; + let hero = this.user.user_settings.find(item => item.setting === 'hero'); + return hero ? hero.value : null; } return null; }, - defaultGameType() { + defaultMultiGameType() { if (this.user.user_settings.length > 0) { - let gameType = this.user.user_settings.find(item => item.setting === 'game_type').value; - - // Check if gameType is truthy and not an empty string - if (gameType && gameType.trim() !== '') { - // Split the comma-separated values into an array - return gameType.split(',').map(value => value.trim()); + let multiGameTypes = this.user.user_settings.find(item => item.setting === 'multi_game_type'); + let gameTypes = multiGameTypes ? multiGameTypes.value : null; + + if (gameTypes && gameTypes.trim() !== '') { + return gameTypes.split(',').map(value => value.trim()); } } - return null; + return ["sl"]; + }, + defaultGameType() { + if (this.user.user_settings.length > 0) { + let gameTypeSetting = this.user.user_settings.find(item => item.setting === 'game_type'); + return gameTypeSetting ? gameTypeSetting.value : null; + } + return "sl"; }, defaultBuildType(){ if (this.user.user_settings.length > 0){ - let buildtype = this.user.user_settings.find(item => item.setting === 'talentbuildtype').value; - return buildtype ? buildtype : null; + let buildtype = this.user.user_settings.find(item => item.setting === 'talentbuildtype'); + return buildtype ? buildtype.value : null; } return this.filters.talent_build_types[0].code; }, defaultAdvancedFiltering(){ if (this.user.user_settings.length > 0){ - let advancedfiltering = this.user.user_settings.find(item => item.setting === 'advancedfiltering').value; - return advancedfiltering ? advancedfiltering : 'false'; + let advancedfiltering = this.user.user_settings.find(item => item.setting === 'advancedfiltering'); + return advancedfiltering ? advancedfiltering.value : 'false'; } return "false"; }, @@ -173,6 +178,7 @@ export default { userid: this.user.battlenet_accounts_id, userhero: this.userhero, usergametype: this.usergametype, + usermultigametype: this.usermultigametype, advancedfiltering: this.advancedfiltering, talentbuildtype: this.talentBuildType, }); @@ -180,6 +186,7 @@ export default { }catch(error){ //Do something here } + }, async setAccountVisbility(){ try{ @@ -201,11 +208,13 @@ export default { this.accountVisibility = eventPayload.value; }else if(eventPayload.field == "Talent Build Type"){ this.talentBuildType = eventPayload.value; + }else if(eventPayload.field == "Game Type"){ + this.usergametype = eventPayload.value; } } else if(eventPayload.type === 'multi') { if(eventPayload.field == "Game Type"){ - this.usergametype = eventPayload.value; + this.usermultigametype = eventPayload.value; } } }, diff --git a/resources/views/Player/Heroes/allHeroesData.blade.php b/resources/views/Player/Heroes/allHeroesData.blade.php index 5a9a4b3e..85c93d5a 100644 --- a/resources/views/Player/Heroes/allHeroesData.blade.php +++ b/resources/views/Player/Heroes/allHeroesData.blade.php @@ -12,5 +12,7 @@ :regionsmap="{{ json_encode($regions) }}" :is-patreon="{{ json_encode($patreon) }}" :patreon-user="{{ json_encode(session('patreonSubscriberAdFree')) }}" + :gametypedefault="{{ json_encode($gametypedefault) }}" + > @endsection diff --git a/resources/views/Player/Heroes/singleHeroData.blade.php b/resources/views/Player/Heroes/singleHeroData.blade.php index 20b99728..90a06be0 100644 --- a/resources/views/Player/Heroes/singleHeroData.blade.php +++ b/resources/views/Player/Heroes/singleHeroData.blade.php @@ -13,5 +13,7 @@ :heroobject="{{ json_encode($heroObject) }}" :is-patreon="{{ json_encode($patreon) }}" :patreon-user="{{ json_encode(session('patreonSubscriberAdFree')) }}" + :gametypedefault="{{ json_encode($gametypedefault) }}" + > @endsection diff --git a/resources/views/Player/Maps/allMapData.blade.php b/resources/views/Player/Maps/allMapData.blade.php index fc10a750..28456eb1 100644 --- a/resources/views/Player/Maps/allMapData.blade.php +++ b/resources/views/Player/Maps/allMapData.blade.php @@ -13,5 +13,7 @@ :regionsmap="{{ json_encode($regions) }}" :is-patreon="{{ json_encode($patreon) }}" :patreon-user="{{ json_encode(session('patreonSubscriberAdFree')) }}" + :gametypedefault="{{ json_encode($gametypedefault) }}" + > @endsection diff --git a/resources/views/Player/Maps/singleMapData.blade.php b/resources/views/Player/Maps/singleMapData.blade.php index 8a39c597..650eb6d4 100644 --- a/resources/views/Player/Maps/singleMapData.blade.php +++ b/resources/views/Player/Maps/singleMapData.blade.php @@ -14,5 +14,7 @@ :regionsmap="{{ json_encode($regions) }}" :is-patreon="{{ json_encode($patreon) }}" :patreon-user="{{ json_encode(session('patreonSubscriberAdFree')) }}" + :gametypedefault="{{ json_encode($gametypedefault) }}" + > @endsection diff --git a/resources/views/Player/Roles/allRoleData.blade.php b/resources/views/Player/Roles/allRoleData.blade.php index a15b6c2f..87f7a9a0 100644 --- a/resources/views/Player/Roles/allRoleData.blade.php +++ b/resources/views/Player/Roles/allRoleData.blade.php @@ -12,5 +12,7 @@ :regionsmap="{{ json_encode($regions) }}" :is-patreon="{{ json_encode($patreon) }}" :patreon-user="{{ json_encode(session('patreonSubscriberAdFree')) }}" + :gametypedefault="{{ json_encode($gametypedefault) }}" + > @endsection diff --git a/resources/views/Player/Roles/singleRoleData.blade.php b/resources/views/Player/Roles/singleRoleData.blade.php index 33a2d4b8..2da0b295 100644 --- a/resources/views/Player/Roles/singleRoleData.blade.php +++ b/resources/views/Player/Roles/singleRoleData.blade.php @@ -12,5 +12,7 @@ :regionsmap="{{ json_encode($regions) }}" :is-patreon="{{ json_encode($patreon) }}" :patreon-user="{{ json_encode(session('patreonSubscriberAdFree')) }}" + :gametypedefault="{{ json_encode($gametypedefault) }}" + > @endsection diff --git a/resources/views/Player/matchupData.blade.php b/resources/views/Player/matchupData.blade.php index b3bbb925..bbdbd09b 100644 --- a/resources/views/Player/matchupData.blade.php +++ b/resources/views/Player/matchupData.blade.php @@ -10,5 +10,7 @@ :region="{{ json_encode($region) }}" :is-patreon="{{ json_encode($patreon) }}" :patreon-user="{{ json_encode(session('patreonSubscriberAdFree')) }}" + :gametypedefault="{{ json_encode($gametypedefault) }}" + > @endsection diff --git a/resources/views/Player/player.blade.php b/resources/views/Player/player.blade.php index a3961b00..e5644928 100644 --- a/resources/views/Player/player.blade.php +++ b/resources/views/Player/player.blade.php @@ -10,7 +10,7 @@ :region="{{ json_encode($region) }}" :filters="{{ json_encode($filters) }}" :season="{{ json_encode($season) }}" - :gametype="{{ json_encode($game_type) }}" + :gametypedefault="{{ json_encode($gametypedefault) }}" :regionsmap="{{ json_encode($regions) }}" :is-patreon="{{ json_encode($patreon) }}" :patreon-user="{{ json_encode(session('patreonSubscriberAdFree')) }}" diff --git a/resources/views/Player/talentData.blade.php b/resources/views/Player/talentData.blade.php index a2a52f17..aa3d5ade 100644 --- a/resources/views/Player/talentData.blade.php +++ b/resources/views/Player/talentData.blade.php @@ -14,5 +14,7 @@ :regionsmap="{{ json_encode($regions) }}" :is-patreon="{{ json_encode($patreon) }}" :patreon-user="{{ json_encode(session('patreonSubscriberAdFree')) }}" + :gametypedefault="{{ json_encode($gametypedefault) }}" + > @endsection diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 4d1ac800..928f29fe 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -32,7 +32,7 @@ function gtag(){dataLayer.push(arguments);}
Site has not been styled for mobile yet.
Patreon subscribers please log in and link your Patreon account as we migrate to new site flair and ad-free infrastructure. - {{ session('headeralert') }} +