From 6b0d3e20e6c9eb7b3803a838b86592e75c815d32 Mon Sep 17 00:00:00 2001 From: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:36:49 +0100 Subject: [PATCH] Restart nutrition (#1085) * Restart nutrition * send data to robotoff --- .github/workflows/github-projects-pr.yml | 34 +- .github/workflows/github-projects.yml | 12 +- CHANGELOG.md | 370 +++++++++--------- src/pages/nutrition/config.ts | 1 + src/pages/nutrition/index.jsx | 60 --- src/pages/nutrition/index.tsx | 265 +++++++++++++ src/pages/nutrition/insight.types.ts | 24 ++ src/pages/nutrition/nutritionFields.js | 344 ---------------- src/pages/nutrition/productCard.jsx | 116 ------ src/pages/nutrition/table.jsx | 66 ---- src/pages/nutrition/tableRow.jsx | 90 ----- .../nutrition/useRobotoffPredicitions.ts | 46 +++ src/pages/nutrition/utils.ts | 70 ++++ src/robotoff.ts | 35 +- 14 files changed, 613 insertions(+), 920 deletions(-) create mode 100644 src/pages/nutrition/config.ts delete mode 100644 src/pages/nutrition/index.jsx create mode 100644 src/pages/nutrition/index.tsx create mode 100644 src/pages/nutrition/insight.types.ts delete mode 100644 src/pages/nutrition/nutritionFields.js delete mode 100644 src/pages/nutrition/productCard.jsx delete mode 100644 src/pages/nutrition/table.jsx delete mode 100644 src/pages/nutrition/tableRow.jsx create mode 100644 src/pages/nutrition/useRobotoffPredicitions.ts create mode 100644 src/pages/nutrition/utils.ts diff --git a/.github/workflows/github-projects-pr.yml b/.github/workflows/github-projects-pr.yml index d596388bcf..e6547a18cf 100644 --- a/.github/workflows/github-projects-pr.yml +++ b/.github/workflows/github-projects-pr.yml @@ -3,23 +3,23 @@ name: Add PRs to the new Hunger Games GitHub Project on: pull_request_target: types: - - assigned - - unassigned - - labeled - - unlabeled - - opened - - edited - - closed - - reopened - - synchronize - - converted_to_draft - - ready_for_review - - locked - - unlocked - - review_requested - - review_request_removed - - auto_merge_enabled - - auto_merge_disabled + - assigned + - unassigned + - labeled + - unlabeled + - opened + - edited + - closed + - reopened + - synchronize + - converted_to_draft + - ready_for_review + - locked + - unlocked + - review_requested + - review_request_removed + - auto_merge_enabled + - auto_merge_disabled jobs: add-to-project: diff --git a/.github/workflows/github-projects.yml b/.github/workflows/github-projects.yml index 27bacd7c75..439ac65318 100644 --- a/.github/workflows/github-projects.yml +++ b/.github/workflows/github-projects.yml @@ -62,13 +62,13 @@ jobs: project-url: https://github.com/orgs/openfoodfacts/projects/5 # Add issue to the folksonomy project github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} labeled: 🏷️ Folksonomy Project - label-operator: OR + label-operator: OR - uses: actions/add-to-project@main with: project-url: https://github.com/orgs/openfoodfacts/projects/44 # Add issue to the data quality project github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} labeled: 🧽 Data quality - label-operator: OR + label-operator: OR - uses: actions/add-to-project@main with: project-url: https://github.com/orgs/openfoodfacts/projects/82 # Add issue to the search project @@ -80,19 +80,19 @@ jobs: project-url: https://github.com/orgs/openfoodfacts/projects/41 # Add issue to the producer platform project github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} labeled: 🏭 Producers Platform - label-operator: OR + label-operator: OR - uses: actions/add-to-project@main with: project-url: https://github.com/orgs/openfoodfacts/projects/19 # Add issue to the infrastructure project github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} labeled: infrastructure - label-operator: OR + label-operator: OR - uses: actions/add-to-project@main with: project-url: https://github.com/orgs/openfoodfacts/projects/92 # Add issue to the Nutri-Score project github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} labeled: 🚥 Nutri-Score game - label-operator: OR + label-operator: OR - uses: actions/add-to-project@main with: project-url: https://github.com/orgs/openfoodfacts/projects/132 # Add issue to the Top upvoted issues board @@ -110,4 +110,4 @@ jobs: project-url: https://github.com/orgs/openfoodfacts/projects/35 # Add issue to the ♿️ accessibility project github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} labeled: ♿️ accessibility - label-operator: OR + label-operator: OR diff --git a/CHANGELOG.md b/CHANGELOG.md index a4fcce5162..2065c5167b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,195 +2,191 @@ ## 1.0.0 (2024-09-26) - ### Features -* Add a game to annotate ingredients ([#769](https://github.com/openfoodfacts/hunger-games/issues/769)) ([966e156](https://github.com/openfoodfacts/hunger-games/commit/966e1567a38a5b4eb14e95a5c994f2128faa6dd3)) -* add a page to experiment with grid selection ([#48](https://github.com/openfoodfacts/hunger-games/issues/48)) ([404a2c6](https://github.com/openfoodfacts/hunger-games/commit/404a2c6adcec9fce6b2c30ff2640b4dfe9c0dc88)) -* Add autosuggestion for labels and categories ([#215](https://github.com/openfoodfacts/hunger-games/issues/215)) ([e8a6efb](https://github.com/openfoodfacts/hunger-games/commit/e8a6efb5c0d44d906208e2eeaf0fcda7df429b35)) -* add brandinator ([#801](https://github.com/openfoodfacts/hunger-games/issues/801)) ([c16fd8f](https://github.com/openfoodfacts/hunger-games/commit/c16fd8f48a66bea72fbdf811bf0f89d37fd7e71d)) -* add country list in settings page, using it as default country in eco-score ([#892](https://github.com/openfoodfacts/hunger-games/issues/892)) ([5f92e6a](https://github.com/openfoodfacts/hunger-games/commit/5f92e6a9e708a4a2c9722f4ff6a5507b78b17e46)) -* add Japanese selection in options ([#282](https://github.com/openfoodfacts/hunger-games/issues/282)) ([7472abb](https://github.com/openfoodfacts/hunger-games/commit/7472abb6ec2e255fd2236db72c21e961ada78171)) -* add Japanese selection in options since we now have translations ([7472abb](https://github.com/openfoodfacts/hunger-games/commit/7472abb6ec2e255fd2236db72c21e961ada78171)) -* Add lazy import for different routes ([#656](https://github.com/openfoodfacts/hunger-games/issues/656)) ([b9d4f93](https://github.com/openfoodfacts/hunger-games/commit/b9d4f93f615ba6fa71ad08449a0014135c321c30)) -* add links related to open food facts in settings route. ([#539](https://github.com/openfoodfacts/hunger-games/issues/539)) ([747e6e1](https://github.com/openfoodfacts/hunger-games/commit/747e6e1894eaa1c50984e1949cf7520f8993ab5f)) -* add loading animation before question display ([#498](https://github.com/openfoodfacts/hunger-games/issues/498)) ([c530360](https://github.com/openfoodfacts/hunger-games/commit/c530360ad0b0e9475b49fcbfa30bec1b85ad39cb)) -* add packaging taxonomy + some dark mode fixes ([#350](https://github.com/openfoodfacts/hunger-games/issues/350)) ([15ea04d](https://github.com/openfoodfacts/hunger-games/commit/15ea04d79d84e64879a0686b190eaabdf8885762)) -* Add shortcut for nutriscore selection ([#168](https://github.com/openfoodfacts/hunger-games/issues/168)) ([86d6783](https://github.com/openfoodfacts/hunger-games/commit/86d67837f24ab76b4da8ce1eb0c65cd228a50b84)) -* add shortcut to crop from question game ([#851](https://github.com/openfoodfacts/hunger-games/issues/851)) ([a59bcc2](https://github.com/openfoodfacts/hunger-games/commit/a59bcc2979b8e8c843c1fa1737578ad18dbb995e)) -* Added an explanation for The Logo Game (solves [#84](https://github.com/openfoodfacts/hunger-games/issues/84)) ([#119](https://github.com/openfoodfacts/hunger-games/issues/119)) ([8344473](https://github.com/openfoodfacts/hunger-games/commit/83444731d7136d5afcba2c19146e8a1281538891)) -* added Croatian and Swedish ([#587](https://github.com/openfoodfacts/hunger-games/issues/587)) ([67ec36f](https://github.com/openfoodfacts/hunger-games/commit/67ec36f7e9d46014151d2fdb600243c80fc41dcb)) -* added NL lang ([#590](https://github.com/openfoodfacts/hunger-games/issues/590)) ([8e4a24d](https://github.com/openfoodfacts/hunger-games/commit/8e4a24de997877f17da8a45a0a61f254a2e0d01c)) -* adding deeplinks to logo dashboards ([#803](https://github.com/openfoodfacts/hunger-games/issues/803)) ([12a3efa](https://github.com/openfoodfacts/hunger-games/commit/12a3efa957bff5b71b6d13b0d00c79c195274173)) -* Allow flagging logo in edit page ([#172](https://github.com/openfoodfacts/hunger-games/issues/172)) ([2b2a0f4](https://github.com/openfoodfacts/hunger-games/commit/2b2a0f4f7d15ecd7a0834a6188667daf8f0785b7)) -* Allow to remove some logos from deep search ([#713](https://github.com/openfoodfacts/hunger-games/issues/713)) ([497d547](https://github.com/openfoodfacts/hunger-games/commit/497d547d68c0ffd00e7e4c9882d362f112406b28)) -* Allows to access all the logo sub-games ([#357](https://github.com/openfoodfacts/hunger-games/issues/357)) ([f105497](https://github.com/openfoodfacts/hunger-games/commit/f105497928cf095ec81707b66b3f52ae047164de)) -* Allows to do deep first search in logo annotation ([#328](https://github.com/openfoodfacts/hunger-games/issues/328)) ([27f14e9](https://github.com/openfoodfacts/hunger-games/commit/27f14e9c207928e0c591ed36f066960ffe319579)) -* Allows to edit favorite question cards ([#50](https://github.com/openfoodfacts/hunger-games/issues/50)) ([31e8fb8](https://github.com/openfoodfacts/hunger-games/commit/31e8fb8d36e03cd08dcb7132aa2d87d934720a30)) -* Allows to fetch 50 additional logos (up to 500) ([#217](https://github.com/openfoodfacts/hunger-games/issues/217)) ([1725ee7](https://github.com/openfoodfacts/hunger-games/commit/1725ee772d402480a68f518c7519ac1f3f1c162f)) -* Allows to fetch logos from some categories ([#320](https://github.com/openfoodfacts/hunger-games/issues/320)) ([25f9f4e](https://github.com/openfoodfacts/hunger-games/commit/25f9f4e2662f9e70f033d0826712a5c0342118c3)) -* allows to save filters ([#36](https://github.com/openfoodfacts/hunger-games/issues/36)) ([0c18eb0](https://github.com/openfoodfacts/hunger-games/commit/0c18eb00b587df15388c4052dfe0fbfee0b085f3)) -* allows to see packaging interface for specific products ([#411](https://github.com/openfoodfacts/hunger-games/issues/411)) ([ccfacea](https://github.com/openfoodfacts/hunger-games/commit/ccfaceab8e77daec47439efcf2635e4cffb6953b)) -* Better page description ([#159](https://github.com/openfoodfacts/hunger-games/issues/159)) ([0d895b8](https://github.com/openfoodfacts/hunger-games/commit/0d895b8bd2844f156e5301b1ff9d1478f8358837)) -* block access to not logged in users ([#365](https://github.com/openfoodfacts/hunger-games/issues/365)) ([d51074d](https://github.com/openfoodfacts/hunger-games/commit/d51074d62ea6b8ed413d5dfd1cfe585dd67211c7)) -* dashboard additions ([#737](https://github.com/openfoodfacts/hunger-games/issues/737)) ([8ec66b3](https://github.com/openfoodfacts/hunger-games/commit/8ec66b37a3bb3539e278f4de4b0be07fc371d757)) -* deeplinking in eco-score page by country ([#885](https://github.com/openfoodfacts/hunger-games/issues/885)) ([c8cc4ed](https://github.com/openfoodfacts/hunger-games/commit/c8cc4edc86e3f77f028d9a07ad1ebe966f15d98f)) -* describe eco-score page ([#276](https://github.com/openfoodfacts/hunger-games/issues/276)) ([7ac4946](https://github.com/openfoodfacts/hunger-games/commit/7ac4946be00f4f902bc56050aed5586e290aa7ae)) -* experiment with login (check if user is logged in or not) ([#124](https://github.com/openfoodfacts/hunger-games/issues/124)) ([6ebabb2](https://github.com/openfoodfacts/hunger-games/commit/6ebabb2c65d0e0dce81d7b1df2ea5c6b30cb8d9d)) -* feature flags added to dev mode ([#133](https://github.com/openfoodfacts/hunger-games/issues/133)) ([fc453a6](https://github.com/openfoodfacts/hunger-games/commit/fc453a60fc7b08c5cddb1dda43af3cdd91866e66)) -* hide logo by default ([#275](https://github.com/openfoodfacts/hunger-games/issues/275)) ([413f923](https://github.com/openfoodfacts/hunger-games/commit/413f923a7f2fe95cccb843fc30454517eaf0ed19)) -* Improve agri-balise categories cards ([#297](https://github.com/openfoodfacts/hunger-games/issues/297)) ([5ccd739](https://github.com/openfoodfacts/hunger-games/commit/5ccd73979fe3da6cdda1580bd276e95ee3e75f7b)) -* improve logos UI ([#222](https://github.com/openfoodfacts/hunger-games/issues/222)) ([b2e1c17](https://github.com/openfoodfacts/hunger-games/commit/b2e1c17ac776625a1d2dcd9b7518b0baea64450a)) -* improve Nutri-Score game ([#93](https://github.com/openfoodfacts/hunger-games/issues/93)) ([bcc612e](https://github.com/openfoodfacts/hunger-games/commit/bcc612eaabf77a069b45fb76b6c0159d1ac42e3a)) -* Improve statistic descriptions ([#205](https://github.com/openfoodfacts/hunger-games/issues/205)) ([b2c3ff4](https://github.com/openfoodfacts/hunger-games/commit/b2c3ff4ee946ba52926d96cc25b2f6511f1c226f)) -* includes not annotated logos in search ([#267](https://github.com/openfoodfacts/hunger-games/issues/267)) ([661e8da](https://github.com/openfoodfacts/hunger-games/commit/661e8da7e19b817c7dccf4e9ad5d758870c7fc2c)) -* Introduce dashboard page ([#444](https://github.com/openfoodfacts/hunger-games/issues/444)) ([e2b7bc6](https://github.com/openfoodfacts/hunger-games/commit/e2b7bc6a14465c4d137e94a962760180c5ba9553)) -* localize keyboard shortcut ([#325](https://github.com/openfoodfacts/hunger-games/issues/325)) ([e2a49e7](https://github.com/openfoodfacts/hunger-games/commit/e2a49e7743c73cc9e872014296ce39690c378caa)) -* logo game improvement ([#143](https://github.com/openfoodfacts/hunger-games/issues/143)) ([67c3d36](https://github.com/openfoodfacts/hunger-games/commit/67c3d3603d679d0f1f891af0964c692cb8c3d55f)) -* Make ingredient game send answer plus some fixes ([#882](https://github.com/openfoodfacts/hunger-games/issues/882)) ([85fe601](https://github.com/openfoodfacts/hunger-games/commit/85fe60154a5901b3157712cbf53882c82a81caf0)) -* more packaging ([#490](https://github.com/openfoodfacts/hunger-games/issues/490)) ([3e24a1a](https://github.com/openfoodfacts/hunger-games/commit/3e24a1a44cb199ebc7bf0b2b9556e3d4d6f02459)) -* New translations for Hunger Games ([#1016](https://github.com/openfoodfacts/hunger-games/issues/1016)) ([45541dd](https://github.com/openfoodfacts/hunger-games/commit/45541dd258f5e643ae2980917b939dd36f550a2a)) -* New translations for Hunger Games ([#351](https://github.com/openfoodfacts/hunger-games/issues/351)) ([81c6540](https://github.com/openfoodfacts/hunger-games/commit/81c65406b863ea358e029a46b493611995d7f2b1)) -* New translations for Hunger Games ([#353](https://github.com/openfoodfacts/hunger-games/issues/353)) ([14b6fea](https://github.com/openfoodfacts/hunger-games/commit/14b6fea2b058c688cc2cfc1a21d129ce9d7b2a8e)) -* New translations for Hunger Games ([#356](https://github.com/openfoodfacts/hunger-games/issues/356)) ([352664c](https://github.com/openfoodfacts/hunger-games/commit/352664cbc7aeeca1e2e2755f7b1c41023d1fceb3)) -* New translations for Hunger Games ([#391](https://github.com/openfoodfacts/hunger-games/issues/391)) ([67fbde3](https://github.com/openfoodfacts/hunger-games/commit/67fbde30637a63f45d9986f7f0b3a28c618b154c)) -* New translations for Hunger Games ([#395](https://github.com/openfoodfacts/hunger-games/issues/395)) ([ed8f938](https://github.com/openfoodfacts/hunger-games/commit/ed8f938eefdd0fb3a815dee45e5359b8c8082ac6)) -* New translations for Hunger Games ([#397](https://github.com/openfoodfacts/hunger-games/issues/397)) ([5fd2a29](https://github.com/openfoodfacts/hunger-games/commit/5fd2a29fd6d87c2a81248265a2cbe2f94208e5eb)) -* New translations for Hunger Games ([#404](https://github.com/openfoodfacts/hunger-games/issues/404)) ([4d65d42](https://github.com/openfoodfacts/hunger-games/commit/4d65d42d6dc2759a97d7bca76f0c05b434ee07bb)) -* New translations for Hunger Games ([#406](https://github.com/openfoodfacts/hunger-games/issues/406)) ([c455778](https://github.com/openfoodfacts/hunger-games/commit/c455778426e43c0ec93f11ef1527280e96b09a9b)) -* New translations for Hunger Games ([#408](https://github.com/openfoodfacts/hunger-games/issues/408)) ([6e46e05](https://github.com/openfoodfacts/hunger-games/commit/6e46e059d6f4587394187a5356eea9c9228397b8)) -* New translations for Hunger Games ([#424](https://github.com/openfoodfacts/hunger-games/issues/424)) ([2aabf1c](https://github.com/openfoodfacts/hunger-games/commit/2aabf1cf6e1cdd64ce4ab311172d2d4eed1567e0)) -* New translations for Hunger Games ([#426](https://github.com/openfoodfacts/hunger-games/issues/426)) ([3f121ce](https://github.com/openfoodfacts/hunger-games/commit/3f121ce8dc552e374ef4c085997d62826635032d)) -* New translations for Hunger Games ([#429](https://github.com/openfoodfacts/hunger-games/issues/429)) ([e31651b](https://github.com/openfoodfacts/hunger-games/commit/e31651bceae61ebe942a9ad9edb003cc2f15cae6)) -* New translations for Hunger Games ([#447](https://github.com/openfoodfacts/hunger-games/issues/447)) ([208ba43](https://github.com/openfoodfacts/hunger-games/commit/208ba43ddbc0a4ca70337b1661ff2fb427efb080)) -* New translations for Hunger Games ([#448](https://github.com/openfoodfacts/hunger-games/issues/448)) ([d6c1a25](https://github.com/openfoodfacts/hunger-games/commit/d6c1a257f90bb78456faf558decde16aa6911492)) -* New translations for Hunger Games ([#454](https://github.com/openfoodfacts/hunger-games/issues/454)) ([6ce024d](https://github.com/openfoodfacts/hunger-games/commit/6ce024d51b55d51e228cc8c1fd727a6a7f7dedac)) -* New translations for Hunger Games ([#468](https://github.com/openfoodfacts/hunger-games/issues/468)) ([06ce7e2](https://github.com/openfoodfacts/hunger-games/commit/06ce7e27b4c4838e554b2acaa6d5a965a8c471f3)) -* New translations for Hunger Games ([#482](https://github.com/openfoodfacts/hunger-games/issues/482)) ([37ecbf0](https://github.com/openfoodfacts/hunger-games/commit/37ecbf03b682bf68edbfd2b03d871ec1c5063227)) -* New translations for Hunger Games ([#489](https://github.com/openfoodfacts/hunger-games/issues/489)) ([7c3e896](https://github.com/openfoodfacts/hunger-games/commit/7c3e89629bdfdd006e3388732a426afc638a174a)) -* New translations for Hunger Games ([#492](https://github.com/openfoodfacts/hunger-games/issues/492)) ([48a3fee](https://github.com/openfoodfacts/hunger-games/commit/48a3feed24660836f154d9bd962de6861b1d478b)) -* New translations for Hunger Games ([#494](https://github.com/openfoodfacts/hunger-games/issues/494)) ([6522c72](https://github.com/openfoodfacts/hunger-games/commit/6522c72bced814de8f197c6beb8c47fe2654cd9c)) -* New translations for Hunger Games ([#497](https://github.com/openfoodfacts/hunger-games/issues/497)) ([a2f492b](https://github.com/openfoodfacts/hunger-games/commit/a2f492baf5eb470716134474ed4e42383d01831f)) -* New translations for Hunger Games ([#529](https://github.com/openfoodfacts/hunger-games/issues/529)) ([e4e6910](https://github.com/openfoodfacts/hunger-games/commit/e4e6910e3b65e451245af912784cd51019e9c1d6)) -* New translations for Hunger Games ([#536](https://github.com/openfoodfacts/hunger-games/issues/536)) ([af9fc3e](https://github.com/openfoodfacts/hunger-games/commit/af9fc3eb8da1292d65e4a4a62cc39421e042629a)) -* New translations for Hunger Games ([#542](https://github.com/openfoodfacts/hunger-games/issues/542)) ([d6d217b](https://github.com/openfoodfacts/hunger-games/commit/d6d217b86c508c560656c6b79627da1dc4228408)) -* New translations for Hunger Games ([#545](https://github.com/openfoodfacts/hunger-games/issues/545)) ([b41b460](https://github.com/openfoodfacts/hunger-games/commit/b41b460988aa7ea6ac0f1755a6372e92e6380b04)) -* New translations for Hunger Games ([#551](https://github.com/openfoodfacts/hunger-games/issues/551)) ([99faa4a](https://github.com/openfoodfacts/hunger-games/commit/99faa4abe00d05810ed2665e0f5a49bff9d4e5b5)) -* New translations for Hunger Games ([#589](https://github.com/openfoodfacts/hunger-games/issues/589)) ([54f4d97](https://github.com/openfoodfacts/hunger-games/commit/54f4d97f50ac88aa04f9566530844b2dd80c271b)) -* New translations for Hunger Games ([#612](https://github.com/openfoodfacts/hunger-games/issues/612)) ([2c00971](https://github.com/openfoodfacts/hunger-games/commit/2c00971b20fc9f9007a70769a24eef2923673663)) -* New translations for Hunger Games ([#636](https://github.com/openfoodfacts/hunger-games/issues/636)) ([906b9eb](https://github.com/openfoodfacts/hunger-games/commit/906b9ebab859ab388ab98198fd4aaa0cfe114869)) -* New translations for Hunger Games ([#719](https://github.com/openfoodfacts/hunger-games/issues/719)) ([8869d82](https://github.com/openfoodfacts/hunger-games/commit/8869d821c56363fc03215e46e8b8e71c1257bce5)) -* New translations for Hunger Games ([#741](https://github.com/openfoodfacts/hunger-games/issues/741)) ([9ce17b8](https://github.com/openfoodfacts/hunger-games/commit/9ce17b880c247c856f80b7e02d75c4ce3f5c8fd6)) -* New translations for Hunger Games ([#771](https://github.com/openfoodfacts/hunger-games/issues/771)) ([751106d](https://github.com/openfoodfacts/hunger-games/commit/751106d53f19f88d80da55aa76a08d53ad4f5ccc)) -* New translations for Hunger Games ([#804](https://github.com/openfoodfacts/hunger-games/issues/804)) ([7e91405](https://github.com/openfoodfacts/hunger-games/commit/7e91405f92cd89ac0151f1b25a08600c9b7e9c3e)) -* New translations for Hunger Games ([#831](https://github.com/openfoodfacts/hunger-games/issues/831)) ([fa20eca](https://github.com/openfoodfacts/hunger-games/commit/fa20eca0eee303382d7e0c0871ddaf595348ea84)) -* New translations for Hunger Games ([#852](https://github.com/openfoodfacts/hunger-games/issues/852)) ([1286085](https://github.com/openfoodfacts/hunger-games/commit/128608589745e60104fb54b0399e46667a8f4016)) -* New translations for Hunger Games ([#855](https://github.com/openfoodfacts/hunger-games/issues/855)) ([f66a2de](https://github.com/openfoodfacts/hunger-games/commit/f66a2dea7fd9aade7a7886c97b79e109f6a7c2c9)) -* New translations for Hunger Games ([#859](https://github.com/openfoodfacts/hunger-games/issues/859)) ([8a3d950](https://github.com/openfoodfacts/hunger-games/commit/8a3d950d82c9b3a0e41618270e381cbe8d316a2c)) -* New translations for Hunger Games ([#860](https://github.com/openfoodfacts/hunger-games/issues/860)) ([5f99b51](https://github.com/openfoodfacts/hunger-games/commit/5f99b51df4745570e9d98b1247f40158fdb882c4)) -* New translations for Hunger Games ([#881](https://github.com/openfoodfacts/hunger-games/issues/881)) ([a7a8f68](https://github.com/openfoodfacts/hunger-games/commit/a7a8f68e92cb7c7d33a3148f80f0a67d374ef9ca)) -* New translations for Hunger Games ([#934](https://github.com/openfoodfacts/hunger-games/issues/934)) ([2ef368a](https://github.com/openfoodfacts/hunger-games/commit/2ef368a6bc71e495b7a678a345d5bf5796117edc)) -* New translations for Hunger Games ([#935](https://github.com/openfoodfacts/hunger-games/issues/935)) ([9b24cdd](https://github.com/openfoodfacts/hunger-games/commit/9b24cdd1d655e31465a728754e496e9b57ce2eed)) -* New translations for Hunger Games ([#955](https://github.com/openfoodfacts/hunger-games/issues/955)) ([1716b28](https://github.com/openfoodfacts/hunger-games/commit/1716b28796d99bb1156d2c4e0f4c1137df1ee3c3)) -* not found page added ([4adb28a](https://github.com/openfoodfacts/hunger-games/commit/4adb28a83eb1de2e1c6827a32394de24aab7b5e3)) -* Nutrition game - table, tableRow and select Unit components ([#154](https://github.com/openfoodfacts/hunger-games/issues/154)) ([c9a78df](https://github.com/openfoodfacts/hunger-games/commit/c9a78df6ed8d7e645507db742da66340fcc4d949)) -* pwa added ([#11](https://github.com/openfoodfacts/hunger-games/issues/11)) ([f0715e7](https://github.com/openfoodfacts/hunger-games/commit/f0715e786a4b30c959e90bc663ed514bf2a21e5f)) -* quick and dirty dashboard for coordination ([#720](https://github.com/openfoodfacts/hunger-games/issues/720)) ([46b9c95](https://github.com/openfoodfacts/hunger-games/commit/46b9c958dce97737e653eb0451b4a9d5686b4462)) -* remove the incitation to login when it's the case ([#193](https://github.com/openfoodfacts/hunger-games/issues/193)) ([e6b004c](https://github.com/openfoodfacts/hunger-games/commit/e6b004cf619724c5b70091f75862b07425b60827)) -* reporting images added ([#147](https://github.com/openfoodfacts/hunger-games/issues/147)) ([a25c1ef](https://github.com/openfoodfacts/hunger-games/commit/a25c1efefafdda43d5c8a53336f0b7a0657f652c)) -* save on enter and cancel on escape ([#144](https://github.com/openfoodfacts/hunger-games/issues/144)) ([2200222](https://github.com/openfoodfacts/hunger-games/commit/22002229e4db5b848b1b45491b5a62ccfccdd776)) -* select and deselect all button for infinite mode ([#450](https://github.com/openfoodfacts/hunger-games/issues/450)) ([e6b8536](https://github.com/openfoodfacts/hunger-games/commit/e6b8536864cc11c4320a22e8b77987e0096993bc)) -* selectable logo annotation and add checkbox ([#173](https://github.com/openfoodfacts/hunger-games/issues/173)) ([9105c71](https://github.com/openfoodfacts/hunger-games/commit/9105c713b7b48a632531b852fe1abe20092c8a2c)) -* Send skip to server ([#362](https://github.com/openfoodfacts/hunger-games/issues/362)) ([7431962](https://github.com/openfoodfacts/hunger-games/commit/74319628a914cea9faa1e346298c00dcfbeeafdc)) -* Show agribalise in eco-score page ([#274](https://github.com/openfoodfacts/hunger-games/issues/274)) ([47588ee](https://github.com/openfoodfacts/hunger-games/commit/47588eebfcd37e6627213acf4cafced9e77a9b60)) -* Show debug informations about insights ([#225](https://github.com/openfoodfacts/hunger-games/issues/225)) ([cf0b006](https://github.com/openfoodfacts/hunger-games/commit/cf0b006dcbcdda91af91edee91ee2d0d7ce95b7f)) -* show other questions in dev mode ([#228](https://github.com/openfoodfacts/hunger-games/issues/228)) ([525db64](https://github.com/openfoodfacts/hunger-games/commit/525db641e04645732176493918921af16425a52d)) -* Show product quantity and labels ([#293](https://github.com/openfoodfacts/hunger-games/issues/293)) ([dd4aee4](https://github.com/openfoodfacts/hunger-games/commit/dd4aee4691c603a072a680dcea02a83cca0e6c95)) -* show table with autosuggestion ([#384](https://github.com/openfoodfacts/hunger-games/issues/384)) ([d47e163](https://github.com/openfoodfacts/hunger-games/commit/d47e1639598eac30a2a0f00b34fe9cc2929a2283)) -* Show top insight in the home page ([#206](https://github.com/openfoodfacts/hunger-games/issues/206)) ([edb5de8](https://github.com/openfoodfacts/hunger-games/commit/edb5de8c864db23460e95560ed8e6bc7173a8483)) -* Show user statistics ([#196](https://github.com/openfoodfacts/hunger-games/issues/196)) ([d250b49](https://github.com/openfoodfacts/hunger-games/commit/d250b499cf1fae02a10efffdd36504c737c8dcf5)) -* Small logo improvements ([#466](https://github.com/openfoodfacts/hunger-games/issues/466)) ([a470185](https://github.com/openfoodfacts/hunger-games/commit/a470185dd288d3d980813a730f33736d75ec58b9)) -* Split interface for fast nutriscore answer and INAO logos ([#392](https://github.com/openfoodfacts/hunger-games/issues/392)) ([bcfc3e6](https://github.com/openfoodfacts/hunger-games/commit/bcfc3e6cd46fbcf72e8d453534225b5263c861b2)) -* Support 2 letters code four countries ([#938](https://github.com/openfoodfacts/hunger-games/issues/938)) ([091e1df](https://github.com/openfoodfacts/hunger-games/commit/091e1df447ca115843b59f135296e4898f3de299)) -* support additional API request for logo preview in debug mode ([#227](https://github.com/openfoodfacts/hunger-games/issues/227)) ([4a636c5](https://github.com/openfoodfacts/hunger-games/commit/4a636c542691f19e642211edf513af999a600cc3)) -* try packaging shapes ([924994c](https://github.com/openfoodfacts/hunger-games/commit/924994cba1381e2879e98108a3d434790c72af8d)) -* turn product details into a more legible table (solves [#123](https://github.com/openfoodfacts/hunger-games/issues/123)) ([#125](https://github.com/openfoodfacts/hunger-games/issues/125)) ([3c60dbd](https://github.com/openfoodfacts/hunger-games/commit/3c60dbd46154f2fa5d3de7c3eecc6924993c6da6)) -* UI improvement of question game ([#218](https://github.com/openfoodfacts/hunger-games/issues/218)) ([858c9fc](https://github.com/openfoodfacts/hunger-games/commit/858c9fc617bf6b302d7cecf09e1dda993e3552ab)) -* Use configured (const) OFF URLs in the UI ([#939](https://github.com/openfoodfacts/hunger-games/issues/939)) ([2407a52](https://github.com/openfoodfacts/hunger-games/commit/2407a5271ead19a78965a6a26ff40b417a82b4da)) -* Use deep link on most of the pages ([#268](https://github.com/openfoodfacts/hunger-games/issues/268)) ([eceabfd](https://github.com/openfoodfacts/hunger-games/commit/eceabfd2928ea979d291afc72c9ba3b23f22c4c8)) -* use predictor in INAO game ([#398](https://github.com/openfoodfacts/hunger-games/issues/398)) ([c03882c](https://github.com/openfoodfacts/hunger-games/commit/c03882c07a7d305ede6df81373ced5224234a617)) -* Use search a lisious for brand ([#942](https://github.com/openfoodfacts/hunger-games/issues/942)) ([4ffe3c1](https://github.com/openfoodfacts/hunger-games/commit/4ffe3c1c6dd17baf803243c69cb9be3c941aa48f)) -* Use the name and not the id for brand ([#944](https://github.com/openfoodfacts/hunger-games/issues/944)) ([f0f20dc](https://github.com/openfoodfacts/hunger-games/commit/f0f20dc91ea70a8be9739ece5fe06a26785c295e)) -* Visualized flagged images ([#169](https://github.com/openfoodfacts/hunger-games/issues/169)) ([dbda2d4](https://github.com/openfoodfacts/hunger-games/commit/dbda2d4a3c3bb06aa5a1bd3a2f86b020b53899f5)) - +- Add a game to annotate ingredients ([#769](https://github.com/openfoodfacts/hunger-games/issues/769)) ([966e156](https://github.com/openfoodfacts/hunger-games/commit/966e1567a38a5b4eb14e95a5c994f2128faa6dd3)) +- add a page to experiment with grid selection ([#48](https://github.com/openfoodfacts/hunger-games/issues/48)) ([404a2c6](https://github.com/openfoodfacts/hunger-games/commit/404a2c6adcec9fce6b2c30ff2640b4dfe9c0dc88)) +- Add autosuggestion for labels and categories ([#215](https://github.com/openfoodfacts/hunger-games/issues/215)) ([e8a6efb](https://github.com/openfoodfacts/hunger-games/commit/e8a6efb5c0d44d906208e2eeaf0fcda7df429b35)) +- add brandinator ([#801](https://github.com/openfoodfacts/hunger-games/issues/801)) ([c16fd8f](https://github.com/openfoodfacts/hunger-games/commit/c16fd8f48a66bea72fbdf811bf0f89d37fd7e71d)) +- add country list in settings page, using it as default country in eco-score ([#892](https://github.com/openfoodfacts/hunger-games/issues/892)) ([5f92e6a](https://github.com/openfoodfacts/hunger-games/commit/5f92e6a9e708a4a2c9722f4ff6a5507b78b17e46)) +- add Japanese selection in options ([#282](https://github.com/openfoodfacts/hunger-games/issues/282)) ([7472abb](https://github.com/openfoodfacts/hunger-games/commit/7472abb6ec2e255fd2236db72c21e961ada78171)) +- add Japanese selection in options since we now have translations ([7472abb](https://github.com/openfoodfacts/hunger-games/commit/7472abb6ec2e255fd2236db72c21e961ada78171)) +- Add lazy import for different routes ([#656](https://github.com/openfoodfacts/hunger-games/issues/656)) ([b9d4f93](https://github.com/openfoodfacts/hunger-games/commit/b9d4f93f615ba6fa71ad08449a0014135c321c30)) +- add links related to open food facts in settings route. ([#539](https://github.com/openfoodfacts/hunger-games/issues/539)) ([747e6e1](https://github.com/openfoodfacts/hunger-games/commit/747e6e1894eaa1c50984e1949cf7520f8993ab5f)) +- add loading animation before question display ([#498](https://github.com/openfoodfacts/hunger-games/issues/498)) ([c530360](https://github.com/openfoodfacts/hunger-games/commit/c530360ad0b0e9475b49fcbfa30bec1b85ad39cb)) +- add packaging taxonomy + some dark mode fixes ([#350](https://github.com/openfoodfacts/hunger-games/issues/350)) ([15ea04d](https://github.com/openfoodfacts/hunger-games/commit/15ea04d79d84e64879a0686b190eaabdf8885762)) +- Add shortcut for nutriscore selection ([#168](https://github.com/openfoodfacts/hunger-games/issues/168)) ([86d6783](https://github.com/openfoodfacts/hunger-games/commit/86d67837f24ab76b4da8ce1eb0c65cd228a50b84)) +- add shortcut to crop from question game ([#851](https://github.com/openfoodfacts/hunger-games/issues/851)) ([a59bcc2](https://github.com/openfoodfacts/hunger-games/commit/a59bcc2979b8e8c843c1fa1737578ad18dbb995e)) +- Added an explanation for The Logo Game (solves [#84](https://github.com/openfoodfacts/hunger-games/issues/84)) ([#119](https://github.com/openfoodfacts/hunger-games/issues/119)) ([8344473](https://github.com/openfoodfacts/hunger-games/commit/83444731d7136d5afcba2c19146e8a1281538891)) +- added Croatian and Swedish ([#587](https://github.com/openfoodfacts/hunger-games/issues/587)) ([67ec36f](https://github.com/openfoodfacts/hunger-games/commit/67ec36f7e9d46014151d2fdb600243c80fc41dcb)) +- added NL lang ([#590](https://github.com/openfoodfacts/hunger-games/issues/590)) ([8e4a24d](https://github.com/openfoodfacts/hunger-games/commit/8e4a24de997877f17da8a45a0a61f254a2e0d01c)) +- adding deeplinks to logo dashboards ([#803](https://github.com/openfoodfacts/hunger-games/issues/803)) ([12a3efa](https://github.com/openfoodfacts/hunger-games/commit/12a3efa957bff5b71b6d13b0d00c79c195274173)) +- Allow flagging logo in edit page ([#172](https://github.com/openfoodfacts/hunger-games/issues/172)) ([2b2a0f4](https://github.com/openfoodfacts/hunger-games/commit/2b2a0f4f7d15ecd7a0834a6188667daf8f0785b7)) +- Allow to remove some logos from deep search ([#713](https://github.com/openfoodfacts/hunger-games/issues/713)) ([497d547](https://github.com/openfoodfacts/hunger-games/commit/497d547d68c0ffd00e7e4c9882d362f112406b28)) +- Allows to access all the logo sub-games ([#357](https://github.com/openfoodfacts/hunger-games/issues/357)) ([f105497](https://github.com/openfoodfacts/hunger-games/commit/f105497928cf095ec81707b66b3f52ae047164de)) +- Allows to do deep first search in logo annotation ([#328](https://github.com/openfoodfacts/hunger-games/issues/328)) ([27f14e9](https://github.com/openfoodfacts/hunger-games/commit/27f14e9c207928e0c591ed36f066960ffe319579)) +- Allows to edit favorite question cards ([#50](https://github.com/openfoodfacts/hunger-games/issues/50)) ([31e8fb8](https://github.com/openfoodfacts/hunger-games/commit/31e8fb8d36e03cd08dcb7132aa2d87d934720a30)) +- Allows to fetch 50 additional logos (up to 500) ([#217](https://github.com/openfoodfacts/hunger-games/issues/217)) ([1725ee7](https://github.com/openfoodfacts/hunger-games/commit/1725ee772d402480a68f518c7519ac1f3f1c162f)) +- Allows to fetch logos from some categories ([#320](https://github.com/openfoodfacts/hunger-games/issues/320)) ([25f9f4e](https://github.com/openfoodfacts/hunger-games/commit/25f9f4e2662f9e70f033d0826712a5c0342118c3)) +- allows to save filters ([#36](https://github.com/openfoodfacts/hunger-games/issues/36)) ([0c18eb0](https://github.com/openfoodfacts/hunger-games/commit/0c18eb00b587df15388c4052dfe0fbfee0b085f3)) +- allows to see packaging interface for specific products ([#411](https://github.com/openfoodfacts/hunger-games/issues/411)) ([ccfacea](https://github.com/openfoodfacts/hunger-games/commit/ccfaceab8e77daec47439efcf2635e4cffb6953b)) +- Better page description ([#159](https://github.com/openfoodfacts/hunger-games/issues/159)) ([0d895b8](https://github.com/openfoodfacts/hunger-games/commit/0d895b8bd2844f156e5301b1ff9d1478f8358837)) +- block access to not logged in users ([#365](https://github.com/openfoodfacts/hunger-games/issues/365)) ([d51074d](https://github.com/openfoodfacts/hunger-games/commit/d51074d62ea6b8ed413d5dfd1cfe585dd67211c7)) +- dashboard additions ([#737](https://github.com/openfoodfacts/hunger-games/issues/737)) ([8ec66b3](https://github.com/openfoodfacts/hunger-games/commit/8ec66b37a3bb3539e278f4de4b0be07fc371d757)) +- deeplinking in eco-score page by country ([#885](https://github.com/openfoodfacts/hunger-games/issues/885)) ([c8cc4ed](https://github.com/openfoodfacts/hunger-games/commit/c8cc4edc86e3f77f028d9a07ad1ebe966f15d98f)) +- describe eco-score page ([#276](https://github.com/openfoodfacts/hunger-games/issues/276)) ([7ac4946](https://github.com/openfoodfacts/hunger-games/commit/7ac4946be00f4f902bc56050aed5586e290aa7ae)) +- experiment with login (check if user is logged in or not) ([#124](https://github.com/openfoodfacts/hunger-games/issues/124)) ([6ebabb2](https://github.com/openfoodfacts/hunger-games/commit/6ebabb2c65d0e0dce81d7b1df2ea5c6b30cb8d9d)) +- feature flags added to dev mode ([#133](https://github.com/openfoodfacts/hunger-games/issues/133)) ([fc453a6](https://github.com/openfoodfacts/hunger-games/commit/fc453a60fc7b08c5cddb1dda43af3cdd91866e66)) +- hide logo by default ([#275](https://github.com/openfoodfacts/hunger-games/issues/275)) ([413f923](https://github.com/openfoodfacts/hunger-games/commit/413f923a7f2fe95cccb843fc30454517eaf0ed19)) +- Improve agri-balise categories cards ([#297](https://github.com/openfoodfacts/hunger-games/issues/297)) ([5ccd739](https://github.com/openfoodfacts/hunger-games/commit/5ccd73979fe3da6cdda1580bd276e95ee3e75f7b)) +- improve logos UI ([#222](https://github.com/openfoodfacts/hunger-games/issues/222)) ([b2e1c17](https://github.com/openfoodfacts/hunger-games/commit/b2e1c17ac776625a1d2dcd9b7518b0baea64450a)) +- improve Nutri-Score game ([#93](https://github.com/openfoodfacts/hunger-games/issues/93)) ([bcc612e](https://github.com/openfoodfacts/hunger-games/commit/bcc612eaabf77a069b45fb76b6c0159d1ac42e3a)) +- Improve statistic descriptions ([#205](https://github.com/openfoodfacts/hunger-games/issues/205)) ([b2c3ff4](https://github.com/openfoodfacts/hunger-games/commit/b2c3ff4ee946ba52926d96cc25b2f6511f1c226f)) +- includes not annotated logos in search ([#267](https://github.com/openfoodfacts/hunger-games/issues/267)) ([661e8da](https://github.com/openfoodfacts/hunger-games/commit/661e8da7e19b817c7dccf4e9ad5d758870c7fc2c)) +- Introduce dashboard page ([#444](https://github.com/openfoodfacts/hunger-games/issues/444)) ([e2b7bc6](https://github.com/openfoodfacts/hunger-games/commit/e2b7bc6a14465c4d137e94a962760180c5ba9553)) +- localize keyboard shortcut ([#325](https://github.com/openfoodfacts/hunger-games/issues/325)) ([e2a49e7](https://github.com/openfoodfacts/hunger-games/commit/e2a49e7743c73cc9e872014296ce39690c378caa)) +- logo game improvement ([#143](https://github.com/openfoodfacts/hunger-games/issues/143)) ([67c3d36](https://github.com/openfoodfacts/hunger-games/commit/67c3d3603d679d0f1f891af0964c692cb8c3d55f)) +- Make ingredient game send answer plus some fixes ([#882](https://github.com/openfoodfacts/hunger-games/issues/882)) ([85fe601](https://github.com/openfoodfacts/hunger-games/commit/85fe60154a5901b3157712cbf53882c82a81caf0)) +- more packaging ([#490](https://github.com/openfoodfacts/hunger-games/issues/490)) ([3e24a1a](https://github.com/openfoodfacts/hunger-games/commit/3e24a1a44cb199ebc7bf0b2b9556e3d4d6f02459)) +- New translations for Hunger Games ([#1016](https://github.com/openfoodfacts/hunger-games/issues/1016)) ([45541dd](https://github.com/openfoodfacts/hunger-games/commit/45541dd258f5e643ae2980917b939dd36f550a2a)) +- New translations for Hunger Games ([#351](https://github.com/openfoodfacts/hunger-games/issues/351)) ([81c6540](https://github.com/openfoodfacts/hunger-games/commit/81c65406b863ea358e029a46b493611995d7f2b1)) +- New translations for Hunger Games ([#353](https://github.com/openfoodfacts/hunger-games/issues/353)) ([14b6fea](https://github.com/openfoodfacts/hunger-games/commit/14b6fea2b058c688cc2cfc1a21d129ce9d7b2a8e)) +- New translations for Hunger Games ([#356](https://github.com/openfoodfacts/hunger-games/issues/356)) ([352664c](https://github.com/openfoodfacts/hunger-games/commit/352664cbc7aeeca1e2e2755f7b1c41023d1fceb3)) +- New translations for Hunger Games ([#391](https://github.com/openfoodfacts/hunger-games/issues/391)) ([67fbde3](https://github.com/openfoodfacts/hunger-games/commit/67fbde30637a63f45d9986f7f0b3a28c618b154c)) +- New translations for Hunger Games ([#395](https://github.com/openfoodfacts/hunger-games/issues/395)) ([ed8f938](https://github.com/openfoodfacts/hunger-games/commit/ed8f938eefdd0fb3a815dee45e5359b8c8082ac6)) +- New translations for Hunger Games ([#397](https://github.com/openfoodfacts/hunger-games/issues/397)) ([5fd2a29](https://github.com/openfoodfacts/hunger-games/commit/5fd2a29fd6d87c2a81248265a2cbe2f94208e5eb)) +- New translations for Hunger Games ([#404](https://github.com/openfoodfacts/hunger-games/issues/404)) ([4d65d42](https://github.com/openfoodfacts/hunger-games/commit/4d65d42d6dc2759a97d7bca76f0c05b434ee07bb)) +- New translations for Hunger Games ([#406](https://github.com/openfoodfacts/hunger-games/issues/406)) ([c455778](https://github.com/openfoodfacts/hunger-games/commit/c455778426e43c0ec93f11ef1527280e96b09a9b)) +- New translations for Hunger Games ([#408](https://github.com/openfoodfacts/hunger-games/issues/408)) ([6e46e05](https://github.com/openfoodfacts/hunger-games/commit/6e46e059d6f4587394187a5356eea9c9228397b8)) +- New translations for Hunger Games ([#424](https://github.com/openfoodfacts/hunger-games/issues/424)) ([2aabf1c](https://github.com/openfoodfacts/hunger-games/commit/2aabf1cf6e1cdd64ce4ab311172d2d4eed1567e0)) +- New translations for Hunger Games ([#426](https://github.com/openfoodfacts/hunger-games/issues/426)) ([3f121ce](https://github.com/openfoodfacts/hunger-games/commit/3f121ce8dc552e374ef4c085997d62826635032d)) +- New translations for Hunger Games ([#429](https://github.com/openfoodfacts/hunger-games/issues/429)) ([e31651b](https://github.com/openfoodfacts/hunger-games/commit/e31651bceae61ebe942a9ad9edb003cc2f15cae6)) +- New translations for Hunger Games ([#447](https://github.com/openfoodfacts/hunger-games/issues/447)) ([208ba43](https://github.com/openfoodfacts/hunger-games/commit/208ba43ddbc0a4ca70337b1661ff2fb427efb080)) +- New translations for Hunger Games ([#448](https://github.com/openfoodfacts/hunger-games/issues/448)) ([d6c1a25](https://github.com/openfoodfacts/hunger-games/commit/d6c1a257f90bb78456faf558decde16aa6911492)) +- New translations for Hunger Games ([#454](https://github.com/openfoodfacts/hunger-games/issues/454)) ([6ce024d](https://github.com/openfoodfacts/hunger-games/commit/6ce024d51b55d51e228cc8c1fd727a6a7f7dedac)) +- New translations for Hunger Games ([#468](https://github.com/openfoodfacts/hunger-games/issues/468)) ([06ce7e2](https://github.com/openfoodfacts/hunger-games/commit/06ce7e27b4c4838e554b2acaa6d5a965a8c471f3)) +- New translations for Hunger Games ([#482](https://github.com/openfoodfacts/hunger-games/issues/482)) ([37ecbf0](https://github.com/openfoodfacts/hunger-games/commit/37ecbf03b682bf68edbfd2b03d871ec1c5063227)) +- New translations for Hunger Games ([#489](https://github.com/openfoodfacts/hunger-games/issues/489)) ([7c3e896](https://github.com/openfoodfacts/hunger-games/commit/7c3e89629bdfdd006e3388732a426afc638a174a)) +- New translations for Hunger Games ([#492](https://github.com/openfoodfacts/hunger-games/issues/492)) ([48a3fee](https://github.com/openfoodfacts/hunger-games/commit/48a3feed24660836f154d9bd962de6861b1d478b)) +- New translations for Hunger Games ([#494](https://github.com/openfoodfacts/hunger-games/issues/494)) ([6522c72](https://github.com/openfoodfacts/hunger-games/commit/6522c72bced814de8f197c6beb8c47fe2654cd9c)) +- New translations for Hunger Games ([#497](https://github.com/openfoodfacts/hunger-games/issues/497)) ([a2f492b](https://github.com/openfoodfacts/hunger-games/commit/a2f492baf5eb470716134474ed4e42383d01831f)) +- New translations for Hunger Games ([#529](https://github.com/openfoodfacts/hunger-games/issues/529)) ([e4e6910](https://github.com/openfoodfacts/hunger-games/commit/e4e6910e3b65e451245af912784cd51019e9c1d6)) +- New translations for Hunger Games ([#536](https://github.com/openfoodfacts/hunger-games/issues/536)) ([af9fc3e](https://github.com/openfoodfacts/hunger-games/commit/af9fc3eb8da1292d65e4a4a62cc39421e042629a)) +- New translations for Hunger Games ([#542](https://github.com/openfoodfacts/hunger-games/issues/542)) ([d6d217b](https://github.com/openfoodfacts/hunger-games/commit/d6d217b86c508c560656c6b79627da1dc4228408)) +- New translations for Hunger Games ([#545](https://github.com/openfoodfacts/hunger-games/issues/545)) ([b41b460](https://github.com/openfoodfacts/hunger-games/commit/b41b460988aa7ea6ac0f1755a6372e92e6380b04)) +- New translations for Hunger Games ([#551](https://github.com/openfoodfacts/hunger-games/issues/551)) ([99faa4a](https://github.com/openfoodfacts/hunger-games/commit/99faa4abe00d05810ed2665e0f5a49bff9d4e5b5)) +- New translations for Hunger Games ([#589](https://github.com/openfoodfacts/hunger-games/issues/589)) ([54f4d97](https://github.com/openfoodfacts/hunger-games/commit/54f4d97f50ac88aa04f9566530844b2dd80c271b)) +- New translations for Hunger Games ([#612](https://github.com/openfoodfacts/hunger-games/issues/612)) ([2c00971](https://github.com/openfoodfacts/hunger-games/commit/2c00971b20fc9f9007a70769a24eef2923673663)) +- New translations for Hunger Games ([#636](https://github.com/openfoodfacts/hunger-games/issues/636)) ([906b9eb](https://github.com/openfoodfacts/hunger-games/commit/906b9ebab859ab388ab98198fd4aaa0cfe114869)) +- New translations for Hunger Games ([#719](https://github.com/openfoodfacts/hunger-games/issues/719)) ([8869d82](https://github.com/openfoodfacts/hunger-games/commit/8869d821c56363fc03215e46e8b8e71c1257bce5)) +- New translations for Hunger Games ([#741](https://github.com/openfoodfacts/hunger-games/issues/741)) ([9ce17b8](https://github.com/openfoodfacts/hunger-games/commit/9ce17b880c247c856f80b7e02d75c4ce3f5c8fd6)) +- New translations for Hunger Games ([#771](https://github.com/openfoodfacts/hunger-games/issues/771)) ([751106d](https://github.com/openfoodfacts/hunger-games/commit/751106d53f19f88d80da55aa76a08d53ad4f5ccc)) +- New translations for Hunger Games ([#804](https://github.com/openfoodfacts/hunger-games/issues/804)) ([7e91405](https://github.com/openfoodfacts/hunger-games/commit/7e91405f92cd89ac0151f1b25a08600c9b7e9c3e)) +- New translations for Hunger Games ([#831](https://github.com/openfoodfacts/hunger-games/issues/831)) ([fa20eca](https://github.com/openfoodfacts/hunger-games/commit/fa20eca0eee303382d7e0c0871ddaf595348ea84)) +- New translations for Hunger Games ([#852](https://github.com/openfoodfacts/hunger-games/issues/852)) ([1286085](https://github.com/openfoodfacts/hunger-games/commit/128608589745e60104fb54b0399e46667a8f4016)) +- New translations for Hunger Games ([#855](https://github.com/openfoodfacts/hunger-games/issues/855)) ([f66a2de](https://github.com/openfoodfacts/hunger-games/commit/f66a2dea7fd9aade7a7886c97b79e109f6a7c2c9)) +- New translations for Hunger Games ([#859](https://github.com/openfoodfacts/hunger-games/issues/859)) ([8a3d950](https://github.com/openfoodfacts/hunger-games/commit/8a3d950d82c9b3a0e41618270e381cbe8d316a2c)) +- New translations for Hunger Games ([#860](https://github.com/openfoodfacts/hunger-games/issues/860)) ([5f99b51](https://github.com/openfoodfacts/hunger-games/commit/5f99b51df4745570e9d98b1247f40158fdb882c4)) +- New translations for Hunger Games ([#881](https://github.com/openfoodfacts/hunger-games/issues/881)) ([a7a8f68](https://github.com/openfoodfacts/hunger-games/commit/a7a8f68e92cb7c7d33a3148f80f0a67d374ef9ca)) +- New translations for Hunger Games ([#934](https://github.com/openfoodfacts/hunger-games/issues/934)) ([2ef368a](https://github.com/openfoodfacts/hunger-games/commit/2ef368a6bc71e495b7a678a345d5bf5796117edc)) +- New translations for Hunger Games ([#935](https://github.com/openfoodfacts/hunger-games/issues/935)) ([9b24cdd](https://github.com/openfoodfacts/hunger-games/commit/9b24cdd1d655e31465a728754e496e9b57ce2eed)) +- New translations for Hunger Games ([#955](https://github.com/openfoodfacts/hunger-games/issues/955)) ([1716b28](https://github.com/openfoodfacts/hunger-games/commit/1716b28796d99bb1156d2c4e0f4c1137df1ee3c3)) +- not found page added ([4adb28a](https://github.com/openfoodfacts/hunger-games/commit/4adb28a83eb1de2e1c6827a32394de24aab7b5e3)) +- Nutrition game - table, tableRow and select Unit components ([#154](https://github.com/openfoodfacts/hunger-games/issues/154)) ([c9a78df](https://github.com/openfoodfacts/hunger-games/commit/c9a78df6ed8d7e645507db742da66340fcc4d949)) +- pwa added ([#11](https://github.com/openfoodfacts/hunger-games/issues/11)) ([f0715e7](https://github.com/openfoodfacts/hunger-games/commit/f0715e786a4b30c959e90bc663ed514bf2a21e5f)) +- quick and dirty dashboard for coordination ([#720](https://github.com/openfoodfacts/hunger-games/issues/720)) ([46b9c95](https://github.com/openfoodfacts/hunger-games/commit/46b9c958dce97737e653eb0451b4a9d5686b4462)) +- remove the incitation to login when it's the case ([#193](https://github.com/openfoodfacts/hunger-games/issues/193)) ([e6b004c](https://github.com/openfoodfacts/hunger-games/commit/e6b004cf619724c5b70091f75862b07425b60827)) +- reporting images added ([#147](https://github.com/openfoodfacts/hunger-games/issues/147)) ([a25c1ef](https://github.com/openfoodfacts/hunger-games/commit/a25c1efefafdda43d5c8a53336f0b7a0657f652c)) +- save on enter and cancel on escape ([#144](https://github.com/openfoodfacts/hunger-games/issues/144)) ([2200222](https://github.com/openfoodfacts/hunger-games/commit/22002229e4db5b848b1b45491b5a62ccfccdd776)) +- select and deselect all button for infinite mode ([#450](https://github.com/openfoodfacts/hunger-games/issues/450)) ([e6b8536](https://github.com/openfoodfacts/hunger-games/commit/e6b8536864cc11c4320a22e8b77987e0096993bc)) +- selectable logo annotation and add checkbox ([#173](https://github.com/openfoodfacts/hunger-games/issues/173)) ([9105c71](https://github.com/openfoodfacts/hunger-games/commit/9105c713b7b48a632531b852fe1abe20092c8a2c)) +- Send skip to server ([#362](https://github.com/openfoodfacts/hunger-games/issues/362)) ([7431962](https://github.com/openfoodfacts/hunger-games/commit/74319628a914cea9faa1e346298c00dcfbeeafdc)) +- Show agribalise in eco-score page ([#274](https://github.com/openfoodfacts/hunger-games/issues/274)) ([47588ee](https://github.com/openfoodfacts/hunger-games/commit/47588eebfcd37e6627213acf4cafced9e77a9b60)) +- Show debug informations about insights ([#225](https://github.com/openfoodfacts/hunger-games/issues/225)) ([cf0b006](https://github.com/openfoodfacts/hunger-games/commit/cf0b006dcbcdda91af91edee91ee2d0d7ce95b7f)) +- show other questions in dev mode ([#228](https://github.com/openfoodfacts/hunger-games/issues/228)) ([525db64](https://github.com/openfoodfacts/hunger-games/commit/525db641e04645732176493918921af16425a52d)) +- Show product quantity and labels ([#293](https://github.com/openfoodfacts/hunger-games/issues/293)) ([dd4aee4](https://github.com/openfoodfacts/hunger-games/commit/dd4aee4691c603a072a680dcea02a83cca0e6c95)) +- show table with autosuggestion ([#384](https://github.com/openfoodfacts/hunger-games/issues/384)) ([d47e163](https://github.com/openfoodfacts/hunger-games/commit/d47e1639598eac30a2a0f00b34fe9cc2929a2283)) +- Show top insight in the home page ([#206](https://github.com/openfoodfacts/hunger-games/issues/206)) ([edb5de8](https://github.com/openfoodfacts/hunger-games/commit/edb5de8c864db23460e95560ed8e6bc7173a8483)) +- Show user statistics ([#196](https://github.com/openfoodfacts/hunger-games/issues/196)) ([d250b49](https://github.com/openfoodfacts/hunger-games/commit/d250b499cf1fae02a10efffdd36504c737c8dcf5)) +- Small logo improvements ([#466](https://github.com/openfoodfacts/hunger-games/issues/466)) ([a470185](https://github.com/openfoodfacts/hunger-games/commit/a470185dd288d3d980813a730f33736d75ec58b9)) +- Split interface for fast nutriscore answer and INAO logos ([#392](https://github.com/openfoodfacts/hunger-games/issues/392)) ([bcfc3e6](https://github.com/openfoodfacts/hunger-games/commit/bcfc3e6cd46fbcf72e8d453534225b5263c861b2)) +- Support 2 letters code four countries ([#938](https://github.com/openfoodfacts/hunger-games/issues/938)) ([091e1df](https://github.com/openfoodfacts/hunger-games/commit/091e1df447ca115843b59f135296e4898f3de299)) +- support additional API request for logo preview in debug mode ([#227](https://github.com/openfoodfacts/hunger-games/issues/227)) ([4a636c5](https://github.com/openfoodfacts/hunger-games/commit/4a636c542691f19e642211edf513af999a600cc3)) +- try packaging shapes ([924994c](https://github.com/openfoodfacts/hunger-games/commit/924994cba1381e2879e98108a3d434790c72af8d)) +- turn product details into a more legible table (solves [#123](https://github.com/openfoodfacts/hunger-games/issues/123)) ([#125](https://github.com/openfoodfacts/hunger-games/issues/125)) ([3c60dbd](https://github.com/openfoodfacts/hunger-games/commit/3c60dbd46154f2fa5d3de7c3eecc6924993c6da6)) +- UI improvement of question game ([#218](https://github.com/openfoodfacts/hunger-games/issues/218)) ([858c9fc](https://github.com/openfoodfacts/hunger-games/commit/858c9fc617bf6b302d7cecf09e1dda993e3552ab)) +- Use configured (const) OFF URLs in the UI ([#939](https://github.com/openfoodfacts/hunger-games/issues/939)) ([2407a52](https://github.com/openfoodfacts/hunger-games/commit/2407a5271ead19a78965a6a26ff40b417a82b4da)) +- Use deep link on most of the pages ([#268](https://github.com/openfoodfacts/hunger-games/issues/268)) ([eceabfd](https://github.com/openfoodfacts/hunger-games/commit/eceabfd2928ea979d291afc72c9ba3b23f22c4c8)) +- use predictor in INAO game ([#398](https://github.com/openfoodfacts/hunger-games/issues/398)) ([c03882c](https://github.com/openfoodfacts/hunger-games/commit/c03882c07a7d305ede6df81373ced5224234a617)) +- Use search a lisious for brand ([#942](https://github.com/openfoodfacts/hunger-games/issues/942)) ([4ffe3c1](https://github.com/openfoodfacts/hunger-games/commit/4ffe3c1c6dd17baf803243c69cb9be3c941aa48f)) +- Use the name and not the id for brand ([#944](https://github.com/openfoodfacts/hunger-games/issues/944)) ([f0f20dc](https://github.com/openfoodfacts/hunger-games/commit/f0f20dc91ea70a8be9739ece5fe06a26785c295e)) +- Visualized flagged images ([#169](https://github.com/openfoodfacts/hunger-games/issues/169)) ([dbda2d4](https://github.com/openfoodfacts/hunger-games/commit/dbda2d4a3c3bb06aa5a1bd3a2f86b020b53899f5)) ### Bug Fixes -* Adapt Hunger Games to the ANN modification in Robotoff ([#409](https://github.com/openfoodfacts/hunger-games/issues/409)) ([0cb81d4](https://github.com/openfoodfacts/hunger-games/commit/0cb81d4d513f2338a6ee0eb267f6584dedfc29c8)) -* Add all countries in the question filter ([#711](https://github.com/openfoodfacts/hunger-games/issues/711)) ([a790aaf](https://github.com/openfoodfacts/hunger-games/commit/a790aaf1675d928f5bb5d76ba61d48056852d498)) -* Add eslint and fix detected errors ([#800](https://github.com/openfoodfacts/hunger-games/issues/800)) ([4c69716](https://github.com/openfoodfacts/hunger-games/commit/4c6971651345914bbbfcc333e12310351b844fe5)) -* add permissions to GH_TOKEN for Pages deployment ([#683](https://github.com/openfoodfacts/hunger-games/issues/683)) ([c9dfef3](https://github.com/openfoodfacts/hunger-games/commit/c9dfef35f27e0ce8141f0d1edc153abe41fa0548)) -* added Settings and Tour to menu in mobile view ([#312](https://github.com/openfoodfacts/hunger-games/issues/312)) ([e9f12b6](https://github.com/openfoodfacts/hunger-games/commit/e9f12b65e27fb0ec33986400474bfbaa64ecc97a)) -* aligned loader center while loading pages ([#674](https://github.com/openfoodfacts/hunger-games/issues/674)) ([b4fed40](https://github.com/openfoodfacts/hunger-games/commit/b4fed40586a1959834fab2334a148cd8e2857650)) -* allows scoll on mobile (a hidden modal was taking the focus) ([#474](https://github.com/openfoodfacts/hunger-games/issues/474)) ([00853cc](https://github.com/openfoodfacts/hunger-games/commit/00853ccc65c13a3f0a551ce22dc5dd91ef153161)) -* allows to use `?type=packaging` in question game ([#570](https://github.com/openfoodfacts/hunger-games/issues/570)) ([69aa4ef](https://github.com/openfoodfacts/hunger-games/commit/69aa4ef91dbb0d63f17672beb22336d9e46a43ab)) -* Autocomplete behavior ([#476](https://github.com/openfoodfacts/hunger-games/issues/476)) ([a7bcfbc](https://github.com/openfoodfacts/hunger-games/commit/a7bcfbc9fffb4e1b806008bdfb98a8e2a8fab7be)) -* Avoid loading logos without a filtering defined ([#742](https://github.com/openfoodfacts/hunger-games/issues/742)) ([9a86c3f](https://github.com/openfoodfacts/hunger-games/commit/9a86c3fde9339fe96e1042cd678679625080b429)) -* capitalise country name. ([#522](https://github.com/openfoodfacts/hunger-games/issues/522)) ([56f5a40](https://github.com/openfoodfacts/hunger-games/commit/56f5a40b6c103b97158c761066e156f64f6c1cda)) -* change header color to match new OFF design ([#366](https://github.com/openfoodfacts/hunger-games/issues/366)) ([eee5a08](https://github.com/openfoodfacts/hunger-games/commit/eee5a081417aaf5fa542c6fa232213211700ce4f)) -* countries list was a single long string which caused the list to… ([#75](https://github.com/openfoodfacts/hunger-games/issues/75)) ([31adba4](https://github.com/openfoodfacts/hunger-games/commit/31adba443526a189d27911bc7d3eb058c66e5764)) -* Do not select logos with a value ([#684](https://github.com/openfoodfacts/hunger-games/issues/684)) ([3792552](https://github.com/openfoodfacts/hunger-games/commit/37925521ecd7f4def3ab2aab626f173df7ec0a20)) -* Do not sent annotation for "NO_QUESTION_LEFT" insight ([#286](https://github.com/openfoodfacts/hunger-games/issues/286)) ([6e02972](https://github.com/openfoodfacts/hunger-games/commit/6e02972b3fbf66ae8a93eeffd76347b1912f06d9)) -* ensure the Welcome Tour opens automatically only for the first time ([#121](https://github.com/openfoodfacts/hunger-games/issues/121)) ([a72147b](https://github.com/openfoodfacts/hunger-games/commit/a72147b0c6e3ff47b2c974aa56a3dd82aae0deed)) -* error when cleaning autcomplete labels ([#224](https://github.com/openfoodfacts/hunger-games/issues/224)) ([06b7381](https://github.com/openfoodfacts/hunger-games/commit/06b7381b59982f89f10563de9e507b2fe6c9de3b)) -* Fix a few typos in common.json that were fixed in en.json ([#640](https://github.com/openfoodfacts/hunger-games/issues/640)) ([e46298e](https://github.com/openfoodfacts/hunger-games/commit/e46298e2a44ad82b1d78bb1ed062b7a2bb15dc62)) -* fix broken logos and move to static.off.org ([#832](https://github.com/openfoodfacts/hunger-games/issues/832)) ([9309a04](https://github.com/openfoodfacts/hunger-games/commit/9309a046cf9dd50ad693bfd74f26fc2a3942c181)) -* Fix insight table error ([#229](https://github.com/openfoodfacts/hunger-games/issues/229)) ([3707afb](https://github.com/openfoodfacts/hunger-games/commit/3707afbd23824605d82866b832354163103f2b8f)) -* fix label value_tag and logo URLs in eco-score page ([#292](https://github.com/openfoodfacts/hunger-games/issues/292)) ([5f2f727](https://github.com/openfoodfacts/hunger-games/commit/5f2f727338ce3209cdc2daab196e3f3de30cde4a)) -* fix robots.txt ([#707](https://github.com/openfoodfacts/hunger-games/issues/707)) ([7951ea5](https://github.com/openfoodfacts/hunger-games/commit/7951ea5c293d6ceb280ca1e3b98b916515b88d0f)) -* fixed warn on empty values ([#641](https://github.com/openfoodfacts/hunger-games/issues/641)) ([fc2d48f](https://github.com/openfoodfacts/hunger-games/commit/fc2d48f84f23ce00c3b7f1dcc9f10b2a90f43aa4)) -* fixes for packaging ([cf49f5b](https://github.com/openfoodfacts/hunger-games/commit/cf49f5b02c365d4c3da994ab8d8e0741e81a68f3)) -* fixes-to-logo-dashboard ([#538](https://github.com/openfoodfacts/hunger-games/issues/538)) ([5a6dd49](https://github.com/openfoodfacts/hunger-games/commit/5a6dd4961ea65af368cb633dd2afd592425d4d5d)) -* Force logo game to show the requested logo with distance 0 ([#294](https://github.com/openfoodfacts/hunger-games/issues/294)) ([189f891](https://github.com/openfoodfacts/hunger-games/commit/189f89116bbdf3a76a75d5bd132b2a5a6994fe7b)) -* GitHub pages deploy ([#666](https://github.com/openfoodfacts/hunger-games/issues/666)) ([ea1b1be](https://github.com/openfoodfacts/hunger-games/commit/ea1b1be5597624054d03ffe1ae8ea53d3b5d0c98)) -* home_ecoscore ([#361](https://github.com/openfoodfacts/hunger-games/issues/361)) ([e5d97cc](https://github.com/openfoodfacts/hunger-games/commit/e5d97cc2ec8701b6bbbb2b1410dd4818fcb37dee)) -* infinit loading state ([#638](https://github.com/openfoodfacts/hunger-games/issues/638)) ([eb225b3](https://github.com/openfoodfacts/hunger-games/commit/eb225b3e0c2457db5dcc9bbe3b3f20f7496dc81f)) -* infinite refresh loop ([#200](https://github.com/openfoodfacts/hunger-games/issues/200)) ([b1183a5](https://github.com/openfoodfacts/hunger-games/commit/b1183a5274d4a8f05ea904aa895faf7f1f5332c1)) -* ingredients game API url ([#808](https://github.com/openfoodfacts/hunger-games/issues/808)) ([0f72784](https://github.com/openfoodfacts/hunger-games/commit/0f72784c4982222f2f7bde62ac6f779e90291390)) -* keep already set filter parameters ([#271](https://github.com/openfoodfacts/hunger-games/issues/271)) ([813c52b](https://github.com/openfoodfacts/hunger-games/commit/813c52bd3021f47c0d18340ee06a4312a2e605cd)) -* labeler.yml with new syntax ([#961](https://github.com/openfoodfacts/hunger-games/issues/961)) ([66f34bc](https://github.com/openfoodfacts/hunger-games/commit/66f34bc33d73214e308401341b70282f16d6e644)) -* link to home page use react-router ([#134](https://github.com/openfoodfacts/hunger-games/issues/134)) ([220c007](https://github.com/openfoodfacts/hunger-games/commit/220c0071795651948ed3e1ce556475170fd54f38)) -* logo ([#128](https://github.com/openfoodfacts/hunger-games/issues/128)) ([d591f2f](https://github.com/openfoodfacts/hunger-games/commit/d591f2f9b53ca8c63e5540e773e580eaa1d96860)) -* Logo games accessible to logged in users [#502](https://github.com/openfoodfacts/hunger-games/issues/502) ([#532](https://github.com/openfoodfacts/hunger-games/issues/532)) ([e667887](https://github.com/openfoodfacts/hunger-games/commit/e6678879991d7cfdc96ad69b80fa52b010046d1c)) -* logo-fixes ([#537](https://github.com/openfoodfacts/hunger-games/issues/537)) ([c145048](https://github.com/openfoodfacts/hunger-games/commit/c145048a81e4b283b1ec33b969c16be122822bb0)) -* logos ([a99b3ba](https://github.com/openfoodfacts/hunger-games/commit/a99b3ba266da52a330fdbef42368d04021dcf4f0)) -* mass logo annotation ([#571](https://github.com/openfoodfacts/hunger-games/issues/571)) ([2b2f3a7](https://github.com/openfoodfacts/hunger-games/commit/2b2f3a7b68a214f7ac29943b046e7c4fb6b84fd0)) -* mass logo annotation ([#572](https://github.com/openfoodfacts/hunger-games/issues/572)) ([b7dd2e2](https://github.com/openfoodfacts/hunger-games/commit/b7dd2e2c1cea03168672ba6d026129282faceee8)) -* move hardcoded dashboard to static ([#833](https://github.com/openfoodfacts/hunger-games/issues/833)) ([3114dba](https://github.com/openfoodfacts/hunger-games/commit/3114dba3b2084ba5062afeca8f1b2ff0aec69b52)) -* move withCredentials from data to config ([#296](https://github.com/openfoodfacts/hunger-games/issues/296)) ([cfc05e7](https://github.com/openfoodfacts/hunger-games/commit/cfc05e79e785579e9a4dc13722dbf263f6ab0732)) -* No intuitive way to close a modal on mobile ([#495](https://github.com/openfoodfacts/hunger-games/issues/495)) ([b46f50f](https://github.com/openfoodfacts/hunger-games/commit/b46f50f1fa5d720c5254719fc938ccbfa397ce8f)) -* Opportunities broken links ([#308](https://github.com/openfoodfacts/hunger-games/issues/308)) ([0c6a2cd](https://github.com/openfoodfacts/hunger-games/commit/0c6a2cddfe39239cfcc0df6b75f2b3e2f93a8845)) -* packaging logos ([3dd7f7a](https://github.com/openfoodfacts/hunger-games/commit/3dd7f7aa0dc4236f01aac2e682b899b3429773bc)) -* prevent resetting autocomplet value when no result found ([#234](https://github.com/openfoodfacts/hunger-games/issues/234)) ([6aeca53](https://github.com/openfoodfacts/hunger-games/commit/6aeca5344309877e54b3976a87a6ab72f9fa4e13)) -* questions page, rephrase remaining annotations ([#69](https://github.com/openfoodfacts/hunger-games/issues/69)) ([f4fa525](https://github.com/openfoodfacts/hunger-games/commit/f4fa525d6aa128942de1536b1d1a192836f13538)) -* Recycling dashboard links to labels vs packaging ([#457](https://github.com/openfoodfacts/hunger-games/issues/457)) ([31db26d](https://github.com/openfoodfacts/hunger-games/commit/31db26df0f1dc3a6a013a6256b87b145c744776d)) -* Replace "en" by "fr" for AB insight ([#209](https://github.com/openfoodfacts/hunger-games/issues/209)) ([8700aef](https://github.com/openfoodfacts/hunger-games/commit/8700aef7197d734d3b4a54fdae54099cc6ae8921)) -* select all in logo game ([#530](https://github.com/openfoodfacts/hunger-games/issues/530)) ([1d01675](https://github.com/openfoodfacts/hunger-games/commit/1d01675ccd425a46387e256c3187d1fc168c3652)) -* Send answers to robotoff ([#552](https://github.com/openfoodfacts/hunger-games/issues/552)) ([ea63319](https://github.com/openfoodfacts/hunger-games/commit/ea6331930172087c200c96e55233b3f2eeffb770)) -* send logo annotations to robotoff ([#202](https://github.com/openfoodfacts/hunger-games/issues/202)) ([add51db](https://github.com/openfoodfacts/hunger-games/commit/add51dba379ae520aa805acb3348a3e625068a8f)) -* show existing categories in categories questions ([#236](https://github.com/openfoodfacts/hunger-games/issues/236)) ([60c8704](https://github.com/openfoodfacts/hunger-games/commit/60c870485dcc498055003202bb04cd79fc913ae0)) -* Show question without logo to avoid false annotation ([#393](https://github.com/openfoodfacts/hunger-games/issues/393)) ([2fb4e16](https://github.com/openfoodfacts/hunger-games/commit/2fb4e16bbb6534618839327927c1b04c60cf0af5)) -* small string fixes ([#310](https://github.com/openfoodfacts/hunger-games/issues/310)) ([2c2c9d3](https://github.com/openfoodfacts/hunger-games/commit/2c2c9d3ad7fde3f6a10b50b0a9e46710807ecf0a)) -* stop loading state in case of error in data fetching ([#543](https://github.com/openfoodfacts/hunger-games/issues/543)) ([e5f3d67](https://github.com/openfoodfacts/hunger-games/commit/e5f3d67bcd5e7028a4ce33c22494271bf74228c4)) -* Swapped old microsoft link with new one ([#637](https://github.com/openfoodfacts/hunger-games/issues/637)) ([54a4e21](https://github.com/openfoodfacts/hunger-games/commit/54a4e2138246139f9b23aaa338e141c02a4b354e)) -* Sync between url and inputs in Nutri-Score game ([#309](https://github.com/openfoodfacts/hunger-games/issues/309)) ([4fd090f](https://github.com/openfoodfacts/hunger-games/commit/4fd090f467b5f03ff96b024d9fcb620bf87d2b36)) -* translation added ([3c1215b](https://github.com/openfoodfacts/hunger-games/commit/3c1215b5a288555c79740a794a91d699d8950978)) -* translation fixed ([c535bdf](https://github.com/openfoodfacts/hunger-games/commit/c535bdfc05b7f9dca8a4cf02c85300b31aaf7947)) -* typo fixes ([#394](https://github.com/openfoodfacts/hunger-games/issues/394)) ([6b7b783](https://github.com/openfoodfacts/hunger-games/commit/6b7b78381dfa6b21a7a251bd31cf7b8f991943db)) -* typo reported by Thomas ([#421](https://github.com/openfoodfacts/hunger-games/issues/421)) ([4581b81](https://github.com/openfoodfacts/hunger-games/commit/4581b81226e007213b69188c52feb0ba41ced802)) -* update OFF_IMAGE_URL ([#715](https://github.com/openfoodfacts/hunger-games/issues/715)) ([8dc83a1](https://github.com/openfoodfacts/hunger-games/commit/8dc83a1bcca4c30a3acd853d5da322b0a5867ea2)) -* Updating logo annotation ([#211](https://github.com/openfoodfacts/hunger-games/issues/211)) ([c624084](https://github.com/openfoodfacts/hunger-games/commit/c62408491560af8705028b681d196f0c204ba52d)) -* use predictor nutriscore for corresponding game ([#407](https://github.com/openfoodfacts/hunger-games/issues/407)) ([450f5fd](https://github.com/openfoodfacts/hunger-games/commit/450f5fd7d3ec5bfea4dd6569c76545a81adc1065)) -* wording fixes ([#544](https://github.com/openfoodfacts/hunger-games/issues/544)) ([e6c6040](https://github.com/openfoodfacts/hunger-games/commit/e6c6040ba681a37f955cf0a7046bf73d8655feea)) - - +- Adapt Hunger Games to the ANN modification in Robotoff ([#409](https://github.com/openfoodfacts/hunger-games/issues/409)) ([0cb81d4](https://github.com/openfoodfacts/hunger-games/commit/0cb81d4d513f2338a6ee0eb267f6584dedfc29c8)) +- Add all countries in the question filter ([#711](https://github.com/openfoodfacts/hunger-games/issues/711)) ([a790aaf](https://github.com/openfoodfacts/hunger-games/commit/a790aaf1675d928f5bb5d76ba61d48056852d498)) +- Add eslint and fix detected errors ([#800](https://github.com/openfoodfacts/hunger-games/issues/800)) ([4c69716](https://github.com/openfoodfacts/hunger-games/commit/4c6971651345914bbbfcc333e12310351b844fe5)) +- add permissions to GH_TOKEN for Pages deployment ([#683](https://github.com/openfoodfacts/hunger-games/issues/683)) ([c9dfef3](https://github.com/openfoodfacts/hunger-games/commit/c9dfef35f27e0ce8141f0d1edc153abe41fa0548)) +- added Settings and Tour to menu in mobile view ([#312](https://github.com/openfoodfacts/hunger-games/issues/312)) ([e9f12b6](https://github.com/openfoodfacts/hunger-games/commit/e9f12b65e27fb0ec33986400474bfbaa64ecc97a)) +- aligned loader center while loading pages ([#674](https://github.com/openfoodfacts/hunger-games/issues/674)) ([b4fed40](https://github.com/openfoodfacts/hunger-games/commit/b4fed40586a1959834fab2334a148cd8e2857650)) +- allows scoll on mobile (a hidden modal was taking the focus) ([#474](https://github.com/openfoodfacts/hunger-games/issues/474)) ([00853cc](https://github.com/openfoodfacts/hunger-games/commit/00853ccc65c13a3f0a551ce22dc5dd91ef153161)) +- allows to use `?type=packaging` in question game ([#570](https://github.com/openfoodfacts/hunger-games/issues/570)) ([69aa4ef](https://github.com/openfoodfacts/hunger-games/commit/69aa4ef91dbb0d63f17672beb22336d9e46a43ab)) +- Autocomplete behavior ([#476](https://github.com/openfoodfacts/hunger-games/issues/476)) ([a7bcfbc](https://github.com/openfoodfacts/hunger-games/commit/a7bcfbc9fffb4e1b806008bdfb98a8e2a8fab7be)) +- Avoid loading logos without a filtering defined ([#742](https://github.com/openfoodfacts/hunger-games/issues/742)) ([9a86c3f](https://github.com/openfoodfacts/hunger-games/commit/9a86c3fde9339fe96e1042cd678679625080b429)) +- capitalise country name. ([#522](https://github.com/openfoodfacts/hunger-games/issues/522)) ([56f5a40](https://github.com/openfoodfacts/hunger-games/commit/56f5a40b6c103b97158c761066e156f64f6c1cda)) +- change header color to match new OFF design ([#366](https://github.com/openfoodfacts/hunger-games/issues/366)) ([eee5a08](https://github.com/openfoodfacts/hunger-games/commit/eee5a081417aaf5fa542c6fa232213211700ce4f)) +- countries list was a single long string which caused the list to… ([#75](https://github.com/openfoodfacts/hunger-games/issues/75)) ([31adba4](https://github.com/openfoodfacts/hunger-games/commit/31adba443526a189d27911bc7d3eb058c66e5764)) +- Do not select logos with a value ([#684](https://github.com/openfoodfacts/hunger-games/issues/684)) ([3792552](https://github.com/openfoodfacts/hunger-games/commit/37925521ecd7f4def3ab2aab626f173df7ec0a20)) +- Do not sent annotation for "NO_QUESTION_LEFT" insight ([#286](https://github.com/openfoodfacts/hunger-games/issues/286)) ([6e02972](https://github.com/openfoodfacts/hunger-games/commit/6e02972b3fbf66ae8a93eeffd76347b1912f06d9)) +- ensure the Welcome Tour opens automatically only for the first time ([#121](https://github.com/openfoodfacts/hunger-games/issues/121)) ([a72147b](https://github.com/openfoodfacts/hunger-games/commit/a72147b0c6e3ff47b2c974aa56a3dd82aae0deed)) +- error when cleaning autcomplete labels ([#224](https://github.com/openfoodfacts/hunger-games/issues/224)) ([06b7381](https://github.com/openfoodfacts/hunger-games/commit/06b7381b59982f89f10563de9e507b2fe6c9de3b)) +- Fix a few typos in common.json that were fixed in en.json ([#640](https://github.com/openfoodfacts/hunger-games/issues/640)) ([e46298e](https://github.com/openfoodfacts/hunger-games/commit/e46298e2a44ad82b1d78bb1ed062b7a2bb15dc62)) +- fix broken logos and move to static.off.org ([#832](https://github.com/openfoodfacts/hunger-games/issues/832)) ([9309a04](https://github.com/openfoodfacts/hunger-games/commit/9309a046cf9dd50ad693bfd74f26fc2a3942c181)) +- Fix insight table error ([#229](https://github.com/openfoodfacts/hunger-games/issues/229)) ([3707afb](https://github.com/openfoodfacts/hunger-games/commit/3707afbd23824605d82866b832354163103f2b8f)) +- fix label value_tag and logo URLs in eco-score page ([#292](https://github.com/openfoodfacts/hunger-games/issues/292)) ([5f2f727](https://github.com/openfoodfacts/hunger-games/commit/5f2f727338ce3209cdc2daab196e3f3de30cde4a)) +- fix robots.txt ([#707](https://github.com/openfoodfacts/hunger-games/issues/707)) ([7951ea5](https://github.com/openfoodfacts/hunger-games/commit/7951ea5c293d6ceb280ca1e3b98b916515b88d0f)) +- fixed warn on empty values ([#641](https://github.com/openfoodfacts/hunger-games/issues/641)) ([fc2d48f](https://github.com/openfoodfacts/hunger-games/commit/fc2d48f84f23ce00c3b7f1dcc9f10b2a90f43aa4)) +- fixes for packaging ([cf49f5b](https://github.com/openfoodfacts/hunger-games/commit/cf49f5b02c365d4c3da994ab8d8e0741e81a68f3)) +- fixes-to-logo-dashboard ([#538](https://github.com/openfoodfacts/hunger-games/issues/538)) ([5a6dd49](https://github.com/openfoodfacts/hunger-games/commit/5a6dd4961ea65af368cb633dd2afd592425d4d5d)) +- Force logo game to show the requested logo with distance 0 ([#294](https://github.com/openfoodfacts/hunger-games/issues/294)) ([189f891](https://github.com/openfoodfacts/hunger-games/commit/189f89116bbdf3a76a75d5bd132b2a5a6994fe7b)) +- GitHub pages deploy ([#666](https://github.com/openfoodfacts/hunger-games/issues/666)) ([ea1b1be](https://github.com/openfoodfacts/hunger-games/commit/ea1b1be5597624054d03ffe1ae8ea53d3b5d0c98)) +- home_ecoscore ([#361](https://github.com/openfoodfacts/hunger-games/issues/361)) ([e5d97cc](https://github.com/openfoodfacts/hunger-games/commit/e5d97cc2ec8701b6bbbb2b1410dd4818fcb37dee)) +- infinit loading state ([#638](https://github.com/openfoodfacts/hunger-games/issues/638)) ([eb225b3](https://github.com/openfoodfacts/hunger-games/commit/eb225b3e0c2457db5dcc9bbe3b3f20f7496dc81f)) +- infinite refresh loop ([#200](https://github.com/openfoodfacts/hunger-games/issues/200)) ([b1183a5](https://github.com/openfoodfacts/hunger-games/commit/b1183a5274d4a8f05ea904aa895faf7f1f5332c1)) +- ingredients game API url ([#808](https://github.com/openfoodfacts/hunger-games/issues/808)) ([0f72784](https://github.com/openfoodfacts/hunger-games/commit/0f72784c4982222f2f7bde62ac6f779e90291390)) +- keep already set filter parameters ([#271](https://github.com/openfoodfacts/hunger-games/issues/271)) ([813c52b](https://github.com/openfoodfacts/hunger-games/commit/813c52bd3021f47c0d18340ee06a4312a2e605cd)) +- labeler.yml with new syntax ([#961](https://github.com/openfoodfacts/hunger-games/issues/961)) ([66f34bc](https://github.com/openfoodfacts/hunger-games/commit/66f34bc33d73214e308401341b70282f16d6e644)) +- link to home page use react-router ([#134](https://github.com/openfoodfacts/hunger-games/issues/134)) ([220c007](https://github.com/openfoodfacts/hunger-games/commit/220c0071795651948ed3e1ce556475170fd54f38)) +- logo ([#128](https://github.com/openfoodfacts/hunger-games/issues/128)) ([d591f2f](https://github.com/openfoodfacts/hunger-games/commit/d591f2f9b53ca8c63e5540e773e580eaa1d96860)) +- Logo games accessible to logged in users [#502](https://github.com/openfoodfacts/hunger-games/issues/502) ([#532](https://github.com/openfoodfacts/hunger-games/issues/532)) ([e667887](https://github.com/openfoodfacts/hunger-games/commit/e6678879991d7cfdc96ad69b80fa52b010046d1c)) +- logo-fixes ([#537](https://github.com/openfoodfacts/hunger-games/issues/537)) ([c145048](https://github.com/openfoodfacts/hunger-games/commit/c145048a81e4b283b1ec33b969c16be122822bb0)) +- logos ([a99b3ba](https://github.com/openfoodfacts/hunger-games/commit/a99b3ba266da52a330fdbef42368d04021dcf4f0)) +- mass logo annotation ([#571](https://github.com/openfoodfacts/hunger-games/issues/571)) ([2b2f3a7](https://github.com/openfoodfacts/hunger-games/commit/2b2f3a7b68a214f7ac29943b046e7c4fb6b84fd0)) +- mass logo annotation ([#572](https://github.com/openfoodfacts/hunger-games/issues/572)) ([b7dd2e2](https://github.com/openfoodfacts/hunger-games/commit/b7dd2e2c1cea03168672ba6d026129282faceee8)) +- move hardcoded dashboard to static ([#833](https://github.com/openfoodfacts/hunger-games/issues/833)) ([3114dba](https://github.com/openfoodfacts/hunger-games/commit/3114dba3b2084ba5062afeca8f1b2ff0aec69b52)) +- move withCredentials from data to config ([#296](https://github.com/openfoodfacts/hunger-games/issues/296)) ([cfc05e7](https://github.com/openfoodfacts/hunger-games/commit/cfc05e79e785579e9a4dc13722dbf263f6ab0732)) +- No intuitive way to close a modal on mobile ([#495](https://github.com/openfoodfacts/hunger-games/issues/495)) ([b46f50f](https://github.com/openfoodfacts/hunger-games/commit/b46f50f1fa5d720c5254719fc938ccbfa397ce8f)) +- Opportunities broken links ([#308](https://github.com/openfoodfacts/hunger-games/issues/308)) ([0c6a2cd](https://github.com/openfoodfacts/hunger-games/commit/0c6a2cddfe39239cfcc0df6b75f2b3e2f93a8845)) +- packaging logos ([3dd7f7a](https://github.com/openfoodfacts/hunger-games/commit/3dd7f7aa0dc4236f01aac2e682b899b3429773bc)) +- prevent resetting autocomplet value when no result found ([#234](https://github.com/openfoodfacts/hunger-games/issues/234)) ([6aeca53](https://github.com/openfoodfacts/hunger-games/commit/6aeca5344309877e54b3976a87a6ab72f9fa4e13)) +- questions page, rephrase remaining annotations ([#69](https://github.com/openfoodfacts/hunger-games/issues/69)) ([f4fa525](https://github.com/openfoodfacts/hunger-games/commit/f4fa525d6aa128942de1536b1d1a192836f13538)) +- Recycling dashboard links to labels vs packaging ([#457](https://github.com/openfoodfacts/hunger-games/issues/457)) ([31db26d](https://github.com/openfoodfacts/hunger-games/commit/31db26df0f1dc3a6a013a6256b87b145c744776d)) +- Replace "en" by "fr" for AB insight ([#209](https://github.com/openfoodfacts/hunger-games/issues/209)) ([8700aef](https://github.com/openfoodfacts/hunger-games/commit/8700aef7197d734d3b4a54fdae54099cc6ae8921)) +- select all in logo game ([#530](https://github.com/openfoodfacts/hunger-games/issues/530)) ([1d01675](https://github.com/openfoodfacts/hunger-games/commit/1d01675ccd425a46387e256c3187d1fc168c3652)) +- Send answers to robotoff ([#552](https://github.com/openfoodfacts/hunger-games/issues/552)) ([ea63319](https://github.com/openfoodfacts/hunger-games/commit/ea6331930172087c200c96e55233b3f2eeffb770)) +- send logo annotations to robotoff ([#202](https://github.com/openfoodfacts/hunger-games/issues/202)) ([add51db](https://github.com/openfoodfacts/hunger-games/commit/add51dba379ae520aa805acb3348a3e625068a8f)) +- show existing categories in categories questions ([#236](https://github.com/openfoodfacts/hunger-games/issues/236)) ([60c8704](https://github.com/openfoodfacts/hunger-games/commit/60c870485dcc498055003202bb04cd79fc913ae0)) +- Show question without logo to avoid false annotation ([#393](https://github.com/openfoodfacts/hunger-games/issues/393)) ([2fb4e16](https://github.com/openfoodfacts/hunger-games/commit/2fb4e16bbb6534618839327927c1b04c60cf0af5)) +- small string fixes ([#310](https://github.com/openfoodfacts/hunger-games/issues/310)) ([2c2c9d3](https://github.com/openfoodfacts/hunger-games/commit/2c2c9d3ad7fde3f6a10b50b0a9e46710807ecf0a)) +- stop loading state in case of error in data fetching ([#543](https://github.com/openfoodfacts/hunger-games/issues/543)) ([e5f3d67](https://github.com/openfoodfacts/hunger-games/commit/e5f3d67bcd5e7028a4ce33c22494271bf74228c4)) +- Swapped old microsoft link with new one ([#637](https://github.com/openfoodfacts/hunger-games/issues/637)) ([54a4e21](https://github.com/openfoodfacts/hunger-games/commit/54a4e2138246139f9b23aaa338e141c02a4b354e)) +- Sync between url and inputs in Nutri-Score game ([#309](https://github.com/openfoodfacts/hunger-games/issues/309)) ([4fd090f](https://github.com/openfoodfacts/hunger-games/commit/4fd090f467b5f03ff96b024d9fcb620bf87d2b36)) +- translation added ([3c1215b](https://github.com/openfoodfacts/hunger-games/commit/3c1215b5a288555c79740a794a91d699d8950978)) +- translation fixed ([c535bdf](https://github.com/openfoodfacts/hunger-games/commit/c535bdfc05b7f9dca8a4cf02c85300b31aaf7947)) +- typo fixes ([#394](https://github.com/openfoodfacts/hunger-games/issues/394)) ([6b7b783](https://github.com/openfoodfacts/hunger-games/commit/6b7b78381dfa6b21a7a251bd31cf7b8f991943db)) +- typo reported by Thomas ([#421](https://github.com/openfoodfacts/hunger-games/issues/421)) ([4581b81](https://github.com/openfoodfacts/hunger-games/commit/4581b81226e007213b69188c52feb0ba41ced802)) +- update OFF_IMAGE_URL ([#715](https://github.com/openfoodfacts/hunger-games/issues/715)) ([8dc83a1](https://github.com/openfoodfacts/hunger-games/commit/8dc83a1bcca4c30a3acd853d5da322b0a5867ea2)) +- Updating logo annotation ([#211](https://github.com/openfoodfacts/hunger-games/issues/211)) ([c624084](https://github.com/openfoodfacts/hunger-games/commit/c62408491560af8705028b681d196f0c204ba52d)) +- use predictor nutriscore for corresponding game ([#407](https://github.com/openfoodfacts/hunger-games/issues/407)) ([450f5fd](https://github.com/openfoodfacts/hunger-games/commit/450f5fd7d3ec5bfea4dd6569c76545a81adc1065)) +- wording fixes ([#544](https://github.com/openfoodfacts/hunger-games/issues/544)) ([e6c6040](https://github.com/openfoodfacts/hunger-games/commit/e6c6040ba681a37f955cf0a7046bf73d8655feea)) diff --git a/src/pages/nutrition/config.ts b/src/pages/nutrition/config.ts new file mode 100644 index 0000000000..9360ba9608 --- /dev/null +++ b/src/pages/nutrition/config.ts @@ -0,0 +1 @@ +export const UNITS = ["", "g", "mg", "µg"]; diff --git a/src/pages/nutrition/index.jsx b/src/pages/nutrition/index.jsx deleted file mode 100644 index 700aca9251..0000000000 --- a/src/pages/nutrition/index.jsx +++ /dev/null @@ -1,60 +0,0 @@ -import * as React from "react"; -import NutritionTable from "./table"; -import ProductNutriments from "./productCard"; -import { Box } from "@mui/material"; - -import { basicNutriments } from "./nutritionFields"; - -export default function Nutrition() { - const [nutriments, setNutriments] = React.useState(basicNutriments); - - const onchangeHandler = React.useCallback( - (nutriment_id, propertyKey) => (event) => { - setNutriments((prevState) => - prevState.map((nutriment) => { - return nutriment_id === nutriment.off_nutriment_id - ? { ...nutriment, [propertyKey]: event.target.value } - : nutriment; - }), - ); - }, - [], - ); - function deleteItem(nutr) { - setNutriments((prev) => - prev.map((nutriment) => - nutriment === nutr ? { ...nutriment, display: false } : nutriment, - ), - ); - } - - return ( - - - - nutr.display)} - setNutriments={setNutriments} - onchangeHandler={onchangeHandler} - deleteItem={deleteItem} - /> - - - ); -} diff --git a/src/pages/nutrition/index.tsx b/src/pages/nutrition/index.tsx new file mode 100644 index 0000000000..d024739cda --- /dev/null +++ b/src/pages/nutrition/index.tsx @@ -0,0 +1,265 @@ +import * as React from "react"; +import { useRobotoffPredicitions } from "./useRobotoffPredicitions"; +import { OFF_IMAGE_URL } from "../../const"; +import { + ReactZoomPanPinchRef, + TransformComponent, + TransformWrapper, +} from "react-zoom-pan-pinch"; +import { Box, Button } from "@mui/material"; +import Stack from "@mui/material/Stack"; +import { + isValidUnit, + NUTRIMENTS, + postRobotoff, + structurePredictions, +} from "./utils"; +import { NutrimentPrediction } from "./insight.types"; +import { ErrorBoundary } from "../taxonomyWalk/Error"; +import { UNITS } from "./config"; + +export default function Nutrition() { + const { isLoading, insight, nextItem } = useRobotoffPredicitions(); + // const [showRaw, setShowRaw] = React.useState(false); + const [values, setValues] = React.useState< + Record> + >({}); + const apiRef = React.useRef(); + + React.useEffect(() => { + if (!insight || typeof insight === "string") { + setValues({}); + return; + } + + setValues(() => insight.data.nutrients); + }, [insight]); + + if (isLoading) { + return

Loading ....

; + } + if (!insight) { + return

No predicition found

; + } + + const nutrimentsDetected = structurePredictions(values); + return ( + + + + + + + + + + + + + + + + + + + + + {nutrimentsDetected.map((nutrimentId) => { + return ( + + + + + + ); + })} + + + + + + + +
Nutri100g + serving{" "} + +
{NUTRIMENTS[nutrimentId] ?? nutrimentId} + + setValues((p) => ({ + ...p, + [`${nutrimentId}_100g`]: { + ...p[`${nutrimentId}_100g`], + value: event.target.value, + }, + })) + } + /> + + {isValidUnit(values[`${nutrimentId}_100g`]?.unit) ? ( + + ) : ( + + {values[`${nutrimentId}_100g`]?.unit} + + )} + + + + setValues((p) => ({ + ...p, + [`${nutrimentId}_serving`]: { + ...p[`${nutrimentId}_serving`], + value: event.target.value, + }, + })) + } + /> + + {isValidUnit(values[`${nutrimentId}_serving`]?.unit) ? ( + + ) : ( + + {values[`${nutrimentId}_serving`]?.unit} + + )} + + +
+ + + + +
+ {/* {showRaw && ( +
+                {JSON.stringify(insight, null, 2)}
+              
+ )} + */} + +
+
+
+
+ ); +} + +// nutrient: { +// } +// nutrition_data_per = "100g" | "serving"; diff --git a/src/pages/nutrition/insight.types.ts b/src/pages/nutrition/insight.types.ts new file mode 100644 index 0000000000..6e4af4d966 --- /dev/null +++ b/src/pages/nutrition/insight.types.ts @@ -0,0 +1,24 @@ +export interface NutrimentPrediction { + end: number; + text: string; + unit: string; + score: number; + start: number; + valid: boolean; + value: string; + entity: string; + char_end: number; + char_start: number; +} + +export interface InsightType { + id: string; + barcode: string; + data: { + entities: { + postprocessed: NutrimentPrediction[]; + }; + nutrients: Record; + }; + source_image: string; +} diff --git a/src/pages/nutrition/nutritionFields.js b/src/pages/nutrition/nutritionFields.js deleted file mode 100644 index e9af3bd2af..0000000000 --- a/src/pages/nutrition/nutritionFields.js +++ /dev/null @@ -1,344 +0,0 @@ -const basicNutriments = [ - { - off_nutriment_id: "energy-kj", - label: "nutriment_energy-kj", - value: "", - unit: null, - quantification: "=", - robotoffPrediction: null, - display: true, - unitOptions: [], - }, - { - off_nutriment_id: "energy-kcal", - label: "nutriment_energy-kcal", - value: "", - unit: null, - quantification: "<", - robotoffPrediction: null, - display: true, - unitOptions: [], - }, - { - off_nutriment_id: "nutriment_fat", - label: "nutriment_fat", - value: "", - unit: "g", - quantification: "<", - robotoffPrediction: null, - display: true, - }, - { - off_nutriment_id: "saturated-fat", - label: "nutriment_saturated-fat", - value: "", - unit: "g", - quantification: "<", - robotoffPrediction: null, - display: true, - }, - { - off_nutriment_id: "carbohydrates", - label: "nutriment_carbohydrates", - value: "", - unit: "g", - quantification: "=", - robotoffPrediction: null, - display: false, - }, - { - off_nutriment_id: "sugars", - label: "nutriment_sugars", - value: "", - unit: "g", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - { - off_nutriment_id: "proteins", - label: "nutriment_proteins", - value: "", - unit: "g", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - { - off_nutriment_id: "fiber", - label: "nutriment_fiber", - value: "", - unit: "g", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "salt", - label: "nutriment_salt", - value: "", - unit: "g", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "sodium", - label: "nutriment_sodium", - value: "", - unit: null, - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "zinc", - label: "nutriment_zinc", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "vitamin-c", - label: "nutriment_vitamin-c", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "vitamin-d", - label: "nutriment_vitamin-d", - value: "", - unit: "µg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "vitamin-k", - label: "nutriment_vitamin-k", - value: "", - unit: "µg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "vitamin-b6", - label: "nutriment_vitamin-b6", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "vitamin-a", - label: "nutriment_vitamin-a", - value: "", - unit: "µg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "selenium", - label: "nutriment_selenium", - value: "", - unit: "µg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - { - off_nutriment_id: "bicarbonate", - label: "nutriment_bicarbonate", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "magnesium", - label: "nutriment_magnesium", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "pantothenic-acid", - label: "nutriment_pantothenic-acid", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - { - off_nutriment_id: "fluoride", - label: "nutriment_fluoride", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "iodine", - label: "nutriment_iodine", - value: "", - unit: "µg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "silica", - label: "nutriment_silica", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "alcohol", - label: "nutriment_alcohol", - value: "", - unit: "% vol", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "potassium", - label: "nutriment_potassium", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "manganese", - label: "nutriment_manganese", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "phosphorus", - label: "nutriment_phosphorus", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - { - off_nutriment_id: "biotin", - label: "nutriment_biotin", - value: "", - unit: "µg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - { - off_nutriment_id: "ph", - label: "nutriment_ph", - value: "", - unit: null, - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "molybdenum", - label: "nutriment_molybdenum", - value: "", - unit: "µg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "caffeine", - label: "nutriment_caffeine", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "chromium", - label: "nutriment_chromium", - value: "", - unit: "µg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "iron", - label: "nutriment_iron", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "copper", - label: "nutriment_copper", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, - - { - off_nutriment_id: "cholesterol", - label: "nutriment_cholesterol", - value: "", - unit: "mg", - quantification: "<", - robotoffPrediction: null, - display: false, - }, -]; - -export { basicNutriments }; diff --git a/src/pages/nutrition/productCard.jsx b/src/pages/nutrition/productCard.jsx deleted file mode 100644 index 8c7860c8b2..0000000000 --- a/src/pages/nutrition/productCard.jsx +++ /dev/null @@ -1,116 +0,0 @@ -import * as React from "react"; -import { useTranslation } from "react-i18next"; -import Box from "@mui/material/Box"; -import Button from "@mui/material/Button"; -import Typography from "@mui/material/Typography"; -import ZoomableImage from "../../components/ZoomableImage"; -import offService from "../../off"; -import { OFF_URL } from "../../const"; - -import { basicNutriments } from "./nutritionFields"; - -export default function ProductNutriments({ setNutriments, nutriments }) { - const { t } = useTranslation(); - const [page, setPage] = React.useState(1); - const [index, setIndex] = React.useState(0); - const [products, setProducts] = React.useState([]); - - const product = products[index]; - const productName = product - ? product.product_name - ? product.product_name - : t("nutrition.unknown_brand") - : t("nutrition.loading"); - - React.useEffect(() => { - const productListUrl = offService.getNutritionToFillUrl({ page }); - - fetch(productListUrl) - .then((res) => res.json()) - .then((data) => { - setProducts(data.products); - }); - }, [page]); - - const pictureURL = products[index] - ? products[index].image_nutrition_url - : `${OFF_URL}/images/image-placeholder.png`; - - function clickHandler() { - if (index < products.length - 1) setIndex((prev) => ++prev); - else { - setIndex(0); - setPage((prevPage) => ++prevPage); - } - const resArr = nutriments.filter( - (nutr) => nutr.display && nutr.value !== null && nutr.value >= 0, - ); - const message = resArr.length ? resArr : t("nutrition.value_missing"); - console.log(message); - setNutriments(basicNutriments); - } - - return ( - - - - - - - {productName} - - {/**/} - {/* PRODUCT DESCRIPTION IF NEEDED*/} - {/**/} - - - - ); -} diff --git a/src/pages/nutrition/table.jsx b/src/pages/nutrition/table.jsx deleted file mode 100644 index b1c944ce36..0000000000 --- a/src/pages/nutrition/table.jsx +++ /dev/null @@ -1,66 +0,0 @@ -import * as React from "react"; -import Table from "@mui/material/Table"; -import TableBody from "@mui/material/TableBody"; -import TableCell from "@mui/material/TableCell"; -import TableContainer from "@mui/material/TableContainer"; -import TableHead from "@mui/material/TableHead"; -import TableRow from "@mui/material/TableRow"; -import { Box } from "@mui/material"; -// import AdditionalNutriments from "./additionalNutritions"; -import { useTranslation } from "react-i18next"; - -import TableRowComp from "./tableRow"; - -export default function NutritionTable({ - nutriments, - // setNutriments, - // additionalNutriments, - deleteItem, - onchangeHandler, -}) { - const { t } = useTranslation(); - - const rows = nutriments.map((nutriment) => ( - - )); - // const options = additionalNutriments.map((item) => ({ - // label: t(`nutrition.nutriments.${item.label}`), - // id: item.label, - // })); - - return ( - - - - - - - {t("nutrition.table.value")} - - - - - {rows} -
-
- {/* */} -
- ); -} diff --git a/src/pages/nutrition/tableRow.jsx b/src/pages/nutrition/tableRow.jsx deleted file mode 100644 index 06d1dff559..0000000000 --- a/src/pages/nutrition/tableRow.jsx +++ /dev/null @@ -1,90 +0,0 @@ -import * as React from "react"; -import TableCell from "@mui/material/TableCell"; -import TableRow from "@mui/material/TableRow"; -import TextField from "@mui/material/TextField"; -import MenuItem from "@mui/material/MenuItem"; -import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline"; - -import { useTranslation } from "react-i18next"; - -const defaultUnitOptions = [ - { value: "g", label: "g" }, - { value: "mg", label: "mg" }, -]; -const qualificationOptions = [ - { value: "=", label: "=" }, - { value: ">", label: ">" }, - { value: "<", label: "<" }, -]; -export default function TableRowComp({ - nutriment, - onchangeHandler, - deleteItem, -}) { - const { t } = useTranslation(); - - const nutrimentLabel = t(`nutrition.nutriments.${nutriment.label}`); - - const unitOptions = nutriment.unitOptions ?? defaultUnitOptions; - - return ( - - - {nutrimentLabel} - - - - {qualificationOptions.map(({ label, value }) => ( - - {label} - - ))} - - - - - - - - {unitOptions.length > 0 && ( - - {unitOptions.map(({ label, value }) => ( - - {label} - - ))} - - )} - - - deleteItem(nutriment)} - /> - - - ); -} diff --git a/src/pages/nutrition/useRobotoffPredicitions.ts b/src/pages/nutrition/useRobotoffPredicitions.ts new file mode 100644 index 0000000000..ac5696030b --- /dev/null +++ b/src/pages/nutrition/useRobotoffPredicitions.ts @@ -0,0 +1,46 @@ +import * as React from "react"; +import robotoff from "../../robotoff"; +import { InsightType } from "./insight.types"; + +export function useRobotoffPredicitions() { + const [isLoading, setIsLoading] = React.useState(false); + const [insights, setInsights] = React.useState([]); + const [insightIndex, setInsightIndex] = React.useState(0); + const [page, setPage] = React.useState(1); + + React.useEffect(() => { + if (isLoading || insightIndex < insights.length - 1) { + return; + } + let valid = true; + setIsLoading(true); + + robotoff + .getInsights( + "", + "nutrient_extraction", + "", + "", + + page, + ) + .then(({ data }) => { + if (!valid) { + return; + } + setInsights((prev) => [...prev, ...data.insights]); + setPage((p) => p + 1); + setIsLoading(false); + }); + + return () => { + valid = false; + }; + }, [page, insightIndex, insights]); + + const nextItem = React.useCallback(() => setInsightIndex((p) => p + 1), []); + + const insight = insights[insightIndex]; + + return { isLoading, insight, nextItem }; +} diff --git a/src/pages/nutrition/utils.ts b/src/pages/nutrition/utils.ts new file mode 100644 index 0000000000..f0b1949cd0 --- /dev/null +++ b/src/pages/nutrition/utils.ts @@ -0,0 +1,70 @@ +import axios from "axios"; +import { UNITS } from "./config"; +import { NutrimentPrediction } from "./insight.types"; +import { ROBOTOFF_API_URL } from "../../const"; + +export const NUTRI_TYPE = ["_100g", "_serving"]; + +export const NUTRIMENTS = { + "energy-kj": "energy (kj)", + "energy-kcal": "energy (kcal)", + fat: "fat", + "saturated-fat": "saturated fat", + carbohydrates: "carbohydrates", + sugars: "sugars", + fiber: "fiber", + proteins: "proteins", + salt: "salt", +}; + +export function isValidUnit(unit: string | null) { + return unit === null || UNITS.includes(unit); +} + +export function structurePredictions( + predictions: Record>, +) { + const nurimentsIds = Object.keys(NUTRIMENTS); + + Object.keys(predictions).forEach((key) => { + if (key === "serving_size") { + return; + } + const id = key.split("_")[0]; // split 'energy-kj_100g' to only get 'energy-kj' + + if (!nurimentsIds.includes(id)) { + nurimentsIds.push(id); + } + }); + + return nurimentsIds; +} + +interface PostRobotoffParams { + insightId: string; + data: Record; + type: "100g" | "serving"; +} +export function postRobotoff(config: PostRobotoffParams) { + const { insightId, data, type } = config; + + const filteredValues = {}; + + Object.keys(data).forEach((key) => { + if (key.includes(type) && data[key].value) { + filteredValues[key] = { + value: data[key].value, + unit: data[key].unit, + }; + } + }); + + axios.post( + `${ROBOTOFF_API_URL}/insights/annotate`, + { + insight_id: insightId, + data: { nutrient: filteredValues }, + }, + { withCredentials: true }, + ); +} diff --git a/src/robotoff.ts b/src/robotoff.ts index 08b5b0c84e..5501f5e2b2 100644 --- a/src/robotoff.ts +++ b/src/robotoff.ts @@ -1,5 +1,5 @@ import axios from "axios"; -import { ROBOTOFF_API_URL, IS_DEVELOPMENT_MODE, OFF_IMAGE_URL } from "./const"; +import { ROBOTOFF_API_URL, IS_DEVELOPMENT_MODE } from "./const"; import { getLang } from "./localeStorageManager"; import COUNTRIES from "./assets/countries.json"; import { reformatValueTag, removeEmptyKeys } from "./utils"; @@ -195,39 +195,6 @@ const robotoff = { ); }, - getNutritionValueFromImage(language, imageOcrUrl, images) { - const ocrUrlSubString = imageOcrUrl.split("/"); - - // setting a default value, assuming length of ocrUrlSubString is 7, - // and product code is 8 characters long - let productCodeForOcrUrl = ocrUrlSubString[5]; - - const nutritionKeyWithLangSuffix = `nutrition_${language}`; - - let imgid = ""; - for (const key in images) { - if (nutritionKeyWithLangSuffix === key) { - imgid = images[nutritionKeyWithLangSuffix].imgid; - } - } - - if (ocrUrlSubString.length > 7) { - // the productCode is 13 characters long - productCodeForOcrUrl = - ocrUrlSubString[5] + - "/" + - ocrUrlSubString[6] + - "/" + - ocrUrlSubString[7] + - "/" + - ocrUrlSubString[8]; - } - - return axios.get( - `${ROBOTOFF_API_URL}/predict/nutrient?ocr_url=${OFF_IMAGE_URL}}/${productCodeForOcrUrl}/${imgid}.json`, - ); - }, - getUnansweredValues(params: { type: "label" | "brand" | "category"; country;