Provide better message when users are deleted in background

https://community.openproject.org/wp/45459
pull/11876/head
Oliver Günther 2 years ago
parent ad594c4e97
commit ab0825ed25
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 2
      app/controllers/users_controller.rb
  2. 2
      config/locales/en.yml
  3. 4
      spec/controllers/users_controller_spec.rb
  4. 6
      spec/features/users/delete_spec.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

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

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

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

Loading…
Cancel
Save