Skip to content
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: add explanation with category in the Nutri-Score and Eco-Score knowledge panels when not applicable #6844

Merged
merged 6 commits into from
Jun 3, 2022

Conversation

stephanegigandet
Copy link
Contributor

When a product does not have a Nutri-Score or an Eco-Score because the product category is excluded from the Nutri-Score and Eco-Score, we now explain why in the corresponding knowledge panel, and we list the category.

image

Fixes #6092 and #6774

@stephanegigandet stephanegigandet requested a review from a team as a code owner June 1, 2022 14:53
@stephanegigandet stephanegigandet added the 📖 Knowledge Panels - https://wiki.openfoodfacts.org/Knowledge_panels label Jun 1, 2022
@github-actions github-actions bot added Attributes https://wiki.openfoodfacts.org/Product_Attributes Display Food.pm 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. 🧪 tests Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org lang labels Jun 1, 2022
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but you forgot an image. Also I was expecting a new nutriscore-not-applicable logo ;-)

lib/ProductOpener/Attributes.pm Show resolved Hide resolved
lib/ProductOpener/Lang.pm Show resolved Hide resolved
@alexgarel
Copy link
Member

Also, @stephanegigandet, could be good to add a test for eco-score not applicable…

@alexgarel
Copy link
Member

proposal for logo:
nutriscore-notapplicable

@stephanegigandet
Copy link
Contributor Author

@alexgarel for the logos, I made a separate PR:
https://github.com/openfoodfacts/openfoodfacts-server/pull/6848/files

Santé publique France has an official logo for "Nutri-Score unknown", so I think we should use it.

I think we can use the same logo for "Nutri-Score not-applicable" as well.

Same for Eco-Score unknown and not-applicable (yet), we can use the same logo.

@stephanegigandet
Copy link
Contributor Author

Also, @stephanegigandet, could be good to add a test for eco-score not applicable…

Good point, I added a test.

@sonarcloud
Copy link

sonarcloud bot commented Jun 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

@stephanegigandet stephanegigandet merged commit 1c95c8a into main Jun 3, 2022
@stephanegigandet stephanegigandet deleted the nutri-eco branch June 3, 2022 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attributes https://wiki.openfoodfacts.org/Product_Attributes Display Food.pm 📖 Knowledge Panels - https://wiki.openfoodfacts.org/Knowledge_panels 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels lang Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. 🧪 tests Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org
Projects
Archived in project
2 participants