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

Extract 'show toggle share dialog' button condition

Aaron Contreras05d05adb94ea
diff --git a/app/components/projects/index_page_header_component.html.erb b/app/components/projects/index_page_header_component.html.erb
index 8762ae35bd2..fe6997b729d 100644
--- a/app/components/projects/index_page_header_component.html.erb
+++ b/app/components/projects/index_page_header_component.html.erb
@@ -21,7 +21,7 @@
)
end
- if query.persisted? && OpenProject::FeatureDecisions.project_list_sharing_active?
+ if show_toggle_share_dialog_button?
header.with_action_icon_button(
tag: :a,
href: dialog_project_query_members_path(query),
diff --git a/app/components/projects/index_page_header_component.rb b/app/components/projects/index_page_header_component.rb
index 119efbefd99..d947ce8c999 100644
--- a/app/components/projects/index_page_header_component.rb
+++ b/app/components/projects/index_page_header_component.rb
@@ -92,6 +92,10 @@ class Projects::IndexPageHeaderComponent < ApplicationComponent
state == :show
end
+ def show_toggle_share_dialog_button?
+ query.persisted? && OpenProject::FeatureDecisions.project_list_sharing_active?
+ end
+
def breadcrumb_items
[
{ href: projects_path, text: t(:label_project_plural) },