shuvroroy / nova-dynamic-views

A nova package for dynamically add custom placeholders component in various section of views.
MIT License
10 stars 3 forks source link

customUpdateHeaderComponents does not seem to work? #5

Closed yobottehg closed 6 months ago

yobottehg commented 10 months ago

Hello!

first of all thank you for the module, it's a valuable addition to Laravel Nova.

I tried to use it on an edit page today and i think something is odd there.

I checked that it does not have have to do anything with my component

    public function customUpdateHeaderComponents(): CustomComponents
    {
        return CustomComponents::make()
            ->addItem('fmv-filter');
    }

    public function customDetailHeaderComponents(): CustomComponents
    {
        return CustomComponents::make()
            ->addItem('fmv-filter');
    }

This works on the detail page but not on the edit page.

https://xyz/admin/resources/entity/69 shows the component in the header, while https://xyz/admin/resources/entity/69/edit does not.

Anything else i need to check?

shuvroroy commented 10 months ago

@yobottehg Can you tell me which version of nova and nova-dynamic-views package you are using? I checked with latest version of nova & nova-dynamic-views and it working fine.

yobottehg commented 10 months ago

@shuvroroy

"name": "shuvroroy/nova-dynamic-views",
"version": "v1.2.4",
"name": "laravel/nova",
"version": "4.32.11",

This are my versions locally.

yobottehg commented 10 months ago

Some things from my local testing:

  1. These functions were added directly on one nova model
  2. I tried this generating a new resource tool, this also only works on the details page
  3. I tried this on a different nova model, also these only works on the details page
  4. Adding these function on the resource class directly instead of only the model also does only work on the details page
  5. Downgrade to laravel nova 4.32.1 does also not work (Version is from 1.2.2 release notes)
  6. I can set a breakpoint into customDetailHeaderComponents and this will halt on the detail page. Setting a breakpoint in customUpdateHeaderComponents does not halt on the edit page. Therefore i think this method is not called.
  7. Vue dev tools does not list the component as rendered on the edit page. But does on the detail page.
  8. NovaDynamicViewsController and the authorize middleware is not called on the update route but the detail route

update detail

--> Still no clue why this does not work. It seems that the update.vue template provided by the module is not used.

shuvroroy commented 10 months ago

@yobottehg Can you create a repository with all Steps To Reproduce and share with me. It will be easier and faster for me to debug