tfwright / live_admin

Low-config admin UI for Phoenix apps, built on LiveView
MIT License
251 stars 22 forks source link

Component Override Functions Arity/Signature Issue #9

Closed jpramassini closed 2 years ago

jpramassini commented 2 years ago

Hi, thanks for building the library! We're trying to use the component override functionality and have passed in render methods similar to your example dev app, but for some reason render_edit/2 is being called instead of the expected render_edit/1.

When inspecting the arguments passed to the function, the first argument is always an empty map, while the second argument is the normal assigns map that's expected. Do you have any idea what could be causing that?

We're using the same pattern as:

 components: [
          new: {LiveAdmin.Components.Container, :render_new, []},
          edit: {LiveAdmin.Components.Container, :render_edit, []}
        ],

from dev.exs.

tfwright commented 2 years ago

Hi @jpramassini

that looks suspiciously like a bug that I fixed in the last version update. can you check your current version and/or try updating to latest?

jpramassini commented 2 years ago

Sure, my current version is 0.4.

tfwright commented 2 years ago

So, unfortunately, I'm not able to reproduce this issue using version 0.4 (f05c8a5ffd390090a16aa21d86e672d9adcad0a1365e72c51ee919ba257ce3ea). If you can share the project code, or provide a sample app that reproduces the issue I'd be happy to take a closer look.

jpramassini commented 2 years ago

I can't share direct project code, but I'll try to pull together a sample app and get back to you. Thanks for your help and for looking into this!

tfwright commented 2 years ago

Overrides have changed in the latest release: https://elixirforum.com/t/liveadmin-phoenix-admin-ui-built-on-liveview/46421/14?u=tfwright

If you weren't able to resolve your issue, you might try updating and following the new example in the dev app--it's a lot more fleshed out in terms of what is entailed in implementing a real form override.