From 66ef1b755074019fe364e26a475292be28749f1f Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Sat, 6 Jan 2024 02:17:12 +0300 Subject: [PATCH] fix set statues form --- .../Resources/FormResource/Pages/ViewResponse.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Filament/Resources/FormResource/Pages/ViewResponse.php b/src/Filament/Resources/FormResource/Pages/ViewResponse.php index 017baf19..bc0d6c1f 100644 --- a/src/Filament/Resources/FormResource/Pages/ViewResponse.php +++ b/src/Filament/Resources/FormResource/Pages/ViewResponse.php @@ -3,8 +3,11 @@ namespace LaraZeus\Bolt\Filament\Resources\FormResource\Pages; use Filament\Actions\Action; +use Filament\Forms\Components\Select; +use Filament\Forms\Components\Textarea; use Filament\Resources\Pages\ViewRecord; use Illuminate\Contracts\Support\Htmlable; +use LaraZeus\Bolt\BoltPlugin; use LaraZeus\Bolt\Filament\Resources\FormResource; use LaraZeus\Bolt\Models\Form; use LaraZeus\Bolt\Models\Response; @@ -39,6 +42,16 @@ protected function getHeaderActions(): array }) ->label(__('Set Status')) ->icon('heroicon-o-tag') + ->form([ + Select::make('status') + ->label(__('status')) + ->default(fn () => $this->response->status) + ->options(BoltPlugin::getModel('FormsStatus')::query()->pluck('label', 'key')) + ->required(), + Textarea::make('notes') + ->default(fn () => $this->response->notes) + ->label(__('Notes')), + ]) ->action(function (array $data): void { $this->response->status = $data['status']; $this->response->notes = $data['notes'];