From 0c683f6b1c714bc659bee79e9a8d633d42a37d67 Mon Sep 17 00:00:00 2001 From: git-directory-deploy <> Date: Tue, 4 Jan 2022 14:53:12 +0100 Subject: [PATCH] fix(monthlyReport): Change string replacment for urls --- src/styles/index.css | 4 ++-- .../services/monthlyReportNotification.ts | 20 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/styles/index.css b/src/styles/index.css index 049ceff48..07f467a62 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -1385,11 +1385,11 @@ a.MuiTypography-colorPrimary { --gasColorRadialGradient: radial-gradient(105.25% 64.58% at 49.68% 70.83%, rgba(4, 106, 88, 0.5) 0%, rgba(255, 255, 255, 0) 100%), #45d1b8; --waterColorRadialGradient: radial-gradient(105.25% 64.58% at 49.68% 70.83%, rgba(2, 93, 174, 0.5) 0%, rgba(255, 255, 255, 0) 100%), #3a98ec; } -/* line 55, src/styles/index.scss */ +/* line 61, src/styles/index.scss */ .application { overflow-x: hidden; background-color: #121212; } @media only screen and (max-width: 768px) { - /* line 55, src/styles/index.scss */ + /* line 61, src/styles/index.scss */ .application { min-height: 100vh; } } diff --git a/src/targets/services/monthlyReportNotification.ts b/src/targets/services/monthlyReportNotification.ts index e6f0e0b33..1fe28e9aa 100644 --- a/src/targets/services/monthlyReportNotification.ts +++ b/src/targets/services/monthlyReportNotification.ts @@ -262,7 +262,6 @@ const monthlyReportNotification = async ({ const environmentService = new EnvironmentService() const baseUrl = environmentService.getPublicURL() - const template = monthlyReportTemplate({ title: 'Du nouveau dans votre espace Ecolyo !', baseUrl: baseUrl, @@ -270,20 +269,29 @@ const monthlyReportNotification = async ({ clientUrl: url, unsubscribeUrl: unsubscribeUrl, consumptionTextExist: consumptionText.length > 0, - consumptionText: consumptionText.replace(/{cozyUrl}/g, appLink + '#/'), - infoText: monthlyReport.info.replace(/{cozyUrl}/g, appLink + '#/'), + consumptionText: consumptionText.replace( + 'https://cozyUrl/', + appLink + '#/' + ), + infoText: monthlyReport.info.replace('https://cozyUrl/', appLink + '#/'), infoImage: monthlyReport.image !== '' ? baseUrl + monthlyReport.image : baseUrl + '/assets/astuce.png', isServiceNews: isServiceNews, isPoll: isPoll, - newsTitle: monthlyReport.newsTitle.replace(/{cozyUrl}/g, appLink + '#/'), + newsTitle: monthlyReport.newsTitle.replace( + 'https://cozyUrl/', + appLink + '#/' + ), newsContent: monthlyReport.newsContent.replace( - /{cozyUrl}/g, + 'https://cozyUrl/', + appLink + '#/' + ), + pollText: monthlyReport.question.replace( + 'https://cozyUrl/', appLink + '#/' ), - pollText: monthlyReport.question.replace(/{cozyUrl}/g, appLink + '#/'), pollUrl: monthlyReport.link, previousMonth: getPreviousMonthName(date.minus({ month: 1 })), consoImageUrl: baseUrl + '/assets/multifluidConsumption.png', -- GitLab