whitecube / nova-flexible-content

Flexible Content & Repeater Fields for Laravel Nova
MIT License
788 stars 228 forks source link

feat(ScopedRequest): model scope on request #398

Closed ianrobertsFF closed 1 year ago

ianrobertsFF commented 1 year ago

This includes the group key as a property on the ScopedRequest class.

Useful if you want to do anything with the scoped request (specifically in any of the get{specificity}Rules methods) within any fields that may be in the layout. Without this context there is nothing to inform which group you are currently working with (and therefore no way to create and return a FlexibleAttribute)

voidgraphics commented 1 year ago

Hi, thanks for the PR. Somehow this change breaks the dependent fields test. I can't think of a reason why, but it does. As such, I can't merge it in this state. Do you have any ideas?

voidgraphics commented 1 year ago

After manual testing, it's a bit of a head scratcher, there are no errors either in the log or in the JS console when I activate a dependent field. There's just nothing happening at all.

ianrobertsFF commented 1 year ago

That's very odd, I'll see if I can see why it's occurring, I guess group could be a bit generic, but I don't think it's colliding with anything. I'll make a project to test as I use a fork of flexible content in my projects anyway

voidgraphics commented 1 year ago

The weirdness keeps increasing. If I use your PR, the test breaks (all the other tests pass though). If I use master, but manually make the same changes you did, all tests pass. Could be something funky with my local setup?

voidgraphics commented 1 year ago

Got it to work in the end. Had to build the assets and do artisan nova:publish for some reason. Thanks for the PR!

ianrobertsFF commented 1 year ago

Aha, sorted at least! Thanks for hopping on it so quickly!