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
[#66411] made hidden labels localised
Eric Schubertac864125b637
diff --git a/app/components/admin/custom_fields/hierarchy/item_form_component.html.erb b/app/components/admin/custom_fields/hierarchy/item_form_component.html.erbindex 679b69cb11e..7635fd09a28 100644--- a/app/components/admin/custom_fields/hierarchy/item_form_component.html.erb+++ b/app/components/admin/custom_fields/hierarchy/item_form_component.html.erb@@ -29,6 +29,6 @@ See COPYRIGHT and LICENSE files for more details.<%=primer_form_with(**item_options) do |f|- render(CustomFields::Hierarchy::ItemForm.new(f, target_item: model, input_format:))+ render(CustomFields::Hierarchy::ItemForm.new(f, target_item: model, secondary_input_format:))end%>diff --git a/app/components/admin/custom_fields/hierarchy/item_form_component.rb b/app/components/admin/custom_fields/hierarchy/item_form_component.rbindex 6ce5c721807..551428d54ef 100644--- a/app/components/admin/custom_fields/hierarchy/item_form_component.rb+++ b/app/components/admin/custom_fields/hierarchy/item_form_component.rb@@ -57,7 +57,7 @@ module Adminendend- def input_format+ def secondary_input_formatfield_format = root.custom_field.field_formatcase field_formatwhen "hierarchy"diff --git a/app/forms/custom_fields/hierarchy/item_form.rb b/app/forms/custom_fields/hierarchy/item_form.rbindex 21952689df2..fa05ae5c9a4 100644--- a/app/forms/custom_fields/hierarchy/item_form.rb+++ b/app/forms/custom_fields/hierarchy/item_form.rb@@ -37,7 +37,7 @@ module CustomFieldsitem_form.group(layout: :horizontal) do |input_group|input_group.text_field(name: :label,- label: "Label",+ label: I18n.t("custom_fields.admin.items.placeholder.label"),value: @target_item.label,visually_hide_label: true,required: true,@@ -46,29 +46,13 @@ module CustomFieldsvalidation_message: validation_message_for(:label))- if @input_format == :short- input_group.text_field(- name: :short,- label: "Short",- value: @target_item.short,- visually_hide_label: true,- full_width: false,- required: false,- placeholder: I18n.t("custom_fields.admin.items.placeholder.short"),- validation_message: validation_message_for(:short)- )- elsif @input_format == :score- input_group.text_field(- name: :score,- label: "Score",- type: :number,- value: @target_item.score,- visually_hide_label: true,- full_width: false,- required: true,- placeholder: I18n.t("custom_fields.admin.items.placeholder.score"),- validation_message: validation_message_for(:score)- )+ case @secondary_input_format+ when :short+ short_input_field(input_group)+ when :score+ score_input_field(input_group)+ else+ raise ArgumentError, "Unsupported secondary input format: #{secondary_input_format}"endend@@ -84,10 +68,10 @@ module CustomFieldsend# @param target_item [CustomField::Hierarchy::Item] item that will be acted upon- def initialize(target_item:, input_format:)+ def initialize(target_item:, secondary_input_format:)super()@target_item = target_item- @input_format = input_format+ @secondary_input_format = secondary_input_formatendprivate@@ -96,6 +80,33 @@ module CustomFields@root ||= @target_item.parent.rootend+ def short_input_field(form_group)+ form_group.text_field(+ name: :short,+ label: I18n.t("custom_fields.admin.items.placeholder.short"),+ value: @target_item.short,+ visually_hide_label: true,+ full_width: false,+ required: false,+ placeholder: I18n.t("custom_fields.admin.items.placeholder.short"),+ validation_message: validation_message_for(:short)+ )+ end++ def score_input_field(form_group)+ form_group.text_field(+ name: :score,+ label: I18n.t("custom_fields.admin.items.placeholder.score"),+ type: :number,+ value: @target_item.score,+ visually_hide_label: true,+ full_width: false,+ required: true,+ placeholder: I18n.t("custom_fields.admin.items.placeholder.score"),+ validation_message: validation_message_for(:score)+ )+ end+def cancel_hrefif @target_item.parent.root?url_helpers.custom_field_items_path(root.custom_field_id)