OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Allow feature flag to have descriptions and show them in admin
Christophe Bliard9bfb7be07072
diff --git a/app/views/admin/settings/experimental_settings/show.html.erb b/app/views/admin/settings/experimental_settings/show.html.erbindex 99fb53c6018..3145a8299f3 100644--- a/app/views/admin/settings/experimental_settings/show.html.erb+++ b/app/views/admin/settings/experimental_settings/show.html.erb@@ -42,8 +42,13 @@ See COPYRIGHT and LICENSE files for more details.</div></div>- <% ::OpenProject::FeatureDecisions.all.each do |feature| %>- <div class="form--field"><%= setting_check_box "feature_#{feature}_active", not_translated_label: feature.to_s %></div>+ <% OpenProject::FeatureDecisions.all.each do |feature| %>+ <div class="form--field">+ <%= setting_check_box "feature_#{feature}_active", not_translated_label: feature.to_s.humanize %>+ <div class="form--field-instructions">+ <p><%= Settings::Definition["feature_#{feature}_active"].description %></p>+ </div>+ </div><% end %></fieldset></section>diff --git a/lib_static/open_project/feature_decisions.rb b/lib_static/open_project/feature_decisions.rbindex 9e0e5506782..f5c13a0a47b 100644--- a/lib_static/open_project/feature_decisions.rb+++ b/lib_static/open_project/feature_decisions.rb@@ -58,10 +58,10 @@ module OpenProjectmodule FeatureDecisionsmodule_function- def add(flag_name)+ def add(flag_name, description: nil)all << flag_namedefine_flag_methods(flag_name)- define_setting_definition(flag_name)+ define_setting_definition(flag_name, description:)enddef active@@ -78,8 +78,9 @@ module OpenProjectendend- def define_setting_definition(flag_name)+ def define_setting_definition(flag_name, description: nil)Settings::Definition.add :"feature_#{flag_name}_active",+ description:,default: Rails.env.development?endend