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

Provide better message when users are deleted in background

Oliver Güntherab0825ed25b6
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index e909720eee2..8f3623f27b3 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -228,7 +228,7 @@ class UsersController < ApplicationController
Users::DeleteService.new(model: @user, user: User.current).call
- flash[:notice] = I18n.t('account.deleted')
+ flash[:notice] = I18n.t('account.deletion_pending')
respond_to do |format|
format.html do
diff --git a/config/locales/en.yml b/config/locales/en.yml
index dd98447abbb..a5933cf6627 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -436,7 +436,7 @@ en:
account:
delete: "Delete account"
delete_confirmation: "Are you sure you want to delete the account?"
- deleted: "Account successfully deleted"
+ deletion_pending: "Account has been locked and was scheduled for deletion. Note that this process takes place in the background. It might take a few moments until the user is fully deleted."
deletion_info:
data_consequences:
other: "Of the data the user created (e.g. email, preferences, work packages, wiki entries) as much as possible will be deleted. Note however, that data like work packages and wiki entries can not be deleted without impeding the work of the other users. Such data is hence reassigned to an account called \"Deleted user\". As the data of every deleted account is reassigned to this account it will not be possible to distinguish the data the user created from the data of another deleted account."
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index 45b2df90df9..460965541a9 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -306,7 +306,7 @@ describe UsersController, type: :controller do
expect(response).to redirect_to(controller: 'account', action: 'login')
end
- it { expect(flash[:notice]).to eq(I18n.t('account.deleted')) }
+ it { expect(flash[:notice]).to eq(I18n.t('account.deletion_pending')) }
end
describe "WHEN the current user is the requested one
@@ -375,7 +375,7 @@ describe UsersController, type: :controller do
expect(response).to redirect_to(controller: 'users', action: 'index')
end
- it { expect(flash[:notice]).to eq(I18n.t('account.deleted')) }
+ it { expect(flash[:notice]).to eq(I18n.t('account.deletion_pending')) }
end
describe "WHEN the current user is the admin
diff --git a/spec/features/users/delete_spec.rb b/spec/features/users/delete_spec.rb
index b6f7a979a70..5ad32f4975c 100644
--- a/spec/features/users/delete_spec.rb
+++ b/spec/features/users/delete_spec.rb
@@ -52,7 +52,7 @@ describe 'user deletion:', type: :feature, js: true do
dialog.confirm_flow_with user_password
- expect(page).to have_content 'Account successfully deleted'
+ expect(page).to have_content 'Account has been locked and was scheduled for deletion'
expect(page).to have_current_path '/login'
end
@@ -111,7 +111,7 @@ describe 'user deletion:', type: :feature, js: true do
dialog.confirm_flow_with user_password, should_fail: false
- expect(page).to have_content 'Account successfully deleted'
+ expect(page).to have_content 'Account has been locked and was scheduled for deletion'
expect(page).to have_current_path '/users'
end
@@ -129,7 +129,7 @@ describe 'user deletion:', type: :feature, js: true do
dialog.confirm_flow_with user_password, with_keyboard: true, should_fail: false
- expect(page).to have_content 'Account successfully deleted'
+ expect(page).to have_content 'Account has been locked and was scheduled for deletion'
expect(page).to have_current_path '/users'
end