-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
feat: refactor Eco-Score knowledge panels + accordion display on web #5841
Conversation
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.
Another question: What's the difference between grade
and evaluation
, I see some panels have grade
and some have evaluation
It's more the backend that says: this icon file can and should be colored. For instance if it's the car icon, the image file is in fact a black SVG icon, and it should be colored. But if it's the Nutri-Score icon, the backend will specify a different file for each grade, the image actually contains multiple colors, and we absolutely don't want the client to try to change its color. |
The possible values are different: grade: a, b, c, d, e, unknown (suitable for instance for the Eco-Score or Nutri-Score panels) |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Fixed, thank you! |
it's just a little difficult to follow as the client of the service, since the guidelines are not clear when the client should use |
In fact for both the Nutri-Score and the Eco-Score, there are both a score and a grade. The score is numeric (e.g. from -40 to 15 for the Nutri-Score, and from 0 to 100 for the Eco-Score). And the scores are then mapped to a 5 letter grade. So I don't think we should rename grade to score. |
yes, to be honest, I'm not sure what we will use the type for, and which types we will eventually have. So just ignore "type" for now. I will put "info" or something for now instead of an empty type. |
Yeah, maybe we don't need it. Currently the openfoodfacts-dart package expects something, so maybe just give a deafult value and perhaps we can remove it later |
better yet, you can just omit the |
I have a json parsing error in my browser for https://uk.openfoodfacts.dev/api/v2/product/3017620422003/nutella-ferrero?fields=knowledge_panels: |
ah, it's my rule to remove trailing commas that is a bit too aggressive, I'll fix it. |
Sorry, fix included in #5950 |
To be added soon:
To test:
Panels API result: https://uk.openfoodfacts.dev/api/v2/product/3017620422003/nutella-ferrero?fields=knowledge_panels
Panels shown on the web: https://uk.openfoodfacts.dev/product/3017620422003/nutella-ferrero?panels=1