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 checkbox actions default display

ayntk-ai141752b9ad8a
diff --git a/resources/views/components/modal-confirmation.blade.php b/resources/views/components/modal-confirmation.blade.php
index eefb7d547c..71b5d370b8 100644
--- a/resources/views/components/modal-confirmation.blade.php
+++ b/resources/views/components/modal-confirmation.blade.php
@@ -17,7 +17,7 @@
<div x-data="{
modalOpen: false,
step: {{ !empty($checkboxes) ? 1 : 2 }},
- selectedActions: [],
+ selectedActions: @js(collect($checkboxes)->where('model', true)->pluck('id')->toArray()),
deleteText: '',
password: '',
checkboxActions: @js($checkboxActions),
@@ -96,11 +96,14 @@
<div class="px-2">Select the actions you want to perform:</div>
</div>
@foreach($checkboxes as $index => $checkbox)
- <x-forms.checkbox :id="$checkbox['id']" :wire:model="$checkbox['model']" :label="$checkbox['label']" x-on:change="$event.target.checked ? selectedActions.push('{{ $checkbox['id'] }}') : selectedActions = selectedActions.filter(a => a !== '{{ $checkbox['id'] }}')"></x-forms.checkbox>
+ <x-forms.checkbox
+ :id="$checkbox['id']"
+ :wire:model="$checkbox['model']"
+ :label="$checkbox['label']"
+ x-on:change="$event.target.checked ? (selectedActions.includes('{{ $checkbox['id'] }}') || selectedActions.push('{{ $checkbox['id'] }}')) : selectedActions = selectedActions.filter(a => a !== '{{ $checkbox['id'] }}')"
+ :checked="$checkbox['model']"
+ ></x-forms.checkbox>
@endforeach
- {{-- <x-forms.button isError x-show="step === 1" @click="step = 2; selectedActions = Object.keys(checkboxActions).filter(action => $wire[action])" type="button">
- Continue
- </x-forms.button> --}}
</div>
@else
<div x-init="step = 2"></div>
diff --git a/resources/views/livewire/project/shared/danger.blade.php b/resources/views/livewire/project/shared/danger.blade.php
index c9bbc2ed01..722d75c996 100644
--- a/resources/views/livewire/project/shared/danger.blade.php
+++ b/resources/views/livewire/project/shared/danger.blade.php
@@ -16,10 +16,10 @@
['id' => 'docker_cleanup', 'model' => 'docker_cleanup', 'label' => 'Run Docker cleanup (remove builder cache and unused images)?']
]"
:checkboxActions="[
- 'delete_volumes' => $delete_volumes ? 'All associated volumes of this resource will be deleted.' : null,
- 'delete_connected_networks' => $delete_connected_networks ? 'All connected networks of this resource will be deleted (predefined networks are not deleted).' : null,
- 'delete_configurations' => $delete_configurations ? 'All configuration files of this resource will be deleted on the server.' : null,
- 'docker_cleanup' => $docker_cleanup ? 'Docker cleanup will be executed which removes builder cache and unused images.' : null
+ 'delete_volumes' => 'All associated volumes of this resource will be deleted.',
+ 'delete_connected_networks' => 'All connected networks of this resource will be deleted (predefined networks are not deleted).',
+ 'delete_configurations' => 'All configuration files of this resource will be deleted on the server.',
+ 'docker_cleanup' => 'Docker cleanup will be executed which removes builder cache and unused images.'
]"
>
This resource will be deleted. It is not reversible. <strong class="text-error">Please think again.</strong><br><br>