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

Split complex guard clause into two

Aaron Contrerasd0d820d3c8f3
diff --git a/app/components/shares/modal_body_component.rb b/app/components/shares/modal_body_component.rb
index d1b96c8f72a..231cb4bd070 100644
--- a/app/components/shares/modal_body_component.rb
+++ b/app/components/shares/modal_body_component.rb
@@ -90,7 +90,8 @@ module Shares
principal_type_filter_value = current_filter_value(params[:filters], "principal_type")
project_member_filter_value = current_filter_value(params[:filters], "also_project_member")
- return false if principal_type_filter_value.nil? || (project_scoped_entity? && project_member_filter_value.nil?)
+ return false if principal_type_filter_value.nil?
+ return false if project_scoped_entity? && project_member_filter_value.nil?
principal_type_checked =
option[:value][:principal_type] == principal_type_filter_value