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: 3919 - select languages for new product images #4255

Merged
merged 12 commits into from
Aug 24, 2023

Conversation

monsieurtanuki
Copy link
Contributor

What

  • In the "add new product" page, we now have the possibility to select the language of the uploaded picture.
  • We do that by reusing the same edit image screen as in existing products.

Screenshot

No changes actually here

new product found! new product edit page
Screenshot_2023-06-29-19-58-22 Screenshot_2023-06-29-19-58-38

Click on an "edit image" button

no picture so far picture selected for French
Screenshot_2023-06-29-19-58-30 Screenshot_2023-06-29-19-59-19

Same product, in Dutch

what about Dutch? picture uploaded for Dutch
Screenshot_2023-06-29-20-00-28 Screenshot_2023-06-29-20-01-46
picture in 2 languages picture considered uploaded
Screenshot_2023-06-29-20-01-50 Screenshot_2023-06-29-19-59-34

Fixes bug(s)

Files

New file:

  • add_new_product_helper.dart: Helper classes for AddNewProductPage that was getting too big.

Impacted files:

  • add_basic_details_page.dart: minor refactoring
  • add_new_product_page.dart: moved code to new file add_new_product_helper.dart; refactored the trackers with new class AnalyticsProductTracker; refactored the access to image edit
  • add_simple_input_button.dart: minor refactoring
  • crop_page.dart: minor refactoring
  • edit_new_packagings.dart: minor refactoring
  • edit_ocr_page.dart: minor refactoring
  • edit_product_page.dart: minor refactoring
  • image_crop_page.dart: minor refactoring
  • image_field_extension.dart: minor refactoring
  • nutrition_page_loaded.dart: minor refactoring
  • product_cards_helper.dart: minor refactoring
  • product_field_editor.dart: minor refactoring
  • product_image_carousel.dart: minor refactoring
  • product_image_carousel_item.dart: renamed from image_upload_card.dart
  • product_image_gallery_view.dart: minor refactoring
  • product_image_local_button.dart: minor refactoring
  • product_image_server_button.dart: minor refactoring
  • product_image_swipeable_view.dart: minor refactoring
  • product_image_viewer.dart: minor refactoring
  • product_refresher.dart: minor refactoring
  • uploaded_image_gallery.dart: minor refactoring

New file:
* `add_new_product_helper.dart`: Helper classes for `AddNewProductPage` that was getting too big.

Impacted files:
* `add_basic_details_page.dart`: minor refactoring
* `add_new_product_page.dart`: moved code to new file `add_new_product_helper.dart`; refactored the trackers with new class `AnalyticsProductTracker`; refactored the access to image edit
* `add_simple_input_button.dart`: minor refactoring
* `crop_page.dart`: minor refactoring
* `edit_new_packagings.dart`: minor refactoring
* `edit_ocr_page.dart`: minor refactoring
* `edit_product_page.dart`: minor refactoring
* `image_crop_page.dart`: minor refactoring
* `image_field_extension.dart`: minor refactoring
* `nutrition_page_loaded.dart`: minor refactoring
* `product_cards_helper.dart`: minor refactoring
* `product_field_editor.dart`: minor refactoring
* `product_image_carousel.dart`: minor refactoring
* `product_image_carousel_item.dart`: renamed from `image_upload_card.dart`
* `product_image_gallery_view.dart`: minor refactoring
* `product_image_local_button.dart`: minor refactoring
* `product_image_server_button.dart`: minor refactoring
* `product_image_swipeable_view.dart`: minor refactoring
* `product_image_viewer.dart`: minor refactoring
* `product_refresher.dart`: minor refactoring
* `uploaded_image_gallery.dart`: minor refactoring
@monsieurtanuki monsieurtanuki requested a review from a team as a code owner June 29, 2023 18:18
@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. ✏️ Editing - Nutrition input ✏️ Editing - Packaging input Related to the structured input of food packaging. 🖼️ Photos - Cropping ✏️ Editing - Basic info input labels Jun 29, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2023

Codecov Report

Merging #4255 (2ddb97f) into develop (b84cd3c) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #4255      +/-   ##
===========================================
- Coverage    10.31%   10.27%   -0.04%     
===========================================
  Files          296      297       +1     
  Lines        15431    15487      +56     
===========================================
  Hits          1591     1591              
- Misses       13840    13896      +56     
Files Changed Coverage Δ
.../cards/data_cards/product_image_carousel_item.dart 0.00% <0.00%> (ø)
...ib/cards/product_cards/product_image_carousel.dart 0.00% <0.00%> (ø)
.../smooth_app/lib/helpers/image_field_extension.dart 0.00% <ø> (ø)
...s/smooth_app/lib/helpers/product_cards_helper.dart 0.00% <ø> (ø)
packages/smooth_app/lib/pages/crop_page.dart 0.00% <0.00%> (ø)
...th_app/lib/pages/image/uploaded_image_gallery.dart 0.00% <0.00%> (ø)
packages/smooth_app/lib/pages/image_crop_page.dart 0.79% <ø> (ø)
..._app/lib/pages/product/add_basic_details_page.dart 0.00% <0.00%> (ø)
..._app/lib/pages/product/add_new_product_helper.dart 0.00% <0.00%> (ø)
...th_app/lib/pages/product/add_new_product_page.dart 0.00% <0.00%> (ø)
... and 12 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@teolemon
Copy link
Member

Does it mean the picker lets you multi select languages, and then prevent the thing from going green unless those 2 have 2 for each section ?

@monsieurtanuki
Copy link
Contributor Author

Does it mean the picker lets you multi select languages, and then prevent the thing from going green unless those 2 have 2 for each section ?

No, the button goes green when there's at least one picture for this field (for one language).
The green button screenshot could have been just after the French input too. And you can click on a green button to add picture for other languages.

@g123k
Copy link
Collaborator

g123k commented Jul 19, 2023

Before validating this PR,I would like #4315 to be merged, as not everyone can access the subfeature, so it's important to fix it first.

@teolemon
Copy link
Member

teolemon commented Aug 3, 2023

Hey @monsieurtanuki I merged a bit too hastily
error • The named parameter 'isLoggedInMandatory' is required, but there's no corresponding argument • packages/smooth_app/lib/pages/product/edit_product_page.dart:236:49 • missing_required_argument

Can you fix it so that I can install the Waldo build to test it ?

@monsieurtanuki
Copy link
Contributor Author

Can you fix it so that I can install the Waldo build to test it ?

Should be OK now.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

You can test this PR on: Android

@g123k
Copy link
Collaborator

g123k commented Aug 4, 2023

@teolemon Could you test the feature?
Because as I break the screen in many pages, it would be better to merge this one first

@teolemon
Copy link
Member

teolemon commented Aug 5, 2023

Screenshot_20230805-084926.png

@g123k
Copy link
Collaborator

g123k commented Aug 5, 2023

Argh, that's because #4438 was not merged

@monsieurtanuki
Copy link
Contributor Author

@teolemon @g123k I've just updated the branch, should be OK then.

@monsieurtanuki
Copy link
Contributor Author

@teolemon @g123k I've just updated the branch, should be OK then.

@g123k No way to refresh the waldo? Or is that refresh implicit?

@monsieurtanuki
Copy link
Contributor Author

@teolemon ping

@teolemon
Copy link
Member

thanks @monsieurtanuki , merging

@teolemon teolemon merged commit 75683db into openfoodfacts:develop Aug 24, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Editing - Basic info input ✏️ Editing - Nutrition input ✏️ Editing - Packaging input Related to the structured input of food packaging. 🖼️ Photos - Cropping Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. 🥫 Product page
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to pick photo language when uploading a new product
4 participants