fix(service): show disabled deploy action when variables are missing
This commit is contained in:
parent
d0b77b2637
commit
89a66dd255
2 changed files with 15 additions and 1 deletions
|
|
@ -188,6 +188,12 @@ class="listbox-panel top-full! left-0! right-0! mt-1! w-full! min-w-0!" role="me
|
|||
</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" />
|
||||
|
|
|
|||
|
|
@ -84,11 +84,19 @@
|
|||
|
||||
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 () {
|
||||
|
|
|
|||
Loading…
Reference in a new issue