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

MAX_NUMBER_GUIDANCE_SELECTIONS value hardcoded in views/plans/_guidance_selection.html.erb #3341

Open
StCyr opened this issue Sep 26, 2023 · 2 comments

Comments

@StCyr
Copy link

StCyr commented Sep 26, 2023

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)

4.1.0

Expected behaviour:

"6" should not be hardcoded

Actual behaviour:

legend><%= _('Select up to 6 organisations to see their guidance.') %></legend>

@StCyr
Copy link
Author

StCyr commented Sep 26, 2023

I'm not sure how to best solve it: MAX_NUMBER_GUIDANCE_SELECTIONS is defined in app/views/layouts/application.html.erb and thus seems only accessible via javascript

So a solution might be to update this value at run time via a javascript with $( document ).ready() but it looks a bit wacky to me. A better solution is probably to define a new configuration setting in config/initializers/_dmproadmap.rb and use this configuration settings' value in views/plans/_guidance_selection.html.erb (and app/views/layouts/application.html.erb)

What do you think?

@nicolasfranck
Copy link
Contributor

nicolasfranck commented Sep 27, 2023

Maybe there is good reason for this maximum value? It would make the list of guidances long if not managed well, but I am not sure if that should be a software concern? So one could also choose to remove this altogether?

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

2 participants