-
-
Notifications
You must be signed in to change notification settings - Fork 403
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: Nutrient levels knowledge panels with facts and recommendations #6980
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
LGTM but a minor remark (also tested ok)
"html": | ||
` | ||
<b>[% lang("knowledge_panels_facts") %]</b> | ||
<ul> | ||
<li>[% lang('nutrient_info_salt_risk') %]</li> | ||
<li>[% lang('nutrient_info_salt_high_blood_pressure') %]</li> | ||
<li>[% lang('nutrient_info_salt_high_consumption') %]</li> | ||
</ul> | ||
<br> | ||
<b>[% lang("knowledge_panels_recommendation") %]</b>[% sep %]: | ||
<b>[% lang('nutrient_recommendation_salt_title') %]</b> | ||
<ul> | ||
<li>[% lang('nutrient_recommendation_salt_cooking_and_table') %]</li> | ||
<li>[% lang('nutrient_recommendation_salt_limit_salty_snacks') %]</li> | ||
</ul> | ||
`, |
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 find it a bit annoying that this is defined here so deeply in a technical construct. Shouldn't we put it in an external template (that we could include here) ?
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'm not really sure if a new level of indirection would make things simpler or more complex. The initial idea was that the knowledge panels templates was the place where we could define what information is presented and how.
I'll merge as-is and we can refine
* refactor: adding perltidy to t/lang.t (#7044) Implementing perltidy to t/lang.t , will have a merge conflict with PR 6085 * taxonomy: add new Polish translations (#7068) * Polish translations of meat * add additinal polish translations of popular ingredients * taxonomy: Corrections to cheeses (#7065) Update categories.txt * refactor: adding perltidy to files (#7070) Implementing perltidy to t/dataquality.t , t/dataqualityfood.t , t/export.t * taxonomy: flaxseed fiber (#6945) * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * update taxonomy and tests Co-authored-by: Stéphane Gigandet <stephane@openfoodfacts.org> * docs: Add how-to for remote dev (Gitpod) (#7053) * docs: Add how-to for remote dev (Gitpod) * docs: Add references/badges for gitpod environments * feat: Nutrient levels knowledge panels with facts and recommendations (#6980) * feat: knowledge panels for nutrient levels #6947 * add quantity in nutrient panel title * facts + recommendations for salt * fixed conflict * add info and recommendations for sugars, fat and saturated fat * fix: fix vitamin b1 thiamin %DV (#7072) fix: fix vitamin b1 thiamin %DV #6882 * refactor: updating perl critic Changing the perl critic config file to make it easier to pick and choose what tests will run. * feat: perlcritic unused variables check * refactor: perlcritic github testing * fetch depth * add perlcritic * better error message * all errors * allow ProductOpener::PerlStandards * remove undef * comment out severity 3 Commented outunused variable, severity 3 so that there are less merge conflicts when implementing perltidy to files. * refactor: dont look into .git directory Making sure that perlcritic doesn't look into .git directory * adding perlcritic to Makefile * moving perlcritic to pull_request.yml * default for perlcritic * refactor: uncomment severity 3 * refactor: removing unused variables Co-authored-by: Teiron <12804636+Teiron@users.noreply.github.com> Co-authored-by: moon-rabbitOFF <34795011+moon-rabbitOFF@users.noreply.github.com> Co-authored-by: Stéphane Gigandet <stephane@openfoodfacts.org> Co-authored-by: Tushar <ditsuke@protonmail.com>
* refactor: adding perltidy to t/lang.t (#7044) Implementing perltidy to t/lang.t , will have a merge conflict with PR 6085 * taxonomy: add new Polish translations (#7068) * Polish translations of meat * add additinal polish translations of popular ingredients * taxonomy: Corrections to cheeses (#7065) Update categories.txt * refactor: adding perltidy to files (#7070) Implementing perltidy to t/dataquality.t , t/dataqualityfood.t , t/export.t * taxonomy: flaxseed fiber (#6945) * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * Update ingredients.txt * update taxonomy and tests Co-authored-by: Stéphane Gigandet <stephane@openfoodfacts.org> * docs: Add how-to for remote dev (Gitpod) (#7053) * docs: Add how-to for remote dev (Gitpod) * docs: Add references/badges for gitpod environments * feat: Nutrient levels knowledge panels with facts and recommendations (#6980) * feat: knowledge panels for nutrient levels #6947 * add quantity in nutrient panel title * facts + recommendations for salt * fixed conflict * add info and recommendations for sugars, fat and saturated fat * fix: fix vitamin b1 thiamin %DV (#7072) fix: fix vitamin b1 thiamin %DV #6882 * refactor: updating perl critic Changing the perl critic config file to make it easier to pick and choose what tests will run. * feat: perlcritic unused variables check * refactor: perlcritic github testing * fetch depth * add perlcritic * better error message * all errors * allow ProductOpener::PerlStandards * remove undef * comment out severity 3 Commented outunused variable, severity 3 so that there are less merge conflicts when implementing perltidy to files. * refactor: dont look into .git directory Making sure that perlcritic doesn't look into .git directory * adding perlcritic to Makefile * moving perlcritic to pull_request.yml * default for perlcritic * refactor: uncomment severity 3 * refactor: removing unused variables Co-authored-by: Teiron <12804636+Teiron@users.noreply.github.com> Co-authored-by: moon-rabbitOFF <34795011+moon-rabbitOFF@users.noreply.github.com> Co-authored-by: Stéphane Gigandet <stephane@openfoodfacts.org> Co-authored-by: Tushar <ditsuke@protonmail.com>
This adds the nutrient levels (aka nutrition traffic lights) for fat, saturated fat, sugars and salt, as knowledge panels just below the Nutri-Score panel.
It's a very good place to educate users about those nutrients: why they matter, what to do about them.
As an example, I added facts + recommendations for salt, based on the WHO and the UK NHS recommendations.
We could use default recommendations from the WHO, and then try to work with local health agencies to have more country specific health messages. (for instance in some countries, MSG / Monosodium Glutamate is a huge source of sodium, and something that should be highlighted).
Here is what it would look like on the OFF website: