-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
HasNestedMany with nested fields in DependencyContainer #39
Comments
I figured out that the fields in the first Variation have the same IDs as the second Variation. I believe this is the case but I lack the experience to edit the fields templates in Vue.js |
HasNestedMany generate a "formUniqueId" for each nested form panel. Probably it should be fixed with something like this on FormField.vue file <template>
<div v-if="dependenciesSatisfied">
<div v-for="childField in field.fields">
<component
...
:form-unique-id="formUniqueId"
/>
</div>
</div>
</template>
<script>
export default {
...
props: ['resourceName', 'resourceId', 'field', 'formUniqueId'],
methods: {
...
componentIsDependency(component) {
if(component.formUniqueId !== this.formUniqueId) {
return false;
}
...
}
}
}
</script> |
Thanks @Lupennat . I have forked this package and applied your fix. Now it is working like a charm! |
Fix bug in nested forms, as discussed in issue alexwenzel#39
* Fix bug in nested forms, as discussed in issue #39 (#40) * Fix dependencies and remove debugging * Fix formUniqueId in nested forms * Revert "Fix bug in nested forms, as discussed in issue #39 (#40)" (#44) This reverts commit a2bcc77. * Handle BackedEnum (#34) * Handle BackedEnum * Use ->value instead of tryFrom * Get Correct Rules (#32) Instead of trying to access the specific rule property and check if it is callable call the correct rule method instead so the individual field has a chance to handle the logic. fixes #17 --------- Co-authored-by: Wajdi Jurry <[email protected]> Co-authored-by: Lonny Kapelushnik <[email protected]>
* added nvmrc file * integrating various pull requests (#45) * Fix bug in nested forms, as discussed in issue #39 (#40) * Fix dependencies and remove debugging * Fix formUniqueId in nested forms * Revert "Fix bug in nested forms, as discussed in issue #39 (#40)" (#44) This reverts commit a2bcc77. * Handle BackedEnum (#34) * Handle BackedEnum * Use ->value instead of tryFrom * Get Correct Rules (#32) Instead of trying to access the specific rule property and check if it is callable call the correct rule method instead so the individual field has a chance to handle the logic. fixes #17 --------- Co-authored-by: Wajdi Jurry <[email protected]> Co-authored-by: Lonny Kapelushnik <[email protected]> --------- Co-authored-by: Wajdi Jurry <[email protected]> Co-authored-by: Lonny Kapelushnik <[email protected]>
I am using this package to nest a relation into other resource. In my case, I am nesting
Variation
resource intoProduct
resource.The
Variation
resource has the following fields:And the
Product
resource has this:Something weird is going on, as illustrated in the attached video, when I check "Enable Sale Price?" for the second Variation, the first Variation got affected by this change.
This bug applies to all fields in
DependencyContainer
in theVariation
resource.screencast-admin.otomech.local-2023.10.04-19_01_26.webm
The text was updated successfully, but these errors were encountered: