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

Make the title configurable in the share strategy

Klaus Zanders299ed3a29451
diff --git a/app/models/sharing_strategies/base_strategy.rb b/app/models/sharing_strategies/base_strategy.rb
index ce621df63fc..52b7ca52a74 100644
--- a/app/models/sharing_strategies/base_strategy.rb
+++ b/app/models/sharing_strategies/base_strategy.rb
@@ -66,6 +66,10 @@ module SharingStrategies
raise NotImplementedError, "Override in a subclass and return a description for the shared user"
end
+ def title
+ raise NotImplementedError, "Override in a subclass and return a title for the sharing dialog"
+ end
+
def custom_body_components?
!additional_body_components.empty?
end
diff --git a/app/models/sharing_strategies/project_query_strategy.rb b/app/models/sharing_strategies/project_query_strategy.rb
index bb950af5755..f3e10fab5d4 100644
--- a/app/models/sharing_strategies/project_query_strategy.rb
+++ b/app/models/sharing_strategies/project_query_strategy.rb
@@ -113,6 +113,10 @@ module SharingStrategies
end
end
+ def title
+ I18n.t(:label_share_project_list)
+ end
+
private
def virtual_owner_share
diff --git a/app/models/sharing_strategies/work_package_strategy.rb b/app/models/sharing_strategies/work_package_strategy.rb
index 1a16bdc7634..7561c656f4c 100644
--- a/app/models/sharing_strategies/work_package_strategy.rb
+++ b/app/models/sharing_strategies/work_package_strategy.rb
@@ -107,6 +107,10 @@ module SharingStrategies
end
end
+ def title
+ I18n.t(:label_share_work_package)
+ end
+
private
def project_member?(share)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 531b5fa9724..fea3b189fe4 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -2163,6 +2163,7 @@ en:
label_invite_user: "Invite user"
label_share: "Share"
label_share_project_list: "Share project list"
+ label_share_work_package: "Share work package"
label_show_hide: "Show/hide"
label_show_hide_n_items: "Show/hide %{count} items"
label_show_all_registered_users: "Show all registered users"