hotfix: Action hidden check with other actions inside a group

This commit is contained in:
Dan Harrin
2024-03-18 07:44:13 +00:00
parent 0a6edd958b
commit 7a2874bcfb
3 changed files with 15 additions and 1 deletions
@@ -94,7 +94,7 @@ trait CanBeHidden
public function isHidden(): bool
{
if ($this->getGroup()?->isHidden()) {
if ($this->getGroup()?->baseIsHidden()) {
return true;
}
+9
View File
@@ -31,6 +31,15 @@ it('can call an action with data', function () {
]);
});
it('can call action inside group', function () {
$post = Post::factory()->create();
livewire(PostsTable::class)
->callTableAction('groupedDelete', $post);
assertSoftDeleted($post);
});
it('can validate an action\'s data', function () {
livewire(PostsTable::class)
->callTableAction('data', data: [
+5
View File
@@ -149,6 +149,11 @@ class PostsTable extends Component implements HasForms, Tables\Contracts\HasTabl
Tables\Actions\DeleteAction::make(),
Tables\Actions\ForceDeleteAction::make(),
Tables\Actions\RestoreAction::make(),
Tables\Actions\ActionGroup::make([
Tables\Actions\DeleteAction::make('groupedDelete'),
Tables\Actions\ForceDeleteAction::make('groupedForceDelete'),
Tables\Actions\RestoreAction::make('groupedRestore'),
]),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),