codenco-dev / nova-grid-system

Nova grid system for Laravel Nova
80 stars 33 forks source link

dislplayUsingLabels() not working on Select field #25

Open iamoat opened 1 year ago

iamoat commented 1 year ago

It shows a key value insteand of the label value.

rafaelsmith commented 1 year ago

Also Country field shows the key And Currency field shows raw number

jmverges commented 1 year ago

+1

ashwind-19 commented 1 year ago

+1

alexandru-eftimie commented 1 year ago

Technically only a small change is required to make this work... add in resources/js/components/PanelItem.vue: import { FieldValue } from '@/mixins'; -- technically from "laravel-nova"; but that wouldn't compile for me. and mixins: [FieldValue],

and remove fieldValue() function.

But to be able to compile it on my machine I had to make a ton of changes.

If someone can make a PR out of it it'd be great. https://github.com/ideatocode/nova-grid-system/tree/fieldValue. I don't know how to do it with just the relevant change.

OverBurt commented 1 year ago

+1 I have same problem:

After adding NovaGridSystem in NovaServiceProvider, the method dislplayUsingLabels() seems not to work correctly on DetailView, it shows key and not label, Index and Form are OK.


Select::make(__('nova-control-panel.field.variation_type'), 'type')
                ->sortable()
                ->options([
                    VariationTypeEnum::Suspend->value => __('common.enum.variation_type_suspend'),
                    VariationTypeEnum::Preferences->value => __('common.enum.variation_type_preferences'),
                    VariationTypeEnum::Days->value => __('common.enum.variation_type_days'),
                ])
                ->displayUsingLabels()->rules(['required']),

Schermata 2023-05-18 alle 11 58 02

Schermata 2023-05-18 alle 11 57 50

scramatte commented 12 months ago

+1 here, same issue