KaufmannDigital / KaufmannDigital.GDPR.CookieConsent

A ready-to-run package, that integrates an advanced cookie consent banner into your Neos CMS site.
https://www.kaufmann.digital/neos-cms/plugins/dsgvo-gdpr-cookie-consent
GNU General Public License v3.0
26 stars 11 forks source link

Javascript String Template Literals in JS snippets are minified with errors #14

Closed retinafunk closed 3 years ago

retinafunk commented 4 years ago

I noticed a small bug when the JS snippets inserted in NEOS Inspector are minified, that Javascript String Template Literals in JS snippets are missing the Variables/ expression interpolations . I mean the ${jsExpression} in const str = ... ${}

So for example.

const mapSrc = https://maps.google.de/maps?hl=de&q=${companyName}+${zip}+${city}&ie=UTF8&t=&z=17&iwloc=B&output=embed;

is minfied to :

const mapSrc = https://maps.google.de/maps?hl=de&q={}+{}+{}&ie=UTF8&t=&z=17&iwloc=B&output=embed;

instead of :

const mapSrc = https://maps.google.de/maps?hl=de&q=PERMANENT+40219+Duesseldorf&ie=UTF8&t=&z=17&iwloc=B&output=embed;

A workaround was to use traditional JS String concat . SO this works:

const mapSrc = 'https://maps.google.de/maps?hl=de&q='+companyName+'+'+zip+'+'+city+'&ie=UTF8&t=&z=17&iwloc=B&output=embed';

Nikdro commented 4 years ago

Thanks for your issue report. Will check it and provide a Bugfix 🙂

Nikdro commented 3 years ago

Bugfix will be available in the next version. Will release it the next days.