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: Editing packaging components on web site #7755

Merged
merged 52 commits into from
Nov 30, 2022
Merged

Conversation

stephanegigandet
Copy link
Contributor

@stephanegigandet stephanegigandet commented Nov 24, 2022

A simple table in the product edit form in order to enter packaging components information.

image

Mobile:

image

It's not very user friendly, but it's a first step in order to be able to enter some data.

Also added new tags to the misc facet so that we can track packaging data:

  • packagings-complete
  • packagings-not-complete
  • packagings-empty
  • packagings-not-empty
  • packagings-not-empty-but-not-complete

Will be done later in separate PRs:

  • adding packagings_complete to the v3 product WRITE API
  • better default ordering for the shape / material options (in particular moving all the numbered options for materials to the bottom of the list)
  • ideally a more specific ordering of shape / material options that could depend on product category, previous selection for the component etc. (e.g. if it's beer, we put bottle at the top of shape, and if the shape is a bottle, we put glass on top of materials)
  • suggestions to quickly add components based on product category and/or other packaging components

@stephanegigandet stephanegigandet requested a review from a team as a code owner November 24, 2022 17:20
@stephanegigandet stephanegigandet marked this pull request as draft November 24, 2022 17:20
@github-actions github-actions bot added CSS Display ✏️ Editing 🧪 integration tests multilingual products 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. 🧪 tests Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org labels Nov 24, 2022
@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label Nov 30, 2022
@stephanegigandet
Copy link
Contributor Author

Hi @alexgarel and @raphael0202 , thanks a lot for the tests, review and suggestions. I believe I addressed all the points you raised.

The new version is currently live on .dev : https://world-fr.openfoodfacts.dev/cgi/product.pl?type=edit&code=7771608000022

@github-actions github-actions bot added API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) API READ All READ APIs include Product, Search… API v3 API WRITE WRITE API to allow sending product info and image 💥 Merge Conflicts 💥 Merge Conflicts labels Nov 30, 2022
@github-actions github-actions bot removed 📚 Documentation Documentation issues improve the project for everyone. API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) API WRITE WRITE API to allow sending product info and image API READ All READ APIs include Product, Search… API v3 labels Nov 30, 2022
@sonarqubecloud
Copy link

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
0.0% 0.0% Duplication

@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label Nov 30, 2022
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, it works fine.

There is something we should however improve in the future:
The text field should be either erased, or regenerated after packaging update.

Currently if I remove a row in packaging (say tap) but do not pay attention and the element is present in text (1 tap), it won't be removed, and this really is counter intuitive to users.

Regenerating text comes with the advantage that it gives a clear template and is easy to modify. But the drawback is losing original input.

@stephanegigandet
Copy link
Contributor Author

The text field should be either erased, or regenerated after packaging update.

The text often contains the text of the recycling instructions on the package. I would prefer to keep it.

@stephanegigandet stephanegigandet merged commit 7dddfcf into main Nov 30, 2022
@stephanegigandet stephanegigandet deleted the packagings-edit branch November 30, 2022 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Display ✏️ Editing 🧪 integration tests 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. 🧪 tests Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org
Projects
Development

Successfully merging this pull request may close these issues.

2 participants