nova-inline-relationship icon indicating copy to clipboard operation
nova-inline-relationship copied to clipboard

Doesn't work with NovaDependencyContainer package

Open Reham-Walid opened this issue 5 years ago • 6 comments

When i try to use it inside NovaDependencyContainer for example

      `<NovaDependencyContainer::make([
                HasOne::make('ResaleTerm','resaleterm',ResaleTerm::class)->inline(),
        ])->dependsOn('premium', false),>`

It doesn't give me any error but the related model is not created , any idea why this might happens ? Thank you :)

Reham-Walid avatar Sep 24 '19 21:09 Reham-Walid

@navneetrai any update about this ? its happening on resolving fields and mapping

bsormagec avatar Sep 27 '19 14:09 bsormagec

@Reham-Walid @bsormagec Thanks for reporting this! We've never tried to use this with the NovaDependencyContainer package. But since you are both asking about it we will take a look at it soon.

kirschbaum avatar Sep 30 '19 17:09 kirschbaum

In my case, the code bellow works perfectly

NovaDependencyContainer::make([
        BelongsTo::make(__('Person'), 'person', Person::class)->inline(),
    ])
    ->dependsOn('type', 'individual'),

y-martini avatar Oct 04 '19 08:10 y-martini

I am telling different case @yuriy-martini dream it like when using NovaDependencyContainer on BelongsTo Related resource if you add a NovaDependency to Person Resource you can see error.

bsormagec avatar Oct 07 '19 13:10 bsormagec

@Reham-Walid @bsormagec @yuriy-martini We have started work on a branch that addresses third party package creation and updating issues. We have started the development on it using Nova Dependency Container as the guinea pig.

brandonferens avatar Dec 18 '19 23:12 brandonferens

@brandonferens I'm the maintainer of the nova dependency container. Is there chance I can see any progress for the branch addressing the compatibility issues?

I dived into your code to see why MorphTo and other relational fields aren't working, and well the why is quite obvious. One of the main problems of all nova packages is that everybody is just extending some field components and overwrite methods to make it work.

If we're going to make these two compatible, I suggest we start by implementing some contracts that, for example, the nova dependency container is nesting fields. This would make it easier to filter the component when resolving e.g.

if($component instanceof NestableFields) {
    // resolve package
}

The question more or less, where do we get these contracts. There a similar discussions spread on different forums / github, but I have yet to see an attempt to make a global third party package to include and defines behaviour for other packages to implement.

Cheers

wize-wiz avatar Jan 13 '20 16:01 wize-wiz