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

HasNestedMany with nested fields in DependencyContainer #9

Closed
wajdijurry opened this issue Oct 4, 2023 · 3 comments
Closed

HasNestedMany with nested fields in DependencyContainer #9

wajdijurry opened this issue Oct 4, 2023 · 3 comments

Comments

@wajdijurry
Copy link

I am using this package to nest a relation into other resource. In my case, I am nesting Variation resource into Product resource.

The Variation resource has the following fields:

// opt-out code
            Boolean::make('Enable Sale Price?', 'sale_price', function ($value) {
                return !is_null($value);
            }),

            DependencyContainer::make([
                Currency::make('Sale Price', 'sale_price')
                    ->currency('JOD'),
            ])->dependsOnNotEmpty('sale_price'),
// opt-out code

And the Product resource has this:

            HasManyNested::make('Variations', 'variations', Variation::class)
                ->propagate('id')
                ->hideFromIndex()
                ->useTabs(),

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 the Variation resource.

screencast-admin.otomech.local-2023.10.04-19_01_26.webm
@wajdijurry
Copy link
Author

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

@Lupennat
Copy link
Owner

Lupennat commented Oct 5, 2023

can you please provide me a link of dependency container package?

@Lupennat
Copy link
Owner

Lupennat commented Oct 5, 2023

discussion moved here

@Lupennat Lupennat closed this as completed Oct 5, 2023
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

2 participants