openfoodfacts-server icon indicating copy to clipboard operation
openfoodfacts-server copied to clipboard

fix: added barcode-svg

Open bazylevnik0 opened this issue 9 months ago • 3 comments

What

Added support of the barcode SVGs in the page

Screenshot

Screenshot from 2024-05-06 20-08-14

Related issue(s) and discussion

  • Fixes #1728
  • It is my first PR, was autonomous as can, but please provide more information about changes if needed

bazylevnik0 avatar May 06 '24 17:05 bazylevnik0

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 49.25%. Comparing base (dc04d18) to head (2656b60). Report is 478 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10242      +/-   ##
==========================================
- Coverage   49.54%   49.25%   -0.30%     
==========================================
  Files          67       76       +9     
  Lines       20650    21872    +1222     
  Branches     4980     5239     +259     
==========================================
+ Hits        10231    10772     +541     
- Misses       9131     9778     +647     
- Partials     1288     1322      +34     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar May 06 '24 18:05 codecov-commenter

After many tryings:
I do not understand how to use display-product.js in this situation. I even couldn't to console.log something. It is sort of async loading, yes? I see connection of this script on the page, but I tried to change something, with failure...

My proposal:
Use a little snippet on the template, ye it is direct js in the template(as i said before, do not understand other way)). I wrote the logic for avoiding the show and initialization for mobiles and with less height.
I see conditions for mobile only in the main page template ([% IF mobile %]). But loading of the library now only on the product page...

Screenshots: Screenshot from 2024-05-08 16-26-11 Screenshot from 2024-05-08 16-26-25

bazylevnik0 avatar May 08 '24 13:05 bazylevnik0

I updated tests results.

alexgarel avatar Jul 12 '24 16:07 alexgarel

@bazylevnik0 thanks for this great contribution.

Sorry for we were quite under an heavy load last week, and it's only now that I saw it was failing since a long time.

I just add to run "make update_test_results" to have all test results updated.

alexgarel avatar Jul 12 '24 16:07 alexgarel