[RFR] Return to list view when deleting a record#642
Conversation
There was a problem hiding this comment.
Why do you go back in case of error? Doesn't make sense.
There was a problem hiding this comment.
Because of #538
But true, there will be another issue here: what about deleting a record from a reference_many list?
A solution may be to add a "with_redirect" to true by default, and open the confirmation box in a pop-up. Reference many delete button would not redirect in this case. What do you think of it?
|
One thing that concerns me is that if you're coming from a filtered list you'll lose the filter. I think you should be smarter and keep the |
|
After an IRL discussion, the most easy way to achieve it is to always redirect to the previous page. We only redirect to the list view if previous page has the same entity and id than the deleted object. In this case, previous view doesn't exist anymore, whatever it is (show or edition view). |
There was a problem hiding this comment.
Console log spotted
|
Switching to RFR. |
a7b85fa to
2dadf40
Compare
|
Tests should now be green: I removed |
There was a problem hiding this comment.
How about if I click a link in the navbar rather than deleting?
There was a problem hiding this comment.
You need to bind once, or stop the listener after deletion.
There was a problem hiding this comment.
It would be unbound at controller destruction (as bound with $on).
|
unit tests fail |
b925df3 to
e9a73af
Compare
|
Green! \o/ |
[RFR] Return to list view when deleting a record
|
Thanks! |
Needs to implement and fix tests.
Closes #641.