Giter VIP home page Giter VIP logo

Comments (4)

RachL avatar RachL commented on August 17, 2024 1

@chahmedejaz that sounds good! Many thanks. I assume you did it, but in doubt: we need this message to have a translation key.

I'm curious: do you have an example of cloning fail we could use when testing this PR?

from openfoodnetwork.

chahmedejaz avatar chahmedejaz commented on August 17, 2024 1

@RachL, @drummer83 -

I assume you did it, but in doubt: we need this message to have a translation key

Yes, Rachel, it will have :)

I'm curious: do you have an example of cloning fail we could use when testing this PR?

Could you please add instructions on how to make cloning fail during testing on our staging server?

This happens only for very old products that don't have valid data as per our current product/variant validations. Normally it would be very hard to reproduce unless we have very old products that were created at the time we didn't have new validations.

I have DB access, so I could also tweak or delete some entries on that variant manually, if required.

Sure Konrad, one of the ways you can create invalid products is to set nil to product's variant_unit. When you clone this product, then it will fail. However, doing this will cause some unexpected UI behavior which can be ignored for the sake of its testing.
You may refer to this spec which validates this failure case:

it "shows error message when cloning invalid record" do
# Existing product is invalid:
product_a.update_columns(variant_unit: nil)
click_product_clone "Apples"
expect(page).to have_content "Unable to clone the product"
within "table.products" do
# Products does not include the cloned product.
expect(all_input_values).not_to match /COPY OF Apples/
end
end

Please let me know if you have any questions. Thanks

from openfoodnetwork.

chahmedejaz avatar chahmedejaz commented on August 17, 2024

Hi @drummer83 - I've implemented it in such a way that the errors that can be fixed by the user will display which field has an invalid value. Any other errors will still display the default one.
Please review the new error message. Thanks.
image

CC: @RachL

from openfoodnetwork.

drummer83 avatar drummer83 commented on August 17, 2024

Thank you, @chahmedejaz! That's fine by me. The text can always be adjusted in Transifex.

Could you please add instructions on how to make cloning fail during testing on our staging server?
I have DB access, so I could also tweak or delete some entries on that variant manually, if required.

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.