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

Add support for new Knowledge panel actions and ensure new actions do not crash the app in the future #3418

Closed
teolemon opened this issue Dec 8, 2022 · 9 comments · Fixed by #3510

Comments

@teolemon
Copy link
Member

teolemon commented Dec 8, 2022

Problem

  • We added some more actions server side (live in production): https://github.com/openfoodfacts/openfoodfacts-server/pull/7304/files
    • action_add_origins
    • action_add_packaging_image
    • action_add_ingredients_image
  • It seems they are not supported yet by the app, although the API was meant to be evolutive (eg: it provides the button name, and the editing view can be inferred from the action)
  • Add support for those new Knowledge panel actions in a way that ensures new actions do not crash the app in the future, and are supported automatically

Future provisions

  • action_add_basic_details
  • action_add_portion_size
  • action_add_nutrition_image
  • action_refresh_ingredients_image
  • action_refresh_nutrition_image
  • action_add_packaging_text
  • action_add_stores
  • action_labels
  • action_countries
  • action_packager_codes_image

Code pointers

@teolemon
Copy link
Member Author

teolemon commented Dec 9, 2022

After a longer investigation, the crash is unrelated, but the new buttons do not seem supported out of the box

@teolemon teolemon removed the 🐛 bug Something isn't working label Dec 9, 2022
@monsieurtanuki monsieurtanuki self-assigned this Dec 10, 2022
@teolemon
Copy link
Member Author

Some of the future provisions don't have very good names for the moment. We will ensure consistency when we actually implement them server side

@monsieurtanuki
Copy link
Contributor

@teolemon I'm implementing 'action_add_origins', 'action_add_packaging_image' and 'action_add_ingredients_image'.
Are you sure about the 'action_' prefix? For the moment we support 'add_categories', 'add_ingredients_text' and 'add_nutrition_facts', and none of them has that prefix, and neither does some of the server code you're referring to.

@teolemon
Copy link
Member Author

@teolemon
Copy link
Member Author

this one is for category addition

@monsieurtanuki
Copy link
Contributor

monsieurtanuki commented Dec 10, 2022

@monsieurtanuki monsieurtanuki removed their assignment Dec 10, 2022
@teolemon
Copy link
Member Author

image
image

@teolemon
Copy link
Member Author

teolemon commented Jan 3, 2023

@M123-dev @monsieurtanuki The screenshots above show the current behaviour. Are we sending the proper thing from the server (it seems so from the example below) ?
https://world.openfoodfacts.org/api/v2/product/8006922084410.json?fields=knowledge_panels
I would expect the app to behave like for add categories

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

Successfully merging a pull request may close this issue.

2 participants