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

fix: Repair fat placements #9569

Merged
merged 7 commits into from
Dec 21, 2023
Merged

fix: Repair fat placements #9569

merged 7 commits into from
Dec 21, 2023

Conversation

aleene
Copy link
Contributor

@aleene aleene commented Dec 21, 2023

What

Repaired the placement on mon- and polyunsaturated fats in the nutritional table

Related issue(s) and discussion

@aleene aleene requested a review from a team as a code owner December 21, 2023 10:33
@aleene aleene changed the title bug: Repair fat placements fix: Repair fat placements Dec 21, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@65e3886). Click here to learn what that means.
Report is 1 commits behind head on main.

❗ Current head 911ca61 differs from pull request most recent head 181f994. Consider uploading reports for the commit 181f994 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9569   +/-   ##
=======================================
  Coverage        ?   49.04%           
=======================================
  Files           ?       66           
  Lines           ?    20532           
  Branches        ?     4944           
=======================================
  Hits            ?    10070           
  Misses          ?     9170           
  Partials        ?     1292           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stephanegigandet
Copy link
Contributor

@aleene We currently support only 3 levels. We could add more levels, it just needs some changes in the code and the templates.

But it won't solve all issues. Look at this product for instance: https://world.openfoodfacts.org/product/3366321051983/omega-3-doux-st-hubert

image

The table in Food.pm is currently used to set up the order of the nutrients, and their level. But we currently do not use it to show nutrients for which we don't have values, but for which we have values for sub-nutrients.

So for this product, we miss "insaturated fat", so we will show something that looks like:

  • Saturated fat
    -- Mono insatured fat
    -- Poly insaturated fat

Which will look like if mono/poly insaturated fat is part of saturated fat...

So we will need more changes in the code, to display en empty line for insaturated fat even though we don't have values for it.

@aleene
Copy link
Contributor Author

aleene commented Dec 21, 2023

OK, we can make a separate issue for that.

@aleene
Copy link
Contributor Author

aleene commented Dec 21, 2023

Copy link

sonarcloud bot commented Dec 21, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@alexgarel
Copy link
Member

I tested, I got this:
image

'-omega-6-fat-', '--linoleic-acid-',
'-unsaturated-fat-', '--monounsaturated-fat-',
'---omega-9-fat-', '--polyunsaturated-fat-',
'---omega-3-fat-', '---omega-6-fat-',
Copy link
Member

Choose a reason for hiding this comment

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

the fact to have four dashes does not harm however, it's displayed as 3 :-)

Copy link
Member

Choose a reason for hiding this comment

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

image

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

@aleene aleene merged commit ab4ed7d into main Dec 21, 2023
12 checks passed
@aleene aleene deleted the aleene-8396 branch December 21, 2023 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The placement of mono and polyunsaturated fat is wrong
4 participants