refactor(ui): remove deploy confirmation modals (#11023)

This commit is contained in:
Andras Bacsai 2026-07-23 19:13:08 +02:00 committed by GitHub
commit 1fc294b908
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 101 additions and 183 deletions

View file

@ -4,28 +4,20 @@
</x-slot> </x-slot>
@if ($application->status === 'running') @if ($application->status === 'running')
@can('deploy', $application) @can('deploy', $application)
<x-modal-confirmation title="Confirm Application Force Deployment?" buttonTitle="Force deploy" <div class="dropdown-iteme" wire:click="force_deploy_without_cache">
submitAction="force_deploy_without_cache" :actions="[ <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"
'This application will be force deployed without build cache.', stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
]" :confirmWithText="false" :confirmWithPassword="false" <path stroke="none" d="M0 0h24v24H0z" fill="none" />
step2ButtonText="Confirm"> <path
<x-slot:content> d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />
<div class="dropdown-iteme"> <path
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5" d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />
<path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M3 3l18 18" />
<path </svg>
d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" /> Force deploy (without
<path cache)
d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" /> </div>
<path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />
<path d="M3 3l18 18" />
</svg>
Force deploy (without
cache)
</div>
</x-slot:content>
</x-modal-confirmation>
@else @else
<div class="dropdown-iteme" data-disabled> <div class="dropdown-iteme" data-disabled>
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5" <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"
@ -44,28 +36,20 @@
@endcan @endcan
@else @else
@can('deploy', $application) @can('deploy', $application)
<x-modal-confirmation title="Confirm Application Force Deployment?" buttonTitle="Force deploy" <div class="dropdown-item" wire:click="deploy(true)">
submitAction="deploy(true)" :actions="[ <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24" stroke-width="1.5"
'This application will be force deployed without build cache.', stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
]" :confirmWithText="false" :confirmWithPassword="false" <path stroke="none" d="M0 0h24v24H0z" fill="none" />
step2ButtonText="Confirm"> <path
<x-slot:content> d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />
<div class="dropdown-item"> <path
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24" stroke-width="1.5" d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />
<path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M3 3l18 18" />
<path </svg>
d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" /> Force deploy (without
<path cache)
d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" /> </div>
<path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />
<path d="M3 3l18 18" />
</svg>
Force deploy (without
cache)
</div>
</x-slot:content>
</x-modal-confirmation>
@else @else
<div class="dropdown-item" data-disabled> <div class="dropdown-item" data-disabled>
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24" stroke-width="1.5" <svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 24 24" stroke-width="1.5"

View file

@ -17,7 +17,7 @@
Pull Latest Images & Restart Pull Latest Images & Restart
</div> </div>
@elseif (str($service->status)->contains('degraded')) @elseif (str($service->status)->contains('degraded'))
<div class="dropdown-item" @if(!auth()->user()->can('deploy', $service)) data-disabled @endif @click="document.getElementById('service-forceDeploy-trigger')?.click()"> <div class="dropdown-item" @if(!auth()->user()->can('deploy', $service)) data-disabled @endif @click="$wire.dispatch('forceDeployEvent')">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-linecap="round" stroke-linejoin="round" data-darkreader-inline-stroke="" stroke-linecap="round" stroke-linejoin="round" data-darkreader-inline-stroke=""
style="--darkreader-inline-stroke: currentColor;" class="w-6 h-6" stroke-width="2"> style="--darkreader-inline-stroke: currentColor;" class="w-6 h-6" stroke-width="2">
@ -27,7 +27,7 @@
Force Restart Force Restart
</div> </div>
@else @else
<div class="dropdown-item" @if(!auth()->user()->can('deploy', $service)) data-disabled @endif @click="document.getElementById('service-forceDeploy-trigger')?.click()"> <div class="dropdown-item" @if(!auth()->user()->can('deploy', $service)) data-disabled @endif @click="$wire.dispatch('forceDeployEvent')">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-linecap="round" stroke-linejoin="round" data-darkreader-inline-stroke="" stroke-linecap="round" stroke-linejoin="round" data-darkreader-inline-stroke=""
style="--darkreader-inline-stroke: currentColor;" class="w-4 h-4" stroke-width="2"> style="--darkreader-inline-stroke: currentColor;" class="w-4 h-4" stroke-width="2">

View file

@ -177,8 +177,7 @@
<div class="flex flex-nowrap items-center gap-2 overflow-x-auto"> <div class="flex flex-nowrap items-center gap-2 overflow-x-auto">
@if (!str($application->status)->startsWith('exited')) @if (!str($application->status)->startsWith('exited'))
@if (!$application->destination->server->isSwarm()) @if (!$application->destination->server->isSwarm())
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0" wire:click="deploy">
@click="document.getElementById('application-mobile-deploy-trigger')?.click()">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-orange-400" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-orange-400"
viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round"> stroke-linecap="round" stroke-linejoin="round">
@ -193,8 +192,7 @@
@endif @endif
@if ($application->build_pack !== 'dockercompose') @if ($application->build_pack !== 'dockercompose')
@if ($application->destination->server->isSwarm()) @if ($application->destination->server->isSwarm())
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0" wire:click="deploy">
@click="document.getElementById('application-mobile-deploy-trigger')?.click()">
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"> xmlns="http://www.w3.org/2000/svg">
<g fill="none" stroke="currentColor" stroke-linecap="round" <g fill="none" stroke="currentColor" stroke-linecap="round"
@ -238,8 +236,7 @@
Stop Stop
</x-forms.button> </x-forms.button>
@else @else
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0" wire:click="deploy">
@click="document.getElementById('application-mobile-deploy-trigger')?.click()">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round"> stroke-linecap="round" stroke-linejoin="round">
@ -251,8 +248,7 @@
@endif @endif
@if (!$application->destination->server->isSwarm()) @if (!$application->destination->server->isSwarm())
@if ($application->status === 'running') @if ($application->status === 'running')
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0" wire:click="force_deploy_without_cache">
@click="document.getElementById('application-mobile-force-deploy-trigger')?.click()">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round"> stroke-linecap="round" stroke-linejoin="round">
@ -262,8 +258,7 @@
Force deploy (without cache) Force deploy (without cache)
</button> </button>
@else @else
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0" wire:click="deploy(true)">
@click="document.getElementById('application-mobile-deploy-force-trigger')?.click()">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round"> stroke-linecap="round" stroke-linejoin="round">
@ -404,15 +399,6 @@
<button id="application-mobile-stop-trigger" type="button" class="hidden">Stop</button> <button id="application-mobile-stop-trigger" type="button" class="hidden">Stop</button>
</x-slot:trigger> </x-slot:trigger>
</x-modal-confirmation> </x-modal-confirmation>
<x-modal-confirmation title="Confirm Application Deployment?" buttonTitle="Deploy"
submitAction="deploy" :actions="[
'This application will be deployed.',
]" :confirmWithText="false" :confirmWithPassword="false"
step2ButtonText="Confirm">
<x-slot:trigger>
<button id="application-mobile-deploy-trigger" type="button" class="hidden">Deploy</button>
</x-slot:trigger>
</x-modal-confirmation>
<x-modal-confirmation title="Confirm Application Restart?" buttonTitle="Restart" <x-modal-confirmation title="Confirm Application Restart?" buttonTitle="Restart"
submitAction="restart" :actions="[ submitAction="restart" :actions="[
'This application will be restarted without rebuilding.', 'This application will be restarted without rebuilding.',
@ -422,24 +408,6 @@
<button id="application-mobile-restart-trigger" type="button" class="hidden">Restart</button> <button id="application-mobile-restart-trigger" type="button" class="hidden">Restart</button>
</x-slot:trigger> </x-slot:trigger>
</x-modal-confirmation> </x-modal-confirmation>
<x-modal-confirmation title="Confirm Application Force Deployment?" buttonTitle="Force deploy"
submitAction="force_deploy_without_cache" :actions="[
'This application will be force deployed without build cache.',
]" :confirmWithText="false" :confirmWithPassword="false"
step2ButtonText="Confirm">
<x-slot:trigger>
<button id="application-mobile-force-deploy-trigger" type="button" class="hidden">Force deploy</button>
</x-slot:trigger>
</x-modal-confirmation>
<x-modal-confirmation title="Confirm Application Force Deployment?" buttonTitle="Force deploy"
submitAction="deploy(true)" :actions="[
'This application will be force deployed without build cache.',
]" :confirmWithText="false" :confirmWithPassword="false"
step2ButtonText="Confirm">
<x-slot:trigger>
<button id="application-mobile-deploy-force-trigger" type="button" class="hidden">Force deploy</button>
</x-slot:trigger>
</x-modal-confirmation>
</div> </div>
<nav <nav
@ -492,50 +460,33 @@ class="scrollbar hidden min-h-10 w-full flex-nowrap items-center gap-6 overflow-
<div class="flex flex-wrap gap-2"> <div class="flex flex-wrap gap-2">
@if (!str($application->status)->startsWith('exited')) @if (!str($application->status)->startsWith('exited'))
@if (!$application->destination->server->isSwarm()) @if (!$application->destination->server->isSwarm())
<x-forms.button canGate="deploy" :canResource="$application" title="With rolling update if possible" wire:click="deploy">
<x-modal-confirmation title="Confirm Application Deployment?" buttonTitle="Redeploy" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-orange-400"
submitAction="deploy" :actions="[ viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
'This application will be redeployed.', stroke-linecap="round" stroke-linejoin="round">
]" :confirmWithText="false" :confirmWithPassword="false" <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
step2ButtonText="Confirm"> <path
<x-slot:content> d="M10.09 4.01l.496 -.495a2 2 0 0 1 2.828 0l7.071 7.07a2 2 0 0 1 0 2.83l-7.07 7.07a2 2 0 0 1 -2.83 0l-7.07 -7.07a2 2 0 0 1 0 -2.83l3.535 -3.535h-3.988">
<x-forms.button canGate="deploy" :canResource="$application" title="With rolling update if possible"> </path>
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-orange-400" <path d="M7.05 11.038v-3.988"></path>
viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" </svg>
stroke-linecap="round" stroke-linejoin="round"> Redeploy
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path> </x-forms.button>
<path
d="M10.09 4.01l.496 -.495a2 2 0 0 1 2.828 0l7.071 7.07a2 2 0 0 1 0 2.83l-7.07 7.07a2 2 0 0 1 -2.83 0l-7.07 -7.07a2 2 0 0 1 0 -2.83l3.535 -3.535h-3.988">
</path>
<path d="M7.05 11.038v-3.988"></path>
</svg>
Redeploy
</x-forms.button>
</x-slot:content>
</x-modal-confirmation>
@endif @endif
@if ($application->build_pack !== 'dockercompose') @if ($application->build_pack !== 'dockercompose')
@if ($application->destination->server->isSwarm()) @if ($application->destination->server->isSwarm())
<x-modal-confirmation title="Confirm Application Deployment?" buttonTitle="Update Service" <x-forms.button canGate="deploy" :canResource="$application" title="Redeploy Swarm Service (rolling update)" wire:click="deploy">
submitAction="deploy" :actions="[ <svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
'This Swarm service will be updated with a rolling deployment.', xmlns="http://www.w3.org/2000/svg">
]" :confirmWithText="false" :confirmWithPassword="false" <g fill="none" stroke="currentColor" stroke-linecap="round"
step2ButtonText="Confirm"> stroke-linejoin="round" stroke-width="2">
<x-slot:content> <path
<x-forms.button canGate="deploy" :canResource="$application" title="Redeploy Swarm Service (rolling update)"> d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <path d="M20 4v5h-5" />
xmlns="http://www.w3.org/2000/svg"> </g>
<g fill="none" stroke="currentColor" stroke-linecap="round" </svg>
stroke-linejoin="round" stroke-width="2"> Update Service
<path </x-forms.button>
d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
<path d="M20 4v5h-5" />
</g>
</svg>
Update Service
</x-forms.button>
</x-slot:content>
</x-modal-confirmation>
@else @else
<x-modal-confirmation title="Confirm Application Restart?" buttonTitle="Restart" <x-modal-confirmation title="Confirm Application Restart?" buttonTitle="Restart"
submitAction="restart" :actions="[ submitAction="restart" :actions="[
@ -582,25 +533,15 @@ class="scrollbar hidden min-h-10 w-full flex-nowrap items-center gap-6 overflow-
</x-slot:button-title> </x-slot:button-title>
</x-modal-confirmation> </x-modal-confirmation>
@else @else
<x-forms.button canGate="deploy" :canResource="$application" wire:click="deploy">
<x-modal-confirmation title="Confirm Application Deployment?" buttonTitle="Deploy" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning"
submitAction="deploy" :actions="[ viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
'This application will be deployed.', stroke-linecap="round" stroke-linejoin="round">
]" :confirmWithText="false" :confirmWithPassword="false" <path stroke="none" d="M0 0h24v24H0z" fill="none" />
step2ButtonText="Confirm"> <path d="M7 4v16l13 -8z" />
<x-slot:content> </svg>
<x-forms.button canGate="deploy" :canResource="$application"> Deploy
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" </x-forms.button>
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M7 4v16l13 -8z" />
</svg>
Deploy
</x-forms.button>
</x-slot:content>
</x-modal-confirmation>
@endif @endif
</div> </div>
</div> </div>

View file

@ -108,7 +108,7 @@
</x-forms.button> </x-forms.button>
@else @else
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0"
@click="document.getElementById('database-start-trigger')?.click()"> @click="$wire.dispatch('startEvent')">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round">
@ -234,7 +234,7 @@ class="scrollbar hidden min-h-10 w-full flex-nowrap items-center gap-6 overflow-
Stop Stop
</x-forms.button> </x-forms.button>
@else @else
<x-forms.button canGate="manage" :canResource="$database" @click="document.getElementById('database-start-trigger')?.click()" class="gap-2"> <x-forms.button canGate="manage" :canResource="$database" @click="$wire.dispatch('startEvent')" class="gap-2">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
@ -286,15 +286,6 @@ class="scrollbar hidden min-h-10 w-full flex-nowrap items-center gap-6 overflow-
<button id="database-stop-trigger" type="button" class="hidden">Stop</button> <button id="database-stop-trigger" type="button" class="hidden">Stop</button>
</x-slot:trigger> </x-slot:trigger>
</x-modal-confirmation> </x-modal-confirmation>
<x-modal-confirmation title="Confirm Database Start?" buttonTitle="Start" submitAction="startEvent"
:actions="[
'This database will be started.',
]" :confirmWithText="false" :confirmWithPassword="false" step2ButtonText="Start Database"
:dispatchAction="true">
<x-slot:trigger>
<button id="database-start-trigger" type="button" class="hidden">Start</button>
</x-slot:trigger>
</x-modal-confirmation>
@endif @endif
</nav> </nav>

View file

@ -168,7 +168,7 @@
Stop Stop
</x-forms.button> </x-forms.button>
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0"
@click="document.getElementById('service-forceDeploy-trigger')?.click()"> @click="$wire.dispatch('forceDeployEvent')">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round">
@ -179,7 +179,7 @@
</button> </button>
@elseif (str($service->status)->contains('exited')) @elseif (str($service->status)->contains('exited'))
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0"
@click="document.getElementById('service-start-trigger')?.click()"> @click="$wire.dispatch('startEvent')">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round">
@ -189,7 +189,7 @@
Deploy Deploy
</button> </button>
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0"
@click="document.getElementById('service-forceDeploy-trigger')?.click()"> @click="$wire.dispatch('forceDeployEvent')">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round">
@ -228,7 +228,7 @@
Stop Stop
</x-forms.button> </x-forms.button>
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0"
@click="document.getElementById('service-start-trigger')?.click()"> @click="$wire.dispatch('startEvent')">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round">
@ -238,7 +238,7 @@
Deploy Deploy
</button> </button>
<button type="button" class="button shrink-0" <button type="button" class="button shrink-0"
@click="document.getElementById('service-forceDeploy-trigger')?.click()"> @click="$wire.dispatch('forceDeployEvent')">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round">
@ -422,7 +422,7 @@ class="scrollbar hidden min-h-10 w-full flex-nowrap items-center gap-6 overflow-
Stop Stop
</x-forms.button> </x-forms.button>
@elseif (str($service->status)->contains('exited')) @elseif (str($service->status)->contains('exited'))
<x-forms.button canGate="deploy" :canResource="$service" @click="document.getElementById('service-start-trigger')?.click()" class="gap-2"> <x-forms.button canGate="deploy" :canResource="$service" @click="$wire.dispatch('startEvent')" class="gap-2">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
@ -447,7 +447,7 @@ class="scrollbar hidden min-h-10 w-full flex-nowrap items-center gap-6 overflow-
</svg> </svg>
Stop Stop
</x-forms.button> </x-forms.button>
<x-forms.button canGate="deploy" :canResource="$service" @click="document.getElementById('service-start-trigger')?.click()" class="gap-2"> <x-forms.button canGate="deploy" :canResource="$service" @click="$wire.dispatch('startEvent')" class="gap-2">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
@ -471,13 +471,6 @@ class="scrollbar hidden min-h-10 w-full flex-nowrap items-center gap-6 overflow-
@endif @endif
</div> </div>
@if ($service->isDeployable) @if ($service->isDeployable)
<x-modal-confirmation title="Confirm Service Deployment?" buttonTitle="Deploy"
submitAction="startEvent" :dispatchAction="true" :actions="['This service will be deployed.']"
:confirmWithText="false" :confirmWithPassword="false" step2ButtonText="Confirm">
<x-slot:trigger>
<button id="service-start-trigger" type="button" class="hidden">Deploy</button>
</x-slot:trigger>
</x-modal-confirmation>
<x-modal-confirmation title="Confirm Service Restart?" buttonTitle="Restart" <x-modal-confirmation title="Confirm Service Restart?" buttonTitle="Restart"
submitAction="restartEvent" :dispatchAction="true" :actions="['This service will be restarted.']" submitAction="restartEvent" :dispatchAction="true" :actions="['This service will be restarted.']"
:confirmWithText="false" :confirmWithPassword="false" step2ButtonText="Confirm"> :confirmWithText="false" :confirmWithPassword="false" step2ButtonText="Confirm">
@ -492,13 +485,6 @@ class="scrollbar hidden min-h-10 w-full flex-nowrap items-center gap-6 overflow-
<button id="service-stop-trigger" type="button" class="hidden">Stop</button> <button id="service-stop-trigger" type="button" class="hidden">Stop</button>
</x-slot:trigger> </x-slot:trigger>
</x-modal-confirmation> </x-modal-confirmation>
<x-modal-confirmation title="Confirm Service Force Deployment?" buttonTitle="Force Deploy"
submitAction="forceDeployEvent" :dispatchAction="true" :actions="['This service will be force deployed.']"
:confirmWithText="false" :confirmWithPassword="false" step2ButtonText="Confirm">
<x-slot:trigger>
<button id="service-forceDeploy-trigger" type="button" class="hidden">Force Deploy</button>
</x-slot:trigger>
</x-modal-confirmation>
<x-modal-confirmation title="Confirm Pull Latest Images & Restart?" buttonTitle="Pull Latest Images & Restart" <x-modal-confirmation title="Confirm Pull Latest Images & Restart?" buttonTitle="Pull Latest Images & Restart"
submitAction="pullAndRestartEvent" :dispatchAction="true" :actions="['Latest images will be pulled and the service will be restarted.']" submitAction="pullAndRestartEvent" :dispatchAction="true" :actions="['Latest images will be pulled and the service will be restarted.']"
:confirmWithText="false" :confirmWithPassword="false" step2ButtonText="Confirm"> :confirmWithText="false" :confirmWithPassword="false" step2ButtonText="Confirm">

View file

@ -19,9 +19,12 @@
->toContain("value.startsWith('location|')") ->toContain("value.startsWith('location|')")
->toContain('window.location.href = url') ->toContain('window.location.href = url')
->toContain('application-mobile-stop-trigger') ->toContain('application-mobile-stop-trigger')
->toContain('application-mobile-deploy-trigger')
->toContain('application-mobile-restart-trigger') ->toContain('application-mobile-restart-trigger')
->toContain('application-mobile-force-deploy-trigger') ->toContain('wire:click="deploy"')
->toContain('wire:click="force_deploy_without_cache"')
->not->toContain('application-mobile-deploy-trigger')
->not->toContain('application-mobile-force-deploy-trigger')
->not->toContain('Confirm Application Deployment?')
->not->toContain('<optgroup label="Actions">'); ->not->toContain('<optgroup label="Actions">');
expect($applicationMobileActions) expect($applicationMobileActions)
@ -51,7 +54,9 @@
->toContain('x-model="selected"') ->toContain('x-model="selected"')
->toContain('database-restart-trigger') ->toContain('database-restart-trigger')
->toContain('database-stop-trigger') ->toContain('database-stop-trigger')
->toContain('database-start-trigger') ->toContain("\$wire.dispatch('startEvent')")
->not->toContain('database-start-trigger')
->not->toContain('Confirm Database Start?')
->toContain('scrollbar hidden min-h-10') ->toContain('scrollbar hidden min-h-10')
->not->toContain('<optgroup label="Links">') ->not->toContain('<optgroup label="Links">')
->not->toContain('<optgroup label="Actions">') ->not->toContain('<optgroup label="Actions">')
@ -86,8 +91,13 @@
->toContain('x-model="selected"') ->toContain('x-model="selected"')
->toContain('service-restart-trigger') ->toContain('service-restart-trigger')
->toContain('service-stop-trigger') ->toContain('service-stop-trigger')
->toContain('service-forceDeploy-trigger') ->toContain("\$wire.dispatch('startEvent')")
->toContain("\$wire.dispatch('forceDeployEvent')")
->toContain('service-pullAndRestart-trigger') ->toContain('service-pullAndRestart-trigger')
->not->toContain('service-start-trigger')
->not->toContain('service-forceDeploy-trigger')
->not->toContain('Confirm Service Deployment?')
->not->toContain('Confirm Service Force Deployment?')
->toContain('scrollbar hidden min-h-10') ->toContain('scrollbar hidden min-h-10')
->toContain('mb-4 w-full md:mb-0 md:hidden') ->toContain('mb-4 w-full md:mb-0 md:hidden')
->toContain('hidden flex-wrap items-center gap-2 md:flex') ->toContain('hidden flex-wrap items-center gap-2 md:flex')

View file

@ -98,12 +98,18 @@
$response->assertSee('value="navigate|configuration|', false); $response->assertSee('value="navigate|configuration|', false);
$response->assertSee('window.Livewire?.navigate ? window.Livewire.navigate(url) : window.location.href = url', false); $response->assertSee('window.Livewire?.navigate ? window.Livewire.navigate(url) : window.location.href = url', false);
$response->assertSee('application-mobile-stop-trigger'); $response->assertSee('application-mobile-stop-trigger');
$response->assertSee('application-mobile-deploy-trigger');
$response->assertSee('application-mobile-restart-trigger'); $response->assertSee('application-mobile-restart-trigger');
$response->assertSee('application-mobile-force-deploy-trigger'); $response->assertSee('wire:click="deploy"', false);
$response->assertSee('Confirm Application Deployment?'); $response->assertSee('Force deploy (without cache)');
expect(
str_contains($response->getContent(), 'wire:click="force_deploy_without_cache"')
|| str_contains($response->getContent(), 'wire:click="deploy(true)"')
)->toBeTrue();
$response->assertDontSee('Confirm Application Deployment?');
$response->assertSee('Confirm Application Restart?'); $response->assertSee('Confirm Application Restart?');
$response->assertSee('Confirm Application Force Deployment?'); $response->assertDontSee('Confirm Application Force Deployment?');
$response->assertDontSee('application-mobile-deploy-trigger');
$response->assertDontSee('application-mobile-force-deploy-trigger');
$response->assertSee('sub-menu-wrapper hidden md:flex', false); $response->assertSee('sub-menu-wrapper hidden md:flex', false);
$response->assertSee('scrollbar hidden min-h-10', false); $response->assertSee('scrollbar hidden min-h-10', false);
$response->assertSee(route('project.application.deployment.index', [ $response->assertSee(route('project.application.deployment.index', [