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

Ingredients and Stores cannot be presented in a list #5887

Open
AdrienMDevMobile opened this issue Nov 20, 2024 · 8 comments
Open

Ingredients and Stores cannot be presented in a list #5887

AdrienMDevMobile opened this issue Nov 20, 2024 · 8 comments

Comments

@AdrienMDevMobile
Copy link

This issue is blocking #5814
Ideally, to present values in a list of elements, the values need to be given to the app in a list.

That is not the case for Ingredients and stores.The list values IngredientsTagsInLanguage and storeTagsInLanguage are null.
The list of ingredients and stores are found in a single String
This can be found in the nutella page, but also this butter and this juice : https://world.openfoodfacts.org/product/3451790988677/le-beurre-tendre-doux-elle-vire
https://world.openfoodfacts.org/product/3254691586054/le-bio-pour-toute-la-famille-multifruit-pressade

Here are two solutions : correct the serverside answer to give the elements in a listvalue in the request.
or : adapt the code of the rawdata list to have the Strings be broken down into a list.

Solution 2 is the easiest to do, but will create technical dept.

@g123k
Copy link
Collaborator

g123k commented Nov 25, 2024

For the stores, you can have a look at what's done on the Edit page.
SimpleInputPageStoreHelper.dart:

splitString(product.stores);

And for the ingredients, you can do the same.
Clearly, a server-side fix would be better.
But it seems that the code for stores is here for months.

@alexgarel
Copy link
Member

@teolemon the right request for ingredient, eg for french, is: https://world.openfoodfacts.org/api/v1/product/3451790988677.json?fields=ingredients_tags_fr

@alexgarel
Copy link
Member

@AdrienMDevMobile
Copy link
Author

@teolemon the right request for ingredient, eg for french, is: https://world.openfoodfacts.org/api/v1/product/3451790988677.json?fields=ingredients_tags_fr

I am currently using ingredientsTextInLanguages, other field 'ingredient' is null Ingredients tag fr is not present in the Product class

@AdrienMDevMobile
Copy link
Author

For stores, I am currently using stores. I have an issue with StoresInLanguage ; the english value is currently null (despite stores field beeing filled with english stores data)

@AdrienMDevMobile
Copy link
Author

The product class contains nutrition values but not their metrics (kJ, kcal...)
I wasn't able to find it in the code, but I assume when clicking the nutrition on the product screen it does a web call.

Shoudl I do this web call on my view ? or the product class should contain the metrics ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 💬 To discuss and validate
Development

No branches or pull requests

4 participants