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

inject translated message instead of using link on translation

Bruno Pagnob9dcf3eb28a7
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index 55d76426ebf..e95034ef070 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -1453,6 +1453,3 @@ en:
waiting_subtitle:
network_off: "There is a network problem."
network_on: "Network is back. We are trying."
- timeout: >
- OpenProject could not provide you access to the project folder within the expected period of time. Please, try once again.<br><br>
- If that problem persists please contact your OpenProject administrator to check the <a href="https://www.openproject.org/docs/system-admin-guide/files/external-file-storages/health-status/">health status of the file storage setup</a>.
diff --git a/frontend/src/stimulus/controllers/dynamic/storages/open-project-storage-modal.controller.ts b/frontend/src/stimulus/controllers/dynamic/storages/open-project-storage-modal.controller.ts
index 6e3ad561e7a..046c0100bb4 100644
--- a/frontend/src/stimulus/controllers/dynamic/storages/open-project-storage-modal.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/storages/open-project-storage-modal.controller.ts
@@ -36,12 +36,14 @@ export default class OpenProjectStorageModalController extends Controller<HTMLDi
static values = {
projectStorageOpenUrl: String,
redirectUrl: String,
+ subtitleTimeoutText: String,
};
loadingInterval:number;
timeoutInterval:number;
networkErrorHappened:boolean;
projectStorageOpenUrlValue:string;
+ subtitleTimeoutTextValue:string;
redirectUrlValue:string;
connect() {
@@ -132,9 +134,7 @@ export default class OpenProjectStorageModalController extends Controller<HTMLDi
);
}
if (waitingSubtitle) {
- waitingSubtitle.innerHTML = I18n.t(
- 'js.open_project_storage_modal.waiting_subtitle.timeout',
- );
+ waitingSubtitle.innerHTML = this.subtitleTimeoutTextValue;
}
}
}
diff --git a/lib/open_project/static/links.rb b/lib/open_project/static/links.rb
index 3cf20939e29..ed1dcb06eef 100644
--- a/lib/open_project/static/links.rb
+++ b/lib/open_project/static/links.rb
@@ -305,6 +305,9 @@ module OpenProject
},
troubleshooting: {
href: "https://www.openproject.org/docs/user-guide/file-management/nextcloud-integration/#possible-errors-and-troubleshooting"
+ },
+ health_status: {
+ href: "https://www.openproject.org/docs/system-admin-guide/files/external-file-storages/health-status/"
}
},
ical_docs: {
diff --git a/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb b/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb
index 56feb9d121a..baf796521fa 100644
--- a/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb
+++ b/modules/storages/app/components/storages/open_project_storage_modal_component.html.erb
@@ -1,7 +1,7 @@
<%= render(
Primer::Alpha::Dialog.new(id: self.class.dialog_id,
title: 'Open project folder modal',
- data: @data)
+ data:)
) do |dialog| %>
<% dialog.with_header(display: :none) %>
<% dialog.with_body(id: self.class.dialog_body_id, p: 2) do %>
diff --git a/modules/storages/app/components/storages/open_project_storage_modal_component.rb b/modules/storages/app/components/storages/open_project_storage_modal_component.rb
index 7af3c0811d7..c864c2efaff 100644
--- a/modules/storages/app/components/storages/open_project_storage_modal_component.rb
+++ b/modules/storages/app/components/storages/open_project_storage_modal_component.rb
@@ -29,15 +29,13 @@
#++
class Storages::OpenProjectStorageModalComponent < ViewComponent::Base
+ attr_reader :controller, :project_storage_open_url, :redirect_url, :state
+
def initialize(project_storage_open_url:, redirect_url:, state:, **options)
super
- controller = "storages--open-project-storage-modal"
- @data = {
- controller:,
- "application-target": "dynamic",
- "#{controller}-project-storage-open-url-value": project_storage_open_url,
- "#{controller}-redirect-url-value": redirect_url
- }
+ @controller = "storages--open-project-storage-modal"
+ @project_storage_open_url = project_storage_open_url
+ @redirect_url = redirect_url
@state = state
end
@@ -48,4 +46,24 @@ class Storages::OpenProjectStorageModalComponent < ViewComponent::Base
def self.dialog_body_id
"open-project-storage-modal-body-component"
end
+
+ def data
+ @data ||= {
+ controller:,
+ "application-target": "dynamic",
+ "#{controller}-project-storage-open-url-value": project_storage_open_url,
+ "#{controller}-redirect-url-value": redirect_url,
+ "#{controller}-subtitle-timeout-text-value": subtitle_timeout_text
+ }
+ end
+
+ def subtitle_timeout_text
+ href = OpenProject::Static::Links[:storage_docs][:health_status][:href]
+ I18n.t(
+ "storages.open_project_storage_modal.timeout.subtitle",
+ storages_health_link: render(Primer::Beta::Link.new(href:, target: "_blank")) do
+ I18n.t("storages.open_project_storage_modal.timeout.link_text")
+ end
+ )
+ end
end
diff --git a/modules/storages/config/locales/en.yml b/modules/storages/config/locales/en.yml
index 216d8ee4e36..528fdbce045 100644
--- a/modules/storages/config/locales/en.yml
+++ b/modules/storages/config/locales/en.yml
@@ -344,6 +344,9 @@ en:
success:
subtitle: You are being redirected
title: Integration setup completed
+ timeout:
+ link_text: health status of the file storage setup
+ subtitle: OpenProject could not provide you access to the project folder within the expected period of time. Please, try once again.<br><br> If that problem persists please contact your OpenProject administrator to check the %{storages_health_link}.
waiting:
subtitle: One moment please, this might take some time...
title: We are setting up your permissions on the project folder.