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

Add warning icon to overview when version is shared with archived projects

Oliver Günther5dcd3c91f4f9
diff --git a/app/views/versions/_overview.html.erb b/app/views/versions/_overview.html.erb
index 7dcdcd3d7ca..254830d8fdc 100644
--- a/app/views/versions/_overview.html.erb
+++ b/app/views/versions/_overview.html.erb
@@ -65,6 +65,9 @@ See COPYRIGHT and LICENSE files for more details.
t(:label_x_open_work_packages_abbr, count: version.open_issues_count),
project_work_packages_open_version_path(version)) %>
(<%= '%0.0f' % (version.open_issues_count.to_f / version.work_packages.count * 100) %>%)
+ <% if version.projects.archived.exists? %>
+ <%= op_icon('icon-warning', title: I18n.t('versions.overview.work_packages_in_archived_projects')) %>
+ <% end %>
</p>
<% else %>
<%= no_results_box %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index a398dc107ad..fa9a0c73eb6 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -415,6 +415,7 @@ en:
versions:
overview:
+ work_packages_in_archived_projects: "The version is shared with archived projects which still have work packages assigned to this version. These are coutned, but will not appear in the linked views."
no_results_title_text: There are currently no work packages assigned to this version.
wiki:
diff --git a/spec/controllers/types_controller_spec.rb b/spec/controllers/types_controller_spec.rb
index 6956d23fdd1..b28b4ed8994 100644
--- a/spec/controllers/types_controller_spec.rb
+++ b/spec/controllers/types_controller_spec.rb
@@ -387,7 +387,7 @@ RSpec.describe TypesController do
.archived_projects_urls_for([archived_project])
[
I18n.t(:'error_can_not_delete_type.explanation'),
- I18n.t(:'error_can_not_delete_type.archived_projects', archived_projects_urls:)
+ I18n.t(:error_can_not_delete_in_use_archived_work_packages, archived_projects_urls:)
]
end