Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/js/components/updater/Updater.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div class="max-w-page mx-auto">
<ui-header :title="__('Updates')" icon="updates">
<ui-header :title="name" icon="updates">
<template v-if="!gettingChangelog" #actions>
<ui-badge :prepend="__('Statamic Version')" :text="currentVersion" color="green" size="lg" />
<ui-badge :prepend="__('Version')" :text="currentVersion" color="green" size="lg" />
<div v-if="onLatestVersion" v-text="__('Up to date')" />
</template>
</ui-header>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/updater/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defineProps(['slug', 'package', 'name']);

<template>
<div class="max-w-5xl 3xl:max-w-6xl mx-auto" data-max-width-wrapper>
<Head :title="__('Updates')" />
<Head :title="[name, __('Updates')]" />
<Updater :slug="slug" :package="package" :name="name" />
</div>
</template>
33 changes: 33 additions & 0 deletions src/Http/Controllers/CP/Updater/UpdateProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
use Facades\Statamic\Marketplace\Marketplace;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Statamic\CP\Breadcrumbs\Breadcrumb;
use Statamic\CP\Breadcrumbs\Breadcrumbs;
use Statamic\Facades\Addon;
use Statamic\Http\Controllers\CP\CpController;
use Statamic\Statamic;

class UpdateProductController extends CpController
{
Expand All @@ -22,6 +26,35 @@ public function show($marketplaceProductSlug)
return $this->pageNotFound();
}

$packageLinks = collect()
->push([
'text' => 'Statamic',
'icon' => 'updates',
'url' => cp_route('updater.product', Statamic::CORE_SLUG),
])
->merge(
Addon::all()
->filter->existsOnMarketplace()
->reject(fn ($addon) => $addon->marketplaceSlug() === $marketplaceProductSlug)
->map(fn ($addon) => [
'text' => $addon->name(),
'icon' => 'updates',
'url' => cp_route('updater.product', $addon->marketplaceSlug()),
])
)
->reject(fn ($link) => $link['url'] === request()->url())
->values()
->all();

if (! empty($packageLinks)) {
Breadcrumbs::push(new Breadcrumb(
text: $product->name(),
url: request()->url(),
icon: 'updates',
links: $packageLinks,
));
}

return Inertia::render('updater/Show', [
'slug' => $marketplaceProductSlug,
'package' => $product->package(),
Expand Down