-
-
Couldn't load subscription status.
- Fork 758
Improve enterprise removal #13648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Improve enterprise removal #13648
Conversation
Make enterprise removal use turbo, which provides the following benefits: * More responsive removal since there's no full page reload. * A success flash message (previously nothing was displayed). * No double alert prompt. It also goes in the direction of removing mrujs in favor of turbo.
And not dependent on implementation details.
Make sure failure to delete due to dependent objects is handled through activemodel errors and not by rescuing `ActiveRecord::DeleteRestrictionError` exceptions. Previously we would display two alert prompts, and we would weirdly display the content of our 500 error page on top of the screen. Now, we display a flash error message explaining the reason to fail to remove it.
| @index = params[:index] | ||
|
|
||
| if @object.destroy | ||
| flash.now[:success] = Spree.t(:successfully_removed, resource: "Enterprise") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed a small bug here, where this particular translation key is not found as expected.
In general there are a few flash message translation bugs which I'll address in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set #13649 as a dependency of this PR, because once that's merged, the system spec that I added will need to be updated to use the properly translated text. Setting this as a draft until that one lands.
What? Why?
Removing enterprises has a few UI problems:
This PR fixes all those issues by moving enterprise removal from mrujs to turbo (which is a technical migration we want to do).
Before (success case)
After (success case)
Before (failure case)
After (failure case)
What should we test?
Release notes
Dependencies
#13649