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

fix: add more linked panels for attributes #6808

Merged
merged 12 commits into from
May 30, 2023
Merged

fix: add more linked panels for attributes #6808

merged 12 commits into from
May 30, 2023

Conversation

teolemon
Copy link
Member

@teolemon teolemon commented May 21, 2022

What

  • adds more linked knowledge panels for various attributes
    • Allergens (commented out, since we don't have an associated knowledge panel yet)
    • vegan/vegetarian/palm oil unknown

Sample query

Why

  • This is important because it increases the likelihood that someone will take a photo of/extract the ingredient list

Related issue(s) and discussion

screen-20230317-152120.mp4

@github-actions github-actions bot added the Attributes https://wiki.openfoodfacts.org/Product_Attributes label May 21, 2022
@sonarcloud
Copy link

sonarcloud bot commented May 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label May 30, 2022
@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 Aug 29, 2022
@teolemon teolemon marked this pull request as ready for review March 17, 2023 13:51
@teolemon teolemon requested a review from a team as a code owner March 17, 2023 13:51
@teolemon teolemon added 🎯 P1 🥗 Ingredients and removed ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. labels Mar 17, 2023
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Cool idea, but it needs a bit of work

lib/ProductOpener/Attributes.pm Outdated Show resolved Hide resolved
$attribute_ref->{icon_url} = "$static_subdomain/images/attributes/${tag}.svg";
$attribute_ref->{panel_id} = "${tag}";
Copy link
Member

Choose a reason for hiding this comment

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

There is "environment_label_en:" in front. And we should do this only for tags with a panel (how do we get them ? Is it through a property in taxonomy ?)

Copy link
Member Author

Choose a reason for hiding this comment

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

@alexgarel would removing this change for the labels make the PR acceptable to you ? we indeed don't have any knowledge panels on labels, but that would be another issue that we can create

@sonarcloud
Copy link

sonarcloud bot commented Apr 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2023

Codecov Report

Merging #6808 (aefba0b) into main (7953dbc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #6808   +/-   ##
=======================================
  Coverage   48.61%   48.62%           
=======================================
  Files         114      114           
  Lines       21343    21346    +3     
  Branches     4779     4779           
=======================================
+ Hits        10376    10379    +3     
  Misses       9680     9680           
  Partials     1287     1287           
Impacted Files Coverage Δ
lib/ProductOpener/Attributes.pm 75.64% <100.00%> (+0.15%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sonarcloud
Copy link

sonarcloud bot commented May 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@stephanegigandet
Copy link
Contributor

@teolemon I made some changes, as we already had a panel_id set, the issue was that the corresponding panel does not exist if we don't have ingredients.

New behaviour:

  • For allergens, if the status is unknown (we don't have "no gluten" labels etc.), we link to the ingredients panel if we don't have ingredients (so that we can display the action to add them), or the ingredients analysis panel (if we have ingredients that are unknown)
  • For vegan/vegetarian/palm oil: similar

@teolemon teolemon requested a review from alexgarel May 26, 2023 16:37
@teolemon
Copy link
Member Author

@stephanegigandet awesome, I re-requested a review from @alexgarel or you can self approve your changes 👍
poke @g123k

@teolemon
Copy link
Member Author

image

@teolemon teolemon enabled auto-merge (squash) May 29, 2023 08:23
@teolemon teolemon disabled auto-merge May 29, 2023 08:23
@teolemon
Copy link
Member Author

@alexgarel your changes should be addressed, can you approve ?

@teolemon teolemon requested review from alexgarel and removed request for alexgarel May 29, 2023 11:29
@alexgarel alexgarel merged commit f861059 into main May 30, 2023
14 checks passed
@alexgarel alexgarel deleted the more-attributes branch May 30, 2023 08:14
MonalikaPatnaik pushed a commit to MonalikaPatnaik/openfoodfacts-server that referenced this pull request May 31, 2023
New behaviour:

* For allergens, if the status is unknown (we don't have "no gluten" labels etc.), we link to the ingredients panel if we don't have ingredients (so that we can display the action to add them), or the ingredients analysis panel (if we have ingredients that are unknown)
* For vegan/vegetarian/palm oil: similar


Co-authored-by: Stéphane Gigandet <stephane@openfoodfacts.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attributes https://wiki.openfoodfacts.org/Product_Attributes 🎯 P1 🧪 tests
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants