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

fix[Op#58142]: Standardize projects table rendering

Kabiru Mwenja46312dd64db4
diff --git a/app/controllers/admin/custom_fields/custom_field_projects_controller.rb b/app/controllers/admin/custom_fields/custom_field_projects_controller.rb
index 5a048b40d9c..3d7dbcd3370 100644
--- a/app/controllers/admin/custom_fields/custom_field_projects_controller.rb
+++ b/app/controllers/admin/custom_fields/custom_field_projects_controller.rb
@@ -137,15 +137,6 @@ class Admin::CustomFields::CustomFieldProjectsController < ApplicationController
respond_with_project_not_found_turbo_streams
end
- def update_project_list_via_turbo_stream(url_for_action: action_name)
- update_via_turbo_stream(
- component: Admin::CustomFields::CustomFieldProjects::TableComponent.new(
- query: available_custom_fields_projects_query,
- params: { custom_field: @custom_field, url_for_action: }
- )
- )
- end
-
def available_custom_fields_projects_query
@available_custom_fields_projects_query = ProjectQuery.new(
name: "custom-fields-projects-#{@custom_field.id}"
@@ -165,7 +156,7 @@ class Admin::CustomFields::CustomFieldProjectsController < ApplicationController
def respond_with_project_not_found_turbo_streams
render_error_flash_message_via_turbo_stream message: t(:notice_project_not_found)
- update_project_list_via_turbo_stream
+ render_project_list(url_for_action: :index)
respond_with_turbo_streams
end
diff --git a/app/controllers/admin/settings/project_custom_fields_controller.rb b/app/controllers/admin/settings/project_custom_fields_controller.rb
index 8963a93944c..4c2bfce929d 100644
--- a/app/controllers/admin/settings/project_custom_fields_controller.rb
+++ b/app/controllers/admin/settings/project_custom_fields_controller.rb
@@ -182,15 +182,8 @@ module Admin::Settings
project_id: permitted_params.project_custom_field_project_mapping[:project_id]
)
rescue ActiveRecord::RecordNotFound
- render_error_flash_message_via_turbo_stream(
- message: t(:notice_file_not_found)
- )
- replace_via_turbo_stream(
- component: Settings::ProjectCustomFields::ProjectCustomFieldMapping::TableComponent.new(
- query: project_custom_field_mappings_query,
- params: { custom_field: @custom_field }
- )
- )
+ render_error_flash_message_via_turbo_stream(message: t(:notice_file_not_found))
+ render_project_list(url_for_action: :project_mappings)
respond_with_turbo_streams
end
@@ -211,10 +204,8 @@ module Admin::Settings
false
end
rescue ActiveRecord::RecordNotFound
- render_error_flash_message_via_turbo_stream(
- message: t(:notice_project_not_found)
- )
- render_project_list
+ render_error_flash_message_via_turbo_stream(message: t(:notice_project_not_found))
+ render_project_list(url_for_action: :project_mappings)
respond_with_turbo_streams
end