Skip to content

Open source personal finance application

Update stat: change empty icon and fix when show transaction from 'Transfer' category

Ilya Komichev20b34d551cd6
diff --git a/src/components/dashboard/Dashboard.vue b/src/components/dashboard/Dashboard.vue
index 8abd574f..d6a8a46d 100644
--- a/src/components/dashboard/Dashboard.vue
+++ b/src/components/dashboard/Dashboard.vue
@@ -4,6 +4,7 @@ import ContextMenuItem from '@/components/shared/contextMenu/ContextMenuItem'
import Dropdown from '@/components/shared/dropdown/Dropdown'
import DashboardFilter from '@/components/dashboard/DashboardFilter'
import DashboardNav from '@/components/dashboard/DashboardNav'
+import EmptyData from '@/components/shared/emptyData/EmptyData'
import StatChartsLine from '@/components/stat/StatChartsLine'
import StatSummaryPc from '@/components/stat/StatSummaryPc'
import StatPc from '@/components/stat/StatPc'
@@ -13,6 +14,7 @@ export default {
components: {
ContextMenu,
ContextMenuItem,
+ EmptyData,
Dropdown,
DashboardFilter,
DashboardNav,
@@ -108,13 +110,20 @@ export default {
): .mdi.mdi-chevron-right
.statMain__content
- transition(name="animation-tab")
- .statMain__tab(v-show="!$store.state.dashboard.showTrnsHistory")
- StatPc
-
- transition(name="animation-tab")
- .statMain__tab._trns(v-show="$store.state.dashboard.showTrnsHistory")
- TrnsList
+ //- empty
+ //------------------------------------------------
+ template(v-if="$store.getters.stat.incomes.categoriesIds.length === 0 && $store.getters.stat.expenses.categoriesIds.length === 0 && $store.getters.selectedTrnsIdsWithDate.length === 0")
+ EmptyData(text="No stat for this period")
+
+ //- stat & history
+ template(v-else)
+ transition(name="animation-tab")
+ .statMain__tab(v-show="!$store.state.dashboard.showTrnsHistory")
+ StatPc
+
+ transition(name="animation-tab")
+ .statMain__tab._trns(v-show="$store.state.dashboard.showTrnsHistory")
+ TrnsList
</template>
<style lang="stylus" scoped>
diff --git a/src/components/shared/emptyData/EmptyData.vue b/src/components/shared/emptyData/EmptyData.vue
index 1120b334..c081fb81 100644
--- a/src/components/shared/emptyData/EmptyData.vue
+++ b/src/components/shared/emptyData/EmptyData.vue
@@ -11,7 +11,7 @@ export default {
<template lang="pug">
.empty
- .empty__icon: .mdi.mdi-flask-empty-outline
+ .empty__icon: .mdi.mdi-cat
.empty__text {{ text }}
</template>
diff --git a/src/components/stat/StatMobile.vue b/src/components/stat/StatMobile.vue
index 76e91257..512e1a0b 100644
--- a/src/components/stat/StatMobile.vue
+++ b/src/components/stat/StatMobile.vue
@@ -80,7 +80,7 @@ export default {
//- empty
//------------------------------------------------
EmptyData(
- v-if="stat.incomes.categoriesIds.length === 0 && stat.expenses.categoriesIds.length === 0"
+ v-if="stat.incomes.categoriesIds.length === 0 && stat.expenses.categoriesIds.length === 0 && $store.getters.selectedTrnsIdsWithDate.length === 0"
text="No stat for this period")
//- history
diff --git a/src/components/stat/StatPc.vue b/src/components/stat/StatPc.vue
index a9606e8f..1e8811ae 100644
--- a/src/components/stat/StatPc.vue
+++ b/src/components/stat/StatPc.vue
@@ -1,13 +1,11 @@
<script>
import Amount from '@/components/amount/Amount'
-import EmptyData from '@/components/shared/emptyData/EmptyData'
import StatItem from '@/components/stat/StatItem'
import PeriodCatsChart from '@/components/stat/cats/PeriodCatsChart'
export default {
components: {
Amount,
- EmptyData,
PeriodCatsChart,
StatItem
},
@@ -22,7 +20,7 @@ export default {
<template lang="pug">
.stat
- .stat__content(v-if="stat.expenses.categoriesIds.length > 0 || stat.incomes.categoriesIds.length > 0")
+ .stat__content
//- expenses
//------------------------------------------------
.stat__item
@@ -60,12 +58,6 @@ export default {
:key="categoryId"
:total="stat.categories[categoryId].incomes")
.stat__empty(v-else) No incomes
-
- //- empty
- //------------------------------------------------
- EmptyData(
- v-else
- text="No stat for this period")
</template>
<style lang="stylus" scoped>