feat(livewire): add selectedActions parameter and error handling to delete methods

- Add `$selectedActions = []` parameter to delete/remove methods in multiple
  Livewire components to support optional deletion actions
- Return error message string when password verification fails instead of
  silent return
- Return `true` on successful deletion to indicate completion
- Handle selectedActions to set component properties for cascading deletions
  (delete_volumes, delete_networks, delete_configurations, docker_cleanup)
- Add test coverage for Danger component delete functionality with password
  validation and selected actions handling
This commit is contained in:
Andras Bacsai committed 2026-03-11 15:04:45 +01:00
1 parent b926f23824
commit 8366e150b1
12 files changed
+130 -26

No files matched your search

@@ -31,7 +31,7 @@ class TerminalAccess extends Component
}
}
public function toggleTerminal($password)
public function toggleTerminal($password, $selectedActions = [])
{
try {
$this->authorize('update', $this->server);
@@ -43,7 +43,7 @@ class TerminalAccess extends Component
// Verify password
if (! verifyPasswordConfirmation($password, $this)) {
return;
return 'The provided password is incorrect.';
}
// Toggle the terminal setting
@@ -55,6 +55,8 @@ class TerminalAccess extends Component
$status = $this->isTerminalEnabled ? 'enabled' : 'disabled';
$this->dispatch('success', "Terminal access has been {$status}.");
return true;
} catch (\Throwable $e) {
return handleError($e, $this);
}