refactor: Update confirmation button text for deletion actions

This commit is contained in:
Andras Bacsai
2024-09-23 08:58:04 +02:00
parent eb9bbf3eda
commit b84d39ba56
16 changed files with 115 additions and 240 deletions

View File

@@ -53,12 +53,12 @@
{{-- :checkboxes="$checkboxes" --}}
:actions="[
'This backup will be permanently deleted from local storage.'
]"
]"
confirmationText="{{ data_get($execution, 'filename') }}"
confirmationLabel="Please confirm the execution of the actions by entering the Backup Filename below"
shortConfirmationLabel="Backup Filename"
step3ButtonText="Permanently Delete Backup"
/>
step3ButtonText="Permanently Delete"
/>
</div>
</div>
@empty

View File

@@ -2,21 +2,13 @@
<div class="flex items-end gap-2">
<x-forms.input id="filename" label="Filename" />
<x-forms.button type="submit">Save</x-forms.button>
<x-modal-confirmation
title="Confirm init-script deletion?"
buttonTitle="Delete"
isErrorButton
submitAction="delete"
:actions="[
'The init-script of this database will be permanently deleted.',
'If you are actively using this init-script, it could cause errors on redeployment.'
]"
confirmationText="{{ $filename }}"
confirmationLabel="Please confirm the execution of the actions by entering the init-script name below"
shortConfirmationLabel="Init-script Name"
:confirmWithPassword=false
step2ButtonText="Permanently Delete Init-script"
/>
<x-modal-confirmation title="Confirm init-script deletion?" buttonTitle="Delete" isErrorButton
submitAction="delete" :actions="[
'The init-script of this database will be permanently deleted.',
'If you are actively using this init-script, it could cause errors on redeployment.',
]" confirmationText="{{ $filename }}"
confirmationLabel="Please confirm the execution of the actions by entering the init-script name below"
shortConfirmationLabel="Init-script Name" :confirmWithPassword=false step2ButtonText="Permanently Delete" />
</div>
<x-forms.textarea id="content" label="Content" />
</form>

View File

@@ -1,12 +1,5 @@
<x-modal-confirmation
title="Confirm Environment Deletion?"
buttonTitle="Delete Environment"
isErrorButton
submitAction="delete"
:actions="['This will delete the selected environment.']"
<x-modal-confirmation title="Confirm Environment Deletion?" buttonTitle="Delete Environment" isErrorButton
submitAction="delete" :actions="['This will delete the selected environment.']"
confirmationLabel="Please confirm the execution of the actions by entering the Environment Name below"
shortConfirmationLabel="Environment Name"
confirmationText="{{ $environmentName }}"
:confirmWithPassword="false"
step2ButtonText="Permanently Delete Environment"
/>
shortConfirmationLabel="Environment Name" confirmationText="{{ $environmentName }}" :confirmWithPassword="false"
step2ButtonText="Permanently Delete" />

View File

@@ -1,12 +1,7 @@
<x-modal-confirmation
title="Confirm Project Deletion?"
buttonTitle="Delete Project"
isErrorButton
submitAction="delete"
:actions="['This will delete the selected project', 'All Environments inside the project will be deleted as well.']"
confirmationLabel="Please confirm the execution of the actions by entering the Project Name below"
shortConfirmationLabel="Project Name"
confirmationText="{{ $projectName }}"
:confirmWithPassword="false"
step2ButtonText="Permanently Delete Project"
/>
<x-modal-confirmation title="Confirm Project Deletion?" buttonTitle="Delete Project" isErrorButton submitAction="delete"
:actions="[
'This will delete the selected project',
'All Environments inside the project will be deleted as well.',
]" confirmationLabel="Please confirm the execution of the actions by entering the Project Name below"
shortConfirmationLabel="Project Name" confirmationText="{{ $projectName }}" :confirmWithPassword="false"
step2ButtonText="Permanently Delete" />

View File

@@ -15,56 +15,32 @@
<form wire:submit='submit' class="flex flex-col gap-2">
<div class="flex gap-2">
@if ($fileStorage->is_directory)
<x-modal-confirmation
title="Confirm Directory Conversion to File?"
buttonTitle="Convert to file"
submitAction="convertToFile"
:actions="['All files in this directory will be permanently deleted and an empty file will be created in its place.']"
confirmationText="{{ $fs_path }}"
confirmationLabel="Please confirm the execution of the actions by entering the Filepath below"
shortConfirmationLabel="Filepath"
:confirmWithPassword="false"
step2ButtonText="Convert to file"
/>
<x-modal-confirmation title="Confirm Directory Conversion to File?" buttonTitle="Convert to file"
submitAction="convertToFile" :actions="[
'All files in this directory will be permanently deleted and an empty file will be created in its place.',
]" confirmationText="{{ $fs_path }}"
confirmationLabel="Please confirm the execution of the actions by entering the Filepath below"
shortConfirmationLabel="Filepath" :confirmWithPassword="false" step2ButtonText="Convert to file" />
@else
<x-modal-confirmation
title="Confirm File Conversion to Directory?"
buttonTitle="Convert to directory"
submitAction="convertToDirectory"
:actions="['The selected file will be permanently deleted and an empty directory will be created in its place.']"
confirmationText="{{ $fs_path }}"
confirmationLabel="Please confirm the execution of the actions by entering the Filepath below"
shortConfirmationLabel="Filepath"
:confirmWithPassword="false"
step2ButtonText="Convert to directory"
/>
<x-modal-confirmation title="Confirm File Conversion to Directory?" buttonTitle="Convert to directory"
submitAction="convertToDirectory" :actions="[
'The selected file will be permanently deleted and an empty directory will be created in its place.',
]" confirmationText="{{ $fs_path }}"
confirmationLabel="Please confirm the execution of the actions by entering the Filepath below"
shortConfirmationLabel="Filepath" :confirmWithPassword="false" step2ButtonText="Convert to directory" />
@endif
@if ($fileStorage->is_directory)
<x-modal-confirmation
title="Confirm Directory Deletion?"
buttonTitle="Delete Directory"
isErrorButton
submitAction="delete"
:checkboxes="$directoryDeletionCheckboxes"
:actions="['The selected directory and all its contents will be permanently deleted from the container.']"
confirmationText="{{ $fs_path }}"
<x-modal-confirmation title="Confirm Directory Deletion?" buttonTitle="Delete Directory" isErrorButton
submitAction="delete" :checkboxes="$directoryDeletionCheckboxes" :actions="[
'The selected directory and all its contents will be permanently deleted from the container.',
]" confirmationText="{{ $fs_path }}"
confirmationLabel="Please confirm the execution of the actions by entering the Filepath below"
shortConfirmationLabel="Filepath"
step3ButtonText="Permanently Delete Directory"
/>
shortConfirmationLabel="Filepath" step3ButtonText="Permanently Delete" />
@else
<x-modal-confirmation
title="Confirm File Deletion?"
buttonTitle="Delete File"
isErrorButton
submitAction="delete"
:checkboxes="$fileDeletionCheckboxes"
:actions="['The selected file will be permanently deleted from the container.']"
confirmationText="{{ $fs_path }}"
<x-modal-confirmation title="Confirm File Deletion?" buttonTitle="Delete File" isErrorButton
submitAction="delete" :checkboxes="$fileDeletionCheckboxes" :actions="['The selected file will be permanently deleted from the container.']" confirmationText="{{ $fs_path }}"
confirmationLabel="Please confirm the execution of the actions by entering the Filepath below"
shortConfirmationLabel="Filepath"
step3ButtonText="Permanently Delete File"
/>
shortConfirmationLabel="Filepath" step3ButtonText="Permanently Delete" />
@endif
@if (!$fileStorage->is_based_on_git)

View File

@@ -7,20 +7,11 @@
<h2>{{ Str::headline($application->name) }}</h2>
@endif
<x-forms.button type="submit">Save</x-forms.button>
<x-modal-confirmation
title="Confirm Service Application Deletion?"
buttonTitle="Delete"
isErrorButton
submitAction="delete"
{{-- :checkboxes="$checkboxes" --}}
:actions="[
'The selected service application container will be stopped and permanently deleted.'
]"
<x-modal-confirmation title="Confirm Service Application Deletion?" buttonTitle="Delete" isErrorButton
submitAction="delete" {{-- :checkboxes="$checkboxes" --}} :actions="['The selected service application container will be stopped and permanently deleted.']"
confirmationText="{{ Str::headline($application->name) }}"
confirmationLabel="Please confirm the execution of the actions by entering the Service Application Name below"
shortConfirmationLabel="Service Application Name"
step3ButtonText="Permanently Delete Service Application"
/>
shortConfirmationLabel="Service Application Name" step3ButtonText="Permanently Delete" />
</div>
<div class="flex flex-col gap-2">
<div class="flex gap-2">

View File

@@ -11,20 +11,11 @@
<path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0-2 0m-3-5V7a4 4 0 1 1 8 0v4" />
</g>
</svg>
<x-modal-confirmation
title="Confirm Environment Variable Deletion?"
isErrorButton
buttonTitle="Delete"
submitAction="delete"
:actions="[
'The selected environment variable will be permanently deleted.'
]"
confirmationText="{{ $env->key }}"
<x-modal-confirmation title="Confirm Environment Variable Deletion?" isErrorButton buttonTitle="Delete"
submitAction="delete" :actions="['The selected environment variable will be permanently deleted.']" confirmationText="{{ $env->key }}"
confirmationLabel="Please confirm the execution of the actions by entering the Environment Variable Name below"
shortConfirmationLabel="Environment Variable Name"
:confirmWithPassword="false"
step2ButtonText="Permanently Delete Environment Variable"
/>
shortConfirmationLabel="Environment Variable Name" :confirmWithPassword="false"
step2ButtonText="Permanently Delete" />
</div>
@else
@if ($isDisabled)
@@ -80,20 +71,12 @@
<x-forms.button wire:click='lock'>
Lock
</x-forms.button>
<x-modal-confirmation
title="Confirm Environment Variable Deletion?"
isErrorButton
buttonTitle="Delete"
submitAction="delete"
:actions="[
'The selected environment variable will be permanently deleted.'
]"
<x-modal-confirmation title="Confirm Environment Variable Deletion?" isErrorButton
buttonTitle="Delete" submitAction="delete" :actions="['The selected environment variable will be permanently deleted.']"
confirmationText="{{ $env->key }}"
confirmationLabel="Please confirm the execution of the actions by entering the Environment Variable Name below"
shortConfirmationLabel="Environment Variable Name"
:confirmWithPassword="false"
step2ButtonText="Permanently Delete Environment Variable"
/>
shortConfirmationLabel="Environment Variable Name" :confirmWithPassword="false"
step2ButtonText="Permanently Delete" />
@else
<x-forms.button type="submit">
Update
@@ -101,20 +84,12 @@
<x-forms.button wire:click='lock'>
Lock
</x-forms.button>
<x-modal-confirmation
title="Confirm Environment Variable Deletion?"
isErrorButton
buttonTitle="Delete"
submitAction="delete"
:actions="[
'The selected environment variable will be permanently deleted.'
]"
<x-modal-confirmation title="Confirm Environment Variable Deletion?" isErrorButton
buttonTitle="Delete" submitAction="delete" :actions="['The selected environment variable will be permanently deleted.']"
confirmationText="{{ $env->key }}"
confirmationLabel="Please confirm the execution of the actions by entering the Environment Variable Name below"
shortConfirmationLabel="Environment Variable Name"
:confirmWithPassword="false"
step2ButtonText="Permanently Delete Environment Variable"
/>
shortConfirmationLabel="Environment Variable Name" :confirmWithPassword="false"
step2ButtonText="Permanently Delete" />
@endif
</div>
@endif

View File

@@ -1,13 +1,13 @@
<div>
<x-slot:title>
{{ data_get_str($resource, 'name')->limit(10) }} > Scheduled Tasks | Coolify
</x-slot>
@if ($type === 'application')
</x-slot>
@if ($type === 'application')
<h1>Scheduled Task</h1>
<livewire:project.application.heading :application="$resource" />
@elseif ($type === 'service')
@elseif ($type === 'service')
<livewire:project.service.navbar :service="$resource" :parameters="$parameters" />
@endif
@endif
<form wire:submit="submit" class="w-full">
<div class="flex flex-col gap-2 pb-2">
@@ -16,18 +16,11 @@
<x-forms.button type="submit">
Save
</x-forms.button>
<x-modal-confirmation
title="Confirm Scheduled Task Deletion?"
isErrorButton
buttonTitle="Delete"
submitAction="delete({{ $task->id }})"
:actions="['The selected scheduled task will be permanently deleted.']"
confirmationText="{{ $task->name }}"
<x-modal-confirmation title="Confirm Scheduled Task Deletion?" isErrorButton buttonTitle="Delete"
submitAction="delete({{ $task->id }})" :actions="['The selected scheduled task will be permanently deleted.']" confirmationText="{{ $task->name }}"
confirmationLabel="Please confirm the execution of the actions by entering the Scheduled Task Name below"
shortConfirmationLabel="Scheduled Task Name"
:confirmWithPassword="false"
step2ButtonText="Permanently Delete Scheduled Task"
/>
shortConfirmationLabel="Scheduled Task Name" :confirmWithPassword="false"
step2ButtonText="Permanently Delete" />
</div>
<div class="flex w-full gap-2">
@@ -35,19 +28,20 @@
<x-forms.input placeholder="php artisan schedule:run" id="task.command" label="Command" required />
<x-forms.input placeholder="0 0 * * * or daily" id="task.frequency" label="Frequency" required />
@if ($type === 'application')
<x-forms.input placeholder="php"
helper="You can leave this empty if your resource only has one container." id="task.container"
label="Container name" />
<x-forms.input placeholder="php"
helper="You can leave this empty if your resource only has one container." id="task.container"
label="Container name" />
@elseif ($type === 'service')
<x-forms.input placeholder="php"
helper="You can leave this empty if your resource only has one service in your stack. Otherwise use the stack name, without the random generated ID. So if you have a mysql service in your stack, use mysql."
id="task.container" label="Service name" />
<x-forms.input placeholder="php"
helper="You can leave this empty if your resource only has one service in your stack. Otherwise use the stack name, without the random generated ID. So if you have a mysql service in your stack, use mysql."
id="task.container" label="Service name" />
@endif
</div>
</form>
</form>
<div class="pt-4">
<h3 class="py-4">Recent executions <span class="text-xs text-neutral-500">(click to check output)</span></h3>
<livewire:project.shared.scheduled-task.executions :task="$task" key="{{ $task->id }}" selectedKey="" :executions="$task->executions->take(20)" />
</div>
<div class="pt-4">
<h3 class="py-4">Recent executions <span class="text-xs text-neutral-500">(click to check output)</span></h3>
<livewire:project.shared.scheduled-task.executions :task="$task" key="{{ $task->id }}" selectedKey=""
:executions="$task->executions->take(20)" />
</div>
</div>

View File

@@ -46,17 +46,13 @@
<x-forms.button type="submit">
Update
</x-forms.button>
<x-modal-confirmation
title="Confirm persistent storage deletion?"
isErrorButton
buttonTitle="Delete"
submitAction="delete"
:actions="['The selected persistent storage/volume will be permanently deleted.', 'If the persistent storage/volume is actvily used by a resource data will be lost.']"
confirmationText="{{ $storage->name }}"
<x-modal-confirmation title="Confirm persistent storage deletion?" isErrorButton buttonTitle="Delete"
submitAction="delete" :actions="[
'The selected persistent storage/volume will be permanently deleted.',
'If the persistent storage/volume is actvily used by a resource data will be lost.',
]" confirmationText="{{ $storage->name }}"
confirmationLabel="Please confirm the execution of the actions by entering the Storage Name below"
shortConfirmationLabel="Storage Name"
step3ButtonText="Permanently Delete Persistent Storage/Volume"
/>
shortConfirmationLabel="Storage Name" step3ButtonText="Permanently Delete" />
</div>
@endif
</form>