From 17ba78cc012cb1c3abe6eb132d6e1228ed95a2d4 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 15 Mar 2022 11:37:10 +0100 Subject: [PATCH 01/75] add query: listTransactionLinks --- frontend/src/graphql/queries.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index 5887d585a..6f67deee8 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -143,3 +143,17 @@ export const queryTransactionLink = gql` } } ` + +export const listTransactionLinks = gql` + query($currentPage: Int = 1, $pageSize: Int = 5, $order: Order = DESC) { + listTransactionLinks(currentPage: $currentPage, pageSize: $pageSize, order: $order) { + amount + holdAvailableAmount + memo + code + createdAt + validUntil + redeemedAt + } + } +` From e5dc99dad60526ab6bc8c0867de4c4f262dcb631 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 15 Mar 2022 11:38:35 +0100 Subject: [PATCH 02/75] add apollo funktion for query transactionLinkList --- frontend/src/components/GddTransactionList.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/GddTransactionList.vue b/frontend/src/components/GddTransactionList.vue index 9c7013ec5..da5f27add 100644 --- a/frontend/src/components/GddTransactionList.vue +++ b/frontend/src/components/GddTransactionList.vue @@ -43,7 +43,7 @@ From 83b1c4c9e19517bccd0e59ea8040888de07b6a18 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 15 Mar 2022 15:55:23 +0100 Subject: [PATCH 11/75] change position from visible on collapse in TransactionLinksSummary.vue --- .../src/components/Transactions/TransactionLinksSummary.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Transactions/TransactionLinksSummary.vue b/frontend/src/components/Transactions/TransactionLinksSummary.vue index d10311e3a..dff7cff3a 100644 --- a/frontend/src/components/Transactions/TransactionLinksSummary.vue +++ b/frontend/src/components/Transactions/TransactionLinksSummary.vue @@ -1,9 +1,9 @@ From 81df36a3fb65b4133e8edcd9f74934135b2f0f22 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 15 Mar 2022 17:15:47 +0100 Subject: [PATCH 14/75] ad function deleteLink and bvModal confirm --- .../TransactionLinks/TransactionLink.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/TransactionLinks/TransactionLink.vue b/frontend/src/components/TransactionLinks/TransactionLink.vue index 966fc3f54..d6dfb84f0 100644 --- a/frontend/src/components/TransactionLinks/TransactionLink.vue +++ b/frontend/src/components/TransactionLinks/TransactionLink.vue @@ -18,7 +18,7 @@ {{ $moment(item.validUntil).fromNow() }} kopieren - löschen + löschen @@ -41,7 +41,8 @@ export default { }, }) .then((result) => { - console.log(result.data) + this.toastSuccess('Link gelöscht') + this.$emit('update-list-transaction-links') }) .catch((err) => { this.toastError(err.message) @@ -58,6 +59,16 @@ export default { this.toastError(this.$t('gdd_per_link.not-copied')) }) }, + deleteLink(id) { + this.$bvModal + .msgBoxConfirm('Den Link löschen?') + .then(() => { + this.deleteTransactionLink(id) + }) + .catch((err) => { + console.log(err) + }) + }, }, } From baf4f66604a0f7d220e0e653974512d1fd32c4c9 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 15 Mar 2022 17:16:35 +0100 Subject: [PATCH 15/75] ad function updateListTransactionLinks on TransactionLinksSummary.vue --- .../Transactions/TransactionLinksSummary.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Transactions/TransactionLinksSummary.vue b/frontend/src/components/Transactions/TransactionLinksSummary.vue index dff7cff3a..c4496ed0d 100644 --- a/frontend/src/components/Transactions/TransactionLinksSummary.vue +++ b/frontend/src/components/Transactions/TransactionLinksSummary.vue @@ -24,7 +24,10 @@ - + @@ -69,7 +72,7 @@ export default { } }, methods: { - async listTransactionLinks() { + async updateListTransactionLinks() { this.$apollo .query({ query: listTransactionLinks, @@ -81,6 +84,7 @@ export default { }) .then((result) => { this.transactionLinks = result.data.listTransactionLinks + this.$emit('update-transactions') }) .catch((err) => { this.toastError(err.message) @@ -88,7 +92,7 @@ export default { }, }, created() { - this.listTransactionLinks() + this.updateListTransactionLinks() }, } From 9bd74cb1488bf76ed9bd0f7a150752fcd90b49f5 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 15 Mar 2022 17:18:32 +0100 Subject: [PATCH 16/75] yarn lint --fix --- frontend/src/components/TransactionLinks/TransactionLink.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/components/TransactionLinks/TransactionLink.vue b/frontend/src/components/TransactionLinks/TransactionLink.vue index d6dfb84f0..0ff13a1a0 100644 --- a/frontend/src/components/TransactionLinks/TransactionLink.vue +++ b/frontend/src/components/TransactionLinks/TransactionLink.vue @@ -65,9 +65,7 @@ export default { .then(() => { this.deleteTransactionLink(id) }) - .catch((err) => { - console.log(err) - }) + .catch(() => {}) }, }, } From 0f97dc60a35cf94a97fdeb152b2f8854aa0f0281 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 15 Mar 2022 22:13:50 +0100 Subject: [PATCH 17/75] Duplicate id app deleted --- frontend/public/index.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frontend/public/index.html b/frontend/public/index.html index a15b46916..b9abe3876 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -52,10 +52,6 @@ -
- -
- From fe733c3f7705a1afd95a969ccd787af5c4838121 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 15 Mar 2022 22:14:20 +0100 Subject: [PATCH 18/75] toast rendering error fixed --- frontend/src/mixins/toaster.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/mixins/toaster.js b/frontend/src/mixins/toaster.js index 68fd78ff9..f6e61e5be 100644 --- a/frontend/src/mixins/toaster.js +++ b/frontend/src/mixins/toaster.js @@ -14,7 +14,7 @@ export const toasters = { }, toast(message, options) { if (message.replace) message = message.replace(/^GraphQL error: /, '') - this.$bvToast.toast(message, { + this.$root.$bvToast.toast(message, { autoHideDelay: 5000, appendToast: true, solid: true, From cf601fc5b31842056f32af426d06d39cdcb8b262 Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 15 Mar 2022 22:15:30 +0100 Subject: [PATCH 19/75] toast rendering error fixed in adminarea --- admin/src/mixins/toaster.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/src/mixins/toaster.js b/admin/src/mixins/toaster.js index 9f79b91e8..2db632a81 100644 --- a/admin/src/mixins/toaster.js +++ b/admin/src/mixins/toaster.js @@ -15,7 +15,7 @@ export const toasters = { toast(message, options) { // for unit tests, check that replace is present if (message.replace) message = message.replace(/^GraphQL error: /, '') - this.$bvToast.toast(message, { + this.$root.$bvToast.toast(message, { autoHideDelay: 5000, appendToast: true, solid: true, From 90ce74a98c1a4d2f75c8ba2d1299b7eec5df7a66 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 16 Mar 2022 11:01:07 +0100 Subject: [PATCH 20/75] add variables pageSize --- frontend/src/graphql/queries.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index 0a309284e..141dc8651 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -145,8 +145,8 @@ export const queryTransactionLink = gql` ` export const listTransactionLinks = gql` - query($currentPage: Int = 1, $pageSize: Int = 5, $order: Order = DESC) { - listTransactionLinks(currentPage: $currentPage, pageSize: $pageSize, order: $order) { + query($currentPage: Int = 1, $pageSize: Int = 5) { + listTransactionLinks(currentPage: $currentPage, pageSize: $pageSize) { id amount holdAvailableAmount From 1a89d94bdaa5de8d3345bc09a4db5cb17ed0792b Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 16 Mar 2022 11:02:26 +0100 Subject: [PATCH 21/75] add varibles object, add computed and watch currentPage --- .../Transactions/TransactionLinksSummary.vue | 59 +++++++++++++------ 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/Transactions/TransactionLinksSummary.vue b/frontend/src/components/Transactions/TransactionLinksSummary.vue index c4496ed0d..5d5bf3c93 100644 --- a/frontend/src/components/Transactions/TransactionLinksSummary.vue +++ b/frontend/src/components/Transactions/TransactionLinksSummary.vue @@ -25,8 +25,9 @@ @@ -69,26 +70,50 @@ export default { return { visible: false, transactionLinks: [], + variables: { + currentPage: 1, + pending: false, + pageSize: 5, + itemsShown: 0, + }, } }, methods: { async updateListTransactionLinks() { - this.$apollo - .query({ - query: listTransactionLinks, - variables: { - currentPage: 1, - pageSize: 5, - }, - fetchPolicy: 'network-only', - }) - .then((result) => { - this.transactionLinks = result.data.listTransactionLinks - this.$emit('update-transactions') - }) - .catch((err) => { - this.toastError(err.message) - }) + if (this.currentPage === 0) { + this.transactionLinks = [] + this.variables.currentPage = 1 + } else { + this.variables.pending = true + this.$apollo + .query({ + query: listTransactionLinks, + variables: { + currentPage: this.currentPage, + }, + fetchPolicy: 'network-only', + }) + .then((result) => { + this.transactionLinks = [...this.transactionLinks, ...result.data.listTransactionLinks] + this.$emit('update-transactions') + this.variables.pending = false + this.variables.itemsShown = this.transactionLinks.length + }) + .catch((err) => { + this.toastError(err.message) + this.variables.pending = false + }) + } + }, + }, + computed: { + currentPage() { + return this.variables.currentPage + }, + }, + watch: { + currentPage() { + this.updateListTransactionLinks() }, }, created() { From e49543ad5522ca64cda7fca276b2afe45a69ddc4 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 16 Mar 2022 11:03:45 +0100 Subject: [PATCH 22/75] add function resetTransactionLinkList, loadMoreLinks and computed buttonText --- .../DecayInformations/CollapseLinksList.vue | 39 +++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/DecayInformations/CollapseLinksList.vue b/frontend/src/components/DecayInformations/CollapseLinksList.vue index 275615de1..7492532b6 100644 --- a/frontend/src/components/DecayInformations/CollapseLinksList.vue +++ b/frontend/src/components/DecayInformations/CollapseLinksList.vue @@ -14,8 +14,24 @@ v-for="item in transactionLinks" :key="item.id" v-bind:item="item" - @update-list-transaction-links="updateListTransactionLinks" + @reset-transaction-link-list="resetTransactionLinkList" /> +
+ + {{ buttonText }} + + +
@@ -30,10 +46,27 @@ export default { }, props: { transactionLinks: { type: Array, required: true }, + transactionLinkCount: { + type: Number, + required: true, + }, + value: { type: Object, required: true }, }, methods: { - updateListTransactionLinks() { - this.$emit('update-list-transaction-links') + resetTransactionLinkList() { + this.$emit('input', { ...this.value, currentPage: 0 }) + }, + loadMoreLinks() { + this.$emit('input', { ...this.value, currentPage: this.value.currentPage + 1 }) + }, + }, + computed: { + buttonText() { + if (this.transactionLinkCount - this.value.itemsShown > this.value.pageSize) + return 'weitere ' + this.value.pageSize + ' Links Nachladen' + return ( + 'die letzten ' + (this.transactionLinkCount - this.value.itemsShown) + ' Links nachladen' + ) }, }, } From b976e8441143e89ee8d0c4bc5cccccb7cd46167c Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 16 Mar 2022 11:05:08 +0100 Subject: [PATCH 23/75] refactor modal, deleteLink emit reset-transaction-link-list --- .../TransactionLinks/TransactionLink.vue | 50 +++++++------------ 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/TransactionLinks/TransactionLink.vue b/frontend/src/components/TransactionLinks/TransactionLink.vue index 0ff13a1a0..b8247c7fc 100644 --- a/frontend/src/components/TransactionLinks/TransactionLink.vue +++ b/frontend/src/components/TransactionLinks/TransactionLink.vue @@ -1,16 +1,5 @@