-
-
Notifications
You must be signed in to change notification settings - Fork 725
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 users removing last item of confirmed order on /cart page #6528
Fix users removing last item of confirmed order on /cart page #6528
Conversation
app/assets/javascripts/darkswarm/controllers/edit_bought_order_controller.js.coffee
Outdated
Show resolved
Hide resolved
2b18b94
to
6c82bdb
Compare
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.
This looks good! I think it can go to testing after a second review.
One way to potentially go further: the error message suggests that the customer should cancel the order instead of removing the last line item. Is that easy for them to do? Could we make it easier?
app/assets/javascripts/darkswarm/controllers/edit_bought_order_controller.js.coffee
Outdated
Show resolved
Hide resolved
@mprieger Do you mind if I commit these suggestions to your branch? |
I would go ahead @andrewpbrett . I hope @mprieger doesn't mind because it'd be cool to have this included in the next release. |
@sauloperez done! Needs a second review and then I think it can be moved to Test Ready. |
aab004c
to
6d6ddee
Compare
Build is failing |
Thanks @sigmundpetersen! Let's see if this fixes it. |
Hey @mprieger , Thank you for this contribution! I staged your PR, but somehow could not verify the underlying issue is fixed. Following the steps described on #5546, I was still able to remove the last item, while on the /cart page, thus breaking the order. See for example, this one: Would you like to have a second look at it? I'm moving to In Dev, for now. |
hello @mprieger Are you still available to make the required changes? Thank you for your contribution :-) |
Hello @RachL and @filipefurtad0 My apologies for the delayed response! Unfortunately, I will not be able to continue work on this at this time, but hopefully my changes (and the revisions from the reviewers) serve as a good starting point for anyone looking to pick this up. |
…_controller.js.coffee
9e9c890
to
ad8973d
Compare
Hi @filipefurtad0 - I rebased and made a small change and I'm now seeing the message show up on the cart page; I think this is ready for a re-test. One thing I did notice is that if there are multiple open orders, it still allows you to delete the last item from all the open orders except the last one. So this doesn't completely fix the problem, but I think it would be fairly uncommon for there to be multiple orders that someone is placing in an order cycle, so I think this would definitely be an improvement (if you do in fact verify it's working). |
Hey @mprieger, Thanks for this contribution! After staging your changes it's possible to verify @andrewpbrett findings - your notes really made testing this much easier, thanks Andy 👍
So, agree this is an improvement, let's merge this 👍 Instead of closing, I'd propose to downgrade #5546. Surely this PR will make it easier to address the missing scenario. |
What? Why?
Closes #5546
This change prevents users from removing the last item of a confirmed order on the /cart page. This was allowed when shops had the option to edit confirmed orders for the same OC.
The functionality is similar to what happens when an order is edited from the /orders page. The main difference is that it displays the error without a page reload. The remove button is disabled when a user presses it for 10s (the time the flash error message is displayed for) to prevent multiple error messages appearing with each button press.
What should we test?
When a shop allows edits to confirmed orders, ensure that user cannot remove last item of a confirmed order in the /cart page.
Confirm that attempting to remove an item multiple times displays at most one error message.
Release notes
Customers can no longer remove the last item of a confirmed order on the /cart page.
Changelog Category: User facing changes
Dependencies
This fix is related to #5505 and should prevent one possible cause for this bug of getting a 500 error when viewing an order from which all items were removed.