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

fix: Support for photos in a different language than the default one (green buttons) #5278

Merged
merged 2 commits into from
May 24, 2024

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented May 24, 2024

Hi everyone,

In the "Fast-track" screen, if the photo is uploaded in a different language than the default one, the button stays gray.
The fix here is to check if at least one photo is pending for the given field.

@g123k g123k added the Product addition The easier it is to add a product and get Nutri-Score, Eco-Score, the happier the users. label May 24, 2024
@g123k g123k self-assigned this May 24, 2024
@g123k g123k requested a review from a team as a code owner May 24, 2024 03:09
@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 8.19%. Comparing base (4d9c7fc) to head (a839715).
Report is 128 commits behind head on develop.

Files Patch % Lines
..._app/lib/pages/product/add_new_product_helper.dart 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5278      +/-   ##
==========================================
- Coverage     9.54%   8.19%   -1.36%     
==========================================
  Files          325     356      +31     
  Lines        16411   17920    +1509     
==========================================
- Hits          1567    1468      -99     
- Misses       14844   16452    +1608     

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

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

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

Hi @g123k!
Your fix is surely an improvement, as it checks not only the current language, but all languages.

I'm afraid it's not 100% good, as the previous version (and yours) only check "transient files" (which are pictures that have not been received by the server yet).
If an image is received by the server, the local product is refreshed (with the new image) and the transient file is removed.
I would suggest using getProductImageLanguages instead.

@teolemon teolemon merged commit ffe90e7 into openfoodfacts:develop May 24, 2024
6 checks passed
@g123k
Copy link
Collaborator Author

g123k commented May 24, 2024

Hi @g123k! Your fix is surely an improvement, as it checks not only the current language, but all languages.

I'm afraid it's not 100% good, as the previous version (and yours) only check "transient files" (which are pictures that have not been received by the server yet). If an image is received by the server, the local product is refreshed (with the new image) and the transient file is removed. I would suggest using getProductImageLanguages instead.

Thanks for your suggestion, I've checked in the 2 cases and it should be OK now

@g123k
Copy link
Collaborator Author

g123k commented May 24, 2024

Hi @g123k! Your fix is surely an improvement, as it checks not only the current language, but all languages.
I'm afraid it's not 100% good, as the previous version (and yours) only check "transient files" (which are pictures that have not been received by the server yet). If an image is received by the server, the local product is refreshed (with the new image) and the transient file is removed. I would suggest using getProductImageLanguages instead.

Thanks for your suggestion, I've checked in the 2 cases and it should be OK now

Oops, there is a merge just after my commit.
Was it the fix you were expecting @monsieurtanuki?

@g123k g123k deleted the fasttrack_image_checker branch May 27, 2024 14:55
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.

[Fast-track] Adding a photo with another language is not recognized as "added"
4 participants