From c6a12d7078768496cca3c8860e3862f455d43ec1 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 15 Aug 2026 23:15:31 +0200 Subject: [PATCH] feat(shared-variables): display project icons in project views Add project icon images with fallback icons and cache-busting URLs, plus coverage for both shared-variable views. --- .../shared-variables/project/index.blade.php | 15 +++++++++++++-- tests/Feature/ProjectIconTest.php | 17 +++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/resources/views/livewire/shared-variables/project/index.blade.php b/resources/views/livewire/shared-variables/project/index.blade.php index 802dfe371..eb394ae83 100644 --- a/resources/views/livewire/shared-variables/project/index.blade.php +++ b/resources/views/livewire/shared-variables/project/index.blade.php @@ -23,7 +23,13 @@ href="{{ route('shared-variables.project.show', ['project_uuid' => $project->uuid]) }}" {{ wireNavigate() }}>
- + @if ($project->icon_path) + {{ $project->name }} icon + @else + + @endif

{{ $project->name }}

@@ -42,7 +48,12 @@ - + @if ($project->icon_path) + {{ $project->name }} icon + @else + + @endif
{{ $project->name }}
{{ $project->description ?: 'No description' }}
{{ $project->environment_variables()->count() }} {{ Str::plural('variable', $project->environment_variables()->count()) }}
diff --git a/tests/Feature/ProjectIconTest.php b/tests/Feature/ProjectIconTest.php index 6f5357c5c..3599c0b4b 100644 --- a/tests/Feature/ProjectIconTest.php +++ b/tests/Feature/ProjectIconTest.php @@ -3,6 +3,7 @@ use App\Livewire\Dashboard; use App\Livewire\Project\Edit; use App\Livewire\Project\Index; +use App\Livewire\SharedVariables\Project\Index as SharedVariablesProjectIndex; use App\Models\InstanceSettings; use App\Models\Project; use App\Models\Team; @@ -113,3 +114,19 @@ it('displays the project icon on the dashboard', function () { 'v' => $this->project->updated_at->timestamp, ]).'"'); }); + +it('displays the project icon in shared variables project views', function () { + $this->project->forceFill([ + 'icon_path' => "project-icons/{$this->project->uuid}/icon.jpg", + 'icon_storage_type' => 'local', + ])->save(); + + $iconUrl = route('project.icon', [ + 'project_uuid' => $this->project->uuid, + 'v' => $this->project->updated_at->timestamp, + ]); + + $component = Livewire::test(SharedVariablesProjectIndex::class); + + expect(substr_count($component->html(), 'src="'.$iconUrl.'"'))->toBe(2); +});