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
fixed form input name nesting
Jonas Jabari77008c5a0226
diff --git a/app/forms/custom_fields/inputs/base/autocomplete/multi_value_input.rb b/app/forms/custom_fields/inputs/base/autocomplete/multi_value_input.rbindex 505295bb706..288fab4b56e 100644--- a/app/forms/custom_fields/inputs/base/autocomplete/multi_value_input.rb+++ b/app/forms/custom_fields/inputs/base/autocomplete/multi_value_input.rb@@ -48,8 +48,7 @@ class CustomFields::Inputs::Base::Autocomplete::MultiValueInput < ApplicationFor{multiple: true,decorated: decorated?,- inputId: id,- inputName: name+ inputId: id}enddiff --git a/app/forms/custom_fields/inputs/base/autocomplete/single_value_input.rb b/app/forms/custom_fields/inputs/base/autocomplete/single_value_input.rbindex b533da6f7a9..d14ccd4dac8 100644--- a/app/forms/custom_fields/inputs/base/autocomplete/single_value_input.rb+++ b/app/forms/custom_fields/inputs/base/autocomplete/single_value_input.rb@@ -48,8 +48,7 @@ class CustomFields::Inputs::Base::Autocomplete::SingleValueInput < ApplicationFo{multiple: false,decorated: decorated?,- inputId: id,- inputName: name+ inputId: id}enddiff --git a/app/forms/custom_fields/inputs/base/utils.rb b/app/forms/custom_fields/inputs/base/utils.rbindex 0f8f1a4dc43..9b5ba930cdd 100644--- a/app/forms/custom_fields/inputs/base/utils.rb+++ b/app/forms/custom_fields/inputs/base/utils.rb@@ -30,7 +30,6 @@ module CustomFields::Inputs::Base::Utilsdef base_input_attributes{id:,- scope_name_to_model: false, # TODO: get rid of this, should work with scope_name_to_model: truename:,label:,value:,@@ -45,8 +44,7 @@ module CustomFields::Inputs::Base::Utilsenddef name- # TODO: get rid of this, should work with scope_name_to_model: true- "#{@object.class.name.downcase}[custom_field_values][#{@custom_field.id}]"+ @custom_field.id.to_senddef labeldiff --git a/app/forms/custom_fields/inputs/multi_select_list.rb b/app/forms/custom_fields/inputs/multi_select_list.rbindex e71ff69b873..152ce7b0ef3 100644--- a/app/forms/custom_fields/inputs/multi_select_list.rb+++ b/app/forms/custom_fields/inputs/multi_select_list.rb@@ -31,7 +31,11 @@ class CustomFields::Inputs::MultiSelectList < CustomFields::Inputs::Base::Autoco# autocompleter does not set key with blank value if nothing is selected or input is cleared# in order to let acts_as_customizable handle the clearing of the value, we need to set the value to blank via a hidden field# which sends blank if autocompleter is cleared- custom_value_form.hidden(**input_attributes.merge(name: "#{input_attributes[:name]}[]", value:))+ custom_value_form.hidden(**input_attributes.merge(+ scope_name_to_model: false,+ name: "#{@object.class.name.downcase}[custom_field_values][#{input_attributes[:name]}][]",+ value:+ ))custom_value_form.autocompleter(**input_attributes) do |list|@custom_field.custom_options.each do |custom_option|diff --git a/app/forms/custom_fields/inputs/multi_version_select_list.rb b/app/forms/custom_fields/inputs/multi_version_select_list.rbindex 75ce18ef0ce..d0c3dd82ef6 100644--- a/app/forms/custom_fields/inputs/multi_version_select_list.rb+++ b/app/forms/custom_fields/inputs/multi_version_select_list.rb@@ -31,7 +31,11 @@ class CustomFields::Inputs::MultiVersionSelectList < CustomFields::Inputs::Base:# autocompleter does not set key with blank value if nothing is selected or input is cleared# in order to let acts_as_customizable handle the clearing of the value, we need to set the value to blank via a hidden field# which sends blank if autocompleter is cleared- custom_value_form.hidden(**input_attributes.merge(name: "#{input_attributes[:name]}[]", value:))+ custom_value_form.hidden(**input_attributes.merge(+ scope_name_to_model: false,+ name: "#{@object.class.name.downcase}[custom_field_values][#{input_attributes[:name]}][]",+ value:+ ))custom_value_form.autocompleter(**input_attributes) do |list|@object.versions.each do |version|diff --git a/modules/overviews/app/components/project_custom_fields/sections/edit_dialog_component.html.erb b/modules/overviews/app/components/project_custom_fields/sections/edit_dialog_component.html.erbindex 6f72a75610a..c183a723f97 100644--- a/modules/overviews/app/components/project_custom_fields/sections/edit_dialog_component.html.erb+++ b/modules/overviews/app/components/project_custom_fields/sections/edit_dialog_component.html.erb@@ -9,9 +9,7 @@) do |f|component_collection do |collection|collection.with_component(Primer::Alpha::Dialog::Body.new(my: 3, style: "max-height: 500px;")) do- f.fields_for(:custom_field_values) do |f|- render(Projects::CustomFields::Form.new(f, project: @project, custom_field_section: @project_custom_field_section))- end+ render(Projects::CustomFields::Form.new(f, project: @project, custom_field_section: @project_custom_field_section))endcollection.with_component(Primer::Alpha::Dialog::Footer.new) docomponent_collection do |footer_collection|