Skip to content

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

[#65513] Form configuration page is broken on the work packages page

Dombi Attila0e66e4b0f5c9
diff --git a/app/views/custom_fields/_tab.html.erb b/app/views/custom_fields/_tab.html.erb
index 89fe2f80b63..999971035b5 100644
--- a/app/views/custom_fields/_tab.html.erb
+++ b/app/views/custom_fields/_tab.html.erb
@@ -144,7 +144,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= t(:label_x_projects, count: custom_field.projects.count) %></td>
<% end %>
<td>
- <% type_links = custom_field.types.map { |t| link_to(t.name, edit_tab_type_path(id: t.id, tab: "form_configuration")) } %>
+ <% type_links = custom_field.types.map { |t| link_to(t.name, edit_type_form_configuration_path(t)) } %>
<% if type_links.empty? %>
<span class="icon-context icon-warning">
<%= link_to t(:label_custom_field_add_no_type), types_path %>
diff --git a/lib/api/v3/work_packages/create_form_representer.rb b/lib/api/v3/work_packages/create_form_representer.rb
index d0f201b70da..62ef51ca3de 100644
--- a/lib/api/v3/work_packages/create_form_representer.rb
+++ b/lib/api/v3/work_packages/create_form_representer.rb
@@ -78,7 +78,7 @@ module API
represented.type_id &&
represented.type_id != 0
{
- href: edit_type_path(represented.type_id, tab: "form_configuration"),
+ href: edit_type_form_configuration_path(represented.type_id),
type: "text/html",
title: "Configure form"
}
diff --git a/lib/api/v3/work_packages/create_project_form_representer.rb b/lib/api/v3/work_packages/create_project_form_representer.rb
index fe1ee711b5a..76fea02105f 100644
--- a/lib/api/v3/work_packages/create_project_form_representer.rb
+++ b/lib/api/v3/work_packages/create_project_form_representer.rb
@@ -76,8 +76,7 @@ module API
represented.type_id &&
represented.type_id != 0
{
- href: edit_type_path(represented.type_id,
- tab: "form_configuration"),
+ href: edit_type_form_configuration_path(represented.type_id),
type: "text/html",
title: "Configure form"
}
diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rb
index e83c14ef98b..acf460e349e 100644
--- a/lib/api/v3/work_packages/work_package_representer.rb
+++ b/lib/api/v3/work_packages/work_package_representer.rb
@@ -180,7 +180,7 @@ module API
next unless represented.type_id
{
- href: edit_type_path(represented.type_id, tab: "form_configuration"),
+ href: edit_type_form_configuration_path(represented.type_id),
type: "text/html",
title: "Configure form"
}
diff --git a/spec/lib/api/v3/work_packages/create_form_representer_spec.rb b/spec/lib/api/v3/work_packages/create_form_representer_spec.rb
index a632cd72993..cf4faae4ae6 100644
--- a/spec/lib/api/v3/work_packages/create_form_representer_spec.rb
+++ b/spec/lib/api/v3/work_packages/create_form_representer_spec.rb
@@ -191,7 +191,7 @@ RSpec.describe API::V3::WorkPackages::CreateFormRepresenter do
it "has a link to configure the form" do
expected = {
- href: "/types/#{type.id}/edit?tab=form_configuration",
+ href: edit_type_form_configuration_path(type),
type: "text/html",
title: "Configure form"
}
diff --git a/spec/lib/api/v3/work_packages/create_project_form_representer_spec.rb b/spec/lib/api/v3/work_packages/create_project_form_representer_spec.rb
index 365413be55e..8120f0c08b6 100644
--- a/spec/lib/api/v3/work_packages/create_project_form_representer_spec.rb
+++ b/spec/lib/api/v3/work_packages/create_project_form_representer_spec.rb
@@ -163,7 +163,7 @@ RSpec.describe API::V3::WorkPackages::CreateProjectFormRepresenter do
it "has a link to configure the form" do
expected = {
- href: "/types/#{type.id}/edit?tab=form_configuration",
+ href: edit_type_form_configuration_path(type),
type: "text/html",
title: "Configure form"
}
diff --git a/spec/lib/api/v3/work_packages/work_package_representer_spec.rb b/spec/lib/api/v3/work_packages/work_package_representer_spec.rb
index f5c282e0827..cfd60f46e64 100644
--- a/spec/lib/api/v3/work_packages/work_package_representer_spec.rb
+++ b/spec/lib/api/v3/work_packages/work_package_representer_spec.rb
@@ -1246,7 +1246,7 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter do
it_behaves_like "has a titled link" do
let(:link) { "configureForm" }
- let(:href) { edit_type_path(work_package.type_id, tab: "form_configuration") }
+ let(:href) { edit_type_form_configuration_path(work_package.type_id) }
let(:title) { "Configure form" }
end
end