Skip to content

Commit

Permalink
fix set statues form
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Jan 5, 2024
1 parent 2f19811 commit 66ef1b7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Filament/Resources/FormResource/Pages/ViewResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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'];
Expand Down

0 comments on commit 66ef1b7

Please sign in to comment.