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

[#43185] Show alert when storage is not added to any project

Andreas Pfohl8e7bc2b2b8d2
diff --git a/modules/storages/app/views/storages/admin/storages/show.html.erb b/modules/storages/app/views/storages/admin/storages/show.html.erb
index f1e15c439d0..3737f1fdcbd 100644
--- a/modules/storages/app/views/storages/admin/storages/show.html.erb
+++ b/modules/storages/app/views/storages/admin/storages/show.html.erb
@@ -50,13 +50,15 @@ See COPYRIGHT and LICENSE files for more details.
</li>
<% end %>
-<div class="op-toast -warning -with-bottom-spacing">
- <div class="op-toast--content">
- <p>
- <%= t('repositories.storage.show_warning_details') %>
- </p>
+<% if @object.projects.empty? %>
+ <div class="op-toast -warning -with-bottom-spacing">
+ <div class="op-toast--content">
+ <p>
+ <%= t('repositories.storage.show_warning_details') %>
+ </p>
+ </div>
</div>
-</div>
+<% end %>
<div class="attributes-group">
<div class="attributes-group--header">
@@ -108,20 +110,20 @@ See COPYRIGHT and LICENSE files for more details.
<h3 class="attributes-group--header-text">OpenProject <%= t(:'storages.label_oauth_application_details') %></h3>
</div>
</div>
- <div class="attributes-key-value">
- <div class="attributes-key-value--key">OpenProject <%= t(:'storages.label_oauth_client_id') %></div>
- <div class="attributes-key-value--value-container">
- <div class="attributes-key-value--value -text">
- <span><%= @object.oauth_application.uid %></span>
- </div>
+ <div class="attributes-key-value">
+ <div class="attributes-key-value--key">OpenProject <%= t(:'storages.label_oauth_client_id') %></div>
+ <div class="attributes-key-value--value-container">
+ <div class="attributes-key-value--value -text">
+ <span><%= @object.oauth_application.uid %></span>
</div>
- <div class="attributes-key-value--key">OpenProject <%= t(:'storages.label_oauth_client_secret') %></div>
- <div class="attributes-key-value--value-container">
- <div class="attributes-key-value--value -text">
- <span>●●●●●●●●●●●●●●●●</span>
- </div>
+ </div>
+ <div class="attributes-key-value--key">OpenProject <%= t(:'storages.label_oauth_client_secret') %></div>
+ <div class="attributes-key-value--value-container">
+ <div class="attributes-key-value--value -text">
+ <span>●●●●●●●●●●●●●●●●</span>
</div>
</div>
+ </div>
</div>
<% end %>