Giter VIP home page Giter VIP logo

Comments (6)

dacook avatar dacook commented on July 17, 2024

Hi @filipefurtad0 , the error in the screenshot for the Price field.
I tried replicating on master, and interestingly got a slightly different problem:

  1. Enable feature toggle admin_style_v3
  2. On the /products page, choose 'New variant'; set it to have an On demand value. (do not change any other values)
  3. Hit Save changes.
  4. Notice changes are not saved, the Unit field has an error ("can't be blank"), and the On hand field has reverted to 0 (not 'on demand').
    Screenshot 2024-06-06 at 9 30 52 am

Can you provide any more details how you had the error on the price field?


I was aware of this problem with the unit field: the unit field is blank by default (1), but when you open the popout (2), it contains a 1. It's not until you change that value that the change is registered and saved.

  1. Screenshot 2024-06-06 at 9 33 48 am

  2. Screenshot 2024-06-06 at 9 33 58 am

from openfoodnetwork.

dacook avatar dacook commented on July 17, 2024

So in summary (from what I can see so far), it appears to be three problems with creating new variants:

  1. Unit field is out of sync with the popout
  2. Price field validation error? (I thought it always defaulted to 0.00)
  3. 'On demand' selection is lost when error on saving new variant

from openfoodnetwork.

RachL avatar RachL commented on July 17, 2024

I've removed the good-first-issue label while we investigate, but FYI that price field error was the one I had in #11633
=> the error appeared on a product I was NOT editing. So perhaps @filipefurtad0 edited a on-hand value, saved and got the price error on another product, hence this issue.
Now how to reproduce this... 💩

from openfoodnetwork.

filipefurtad0 avatar filipefurtad0 commented on July 17, 2024

I can't reproduce this either now @RachL, sorry. I'm not sure what changed, or whether I just bumped on what you describe @dacook, i.e., in the case that something is left blank, the choice regarding stock is not kept:

Notice changes are not saved, the Unit field has an error ("can't be blank"), and the On hand field has reverted to 0 (not 'on demand').

Therefore, I agree with your summary:

  1. Unit field is out of sync with the popout -> indeed. For a 1 kg product, the default value appearing on the dropdown is 0.001, with an empty Display as field:

image

  1. Price field validation error? (I thought it always defaulted to 0.00) -> I think price is mandatory, and can never be left blank. I think it is ok to get an error, when left blank.

  2. 'On demand' selection is lost when error on saving new variant -> fully agree, this is reproducible

from openfoodnetwork.

filipefurtad0 avatar filipefurtad0 commented on July 17, 2024

To avoid confusion, maybe it is best to close this issue, and open two issues for points 1) and 3) above? And also for point 2) as well of course, if you feel this is inconsistent behavior (to have Price as a mandatory field).

Looking at #11633 it does seem similar... Although I was not editing a variant, but rather creating a new one. Maybe there is a combination here I'm missing...

from openfoodnetwork.

filipefurtad0 avatar filipefurtad0 commented on July 17, 2024

Ok, created the two issues (mentioned above). I think we can close here.

from openfoodnetwork.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.