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

i18n role names and descriptions for project query sharing

Aaron Contrerasf167e736c1fb
diff --git a/app/models/sharing_strategies/project_query_strategy.rb b/app/models/sharing_strategies/project_query_strategy.rb
index 163397655b0..981b3fa7359 100644
--- a/app/models/sharing_strategies/project_query_strategy.rb
+++ b/app/models/sharing_strategies/project_query_strategy.rb
@@ -29,14 +29,17 @@
module SharingStrategies
class ProjectQueryStrategy < BaseStrategy
def available_roles
- ProjectQueryRole.all.map.with_index do |role, index|
- {
- label: role.name,
- value: role.id,
- description: "#{role.name} description", # TODO: Figure out from where we can get the description
- default: index.zero?
- }
- end
+ role_mapping = ProjectQueryRole.pluck(:builtin, :id).to_h
+
+ [
+ { label: I18n.t("sharing.project_queries.permissions.edit"),
+ value: role_mapping[Role::BUILTIN_PROJECT_QUERY_EDIT],
+ description: I18n.t("sharing.project_queries.permissions.edit_description") },
+ { label: I18n.t("sharing.project_queries.permissions.view"),
+ value: role_mapping[Role::BUILTIN_PROJECT_QUERY_VIEW],
+ description: I18n.t("sharing.project_queries.permissions.view_description"),
+ default: true }
+ ]
end
def manageable?
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 5eeb15bf996..ce8dfa601ea 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -3674,6 +3674,11 @@ en:
project_queries:
text_empty_state_header: "Shared with everyone"
text_empty_state_description: "Everyone can view this project list. You can also add individual users with extra permissions."
+ permissions:
+ view: "View"
+ view_description: "TODO: Add me"
+ edit: "Edit"
+ edit_description: "TODO: Add me as well"
working_days:
info: >
Days that are not selected are skipped when scheduling work packages (and not included in the day count).