プロジェクト

全般

プロフィール

Vote #80736

完了

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

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
UI_10
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
10
version_id:
152
issue_org_id:
33116
author_id:
332
assigned_to_id:
332
comments:
3
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

"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 |


journals

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.

<pre><code class="diff">
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
</code></pre>
--------------------------------------------------------------------------------
Setting the target version to 4.2.0.
--------------------------------------------------------------------------------
Committed the patch. Thank you.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリUI_10 にセット
  • 対象バージョン4.2.0_152 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0