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 - removed irrelevant editors for non-FOOD products #5663

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

monsieurtanuki
Copy link
Contributor

What

  • now the main image fields depend on product type (e.g. no nutrition and ingredients for PRODUCTS)
  • no ingredient editor for PRODUCTS in the edit product page
  • one single editor page for new found products that are not FOOD

Screenshots

PRODUCTS (no ingredients, no nutrition) BEAUTY (no nutrition)
Screenshot_1727971782 Screenshot_1727972267
Screenshot_1727971771 Screenshot_1727972249
Screenshot_1727978217 Screenshot_1727974797
Screenshot_1727978222 Screenshot_1727975824

Part of

Impacted files

  • add_new_product_page.dart: editors different when not FOOD; minor refactoring
  • edit_product_page.dart: no ingredient editor for PRODUCTS
  • image_field_extension.dart: now the main image fields depend on product type; minor refactoring (more compact switch syntax)
  • knowledge_panels_builder.dart: minor fix
  • product_cards_helper.dart: now the main image fields depend on product type
  • product_image_gallery_view.dart: now the main image fields depend on product type
  • product_image_swipeable_view.dart: now the main image fields depend on product type

Impacted files:
* `add_new_product_page.dart`: editors different when not FOOD; minor refactoring
* `edit_product_page.dart`: no ingredient editor for PRODUCTS
* `image_field_extension.dart`: now the main image fields depend on product type; minor refactoring (more compact `switch` syntax)
* `knowledge_panels_builder.dart`: minor fix
* `product_cards_helper.dart`: now the main image fields depend on product type
* `product_image_gallery_view.dart`: now the main image fields depend on product type
* `product_image_swipeable_view.dart`: now the main image fields depend on product type
@github-actions github-actions bot added 🥫 Product page Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. labels Oct 3, 2024
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.

The screenshot actually illustrate the corner cases

@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 6.85%. Comparing base (4d9c7fc) to head (2becf35).
Report is 342 commits behind head on develop.

Files with missing lines Patch % Lines
...th_app/lib/pages/product/add_new_product_page.dart 0.00% 43 Missing ⚠️
.../smooth_app/lib/helpers/image_field_extension.dart 0.00% 30 Missing ⚠️
...mooth_app/lib/pages/product/edit_product_page.dart 0.00% 5 Missing ⚠️
.../lib/knowledge_panel/knowledge_panels_builder.dart 0.00% 4 Missing ⚠️
.../lib/pages/product/product_image_gallery_view.dart 0.00% 4 Missing ⚠️
...s/smooth_app/lib/helpers/product_cards_helper.dart 0.00% 2 Missing ⚠️
...ib/pages/product/product_image_swipeable_view.dart 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5663      +/-   ##
==========================================
- Coverage     9.54%   6.85%   -2.70%     
==========================================
  Files          325     402      +77     
  Lines        16411   21395    +4984     
==========================================
- Hits          1567    1466     -101     
- Misses       14844   19929    +5085     

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

@monsieurtanuki
Copy link
Contributor Author

The screenshot actually illustrate the corner cases

@teolemon Not sure I understand what you mean.

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.

  • Detergents are one of the few OPF categories where there can be ingredients
  • toothpaste is one of the few cosmetics categories where there can be what is similar to a nutrient, that is to say the parts per 1000 of fluoride

@monsieurtanuki
Copy link
Contributor Author

@teolemon How does it work with the legacy apps?

@teolemon
Copy link
Member

teolemon commented Oct 4, 2024

We were more liberal and kept ingredients for OPF.

@monsieurtanuki monsieurtanuki merged commit 3c12fe0 into openfoodfacts:develop Oct 4, 2024
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review!

I guess we'll have to fine-tune the concept of "other products".
There are classes of products that have expected/mandatory features, like diagonal size for smartphones or fluoride for toothpaste. How could we nudge users into entering expected (folksonomy) values (I mean, related to expected keys)?

@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your review!

I guess we'll have to fine-tune the concept of "other products". There are classes of products that have expected/mandatory features, like diagonal size for smartphones or fluoride for toothpaste. How could we nudge users into entering expected (folksonomy) values (I mean, related to expected keys)?

From the category I guess: somehow maintaining a list of expected features for a given product category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. 🥫 Product page
Development

Successfully merging this pull request may close these issues.

3 participants