Project

General

Profile

Actions

Patch #35373

open

Improve project deletion warning text

Added by Felix Schäfer about 3 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
UI
Start date:
Due date:
% Done:

0%

Estimated time:

Description

This is related to #34417

The information text when deleting the user clearly states that deleting the user cannot be undone and that locking the user would be an alternative. This patch adds similar text stating the finality of deleting a project and the alternative of archiving the project to the project deletion information text.


Files

35373.patch (2.73 KB) 35373.patch Felix Schäfer, 2021-06-08 14:53
35373-1.patch (1.09 KB) 35373-1.patch Felix Schäfer, 2021-06-08 15:10
Bildschirmfoto 2021-06-08 um 15.22.32.png (6.93 KB) Bildschirmfoto 2021-06-08 um 15.22.32.png Felix Schäfer, 2021-06-08 15:23

Related issues

Related to Redmine - Feature #34417: Require explicit confirmation when deleting a user or a projectClosedGo MAEDA

Actions
Actions #1

Updated by Felix Schäfer about 3 years ago

Actions #2

Updated by Felix Schäfer about 3 years ago

The attached patch adds an "archive" link to the project deletion form. The guard for if the user is an admin is necessary because only admins can archive a project but non-admin users might be able to delete projects.

We can furthermore offer CSS to make the archive link resemble a button and to add an alert colour to the "delete" button of the project and user destroy pages. Please let me know if we should work on and provide such CSS.

Actions #3

Updated by Go MAEDA about 3 years ago

  • Target version set to Candidate for next major release
Actions #4

Updated by Go MAEDA about 3 years ago

  • Related to Feature #34417: Require explicit confirmation when deleting a user or a project added
Actions #5

Updated by Go MAEDA about 3 years ago

35373-1.patch does not render the "Archive" link as a button but as a text link.

How about using submit_tag instead of link_to in order to render the "Archive" as a button and for the consistency with app/views/users/destroy.html.erb?

diff --git a/app/views/projects/destroy.html.erb b/app/views/projects/destroy.html.erb
index f2c97449b..043cb1c5c 100644
--- a/app/views/projects/destroy.html.erb
+++ b/app/views/projects/destroy.html.erb
@@ -26,6 +26,9 @@

 <p>
   <%= submit_tag l(:button_delete) %>
+  <% if User.current.admin? and !@project_to_destroy.archived? %>
+    <%= submit_tag l(:button_archive), name: 'archive' %>
+  <% end %>
   <%= link_to l(:button_cancel), User.current.admin? ? admin_projects_path : projects_path %>
 </p>
 <% end %>
Actions #6

Updated by Felix Schäfer almost 3 years ago

Go MAEDA wrote:

35373-1.patch does not render the "Archive" link as a button but as a text link.

How about using submit_tag instead of link_to in order to render the "Archive" as a button and for the consistency with app/views/users/destroy.html.erb?

This is a good idea but would require patching the ProjectsController too, as ProjectsController#destroy does not understand archiving a project. Or we could wrap another form around the archive button.

Should we look into adapting the patch this way?

Actions

Also available in: Atom PDF