From d4ce46b271bc2e859b629f93feea9cddc2069dde Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 9 Mar 2022 16:34:54 +0100 Subject: [PATCH 1/8] update db version --- backend/src/config/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 82fb9ff2b..4cd428153 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -10,7 +10,7 @@ Decimal.set({ }) const constants = { - DB_VERSION: '0029-clean_transaction_table', + DB_VERSION: '0030-transaction_link', DECAY_START_TIME: new Date('2021-05-13 17:46:31'), // GMT+0 } From 01648aaa0d5d84676bbede8cc9c8a7c4ac313ce9 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 9 Mar 2022 16:51:17 +0100 Subject: [PATCH 2/8] add soft delete for transaction links --- database/entity/0030-transaction_link/TransactionLink.ts | 5 ++++- database/migrations/0030-transaction_link.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/database/entity/0030-transaction_link/TransactionLink.ts b/database/entity/0030-transaction_link/TransactionLink.ts index bb12277d1..6ea708547 100644 --- a/database/entity/0030-transaction_link/TransactionLink.ts +++ b/database/entity/0030-transaction_link/TransactionLink.ts @@ -1,5 +1,5 @@ import Decimal from 'decimal.js-light' -import { BaseEntity, Entity, PrimaryGeneratedColumn, Column } from 'typeorm' +import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, DeleteDateColumn } from 'typeorm' import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer' @Entity('transaction_links') @@ -41,6 +41,9 @@ export class TransactionLink extends BaseEntity { }) createdAt: Date + @DeleteDateColumn() + deletedAt?: Date | null + @Column({ type: 'datetime', nullable: false, diff --git a/database/migrations/0030-transaction_link.ts b/database/migrations/0030-transaction_link.ts index 4d72cf43b..ee76c980d 100644 --- a/database/migrations/0030-transaction_link.ts +++ b/database/migrations/0030-transaction_link.ts @@ -13,6 +13,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis \`memo\` varchar(255) NOT NULL, \`code\` varchar(24) NOT NULL, \`createdAt\` datetime NOT NULL, + \`deletedAt\` datetime DEFAULT NULL, \`validUntil\` datetime NOT NULL, \`showEmail\` boolean NOT NULL DEFAULT false, \`redeemedAt\` datetime, From f96177285471bac61f8533cdc203873ea1ee1f0d Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 9 Mar 2022 16:51:56 +0100 Subject: [PATCH 3/8] add soft delete to transaction link model --- backend/src/graphql/model/TransactionLink.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/graphql/model/TransactionLink.ts b/backend/src/graphql/model/TransactionLink.ts index f449a6f9e..0f19df466 100644 --- a/backend/src/graphql/model/TransactionLink.ts +++ b/backend/src/graphql/model/TransactionLink.ts @@ -25,6 +25,9 @@ export class TransactionLink { @Field(() => Date) createdAt: Date + @Field(() => Date, { nullable: true }) + deletedAt: Date | null + @Field(() => Date) validUntil: Date From dbb42c30ec988e82de161f1886a838af808a076c Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 9 Mar 2022 17:07:32 +0100 Subject: [PATCH 4/8] increase timeout by factoe 100 --- backend/src/graphql/resolver/UserResolver.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/graphql/resolver/UserResolver.test.ts b/backend/src/graphql/resolver/UserResolver.test.ts index 9f3d7265f..05ff2b302 100644 --- a/backend/src/graphql/resolver/UserResolver.test.ts +++ b/backend/src/graphql/resolver/UserResolver.test.ts @@ -12,7 +12,7 @@ import CONFIG from '@/config' import { sendAccountActivationEmail } from '@/mailer/sendAccountActivationEmail' // import { klicktippSignIn } from '@/apis/KlicktippController' -jest.setTimeout(10000) +jest.setTimeout(1000000) jest.mock('@/mailer/sendAccountActivationEmail', () => { return { From b97837d41517c91b5e36984af1e4b379e2827117 Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 10 Mar 2022 10:34:48 +0100 Subject: [PATCH 5/8] test data for displaySetup in ShowTransactionLinkInformations.vue --- .../pages/ShowTransactionLinkInformations.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/ShowTransactionLinkInformations.vue b/frontend/src/pages/ShowTransactionLinkInformations.vue index c56db14d6..b3ddd287c 100644 --- a/frontend/src/pages/ShowTransactionLinkInformations.vue +++ b/frontend/src/pages/ShowTransactionLinkInformations.vue @@ -4,6 +4,7 @@
+
resultDB : {{ resultDB }}

{{ displaySetup.user.firstName }} {{ displaySetup.user.lastName }} {{ $t('wants to send you') }} {{ displaySetup.amount | GDD }} @@ -25,7 +26,16 @@ export default { name: 'ShowTransactionLinkInformations', data() { return { - displaySetup: {}, + resultDB: {}, + displaySetup: { + amount: '123456', + linkTo: '', + user: { + publisherId: 1, + firstName: 'testName', + lastName: 'testOgerly', + }, + }, } }, methods: { @@ -41,6 +51,7 @@ export default { const { data: { queryTransactionLink }, } = result + this.resultDB = queryTransactionLink this.displaySetup = queryTransactionLink this.$store.commit('publisherId', queryTransactionLink.user.publisherId) }) @@ -50,7 +61,8 @@ export default { }, }, created() { - this.setDisplaySetup() + this.setTransactionLinkInformation() + this.displaySetup.linkTo = this.$route.params.code }, } From cec79d462ff916cd1ca5970dfe4b428973a09941 Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 10 Mar 2022 10:50:01 +0100 Subject: [PATCH 6/8] add locales for transaction-link, add default datas for ShowTransactionLinkInformations --- frontend/src/locales/de.json | 5 +++++ frontend/src/locales/en.json | 5 +++++ frontend/src/pages/ShowTransactionLinkInformations.vue | 8 +++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 21cfc44cb..8b0cccf7f 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -46,6 +46,11 @@ "total": "Gesamt", "year": "Jahre" }, + "transaction-link": { + "send_you":"sendet dir", + "subtitle":"subtitle", + "button":"einlösen" + }, "error": { "change-password": "Fehler beim Ändern des Passworts", "empty-transactionlist": "Es gab einen Fehler mit der Übermittlung der Anzahl deiner Transaktionen.", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 3014570ad..1c7c2595d 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -46,6 +46,11 @@ "total": "Total", "year": "Years" }, + "transaction-link": { + "send_you":"wants to send you", + "subtitle":"subtitle", + "button":"redeem" + }, "error": { "change-password": "Error while changing password", "empty-transactionlist": "There was an error with the transmission of the number of your transactions.", diff --git a/frontend/src/pages/ShowTransactionLinkInformations.vue b/frontend/src/pages/ShowTransactionLinkInformations.vue index b3ddd287c..2490aec99 100644 --- a/frontend/src/pages/ShowTransactionLinkInformations.vue +++ b/frontend/src/pages/ShowTransactionLinkInformations.vue @@ -7,12 +7,12 @@

resultDB : {{ resultDB }}

{{ displaySetup.user.firstName }} {{ displaySetup.user.lastName }} - {{ $t('wants to send you') }} {{ displaySetup.amount | GDD }} + {{ $t('transaction-link.send_you') }} {{ displaySetup.amount | GDD }}

-

{{ $t(displaySetup.subtitle) }}

+

{{ displaySetup.memo }}


- {{ $t(displaySetup.button) }} + {{ $t('transaction-link.button') }}
@@ -30,10 +30,12 @@ export default { displaySetup: { amount: '123456', linkTo: '', + memo: 'Test Memo, Test Memo von Ogerly, Test Memo von Ogerly für testuser', user: { publisherId: 1, firstName: 'testName', lastName: 'testOgerly', + email: 'test@example.de', }, }, } From f4b5961c3852b20c299a8ee2d776f7d82002586a Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 10 Mar 2022 10:51:24 +0100 Subject: [PATCH 7/8] yarn lint --fix --- frontend/src/pages/Send.vue | 3 +-- frontend/src/pages/ShowTransactionLinkInformations.spec.js | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/pages/Send.vue b/frontend/src/pages/Send.vue index 56c31026c..55fa013ca 100644 --- a/frontend/src/pages/Send.vue +++ b/frontend/src/pages/Send.vue @@ -77,7 +77,6 @@ export default { this.currentTransactionStep = 1 }, async sendTransaction() { - console.log('TESTETESTESTES') this.loading = true this.error = false if (this.transactionData.selected === 'send') { @@ -101,7 +100,7 @@ export default { variables: { amount: this.transactionData.amount, memo: this.transactionData.memo }, }) .then((result) => { - console.log(result) + alert(result) }) .catch((error) => { this.toastError(error) diff --git a/frontend/src/pages/ShowTransactionLinkInformations.spec.js b/frontend/src/pages/ShowTransactionLinkInformations.spec.js index 8b1378917..e69de29bb 100644 --- a/frontend/src/pages/ShowTransactionLinkInformations.spec.js +++ b/frontend/src/pages/ShowTransactionLinkInformations.spec.js @@ -1 +0,0 @@ - From d24830bdb28b019aa38439d0c201e4f140f8dc27 Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 10 Mar 2022 10:51:44 +0100 Subject: [PATCH 8/8] yarn locales --fix --- frontend/src/locales/de.json | 10 +++++----- frontend/src/locales/en.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 8b0cccf7f..8a49c3016 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -46,11 +46,6 @@ "total": "Gesamt", "year": "Jahre" }, - "transaction-link": { - "send_you":"sendet dir", - "subtitle":"subtitle", - "button":"einlösen" - }, "error": { "change-password": "Fehler beim Ändern des Passworts", "empty-transactionlist": "Es gab einen Fehler mit der Übermittlung der Anzahl deiner Transaktionen.", @@ -237,6 +232,11 @@ "receiverNotFound": "Empfänger nicht gefunden", "show_all": "Alle {count} Transaktionen ansehen" }, + "transaction-link": { + "button": "einlösen", + "send_you": "sendet dir", + "subtitle": "subtitle" + }, "transactions": "Transaktionen", "whitepaper": "Whitepaper" } diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 1c7c2595d..ca66bfe35 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -46,11 +46,6 @@ "total": "Total", "year": "Years" }, - "transaction-link": { - "send_you":"wants to send you", - "subtitle":"subtitle", - "button":"redeem" - }, "error": { "change-password": "Error while changing password", "empty-transactionlist": "There was an error with the transmission of the number of your transactions.", @@ -237,6 +232,11 @@ "receiverNotFound": "Recipient not found", "show_all": "View all {count} transactions." }, + "transaction-link": { + "button": "redeem", + "send_you": "wants to send you", + "subtitle": "subtitle" + }, "transactions": "Transactions", "whitepaper": "Whitepaper" }