diff --git a/docs/.data/content/contents.sqlite b/docs/.data/content/contents.sqlite deleted file mode 100644 index bb932e2..0000000 Binary files a/docs/.data/content/contents.sqlite and /dev/null differ diff --git a/src/Filament/Actions/CommentsAction.php b/src/Filament/Actions/CommentsAction.php index 0903c4e..0a44526 100644 --- a/src/Filament/Actions/CommentsAction.php +++ b/src/Filament/Actions/CommentsAction.php @@ -3,8 +3,8 @@ namespace Relaticle\Comments\Filament\Actions; use Filament\Actions\Action; -use Illuminate\Contracts\View\View; use Relaticle\Comments\Concerns\HasComments; +use Relaticle\Comments\Filament\Infolists\Components\CommentsEntry; class CommentsAction extends Action { @@ -19,11 +19,9 @@ class CommentsAction extends Action ->modalHeading(__('Comments')) ->modalSubmitAction(false) ->modalCancelAction(false) - ->modalContent(function (): View { - return view('comments::filament.comments-action', [ - 'record' => $this->getRecord(), - ]); - }) + ->schema([ + CommentsEntry::make('comments'), + ]) ->badge(function (): ?int { $record = $this->getRecord(); diff --git a/src/Filament/Actions/CommentsTableAction.php b/src/Filament/Actions/CommentsTableAction.php index bb756d4..94c803e 100644 --- a/src/Filament/Actions/CommentsTableAction.php +++ b/src/Filament/Actions/CommentsTableAction.php @@ -3,8 +3,8 @@ namespace Relaticle\Comments\Filament\Actions; use Filament\Actions\Action; -use Illuminate\Contracts\View\View; use Relaticle\Comments\Concerns\HasComments; +use Relaticle\Comments\Filament\Infolists\Components\CommentsEntry; class CommentsTableAction extends Action { @@ -19,11 +19,9 @@ class CommentsTableAction extends Action ->modalHeading(__('Comments')) ->modalSubmitAction(false) ->modalCancelAction(false) - ->modalContent(function (): View { - return view('comments::filament.comments-action', [ - 'record' => $this->getRecord(), - ]); - }) + ->schema([ + CommentsEntry::make('comments'), + ]) ->badge(function (): ?int { $record = $this->getRecord(); diff --git a/tests/Feature/CommentsActionTest.php b/tests/Feature/CommentsActionTest.php index 9a50ac6..17ab2f8 100644 --- a/tests/Feature/CommentsActionTest.php +++ b/tests/Feature/CommentsActionTest.php @@ -29,10 +29,11 @@ it('has a chat bubble icon', function () { expect($action->getIcon())->toBe('heroicon-o-chat-bubble-left-right'); }); -it('has modal content configured', function () { +it('disables modal submit and cancel actions', function () { $action = CommentsAction::make('comments'); - expect($action->hasModalContent())->toBeTrue(); + expect($action->getModalSubmitAction())->toBeFalsy() + ->and($action->getModalCancelAction())->toBeFalsy(); }); it('shows badge with comment count when comments exist', function () { diff --git a/tests/Feature/CommentsTableActionTest.php b/tests/Feature/CommentsTableActionTest.php index ea6e9ad..8e147f7 100644 --- a/tests/Feature/CommentsTableActionTest.php +++ b/tests/Feature/CommentsTableActionTest.php @@ -17,10 +17,11 @@ it('configures as a slide-over', function () { expect($action->isModalSlideOver())->toBeTrue(); }); -it('has modal content configured', function () { +it('disables modal submit and cancel actions', function () { $action = CommentsTableAction::make('comments'); - expect($action->hasModalContent())->toBeTrue(); + expect($action->getModalSubmitAction())->toBeFalsy() + ->and($action->getModalCancelAction())->toBeFalsy(); }); it('shows badge with comment count for the record', function () {