Skip to content

Commit

Permalink
feat: rename ecoscore fields to environmental_score (internal) and ne…
Browse files Browse the repository at this point in the history
…w external name and logos (#11142)

Continuation of
#11117

We will soon rename the Eco-Score to a new name.

To ease the transition to a new name and be more future proof, we will
rename all Eco-Score internal fields to a generic "environmental score"
field.

Important notes:

- the internal attribute id "ecoscore" is not renamed, as it is stored
in clients.
- for the time being, we keep the internal facet id "ecosore" and we
copy environmental_score_tags to ecoscore_tags so that MongoDB and
off-query can continue to work
- in order for attributes and knowledge panels to work before Eco-Score
has been recomputed (and new environmental_scores fields have been
created), the attributes and knowledge panels will use ecoscore_data if
environmental_data is not present.

Plan discussed in
https://docs.google.com/document/d/1LL8-aiSF482xaJ1o0AKmhXB5QWfVE0_jzvYakq3VXys/edit?tab=t.0#heading=h.pirt3xscsuwq
  • Loading branch information
stephanegigandet authored Dec 18, 2024
1 parent 8a37c8b commit 8a1fec4
Show file tree
Hide file tree
Showing 948 changed files with 36,304 additions and 26,812 deletions.
8 changes: 4 additions & 4 deletions cgi/product_jqm_multilingual.pl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ =head1 DESCRIPTION
use ProductOpener::Ingredients qw/:all/;
use ProductOpener::Images qw/:all/;
use ProductOpener::DataQuality qw/:all/;
use ProductOpener::Ecoscore qw/:all/;
use ProductOpener::EnvironmentalScore qw/:all/;
use ProductOpener::Packaging qw/:all/;
use ProductOpener::ForestFootprint qw/:all/;
use ProductOpener::Text qw/remove_tags_and_quote/;
Expand Down Expand Up @@ -266,8 +266,8 @@ =head1 DESCRIPTION
push @app_fields, "creator";
}

if ($request_ref->{admin} or ($User_id eq "ecoscore-impact-estimator")) {
push @app_fields, ("ecoscore_extended_data", "ecoscore_extended_data_version");
if ($request_ref->{admin} or ($User_id eq "environmental-score-impact-estimator")) {
push @app_fields, ("environmental_score_extended_data", "environmental_score_extended_data_version");
}

# generate a list of potential languages for language specific fields
Expand Down Expand Up @@ -385,7 +385,7 @@ =head1 DESCRIPTION
}

}
elsif ($field eq "ecoscore_extended_data") {
elsif ($field eq "environmental_score_extended_data") {
# we expect a JSON value
if (defined single_param($field)) {
$product_ref->{$field} = decode_json(single_param($field));
Expand Down
2 changes: 1 addition & 1 deletion cgi/product_multilingual.pl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
use ProductOpener::KnowledgePanelsContribution qw/create_contribution_card_panel/;
use ProductOpener::URL qw/:all/;
use ProductOpener::DataQuality qw/:all/;
use ProductOpener::Ecoscore qw/:all/;
use ProductOpener::EnvironmentalScore qw/:all/;
use ProductOpener::Packaging
qw/apply_rules_to_augment_packaging_component_data get_checked_and_taxonomized_packaging_component_data/;
use ProductOpener::ForestFootprint qw/:all/;
Expand Down
4 changes: 2 additions & 2 deletions cgi/search.pl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

my @search_fields
= qw(brands categories packaging labels origins manufacturing_places emb_codes purchase_places stores countries
ingredients additives allergens traces nutrition_grades nova_groups ecoscore languages creator editors states);
ingredients additives allergens traces nutrition_grades nova_groups environmental_score languages creator editors states);

$request_ref->{admin} and push @search_fields, "lang";

Expand Down Expand Up @@ -352,7 +352,7 @@
my @other_search_fields = (
"additives_n", "ingredients_n", "known_ingredients_n", "unknown_ingredients_n",
"fruits-vegetables-nuts-estimate-from-ingredients",
"forest_footprint", "product_quantity", "nova_group", 'ecoscore_score',
"forest_footprint", "product_quantity", "nova_group", 'environmental_score_score',
);

# Add the fields related to packaging
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8a1fec4

Please sign in to comment.