Openfoodnetwork: Add 'would you like to save changes?' alert to Product page

Created on 21 Jan 2019  路  13Comments  路  Source: openfoodfoundation/openfoodnetwork

Description

On the Bulk Edit Products page (or Inventory page), if I makes some changes and don't click save, then I navigate away from the page, my changes are lost. Can we please add a dialogue box in this case asking the user whether they want to Save Changes?

Expected Behavior

If I make some changes but don't click save, then i navigate away, I would like to be asked 'are you sure you want to discard those changes' or 'would you like to save your changes'. This helps the user to avoid making mistakes.

Actual Behavior

I accidentally navigate away without saving my changes and now I've lost all the edits I just did.

Steps to Reproduce

  1. Go to a Products page
  2. Edit something about a product and then navigate to another tab in the backed.
  3. You'll see that you are not asked 'would you like to save changes' and your edits are lost.

  4. Go to Inventory page

  5. Edit something about a product and then navigate to another tab in the backed.
  6. You'll see that you are not asked 'would you like to save changes' and your edits are lost.

Context

One example from an Aus user - I'm trying to prepare my stock availability. I think I've saved everything correctly but when I go to the shop I find the some of my edits haven't saved - I must have forgotten to click save. I wish there was an easier way to prevent these little mistakes - they are hard to rectify if I have a customer accidentally order something I don't have, or I lose sales because something I have on hand isn't showing in the shop.

Severity

bug-s3: a feature is broken but there is a workaround

Your Environment

Aus production, Desktop, Chrome

enhancement good first issue hackathon

Most helpful comment

Just getting to this now. Sorry again for the delay

All 13 comments

Would it be alright if I worked on this?

Yes that would be alright indeed @Chrisyee22 ! 馃憤 Have you already found your way to https://github.com/openfoodfoundation/openfoodnetwork#contributing ? Please ask in the #dev channel of our Slack referred there if you have any questions. Thank you and welcome to OFN!

How are you doing @Chrisyee22, need any help getting a PR ready for code review? 馃槃

Hi @daniellemoorhead, I'm just getting over a massive flu but will be finishing up my PR either this evening or tomorrow morning. 馃槃

Oh no @Chrisyee22 that doesn't sound like fun at all 馃槥
I'm glad you're on the mend and we're looking forward to seeing your PR in code review!

Just getting to this now. Sorry again for the delay

I hope you're feeling better now @Chrisyee22 and no worries about taking time. Life has a way of throwing roadblocks across our plans - happens to all of us all the time!

Hi @daniellemoorhead, I'm running into some issues as I can't seem to navigate to the producers view. I can view everything as a customer as well as log in as an admin but I am unable to to replicate this error as I am not able to view the producers inventory page. Some navigational help would be greatly appreciated. 馃槂

@Chrisyee22 to create a producer account you can transform your customer account into a producer account by navigating through the /register page.
After that, products are under /admin/products and inventory under /admin/inventory
Let me know if this is helpful.

@RachL that did help. I was able to recreate the issue.

hi! I'd like to contribute to fixing this issue, but I'm wondering if it's still open or is it already closed?

Hey @noloman you're most welcome to take on this issue, it's still open. There was some prior work done in PR #3482 by @Chrisyee22, so please look at the code and read the comments there. Work stagnated on that PR so it was closed without merge.

Please refer to Getting started and the wiki. And connect with us on Slack if you need any help!

I just tested this and you are now asked to save changes on product page.
Closing.

Was this page helpful?
0 / 5 - 0 ratings