Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nova 4 support #206

Open
jaros93 opened this issue Apr 14, 2022 · 18 comments
Open

Nova 4 support #206

jaros93 opened this issue Apr 14, 2022 · 18 comments
Assignees
Labels
enhancement New feature or request

Comments

@jaros93
Copy link

jaros93 commented Apr 14, 2022

Added Nova 4 compatibility.

@GarethSomers
Copy link

Hi @jaros93 are you asking for the developers to "Add Nova 4 compatibility"?

"Added" is past tense and implies you've done this already.


In any case Nova 4 adds native support for Dependant Fields.

I wonder if anyone can comment on the native functionality vs that of this package? And whether this package is still required.

@wamesro
Copy link

wamesro commented Apr 22, 2022

It's not exactly the same

This convenient notation is not possible

NovaDependencyContainer::make([
    Text::make('First Name', 'first_name')
])->dependsOn('name_format', 0),

It is not possible to use it

It is necessary to set a condition for each field

And it is not possible to use either hideWhenCreating() hideWhenCreating()
https://nova.laravel.com/docs/4.0/resources/fields.html#showing-hiding-fields
only e.g. readonly() required() default()

@NoahNxT
Copy link
Contributor

NoahNxT commented May 1, 2022

@GarethSomers The new dependent functionality works very well in Nova 4, but there are some main issues which made me choose for this package still:

  1. Not all fields are supported for the dependent functionality, for example the Markdown field (which isn't even mentioned in the docs) https://nova.laravel.com/docs/4.0/resources/fields.html#dependent-fields

  2. Also the key difference is that the default dependsOn from Nova 4 itself does not check on all events/changes of your dependent field, for example one of the big ones is a boolean field, when you set a default value as 'true' on it it will not detect it on your Edit page, which makes it not yet reliable.

  3. and last but not least, this package makes it possible to use the dependent functionality on a quick and easy way without having to write any difficult logics.

@NoahNxT
Copy link
Contributor

NoahNxT commented May 1, 2022

Nova 4 support will be there in the future, but not yet. But surely feel free to open a PR and we'll check it as fast as possible!

@NoahNxT NoahNxT added the enhancement New feature or request label May 1, 2022
@NoahNxT NoahNxT self-assigned this May 1, 2022
@meyer59
Copy link

meyer59 commented May 2, 2022

Also (it seems ridiculous) but Laravel nova dependent functionality doesnt work on Action. check this laravel/nova-issues#3897

@epartment epartment deleted a comment from wamesro May 9, 2022
@internetbug256
Copy link

Hi from Argentina. Also suffering from Nova 4.0 "enhancements" and plugins compatibility. I have some projects where I had to leave them at Nova 3 due to the amount of plugins not working in the new version.
Piece of advice: let's start learning how to build our own plugins. Can't depend on this kind of issues.

@mehrancodes
Copy link

Just tried to find a solution this weekend and got failed. in the first step we need to upgrade to Vue 3. since it is trying to get all of the components list via this.$root.$children which doesn't exists in Vue 3. this is where the issue happens

@NoahNxT
Copy link
Contributor

NoahNxT commented May 15, 2022

@mehrancodes indeed, we'll have to upgrade to Vue 3. Haven't got the time yet to take a look at it but feel free to open a PR 😇

@mehrancodes
Copy link

@NoahNxT Yes true, and UNF it needs a deep understanding of Vue 3. I believe the easier way would be to start the frontend side from zero since in Vue 3 we have composition API and the things can be done different than Vue 2

@dmason30
Copy link

There is a Nova 4 compatible fork here, not sure why they never created a PR for you guys but perhaps someone could take inspiration from it:

https://github.com/alexwenzel/nova-dependency-container

@NoahNxT
Copy link
Contributor

NoahNxT commented May 19, 2022

@dmason30 thanks for the info! We will try to take a look ASAP.

@mehrancodes
Copy link

@NoahNxT I also did a deep look at the Nova source code just noticed we can get rid of most of the complex parts by using events! for example the watchers registration, etc... Also tested it out quickly and it did work!

For now I would go with the above PR since we need it on prod but would make a PR soon for the event driven solution

@jaxramus
Copy link

jaxramus commented Jun 7, 2022

+1 im still reaching for this package over nova 4 dependsOn a lot of the time

will use the fork posted in the replies for now.

@samdharris
Copy link

samdharris commented Jul 14, 2022

Hi There

I'm looking at upgrading this to Nova 4 and the main issue is the retirement of the $children property in Vue 3 so without direct access the child component instances, it's kinda difficult for this package to function :(

@dmason30
Copy link

@samdharris You can see how this fork got around this here

https://github.com/alexwenzel/nova-dependency-container/blob/4f4d3756f6d3f6d37ae577841c919d8576340f28/resources/js/components/FormField.vue#L46

@dmason30
Copy link

dmason30 commented Jul 14, 2022

Also (it seems ridiculous) but Laravel nova dependent functionality doesnt work on Action. check this laravel/nova-issues#3897

Nova 4 now supports dependent fields in actions!

@NoahNxT
Copy link
Contributor

NoahNxT commented Jul 14, 2022

@mehrancodes Did you finished your PR?

@BobbyBorisov
Copy link

ping @mehrancodes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests