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

Added more mail styling

Andreas Pfohl3e1a98f23ce5
diff --git a/app/components/mailer/label_component.html.erb b/app/components/mailer/label_component.html.erb
index 67f1f343be6..451e80c1486 100644
--- a/app/components/mailer/label_component.html.erb
+++ b/app/components/mailer/label_component.html.erb
@@ -3,8 +3,9 @@
<td style="color: <%= @color %>;
background-color: #FFFFFF;
white-space: nowrap;
- padding: 0px 7px;
+ padding: 0 7px;
font-size: 12px;
+ font-weight: 600;
line-height: 18px;
border: 0.8px <%= @color %> solid;
border-radius: 24px;">
diff --git a/lib/open_project/static/links.rb b/lib/open_project/static/links.rb
index 60101679213..4e2ddc22547 100644
--- a/lib/open_project/static/links.rb
+++ b/lib/open_project/static/links.rb
@@ -273,6 +273,9 @@ module OpenProject
},
one_drive_oauth_application: {
href: 'https://portal.azure.com/'
+ },
+ troubleshooting: {
+ href: 'https://www.openproject.org/docs/user-guide/file-management/nextcloud-integration/#possible-errors-and-troubleshooting'
}
},
ical_docs: {
diff --git a/modules/storages/app/components/storages/admin/mailer/health_status_notification_component.html.erb b/modules/storages/app/components/storages/admin/mailer/health_status_notification_component.html.erb
deleted file mode 100644
index 6dd45aa992a..00000000000
--- a/modules/storages/app/components/storages/admin/mailer/health_status_notification_component.html.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-<a style="text-decoration: none;display: block;" href="/" target="_blank">
- <%= render 'mailer/border_table' do %>
- <tr><td>Foo</td></tr>
- <% end %>
-</a>
diff --git a/modules/storages/app/components/storages/admin/mailer/health_status_notification_component.rb b/modules/storages/app/components/storages/admin/mailer/health_status_notification_component.rb
deleted file mode 100644
index 17aa593a8af..00000000000
--- a/modules/storages/app/components/storages/admin/mailer/health_status_notification_component.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) 2012-2024 the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2013 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See COPYRIGHT and LICENSE files for more details.
-#++
-#
-
-module Storages::Admin
- module Mailer
- class HealthStatusNotificationComponent < ViewComponent::Base
- include MailLayoutHelper
- end
- end
-end
diff --git a/modules/storages/app/views/storages/storages_mailer/_health_status_notification.html.erb b/modules/storages/app/views/storages/storages_mailer/_health_status_notification.html.erb
new file mode 100644
index 00000000000..c4d57376d71
--- /dev/null
+++ b/modules/storages/app/views/storages/storages_mailer/_health_status_notification.html.erb
@@ -0,0 +1,80 @@
+<a style="text-decoration: none;display: block;" href="<%= url %>" target="_blank">
+ <%= render layout: 'mailer/border_table' do %>
+ <tr>
+ <td>
+ <table <%= placeholder_table_styles(width: '100%', style: 'width:100%;font-size:14px;') %>>
+ <tr>
+ <%= placeholder_cell('12px', vertical: true) %>
+ <td>
+ <table <%= placeholder_table_styles %>>
+ <tr>
+ <td>
+ <%= render Mailer::LabelComponent.new(scheme: :danger, text: 'Error') %>
+ </td>
+
+ <%= placeholder_cell('8px', vertical: true) %>
+
+ <td style="color: #878787; font-size: 12px; font-weight: 700;">
+ <%= storage_type %> - <%= storage_url %>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <%= placeholder_cell('12px', vertical: true) %>
+ </tr>
+
+ <tr>
+ <%= placeholder_cell('8px', vertical: false) %>
+ </tr>
+
+ <tr>
+ <%= placeholder_cell('12px', vertical: true) %>
+ <td style="font-weight: 700; line-height: 20px; color: black;"><%= storage_name %></td>
+ <%= placeholder_cell('12px', vertical: true) %>
+ </tr>
+
+ <tr>
+ <%= placeholder_cell('8px', vertical: false) %>
+ </tr>
+
+ <tr id="reason">
+ <%= placeholder_cell('12px', vertical: true) %>
+ <td style="color: #878787; font-size: 12px; font-weight: 400; line-height: 16px;"><%= reason %></td>
+ <%= placeholder_cell('12px', vertical: true) %>
+ </tr>
+
+ <% if is_nextcloud %>
+ <tr id="troubleshooting">
+ <%= placeholder_cell('12px', vertical: true) %>
+ <td style="color: #878787; font-size: 12px; font-weight: 400; line-height: 16px;">For more information,
+ check file storages <a href="<%= troubleshooting_url %>">troubleshooting documentation</a>.
+ </td>
+ <%= placeholder_cell('12px', vertical: true) %>
+ </tr>
+ <% end %>
+ </table>
+ </td>
+ </tr>
+ <% end %>
+</a>
+
+<table <%= placeholder_table_styles(width: '100%', style: "width:100%;") %>>
+ <tr>
+ <%= placeholder_cell('12px', vertical: false) %>
+ </tr>
+
+ <tr>
+ <td>
+ <a style="text-decoration: none; line-height: 24px; font-size: 14px"
+ href="<%= url %>"
+ target="_blank"
+ rel="noopener noreferrer">
+ <%= I18n.t('mail.work_packages.open_in_browser') %>
+ </a>
+ </td>
+ </tr>
+
+ <tr>
+ <%= placeholder_cell('20px', vertical: false) %>
+ </tr>
+</table>
diff --git a/modules/storages/app/views/storages/storages_mailer/notify_unhealthy.html.erb b/modules/storages/app/views/storages/storages_mailer/notify_unhealthy.html.erb
index 38744817ed7..4da25a4a006 100644
--- a/modules/storages/app/views/storages/storages_mailer/notify_unhealthy.html.erb
+++ b/modules/storages/app/views/storages/storages_mailer/notify_unhealthy.html.erb
@@ -38,9 +38,16 @@ See COPYRIGHT and LICENSE files for more details.
button_text: I18n.t(:'mail.storages.health.see_storage_settings')
}) %>
- <div>Foo</div>
-
- <%= render(Storages::Admin::Mailer::HealthStatusNotificationComponent.new) %>
+ <%= render(partial: 'health_status_notification',
+ locals: {
+ url: @url,
+ storage_name: @storage.name,
+ storage_type: I18n.t("storages.provider_types.#{@storage.short_provider_type}.name"),
+ storage_url: @storage.host,
+ reason: "#{@storage.health_reason_identifier} - #{@storage.health_reason_description}",
+ is_nextcloud: @storage.provider_type == ::Storages::Storage::PROVIDER_TYPE_NEXTCLOUD,
+ troubleshooting_url: ::OpenProject::Static::Links[:storage_docs][:troubleshooting][:href]
+ }) %>
</td>
</tr>
</table>