filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
17.12k stars 2.69k forks source link

Standalone Table with Row Actions not working #7074

Closed abishekrsrikaanth closed 1 year ago

abishekrsrikaanth commented 1 year ago

Package

filament/tables

Package Version

v3.0.0-beta1

Laravel Version

v10.10

Livewire Version

v3.0

PHP Version

PHP 8.2

Problem description

I have the following table actions for my standalone table.

public function getTableActions(): array
    {
        return [
            Action::make('Edit')->form($this->getFormSchema())->modalWidth('md')->action(function ($data) {
                $this->company->benefits()->updateExistingPivot($data['id'], ['benefit_description' => $data['description']]);
            }),
            Action::make('Delete')->requiresConfirmation()->action(function ($data) {
                $this->company->benefits()->detach($data['id']);
            }),
        ];
    }

Not sure why, but clicking on the Edit or Delete actions does nothing.

No console errors but there is a network call and the response is always about close-modal. Screenshot of the network call response. Here is the video of what I am facing on the actual project https://share.cleanshot.com/4xZDqtxK

CleanShot 2023-07-21 at 02 39 33

Here is the payload

CleanShot 2023-07-21 at 02 40 11

Expected behavior

The Edit Modal or the Delete Confirmation Dialog doesn't show

Steps to reproduce

Try to add the above code to a standalone table builder

Reproduction repository

Please create a user on the database and visit the root / url to load the table and click the edit button NA

Relevant log output

No response

github-actions[bot] commented 1 year ago

Hey @abishekrsrikaanth! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

github-actions[bot] commented 1 year ago

Thank you for providing reproduction steps! Reopening the issue now.

zepfietje commented 1 year ago

Make sure your page contains the <x-filament-actions::modals /> component: https://beta.filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component/#adding-the-action.

@danharrin could you add a reference of this to the table docs if you think that's needed?

danharrin commented 1 year ago

The tables package should inject it by default