fix: use schema() instead of modalContent() for Filament 5 compatibility

Replace deprecated modalContent() with schema([CommentsEntry::make('comments')])
in both CommentsAction and CommentsTableAction to fix comment creation in
Filament 5 modals.
This commit is contained in:
manukminasyan
2026-03-27 17:48:32 +04:00
parent 889dc2828b
commit f119095ae5
5 changed files with 14 additions and 16 deletions

View File

@@ -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 () {

View File

@@ -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 () {