-
-
Notifications
You must be signed in to change notification settings - Fork 357
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: Show barcode image on product page - Fixes #1728 #4227
Conversation
`Show barcode image on product page` * Added JsBarcode CDN link to the frontend. * Now the `barcode number` is converted to a vector image.
…aragraph) * Fixed dangling svg issue (It occured when the javascript was turned off)
Can someone review it ? |
const barcode = document.getElementById('barcode'); | ||
|
||
// Get the barcode_paragraph `p` element from DOM. | ||
const barcodeParagraph = document.getElementById('barcode_paragraph'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The barcode_paragraph
element does not exist, if the barcode doesn't start with a 0
, so that should likely be checked before doing all of this. Maybe even the JsBarcode.all.min.js
script only needs to be included, if we know the barcode will be replaced by an SVG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you mention the pages, on which the barcode
is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stephanegigandet @teolemon Where did you initially want the barcode to be displayed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No one is replying 🙁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ArishSultan, sorry for my late reply. We should show the barcode only the product info page: https://world.openfoodfacts.org/product/5022019160310/organic-ginger-beer-belvoir
Ideally it would appear when we click on a barcode button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i am on it
Kudos, SonarCloud Quality Gate passed!
|
Kudos, SonarCloud Quality Gate passed! |
Did @ArishSultan 's latest commit fix your concerns about the display only on the product page ? |
What
barcode number
is converted to a vector image.Related issues and discussion
Screenshot
Part of