From 700165f6ed8d74015bddb56d4414af6d14c56d6c Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Tue, 1 Oct 2024 15:18:15 -0400 Subject: [PATCH 1/3] Always show addons (even if `dev-master`) in updates view. --- resources/views/updater/index.blade.php | 38 ++++++++++--------- .../CP/Updater/UpdaterController.php | 16 ++------ 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/resources/views/updater/index.blade.php b/resources/views/updater/index.blade.php index f25bf10f03..bd810906f6 100644 --- a/resources/views/updater/index.blade.php +++ b/resources/views/updater/index.blade.php @@ -44,24 +44,26 @@ class="btn-primary btn-lg">{{ __('Try again') }} -
{{ __('Addons') }}
-
- - @foreach ($addons as $addon) - - - @if ($count = $addon->changelog()->availableUpdatesCount()) - - @else - - @endif - - @endforeach -
{{ $addon -> name() }} - {{ $addon -> version() }}{{ trans_choice('1 update|:count updates', $count) }}{{ __('Up to date') }}
-
+ @if($addons->count()) +
{{ __('Addons') }}
+
+ + @foreach ($addons as $addon) + + + @if ($count = $addon->changelog()->availableUpdatesCount()) + + @else + + @endif + + @endforeach +
{{ $addon -> name() }} + {{ $addon -> version() }}{{ trans_choice('1 update|:count updates', $count) }}{{ __('Up to date') }}
+
+ @endif @if($unlistedAddons->count())
{{ __('Unlisted Addons') }}
diff --git a/src/Http/Controllers/CP/Updater/UpdaterController.php b/src/Http/Controllers/CP/Updater/UpdaterController.php index c907479f9e..2fbdba18bc 100644 --- a/src/Http/Controllers/CP/Updater/UpdaterController.php +++ b/src/Http/Controllers/CP/Updater/UpdaterController.php @@ -19,7 +19,7 @@ public function index(Licenses $licenses) { $this->authorize('view updates'); - $addons = $this->getUpdatableAddons(); + $addons = Addon::all(); if ($addons->isEmpty()) { return redirect()->route('statamic.cp.updater.product', Statamic::CORE_SLUG); @@ -28,8 +28,8 @@ public function index(Licenses $licenses) return view('statamic::updater.index', [ 'requestError' => $licenses->requestFailed(), 'statamic' => Marketplace::statamic()->changelog(), - 'addons' => Addon::all()->filter->existsOnMarketplace(), - 'unlistedAddons' => Addon::all()->reject->existsOnMarketplace(), + 'addons' => $addons->filter->existsOnMarketplace(), + 'unlistedAddons' => $addons->reject->existsOnMarketplace(), ]); } @@ -42,14 +42,4 @@ public function count(Request $request) return UpdatesOverview::count(); } - - /** - * Get updatable addons. - * - * @return \Illuminate\Support\Collection - */ - private function getUpdatableAddons() - { - return Addon::all()->filter->marketplaceSlug(); - } } From e2f8ad9e4debe1755ef78cda94f68b3fa7c37880 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Tue, 1 Oct 2024 15:21:38 -0400 Subject: [PATCH 2/3] =?UTF-8?q?Don=E2=80=99t=20show=20statamic/cms=20in=20?= =?UTF-8?q?updates=20badge=20if=20local=20or=20dev=20branch=20installed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Updater/UpdatesOverview.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Updater/UpdatesOverview.php b/src/Updater/UpdatesOverview.php index 10dd74809a..810b5a6716 100644 --- a/src/Updater/UpdatesOverview.php +++ b/src/Updater/UpdatesOverview.php @@ -6,6 +6,8 @@ use Facades\Statamic\Marketplace\Marketplace; use Illuminate\Support\Facades\Cache; use Statamic\Facades\Addon; +use Statamic\Statamic; +use Statamic\Support\Str; class UpdatesOverview { @@ -93,6 +95,12 @@ protected function resetState() */ protected function checkForStatamicUpdates() { + $version = Statamic::version(); + + if (Str::startsWith($version, 'dev-') || Str::endsWith($version, '-dev')) { + return $this; + } + if (Marketplace::statamic()->changelog()->latest()->type === 'upgrade') { $this->statamic = true; $this->count++; From 1382f4a77fb598fbc446c2738ec9a4f9613976ba Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Tue, 1 Oct 2024 15:21:47 -0400 Subject: [PATCH 3/3] =?UTF-8?q?Don=E2=80=99t=20show=20addons=20in=20update?= =?UTF-8?q?s=20badge=20if=20local=20or=20dev=20branch=20installed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Extend/Addon.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Extend/Addon.php b/src/Extend/Addon.php index d5592b5f24..1b44943bb7 100644 --- a/src/Extend/Addon.php +++ b/src/Extend/Addon.php @@ -371,6 +371,10 @@ public function changelog() public function isLatestVersion() { + if (Str::startsWith($this->version, 'dev-') || Str::endsWith($this->version, '-dev')) { + return true; + } + if (! $this->latestVersion) { return true; }