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
Extract user filter checking into a helper
Klaus Zandersdbfe5db1df98
diff --git a/modules/reporting/lib/widget/filters.rb b/modules/reporting/lib/widget/filters.rbindex 2117840bed4..c10544f7e9c 100644--- a/modules/reporting/lib/widget/filters.rb+++ b/modules/reporting/lib/widget/filters.rb@@ -100,8 +100,7 @@ class Widget::Filters < Widget::Base# Handling for custom widgets firstif f_cls == CostQuery::Filter::ProjectIdrender_widget Project, f, to: html- elsif f_cls.in?([CostQuery::Filter::UserId, CostQuery::Filter::LoggedById, CostQuery::Filter::AssignedToId,- CostQuery::Filter::ResponsibleId, CostQuery::Filter::AuthorId])+ elsif user_filter?(f_cls)render_widget User, f, to: htmlelsif f_cls == CostQuery::Filter::WorkPackageIdrender_widget WorkPackage, f, to: html@@ -126,6 +125,16 @@ class Widget::Filters < Widget::Baserender_widget RemoveButton, f, to: htmlend# rubocop:enable Metrics/PerceivedComplexity++ def user_filter?(f_cls)+ f_cls.in?([+ CostQuery::Filter::UserId,+ CostQuery::Filter::LoggedById,+ CostQuery::Filter::AssignedToId,+ CostQuery::Filter::ResponsibleId,+ CostQuery::Filter::AuthorId+ ])+ endend# rubocop:enable Metrics/AbcSize