Skip to content

HasNestedMany with nested fields in DependencyContainer #39

@wajdijurry

Description

@wajdijurry

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions