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

Map filters on the board itself

Oliver Günther0d9b4bdcf012
diff --git a/modules/boards/app/services/boards/copy_service.rb b/modules/boards/app/services/boards/copy_service.rb
index 956d9e982dc..ae180cb02e9 100644
--- a/modules/boards/app/services/boards/copy_service.rb
+++ b/modules/boards/app/services/boards/copy_service.rb
@@ -31,8 +31,23 @@ module Boards
protected
def set_attributes_params(params)
- super
- .merge(project: state.project || model.project)
+ super.deep_symbolize_keys.tap do |hash|
+ hash[:project] = state.project || model.project
+
+ hash[:options] = mapped_options(hash[:options]) if hash.key?(:options)
+ end
+ end
+
+ def mapped_options(options)
+ options[:filters] = mapped_filters(options[:filters]) if options.key?(:filters)
+
+ options
+ end
+
+ def mapped_filters(filters)
+ ::Queries::Copy::FiltersMapper
+ .new(state)
+ .map_filters(filters)
end
end
end