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

chore[Op#50737]: define provider docs links

Kabiru Mwenjab0cd23f4b3b8
diff --git a/lib/open_project/static/links.rb b/lib/open_project/static/links.rb
index 2c1596131ce..126c12fe79c 100644
--- a/lib/open_project/static/links.rb
+++ b/lib/open_project/static/links.rb
@@ -258,6 +258,12 @@ module OpenProject
storage_docs: {
setup: {
href: 'https://www.openproject.org/docs/system-admin-guide/integrations/nextcloud/'
+ },
+ nextcloud_oauth_application: {
+ href: 'https://apps.nextcloud.com/apps/integration_openproject'
+ },
+ one_drive_oauth_application: {
+ href: 'https://docs.microsoft.com/en-us/graph/auth-register-app-v2'
}
},
ical_docs: {
diff --git a/modules/storages/app/components/storages/admin/forms/general_info_form_component.rb b/modules/storages/app/components/storages/admin/forms/general_info_form_component.rb
index 972bd896b9b..c6778138ef8 100644
--- a/modules/storages/app/components/storages/admin/forms/general_info_form_component.rb
+++ b/modules/storages/app/components/storages/admin/forms/general_info_form_component.rb
@@ -77,18 +77,14 @@ module Storages::Admin::Forms
def provider_type_select_caption
return if storage.provider_type.blank?
- if storage.provider_type_nextcloud?
- caption_for_provider_type(:nextcloud, "https://apps.nextcloud.com/apps/integration_openproject")
- elsif storage.provider_type_one_drive?
- caption_for_provider_type(:one_drive, "https://docs.microsoft.com/en-us/graph/auth-register-app-v2")
- end
+ caption_for_provider_type(storage.short_provider_type)
end
- def caption_for_provider_type(provider_type, href)
+ def caption_for_provider_type(provider_type)
I18n.t(
"storages.instructions.#{provider_type}.provider_configuration",
application_link_text: application_link_text_for(
- href,
+ ::OpenProject::Static::Links[:storage_docs][:"#{provider_type}_oauth_application"][:href],
I18n.t("storages.instructions.#{provider_type}.application_link_text")
)
).html_safe
diff --git a/modules/storages/app/views/storages/admin/storages/new.html.erb b/modules/storages/app/views/storages/admin/storages/new.html.erb
index a198fca8131..2de44f42eb4 100644
--- a/modules/storages/app/views/storages/admin/storages/new.html.erb
+++ b/modules/storages/app/views/storages/admin/storages/new.html.erb
@@ -9,7 +9,13 @@
<% end %>
<% header.with_description do %>
- <%= t("storages.instructions.new_storage") %>
+ <%=
+ t("storages.instructions.new_storage",
+ new_storage_link_text: render(
+ Primer::Beta::Link.new(href: ::OpenProject::Static::Links[:storage_docs][:setup][:href], target: '_blank')
+ ) { t("storages.instructions.new_storage_link_text") }
+ ).html_safe
+ %>
<% end %>
<% end %>
diff --git a/modules/storages/config/locales/en.yml b/modules/storages/config/locales/en.yml
index 3e4309c674f..cd1eb3e8ed7 100644
--- a/modules/storages/config/locales/en.yml
+++ b/modules/storages/config/locales/en.yml
@@ -117,7 +117,8 @@ en:
managed_project_folders_application_password: >
Copy this value from:
managed_project_folders_application_password_caption: "Enable automatic managed folders by copying this value from: %{provider_type_link}."
- new_storage: "Read our file storage documentation for more information about this setup."
+ new_storage: "Read our %{new_storage_link_text} for more information about this setup."
+ new_storage_link_text: "file storage documentation"
no_storage_set_up: "There are no file storages set up yet."
no_specific_folder: "By default, each user will start at their own home folder when they upload a file."
automatic_folder: "This will automatically create a root folder for this project and manage the access permissions for each project member."