diff --git a/app/components/custom_fields/details_component.rb b/app/components/custom_fields/details_component.rb index 31b51f12b82..e2d4f0272ee 100644 --- a/app/components/custom_fields/details_component.rb +++ b/app/components/custom_fields/details_component.rb @@ -84,8 +84,12 @@ module CustomFields end def persisted_cf_has_no_items_or_projects? - if custom_field.list? && custom_field.custom_options.empty? && custom_field.projects.empty? - return true + if custom_field.list? && custom_field.custom_options.empty? + if custom_field.respond_to?(:projects) + custom_field.projects.empty? + end + + true end custom_field.persisted? && diff --git a/app/forms/custom_fields/details_form.rb b/app/forms/custom_fields/details_form.rb index 57d4f747f26..eb37d53f2ee 100644 --- a/app/forms/custom_fields/details_form.rb +++ b/app/forms/custom_fields/details_form.rb @@ -82,7 +82,6 @@ module CustomFields details_form.text_field( name: :regexp, label: label(:regexp), - size: 50, caption: instructions(:regexp), input_width: :medium ) @@ -238,7 +237,7 @@ module CustomFields end def show_right_to_left_field? - %w[text].include?(model.field_format) + model.is_a?(WorkPackageCustomField) && %w[text].include?(model.field_format) end def show_multi_value_field? @@ -258,7 +257,8 @@ module CustomFields end def show_is_searchable_field? - %w[bool date float int user version hierarchy weighted_item_list calculated_value].exclude?(model.field_format) + (model.is_a?(WorkPackageCustomField) || model.is_a?(ProjectCustomField)) && + %w[bool date float int user version hierarchy weighted_item_list calculated_value].exclude?(model.field_format) end def show_non_open_versions_field? diff --git a/app/views/admin/settings/project_custom_fields/list_items.html.erb b/app/views/admin/settings/project_custom_fields/list_items.html.erb index f0adfc60203..6247d928387 100644 --- a/app/views/admin/settings/project_custom_fields/list_items.html.erb +++ b/app/views/admin/settings/project_custom_fields/list_items.html.erb @@ -65,10 +65,10 @@ See COPYRIGHT and LICENSE files for more details. flex.with_column do render Primer::Beta::Button.new( scheme: :primary, - type: :submit, - ) do |button| + type: :submit + ) do |button| button.with_leading_visual_icon(icon: :check) - t(:button_submit) + t(:button_save) end end end diff --git a/app/views/custom_fields/_custom_options.html.erb b/app/views/custom_fields/_custom_options.html.erb index b122d871e5a..fa89235fbe6 100644 --- a/app/views/custom_fields/_custom_options.html.erb +++ b/app/views/custom_fields/_custom_options.html.erb @@ -93,7 +93,7 @@ See COPYRIGHT and LICENSE files for more details. no_label: true %> -