Skip to content

Open source personal finance application

update 3.6.2

ilkome6702fc3a3496
diff --git a/components/categories/modal/CategoryModal.vue b/components/categories/modal/CategoryModal.vue
index 7f44b167..8a699501 100644
--- a/components/categories/modal/CategoryModal.vue
+++ b/components/categories/modal/CategoryModal.vue
@@ -99,51 +99,50 @@ export default {
</script>
<template lang="pug">
-div
- Portal(
- v-if="$store.state.categories.modal.show"
- to="modal"
+Portal(
+ v-if="$store.state.categories.modal.show"
+ to="modal"
+)
+ ModalBottom(
+ :key="$store.state.categories.modal.id"
+ @onClose="$store.commit('categories/hideCategoryModal')"
+ @afterClose="$store.commit('categories/setCategoryModalId', null)"
)
- ModalBottom(
- :key="$store.state.categories.modal.id"
- @onClose="$store.commit('categories/hideCategoryModal')"
- @afterClose="$store.commit('categories/setCategoryModalId', null)"
- )
- template(slot="header")
- .categoryWrap
- .categoryIcon
- Icon(
- :icon="category.icon"
- :background="category.color || $store.state.ui.defaultBgColor"
- :round="true"
- :big="true"
- )
- .modalBottom__header__title {{ category.name }}
-
- template(slot="btns")
- ModalButton(
- :name="$t('base.delete')"
- icon="mdi mdi-delete"
- @onClick="handleDeleteClick"
- )
- ModalButton(
- :name="$t('base.edit')"
- icon="mdi mdi-pencil"
- @onClick="handleEditClick"
- )
- ModalButton(
- :name="$t('base.filter')"
- icon="mdi mdi-filter-outline"
- @onClick="handleSetFilterCategory"
- )
-
- template(v-if="childCategoriesIds.length")
- CategoriesView(
- :borderTop="true"
- :ids="childCategoriesIds"
- :noPadding="true"
- @onClick="id => $store.dispatch('categories/showCategoryModal', id)"
- )
+ template(slot="header")
+ .categoryWrap
+ .categoryIcon
+ Icon(
+ :icon="category.icon"
+ :background="category.color || $store.state.ui.defaultBgColor"
+ :round="true"
+ :big="true"
+ )
+ .modalBottom__header__title {{ category.name }}
+
+ template(slot="btns")
+ ModalButton(
+ :name="$t('base.delete')"
+ icon="mdi mdi-delete"
+ @onClick="handleDeleteClick"
+ )
+ ModalButton(
+ :name="$t('base.edit')"
+ icon="mdi mdi-pencil"
+ @onClick="handleEditClick"
+ )
+ ModalButton(
+ :name="$t('base.filter')"
+ icon="mdi mdi-filter-outline"
+ @onClick="handleSetFilterCategory"
+ )
+
+ template(v-if="childCategoriesIds.length")
+ CategoriesView(
+ :borderTop="true"
+ :ids="childCategoriesIds"
+ :noPadding="true"
+ @onClick="id => $store.dispatch('categories/showCategoryModal', id)"
+ )
ModalBottomConfirm(
:show="showModalConfirm"
diff --git a/components/dashboard/Dashboard.vue b/components/dashboard/Dashboard.vue
index d20bf752..daafbda5 100644
--- a/components/dashboard/Dashboard.vue
+++ b/components/dashboard/Dashboard.vue
@@ -30,10 +30,10 @@ export default {
<template lang="pug">
.dashboard(v-show="$store.state.ui.activeTab === 'stat'")
- .dashboard__wrap(v-if="$store.state.ui.statGraphsVisibility === 'visible'")
+ .dashboard__wrap(v-if="$store.getters['trns/hasTrns'] && $store.state.ui.statGraphsVisibility === 'visible'")
.dashboard__chart
StatChartLines(
- v-if="filterPeriod !== 'all'"
+ v-if="$store.getters['trns/hasTrns'] && filterPeriod !== 'all'"
:chartType="periods[filterPeriod].grouped ? 'column' : 'line'"
)
@@ -43,34 +43,7 @@ export default {
DashboardFilter
DashboardStatControl
- template(v-if="!$store.getters['trns/hasTrns']")
- .startSomething
- .options__item(v-if="$store.getters['wallets/hasWallets'] && $store.getters['categories/hasCategories']")
- Button._grey._center(
- :title="$t('createTrn')"
- @onClick="$store.dispatch('trnForm/openTrnForm', { action: 'create' })"
- )
-
- .options__item(v-if="!$store.getters['wallets/hasWallets'] && !$store.getters['categories/hasCategories']")
- h4 {{ $t('welcome.firstRun.text') }}
-
- Button._blue._center(
- :title="$t('welcome.firstRun.btn')"
- size="xl"
- @onClick="$router.push('/welcome')"
- )
-
- .options__item(v-if="$store.state.demo.hasDemo")
- .options__or
- .options__or__border
- .options__or__text {{ $t('welcome.or') }}
-
- h4 {{ $t('welcome.demo.text') }}
- Button._blue._center(
- size="xl"
- :title="$t('welcome.demo.btn')"
- @onClick="$store.dispatch('demo/createDemo')"
- )
+ LazyNoStatActions(v-if="!$store.getters['trns/hasTrns']")
.dashboard__content(v-if="$store.getters['trns/hasTrns']")
//- empty
@@ -148,34 +121,4 @@ export default {
&._trns
padding 60px 60px
padding-top 30px
-
-.startSomething
- display flex
- align-items center
- justify-content center
- padding 100px 0
- flex-flow column
-
- .options__item
- margin-bottom 40px
-
- .options__or
- position relative
- display flex
- align-items center
- justify-content center
- padding $m9 0
- color var(--c-font-4)
- text-align center
- &__text
- position relative
- padding $m7
- background var(--c-bg-2)
- &__border
- position absolute
- top 50%
- left 0
- width 100%
- height 1px
- background var(--c-bg-6)
</style>
diff --git a/components/layout/LayoutMobile.vue b/components/layout/LayoutMobile.vue
index e3f2227e..ea2c9937 100644
--- a/components/layout/LayoutMobile.vue
+++ b/components/layout/LayoutMobile.vue
@@ -154,7 +154,10 @@ export default {
.layoutMobile__content(ref="scroll")
//- Categories
//---------------------------------------------------------------------------
- template(v-if="activeTabViewName === 'categories'")
+ .h100(
+ v-show="activeTabViewName === 'categories'"
+ :style="{ zIndex: activeTabViewName === 'categories' ? 10 : 0 }"
+ )
ComponentWrap(:contentPadding="false")
template(slot="headerLeft") {{ $t('categories.name') }}
@@ -175,33 +178,28 @@ export default {
//- Wallets
//---------------------------------------------------------------------------
- template(v-if="activeTabViewName === 'wallets'")
+ .h100(
+ v-show="activeTabViewName === 'wallets'"
+ :style="{ zIndex: activeTabViewName === 'wallets' ? 10 : 0 }"
+ )
WalletsPageMobile
- //- Categories
+ //- No trns
//---------------------------------------------------------------------------
- template(v-if="activeTabViewName === 'categories'")
- ComponentWrap(:contentPadding="false")
- template(slot="headerLeft") {{ $t('categories.name') }}
-
- template(slot="content")
- CategoriesList(
- :style="{ paddingTop: '16px' }"
- @onClick="(id) => $store.dispatch('categories/showCategoryModal', id)"
- )
-
- template(slot="bottom")
- .flex
- .col
- Button(
- :title="$t('categories.new')"
- className="_inline _small"
- @onClick="$store.dispatch('ui/setActiveTab', 'createCategory')"
- )
+ .page(
+ v-if="!$store.getters['trns/hasTrns']"
+ v-show="activeTabViewName === 'chart' || activeTabViewName === 'incomes' || activeTabViewName === 'expenses' || activeTabViewName === 'history'"
+ )
+ .page__content
+ .box
+ NoStatActions
- //- Stat
+ //- Stat: has trns
//---------------------------------------------------------------------------
- .page(v-show="activeTabViewName === 'chart' || activeTabViewName === 'incomes' || activeTabViewName === 'expenses' || activeTabViewName === 'history'")
+ .page(
+ v-if="$store.getters['trns/hasTrns']"
+ v-show="activeTabViewName === 'chart' || activeTabViewName === 'incomes' || activeTabViewName === 'expenses' || activeTabViewName === 'history'"
+ )
.page__content
//- Daily & History
@@ -258,7 +256,7 @@ export default {
//- Chart Content
//-----------------------------
.box._h272(
- v-if="filterPeriod !== 'all'"
+ v-if="$store.getters['trns/hasTrns'] && filterPeriod !== 'all'"
v-show="activeTabViewName !== 'history' && activeTabViewName !== 'chart'"
)
StatChartLines(
@@ -293,7 +291,7 @@ export default {
template(v-if="activeTabViewName === 'chart'")
.page__grid
.box._h272(
- v-if="filterPeriod !== 'all'"
+ v-if="$store.getters['trns/hasTrns'] && filterPeriod !== 'all'"
v-show="activeTabViewName !== 'history'"
)
StatChartLines(
@@ -652,6 +650,9 @@ export default {
<style lang="stylus" scoped>
@import '~assets/stylus/variables'
+.h100
+ height 100%
+
.context-menu-sep
background var(--c-bg-1)
diff --git a/components/layout/component/ComponentWrap.vue b/components/layout/component/ComponentWrap.vue
index 8ffa2a1d..0efb4335 100644
--- a/components/layout/component/ComponentWrap.vue
+++ b/components/layout/component/ComponentWrap.vue
@@ -44,7 +44,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables"
+@import '~assets/stylus/variables'
.component
display grid
@@ -100,7 +100,7 @@ export default {
overflow-y auto
scrollbar()
- +media-tablet("less")
+ +media-tablet('less')
display flex
flex-flow column
justify-content center
diff --git a/components/stat/NoStatActions.vue b/components/stat/NoStatActions.vue
new file mode 100644
index 00000000..5502f0a6
--- /dev/null
+++ b/components/stat/NoStatActions.vue
@@ -0,0 +1,67 @@
+<script>
+export default {
+ name: 'NoStatActions'
+}
+</script>
+
+<template lang="pug">
+.startSomething
+ .options__item(v-if="$store.getters['wallets/hasWallets'] && $store.getters['categories/hasCategories']")
+ Button._grey._center(
+ :title="$t('createTrn')"
+ @onClick="$store.dispatch('trnForm/openTrnForm', { action: 'create' })"
+ )
+
+ .options__item(v-if="!$store.getters['wallets/hasWallets'] && !$store.getters['categories/hasCategories']")
+ h4 {{ $t('welcome.firstRun.text') }}
+
+ Button._blue._center(
+ :title="$t('welcome.firstRun.btn')"
+ size="xl"
+ @onClick="$router.push('/welcome')"
+ )
+
+ .options__item(v-if="$store.state.demo.hasDemo")
+ .options__or
+ .options__or__border
+ .options__or__text {{ $t('welcome.or') }}
+
+ h4 {{ $t('welcome.demo.text') }}
+ Button._blue._center(
+ size="xl"
+ :title="$t('welcome.demo.btn')"
+ @onClick="$store.dispatch('demo/createDemo')"
+ )
+</template>
+
+<style lang="stylus" scoped>
+.startSomething
+ display flex
+ align-items center
+ justify-content center
+ padding 100px 0
+ flex-flow column
+
+ .options__item
+ margin-bottom 40px
+
+ .options__or
+ position relative
+ display flex
+ align-items center
+ justify-content center
+ padding $m9 0
+ color var(--c-font-4)
+ text-align center
+ &__text
+ position relative
+ padding $m7
+ background var(--c-bg-2)
+ &__border
+ position absolute
+ top 50%
+ left 0
+ width 100%
+ height 1px
+ background var(--c-bg-6)
+</style>
diff --git a/components/stat/StatItemMobile.vue b/components/stat/StatItemMobile.vue
index db45cb58..99471665 100644
--- a/components/stat/StatItemMobile.vue
+++ b/components/stat/StatItemMobile.vue
@@ -121,7 +121,7 @@ export default {
.statItem__inside(@click.stop="")
.statItem__chart
StatChartLines(
- v-if="filterPeriod !== 'all'"
+ v-if="$store.getters['trns/hasTrns'] && filterPeriod !== 'all'"
:categoryId="categoryId"
:chartColor="category.color"
:isShowExpenses="type === 0"
diff --git a/components/trnForm/TrnFormModalCats.vue b/components/trnForm/TrnFormModalCats.vue
index c2e43077..dc0e355f 100644
--- a/components/trnForm/TrnFormModalCats.vue
+++ b/components/trnForm/TrnFormModalCats.vue
@@ -22,6 +22,7 @@ export default {
watch: {
show: {
handler (isShow) {
+ const initialSlide = this.$store.getters['categories/quickSelectorCategoriesIds'] && this.$store.getters['categories/quickSelectorCategoriesIds'].length > 0 ? 1 : 2
this.$nextTick(() => {
if (this.slider) {
this.slider.update()
@@ -30,7 +31,7 @@ export default {
this.slider = new Swiper(this.$refs.slider, {
slidesPerView: 1,
autoHeight: false,
- initialSlide: 1,
+ initialSlide,
shortSwipes: false,
longSwipesRatio: 0.1,
longSwipesMs: 60
diff --git a/components/wallets/total/WalletsTotal.vue b/components/wallets/total/WalletsTotal.vue
index 2303987e..650589fd 100644
--- a/components/wallets/total/WalletsTotal.vue
+++ b/components/wallets/total/WalletsTotal.vue
@@ -79,9 +79,9 @@ export default {
padding-bottom 16px
&__title
- padding-right 6px
- padding-bottom 6px
opacity .6
+ padding-right 0
+ padding-bottom 6px
font-size 12px
text-align center
</style>
diff --git a/package.json b/package.json
index 437b72bb..0e37ef8e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "finapp",
- "version": "3.6.1",
+ "version": "3.6.2",
"scripts": {
"dev": "cross-env NUXT_HOST=0.0.0.0 nuxt",
"build": "nuxt build",