Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 5643 - edit of products of any product type #5661

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • The aim of this PR is to take into account the product type for edit operations. It implies updating data on the related server.
  • As the product type is mandatory, for new found products we now ask first which product type it is. And that's it.
  • For "old" products, we of course consider they are food. When refreshed from a server, they will deduce the product type from the server that hosts them.
  • Et voilà: https://fr.openbeautyfacts.org/produit/3350033596092/dentifrices-fracheur-la-menthe-poivree-monoprix
  • What is missing is fine-tuning the edit features for each product type (e.g. no nutrition for "products"). The current PR being big enough, other features will be coded in next PRs.

Screenshots

hey, new product! select product type
Screenshot_1727880481 Screenshot_1727880489
mandatory product type cannot change product type
Screenshot_1727880496 Screenshot_1727880513
photos categories
Screenshot_1727881183 Screenshot_1727881226
ingredients basic details
Screenshot_1727881270 Screenshot_1727881339

Part of

Impacted files

  • add_basic_details_page.dart: added product type
  • add_new_product_page.dart: added a "set product type page" for new products; added product type; minor refactoring
  • add_other_details_page.dart: added product type
  • app_en.arb: added 1 label per product type, and 4 labels for product type input
  • background_task_barcode.dart: added product type
  • background_task_crop.dart: added product type
  • background_task_details.dart: added product type
  • background_task_hunger_games.dart: added product type
  • background_task_image.dart: added product type
  • background_task_refresh_later.dart: added product type
  • background_task_unselect.dart: added product type
  • background_task_upload.dart: added product type
  • edit_new_packagings.dart: added product type
  • edit_ocr_page.dart: added product type
  • image_crop_page.dart: added product type
  • nutrition_page_loaded.dart: added product type
  • product_crop_helper.dart: added product type
  • product_dialog_helper.dart: removed irrelevant nutriscore and ecoscore logos for new found products, as we cannot say already if it's food
  • product_image_button.dart: added product type
  • product_image_carousel_item.dart: added product type
  • product_image_crop_button.dart: added product type
  • product_image_gallery_view.dart: added product type
  • product_image_local_button.dart: added product type
  • product_image_unselect_button.dart: added product type
  • product_image_viewer.dart: added product type
  • product_query.dart: localized labels for product type
  • simple_input_page.dart: added product type
  • simple_input_page_helpers.dart: added product type
  • up_to_date_changes.dart: added product type
  • uploaded_image_gallery.dart: added product type

Impacted files:
* `add_basic_details_page.dart`: added product type
* `add_new_product_page.dart`: added a "set product type page" for new products; added product type; minor refactoring
* `add_other_details_page.dart`: added product type
* `app_en.arb`: added 1 label per product type, and 4 labels for product type input
* `background_task_barcode.dart`: added product type
* `background_task_crop.dart`: added product type
* `background_task_details.dart`: added product type
* `background_task_hunger_games.dart`: added product type
* `background_task_image.dart`: added product type
* `background_task_refresh_later.dart`: added product type
* `background_task_unselect.dart`: added product type
* `background_task_upload.dart`: added product type
* `edit_new_packagings.dart`: added product type
* `edit_ocr_page.dart`: added product type
* `image_crop_page.dart`: added product type
* `nutrition_page_loaded.dart`: added product type
* `product_crop_helper.dart`: added product type
* `product_dialog_helper.dart`: removed irrelevant nutriscore and ecoscore logos for new found products, as we cannot say already if it's food
* `product_image_button.dart`: added product type
* `product_image_carousel_item.dart`: added product type
* `product_image_crop_button.dart`: added product type
* `product_image_gallery_view.dart`: added product type
* `product_image_local_button.dart`: added product type
* `product_image_unselect_button.dart`: added product type
* `product_image_viewer.dart`: added product type
* `product_query.dart`: localized labels for product type
* `simple_input_page.dart`: added product type
* `simple_input_page_helpers.dart`: added product type
* `up_to_date_changes.dart`: added product type
* `uploaded_image_gallery.dart`: added product type
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 95 lines in your changes missing coverage. Please review.

Project coverage is 6.85%. Comparing base (4d9c7fc) to head (83b09ab).
Report is 340 commits behind head on develop.

Files with missing lines Patch % Lines
...th_app/lib/pages/product/add_new_product_page.dart 0.00% 60 Missing ⚠️
...th_app/lib/background/background_task_barcode.dart 0.00% 5 Missing ⚠️
packages/smooth_app/lib/query/product_query.dart 0.00% 5 Missing ⚠️
...smooth_app/lib/data_models/up_to_date_changes.dart 0.00% 2 Missing ⚠️
...oth_app/lib/pages/product/edit_new_packagings.dart 0.00% 2 Missing ⚠️
..._app/lib/pages/product/edit_ocr/edit_ocr_page.dart 0.00% 2 Missing ⚠️
...ages/smooth_app/lib/pages/product_crop_helper.dart 0.00% 2 Missing ⚠️
...mooth_app/lib/background/background_task_crop.dart 0.00% 1 Missing ⚠️
...ooth_app/lib/background/background_task_image.dart 0.00% 1 Missing ⚠️
.../lib/background/background_task_refresh_later.dart 0.00% 1 Missing ⚠️
... and 14 more
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5661      +/-   ##
==========================================
- Coverage     9.54%   6.85%   -2.70%     
==========================================
  Files          325     402      +77     
  Lines        16411   21379    +4968     
==========================================
- Hits          1567    1466     -101     
- Misses       14844   19913    +5069     

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

@teolemon teolemon added 🧴 Open Beauty Facts Please see this proposal: https://github.com/openfoodfacts/smooth-app/discussions/1378 📸 Open Products Facts 🐾 Open Pet Food Facts OxF labels Oct 2, 2024
@teolemon teolemon requested a review from a team October 2, 2024 15:40
Copy link
Member

@teolemon teolemon left a comment

Choose a reason for hiding this comment

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

👏 👏 👏
🍾 🧴 🐱 📸
really cool.

@monsieurtanuki monsieurtanuki merged commit 899cb0f into openfoodfacts:develop Oct 2, 2024
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your quick review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants