Skip to content

Commit

Permalink
Add documentation links to error messages
Browse files Browse the repository at this point in the history
Linking to two places in the documentation from the two
connection checks we have for storages.
  • Loading branch information
NobodysNightmare committed Jan 6, 2025
1 parent 2e69e08 commit b4518a6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions modules/storages/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b4518a6

Please sign in to comment.