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: Finalize Eco-Score knowledge panels #6017

Merged
merged 9 commits into from
Oct 26, 2021
Merged

feat: Finalize Eco-Score knowledge panels #6017

merged 9 commits into from
Oct 26, 2021

Conversation

stephanegigandet
Copy link
Contributor

This PR contains a version of the Eco-Score knowledge panel (and sub panels), that we can use to remplace the existing "Ecoscore details" dropdown.

Included changes:

  • Knowledge panels API change to make it possible to display small icons (useful for the Eco-Score subpanels)
  • Attributes API: added the grade in addition to the score (this is to avoid clients guessing if match 20 is D or E)
  • Some shortening of panels titles
  • Colors for panel titles if the panel has a specified grade (useful for Eco-Score, Nutri-Score etc.)
  • Lighter colors for panels titles backgrounds
  • Bigger padding for panel content so that it's easier to see the nesting of subpanels, and which subpanel is inside which panel.
  • Use panel groups inside the Eco-Score panel for the agribalyse LCA, adjustments, and total score

To test: add ?panels=1
e.g. https://uk.openfoodfacts.dev/product/00434034/swiss-chocolate-extra-fine-milk-marks-spencer?panels=1

Example 1:

image

Example 2:

image

Example 3:

image

The goal is to soon replace the current Eco-Score details:

image

@stephanegigandet stephanegigandet added 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels 🌱 Eco-Score https://world.openfoodfacts.org/eco-score-the-environmental-impact-of-food-products labels Oct 22, 2021
@stephanegigandet stephanegigandet requested a review from a team as a code owner October 22, 2021 16:15
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.

Seems ok, although I'm not able to test it (no eco-score data, dont have the time to upload new data now).

@stephanegigandet stephanegigandet requested review from jasmeet0817 and a team October 25, 2021 07:13
@sonarcloud
Copy link

sonarcloud bot commented Oct 25, 2021

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

@stephanegigandet stephanegigandet merged commit b14375d into main Oct 26, 2021
@stephanegigandet stephanegigandet deleted the panels branch October 26, 2021 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 Eco-Score https://world.openfoodfacts.org/eco-score-the-environmental-impact-of-food-products 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants