From a3ccf0d5bb48b52ab80a7ae900d5012de52bc601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 2 Jan 2023 13:56:56 +0100 Subject: [PATCH 1/7] Change 'transactionLinkRedeemed' subject --- backend/src/emails/templates/transactionLinkRedeemed/html.pug | 4 ++-- .../src/emails/templates/transactionLinkRedeemed/subject.pug | 2 +- backend/src/locales/de.json | 2 +- backend/src/locales/en.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/emails/templates/transactionLinkRedeemed/html.pug b/backend/src/emails/templates/transactionLinkRedeemed/html.pug index fb561f5c5..30146e27f 100644 --- a/backend/src/emails/templates/transactionLinkRedeemed/html.pug +++ b/backend/src/emails/templates/transactionLinkRedeemed/html.pug @@ -1,9 +1,9 @@ doctype html html(lang=locale) head - title= t('emails.transactionLinkRedeemed.subject') + title= t('emails.transactionLinkRedeemed.subject', { senderFirstName, senderLastName }) body - h1(style='margin-bottom: 24px;')= t('emails.transactionLinkRedeemed.subject') + h1(style='margin-bottom: 24px;')= t('emails.transactionLinkRedeemed.subject', { senderFirstName, senderLastName }) #container.col include ../hello.pug p= t('emails.transactionLinkRedeemed.hasRedeemedYourLink', { senderFirstName, senderLastName, senderEmail }) diff --git a/backend/src/emails/templates/transactionLinkRedeemed/subject.pug b/backend/src/emails/templates/transactionLinkRedeemed/subject.pug index 6f4f74f04..9070b60b3 100644 --- a/backend/src/emails/templates/transactionLinkRedeemed/subject.pug +++ b/backend/src/emails/templates/transactionLinkRedeemed/subject.pug @@ -1 +1 @@ -= t('emails.transactionLinkRedeemed.subject') += t('emails.transactionLinkRedeemed.subject', { senderFirstName, senderLastName }) diff --git a/backend/src/locales/de.json b/backend/src/locales/de.json index 2e6796794..38b53508b 100644 --- a/backend/src/locales/de.json +++ b/backend/src/locales/de.json @@ -48,7 +48,7 @@ "transactionLinkRedeemed": { "hasRedeemedYourLink": "{senderFirstName} {senderLastName} ({senderEmail}) hat soeben deinen Link eingelöst.", "memo": "Nachricht: {transactionMemo}", - "subject": "Gradido: Dein Gradido-Link wurde eingelöst" + "subject": "Gradido: {senderFirstName} {senderLastName} hat deinen Gradido-Link eingelöst" }, "transactionReceived": { "haveReceivedAmountGDDFrom": "du hast soeben {transactionAmount} GDD von {senderFirstName} {senderLastName} ({senderEmail}) erhalten.", diff --git a/backend/src/locales/en.json b/backend/src/locales/en.json index 3b25f8ae4..6131bb501 100644 --- a/backend/src/locales/en.json +++ b/backend/src/locales/en.json @@ -48,7 +48,7 @@ "transactionLinkRedeemed": { "hasRedeemedYourLink": "{senderFirstName} {senderLastName} ({senderEmail}) has just redeemed your link.", "memo": "Message: {transactionMemo}", - "subject": "Gradido: Your Gradido link has been redeemed" + "subject": "Gradido: {senderFirstName} {senderLastName} has redeemed your Gradido link" }, "transactionReceived": { "haveReceivedAmountGDDFrom": "You have just received {transactionAmount} GDD from {senderFirstName} {senderLastName} ({senderEmail}).", From bd6ba95fd331478a00992b38340448d21bf33ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 2 Jan 2023 14:49:53 +0100 Subject: [PATCH 2/7] Change transaction link additional text --- frontend/src/locales/de.json | 2 +- frontend/src/locales/en.json | 2 +- frontend/src/locales/es.json | 2 +- frontend/src/locales/fr.json | 2 +- frontend/src/locales/nl.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index aa1b02871..4f9bafed1 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -172,7 +172,7 @@ "link-copied": "Link wurde in die Zwischenablage kopiert. Du kannst ihn jetzt in eine E-Mail oder Nachricht einfügen.", "link-deleted": "Der Link wurde am {date} gelöscht.", "link-expired": "Der Link ist nicht mehr gültig. Die Gültigkeit ist am {date} abgelaufen.", - "link-hint": "Achtung: Jeder kann diesen Link einlösen. Gib ihn bitte nicht weiter!", + "link-hint": "Achtung: Jeder kann diesen Link einlösen. Bitte geh achtsam mit ihm um!", "link-overview": "Linkübersicht", "links_count": "Aktive Links", "links_sum": "Offene Links und QR-Codes", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 2b455d599..a7328ca40 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -172,7 +172,7 @@ "link-copied": "Link has been copied to the clipboard. You can now paste it into an email or message.", "link-deleted": "The link was deleted on {date}.", "link-expired": "The link is no longer valid. The validity expired on {date}.", - "link-hint": "Attention: Anyone can redeem this link. Please do not share it!", + "link-hint": "Attention: Anyone can redeem this link. Please be careful with it!", "link-overview": "Link overview", "links_count": "Active links", "links_sum": "Open links and QR codes", diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json index 2c7e4c4ba..e54b95b2f 100644 --- a/frontend/src/locales/es.json +++ b/frontend/src/locales/es.json @@ -172,7 +172,7 @@ "link-copied": "El enlace se ha copiado en el portapapeles. Ahora puedes pegarlo en un correo electrónico o mensaje.", "link-deleted": "El enlace se eliminó el {date}.", "link-expired": "El enlace ya no es válido. La validez expiró el {date}.", - "link-hint": "Atención: cualquiera puede canjear este enlace. Por favor, no lo transmitan.", + "link-hint": "Atención: cualquiera puede canjear este enlace. Por favor, ¡ten cuidado con él!", "link-overview": "Resumen de enlaces", "links_count": "Enlaces activos", "links_sum": "Enlaces abiertos y códigos QR", diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json index 98d2e5a10..1b4e4ce20 100644 --- a/frontend/src/locales/fr.json +++ b/frontend/src/locales/fr.json @@ -172,7 +172,7 @@ "link-copied": "Le lien a été copié dans le presse-papier. Vous pouvez désormais le coller dans votre email ou votre message.", "link-deleted": "Le lien a été supprimé le on {date}.", "link-expired": "Le lien n´est plus valide. Sa validité a expiré le {date}.", - "link-hint": "Attention : tout le monde peut utiliser ce lien. Ne le partage pas, s'il te plaît!", + "link-hint": "Attention : tout le monde peut utiliser ce lien. Veuillez en prendre soin!", "link-overview": "Aperçu du lien", "links_count": "Liens actifs", "links_sum": "Ouvrir les liens et les QR codes", diff --git a/frontend/src/locales/nl.json b/frontend/src/locales/nl.json index eb28615c6..c81dbffb2 100644 --- a/frontend/src/locales/nl.json +++ b/frontend/src/locales/nl.json @@ -172,7 +172,7 @@ "link-copied": "Link werd naar het klembord gekopieerd. Je kunt deze nu in een email of bericht invoegen.", "link-deleted": "De link werd op {date} verwijderd.", "link-expired": "De link is niet meer geldig. De geldigheid is op {date} afgelopen.", - "link-hint": "Attentie: Iedereen kan deze link inwisselen. Geef het alsjeblieft niet door!", + "link-hint": "Attentie: Ledereen kan deze link inwisselen. Wees er voorzichtig mee!", "link-overview": "Overzicht links", "links_count": "Actieve links", "links_sum": "Open links en QR-Codes", From 5e8af000f4336e395c10eda94584b35d111bf07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 2 Jan 2023 14:56:46 +0100 Subject: [PATCH 3/7] Fix tests for email 'transactionLinkRedeemed' --- backend/src/emails/sendEmailVariants.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/emails/sendEmailVariants.test.ts b/backend/src/emails/sendEmailVariants.test.ts index 9396c2b13..6dbde1196 100644 --- a/backend/src/emails/sendEmailVariants.test.ts +++ b/backend/src/emails/sendEmailVariants.test.ts @@ -563,18 +563,18 @@ describe('sendEmailVariants', () => { to: 'Peter Lustig ', from: 'Gradido (do not answer) ', attachments: [], - subject: 'Gradido: Your Gradido link has been redeemed', + subject: 'Gradido: Bibi Bloxberg has redeemed your Gradido link', html: expect.any(String), - text: expect.stringContaining('GRADIDO: YOUR GRADIDO LINK HAS BEEN REDEEMED'), + text: expect.stringContaining('BIBI BLOXBERG HAS REDEEMED YOUR GRADIDO LINK'), }), }) expect(result.originalMessage.html).toContain('') expect(result.originalMessage.html).toContain('') expect(result.originalMessage.html).toContain( - 'Gradido: Your Gradido link has been redeemed', + 'Gradido: Bibi Bloxberg has redeemed your Gradido link', ) expect(result.originalMessage.html).toContain( - '>Gradido: Your Gradido link has been redeemed', + '>Gradido: Bibi Bloxberg has redeemed your Gradido link', ) expect(result.originalMessage.html).toContain('Hello Peter Lustig') expect(result.originalMessage.html).toContain( From b64012195878c3522d49034d6733e278c73deaac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 2 Jan 2023 15:10:03 +0100 Subject: [PATCH 4/7] Fix test for year in footer --- frontend/src/components/ContentFooter.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/ContentFooter.spec.js b/frontend/src/components/ContentFooter.spec.js index c578d3fac..175ef347b 100644 --- a/frontend/src/components/ContentFooter.spec.js +++ b/frontend/src/components/ContentFooter.spec.js @@ -33,7 +33,7 @@ describe('ContentFooter', () => { }) it('renders the copyright year', () => { - expect(mocks.$t).toBeCalledWith('footer.copyright.year', { year: 2022 }) + expect(mocks.$t).toBeCalledWith('footer.copyright.year', { year: 2023 }) }) it('renders a link to Gradido-Akademie', () => { From 347e937d6b4ed2ce50abe87e34d97a3a1ba18448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 2 Jan 2023 15:31:09 +0100 Subject: [PATCH 5/7] Fix backend test 'run two hours forward to be in the next month in UTC' > 'has the clock set correctly' by adding a '0' in front of the month if '< 10' --- backend/src/graphql/resolver/util/creations.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/graphql/resolver/util/creations.test.ts b/backend/src/graphql/resolver/util/creations.test.ts index 6be317e16..e9c1997f6 100644 --- a/backend/src/graphql/resolver/util/creations.test.ts +++ b/backend/src/graphql/resolver/util/creations.test.ts @@ -183,8 +183,10 @@ describe('util/creation', () => { }) it('has the clock set correctly', () => { + const targetMonth = targetDate.getMonth() + 1 + const targetMonthString = (targetMonth < 10 ? '0' : '') + String(targetMonth) expect(new Date().toISOString()).toContain( - `${targetDate.getFullYear()}-${targetDate.getMonth() + 1}-${targetDate.getDate()}T23:`, + `${targetDate.getFullYear()}-${targetMonthString}-${targetDate.getDate()}T23:`, ) }) From 77bfa5b5ef9a1f97e38837334ccbdcb70ff1117d Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 2 Jan 2023 17:46:39 +0100 Subject: [PATCH 6/7] expect current(local) year to be visible in the footer. --- frontend/src/components/ContentFooter.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/ContentFooter.spec.js b/frontend/src/components/ContentFooter.spec.js index c578d3fac..29d13bc28 100644 --- a/frontend/src/components/ContentFooter.spec.js +++ b/frontend/src/components/ContentFooter.spec.js @@ -32,8 +32,8 @@ describe('ContentFooter', () => { expect(wrapper.find('div.copyright').exists()).toBeTruthy() }) - it('renders the copyright year', () => { - expect(mocks.$t).toBeCalledWith('footer.copyright.year', { year: 2022 }) + it('renders the current year as copyright year', () => { + expect(mocks.$t).toBeCalledWith('footer.copyright.year', { year: new Date().getFullYear() }) }) it('renders a link to Gradido-Akademie', () => { From f83b9a762c564f3185423613ee01adf925e9191f Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 3 Jan 2023 12:41:42 +0100 Subject: [PATCH 7/7] also fix backend month test --- backend/src/graphql/resolver/util/creations.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/graphql/resolver/util/creations.test.ts b/backend/src/graphql/resolver/util/creations.test.ts index 6be317e16..d9ccf6936 100644 --- a/backend/src/graphql/resolver/util/creations.test.ts +++ b/backend/src/graphql/resolver/util/creations.test.ts @@ -183,8 +183,10 @@ describe('util/creation', () => { }) it('has the clock set correctly', () => { + const targetMonthString = + (targetDate.getMonth() + 1 < 10 ? '0' : '') + String(targetDate.getMonth() + 1) expect(new Date().toISOString()).toContain( - `${targetDate.getFullYear()}-${targetDate.getMonth() + 1}-${targetDate.getDate()}T23:`, + `${targetDate.getFullYear()}-${targetMonthString}-${targetDate.getDate()}T23:`, ) })