From dab9a7f3552581210fe8aec36b82faa5c8567b70 Mon Sep 17 00:00:00 2001 From: Wes Copeland Date: Fri, 24 Nov 2023 19:16:20 -0500 Subject: [PATCH] chore: remove FEATURE_BEAT flag --- .env.example | 3 +- app/Helpers/render/game.php | 2 +- app/Helpers/render/user.php | 4 +- app/Platform/Components/GameCard.php | 5 +- .../BeatenGamesLeaderboardController.php | 4 -- .../PlayerCompletionProgressController.php | 4 -- config/envy.php | 2 +- config/feature.php | 11 ++-- public/gameInfo.php | 2 +- public/userInfo.php | 3 +- .../global-statistics.blade.php | 20 +++----- .../views/components/feature-flags.blade.php | 9 ---- .../views/components/menu/account.blade.php | 5 +- .../views/components/menu/main.blade.php | 4 +- resources/views/content/top-links.blade.php | 10 ++-- .../achievements-list-item.blade.php | 50 +++++++++---------- .../big-status-label.blade.php | 32 ++++++------ 17 files changed, 65 insertions(+), 105 deletions(-) diff --git a/.env.example b/.env.example index b1cd6f22e3..988ec210fd 100644 --- a/.env.example +++ b/.env.example @@ -15,7 +15,8 @@ FORWARD_PHPMYADMIN_PORT=64080 # Feature Flags -FEATURE_BEAT=true +## example +#FEATURE_BEAT=true # Application diff --git a/app/Helpers/render/game.php b/app/Helpers/render/game.php index 955fc7462b..a4e8c4de31 100644 --- a/app/Helpers/render/game.php +++ b/app/Helpers/render/game.php @@ -183,7 +183,7 @@ function RenderGameSort( // } echo "Points$mark4 - "; echo "Title$mark5"; - if (config('feature.beat') && $canSortByType) { + if ($canSortByType) { echo " - "; echo "Type$mark6"; } diff --git a/app/Helpers/render/user.php b/app/Helpers/render/user.php index d10e2f0d1e..aa7b1c4779 100644 --- a/app/Helpers/render/user.php +++ b/app/Helpers/render/user.php @@ -96,9 +96,7 @@ function RenderCompletedGamesList( HTML; - if (config('feature.beat')) { - echo "more..."; - } + echo "more..."; echo ""; echo "
"; diff --git a/app/Platform/Components/GameCard.php b/app/Platform/Components/GameCard.php index bcf5dfa233..53900991f3 100644 --- a/app/Platform/Components/GameCard.php +++ b/app/Platform/Components/GameCard.php @@ -243,10 +243,7 @@ private function buildCardUserProgressionData(array $userGameProgressionAwards, $highestProgressionStatus = null; $highestProgressionAwardDate = null; - $progressionTypes = ['completed', 'mastered']; - if (config('feature.beat')) { - $progressionTypes = ['beaten-softcore', 'beaten-hardcore', 'completed', 'mastered']; - } + $progressionTypes = ['beaten-softcore', 'beaten-hardcore', 'completed', 'mastered']; foreach ($progressionTypes as $progressionType) { if (isset($userGameProgressionAwards[$progressionType])) { diff --git a/app/Platform/Controllers/BeatenGamesLeaderboardController.php b/app/Platform/Controllers/BeatenGamesLeaderboardController.php index 7c46b330ea..7994b29b06 100644 --- a/app/Platform/Controllers/BeatenGamesLeaderboardController.php +++ b/app/Platform/Controllers/BeatenGamesLeaderboardController.php @@ -22,10 +22,6 @@ class BeatenGamesLeaderboardController extends Controller public function __invoke(Request $request): View { - if (!config('feature.beat')) { - abort(404); - } - $validatedData = $request->validate([ 'page.number' => 'sometimes|integer|min:1', 'filter.system' => 'sometimes|integer', diff --git a/app/Platform/Controllers/PlayerCompletionProgressController.php b/app/Platform/Controllers/PlayerCompletionProgressController.php index 2695f398f3..58770fded1 100644 --- a/app/Platform/Controllers/PlayerCompletionProgressController.php +++ b/app/Platform/Controllers/PlayerCompletionProgressController.php @@ -22,10 +22,6 @@ public function __construct(protected PlayerProgressionService $playerProgressio public function __invoke(Request $request): View { - if (!config('feature.beat')) { - abort(404); - } - $targetUsername = $request->route()->parameters['user']; $validatedData = $request->validate([ 'page.number' => 'sometimes|integer|min:1', diff --git a/config/envy.php b/config/envy.php index 9e2c4dee9d..3383e9aa68 100644 --- a/config/envy.php +++ b/config/envy.php @@ -80,7 +80,7 @@ 'REDIS_CACHE_DB', 'MYSQL_ATTR_SSL_CA', // config/feature.php - 'FEATURE_BEAT', + // // config/filesystem.php 'AWS_ENDPOINT', 'AWS_URL', diff --git a/config/feature.php b/config/feature.php index 2b7d4c4d27..51cf47cc13 100644 --- a/config/feature.php +++ b/config/feature.php @@ -1,10 +1,9 @@ env('FEATURE_BEAT', false), - +/** + * EXAMPLE: + * // If true, player-facing beaten games UI/UX is enabled. + * 'beat' => env('FEATURE_BEAT', false), + */ ]; diff --git a/public/gameInfo.php b/public/gameInfo.php index 88a083efe7..f53083c620 100644 --- a/public/gameInfo.php +++ b/public/gameInfo.php @@ -833,7 +833,7 @@ function () { ', [ 'beatenGameCreditDialogContext' => $beatenGameCreditDialogContext, 'gameId' => $gameID, - 'isBeatable' => $isGameBeatable && config('feature.beat') === true, + 'isBeatable' => $isGameBeatable, 'isBeatenHardcore' => $isBeatenHardcore, 'isBeatenSoftcore' => $isBeatenSoftcore, 'isCompleted' => !is_null($userGameProgressionAwards['completed']), diff --git a/public/userInfo.php b/public/userInfo.php index 2023b1dcf2..e3c12cdab6 100644 --- a/public/userInfo.php +++ b/public/userInfo.php @@ -485,8 +485,7 @@ function resize() { } $canShowProgressionStatusComponent = - config('feature.beat') - && !empty($userCompletedGamesList) + !empty($userCompletedGamesList) // Needs at least one non-event game. && count(array_filter($userCompletedGamesList, fn ($game) => $game['ConsoleID'] != 101)) > 0; diff --git a/resources/views/community/components/global-statistics/global-statistics.blade.php b/resources/views/community/components/global-statistics/global-statistics.blade.php index 83fec3fda1..e3b218e522 100644 --- a/resources/views/community/components/global-statistics/global-statistics.blade.php +++ b/resources/views/community/components/global-statistics/global-statistics.blade.php @@ -6,10 +6,8 @@
- @hasfeature("beat") - - - @endhasfeature + +
@@ -31,14 +29,12 @@ :timestamp="$lastMasteredTimeAgo" /> - @hasfeature("beat") - - @endhasfeature +
@if ($lastRegisteredUser) diff --git a/resources/views/components/feature-flags.blade.php b/resources/views/components/feature-flags.blade.php index 660b0e2eb4..4812c75f06 100644 --- a/resources/views/components/feature-flags.blade.php +++ b/resources/views/components/feature-flags.blade.php @@ -19,15 +19,6 @@ function handleToggleCookie(cookieName) { } -
-

Beaten Games Player-facing UX

- @hasfeature("beat") - Enabled - @else - Disabled - @endhasfeature -
- {{-- EXAMPLE

Aggregate Queries

diff --git a/resources/views/components/menu/account.blade.php b/resources/views/components/menu/account.blade.php index c911055f3b..e506dc7af7 100644 --- a/resources/views/components/menu/account.blade.php +++ b/resources/views/components/menu/account.blade.php @@ -51,10 +51,7 @@ {{ $user->username }} {{ __res('profile', 1) }} - - @hasfeature("beat") - Completion Progress - @endhasfeature + Completion Progress @if($user->Permissions >= Permissions::Registered) Want to Play Games diff --git a/resources/views/components/menu/main.blade.php b/resources/views/components/menu/main.blade.php index 1cd82e1d74..45fe32d773 100644 --- a/resources/views/components/menu/main.blade.php +++ b/resources/views/components/menu/main.blade.php @@ -152,9 +152,7 @@ {{ __res('user') }} Global Points Ranking - @hasfeature("beat") - Global Beaten Games Ranking - @endhasfeature + Global Beaten Games Ranking Recent Game Awards Developer Stats diff --git a/resources/views/content/top-links.blade.php b/resources/views/content/top-links.blade.php index f7f8e202bc..f9ab59ef78 100644 --- a/resources/views/content/top-links.blade.php +++ b/resources/views/content/top-links.blade.php @@ -7,12 +7,10 @@ Global Points Ranking - @hasfeature("beat") - - - Global Beaten Games Ranking - - @endhasfeature + + + Global Beaten Games Ranking + @if(config('services.discord.invite_id')) diff --git a/resources/views/platform/components/game/achievements-list/achievements-list-item.blade.php b/resources/views/platform/components/game/achievements-list/achievements-list-item.blade.php index 43000962e1..65dc7436ae 100644 --- a/resources/views/platform/components/game/achievements-list/achievements-list-item.blade.php +++ b/resources/views/platform/components/game/achievements-list/achievements-list-item.blade.php @@ -67,21 +67,19 @@ @endif
- @hasfeature("beat") - @if ($achievement['type'] && !$useMinimalLayout) -
-
- -
+ @if ($achievement['type'] && !$useMinimalLayout) +
+
+
- @endif - @endhasfeature +
+ @endif

@@ -106,19 +104,17 @@

- @hasfeature("beat") - @if ($achievement['type'] && !$useMinimalLayout) - - @endif - @endhasfeature + @if ($achievement['type'] && !$useMinimalLayout) + + @endif @if (!$useMinimalLayout)

{{ $statusLabel }}

- @hasfeature('beat') - @if (!$isBeaten && $isBeatable) - - - - - - @endif - @endhasfeature + @if (!$isBeaten && $isBeatable) + + + + + + @endif
\ No newline at end of file