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

feat: nutripatrol product report #10991

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

alexgarel
Copy link
Member

First Nutri-Patrol integration.

image

@alexgarel alexgarel requested a review from a team as a code owner November 7, 2024 14:11
@github-actions github-actions bot added 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. Products 🌐 Translations labels Nov 7, 2024
@alexgarel alexgarel changed the title Feat nutripatrol product report feat: nutripatrol product report Nov 7, 2024
@alexgarel
Copy link
Member Author

/update_tests_results

@github-actions github-actions bot added API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🧪 tests 🧪 integration tests labels Nov 7, 2024
@alexgarel
Copy link
Member Author

/update_tests_results

]
"json" : "{\n \"level\": \"info\",\n \"topics\": [\n \"problem\"\n ],\n \"expand_for\": \"large\",\n \"evaluation\": \"neutral\",\n \"title_element\": {\n \"title\": \"Incomplete or incorrect information?\",\n \"subtitle\": \"Category, labels, ingredients, allergens, nutritional information, photos etc.\",\n \"icon_url\": \"http://static.openfoodfacts.localhost/images/logos/off-logo-icon-light.svg\"},\n \"elements\": [\n {\n \"element_type\": \"text\",\n \"text_element\": {\n \"html\": `\n If the information does not match the information on the packaging, you can complete or correct it. Thank you!\n Open Food Facts is a collaborative database, and every contribution is useful for all.\n }},\n {\n \"element_type\": \"action\",\n \"action_element\": {\n \"html\": \"\",\n \"actions\": [\"edit_product\"]\n }\n }]\n}",
"json_debug_url" : "http://static.openfoodfacts.localhost/files/debug/knowledge_panels/incomplete_or_incorrect_data0200000000034.json",
"json_error" : "malformed JSON string, neither tag, array, object, number, string or atom, at character offset 519 (before \"`\\n I...\") at /opt/product-opener/lib/ProductOpener/KnowledgePanels.pm line 411.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a typo in the template, fixing it.

@stephanegigandet
Copy link
Contributor

/update_tests_results

if (defined $actions_urls{$action}) {
$url .= $actions_urls{$action};
my $action_url = $actions_urls{$action};
if ($action_url =~ /^#/) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The "edit_product" action has an empty url "" because before we always started with the edit form URL. So we need a change like this:

Suggested change
if ($action_url =~ /^#/) {
if (($action eq '') or (($action_url =~ /^#/)) {

Copy link

sonarcloud bot commented Nov 8, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🧪 integration tests 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels 👮 Moderation Products Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. 🧪 tests 🌐 Translations
Projects
Status: In progress
Status: In progress
Status: Backlog
Development

Successfully merging this pull request may close these issues.

3 participants