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
Set is_filter to true by default and add descriptions
Oliver Günther68b39586f006
diff --git a/app/views/custom_fields/_form.html.erb b/app/views/custom_fields/_form.html.erbindex 6b0c988e39e..d0e70e168ff 100644--- a/app/views/custom_fields/_form.html.erb+++ b/app/views/custom_fields/_form.html.erb@@ -154,16 +154,28 @@ See COPYRIGHT and LICENSE files for more details.when "WorkPackageCustomField" %><div class="form--field"><%= f.check_box :is_required %>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.is_required') %></p>+ </div></div><div class="form--field"><%= f.check_box :is_for_all %>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.is_for_all') %></p>+ </div></div><div class="form--field"><%= f.check_box :is_filter %>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.is_filter') %></p>+ </div></div><div class="form--field"><%= f.check_box :searchable,data: { 'admin--custom-fields-target': 'searchable' }%>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.searchable') %></p>+ </div></div><div class="form--field" hidden><%= f.check_box :content_right_to_left,@@ -172,19 +184,34 @@ See COPYRIGHT and LICENSE files for more details.<% when "UserCustomField" %><div class="form--field"><%= f.check_box :is_required %>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.is_required') %></p>+ </div></div><div class="form--field"><%= f.check_box :visible %>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.visible') %></p>+ </div></div><div class="form--field"><%= f.check_box :editable %>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.editable') %></p>+ </div></div><% when "ProjectCustomField" %><div class="form--field"><%= f.check_box :is_required %>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.is_required') %></p>+ </div></div><div class="form--field"><%= f.check_box :visible %>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.visible') %></p>+ </div></div><div class="form--field"><%= f.check_box :searchable,@@ -193,10 +220,16 @@ See COPYRIGHT and LICENSE files for more details.<% when "TimeEntryCustomField" %><div class="form--field"><%= f.check_box :is_required %>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.is_required') %></p>+ </div></div><% else %><div class="form--field"><%= f.check_box :is_required %>+ <div class="form--field-instructions">+ <p><%= t('custom_fields.instructions.is_required') %></p>+ </div></div><% end %><%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", custom_field: @custom_field, form: f) %>diff --git a/config/locales/en.yml b/config/locales/en.ymlindex 9ebc07e0cf6..7c072891b5a 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -224,6 +224,16 @@ en:confirm_destroy_option: "Deleting an option will delete all of its occurrences (e.g. in work packages). Are you sure you want to delete it?"reorder_alphabetical: "Reorder values alphabetically"reorder_confirmation: "Warning: The current order of available values will be lost. Continue?"+ instructions:+ is_required: "Mark the custom field as required. This will make it mandatory to fill in the field when creating new or updating existing resources."+ is_for_all: "Mark the custom field as available in all existing and new projects."+ searchable: "Include the field values when using the global search functionality."+ editable: "Allow the field to be editable by users themselves."+ visible: "Make field visible for all users (non-admins) in the project overview and displayed in the project details widget on the Project Overview."+ is_filter: >+ Allow the custom field to be used in a filter in work package views.+ Note that only with 'For all projects' selected, the custom field will show up in global views.+tab:no_results_title_text: There are currently no custom fields.no_results_content_text: Create a new custom fielddiff --git a/db/migrate/20231212131603_set_custom_fields_filter_default_true.rb b/db/migrate/20231212131603_set_custom_fields_filter_default_true.rbnew file mode 100644index 00000000000..dedb75a252e--- /dev/null+++ b/db/migrate/20231212131603_set_custom_fields_filter_default_true.rb@@ -0,0 +1,9 @@+class SetCustomFieldsFilterDefaultTrue < ActiveRecord::Migration[7.0]+ def up+ change_column_default :custom_fields, :is_filter, true+ end++ def down+ change_column_default :custom_fields, :is_filter, false+ end+end