Skip to content

Commit

Permalink
Merge pull request #17346 from opf/fix/57896-storages-help-link
Browse files Browse the repository at this point in the history
fix broken link to storages documentation
  • Loading branch information
brunopagno authored Dec 5, 2024
2 parents 3151cdd + b9dcf3e commit 5ceee81
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
3 changes: 0 additions & 3 deletions config/locales/js-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,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/file-storage-troubleshooting/">health status of the file storage setup</a>.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
}
}
}
3 changes: 3 additions & 0 deletions lib/open_project/static/links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ def static_links
},
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: {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -48,4 +46,24 @@ def self.dialog_id
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
3 changes: 3 additions & 0 deletions modules/storages/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5ceee81

Please sign in to comment.