diff --git a/frontend/components/accountEditor.vue b/frontend/components/accountEditor.vue new file mode 100644 index 0000000..1140b3a --- /dev/null +++ b/frontend/components/accountEditor.vue @@ -0,0 +1,153 @@ + + + diff --git a/frontend/components/accountOverview.vue b/frontend/components/accountOverview.vue index d8bebb4..71ad5e8 100644 --- a/frontend/components/accountOverview.vue +++ b/frontend/components/accountOverview.vue @@ -2,8 +2,17 @@
-
- {{ accountIdToName[accountId] }} +
+ +
@@ -313,12 +328,13 @@ /* eslint-disable sort-imports */ import { Modal } from 'bootstrap' +import accountEditor from './accountEditor.vue' import { formatNumber } from '../helpers' import rangeSelector from './rangeSelector.vue' import txEditor from './txEditor.vue' export default { - components: { rangeSelector, txEditor }, + components: { accountEditor, rangeSelector, txEditor }, computed: { account() { @@ -345,6 +361,13 @@ export default { return cats }, + editedAcc() { + if (!this.editedAccId) { + return null + } + return this.accounts.filter(acc => acc.id === this.editedAccId)[0] || null + }, + selectedTx() { return Object.entries(this.selectedTxRaw) .filter(e => e[1]) @@ -392,6 +415,7 @@ export default { data() { return { + editedAccId: null, editedTxId: null, modals: { @@ -410,6 +434,8 @@ export default { } }, + emits: ['update-accounts'], + methods: { deleteSelected() { const actions = [] diff --git a/frontend/components/budgetDashboard.vue b/frontend/components/budgetDashboard.vue index 88d4b9a..41fb16c 100644 --- a/frontend/components/budgetDashboard.vue +++ b/frontend/components/budgetDashboard.vue @@ -49,7 +49,16 @@ v-for="cat in categories" :key="cat.id" > - {{ cat.name }} + + + {{ cat.name }} + + {{ formatNumber(allocatedByCategory[cat.id] || 0) }} € @@ -170,6 +179,12 @@
+ + @@ -177,12 +192,13 @@ /* eslint-disable sort-imports */ import { Modal } from 'bootstrap' +import accountEditor from './accountEditor.vue' import { formatNumber } from '../helpers' import rangeSelector from './rangeSelector.vue' import { unallocatedMoneyAcc } from '../constants' export default { - components: { rangeSelector }, + components: { accountEditor, rangeSelector }, computed: { activityByCategory() { @@ -211,6 +227,13 @@ export default { return accounts }, + editedAcc() { + if (!this.editedAccId) { + return null + } + return this.accounts.filter(acc => acc.id === this.editedAccId)[0] || null + }, + transferModalValid() { if (!this.modals.createTransfer.from || !this.modals.createTransfer.to) { return false @@ -254,6 +277,8 @@ export default { data() { return { + editedAccId: null, + modals: { createTransfer: { amount: 0, @@ -267,6 +292,8 @@ export default { } }, + emits: ['update-accounts'], + methods: { fetchTransactions() { const since = this.timeRange.start.toISOString()