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

resolveUsing not working on Row #49

Closed
idragon81 opened this issue Dec 12, 2018 · 2 comments
Closed

resolveUsing not working on Row #49

idragon81 opened this issue Dec 12, 2018 · 2 comments

Comments

@idragon81
Copy link

idragon81 commented Dec 12, 2018

resolveUsing is not working when applying on row's children

  Row::make('Items', [
                    Text::make("Name")->fieldClasses('w-full px-8 py-6')
                        ->hideLabelInForms()
                        ->resolveUsing(function ($value) {
                            $locale = app()->getLocale();
                            $item = json_decode($value, true);
                            return $item[$locale];
                        })->readOnly(),
                    Text::make("Quantity")->fieldClasses('w-full px-8 py-6')
                        ->hideLabelInForms()->readOnly(),
                    Text::make("Price")->fieldClasses('w-full px-8 py-6')
                        ->hideLabelInForms()->readOnly(),
                ])->hideWhenUpdating()->hideWhenCreating(),
@beliolfa
Copy link
Contributor

Added support for this in 0.6.1.

@ragingdave
Copy link
Contributor

ragingdave commented Jan 10, 2019

Maybe I'm missing something but the resolveUsing code doesn't even get hit at all? On version 0.6.1.

Adding a dd into the resolveUsing callback is never called. In fact adding a dd to either the row or the inner row fields seem to do nothing.

Snippet as an example:

       Row::make('Features and Benefits', [
            Text::make('test', null, function($feature) {
                dd('test');
            }),
            Textarea::make('Feature/Benefit', 'feature', function ($feature) {
                dd('test');
                return $feature;
            })->hideLabelInForms()
        ], 'features')

Granted I'm trying to do something like a list where the result is just an array of strings, but the logic should still be getting hit.

ADDITIONAL UPDATE: It also broke using a resolveUsing on the Row field itself. reverting back to 0.6.0 makes the row field level resolve work again

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

3 participants