Project

General

Profile

Actions

Defect #33116

closed

Successful deletion notice is not displayed after deleting some types of content

Added by Go MAEDA over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
UI
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

"Successful deletion" flash message is not displayed after deleting some types of objects such as issues, documents, and wiki pages. However, you will see the message after deleting time entries or messages.

I think the message should be displayed when deleting any type of content for consistency and usability.

Type of object Notice after deletion
Attachment No
Document No
Issue No
Message "Successful deletion."
News No
TimeEntry "Successful deletion."
WikiPage No

Files

33116.patch (7.58 KB) 33116.patch Yuichi HARADA, 2020-03-30 08:20
Actions #1

Updated by Yuichi HARADA over 4 years ago

The following patch will display a "Successful deletion" flash message after deleting issues, documents, news, and wiki pages.
I think that you don't need to display a flash message because the attachments disappear dynamically on the screen when you delete them.

diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb
index b9e2633cc..101e5443a 100644
--- a/app/controllers/documents_controller.rb
+++ b/app/controllers/documents_controller.rb
@@ -83,6 +83,7 @@ class DocumentsController < ApplicationController

   def destroy
     @document.destroy if request.delete?
+    flash[:notice] = l(:notice_successful_delete)
     redirect_to project_documents_path(@project)
   end

diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 0d1acc95b..b442b355b 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -448,7 +448,10 @@ class IssuesController < ApplicationController
       end
     end
     respond_to do |format|
-      format.html {redirect_back_or_default _project_issues_path(@project)}
+      format.html {
+        flash[:notice] = l(:notice_successful_delete)
+        redirect_back_or_default _project_issues_path(@project)
+      }
       format.api  {render_api_ok}
     end
   end
diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb
index 511f10ddb..a67ef88c8 100644
--- a/app/controllers/news_controller.rb
+++ b/app/controllers/news_controller.rb
@@ -115,7 +115,10 @@ class NewsController < ApplicationController
   def destroy
     @news.destroy
     respond_to do |format|
-      format.html { redirect_to project_news_index_path(@project) }
+      format.html {
+        flash[:notice] = l(:notice_successful_delete)
+        redirect_to project_news_index_path(@project)
+      }
       format.api  { render_api_ok }
     end
   end
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index 527f0b821..fdb523cb6 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -284,7 +284,10 @@ class WikiController < ApplicationController
     end
     @page.destroy
     respond_to do |format|
-      format.html { redirect_to project_wiki_index_path(@project) }
+      format.html {
+        flash[:notice] = l(:notice_successful_delete)
+        redirect_to project_wiki_index_path(@project)
+      }
       format.api { render_api_ok }
     end
   end
Actions #2

Updated by Go MAEDA over 4 years ago

  • Target version set to 4.2.0

Setting the target version to 4.2.0.

Actions #3

Updated by Go MAEDA over 4 years ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you.

Actions

Also available in: Atom PDF