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

Dependency show or hide support #87

Closed
ertacgungor opened this issue Sep 27, 2019 · 6 comments
Closed

Dependency show or hide support #87

ertacgungor opened this issue Sep 27, 2019 · 6 comments

Comments

@ertacgungor
Copy link

Hello @voidgraphics,

I got an issue about hiding and showing field depend another select or switch. When i try to use epartment/nova-dependency-container nothing happening when i change it. Do you have any idea to fix that problem or another alternative solution about this..

Thank you.

@voidgraphics
Copy link
Member

Hi @ertacgungor, at first glance I would suggest making two different layouts instead. I'm sorry to hear that nova-dependency-container is not compatible with flexible fields right now and we would love to get it to work sometime.

@wize-wiz
Copy link

wize-wiz commented Oct 27, 2019

@ertacgungor @voidgraphics I'm the maintainer of the dependency container.

The problem here is that the field attributes in each layout (group) have a generated hash where the original attribute is appended e.g. __text. The dependency container so far is only capable of finding the dependency fields by its attribute, which in this case always fails.

Second problem is that the container gathers all vue components (once) in search of any fields that might be a dependency for the container. Now in this particular case it will never find its dependency because the layout added is generated on the fly with the said generated hash form hash__attribute.

Because this package (flexible content) is quite special on how it handles fields, by generating fields on the fly with the said generated field attribute, that the only possible way for any support is adding functionality just for this package.

I've been playing around with flexible-content and I do have a few ideas, but I have to see what goes without breaking anything else.

My first try would be to check if the root parent of the dependency package is a flexible content group component. If so, I'll try to add a mechanism to use FormNovaFlexibleContentGroup->group->key generated hash and incorporate it to find all dependency fields within this (hash/key) group.

@nilsE
Copy link

nilsE commented Nov 17, 2019

would need support for epartment/nova-dependency-container, too - is there any chance to make this work?

thanks,
Nils

@voidgraphics
Copy link
Member

Hi @wize-wiz, thanks a lot for looking into it, and considering a fix on your end. Feel free to comment back here if you wish to discuss possible solutions into more detail.

@nilsE By all means we would love to. The team at @whitecube is very busy with client work at this time which makes an immediate fix from us pretty unlikely, but you are very welcome to submit a PR to this repo or to the nova-dependency-container repo if you can get it working.

wize-wiz added a commit to epartment/nova-dependency-container that referenced this issue Dec 1, 2019
@wize-wiz
Copy link

wize-wiz commented Dec 1, 2019

@nilsE @ertacgungor Just released a version v1.2.10 where the dependency container should now work appropriately with this package.

If there are any issues left concerning the dependency container, please create an issue here

@voidgraphics
Copy link
Member

Thank you @wize-wiz!

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

No branches or pull requests

4 participants