-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
fix: message don't appear on fail destroy on associations #2016
fix: message don't appear on fail destroy on associations #2016
Conversation
Code Climate has analyzed commit c9afba0 and detected 0 issues on this pull request. View more on Code Climate. |
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.
Can we please add some tests for this use-case?
Then we can merge it.
respond_to do |format| | ||
format.html { redirect_back fallback_location: params[:referrer] || resources_path(resource: @resource, turbo_frame: params[:turbo_frame], view_type: params[:view_type]), error: destroy_fail_message } | ||
format.turbo_stream { render partial: "avo/partials/flash_alerts" } |
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.
Are you sure that removing the redirect
does not break other flows?
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.
None that I tested or that is covered by automatic tests
@@ -1,3 +1,3 @@ | |||
<%= turbo_stream.append "alerts" do %> | |||
<%= render Avo::FlashAlertsComponent.new flashes: flash %> | |||
<%= render Avo::FlashAlertsComponent.new flashes: flash.discard %> |
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.
Are we sure that the discard
works well with other flows as well?
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 think so, it will discard the entire flash at the end of the current action
This PR has been merged into Please check the release guide for more information. |
Description
Fixes #1918
Turbo stream errors on destroy should be more efficient and error proof
Before
before.webm
After
after.webm
Checklist:
Manual review steps
Manual reviewer: please leave a comment with output from the test if that's the case.