-
-
Notifications
You must be signed in to change notification settings - Fork 394
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: added unit for sodium in India #10041
feat: added unit for sodium in India #10041
Conversation
You will see the changes when you edit a product (the default unit should be mg for sodium), and when you view the product page. Make sure to run "make build_taxonomies" and "make restart" first. Sodium is automatically converted to salt, so you should put the same unit for salt. Can you try and see if it works as expected? Also, could you look in Food.pm, there is a table that defines which nutrients are listed by default on nutrition facts table for specific countries: %nutriments_tables = ( Could you try to add a table for India, so that it shows the nutrients that are printed on food packages in India? (for instance sodium instead of salt, but also added sugars, cholesterol etc.) |
Sure.. I'll try and update you soon |
@stephanegigandet , as expected, I'm getting this in the edit product of a mango drink from India whose dummy data and couple of pictures I was adding to test. |
@@ -87,6 +87,8 @@ BEGIN { | |||
|
|||
&check_nutriscore_categories_exist_in_taxonomy | |||
|
|||
&get_nutrient_unit |
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.
I think it would be great if you could add a unit test in food.t
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.
It looks good, thank you @himanshisrestha
As @hangy suggests, could you add a simple test for the get_nutrient_unit function in food.t ?
Maybe one test for India to get the unit_in, and one test for a country for which we don't have a unit, to check that we get the default unit.
Sure ... Working on it !! |
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10041 +/- ##
==========================================
+ Coverage 49.54% 49.59% +0.04%
==========================================
Files 67 70 +3
Lines 20650 20940 +290
Branches 4980 5021 +41
==========================================
+ Hits 10231 10385 +154
- Misses 9131 9264 +133
- Partials 1288 1291 +3 ☔ View full report in Codecov by Sentry. |
- Added unit_in:en: mg key value pair to the nutrients taxonomy - Made a new subroutine in Food.pm named get_nutrient_unit - added a test in food.t - Fixes #10038
What
I'vent been able to see effects that the changes made
Related issue(s) and discussion