Skip to content

Open source personal finance application

update 3.2.3

ilkomecb9167abef22
diff --git a/components/dashboard/Dashboard.vue b/components/dashboard/Dashboard.vue
index ec09ebe4..c57f501e 100644
--- a/components/dashboard/Dashboard.vue
+++ b/components/dashboard/Dashboard.vue
@@ -22,12 +22,14 @@ export default {
<template lang="pug">
.dashboard(v-show="$store.state.ui.activeTab === 'stat'")
- .dashboard__wrap
- StatChartsLine
+ .chartBlock
+ .dashboard__wrap
+ StatChartsLine
+
+ DashboardNav
+ StatSummaryPc
+ DashboardFilter
- DashboardNav
- StatSummaryPc
- DashboardFilter
DashboardStatControl
template(v-if="!$store.getters['trns/hasTrns']")
@@ -40,9 +42,10 @@ export default {
.options__item(v-if="!$store.getters['wallets/hasWallets'] && !$store.getters['categories/hasCategories']")
h4 {{ $t('welcome.firstRun.text') }}
+
Button._blue._center(
- size="xl"
:title="$t('welcome.firstRun.btn')"
+ size="xl"
@onClick="$router.push('/welcome')"
)
@@ -92,9 +95,13 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/media"
-@import "~assets/stylus/variables/scroll"
+@import "~assets/stylus/variables"
+
+.chartBlock
+ z-index 10
+ position sticky
+ top 0
+ background var(--c-bg-2)
.dashboard
overflow hidden
@@ -102,7 +109,6 @@ export default {
scrollbar()
&__wrap
- position relative
max-width 1100px
padding 0px 60px
diff --git a/components/dashboard/DashboardNav.vue b/components/dashboard/DashboardNav.vue
index 4d2ed195..55b78ba9 100644
--- a/components/dashboard/DashboardNav.vue
+++ b/components/dashboard/DashboardNav.vue
@@ -16,45 +16,45 @@ export default {
ContextMenu(
:position="{ left: '-12px', top: true }"
:visible="visiblePeriodMenu"
- @onClickOpener="visiblePeriodMenu = !visiblePeriodMenu")
+ @onClickOpener="visiblePeriodMenu = !visiblePeriodMenu"
+ )
template(slot="opener")
- Dropdown._noBd(
- :active="visiblePeriodMenu")
+ Dropdown._noBd(:active="visiblePeriodMenu")
template(slot="title"): Date.dateSelecror
template(slot="content")
ContextMenuItem(
- icon="mdi mdi-weather-sunset-up"
- :title="$t('dates.day.simple')"
:selected="$store.state.filter.period === 'day'"
+ :title="$t('dates.day.simple')"
+ icon="mdi mdi-weather-sunset-up"
@onClick="$store.dispatch('filter/setPeriod', 'day')"
@onClose="visiblePeriodMenu = !visiblePeriodMenu"
)
ContextMenuItem(
- icon="mdi mdi-calendar-week"
- :title="$t('dates.week.simple')"
:selected="$store.state.filter.period === 'week'"
+ :title="$t('dates.week.simple')"
+ icon="mdi mdi-calendar-week"
@onClick="$store.dispatch('filter/setPeriod', 'week')"
@onClose="visiblePeriodMenu = !visiblePeriodMenu"
)
ContextMenuItem(
- icon="mdi mdi-calendar"
- :title="$t('dates.month.simple')"
:selected="$store.state.filter.period === 'month'"
+ :title="$t('dates.month.simple')"
+ icon="mdi mdi-calendar"
@onClick="$store.dispatch('filter/setPeriod', 'month')"
@onClose="visiblePeriodMenu = !visiblePeriodMenu"
)
ContextMenuItem(
- icon="mdi mdi-calendar-star"
- :title="$t('dates.year.simple')"
:selected="$store.state.filter.period === 'year'"
+ :title="$t('dates.year.simple')"
+ icon="mdi mdi-calendar-star"
@onClick="$store.dispatch('filter/setPeriod', 'year')"
@onClose="visiblePeriodMenu = !visiblePeriodMenu"
)
ContextMenuItem(
- icon="mdi mdi-database"
- :title="$t('dates.all')"
:selected="$store.state.filter.period === 'all'"
+ :title="$t('dates.all')"
+ icon="mdi mdi-database"
@onClick="$store.dispatch('filter/setPeriod', 'all')"
@onClose="visiblePeriodMenu = !visiblePeriodMenu"
)
diff --git a/components/dashboard/DashboardStatControl.vue b/components/dashboard/DashboardStatControl.vue
index 7445d356..be128a96 100644
--- a/components/dashboard/DashboardStatControl.vue
+++ b/components/dashboard/DashboardStatControl.vue
@@ -9,15 +9,18 @@ export default {
.tabs
.tabItem(
@click="$store.commit('dashboard/setDashboardActiveTab', 'stat')"
- :class="{ _active: $store.state.dashboard.activeTab === 'stat' }") {{ $t('stat.shortTitle') }}
+ :class="{ _active: $store.state.dashboard.activeTab === 'stat' }"
+ ) {{ $t('stat.shortTitle') }}
.tabItem(
@click="$store.commit('dashboard/setDashboardActiveTab', 'history')"
- :class="{ _active: $store.state.dashboard.activeTab === 'history' }") {{ $t('trns.history') }}
+ :class="{ _active: $store.state.dashboard.activeTab === 'history' }"
+ ) {{ $t('trns.history') }}
.tabItem(
@click="$store.commit('dashboard/setDashboardActiveTab', 'balance')"
- :class="{ _active: $store.state.dashboard.activeTab === 'balance' }") {{ $t('stat.balanceTitle') }}
+ :class="{ _active: $store.state.dashboard.activeTab === 'balance' }"
+ ) {{ $t('stat.balanceTitle') }}
.tabs
.tabItem(
@@ -53,11 +56,11 @@ $text-disable = var(--c-font-5)
.tabs
display flex
- cursor pointer
&:last-child
justify-self end
.tabItem
+ cursor pointer
display flex
align-items center
color $text
diff --git a/components/lang/LangDropdown.vue b/components/lang/LangDropdown.vue
index 7b9691c9..b681b9c9 100644
--- a/components/lang/LangDropdown.vue
+++ b/components/lang/LangDropdown.vue
@@ -8,8 +8,6 @@ export default {
computed: {
currentLanguageName () {
- console.log(this.$i18n.locale)
-
switch (this.$i18n.locale) {
case 'ru':
return '🇷🇺 Russian - Русский'
diff --git a/components/layout/LayoutMobile.vue b/components/layout/LayoutMobile.vue
index 79bde3e6..18b149d6 100644
--- a/components/layout/LayoutMobile.vue
+++ b/components/layout/LayoutMobile.vue
@@ -116,47 +116,8 @@ export default {
.page__nav
h1: Date
.page__customize
- ContextMenu(
- :position="{ right: '0px', top: '0px' }"
- :visible="visibleContextMenu"
- @onClickOpener="visibleContextMenu = !visibleContextMenu")
-
- template(slot="opener")
- .opener
- .mdi.mdi-tune
-
- template(slot="content")
- ContextMenuItem(
- :title="$t('stat.customize.showPeriodsChart')"
- :showCheckbox="true"
- :checkboxValue="$store.state.ui.statGraphsVisibility === 'visible'"
- icon="mdi mdi-chart-bar-stacked"
- @onClick="$store.dispatch('ui/toogleShowStatGraphs')"
- )
-
- ContextMenuItem(
- :title="$t('stat.customize.showCategorisChart')"
- :showCheckbox="true"
- :checkboxValue="$store.state.ui.catsChart === 'visible'"
- icon="mdi mdi-folder-star"
- @onClick="$store.dispatch('ui/toogleVisibleCatsChart')"
- )
-
- ContextMenuItem(
- :title="$t('stat.customize.showCategorisList')"
- :showCheckbox="true"
- :checkboxValue="$store.state.ui.statItems === 'visible'"
- icon="mdi mdi-chart-gantt"
- @onClick="$store.dispatch('ui/toogleVisibilityStatItems')"
- )
-
- .context-menu-sep
-
- ContextMenuItem(
- :title="$t('theme.change')"
- icon="mdi mdi-palette"
- @onClick="$store.dispatch('ui/changeTheme')"
- )
+ .opener(@click="$store.dispatch('ui/setActiveTab', 'customize')")
+ .mdi.mdi-tune
.page__content
.chartBar(v-show="$store.state.ui.statGraphsVisibility === 'visible'")
@@ -217,8 +178,6 @@ export default {
WalletModal(:slider="slider")
CategoryStatModal
- //- Caegory Form: create or edit
- //------------------------------------------------------------------------------
Portal(
v-if="activeTab === 'menu'"
to="modal"
@@ -229,6 +188,55 @@ export default {
)
Menu
+ //- Caegory Form: create or edit
+ //------------------------------------------------------------------------------
+ Portal(
+ v-if="activeTab === 'customize'"
+ to="modal"
+ )
+ ModalBottom(
+ key="customize"
+ @onClose="$store.dispatch('ui/setActiveTab', 'stat')"
+ )
+ ContextMenuItem(
+ :title="$t('stat.customize.showPeriodsChart')"
+ :showCheckbox="true"
+ :checkboxValue="$store.state.ui.statGraphsVisibility === 'visible'"
+ icon="mdi mdi-chart-bar-stacked"
+ @onClick="$store.dispatch('ui/toogleShowStatGraphs')"
+ )
+
+ ContextMenuItem(
+ :title="$t('stat.customize.showCategorisChart')"
+ :showCheckbox="true"
+ :checkboxValue="$store.state.ui.catsChart === 'visible'"
+ icon="mdi mdi-folder-star"
+ @onClick="$store.dispatch('ui/toogleVisibleCatsChart')"
+ )
+
+ ContextMenuItem(
+ :title="$t('stat.customize.showCategorisList')"
+ :showCheckbox="true"
+ :checkboxValue="$store.state.ui.statItems === 'visible'"
+ icon="mdi mdi-chart-gantt"
+ @onClick="$store.dispatch('ui/toogleVisibilityStatItems')"
+ )
+
+ ContextMenuItem(
+ :title="$t('stat.customize.showCategorisList')"
+ :showCheckbox="true"
+ :checkboxValue="$store.state.ui.stat.analyticsVisibility === 'visible'"
+ icon="mdi mdi-chart-gantt"
+ @onClick="$store.dispatch('ui/toogleStat', 'analyticsVisibility')"
+ )
+ .context-menu-sep
+
+ ContextMenuItem(
+ :title="$t('theme.change')"
+ icon="mdi mdi-palette"
+ @onClick="$store.dispatch('ui/changeTheme')"
+ )
+
//- Caegory Form: create or edit
//------------------------------------------------------------------------------
Portal(
diff --git a/components/stat/StatMobile2.vue b/components/stat/StatMobile2.vue
index 721b5ca9..4ee4f954 100644
--- a/components/stat/StatMobile2.vue
+++ b/components/stat/StatMobile2.vue
@@ -165,7 +165,8 @@ export default {
:currency="$store.state.currencies.base"
:key="categoryId"
:type="0"
- :total="statCurrentPeriod.categories[categoryId].expenses")
+ :total="statCurrentPeriod.categories[categoryId].expenses"
+ )
//- expenses
.statGroup(v-show="isShowHistory")
diff --git a/components/stat/cats/PeriodCatsChart.vue b/components/stat/cats/PeriodCatsChart.vue
index 7c37a460..cb2c9ae8 100644
--- a/components/stat/cats/PeriodCatsChart.vue
+++ b/components/stat/cats/PeriodCatsChart.vue
@@ -48,8 +48,7 @@ export default {
<template lang="pug">
.cats-chart(:class="className")
- .cats-chart__items(
- v-if="statCurrentPeriod[type].categoriesIds.length > 0")
+ .cats-chart__items(v-if="statCurrentPeriod[type].categoriesIds.length > 0")
PeriodCatsChartItem(
v-for="categoryId in statCurrentPeriod[type].categoriesIds"
:biggest="biggestAmount"
@@ -57,15 +56,19 @@ export default {
:categoryId="categoryId"
:key="`charts-${categoryId}`"
:total="statCurrentPeriod.categories[categoryId][type]"
- @onActiveCategoryChange="handleActiveCategoryChange")
+ @onActiveCategoryChange="handleActiveCategoryChange"
+ )
.cats-chart__popup(
- v-if="this.$store.state.ui.pc"
- v-show="activeCategoryId")
+ v-if="$store.state.ui.pc"
+ v-show="activeCategoryId"
+ )
+
PeriodCatsChartPopup(
:offset="offset"
:categoryId="activeCategoryId"
- :type="type")
+ :type="type"
+ )
</template>
<style lang="stylus" scoped>
diff --git a/package.json b/package.json
index f53c6c16..291f33c7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "finapp",
- "version": "3.2.2",
+ "version": "3.2.3",
"scripts": {
"dev": "cross-env NUXT_HOST=0.0.0.0 nuxt",
"build": "nuxt build",
diff --git a/store/trns/getters.js b/store/trns/getters.js
index 476c58ce..d341fb31 100644
--- a/store/trns/getters.js
+++ b/store/trns/getters.js
@@ -196,10 +196,10 @@ export default {
getTrns: (state, getters, rootState) => (props) => {
if (!getters.hasTrns) { return [] }
- const { date, periodName, description } = props
+ const { date, periodName, description, categoryId } = props
const categories = rootState.categories.items
const categoriesIds = Object.keys(categories)
- const filterCategoryId = rootState.filter.categoryId
+ const filterCategoryId = rootState.filter.categoryId || categoryId
const filterWalletId = rootState.filter.walletId
const trns = rootState.trns.items
diff --git a/store/ui/actions.js b/store/ui/actions.js
index 9907b62f..0fb2f6f3 100644
--- a/store/ui/actions.js
+++ b/store/ui/actions.js
@@ -155,6 +155,16 @@ export default {
dispatch('ui/saveUiView', null, { root: true })
},
+ toogleStat ({ commit, dispatch, state }, id) {
+ let value
+ state.stat[id] === 'visible'
+ ? value = 'hidden'
+ : value = 'visible'
+
+ commit('ui/setShow', { id, value }, { root: true })
+ dispatch('ui/saveUiView', null, { root: true })
+ },
+
/**
* Save ui view state to localStorage for selected filter
*/
@@ -175,7 +185,8 @@ export default {
statLastTrnsVisibility: rootState.ui.statLastTrnsVisibility,
statSummuryVisibility: rootState.ui.statSummuryVisibility,
totalChartPeriods: rootState.chart.periods,
- walletsVisibility: rootState.ui.stat.walletsVisibility
+ walletsVisibility: rootState.ui.stat.walletsVisibility,
+ analyticsVisibility: rootState.ui.stat.analyticsVisibility
}
})
},
@@ -223,10 +234,18 @@ export default {
? commit('setStatSummuryVisibility', 'visible')
: commit('setStatSummuryVisibility', 'hidden')
+ // Analytics
+ localFilterUiItem.analyticsVisibility === 'visible'
+ ? commit('setShow', { id: 'analyticsVisibility', value: 'visible' })
+ : commit('setShow', { id: 'analyticsVisibility', value: 'hidden' })
+
// periods in total chart
const currentPeriodName = rootState.filter.period
const localPeriodValues = localFilterUiItem.totalChartPeriods[currentPeriodName]
- commit('chart/setPeriodValues', { periodName: currentPeriodName, values: localPeriodValues }, { root: true })
+ commit('chart/setPeriodValues', {
+ periodName: currentPeriodName,
+ values: localPeriodValues
+ }, { root: true })
}
}
}
diff --git a/store/ui/index.js b/store/ui/index.js
index 66d8504a..fb866b15 100644
--- a/store/ui/index.js
+++ b/store/ui/index.js
@@ -13,6 +13,7 @@ const state = () => ({
statLastTrnsVisibility: 'hidden',
statSummuryVisibility: 'visible',
stat: {
+ analyticsVisibility: 'hidden',
activeTab: 'stat',
walletsVisibility: 'hidden'
},
diff --git a/store/ui/mutations.js b/store/ui/mutations.js
index f2e04384..c8cdfc51 100644
--- a/store/ui/mutations.js
+++ b/store/ui/mutations.js
@@ -39,5 +39,9 @@ export default {
setStatLastTrnsVisibility (state, status) {
state.statLastTrnsVisibility = status
+ },
+
+ setShow (state, { id, value }) {
+ state.stat[id] = value
}
}