Show the SealShare version and links on the admin dashboard
A quiet line under the shares card reads "SealShare 2.1.0 · Release notes · Website · Made by noNameWEB": the release notes link goes to the installed version's Gitea release, the others to sealshare.nonameweb.ch and nonameweb.ch, each in a new tab. It is page chrome, not content, so it is a footer line rather than a card. The image has neither .git nor CHANGELOG.md, so the version is a constant in config/app.php, bumped with each release. AppVersionTest fails while it differs from the newest released heading in CHANGELOG.md, so a forgotten bump stops CI before the tag's image is built. CHANGELOG (Unreleased) notes it. The dashboard screenshots are unchanged: the line sits below their fold. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
5d9e72fd06
commit
82eeacea28
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- The admin dashboard shows the installed SealShare version, with links to its release notes, the SealShare website and noNameWEB.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Docker installs updated from 2.0 answered every upload with "409 Conflict". The example `docker-compose.yml` mounted the SQLite volume over all of `/app/database`, which hid the image's new migration, so it never ran. The container now adds the migrations the volume is missing before migrating, so existing compose files keep working.
|
||||
|
||||
@@ -77,6 +77,7 @@ class AdminDashboard extends Component
|
||||
'totalFiles' => ShareFile::query()->whereHas('share', fn ($query) => $query->whereNotNull('completed_at'))->count(),
|
||||
'usedSpace' => $shareService->getTotalUsedSpace(),
|
||||
'maxQuota' => $shareService->getMaxStorageQuota(),
|
||||
'version' => config('app.version'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,19 @@ return [
|
||||
|
||||
'name' => env('APP_NAME', 'SealShare'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SealShare Version
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The release this code is, shown on the admin dashboard. Bump it together
|
||||
| with the release's heading in CHANGELOG.md: tests/Feature/AppVersionTest
|
||||
| fails while the two differ.
|
||||
|
|
||||
*/
|
||||
|
||||
'version' => '2.1.0',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Environment
|
||||
|
||||
@@ -63,6 +63,14 @@
|
||||
</x-stack>
|
||||
</x-card>
|
||||
|
||||
{{-- Page chrome, not content, so a quiet line instead of a card: the installed version, its release notes and who makes SealShare. --}}
|
||||
<footer class="md-type-body-sm md-ink-variant md-text-center" data-test="dashboard-about">
|
||||
SealShare {{ $version }}
|
||||
· <a href="https://gitea.nonameweb.ch/noNameWEB/SealShare/releases/tag/v{{ $version }}" target="_blank" rel="noopener" class="md-link md-ink-primary">{{ __('Release notes') }}</a>
|
||||
· <a href="https://sealshare.nonameweb.ch" target="_blank" rel="noopener" class="md-link md-ink-primary">{{ __('Website') }}</a>
|
||||
· {{ __('Made by') }} <a href="https://nonameweb.ch" target="_blank" rel="noopener" class="md-link md-ink-primary">noNameWEB</a>
|
||||
</footer>
|
||||
|
||||
<x-modal wire:model="deletingShareId" :title="__('Delete this share?')" icon="delete">
|
||||
{{ __('Are you sure you want to delete this share?') }}
|
||||
|
||||
|
||||
@@ -44,6 +44,18 @@ test('admin dashboard shows stats', function () {
|
||||
$response->assertSee('Disk Usage');
|
||||
});
|
||||
|
||||
test('admin dashboard shows the installed version with its release notes and links to the website and noNameWEB', function () {
|
||||
$admin = User::query()->where('is_admin', true)->first();
|
||||
config(['app.version' => '9.8.7']);
|
||||
|
||||
$response = $this->actingAs($admin)->get(route('admin.dashboard'));
|
||||
|
||||
$response->assertSee('SealShare 9.8.7');
|
||||
$response->assertSee('href="https://gitea.nonameweb.ch/noNameWEB/SealShare/releases/tag/v9.8.7"', false);
|
||||
$response->assertSee('href="https://sealshare.nonameweb.ch"', false);
|
||||
$response->assertSee('href="https://nonameweb.ch"', false);
|
||||
});
|
||||
|
||||
test('admin can delete share', function () {
|
||||
Storage::fake('shares');
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* The admin dashboard shows config('app.version'), which is bumped by hand with each release. The
|
||||
* changelog's newest released heading is the release, so the two must agree before a tag is built.
|
||||
*/
|
||||
|
||||
test('the version is the newest release in the changelog', function () {
|
||||
preg_match('/^## \[(\d+\.\d+\.\d+)\]/m', file_get_contents(base_path('CHANGELOG.md')), $release);
|
||||
|
||||
expect(config('app.version'))->toBe($release[1]);
|
||||
});
|
||||
Reference in New Issue
Block a user