Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(service): show disabled deploy action when variables are missing

Andras Bacsai89a66dd25526
diff --git a/resources/views/livewire/project/service/heading.blade.php b/resources/views/livewire/project/service/heading.blade.php
index e7da50c809..79899e8795 100644
--- a/resources/views/livewire/project/service/heading.blade.php
+++ b/resources/views/livewire/project/service/heading.blade.php
@@ -188,6 +188,12 @@
</div>
@endcan
@else
+ @can('deploy', $service)
+ <button type="button" class="button mb-2 w-full justify-between" disabled>
+ <span>Deploy</span>
+ <span class="text-xs font-normal opacity-70">Fill required variables first</span>
+ </button>
+ @endcan
<a href="{{ $environmentVariablesUrl }}" {{ wireNavigate() }}
class="mb-3 inline-flex" aria-label="Open required environment variables">
<x-status-badge status="Required variables missing" type="error" />
diff --git a/tests/Feature/ResourceHeadingUnifiedNavbarTest.php b/tests/Feature/ResourceHeadingUnifiedNavbarTest.php
index 330afa7edf..ce69f26ef7 100644
--- a/tests/Feature/ResourceHeadingUnifiedNavbarTest.php
+++ b/tests/Feature/ResourceHeadingUnifiedNavbarTest.php
@@ -84,11 +84,19 @@ it('docks desktop resource actions in the top bar instead of floating over conte
it('links the service header missing variables warning to environment variables', function () {
$heading = file_get_contents(resource_path('views/livewire/project/service/heading.blade.php'));
+ $mobileActions = str($heading)
+ ->after('<div class="w-full xl:hidden">')
+ ->before("@teleport('#resource-action-hud-slot')")
+ ->toString();
expect($heading)
->toContain("route('project.service.environment-variables'")
->toContain('Required variables missing')
- ->toContain('href="{{ $environmentVariablesUrl }}"');
+ ->toContain('href="{{ $environmentVariablesUrl }}"')
+ ->and($mobileActions)
+ ->toContain('Fill required variables first')
+ ->toContain('disabled')
+ ->toContain('Deploy');
});
it('places the account menu beside the desktop sidebar toggle while retaining it on mobile', function () {