From 000ac24865cf54194a281ae75d1c33fe64712d6f Mon Sep 17 00:00:00 2001 From: elweyn Date: Sat, 1 Jul 2023 11:53:54 +0200 Subject: [PATCH 1/6] Test that their is no email send after a moderator message. --- .../graphql/resolver/ContributionMessageResolver.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/graphql/resolver/ContributionMessageResolver.test.ts b/backend/src/graphql/resolver/ContributionMessageResolver.test.ts index 12df7f056..e4929483f 100644 --- a/backend/src/graphql/resolver/ContributionMessageResolver.test.ts +++ b/backend/src/graphql/resolver/ContributionMessageResolver.test.ts @@ -219,6 +219,10 @@ describe('ContributionMessageResolver', () => { }) describe('contribution message type MODERATOR', () => { + beforeAll(() => { + jest.clearAllMocks() + }) + it('creates ContributionMessage', async () => { await expect( mutate({ @@ -243,6 +247,10 @@ describe('ContributionMessageResolver', () => { }), ) }) + + it("don't call sendAddedContributionMessageEmail", () => { + expect(sendAddedContributionMessageEmail).not.toBeCalled() + }) }) }) }) From 0b4d7181be9ddacdd7dd35a1074697c7dff17b4c Mon Sep 17 00:00:00 2001 From: elweyn Date: Sat, 1 Jul 2023 11:54:24 +0200 Subject: [PATCH 2/6] Check that the message type is not MODERATOR before sending email. --- .../resolver/ContributionMessageResolver.ts | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/backend/src/graphql/resolver/ContributionMessageResolver.ts b/backend/src/graphql/resolver/ContributionMessageResolver.ts index 05a4c5033..0cbc2446c 100644 --- a/backend/src/graphql/resolver/ContributionMessageResolver.ts +++ b/backend/src/graphql/resolver/ContributionMessageResolver.ts @@ -167,15 +167,17 @@ export class ContributionMessageResolver { await queryRunner.manager.update(DbContribution, { id: contributionId }, contribution) } - void sendAddedContributionMessageEmail({ - firstName: contribution.user.firstName, - lastName: contribution.user.lastName, - email: contribution.user.emailContact.email, - language: contribution.user.language, - senderFirstName: moderator.firstName, - senderLastName: moderator.lastName, - contributionMemo: contribution.memo, - }) + if (messageType !== ContributionMessageType.MODERATOR) { + void sendAddedContributionMessageEmail({ + firstName: contribution.user.firstName, + lastName: contribution.user.lastName, + email: contribution.user.emailContact.email, + language: contribution.user.language, + senderFirstName: moderator.firstName, + senderLastName: moderator.lastName, + contributionMemo: contribution.memo, + }) + } await queryRunner.commitTransaction() await EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE( { id: contribution.userId } as DbUser, From f4b537c08c884eaf4e6e687da23f1b49b08fdc2a Mon Sep 17 00:00:00 2001 From: elweyn Date: Sat, 1 Jul 2023 12:14:57 +0200 Subject: [PATCH 3/6] Add alias to the verifyLogin grqphql answer. --- frontend/src/graphql/queries.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index 49975b0a2..465672f2f 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -4,6 +4,7 @@ export const verifyLogin = gql` query { verifyLogin { gradidoID + alias firstName lastName language From c369c42093a2809e0bb0949548c2fc911a79f708 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 3 Jul 2023 08:01:29 +0200 Subject: [PATCH 4/6] date from deploy changed to infotext --- frontend/src/assets/News/news.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/assets/News/news.json b/frontend/src/assets/News/news.json index e10bcc890..259a8d0f0 100644 --- a/frontend/src/assets/News/news.json +++ b/frontend/src/assets/News/news.json @@ -1,35 +1,35 @@ [ { "locale": "de", - "date": "13. juni 2023", + "date": "4. juni 2023", "text": "Neue Funktion verfügbar: Jetzt Benutzernamen eintragen!", "url": "/settings", "extra": "Deine persönlichen Daten sind uns wichtig, und wir legen großen Wert auf deren Schutz. Wir wissen, dass nicht jeder seine E-Mail-Adresse anderen Benutzern preisgeben möchte. Aus diesem Grund kannst du nun einen Benutzernamen deiner Wahl in den Einstellungen angeben. Dies ist auch ein wichtiger Bestandteil unserer Vorbereitung für die bevorstehende Einführung unserer dezentralen Community-Server." }, { "locale": "en", - "date": "13 june 2023", + "date": "4 july 2023", "text": "New function available: Enter username now!", "url": "/settings", "extra": "Your personal information is important to us, and we take great care to protect it. We know that not everyone wants to reveal their email address to other users. For this reason, you can now enter a username of your choice in the settings. This is also an important part of our preparation for the upcoming launch of our decentralized community servers." }, { "locale": "fr", - "date": "13 juin 2023", + "date": "4 juillet 2023", "text": "Nouvelle fonction disponible : Saisis ton nom d'utilisateur maintenant !", "url": "/settings", "extra": "Tes données personnelles sont importantes pour nous et nous attachons une grande importance à leur protection. Nous savons que certains ne souhaitent pas divulguer leur adresse e-mail à d'autres utilisateurs. C'est pourquoi tu peux désormais indiquer un nom d'utilisateur de ton choix dans les paramètres. Il s'agit également d'un élément important de notre préparation à l'introduction prochaine de nos serveurs communautaires décentralisés." }, { "locale": "es", - "date": "13 junio 20233", + "date": "4 julio 20233", "text": "Nueva función disponible: Introduzca ahora su nombre de usuario", "url": "/settings", "extra": "Sus datos personales son importantes para nosotros y concedemos gran importancia a su protección. Sabemos que no todo el mundo quiere revelar su dirección de correo electrónico a otros usuarios. Por este motivo, ahora puede introducir un nombre de usuario de su elección en los ajustes. Esto es también una parte importante de nuestra preparación para el próximo lanzamiento de nuestros servidores comunitarios descentralizados." }, { "locale": "nl", - "date": "13 juni 2023", + "date": "4 juli 2023", "text": "Nieuwe functie beschikbaar: Voer nu je gebruikersnaam in!", "url": "/settings", "extra": "Je persoonlijke gegevens zijn belangrijk voor ons en we hechten veel belang aan de bescherming ervan. We weten dat niet iedereen zijn e-mailadres bekend wil maken aan andere gebruikers. Daarom kun je nu een gebruikersnaam naar keuze invoeren in de instellingen. Dit is ook een belangrijk onderdeel van onze voorbereiding op de komende lancering van onze gedecentraliseerde community servers." From 258874dd86d4eb5f0a68f21015f5389c026e5fa3 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 3 Jul 2023 11:52:45 +0200 Subject: [PATCH 5/6] changes incorporated --- frontend/src/components/Inputs/InputUsername.vue | 2 +- frontend/src/components/UserSettings/UserName.vue | 8 ++++++-- frontend/src/locales/de.json | 1 + frontend/src/locales/en.json | 3 ++- frontend/src/pages/Settings.vue | 4 ++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/Inputs/InputUsername.vue b/frontend/src/components/Inputs/InputUsername.vue index 4354d0c1d..e19b1ea91 100644 --- a/frontend/src/components/Inputs/InputUsername.vue +++ b/frontend/src/components/Inputs/InputUsername.vue @@ -9,7 +9,7 @@ vid="username" v-slot="{ errors, valid, validated, ariaInput, ariaMsg }" > - +
- + - +
diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 215898046..40b24332e 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -292,6 +292,7 @@ "warningText": "Bist du noch da?" }, "settings": { + "usernameInfo": "Kann nach dem speichern nicht mehr geändert werden!", "emailInfo": "Kann aktuell noch nicht geändert werden.", "hideAmountGDD": "Dein GDD Betrag ist versteckt.", "hideAmountGDT": "Dein GDT Betrag ist versteckt.", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index df87bbccf..c2cc0d35c 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -292,7 +292,8 @@ "warningText": "Are you still there?" }, "settings": { - "emailInfo": "NCannot be changed at this time.", + "usernameInfo": "Cannot be changed after saving!", + "emailInfo": "Cannot be changed at this time.", "hideAmountGDD": "Your GDD amount is hidden.", "hideAmountGDT": "Your GDT amount is hidden.", "info": "Transactions can now be made by username or email address.", diff --git a/frontend/src/pages/Settings.vue b/frontend/src/pages/Settings.vue index c1377c97b..1530e5e97 100644 --- a/frontend/src/pages/Settings.vue +++ b/frontend/src/pages/Settings.vue @@ -1,7 +1,7 @@