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

Extend the knowledge panel API to add actions elements (e.g. add ingredients) #6902

Closed
stephanegigandet opened this issue Jun 14, 2022 · 2 comments · Fixed by #6903
Closed
Assignees
Labels
📖 Knowledge panels - Actions 📖 Knowledge Panels - https://wiki.openfoodfacts.org/Knowledge_panels ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.

Comments

@stephanegigandet
Copy link
Contributor

stephanegigandet commented Jun 14, 2022

Almost all knowledge panels rely on some specific information about the product being available, and if the data is not available, we either do not display a panel, or display a message that we are missing data.

We can add in the knowledge panel structure a list of actions that the user can take. e.g. for the Nutri-Score panel, if we can't compute the Nutri-Score because we are missing the product category, or some nutrition facts, we can display a button to add the missing information.

@stephanegigandet stephanegigandet self-assigned this Jun 14, 2022
@stephanegigandet stephanegigandet added the 📖 Knowledge Panels - https://wiki.openfoodfacts.org/Knowledge_panels label Jun 14, 2022
@stephanegigandet stephanegigandet moved this from 📋 Shortlist (max 20) to 🏗 In progress in Product Opener - Sprint Jun 14, 2022
@stephanegigandet
Copy link
Contributor Author

stephanegigandet commented Jun 14, 2022

Some panels already have data to edit some fields, but it may not be used yet:

e.g. ingredients panel:

"elements": [
    {
        "element_type": "text",
        "text_element": {
            "html": `[% panel.ingredients_text_with_allergens %]`,
            "lc": "[% panel.ingredients_text_lc %]",
            "language": "[% panel.ingredients_text_language %]",
            "edit_field_type": "ingredients_text",
            "edit_field_id": "ingredients_text_[% panel.ingredients_text_lc %]",
            "edit_field_value": `[% panel.ingredients_text %]`,
        },
    },

stephanegigandet added a commit that referenced this issue Jun 20, 2022
* feat: add actions to panels #6902

* Update templates/web/panels/panel.tt.html

Co-authored-by: Alex Garel <alex@garel.org>

* suggestions from code review

Co-authored-by: Alex Garel <alex@garel.org>
@stephanegigandet stephanegigandet moved this from 🏗 In progress to ✅ Done in Product Opener - Sprint Jul 4, 2022
@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Sep 13, 2022
@teolemon teolemon linked a pull request Oct 23, 2022 that will close this issue
@teolemon teolemon closed this as completed Dec 8, 2022
Repository owner moved this from To do to Done in 📖 Knowledge panels Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 Knowledge panels - Actions 📖 Knowledge Panels - https://wiki.openfoodfacts.org/Knowledge_panels ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants