diff --git a/lib/open_project/static/links.rb b/lib/open_project/static/links.rb index ed1dcb06eef0..61d4826633ad 100644 --- a/lib/open_project/static/links.rb +++ b/lib/open_project/static/links.rb @@ -44,8 +44,10 @@ def links @links ||= static_links.merge(dynamic_links) end - def url_for(item) - links.dig(item, :href) + def url_for(*items, anchor: nil) + url = links.dig(*items, :href) + url += "##{anchor}" if anchor.present? + url end def has?(name) diff --git a/modules/storages/app/components/storages/admin/side_panel/health_status_component.html.erb b/modules/storages/app/components/storages/admin/side_panel/health_status_component.html.erb index 15cea3bfb15a..08af88c2a3f9 100644 --- a/modules/storages/app/components/storages/admin/side_panel/health_status_component.html.erb +++ b/modules/storages/app/components/storages/admin/side_panel/health_status_component.html.erb @@ -77,6 +77,13 @@ See COPYRIGHT and LICENSE files for more details. formatted_health_reason end end + + health_status_container.with_row(mt: 2) do + render(Primer::Beta::Link.new(href: OpenProject::Static::Links.url_for(:storage_docs, :health_status, anchor: "file-storage-errors-description"))) do |link| + link.with_trailing_visual_icon(icon: 'link-external') + I18n.t("storages.health.ampf_docs_link") + end + end end end end diff --git a/modules/storages/app/components/storages/admin/side_panel/validation_result_component.html.erb b/modules/storages/app/components/storages/admin/side_panel/validation_result_component.html.erb index e87512c53dce..e10187f18ec8 100644 --- a/modules/storages/app/components/storages/admin/side_panel/validation_result_component.html.erb +++ b/modules/storages/app/components/storages/admin/side_panel/validation_result_component.html.erb @@ -46,7 +46,15 @@ See COPYRIGHT and LICENSE files for more details. end if @result.description.present? - prefix = @result.error_code? ? "#{@result.error_code.upcase}: " : "" + prefix = if @result.error_code? + link_to( + @result.error_code.upcase, + OpenProject::Static::Links.url_for(:storage_docs, :health_status, anchor: "connection-validation"), + target: "_blank" + ) + ": " + else + "" + end container.with_row(mt: 2) do render(Primer::Beta::Text.new(color: :muted, test_selector: "validation-result--description")) do diff --git a/modules/storages/config/locales/en.yml b/modules/storages/config/locales/en.yml index 7a4f175129c0..8c3cc08c7082 100644 --- a/modules/storages/config/locales/en.yml +++ b/modules/storages/config/locales/en.yml @@ -208,6 +208,7 @@ en: redirect_uri: Redirect URI storage_provider: Storage provider health: + ampf_docs_link: See error documentation checked: Last checked %{datetime} connection_validation: action: Recheck connection