From b4518a64d5d74c78a21ed18ea6005d79cec654b3 Mon Sep 17 00:00:00 2001 From: Jan Sandbrink Date: Mon, 6 Jan 2025 16:50:38 +0100 Subject: [PATCH] Add documentation links to error messages Linking to two places in the documentation from the two connection checks we have for storages. --- .../admin/side_panel/health_status_component.html.erb | 7 +++++++ .../side_panel/validation_result_component.html.erb | 10 +++++++++- modules/storages/config/locales/en.yml | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) 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..5f6cb79d8f43 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: "https://www.openproject.org/docs/system-admin-guide/files/external-file-storages/health-status/#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..b4e72df3488e 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, + "https://www.openproject.org/docs/system-admin-guide/files/external-file-storages/health-status/#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