-
-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add simple input for missing tags #2169
Comments
@teolemon Regarding autocompletion, we're a bit stuck because of openfoodfacts/openfoodfacts-dart#465 |
@monsieurtanuki We never noticed it, and did a query with every key stroke, after the nth first keystrokes |
Then you're lucky and I'm not. We're both using the same
|
aah @monsieurtanuki I believe we use local taxonomies in V1 for those, actually… |
We only use autosuggest for 2 specific fields (packager codes). Local taxonomies allow for local editing, but they are very heavy |
@teolemon What shall we do then? |
I would move ahead without waiting for a server fix, the server fix will only make it work better once it's ready. |
User can input whatever they wish actually. Suggestions are just for convenience, and we do server side parsing and taxonomization over time |
Ok then. |
New files: * `simple_input_page.dart`: Simple input page: we have a list of labels, we add, we remove, we save. * `simple_input_page_helpers.dart`: Helpers for Simple Input Page. Impacted files: * `category_picker_page.dart`: refactored * `edit_ingredients_page.dart`: refactored * `edit_product_page.dart`: added an "edit store" button; refactored * `nutrition_page_loaded.dart`: refactored * `product_query.dart`: added fields for stores * `product_refresher.dart`: now we return the saved and refreshed product instead of a mere bool
New files: * `simple_input_page.dart`: Simple input page: we have a list of labels, we add, we remove, we save. * `simple_input_page_helpers.dart`: Helpers for Simple Input Page. Impacted files: * `category_picker_page.dart`: refactored * `edit_ingredients_page.dart`: refactored * `edit_product_page.dart`: added an "edit store" button; refactored * `nutrition_page_loaded.dart`: refactored * `product_query.dart`: added fields for stores * `product_refresher.dart`: now we return the saved and refreshed product instead of a mere bool
Impacted files: * `app_en.arb`: added 5 translations * `app_fr.arb`: added 5 translations * `edit_product_page.dart`: added an action for "edit labels"; refactored * `simple_input_page.dart`: renamed "label" as "term" to avoid confusion; translated; refactored * `simple_input_page_helpers.dart`: implementation for "labels"; renamed "label" as "term"; translated * `smooth_alert_dialog.dart`: minor refactoring
Impacted files: * `app_en.arb`: added 5 translations * `app_fr.arb`: added 5 translations * `edit_product_page.dart`: added an action for "edit labels"; refactored * `simple_input_page.dart`: renamed "label" as "term" to avoid confusion; translated; refactored * `simple_input_page_helpers.dart`: implementation for "labels"; renamed "label" as "term"; translated * `smooth_alert_dialog.dart`: minor refactoring
Labels and Stores are merged. How about Categories ? |
Ok for categories. Working on it. |
Impacted files: * `app_en.arb`: added 2 translations (and fixed 1) * `app_fr.arb`: added 2 translations * `edit_product_page.dart`: added an item for "edit categories" * `Podfile.lock`: wtf * `simple_input_page_helpers.dart`: implementation for "categories"; refactored with an "in language" abstraction
Impacted files: * `app_en.arb`: added 2 translations (and fixed 1) * `app_fr.arb`: added 2 translations * `edit_product_page.dart`: added an item for "edit categories" * `Podfile.lock`: wtf * `simple_input_page_helpers.dart`: implementation for "categories"; refactored with an "in language" abstraction
@teolemon I can work on "Packaging", but the following fields do not exist in off-dart products AFAIK:
|
Packaging is the next logical target. |
Let's file the relevant issues against openfoodfacts-dart |
To be honest I'm a bit lost regarding "packaging", because of the discrepancies between TEST and PROD on PROD: {
"code": "5010477348630",
"product": {
"packaging": "Etui en carton,Sac en plastique à jeter,Sachet en plastique,Étui en carton à recycler",
"packaging_tags": ["fr:etui-en-carton", "fr:sac-en-plastique-a-jeter", "fr:sachet-en-plastique", "fr:etui-en-carton-a-recycler"]
},
"status": 1,
"status_verbose": "product found"
} TEST: {
"code": "5010477348630",
"product": {
"packaging": "fr:sac en plastique à jeter,fr:étui en carton à recycler,fr:Etui en carton,fr:Sachet en plastique",
"packaging_tags": ["fr-sac-en-plastique-a-jeter", "fr-etui-en-carton-a-recycler", "fr-etui-en-carton", "fr-sachet-en-plastique"]
},
"status": 1,
"status_verbose": "product found"
} |
We also have https://world.openfoodfacts.org/api/v2/product/5010477348630?fields=packaging_text_fr which behaves like the ingredients field (multilingual, OCR-compatible) And it's hairy "packaging":"Etui en carton,Sac en plastique à jeter,Sachet en plastique,Étui en carton à recycler","packaging_hierarchy":["fr:Etui en carton","fr:Sac en plastique à jeter","fr:Sachet en plastique","fr:Étui en carton à recycler"], "packaging_lc":"fr", "packaging_old":"fr:sac en plastique à jeter,fr:étui en carton à recycler,fr:Etui en carton,fr:Sachet en plastique", "packaging_tags":["fr:etui-en-carton","fr:sac-en-plastique-a-jeter","fr:sachet-en-plastique","fr:etui-en-carton-a-recycler"], "packaging_text":"", "packaging_text_fr":"", "packagings":[{"material":"en:cardboard","recycling":"en:recycle","shape":"en:sleeve"},{"material":"en:plastic","recycling":"en:discard","shape":"en:bag"}] |
@teolemon Is there any piece of code on the server that could help us understand how we are supposed to read and write packaging? |
Hi @monsieurtanuki , there's no good way to write packaging data currently (the existing packaging tag is deprecated), so I suggest that we wait until we do have a right way and a corresponding API to do it. There's more details about the current state here: https://wiki.openfoodfacts.org/Packagings_data_structure |
Impacted files: * `app_en.arb`: added emb codes and countries translations * `app_fr.arb`: added emb codes and countries translations * `edit_product_page.dart`: added emb codes and countries editors * `Podfile.lock`: wtf * `product_query.dart`: added emb codes and countries product fields * `product_refresher.dart`: now using language and country parameters for `saveProduct` * `pubspec.lock`: wtf * `pubspec.yaml`: upgraded versions of off-dart and sentry * `simple_input_page.dart`: added an optional explanation field * `simple_input_page_helpers.dart`: added emb codes and countries helpers; added an optional explanation field; refactored
* feat: #2169 - added emb codes and countries Impacted files: * `app_en.arb`: added emb codes and countries translations * `app_fr.arb`: added emb codes and countries translations * `edit_product_page.dart`: added emb codes and countries editors * `Podfile.lock`: wtf * `product_query.dart`: added emb codes and countries product fields * `product_refresher.dart`: now using language and country parameters for `saveProduct` * `pubspec.lock`: wtf * `pubspec.yaml`: upgraded versions of off-dart and sentry * `simple_input_page.dart`: added an optional explanation field * `simple_input_page_helpers.dart`: added emb codes and countries helpers; added an optional explanation field; refactored * Update packages/smooth_app/lib/l10n/app_en.arb Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com> * Update packages/smooth_app/lib/l10n/app_en.arb Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com> * Update packages/smooth_app/lib/l10n/app_en.arb Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com> * Update packages/smooth_app/lib/l10n/app_en.arb Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com> Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
@monsieurtanuki we can clone the ingredients extraction system, the current packaging system on the web works exactly the same way |
Why
What
Screenshots from V1
The text was updated successfully, but these errors were encountered: