Skip to content

Open source personal finance application

fix wallets sorting, change wallets total logic

ilkome5af97aeddb84
diff --git a/components/layout/LayoutMobile.vue b/components/layout/LayoutMobile.vue
index 32b6c74e..ce22c1a8 100644
--- a/components/layout/LayoutMobile.vue
+++ b/components/layout/LayoutMobile.vue
@@ -84,7 +84,7 @@ export default {
//- wallets sort
transition(name="animation-tab")
.tab(v-if="activeTab === 'walletsSort'")
- walletsSort
+ WalletsSort
//- categories
transition(name="animation-tab")
diff --git a/components/wallets/sort/WalletsSort.vue b/components/wallets/sort/WalletsSort.vue
index b038219e..1b384048 100644
--- a/components/wallets/sort/WalletsSort.vue
+++ b/components/wallets/sort/WalletsSort.vue
@@ -1,5 +1,6 @@
<script>
import draggable from 'vuedraggable'
+import { successEmo, random } from '~/assets/js/emo'
export default {
components: {
@@ -14,11 +15,10 @@ export default {
methods: {
/**
- * Get array of wallets IDs
- * Convert them to objects with order value
- * Push object with wallets to DB
- *
- */
+ * Get array of wallets IDs
+ * Convert them to objects with order value
+ * Push object with wallets to DB
+ */
async saveWalletsOrder () {
const sortedWallets = {}
@@ -31,7 +31,7 @@ export default {
this.$store.dispatch('ui/setActiveTab', 'wallets')
this.$notify({
type: 'success',
- title: 'OK',
+ title: random(successEmo),
text: 'Saved'
})
}
@@ -45,7 +45,7 @@ ComponentWrap(:contentPadding="$store.state.ui.pc")
template(slot="headerLeft") {{ $lang.wallets.sortTitle }}
template(slot="content")
- WalletsList(
+ WalletsList2(
:style="{ paddingTop: '10px' }"
v-slot="{ wallets }")
draggable(
diff --git a/components/wallets/total/WalletsTotal.vue b/components/wallets/total/WalletsTotal.vue
index 1d0f42be..77a527da 100644
--- a/components/wallets/total/WalletsTotal.vue
+++ b/components/wallets/total/WalletsTotal.vue
@@ -6,7 +6,7 @@ export default {
const walletsTotal = this.$store.getters['wallets/walletsTotal']
const total = {
counted: 0,
- all: 0
+ other: 0
}
for (const walletId in walletsItems) {
@@ -25,7 +25,7 @@ export default {
total.counted = total.counted + walletTotal
}
else {
- total.all = total.all + walletTotal
+ total.other = total.other + walletTotal
}
}
return total
@@ -38,18 +38,18 @@ export default {
.walletsTotal(
v-if="$store.getters['wallets/hasWallets']"
)
- .walletsTotal__item(v-if="totalInWallets.all !== 0")
- .walletsTotal__title {{ $lang.money.also }}
+ .walletsTotal__item(v-if="totalInWallets.other !== 0")
+ .walletsTotal__title {{ $lang.money.all }}
.walletsTotal__value
Amount(
:currency="$store.state.currencies.base"
- :value="totalInWallets.all"
+ :value="totalInWallets.other + totalInWallets.counted"
size="lg"
vertical="center"
)
.walletsTotal__item
- .walletsTotal__title {{ $lang.money.total }}
+ .walletsTotal__title {{ $lang.money.wallets }}
.walletsTotal__value
Amount(
:currency="$store.state.currencies.base"
diff --git a/locales/en.json b/locales/en.json
index 329b3665..46971981 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -170,7 +170,9 @@
"transfer": "Transfer",
"total": "Total",
"average": "Average",
- "also": "Also"
+ "also": "Also",
+ "wallets": "Wallets",
+ "all": "Total"
},
"dates": {
diff --git a/locales/ru.json b/locales/ru.json
index b96fccb3..2e73c5e1 100644
--- a/locales/ru.json
+++ b/locales/ru.json
@@ -170,7 +170,9 @@
"transfer": "Перевод",
"total": "Итого",
"average": "Среднее",
- "also": "Еще"
+ "also": "Еще",
+ "wallets": "Кошельки",
+ "all": "Всего"
},
"dates": {