From 09d751076e735a3880649f5bb267914bf8e6df01 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 23 Feb 2021 06:45:09 +0100 Subject: [PATCH] Single event --- frontend/src/components/transactions/Create.vue | 15 +-------------- .../components/transactions/TransactionAmount.vue | 2 +- .../components/transactions/TransactionBill.vue | 2 +- .../components/transactions/TransactionBudget.vue | 2 +- .../transactions/TransactionCategory.vue | 2 +- .../transactions/TransactionCustomDates.vue | 2 +- .../transactions/TransactionDescription.vue | 2 +- .../transactions/TransactionExternalUrl.vue | 2 +- .../transactions/TransactionForeignAmount.vue | 2 +- .../transactions/TransactionForeignCurrency.vue | 2 +- .../transactions/TransactionInternalReference.vue | 2 +- .../components/transactions/TransactionLinks.vue | 2 +- .../components/transactions/TransactionNotes.vue | 2 +- .../transactions/TransactionPiggyBank.vue | 2 +- .../components/transactions/TransactionTags.vue | 2 +- 15 files changed, 15 insertions(+), 28 deletions(-) diff --git a/frontend/src/components/transactions/Create.vue b/frontend/src/components/transactions/Create.vue index 075a077b84..244c64ee14 100644 --- a/frontend/src/components/transactions/Create.vue +++ b/frontend/src/components/transactions/Create.vue @@ -38,20 +38,7 @@ v-on:switch-accounts="switchAccounts($event)" v-on:set-date="storeDate($event)" v-on:set-time="storeTime($event)" - v-on:set-amount="storeField($event)" - v-on:set-foreign-currency-id="storeField($event)" - v-on:set-foreign-amount="storeField($event)" - v-on:set-custom-date="storeField($event)" - v-on:set-budget="storeField($event)" - v-on:set-category="storeField($event)" - v-on:set-bill="storeField($event)" - v-on:set-tags="storeField($event)" - v-on:set-piggy-bank="storeField($event)" - v-on:set-internal-reference="storeField($event)" - v-on:set-external-url="storeField($event)" - v-on:set-notes="storeField($event)" - v-on:set-links="storeField($event)" - v-on:set-description="storeField($event)" + v-on:set-field="storeField($event)" /> diff --git a/frontend/src/components/transactions/TransactionAmount.vue b/frontend/src/components/transactions/TransactionAmount.vue index 1f2d43f5c6..8fc4b4a86c 100644 --- a/frontend/src/components/transactions/TransactionAmount.vue +++ b/frontend/src/components/transactions/TransactionAmount.vue @@ -60,7 +60,7 @@ export default { }, watch: { transactionAmount: function (value) { - this.$emit('set-amount', {field: 'amount', index: this.index, value: value}); + this.$emit('set-field', {field: 'amount', index: this.index, value: value}); }, amount: function (value) { this.transactionAmount = value; diff --git a/frontend/src/components/transactions/TransactionBill.vue b/frontend/src/components/transactions/TransactionBill.vue index 35f9c290e7..e58a0d7bff 100644 --- a/frontend/src/components/transactions/TransactionBill.vue +++ b/frontend/src/components/transactions/TransactionBill.vue @@ -89,7 +89,7 @@ export default { }, watch: { bill: function (value) { - this.$emit('set-bill', {field: 'bill_id', index: this.index, value: value}); + this.$emit('set-field', {field: 'bill_id', index: this.index, value: value}); } }, } diff --git a/frontend/src/components/transactions/TransactionBudget.vue b/frontend/src/components/transactions/TransactionBudget.vue index 4eeb2d385c..a9b4718527 100644 --- a/frontend/src/components/transactions/TransactionBudget.vue +++ b/frontend/src/components/transactions/TransactionBudget.vue @@ -88,7 +88,7 @@ export default { }, watch: { budget: function (value) { - this.$emit('set-budget', {field: 'budget_id', index: this.index, value: value}); + this.$emit('set-field', {field: 'budget_id', index: this.index, value: value}); } }, } diff --git a/frontend/src/components/transactions/TransactionCategory.vue b/frontend/src/components/transactions/TransactionCategory.vue index 76e1314080..ab7125ce05 100644 --- a/frontend/src/components/transactions/TransactionCategory.vue +++ b/frontend/src/components/transactions/TransactionCategory.vue @@ -93,7 +93,7 @@ export default { }, watch: { category: function (value) { - this.$emit('set-category', {field: 'category', index: this.index, value: value}); + this.$emit('set-field', {field: 'category', index: this.index, value: value}); } }, computed: { diff --git a/frontend/src/components/transactions/TransactionCustomDates.vue b/frontend/src/components/transactions/TransactionCustomDates.vue index 6457a3e738..a1f7eef72f 100644 --- a/frontend/src/components/transactions/TransactionCustomDates.vue +++ b/frontend/src/components/transactions/TransactionCustomDates.vue @@ -84,7 +84,7 @@ export default { return this.dates[field] ?? ''; }, setFieldValue(event, field) { - this.$emit('set-custom-date', {field: field, index: this.index, value: event.target.value}); + this.$emit('set-field', {field: field, index: this.index, value: event.target.value}); }, } } diff --git a/frontend/src/components/transactions/TransactionDescription.vue b/frontend/src/components/transactions/TransactionDescription.vue index 1446014229..182afd3f99 100644 --- a/frontend/src/components/transactions/TransactionDescription.vue +++ b/frontend/src/components/transactions/TransactionDescription.vue @@ -86,7 +86,7 @@ export default { }, watch: { description: function (value) { - this.$emit('set-description', {field: 'description', index: this.index, value: value}); + this.$emit('set-field', {field: 'description', index: this.index, value: value}); // } }, diff --git a/frontend/src/components/transactions/TransactionExternalUrl.vue b/frontend/src/components/transactions/TransactionExternalUrl.vue index fcf21c7e6d..be7a9ba80f 100644 --- a/frontend/src/components/transactions/TransactionExternalUrl.vue +++ b/frontend/src/components/transactions/TransactionExternalUrl.vue @@ -62,7 +62,7 @@ export default { this.availableFields = value; }, url: function (value) { - this.$emit('set-external-url', {field: 'external_url', index: index, value: value}); + this.$emit('set-field', {field: 'external_url', index: index, value: value}); } } } diff --git a/frontend/src/components/transactions/TransactionForeignAmount.vue b/frontend/src/components/transactions/TransactionForeignAmount.vue index 6b9ba20a93..ff6bf09a34 100644 --- a/frontend/src/components/transactions/TransactionForeignAmount.vue +++ b/frontend/src/components/transactions/TransactionForeignAmount.vue @@ -59,7 +59,7 @@ export default { }, watch: { amount: function(value) { - this.$emit('set-foreign-amount', {field: 'foreign_amount', index: this.index, value: value}); + this.$emit('set-field', {field: 'foreign_amount', index: this.index, value: value}); } }, computed: { diff --git a/frontend/src/components/transactions/TransactionForeignCurrency.vue b/frontend/src/components/transactions/TransactionForeignCurrency.vue index 3f4aca0258..3fae45906e 100644 --- a/frontend/src/components/transactions/TransactionForeignCurrency.vue +++ b/frontend/src/components/transactions/TransactionForeignCurrency.vue @@ -58,7 +58,7 @@ export default { this.dstCurrencyId = value; }, selectedCurrency: function(value) { - this.$emit('set-foreign-currency-id',{field: 'foreign_currency_id', index: this.index, value: value}); + this.$emit('set-field',{field: 'foreign_currency_id', index: this.index, value: value}); }, transactionType: function (value) { this.lockedCurrency = 0; diff --git a/frontend/src/components/transactions/TransactionInternalReference.vue b/frontend/src/components/transactions/TransactionInternalReference.vue index a5280767bf..24ad09ed88 100644 --- a/frontend/src/components/transactions/TransactionInternalReference.vue +++ b/frontend/src/components/transactions/TransactionInternalReference.vue @@ -63,7 +63,7 @@ export default { this.availableFields = value; }, reference: function (value) { - this.$emit('set-internal-reference', {field: 'internal_reference', index: this.index, value: value}); + this.$emit('set-field', {field: 'internal_reference', index: this.index, value: value}); } } } diff --git a/frontend/src/components/transactions/TransactionLinks.vue b/frontend/src/components/transactions/TransactionLinks.vue index 36e7c2fae9..fee4115422 100644 --- a/frontend/src/components/transactions/TransactionLinks.vue +++ b/frontend/src/components/transactions/TransactionLinks.vue @@ -216,7 +216,7 @@ export default { }, watch: { links: function (value) { - this.$emit('set-links', {index: this.index, field: 'links', value: lodashClonedeep(value)}); + this.$emit('set-field', {index: this.index, field: 'links', value: lodashClonedeep(value)}); }, customFields: function (value) { this.availableFields = value; diff --git a/frontend/src/components/transactions/TransactionNotes.vue b/frontend/src/components/transactions/TransactionNotes.vue index d0005ab3a9..92bd7caf94 100644 --- a/frontend/src/components/transactions/TransactionNotes.vue +++ b/frontend/src/components/transactions/TransactionNotes.vue @@ -58,7 +58,7 @@ export default { this.availableFields = value; }, notes: function (value) { - this.$emit('set-notes', {field: 'notes', index: this.index, value: value}); + this.$emit('set-field', {field: 'notes', index: this.index, value: value}); } } } diff --git a/frontend/src/components/transactions/TransactionPiggyBank.vue b/frontend/src/components/transactions/TransactionPiggyBank.vue index 014626e27a..7a17a3727c 100644 --- a/frontend/src/components/transactions/TransactionPiggyBank.vue +++ b/frontend/src/components/transactions/TransactionPiggyBank.vue @@ -90,7 +90,7 @@ export default { }, watch: { piggy_bank_id: function (value) { - this.$emit('set-piggy-bank', {field: 'piggy_bank_id', index: this.index, value: value}); + this.$emit('set-field', {field: 'piggy_bank_id', index: this.index, value: value}); } } } diff --git a/frontend/src/components/transactions/TransactionTags.vue b/frontend/src/components/transactions/TransactionTags.vue index 26f59d7765..0cfb2ddce1 100644 --- a/frontend/src/components/transactions/TransactionTags.vue +++ b/frontend/src/components/transactions/TransactionTags.vue @@ -63,7 +63,7 @@ export default { watch: { 'currentTag': 'initItems', tagList: function (value) { - this.$emit('set-tags', {field: 'tags', index: this.index, value: value}); + this.$emit('set-field', {field: 'tags', index: this.index, value: value}); this.updateTags = false; this.tags = value; },