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: Show barcode image on product page - Fixes #1728 #4227

Closed
wants to merge 4 commits into from
Closed

feat: Show barcode image on product page - Fixes #1728 #4227

wants to merge 4 commits into from

Conversation

ArishSultan
Copy link

@ArishSultan ArishSultan commented Sep 18, 2020

What

  • Show barcode image on product page
  • Added JsBarcode CDN link to the frontend.
  • Now the barcode number is converted to a vector image.

Related issues and discussion

  • Fixes

Screenshot

image

Part of

  • Product Page

`Show barcode image on product page`

* Added JsBarcode CDN link to the frontend.
* Now the `barcode number` is converted to a vector image.
templates/display_product.tt.html Outdated Show resolved Hide resolved
templates/display_product.tt.html Outdated Show resolved Hide resolved
…aragraph)

* Fixed dangling svg issue (It occured when the javascript was turned off)
@ArishSultan
Copy link
Author

Can someone review it ?

const barcode = document.getElementById('barcode');

// Get the barcode_paragraph `p` element from DOM.
const barcodeParagraph = document.getElementById('barcode_paragraph');
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

Also, it may need to be limited to some page types, because right now, the barcode is also replaced if I still have to log in: image

Copy link
Author

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

Copy link
Member

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?

Copy link
Author

Choose a reason for hiding this comment

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

No one is replying 🙁

Copy link
Contributor

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.

Copy link
Author

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

@sonarcloud
Copy link

sonarcloud bot commented Sep 19, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

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

@teolemon teolemon changed the title Fixed Issue #1728 Show barcode image on product page - Fixes Issue #1728 Oct 2, 2020
@teolemon teolemon changed the title Show barcode image on product page - Fixes Issue #1728 Show barcode image on product page - Fixes #1728 Oct 2, 2020
@sonarcloud
Copy link

sonarcloud bot commented Dec 7, 2020

Kudos, SonarCloud 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

@teolemon teolemon requested a review from a team January 14, 2021 16:58
@jolesh jolesh linked an issue Jan 15, 2021 that may be closed by this pull request
@teolemon
Copy link
Member

teolemon commented Feb 3, 2021

Did @ArishSultan 's latest commit fix your concerns about the display only on the product page ?
@hangy

@teolemon teolemon added the 💥 Merge Conflicts 💥 Merge Conflicts label Feb 13, 2022
@teolemon teolemon changed the title Show barcode image on product page - Fixes #1728 feat: Show barcode image on product page - Fixes #1728 Feb 13, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Show barcode image on product page
4 participants