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

dislplayUsingLabels() not working on Select field #25

Open
iamoat opened this issue Sep 30, 2022 · 6 comments
Open

dislplayUsingLabels() not working on Select field #25

iamoat opened this issue Sep 30, 2022 · 6 comments

Comments

@iamoat
Copy link

iamoat commented Sep 30, 2022

It shows a key value insteand of the label value.

@rafaelsmith
Copy link

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

@jmverges
Copy link

jmverges commented Mar 8, 2023

+1

1 similar comment
@ashwind-19
Copy link

+1

@alexandru-eftimie
Copy link

alexandru-eftimie commented May 9, 2023

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
Copy link

OverBurt commented May 18, 2023

+1 I have same problem:

  • laravel/nova 4.24.3
  • codenco-dev/nova-grid-system v2.0.1

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
Copy link

+1 here, same issue

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

7 participants