migrating tests (Metrics, NotificationChannels, PHP, Profile and Projects)

This commit is contained in:
Saeed Vaziry
2024-10-10 23:24:07 +02:00
parent 93cee92568
commit 7086e84c3c
16 changed files with 292 additions and 212 deletions

View File

@ -9,7 +9,7 @@
use App\Web\Pages\Settings\Projects\Widgets\ProjectUsersList;
use App\Web\Pages\Settings\Projects\Widgets\UpdateProject;
use Exception;
use Filament\Actions\DeleteAction;
use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Illuminate\Contracts\Support\Htmlable;
@ -54,17 +54,24 @@ public function getTitle(): string|Htmlable
protected function getHeaderActions(): array
{
return [
DeleteAction::make()
Action::make('delete')
->record($this->project)
->color('danger')
->label('Delete Project')
->icon('heroicon-o-trash')
->modalHeading('Delete Project')
->modalDescription('Are you sure you want to delete this project? This action will delete all associated data and cannot be undone.')
->using(function (Project $record) {
->requiresConfirmation()
->action(function (Project $record) {
try {
app(DeleteProject::class)->delete(auth()->user(), $record);
$this->redirectRoute(Index::getUrl());
Notification::make()
->success()
->title('Project deleted successfully.')
->send();
$this->redirect(Index::getUrl());
} catch (Exception $e) {
Notification::make()
->title($e->getMessage())