From 40fe40d753e19a3e9f5acbba68e699b43240ccb5 Mon Sep 17 00:00:00 2001 From: Philippe Ozil Date: Thu, 25 Apr 2024 09:48:42 +0200 Subject: [PATCH] fix: QR code generator (#110) --- README.md | 2 +- src/main/default/lwc/qrCode/__tests__/qrCode.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7c215dc..1051336 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ If installing on a Developer Edition org, you first need to set up **My Domain** 1. Click [this link](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5p0000013nkIAAQ) to install the host app package and choose **Install for All Users**. - You'll need to approve access to `https://chart.googleapis.com`. We use this library to draw leaderboards. + You'll need to approve access to `https://api.qrserver.com`. We use this library to draw a QR Code. 1. Set up permissions: 1. Navigate to **Setup > Users > Permission Sets**, click **Quiz Host** diff --git a/src/main/default/lwc/qrCode/__tests__/qrCode.test.js b/src/main/default/lwc/qrCode/__tests__/qrCode.test.js index 1b63ea1..1aaf117 100644 --- a/src/main/default/lwc/qrCode/__tests__/qrCode.test.js +++ b/src/main/default/lwc/qrCode/__tests__/qrCode.test.js @@ -22,7 +22,7 @@ describe('qr-code', () => { const img = element.shadowRoot.querySelector('img'); expect(img.src).toBe( - `https://chart.googleapis.com/chart?chs=${IMAGE_SIZE}x${IMAGE_SIZE}&cht=qr&chl=${encodeURIComponent( + `https://api.qrserver.com/v1/create-qr-code/?size=${IMAGE_SIZE}x${IMAGE_SIZE}&data=${encodeURIComponent( IMAGE_BASE_URL )}` );