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

Avo team & user view don't work in production environment #1371

Open
tangopium opened this issue Mar 20, 2024 · 3 comments
Open

Avo team & user view don't work in production environment #1371

tangopium opened this issue Mar 20, 2024 · 3 comments

Comments

@tangopium
Copy link

There is currently an issue with the team and user view of the avo dashboard in production:

image

The issue is, that in these views, a select_field (from avo) is used to display a time_zone value. The select_field uses options.invert[value].

In the User and Team model, these options get fed by view_context.time_zone_options_for_select(Avo::Current.user.time_zone, nil, ActiveSupport::TimeZone), which returns a ActiveSupport::SafeBuffer(String). This class doesn't implement an invert method.

In the development environment this works, because the colorize gem gets included, which implements this method for the String class. But in production, this gem/method is missing.

@lcorneliussen
Copy link

I also have this issue

@lcorneliussen
Copy link

Changing time_zone in Avo::Resources::Team to text is a workaround to show the teams (but then lacks potential dropdown editing)

field :time_zone, as: :text 

@jagthedrummer
Copy link
Contributor

@adrianthedev can you offer any advice here? I'm not sure why the options for time_zone are defined they way they are.

field :time_zone, as: :select, options: -> { view_context.time_zone_options_for_select(Avo::Current.user.time_zone, nil, ActiveSupport::TimeZone) }

field :time_zone, as: :select, options: -> { view_context.time_zone_options_for_select(Avo::Current.user.time_zone, nil, ActiveSupport::TimeZone) }

We're using the resources you defined in #796

Or maybe this is an avo bug and it should be able to handle cases where it's impossible to invert an option?

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