From 19c70ed02e3dfad14fdcad9091a92f487b9fc298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 25 Oct 2024 14:21:42 +0200 Subject: [PATCH] fix: better display of Eco-Score details (#10934) Small fixes: - correctly display the details of the origins of ingredients adjustment when origins and/or country of request is unknown / world. - remove extra comma causing an extra bar in the Eco-Score distribution graph - display a score of 0 when the score is negative --- lib/ProductOpener/Display.pm | 3 +-- lib/ProductOpener/Ecoscore.pm | 14 ++++++++++++-- lib/ProductOpener/KnowledgePanels.pm | 3 +++ .../environment/ecoscore/total.tt.json | 1 - .../api_v2_product_read/get-existing-product.json | 2 +- .../get-fields-all-knowledge-panels.json | 4 ++-- .../api_v2_product_read/get-fields-all.json | 2 +- ...elds-attribute-groups-all-knowledge-panels.json | 4 ++-- ...card-knowledge_panels_excluded-health_card.json | 2 +- ...nels_included-health_card-environment_card.json | 2 +- .../get-knowledge-panels-fr.json | 2 +- .../api_v2_product_read/get-knowledge-panels.json | 2 +- .../get-product-auth-good-password.json | 2 +- ...-product-ingredients-text-without-language.json | 2 +- .../api_v2_product_write/get-product.json | 2 +- .../get-existing-product-gs1-ai-data-str.json | 2 +- .../get-existing-product-gs1-caret.json | 2 +- .../get-existing-product-gs1-data-uri.json | 2 +- .../get-existing-product-gs1-fnc1.json | 2 +- .../get-existing-product-gs1-gs.json | 2 +- .../api_v3_product_read/get-existing-product.json | 2 +- .../get-fields-all-knowledge-panels.json | 4 ++-- .../api_v3_product_read/get-fields-all.json | 2 +- ...elds-attribute-groups-all-knowledge-panels.json | 4 ++-- ...card-knowledge_panels_excluded-health_card.json | 2 +- ...nels_included-health_card-environment_card.json | 2 +- .../get-knowledge-panels-fr.json | 2 +- .../api_v3_product_read/get-knowledge-panels.json | 2 +- .../patch-request-fields-all.json | 2 +- .../patch-request-fields-ecoscore-data.json | 2 +- .../export_more_fields/export_more_fields.csv | 2 +- .../export_more_fields/rows/04083637.json | 2 +- .../page_crawler/crawler-access-product-page.html | 1 - .../normal-user-access-product-page.html | 1 - .../product_read/get-existing-product.html | 1 - ...-edited-protected-product-api-v2-moderator.json | 2 +- .../get-edited-protected-product-api-v2.json | 2 +- ...dited-protected-product-web-form-moderator.json | 2 +- .../get-edited-protected-product-web-form.json | 2 +- .../get-edited-unprotected-product-api-v2.json | 2 +- .../get-edited-unprotected-product-web-form.json | 2 +- .../search_v1/search-no-filter.json | 12 ++++++------ .../web_html/fr-product-2.html | 1 - .../expected_test_results/web_html/fr-product.html | 1 - .../web_html/world-product.html | 1 - 45 files changed, 60 insertions(+), 55 deletions(-) diff --git a/lib/ProductOpener/Display.pm b/lib/ProductOpener/Display.pm index 2f5b9f774d66e..a2e9b65754ddf 100644 --- a/lib/ProductOpener/Display.pm +++ b/lib/ProductOpener/Display.pm @@ -2462,8 +2462,7 @@ HTML } } elsif ($request_ref->{groupby_tagtype} eq 'ecoscore') { - $categories - = "'A+','A','B','C','D','E',,'F','" . lang("not_applicable") . "','" . lang("unknown") . "'"; + $categories = "'A+','A','B','C','D','E','F','" . lang("not_applicable") . "','" . lang("unknown") . "'"; $colors = "'#1E8F4E','#1E8F4E','#60AC0E','#EEAE0E','#FF6F1E','#DF1F1F','#DF1F1F','#a0a0a0','#a0a0a0'"; $series_data = ''; foreach my $ecoscore_grade ('a-plus', 'a', 'b', 'c', 'd', 'e', 'f', 'not-applicable', 'unknown') { diff --git a/lib/ProductOpener/Ecoscore.pm b/lib/ProductOpener/Ecoscore.pm index 7a59fdf853273..fa8950ddb657f 100644 --- a/lib/ProductOpener/Ecoscore.pm +++ b/lib/ProductOpener/Ecoscore.pm @@ -214,6 +214,8 @@ sub load_ecoscore_data_origins_of_ingredients_distances() { # Score 0 for unknown origin $ecoscore_data{origins}{"en:unknown"}{"transportation_score_" . $countries[$i]} = 0; } + # Score 0 for unspecified request country (world) + $ecoscore_data{origins}{"en:unknown"}{"transportation_score_world"} = 0; my @ecoscore_countries_sorted = sort keys %ecoscore_countries; %ecoscore_countries_enabled = %ecoscore_countries; @@ -257,6 +259,8 @@ sub load_ecoscore_data_origins_of_ingredients_distances() { } $ecoscore_data{origins}{$origin_id}{"transportation_score_" . $countries[$i]} = $value; } + # Score 0 for unspecified request country (world) + $ecoscore_data{origins}{$origin_id}{"transportation_score_world"} = 0; $log->debug("ecoscore origins CSV file - row", {origin => $origin, origin_id => $origin_id, ecoscore_data => $ecoscore_data{origins}{$origin_id}}) @@ -1754,7 +1758,7 @@ The adjustment value and computations details are stored in the product referenc =cut -sub localize_ecoscore ($cc, $product_ref) { +sub localize_ecoscore ($request_cc, $product_ref) { # Localize the Eco-Score fields that depends on the country of the request @@ -1762,6 +1766,13 @@ sub localize_ecoscore ($cc, $product_ref) { # Localize the final score + # If we have specific Eco-Score and origins of ingredients adjustment for the country, use it, + # otherwise use the world values + my $cc = $request_cc; + if (not defined $product_ref->{ecoscore_data}{"scores"}{$cc}) { + $cc = "world"; + } + if (defined $product_ref->{ecoscore_data}{"scores"}{$cc}) { $product_ref->{ecoscore_data}{"score"} = $product_ref->{ecoscore_data}{"scores"}{$cc}; $product_ref->{ecoscore_data}{"grade"} = $product_ref->{ecoscore_data}{"grades"}{$cc}; @@ -1770,7 +1781,6 @@ sub localize_ecoscore ($cc, $product_ref) { $product_ref->{"ecoscore_grade"} = $product_ref->{ecoscore_data}{"grade"}; $product_ref->{"ecoscore_tags"} = [$product_ref->{ecoscore_grade}]; } - # Localize the origins of ingredients data if (defined $product_ref->{ecoscore_data}{adjustments}{origins_of_ingredients}) { diff --git a/lib/ProductOpener/KnowledgePanels.pm b/lib/ProductOpener/KnowledgePanels.pm index 8539f46ac1521..0ff6811561322 100644 --- a/lib/ProductOpener/KnowledgePanels.pm +++ b/lib/ProductOpener/KnowledgePanels.pm @@ -623,6 +623,9 @@ sub create_ecoscore_panel ($product_ref, $target_lc, $target_cc, $options_ref, $ if ($score > 100) { $score = 100; } + if ($score < 0) { + $score = 0; + } # We can reuse some strings from the Eco-Score attribute my $title = sprintf(lang_in_other_lc($target_lc, "attribute_ecoscore_grade_title"), uc($grade)) . ' - ' diff --git a/templates/api/knowledge-panels/environment/ecoscore/total.tt.json b/templates/api/knowledge-panels/environment/ecoscore/total.tt.json index 824a0a103a521..e1c3de660e4c1 100644 --- a/templates/api/knowledge-panels/environment/ecoscore/total.tt.json +++ b/templates/api/knowledge-panels/environment/ecoscore/total.tt.json @@ -26,7 +26,6 @@ [% IF sum_of_bonuses_and_maluses > 0 %]+[% END %][% sum_of_bonuses_and_maluses %] [% END %]

[% lang('ecoscore_final_score') %][% sep %]: [% panel.score %]/100 - [% IF product.ecoscore_data.downgraded AND (panel.score == 79) %] ([% lang('ecoscore_downgraded_non_recyclable_and_non_biodegradable_materials') %])[% END %] ` } } diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json b/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json index b86bcbb81862f..183fd8fd9e9c9 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-existing-product.json @@ -115,7 +115,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json index 08d020e9bc959..973d3a680cd91 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all-knowledge-panels.json @@ -115,7 +115,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, @@ -1199,7 +1199,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n \n ", + "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json index 37bd1bd5ec107..21fd7ebb6738c 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-all.json @@ -115,7 +115,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json index f2454312ab440..0eb50d5cf266a 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-attribute-groups-all-knowledge-panels.json @@ -771,7 +771,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, @@ -1855,7 +1855,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n \n ", + "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json index 708b708b2d5de..2cda8f2fc6015 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json @@ -493,7 +493,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n \n ", + "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json b/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json index 35752e10e9821..93fc598af43ac 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json @@ -493,7 +493,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n \n ", + "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels-fr.json b/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels-fr.json index 91a48114dc672..a0bedbf0bdf33 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels-fr.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels-fr.json @@ -493,7 +493,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Score d'analyse du cycle de vie : 70
\n Somme des bonus et malus :\n \n -23\n

\n Score final : 47/100\n \n ", + "html" : "\n Score d'analyse du cycle de vie : 70
\n Somme des bonus et malus :\n \n -23\n

\n Score final : 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels.json b/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels.json index 631730c89fe5c..d459e5fc008ab 100644 --- a/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v2_product_read/get-knowledge-panels.json @@ -493,7 +493,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n \n ", + "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v2_product_write/get-product-auth-good-password.json b/tests/integration/expected_test_results/api_v2_product_write/get-product-auth-good-password.json index d4f2c6c809820..e9844b97ee490 100644 --- a/tests/integration/expected_test_results/api_v2_product_write/get-product-auth-good-password.json +++ b/tests/integration/expected_test_results/api_v2_product_write/get-product-auth-good-password.json @@ -114,7 +114,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json b/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json index d45b747fd6702..16bc76ca72984 100644 --- a/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json +++ b/tests/integration/expected_test_results/api_v2_product_write/get-product-ingredients-text-without-language.json @@ -100,7 +100,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v2_product_write/get-product.json b/tests/integration/expected_test_results/api_v2_product_write/get-product.json index 74aedc8f7b415..c9ab86cb83fae 100644 --- a/tests/integration/expected_test_results/api_v2_product_write/get-product.json +++ b/tests/integration/expected_test_results/api_v2_product_write/get-product.json @@ -114,7 +114,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json index 7a973c3850ca4..e4d9026fee348 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-ai-data-str.json @@ -109,7 +109,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json index c2fd3e7eeccf4..5d9f208e2d6b2 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-caret.json @@ -109,7 +109,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json index c2fd3e7eeccf4..5d9f208e2d6b2 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-data-uri.json @@ -109,7 +109,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json index 7a973c3850ca4..e4d9026fee348 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-fnc1.json @@ -109,7 +109,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json index c2fd3e7eeccf4..5d9f208e2d6b2 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product-gs1-gs.json @@ -109,7 +109,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json index 2bbefe1f2cc4c..4adbddb8d6ca5 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-existing-product.json @@ -109,7 +109,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json index 03cd6b177e254..d3be88038a229 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all-knowledge-panels.json @@ -109,7 +109,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, @@ -1193,7 +1193,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n \n ", + "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json index df12eea5f4964..7863697d88b3c 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-all.json @@ -109,7 +109,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json index f295850a6630a..4f290fa3ff52e 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-attribute-groups-all-knowledge-panels.json @@ -757,7 +757,7 @@ "epi_score" : "0", "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, @@ -1841,7 +1841,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n \n ", + "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json index 1a398d4e82557..5487db8d72839 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card-knowledge_panels_excluded-health_card.json @@ -494,7 +494,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n \n ", + "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json b/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json index fb09d2de473cb..9c395b3b4db54 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-fields-knowledge-panels-knowledge-panels_included-health_card-environment_card.json @@ -494,7 +494,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n \n ", + "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels-fr.json b/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels-fr.json index bc91ed1cbd7cc..651407a2073f1 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels-fr.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels-fr.json @@ -494,7 +494,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Score d'analyse du cycle de vie : 70
\n Somme des bonus et malus :\n \n -23\n

\n Score final : 47/100\n \n ", + "html" : "\n Score d'analyse du cycle de vie : 70
\n Somme des bonus et malus :\n \n -23\n

\n Score final : 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels.json b/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels.json index eacd14f068bc4..9117e0aa04f60 100644 --- a/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels.json +++ b/tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels.json @@ -494,7 +494,7 @@ { "element_type" : "text", "text_element" : { - "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n \n ", + "html" : "\n Life cycle analysis score: 70
\n Sum of bonuses and maluses:\n \n -23\n

\n Final score: 47/100\n ", "type" : "summary" } } diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-all.json b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-all.json index e76f9f59968dc..f79d850879243 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-all.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-all.json @@ -71,7 +71,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-ecoscore-data.json b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-ecoscore-data.json index c744a07ea3049..496d49a9070e6 100644 --- a/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-ecoscore-data.json +++ b/tests/integration/expected_test_results/api_v3_product_write/patch-request-fields-ecoscore-data.json @@ -10,7 +10,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/export_more_fields/export_more_fields.csv b/tests/integration/expected_test_results/export_more_fields/export_more_fields.csv index b7aa9a457c994..704b86268c243 100644 --- a/tests/integration/expected_test_results/export_more_fields/export_more_fields.csv +++ b/tests/integration/expected_test_results/export_more_fields/export_more_fields.csv @@ -29,5 +29,5 @@ Canola Oil, Water, Garbanzo Beans, Lupin (bean), Mustard Seeds, Grape Vinegar, L 77000001 fr "Pâte à tartiner chocolat et noisettes" 300 g Alex Olivier alex-olivier "Petit-déjeuners, Produits à tartiner, Produits à tartiner sucrés, Pâtes à tartiner, Pâtes à tartiner aux noisettes, Pâtes à tartiner au chocolat, Pâtes à tartiner aux noisettes et au cacao" en:breakfasts,en:spreads,en:sweet-spreads,fr:pates-a-tartiner,en:hazelnut-spreads,en:chocolate-spreads,en:cocoa-and-hazelnuts-spreads France en:france 100g 100g 49 % en:sweets en:sugary-snacks,en:sweets unknown unknown d 31 1 31032 -5 -15 0 0 8712423020221 fr The Tasty Decaf Unilever unilever France en:france 100g 100g 1 kcal 0 g 0 g 0 g 0 g 0 g 0 g 0 g 1 kcal unknown unknown unknown 1 -5 -15 0 App - yuka, Apps 0 0071464240608 en 100% fruit juice smoothie, green goodness Green goodness smoothie 8 OZA (240 ml) Bolthouse Farms bolthouse-farms Wm. Bolthouse Farms Inc. Beverages and beverages preparations, Plant-based foods and beverages, Beverages, Plant-based beverages en:beverages-and-beverages-preparations,en:plant-based-foods-and-beverages,en:beverages,en:plant-based-beverages France, United States en:france,en:united-states Pineapple juice from concentrate (water, pineapple juice concentrate), apple juice from concentrate (water, apple juice concentrate), mango puree from concentrate (water, mango puree concentrate), banana puree, kiwi puree, spirulina powder, natural flavor, green tea extract, spinach powder, broccoli powder, barley grass powder, wheat grass powder, garlic powder, jerusalem artichoke powder, nova scotia dulse powder. 100g 100g 58 kcal 0 g 0 g 13.75 g 12.5 g 0.8 g 0.83 g 30 mg 12 mg 58 kcal 0 g 0 mg 417 IU 12.5 mg 0.071 mg 0.125 mg 0.62 µg 175 mg 17 mg 0.45 mg 1 mg en:unsweetened-beverages en:beverages,en:unsweetened-beverages 4 en:4-ultra-processed-food-and-drink-products d 8 unknown 1 -5 -15 0 2018-02-14T00:00:00Z Fruit & Vegetable Juice, Nectars & Fruit Drinks LI 653042 2018-02-14T00:00:00Z 2019-12-06T00:00:00Z App - yuka, Apps, Databases, database-usda 0 -04083637 fr Lait concentré non sucré entier 410 g Régilait regilait Produits laitiers, Laits concentrés, Laits concentrés non sucrés, Laits entiers concentrés en:dairies,en:evaporated-milks,en:evaporated-milks-without-sugar,fr:laits-entiers-concentres Fabriqué en Allemagne en:made-in-germany France en:france DE RP-25 EC de-rp-25-ec Lait entier (origine UE), stabilisants : phosphates de sodium, carraghénanes Lait en:milk 100g 100g 132 kcal 7.5 g 5 g 10 g 10 g 6.1 g 0.25 g 0.1 g 132 kcal 4 en:4-ultra-processed-food-and-drink-products c 5 unknown 1 -4 -15 0 App - yuka, Apps 0 +04083637 fr Lait concentré non sucré entier 410 g Régilait regilait Produits laitiers, Laits concentrés, Laits concentrés non sucrés, Laits entiers concentrés en:dairies,en:evaporated-milks,en:evaporated-milks-without-sugar,fr:laits-entiers-concentres Fabriqué en Allemagne en:made-in-germany France en:france DE RP-25 EC de-rp-25-ec Lait entier (origine UE), stabilisants : phosphates de sodium, carraghénanes Lait en:milk 100g 100g 132 kcal 7.5 g 5 g 10 g 10 g 6.1 g 0.25 g 0.1 g 132 kcal 4 en:4-ultra-processed-food-and-drink-products c 5 unknown 1 -5 -15 0 App - yuka, Apps 0 0850032917148 en Tulú Drinks - Strawberry Flavor Aloe Drink with Strawberry Flavor 500 ml 240 ml Plastic en:plastic Tulú, Tulú Drinks tulu,tulu-drinks Colombia's Best Beverages and beverages preparations, Plant-based foods and beverages, Beverages, Plant-based beverages, Fruit-based beverages, Non-alcoholic beverages, Aloe Vera drinks en:beverages-and-beverages-preparations,en:plant-based-foods-and-beverages,en:beverages,en:plant-based-beverages,en:fruit-based-beverages,en:non-alcoholic-beverages,en:aloe-vera-drinks Vegetarian, No preservatives, Vegan en:vegetarian,en:no-preservatives,en:vegan Puerto Rico en:puerto-rico Colombia en:colombia Water, Aloe Vera Pulp, Sugar, Citric Acid, Sodium Citrate, Aloe Artifical Flavor, Calcium Lactate, Strawberry Artificial Flavor, Ascorbic Acid, Gellan Gum, EDTA, Sucralose, FD&C Red No. 40 None en:none None en:none serving 100g 50 kcal 0 g 0 g 12 g 12 g 0 g 0 g 100 mg 40 mg 50 kcal en:sweetened-beverages en:beverages,en:sweetened-beverages 4 en:4-ultra-processed-food-and-drink-products d 7 c 48 1 18309 -1 -15 0 0 diff --git a/tests/integration/expected_test_results/export_more_fields/rows/04083637.json b/tests/integration/expected_test_results/export_more_fields/rows/04083637.json index fff3d1ecdd422..8bf6c30adddd4 100644 --- a/tests/integration/expected_test_results/export_more_fields/rows/04083637.json +++ b/tests/integration/expected_test_results/export_more_fields/rows/04083637.json @@ -56,7 +56,7 @@ "nutrition_data_per" : "100g", "nutrition_data_prepared_per" : "100g", "obsolete" : "0", - "off:ecoscore_data.adjustments.origins_of_ingredients.value" : "-4", + "off:ecoscore_data.adjustments.origins_of_ingredients.value" : "-5", "off:ecoscore_data.adjustments.packaging.non_recyclable_and_non_biodegradable_materials" : "", "off:ecoscore_data.adjustments.packaging.value" : "-15", "off:ecoscore_data.adjustments.production_system.value" : "0", diff --git a/tests/integration/expected_test_results/page_crawler/crawler-access-product-page.html b/tests/integration/expected_test_results/page_crawler/crawler-access-product-page.html index a3ecbb54ae97d..b649561f7ef27 100644 --- a/tests/integration/expected_test_results/page_crawler/crawler-access-product-page.html +++ b/tests/integration/expected_test_results/page_crawler/crawler-access-product-page.html @@ -2771,7 +2771,6 @@

Eco-Score for this product



Final score: 31/100 - diff --git a/tests/integration/expected_test_results/page_crawler/normal-user-access-product-page.html b/tests/integration/expected_test_results/page_crawler/normal-user-access-product-page.html index a3ecbb54ae97d..b649561f7ef27 100644 --- a/tests/integration/expected_test_results/page_crawler/normal-user-access-product-page.html +++ b/tests/integration/expected_test_results/page_crawler/normal-user-access-product-page.html @@ -2771,7 +2771,6 @@

Eco-Score for this product



Final score: 31/100 - diff --git a/tests/integration/expected_test_results/product_read/get-existing-product.html b/tests/integration/expected_test_results/product_read/get-existing-product.html index 0956a196c0b54..8075a61aad657 100644 --- a/tests/integration/expected_test_results/product_read/get-existing-product.html +++ b/tests/integration/expected_test_results/product_read/get-existing-product.html @@ -3437,7 +3437,6 @@

Eco-Score for this product



Final score: 47/100 - diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json index c3c5403b13b35..b1fe5bf8abf1b 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2-moderator.json @@ -108,7 +108,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json index 29a904f3c171d..0436205f547f0 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-api-v2.json @@ -109,7 +109,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json index 32729268096b7..ac3ca61792926 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form-moderator.json @@ -112,7 +112,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json index 285e588369f27..e197c53ca5f8c 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-protected-product-web-form.json @@ -113,7 +113,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json index 347355115c62b..27ea4c0ba8da5 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-api-v2.json @@ -108,7 +108,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json index e8b2e240853e8..8bba1aaf091ea 100644 --- a/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json +++ b/tests/integration/expected_test_results/protected_product/get-edited-unprotected-product-web-form.json @@ -112,7 +112,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/search_v1/search-no-filter.json b/tests/integration/expected_test_results/search_v1/search-no-filter.json index b630be4b2b200..4527dabc70356 100644 --- a/tests/integration/expected_test_results/search_v1/search-no-filter.json +++ b/tests/integration/expected_test_results/search_v1/search-no-filter.json @@ -98,7 +98,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, @@ -1022,7 +1022,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, @@ -1651,7 +1651,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, @@ -2479,7 +2479,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, @@ -3296,7 +3296,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, @@ -4271,7 +4271,7 @@ "epi_score" : 0, "origin" : "en:unknown", "percent" : 100, - "transportation_score" : null + "transportation_score" : 0 } ], "epi_score" : 0, diff --git a/tests/integration/expected_test_results/web_html/fr-product-2.html b/tests/integration/expected_test_results/web_html/fr-product-2.html index 1fd93519c6e67..6ebfb494feb73 100644 --- a/tests/integration/expected_test_results/web_html/fr-product-2.html +++ b/tests/integration/expected_test_results/web_html/fr-product-2.html @@ -2829,7 +2829,6 @@

Eco-Score pour ce produit



Score final : 60/100 - diff --git a/tests/integration/expected_test_results/web_html/fr-product.html b/tests/integration/expected_test_results/web_html/fr-product.html index 324c2894e5bb2..24b9630429616 100644 --- a/tests/integration/expected_test_results/web_html/fr-product.html +++ b/tests/integration/expected_test_results/web_html/fr-product.html @@ -2843,7 +2843,6 @@

Eco-Score pour ce produit



Score final : 60/100 - diff --git a/tests/integration/expected_test_results/web_html/world-product.html b/tests/integration/expected_test_results/web_html/world-product.html index 25b9244cdca54..173912f40a2df 100644 --- a/tests/integration/expected_test_results/web_html/world-product.html +++ b/tests/integration/expected_test_results/web_html/world-product.html @@ -3417,7 +3417,6 @@

Eco-Score for this product



Final score: 60/100 -