Closed teolemon closed 2 years ago
Related user report:
@monsieurtanuki the API should be available on the .net server This extends the knowledge panels API to add a new "action" element that contains a list of actions such as "add_categories", "add_ingredients_text", "add_nutrition_facts". Clients can then add buttons or links to directly add or edit the corresponding data.
e.g. ingredients panel when we don't have ingredients:
ingredients: {
elements: [
{
action_element: {
actions: [
"add_ingredients_text"
],
html: "Could you add the ingredients list?"
},
element_type: "action"
}
],
evaluation: "unknown",
expand_for: "large",
expanded: false,
level: "info",
title_element: {
icon_color_from_evaluation: true,
icon_url: "http://static.openfoodfacts.localhost/images/icons/dist/ingredients.svg",
title: "Les ingrédients sont manquants"
},
topics: [
"health"
]
},
Nutri-Score panel when we are missing the category + nutrition facts:
nutriscore: {
elements: [
{
element_type: "text",
text_element: {
html: "La catégorie du produit doit être spécifiée afin de calculer le Nutri-Score.
",
type: "warning"
}
},
{
element_type: "text",
text_element: {
html: "Les données nutritionnelles du produit doivent être spécifiées afin de calculer le Nutri-Score.
",
type: "warning"
}
},
{
action_element: {
actions: [
"add_categories",
"add_nutrition_facts"
],
html: "Could you add the information needed to compute the Nutri-Score?"
},
element_type: "action"
},
@monsieurtanuki would you be interested by implementing the Smoothie side ?
From off-dart 1.20.0 we have the new 'action_element' (#495)
What
Mockup
Why
How
The API should be available on the .net and .org server
e.g. ingredients panel when we don't have ingredients:
Nutri-Score panel when we are missing the category + nutrition facts: