Skip to content

Open source personal finance application

update 3.16.0

ilkome07914f047621
diff --git a/assets/stylus/index.styl b/assets/stylus/index.styl
index 9cf17ec5..0fe6324d 100644
--- a/assets/stylus/index.styl
+++ b/assets/stylus/index.styl
@@ -1,7 +1,8 @@
// Created by Ilya Komichev
// github.com/ilkome/finapp
-@import "variables"
-@import "mixins/*"
-@import "common/*"
-@import "../../components/**/*"
+@import 'variables'
+@import 'mixins/*'
+@import 'common/*'
+@import 'shame'
+@import '../../components/**/*'
diff --git a/components/layout/styles/component.styl b/assets/stylus/shame.styl
similarity index 98%
rename from components/layout/styles/component.styl
rename to assets/stylus/shame.styl
index 865e528b..4231db1d 100644
--- a/components/layout/styles/component.styl
+++ b/assets/stylus/shame.styl
@@ -1,9 +1,9 @@
.form-line
- padding $m7 $m6
margin-bottom $m9
- border-radius $m3
+ padding $m7 $m6
text-align left
border 1px solid var(--c-bg-6)
+ border-radius $m3
+media-laptop()
height auto
@@ -18,9 +18,9 @@
margin-bottom 24px
&._p0
- padding 0
margin 0
margin-bottom $m10
+ padding 0
+media-laptop()
margin-bottom 24px
@@ -28,9 +28,9 @@
.v-input
.v-input__slot
.v-messages
+ min-height 0
margin 0
padding 0
- min-height 0
&._clean
border 0
@@ -55,8 +55,8 @@
&__label
padding-top 3px
color var(--c-font-4)
+ font-weight 500;
line-height 18px
- font-weight 500
&__icon
display flex
@@ -66,8 +66,8 @@
font-size 32px
&__label
- margin-left auto
opacity .6
+ margin-left auto
font-size 10px
text-transform uppercase
diff --git a/assets/stylus/variables/colors-dark.styl b/assets/stylus/variables/colors-dark.styl
index f94799e6..833dccca 100644
--- a/assets/stylus/variables/colors-dark.styl
+++ b/assets/stylus/variables/colors-dark.styl
@@ -23,7 +23,7 @@ html.dark-mode
--c-bg-4 rgba(28, 28, 28, 1)
--c-bg-44 rgba(25, 25, 25, 1)
--c-bg-5 rgba(35, 35, 35, 1)
- --c-bg-6 rgba(39, 39, 39, 1)
+ --c-bg-6 #272727
--c-bg-7 rgba(46, 46, 46, 1)
--c-bg-8 rgba(63, 63, 63, 1)
--c-bg-9 rgba(135, 135, 135, 1)
@@ -50,3 +50,5 @@ html.dark-mode
--c-item2-bg-hover #1c1c1c
--c-item2-bd-hover #3f3f3f
+
+ --c-item3-bg-hover #272727
diff --git a/assets/stylus/variables/colors-light.styl b/assets/stylus/variables/colors-light.styl
index 3b99e2c6..2f3a31cb 100644
--- a/assets/stylus/variables/colors-light.styl
+++ b/assets/stylus/variables/colors-light.styl
@@ -54,3 +54,5 @@ html
--c-item2-bg-hover #fafafa
--c-item2-bd-hover #bebebe
+
+ --c-item3-bg-hover rgba(235, 235, 235, 1)
diff --git a/components/about/About.vue b/components/about/About.vue
index 7b6bf0d4..492c42a8 100644
--- a/components/about/About.vue
+++ b/components/about/About.vue
@@ -29,16 +29,17 @@ export default {
&__wrap
display flex
- gap $m10
+ gap $mb2
padding-bottom $m7
.aboutPerson
&__title
- padding-bottom $m5
- color var(--c-font-3)
+ padding-bottom $m4
+ color var(--c-font-4)
font-size 12px
&__name
+ color var(--c-font-2)
font-size 14px
line-height 18px
fontFamilyNunito()
diff --git a/components/amount/Amount.vue b/components/amount/Amount.vue
index e8ad512f..aa6bcc21 100644
--- a/components/amount/Amount.vue
+++ b/components/amount/Amount.vue
@@ -1,56 +1,23 @@
<script>
import currency from 'currency.js'
-const baseAmountFormat = (value, separator) => currency(value, { symbol: '', precision: 0, pattern: '#', separator }).format()
+const baseAmountFormat = (value, separator) =>
+ currency(value, { symbol: '', precision: 0, pattern: '#', separator })
+ .format()
export default {
name: 'Amount',
props: {
- value: {
- type: Number,
- required: true
- },
-
- currency: {
- type: String,
- required: true
- },
-
- type: {
- type: Number,
- default: null
- },
-
- showBase: {
- type: Boolean,
- default: true
- },
-
- size: {
- type: String,
- default: null
- },
-
- vertical: {
- type: String,
- default: null
- },
-
- isShowPrefix: {
- type: Boolean,
- default: false
- },
-
- isColorize: {
- type: Boolean,
- default: true
- },
-
- isAltColor: {
- type: Boolean,
- default: false
- }
+ currency: { type: String, required: true },
+ isAltColor: { type: Boolean, default: false },
+ isColorize: { type: Boolean, default: true },
+ isShowPrefix: { type: Boolean, default: false },
+ showBase: { type: Boolean, default: true },
+ size: { type: String, default: null },
+ type: { type: Number, default: null },
+ value: { type: Number, required: true },
+ vertical: { type: String, default: null }
},
computed: {
@@ -70,9 +37,9 @@ export default {
currency: this.currency
})
- if (baseValue) {
+ if (baseValue)
return this.formatAmount(baseValue)
- }
+
return null
}
},
@@ -184,7 +151,12 @@ export default {
&._base
opacity .6
- padding-top 0px
+
+ &._base._size_xl
+ padding-top 4px
+
+ &._base._size_md
+ padding-top 3px
&__prefix
align-self center
@@ -192,9 +164,20 @@ export default {
font-weight 400
~/._size_xl &
+ padding-top 2px
padding-right $m4
font-size 26px
+ ~/._base &
+ padding-top 10px
+ font-size 12px
+
+ ~/._base._size_xl &
+ padding-top 1px
+
+ ~/._base._size_md &
+ padding-top 2px
+
&__value
font-secondary()
font-size 14px
@@ -212,9 +195,13 @@ export default {
font-weight 500
~/._size_xl._base &
- padding-top $m6
+ padding-top 0
font-size 18px
+ ~/._size_md._base &
+ padding-top 0
+ font-size 14px
+
&__symbol
padding-bottom 0px
padding-left 2px
@@ -231,13 +218,17 @@ export default {
padding-bottom 3px
~/._size_xl &
- padding-bottom 4px
+ padding-bottom 5px
font-size 18px
font-weight 300
~/._size_xl._base &
- padding-bottom 0
- font-size 14px
+ padding-bottom 2px
+ font-size 12px
+
+ ~/._size_md._base &
+ padding-bottom 1px
+ font-size 10px
.amount._size_lg
.amountItem__value
diff --git a/components/analytics/AnalyticsChart.vue b/components/analytics/AnalyticsChart.vue
index 1c414126..a099b2b9 100644
--- a/components/analytics/AnalyticsChart.vue
+++ b/components/analytics/AnalyticsChart.vue
@@ -36,10 +36,6 @@ export default {
},
computed: {
- activeTab () {
- return this.$store.state.dashboard.activeTab === 'balance'
- },
-
showedPeriods () {
return this.$store.state.stat.showedPeriods
},
diff --git a/components/analytics/AnalyticsChartTrns.vue b/components/analytics/AnalyticsChartTrns.vue
index 0129bb7a..9d042cab 100644
--- a/components/analytics/AnalyticsChartTrns.vue
+++ b/components/analytics/AnalyticsChartTrns.vue
@@ -41,10 +41,6 @@ export default {
},
computed: {
- activeTab () {
- return this.$store.state.dashboard.activeTab === 'balance'
- },
-
periods () {
return this.$store.state.chart.periods
},
diff --git a/components/categories/EditModal.vue b/components/categories/EditModal.vue
index 1ca80e9c..86033ce1 100644
--- a/components/categories/EditModal.vue
+++ b/components/categories/EditModal.vue
@@ -9,16 +9,6 @@ function random (icons) {
}
export default {
- setup (_props, { emit }) {
- const closed = () => {
- emit('onClose')
- }
-
- return {
- closed
- }
- },
-
data () {
return {
originalParentId: null,
@@ -74,6 +64,11 @@ export default {
},
methods: {
+ closed () {
+ this.$store.commit('categories/setCategoryEditId', null)
+ this.$store.dispatch('ui/setActiveTab', null)
+ },
+
handleColorSelect (color) {
this.category.color = color
this.showColors = false
@@ -93,7 +88,7 @@ export default {
this.showParents = false
},
- handleSubmit () {
+ handleSubmit (close) {
if (this.validateForm()) {
const uid = this.$store.state.user.user.uid
const id = this.categoryId || generateId()
@@ -157,11 +152,7 @@ export default {
}
}
- this.$store.commit('categories/setCategoryEditId', null)
- this.$store.dispatch('ui/setActiveTab', 'categories')
-
- if (this.$listeners.callback)
- this.$listeners.callback()
+ close()
}
},
@@ -264,30 +255,32 @@ Portal(
template(v-if="$store.getters['categories/getChildCategoriesIds'](categoryId).length")
.form-line._p0._clean
- SharedInputsCheckbox(
- v-model="applyChildColor"
+ SharedContextMenuItem(
+ :checkboxValue="applyChildColor"
:title="$t('categories.form.childColor')"
- :alt="true"
+ showCheckbox
+ @onClick="applyChildColor = !applyChildColor"
)
template(v-if="$store.getters['categories/getChildCategoriesIds'](categoryId).length === 0")
- .form-line._p0._clean
- SharedInputsCheckbox(
- v-model="category.showInLastUsed"
- :title="$t('categories.form.lastUsed')"
- :alt="true")
- .form-line._p0._clean
- SharedInputsCheckbox(
- v-model="category.showInQuickSelector"
- :title="$t('categories.form.quickSelector')"
- :alt="true")
- template(slot="bottom")
+ SharedContextMenuItem(
+ :checkboxValue="category.showInLastUsed"
+ :title="$t('categories.form.lastUsed')"
+ showCheckbox
+ @onClick="category.showInLastUsed = !category.showInLastUsed"
+ )
+ SharedContextMenuItem(
+ :checkboxValue="category.showInQuickSelector"
+ :title="$t('categories.form.quickSelector')"
+ showCheckbox
+ @onClick="category.showInQuickSelector = !category.showInQuickSelector"
+ )
- .col
+ .col(style="padding-top: 16px; text-align: center")
SharedButton(
:class="['_text-center _blue2 _ml-big', { _inline: $store.state.ui.pc }]"
:title="$t('categories.form.save')"
- @onClick="handleSubmit"
+ @onClick="handleSubmit(close)"
)
//- colors
@@ -361,6 +354,8 @@ Portal(
@import '~assets/stylus/variables'
.header
+ max-width 400px
+ margin 0 auto
padding $m8
flex-grow 1
fontFamilyNunito()
@@ -416,6 +411,8 @@ Portal(
padding-bottom $m8
.content
+ max-width 400px
+ margin 0 auto
padding $m8
background var(--c-bg-3)
+media(600px)
@@ -435,7 +432,6 @@ Portal(
@media $media-laptop
grid-column-gap $m10
grid-row-gap $m10
- padding-bottom $m10
&__i._full
grid-column 1 / -1
diff --git a/components/categories/Form.vue b/components/categories/Form.vue
index 3d11dc7d..8f7117cd 100644
--- a/components/categories/Form.vue
+++ b/components/categories/Form.vue
@@ -158,7 +158,6 @@ export default {
}
this.$store.commit('categories/setCategoryEditId', null)
- this.$store.dispatch('ui/setActiveTab', 'categories')
if (this.$listeners.callback)
this.$listeners.callback()
@@ -251,26 +250,28 @@ export default {
template(v-if="$store.getters['categories/getChildCategoriesIds'](categoryId).length")
.form-line._p0._clean
- SharedInputsCheckbox(
- v-model="applyChildColor"
+ SharedContextMenuItem(
+ :checkboxValue="applyChildColor"
:title="$t('categories.form.childColor')"
- :alt="true"
+ showCheckbox
+ @onClick="applyChildColor = !applyChildColor"
)
template(v-if="$store.getters['categories/getChildCategoriesIds'](categoryId).length === 0")
- .form-line._p0._clean
- SharedInputsCheckbox(
- v-model="category.showInLastUsed"
- :title="$t('categories.form.lastUsed')"
- :alt="true")
- .form-line._p0._clean
- SharedInputsCheckbox(
- v-model="category.showInQuickSelector"
- :title="$t('categories.form.quickSelector')"
- :alt="true")
- template(slot="bottom")
+ SharedContextMenuItem(
+ :checkboxValue="category.showInLastUsed"
+ :title="$t('categories.form.lastUsed')"
+ showCheckbox
+ @onClick="category.showInLastUsed = !category.showInLastUsed"
+ )
+ SharedContextMenuItem(
+ :checkboxValue="category.showInQuickSelector"
+ :title="$t('categories.form.quickSelector')"
+ showCheckbox
+ @onClick="category.showInQuickSelector = !category.showInQuickSelector"
+ )
- .col
+ .col(style="padding-top: 16px; text-align: center")
SharedButton(
:class="['_text-center _blue2 _ml-big', { _inline: $store.state.ui.pc }]"
:title="$t('categories.form.save')"
@@ -422,7 +423,6 @@ export default {
@media $media-laptop
grid-column-gap $m10
grid-row-gap $m10
- padding-bottom $m10
&__i._full
grid-column 1 / -1
@@ -450,7 +450,3 @@ export default {
padding 0
font-size 10px
</style>
-
-<style lang="stylus">
-@import '~assets/stylus/variables'
-</style>
diff --git a/components/categories/Modal.vue b/components/categories/Modal.vue
index 1692c96e..df086fc5 100644
--- a/components/categories/Modal.vue
+++ b/components/categories/Modal.vue
@@ -62,8 +62,6 @@ export default {
this.$store.commit('categories/hideCategoryModal')
this.$store.commit('categories/setCategoryModalId', null)
- this.$store.dispatch('ui/setActiveTab', 'stat')
- this.$store.dispatch('ui/setActiveTabViewName', 'stat')
this.$store.dispatch('ui/setActiveTabStat', 'details')
},
diff --git a/components/currencies/CurrencyModal.vue b/components/currencies/Modal.vue
similarity index 100%
rename from components/currencies/CurrencyModal.vue
rename to components/currencies/Modal.vue
diff --git a/components/groups/GroupItem.vue b/components/groups/GroupItem.vue
index 1f1c2c50..e623d9d1 100644
--- a/components/groups/GroupItem.vue
+++ b/components/groups/GroupItem.vue
@@ -29,9 +29,9 @@ export default {
if (this.group.trnsIds) {
return Object.keys(this.group.trnsIds)
.sort((a, b) => {
- if (!this.$store.state.trns.items[a]) { return }
- if (this.$store.state.trns.items[a].date > this.$store.state.trns.items[b].date) { return -1 }
- if (this.$store.state.trns.items[a].date < this.$store.state.trns.items[b].date) { return 1 }
+ if (!this.$store.state.trns.items[a]) return
+ if (this.$store.state.trns.items[a].date > this.$store.state.trns.items[b].date) return -1
+ if (this.$store.state.trns.items[a].date < this.$store.state.trns.items[b].date) return 1
return 0
})
}
@@ -39,9 +39,9 @@ export default {
},
gotAmount () {
- if (this.trnsIds) {
+ if (this.trnsIds)
return this.$store.getters['trns/getTotalOfTrnsIds'](this.trnsIds)
- }
+
return 0
},
@@ -126,7 +126,20 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/media"
+@import '~assets/stylus/variables'
+
+.sum
+ &__title
+ opacity .6
+ padding-bottom 5px
+ color var(--c-font-4)
+ font-size 10px
+
+ +media-laptop()
+ font-size 11px
+
+ &._right
+ text-align right
.groupItem
overflow hidden
@@ -174,8 +187,8 @@ export default {
border-radius 3px
&__in
- min-width 0px
height 6px
+ min-width 0px
background rgba(44, 173, 34, .7)
&__trns
diff --git a/components/groups/Groups.vue b/components/groups/Groups.vue
index 92157dbe..9946a9c9 100644
--- a/components/groups/Groups.vue
+++ b/components/groups/Groups.vue
@@ -9,7 +9,9 @@ export default {
computed: {
groups () {
const formatedGroups = {}
- if (!this.$store.state.groups) { return }
+ if (!this.$store.state.groups)
+ return
+
for (const id in this.$store.state.groups.items) {
formatedGroups[id] = {
id,
@@ -28,7 +30,7 @@ export default {
</script>
<template lang="pug">
-LayoutComponentWrap
+LayoutBaseWrap
template(slot="headerLeft")
div {{ $t('groups.name') }}
diff --git a/components/layout/Base.vue b/components/layout/Base.vue
deleted file mode 100644
index 46a9d231..00000000
--- a/components/layout/Base.vue
+++ /dev/null
@@ -1,74 +0,0 @@
-<script>
-import { computed, useContext } from '@nuxtjs/composition-api'
-
-export default {
- name: 'LayoutWrap',
-
- setup () {
- const { store } = useContext()
-
- // Computed
- const activeTabViewName = computed(() => store.state.ui.activeTabViewName)
-
- return {
- activeTabViewName
- }
- }
-}
-</script>
-
-<template lang="pug">
-.h100
- LazyStatDashboard(v-if="$store.getters['trns/hasTrns']")
- LazyStatNoStatActions(v-if="!$store.getters['trns/hasTrns']")
-
- //- Analytics
- //-----------------------------
- //- template(v-if="activeTabViewName === 'analytics'")
- //- .pageAnalytics
- //- Analytics
- //- template(#incomes)
- //- .boxTitle {{ $t('money.incomes') }}
-
- //- .boxSummary2
- //- .boxSummary2__item
- //- Amount(
- //- :currency="$store.state.currencies.base"
- //- :type="1"
- //- :value="statCurrentPeriod.incomes.total"
- //- size="xl"
- //- vertical="left"
- //- )
- //- StatSummaryRowItemView(
- //- :type="1"
- //- :amount="statAverage.incomes"
- //- :title="$t('money.average.incomes')"
- //- )
-
- //- template(#expenses)
- //- .boxTitle {{ $t('money.expenses') }}
-
- //- .boxSummary2
- //- .boxSummary2__item
- //- Amount(
- //- :currency="$store.state.currencies.base"
- //- :type="0"
- //- :value="statCurrentPeriod.expenses.total"
- //- size="xl"
- //- vertical="left"
- //- )
- //- StatSummaryRowItemView(
- //- :type="0"
- //- :amount="statAverage.expenses"
- //- :title="$t('money.average.expenses')"
- //- )
-</template>
-
-<style lang="stylus" scoped>
-@import '~assets/stylus/variables'
-
-.h100
- overflow hidden
- display grid
- height 100%
-</style>
diff --git a/components/layout/component/ComponentWrap.vue b/components/layout/BaseWrap.vue
similarity index 100%
rename from components/layout/component/ComponentWrap.vue
rename to components/layout/BaseWrap.vue
diff --git a/components/layout/mobile/BottomMenu.vue b/components/layout/BottomMenu.vue
similarity index 91%
rename from components/layout/mobile/BottomMenu.vue
rename to components/layout/BottomMenu.vue
index f2f387c5..b0b42fef 100644
--- a/components/layout/mobile/BottomMenu.vue
+++ b/components/layout/BottomMenu.vue
@@ -19,7 +19,6 @@ export default {
const { store, app: { i18n } } = useContext()
const route = useRoute()
const router = useRouter()
- const activeTabViewName = computed(() => store.state.ui.activeTabViewName)
const menu = computed(() => ({
stat: {
@@ -51,16 +50,11 @@ export default {
}
router.push(tabName)
- store.dispatch('ui/setActiveTab', tabName)
- store.dispatch('ui/setActiveTabViewName', tabName)
}
function getClassName (tabName) {
if (route.value.name === tabName)
return true
-
- if (route.value.name === 'index')
- return activeTabViewName.value === tabName
}
return {
@@ -144,7 +138,7 @@ export default {
fill var(--c-font-1)
+media(600px)
- padding $m9 0
+ padding $m8 0
svg
width 24px
@@ -152,10 +146,6 @@ export default {
fill var(--c-blue-1)
anim()
- +media(600px)
- width 24px
- height 24px
-
.menu
background var(--c-bg-3)
@@ -185,7 +175,7 @@ export default {
anim()
+media(600px)
- padding $m9 0
+ padding $m8 0
border-radius 8px
+media-hover()
@@ -206,5 +196,5 @@ export default {
font-size 22px
+media(800px)
- font-size 36px
+ font-size 28px
</style>
diff --git a/components/layout/mobile/MenuModal.vue b/components/layout/MenuModal.vue
similarity index 92%
rename from components/layout/mobile/MenuModal.vue
rename to components/layout/MenuModal.vue
index 2cadec2d..502344d6 100644
--- a/components/layout/mobile/MenuModal.vue
+++ b/components/layout/MenuModal.vue
@@ -16,12 +16,10 @@ export default {
</script>
<template lang="pug">
-Portal(
- to="modal"
-)
+Portal(to="modal")
LazyBaseBottomSheet(
v-if="activeTab === 'menu'"
- @closed="$store.dispatch('ui/setActiveTab', 'stat')"
+ @closed="$store.dispatch('ui/setActiveTab', null)"
)
template(#handler="{ close }")
.handler
@@ -39,7 +37,7 @@ Portal(
template
.content
div(style="height: 16px")
- LayoutSidebarBaseMenu
+ LayoutSidebarMenu
div(style="padding: 0 16px 16px 16px")
SharedContextMenuItem(
diff --git a/components/layout/sidebar/LayoutPcSidebar.vue b/components/layout/Sidebar.vue
similarity index 87%
rename from components/layout/sidebar/LayoutPcSidebar.vue
rename to components/layout/Sidebar.vue
index c2244e02..6a2c402b 100644
--- a/components/layout/sidebar/LayoutPcSidebar.vue
+++ b/components/layout/Sidebar.vue
@@ -1,18 +1,6 @@
<script>
export default {
- name: 'LayoutPcSidebar',
-
- data () {
- return {
- visibleSettingsMenu: false
- }
- },
-
- computed: {
- activeTab () {
- return this.$store.state.ui.activeTab
- }
- },
+ name: 'LayoutSidebar',
methods: {
handleShowWalletsModalWalletModal (id) {
@@ -25,7 +13,7 @@ export default {
<template lang="pug" scoped>
.sidebar
- LayoutSidebarBaseMenu
+ LayoutSidebarMenu
.sidebar__content
WalletsTotal
@@ -48,6 +36,7 @@ export default {
grid-template-columns 1fr
grid-template-rows minmax(auto, auto) minmax(auto, auto) 1fr
height 100vh
+ min-width 280px
background var(--c-bg-4)
border-right 1px solid var(--c-bg-2)
diff --git a/components/layout/SidebarMenu.vue b/components/layout/SidebarMenu.vue
new file mode 100644
index 00000000..dc4cdf39
--- /dev/null
+++ b/components/layout/SidebarMenu.vue
@@ -0,0 +1,91 @@
+<script>
+export default {
+ name: 'LayoutSidebarBaseMenu',
+
+ computed: {
+ menu () {
+ return {
+ trnForm: {
+ icon: 'mdi mdi-plus',
+ name: this.$t('createTrn')
+ },
+ index: {
+ icon: 'mdi mdi-poll',
+ name: this.$t('stat.shortTitle')
+ },
+ wallets: {
+ icon: 'mdi mdi-credit-card-multiple',
+ name: this.$t('wallets.name')
+ },
+ categories: {
+ icon: 'mdi mdi-folder-star',
+ name: this.$t('categories.name')
+ },
+ users: {
+ icon: 'mdi mdi-account-multiple',
+ name: this.$t('users.title'),
+ private: true
+ },
+ settings: {
+ icon: 'mdi mdi-cog-outline',
+ name: this.$t('settings.title')
+ }
+ }
+ }
+ },
+
+ methods: {
+ onClickMenu (menuId) {
+ menuId === 'trnForm'
+ ? this.$store.dispatch('trnForm/openTrnForm', { action: 'create' })
+ : this.$router.push(menuId)
+
+ this.$store.dispatch('ui/setActiveTab', null)
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.menu
+ template(v-for="(menuItem, menuId) in menu")
+ .menuItem(
+ v-if="$store.getters['user/isTester'] || !menuItem.private"
+ :class="{ _active: $route.name === menuId }"
+ @click="onClickMenu(menuId)"
+ )
+ .menuItem__icon: div(:class="menuItem.icon")
+ .menuItem__text {{ menuItem.name }}
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.menu
+ padding-bottom $m10
+
+.menuItem
+ cursor pointer
+ display flex
+ align-items center
+ gap $m8
+ padding $m7 $m8
+
+ +media-hover()
+ background var(--c-item3-bg-hover)
+
+ &._active
+ color var(--c-font-2)
+ border-right 4px solid var(--c-bg-8)
+
+ &__icon
+ color var(--c-font-3)
+ font-size 20px
+
+ &__text
+ color var(--c-font-4)
+ font-size 14px
+
+ ~/._active &
+ color var(--c-font-2)
+</style>
diff --git a/components/layout/sidebar/BaseMenu.vue b/components/layout/sidebar/BaseMenu.vue
deleted file mode 100644
index 1af20086..00000000
--- a/components/layout/sidebar/BaseMenu.vue
+++ /dev/null
@@ -1,172 +0,0 @@
-<script>
-export default {
- name: 'LayoutSidebarBaseMenu',
-
- computed: {
- activeTab () {
- return this.$store.state.ui.activeTab
- },
-
- menu () {
- return {
- trnForm: {
- id: 'trnForm',
- icon: 'mdi mdi-plus',
- name: this.$t('createTrn')
- },
- stat: {
- icon: 'mdi mdi-poll',
- name: this.$t('stat.shortTitle')
- },
- wallets: {
- id: 'wallets',
- icon: 'mdi mdi-credit-card-multiple',
- name: this.$t('wallets.name')
- },
- categories: {
- id: 'categories',
- icon: 'mdi mdi-folder-star',
- name: this.$t('categories.name')
- },
- users: {
- icon: 'mdi mdi-account-multiple',
- name: this.$t('users.title'),
- private: true
- },
- settings: {
- icon: 'mdi mdi-cog-outline',
- name: this.$t('settings.title')
- }
- }
- }
- },
-
- methods: {
- handleSetActiveTab (tabName) {
- if (tabName === 'menu') {
- store.dispatch('ui/setActiveTab', 'menu')
- return
- }
- store.dispatch('ui/setActiveTabViewName', tabName)
- },
-
- handleClickMenu (menuId) {
- if (menuId === 'settings') {
- this.$store.dispatch('ui/setActiveTab', 'stat')
- this.$store.dispatch('ui/setActiveTabViewName', 'stat')
- this.$router.push(menuId)
- return
- }
-
- if (menuId === 'wallets') {
- this.$store.dispatch('ui/setActiveTab', 'wallets')
- this.$store.dispatch('ui/setActiveTabViewName', 'wallets')
- this.$router.push(menuId)
- return
- }
-
- if (menuId === 'stat')
- this.$store.dispatch('ui/setActiveTabViewName', 'stat')
-
- if (menuId === 'categories') {
- this.$router.push(menuId)
- this.$store.dispatch('ui/setActiveTab', 'categories')
- this.$store.dispatch('ui/setActiveTabViewName', 'categories')
- return
- }
-
- if (menuId === 'users') {
- this.$router.push(menuId)
- this.$store.dispatch('ui/setActiveTab', 'users')
- this.$store.dispatch('ui/setActiveTabViewName', 'users')
- return
- }
- else if (menuId === 'trnForm') {
- this.$store.dispatch('trnForm/openTrnForm', { action: 'create' })
- return
- }
- else {
- this.$router.push('/')
- }
-
- if (this.$listeners.onClickMenuCalback)
- this.$listeners.onClickMenuCalback()
-
- this.$store.dispatch('ui/setActiveTab', menuId)
- }
- }
-}
-</script>
-
-<template lang="pug">
-.menu
- template(v-for="(menuItem, menuId) in menu")
- .menuItem(
- v-if="$store.getters['user/isTester'] || !menuItem.private"
- :class="{ _active: $route.name === menuId || ($route.name === 'index' && menuId === 'stat'), [`_${menuId}`]: true }"
- @click="handleClickMenu(menuId)"
- )
- .menuItem__icon: div(:class="menuItem.icon")
- .menuItem__text {{ menuItem.name }}
-</template>
-
-<style lang="stylus" scoped>
-@import '~assets/stylus/variables'
-
-item-bg-active()
- background var(--c-bg-6)
-
-.menu
- padding-bottom $m10
-
-.menuItem
- cursor pointer
- display grid
- grid-template-columns 24px 1fr 24px
- grid-column-gap 20px
- align-items center
- height 50px
- padding $m7 $m9
-
- +media-laptop()
- height auto
- padding 16px 20px
-
- &:hover
- +media-laptop()
- background var(--c-bg-6)
-
- &:active
- item-bg-active()
-
- &._active
- color var(--c-font-2)
- border-right 4px solid var(--c-bg-8)
-
- &__icon
- align-self center
- justify-self center
- color var(--c-font-3)
- font-size 20px
- grid-column 1 / 2
-
- &__text
- grid-column 2 / 3
- color var(--c-font-4)
- font-size 14px
-
- ~/._active &
- color var(--c-font-2)
-
- &__arrow
- display flex
- align-items center
- justify-content center
- width 40px
- height 40px
- margin -10px 0
- margin-right -14px
- justify-self end
- color var(--c-font-4)
- font-size 22px
-</style>
diff --git a/components/layout/styles/InfoEmpty.styl b/components/layout/styles/InfoEmpty.styl
deleted file mode 100644
index 0041fa38..00000000
--- a/components/layout/styles/InfoEmpty.styl
+++ /dev/null
@@ -1,29 +0,0 @@
-.emptyInfo
- display flex
- flex-flow row wrap
- align-items center
- justify-content center
- min-height 50vh
-
- &__wrap
- flex-grow 1
- display flex
- flex-flow column nowrap
- align-items center
-
- &__logo
- margin-bottom 32px
-
- &__image
- margin-bottom 32px
- font-size 66px
- color var(--c-incomes-1)
-
- @media $media-laptop
- font-size @font-size * 1.5
-
- &__text
- margin-bottom $m8
-
- &:last-child
- margin-bottom 0
diff --git a/components/layout/styles/common.styl b/components/layout/styles/common.styl
deleted file mode 100644
index f3f3c2f3..00000000
--- a/components/layout/styles/common.styl
+++ /dev/null
@@ -1,98 +0,0 @@
-//------------------------------------------------
-// sum
-//------------------------------------------------
-.sum
- &__title
- opacity .6
- padding-bottom 5px
- font-size 10px
- color var(--c-font-4)
-
- +media-laptop()
- font-size 11px
-
- &._right
- text-align right
-
-
-//------------------------------------------------
-// budgetItem
-//------------------------------------------------
-.budgetItem
- max-width 600px
- position relative
- overflow hidden
- font-size 14px
- background var(--c-bg-4)
- border 1px solid var(--c-bg-5)
- border-radius 3px
-
- &._total
- margin-bottom 24px
- background var(--c-bg-1)
- border-color var(--c-bg-6)
-
- +media-laptop()
- margin-bottom 32px
-
- &__countTotal
- position absolute
- left 12px
- top 0px
- width 12px
- height 2px
- background var(--c-blue-1)
- border-radius 2px
-
- +media-laptop()
- width 16px
- left 16px
-
- &__top
- display flex
- align-items center
- justify-content space-between
- padding 12px
- padding-bottom 0
-
- +media-laptop()
- padding 16px
- padding-bottom 0
-
- &__name
- font-size 14px
-
- &__description
- padding-top 5px
- font-size 11px
- color var(--c-font-4)
-
- &__info
- padding 16px
-
- +media-laptop()
- padding 16px
-
- &__amounts
- display flex
- justify-content space-between
- padding-bottom 8px
-
- &__graph
- overflow hidden
- background var(--c-bg-7)
- border-radius 3px
-
- &__in
- height 6px
- min-width 0px
- background rgba(44, 173, 34, 0.7)
-
- &__trns
- margin-top 1px
- padding 0 12px
- border-top 1px solid var(--c-bg-2)
- background var(--c-bg-3)
-
- +media-laptop()
- padding 0 16px
diff --git a/components/shared/button/Button.vue b/components/shared/button/Button.vue
index fbf897b6..da9f2ade 100644
--- a/components/shared/button/Button.vue
+++ b/components/shared/button/Button.vue
@@ -56,8 +56,7 @@ export default {
v-if="showCheckbox"
@click.prevent=""
)
- SharedInputsCheckbox._small(v-model="checkboxValue")
-
+ SharedInputsCheckbox(v-model="checkboxValue")
</template>
<style lang="stylus">
diff --git a/components/shared/contextMenu/ContextMenuItem.vue b/components/shared/contextMenu/ContextMenuItem.vue
index 64b49dd4..0a4ced87 100644
--- a/components/shared/contextMenu/ContextMenuItem.vue
+++ b/components/shared/contextMenu/ContextMenuItem.vue
@@ -1,26 +1,12 @@
<script>
export default {
props: {
- icon: {
- type: String,
- default: null
- },
- title: {
- type: String,
- required: true
- },
- selected: {
- type: Boolean,
- default: false
- },
- showCheckbox: {
- type: Boolean,
- default: false
- },
- checkboxValue: {
- type: Boolean,
- default: false
- }
+ checkboxValue: { type: Boolean, default: false },
+ grow: { type: Boolean, default: true },
+ icon: { type: String, default: null },
+ selected: { type: Boolean, default: false },
+ showCheckbox: { type: Boolean, default: false },
+ title: { type: String, required: true }
},
methods: {
@@ -35,42 +21,49 @@ export default {
<template lang="pug">
.item(
+ :class="{ _selected: selected, _grow: grow }"
@click="handleClick"
- :class="{ _selected: selected }")
+)
.item__icon(v-if="icon"): div(:class="icon")
.item__title {{ title }}
- .item__check(v-if="showCheckbox" @click.prevent="")
- SharedInputsCheckbox._small(v-model="checkboxValue")
+
+ .item__check(
+ v-if="showCheckbox"
+ @click.prevent=""
+ )
+ SharedInputsCheckbox(v-model="checkboxValue")
</template>
<style lang="stylus" scoped>
-@import '~assets/stylus/variables/margins'
-@import '~assets/stylus/variables/media'
+@import '~assets/stylus/variables'
.item
cursor pointer
display flex
align-items center
- flex-grow 1
- height 44px
- margin $m4 $m4
+ flex-grow 0
+ max-width 400px
+ min-height 44px
+ margin $m4 0
padding 0 $m6
font-size 14px
border-radius $m5
@media $media-laptop
- height 38px
-
- +media-hover()
- &:not(._selected)
- background var(--c-bg-3)
+ max-width 320px
+ min-height 38px
- /.light-mode &
- background var(--c-bg-5)
+ &._grow
+ flex-grow 1
+ width 100%
+ max-width inherit
&._selected
background var(--c-bg-2)
+ +media-hover()
+ background var(--c-item-bg-hover)
+
&__icon
opacity .85
margin-right $m7
@@ -78,9 +71,10 @@ export default {
text-align center
&__title
+ flex-grow 1
color var(--c-font-3)
+ font-size 14px
&__check
- margin-left auto
- padding-left 32px
+ padding-left $m8
</style>
diff --git a/components/shared/inputs/Checkbox.vue b/components/shared/inputs/Checkbox.vue
index ad7f58fe..bd1e7e11 100644
--- a/components/shared/inputs/Checkbox.vue
+++ b/components/shared/inputs/Checkbox.vue
@@ -2,138 +2,54 @@
<script>
export default {
props: {
- value: {
- type: Boolean,
- required: true
- },
- title: {
- type: String,
- default: null
- },
- alt: {
- type: Boolean,
- default: false
- }
+ value: { type: Boolean, required: true },
+ title: { type: String, default: null }
}
}
</script>
<template lang="pug">
-label.checkbox(:class="{ _alt: alt }")
- input.checkbox__input(
- type="checkbox"
- :checked="value"
- @input="$emit('input', $event.target.checked)"
- )
- .checkbox__helper
- .checkbox__toogle
+.checkboxBlock(@click="$emit('click', !value)")
.checkbox__title(v-if="title") {{ title }}
+
+ .checkbox(:class="{ _active: value }")
+ .checkbox__in
</template>
<style lang="stylus" scoped>
@import '~assets/stylus/variables'
-.checkbox
- --width 3.3em
- --height 1.5em
- --left 1.7em
- cursor pointer
- position relative
+.checkboxBlock
display flex
align-items center
- font-size 16px
- $color-rail = var(--c-font-2)
-
- +media-laptop()
- font-size 14px
- &._small
- --width 2.4em
- --height 1.4em
- --left 1.2em
-
- &__title
- padding 0 1em
- font-size 1em
-
- &__input[type='checkbox']
- opacity 0
- position absolute
-
- &:checked
- + .checkbox__helper:before
- background var(--c-blue-1)
- box-shadow inset 0px 1px 1px background var(--c-bg-12)
- ^[0]._alt &
- background var(--c-bg-7)
-
- + .checkbox__helper:after
- left var(--left)
- animation switch .2s ease-out
-
- &__helper
- cursor pointer
- position relative
- width var(--width)
- height var(--height)
- flex-shrink 0
- &:before
- position absolute
- top .5px
- left 0
- width var(--width)
- height var(--height)
- background var(--c-bg-8)
- border-radius 50px
- transition background .1s ease
- content ''
+.checkbox
+ position relative
+ width 44px
+ height 24px
+ // margin-left auto
+ background var(--c-bg-8)
+ border-radius $m8
+ anim()
- // trail
- &:after
- z-index 1
- position absolute
- left 0em
- width var(--height)
- height var(--height)
- background $color-rail
- border-radius 50px
- box-shadow 0px 2px 5px 0px rgba(0, 0, 0, .3)
- transition all .2s ease
- content ''
- animation switch .2s ease-out
- /.light-mode &
- background var(--c-bg-1)
+ &._active
+ background var(--c-blue-3)
- &__toogle
+ &__in
position absolute
- top 0
- right 0
- display flex
- align-items center
- width var(--width)
- height var(--height)
- padding 0 .3em
- padding-top .1em
- ^[0]._small &
- padding-right .02em
- padding-left .02em
-
- &__item
- color var(--c-font-2)
- font-size .7em
- text-align center
- text-transform uppercase
- flex 1 1
- ^[0]._small &
- font-size .5em
- /.light-mode &
- color var(--c-font-1)
- &._on
- content 'on'
- &._off
- content 'off'
+ top 2px
+ left 3px
+ width 20px
+ height 20px
+ background var(--c-font-2)
+ border-radius $m8
+ box-shadow 0px 0px 4px rgba(0, 0, 0, .25)
+ anim()
+
+ ^[0]._active &
+ transform translateX(18px)
-@keyframes switch
- 50%
- transform scaleX(1.3)
+ &__title
+ flex-grow 1
+ padding-right $m7
</style>
diff --git a/components/stat/Dashboard.vue b/components/stat/Dashboard.vue
index ca83487f..e0de73ed 100644
--- a/components/stat/Dashboard.vue
+++ b/components/stat/Dashboard.vue
@@ -14,10 +14,7 @@ export default {
const { getTrnsIds } = useTrns()
const { getStatBy } = getStat()
- const activeTabViewName = computed(() => store.state.ui.activeTabViewName)
- const activeTab = computed(() => store.state.ui.activeTab)
const activeTabStat = computed(() => store.state.ui.activeTabStat)
- const statPage = computed(() => activeTabViewName.value === 'stat')
const statCurrentPeriod = computed(() => store.getters['stat/statCurrentPeriod'])
const statAverage = computed(() => store.getters['stat/statAverage'])
const filterPeriod = computed(() => store.state.filter.period)
@@ -125,10 +122,7 @@ export default {
return {
isShowChart,
- activeTabViewName,
- activeTab,
activeTabStat,
- statPage,
statCurrentPeriod,
statAverage,
filter,
@@ -363,7 +357,10 @@ export default {
//- history
.history(v-if="activeTabStat === 'history' || statAverage && (statAverage.incomes !== 0 && statAverage.expenses !== 0) && ui.showHistory && $store.getters['trns/selectedTrnsIdsWithDate'].length > 0 && (activeTabStat !== 'incomes' && activeTabStat !== 'expenses')")
.baseBox__title(v-if="activeTabStat !== 'history'") {{ $t('trns.history') }}
- TrnsList(:size="50")
+ TrnsList(
+ :size="50"
+ :isShowFilter="activeTabStat === 'history'"
+ )
</template>
<style lang="stylus">
diff --git a/components/stat/DashboardMenu.vue b/components/stat/DashboardMenu.vue
index 109edc7f..5f5b1cb3 100644
--- a/components/stat/DashboardMenu.vue
+++ b/components/stat/DashboardMenu.vue
@@ -7,8 +7,6 @@ export default {
setup () {
const { store } = useContext()
const activeTabStat = computed(() => store.state.ui.activeTabStat)
- const statAverage = computed(() => store.getters['stat/statAverage'])
- const isStatPage = computed(() => store.state.ui.activeTabViewName === 'stat')
function onClickStatMenu (tabName) {
store.dispatch('ui/setActiveTabStat', tabName)
@@ -16,9 +14,6 @@ export default {
return {
activeTabStat,
- statAverage,
- isStatPage,
-
onClickStatMenu
}
}
@@ -26,7 +21,7 @@ export default {
</script>
<template lang="pug">
-.menu(v-if="isStatPage")
+.menu
.menuItem(
:class="{ _active: activeTabStat === 'details' }"
@click="onClickStatMenu('details')"
diff --git a/components/trns/Modal.vue b/components/trns/Modal.vue
index 157fdcb9..f47b6ada 100644
--- a/components/trns/Modal.vue
+++ b/components/trns/Modal.vue
@@ -55,14 +55,14 @@ export default {
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
this.$store.commit('stat/setCategoryModal', { id: null, type: null })
- this.$store.dispatch('ui/setActiveTab', 'stat')
+ this.$store.dispatch('ui/setActiveTabStat', 'details')
},
handleSetFilterWallet () {
this.setWalletFilter(this.$store.state.trns.items[this.trnId].walletId)
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
this.$store.commit('filter/setFilterDateNow')
- this.$store.dispatch('ui/setActiveTab', 'stat')
+ this.$store.dispatch('ui/setActiveTabStat', 'details')
},
handleDublicateTrn () {
const trnId = this.trnId
@@ -181,31 +181,31 @@ Portal(
@click="close()"
) {{ $t('close') }}
- template(v-if="groups && $store.getters['user/isTester']")
- Portal(
- v-if="showModalGroups"
- to="modal"
- )
- ModalBottom(
- :title="$t('groups.name')"
- paddingless
- @onClose="showModalGroups = false"
- )
- template(v-for="(group, groupId) in groups")
- .item(@click="toogleAddToGroup(groupId)")
- .item__active
- template(v-if="trn && trn.groups && trn.groups[groupId]")
- .mdi.mdi-check
- template(v-else)
- .mdi.mdi-plus
- .item__name {{ group.name }}
-
- //- confirm
- ModalBottomConfirm(
- :show="showModalConfirm"
- @onClose="showModalConfirm = false"
- @onConfirm="handleDeleteConfirm"
+ //- groups
+ Portal(
+ v-if="groups && $store.getters['user/isTester'] && showModalGroups"
+ to="modal"
+ )
+ ModalBottom(
+ :title="$t('groups.name')"
+ paddingless
+ @onClose="showModalGroups = false"
)
+ template(v-for="(group, groupId) in groups")
+ .groupItem(@click="toogleAddToGroup(groupId)")
+ .groupItem__active
+ template(v-if="trn && trn.groups && trn.groups[groupId]")
+ .mdi.mdi-check
+ template(v-else)
+ .mdi.mdi-plus
+ .groupItem__name {{ group.name }}
+
+ //- delete confirm
+ ModalBottomConfirm(
+ :show="showModalConfirm"
+ @onClose="showModalConfirm = false"
+ @onConfirm="handleDeleteConfirm"
+ )
</template>
<style lang="stylus" scoped>
@@ -224,7 +224,7 @@ Portal(
background var(--c-bg-3)
border-radius $m7 $m7 0 0
-.item
+.groupItem
cursor pointer
display flex
width 100%
diff --git a/components/trns/list/TrnsList.vue b/components/trns/list/TrnsList.vue
index 12b2c378..22f7a777 100644
--- a/components/trns/list/TrnsList.vue
+++ b/components/trns/list/TrnsList.vue
@@ -3,50 +3,24 @@ export default {
name: 'TrnsList',
props: {
- ui: {
- type: String,
- default: 'history'
- },
- limit: {
- type: Number,
- default: 0
- },
- categoryId: {
- type: String,
- default: null
- },
- expenses: {
- type: Boolean,
- default: false
- },
- incomes: {
- type: Boolean,
- default: false
- },
- size: {
- type: Number,
- required: false,
- default: 30
- }
+ categoryId: { type: String, default: null },
+ expenses: { type: Boolean, default: false },
+ incomes: { type: Boolean, default: false },
+ isShowFilter: { type: Boolean, default: false },
+ limit: { type: Number, default: 0 },
+ size: { type: Number, required: false, default: 30 },
+ ui: { type: String, default: 'history' }
},
data () {
return {
pageNumber: 1,
- sortByEditDate: false
+ sortByEditDate: false,
+ isShowTrnsWithDesc: false
}
},
computed: {
- isShowedAllTrns () {
- return this.paginatedTrnsIds.length === this.trnsIds.length
- },
-
- paginatedTrnsIds () {
- const end = this.pageNumber * this.size
- return this.trnsIds.slice(0, end)
- },
-
trnsIds () {
const trns = this.$store.state.trns.items
let trnsIds = this.$store.getters['trns/selectedTrnsIdsWithDate']
@@ -59,11 +33,35 @@ export default {
if (this.incomes) trnsIds = trnsIds.filter(id => trns[id].type === 1)
if (this.expenses) trnsIds = trnsIds.filter(id => trns[id].type === 0)
- // limit
- if (this.limit > 0) return trnsIds.slice(0, this.limit)
return trnsIds
},
+ isShowedAllTrns () {
+ return this.paginatedTrnsIds.length === this.trnsIdsWithLimit.length
+ },
+
+ isTrnsWithDescription () {
+ const trns = this.$store.state.trns.items
+ return this.trnsIds.filter(id => trns[id].description).length > 0
+ },
+
+ trnsIdsWithLimit () {
+ const trns = this.$store.state.trns.items
+
+ if (this.isShowFilter && this.isShowTrnsWithDesc && this.isTrnsWithDescription)
+ return this.trnsIds.filter(id => trns[id].description)
+
+ if (this.limit > 0)
+ return this.trnsIds.slice(0, this.limit)
+
+ return this.trnsIds
+ },
+
+ paginatedTrnsIds () {
+ const end = this.pageNumber * this.size
+ return this.trnsIdsWithLimit.slice(0, end)
+ },
+
groupedTrns () {
const trns = this.$store.state.trns.items
const trnsList = {}
@@ -86,6 +84,10 @@ export default {
methods: {
showMoreTrns () {
this.pageNumber = this.pageNumber + 1
+ },
+
+ showTrnsWithDesc () {
+ this.isShowTrnsWithDesc = !this.isShowTrnsWithDesc
}
}
}
@@ -93,6 +95,17 @@ export default {
<template lang="pug">
.trnsList
+ template(v-if="isShowFilter && isTrnsWithDescription")
+ .filter
+ SharedContextMenuItem(
+ :checkboxValue="isShowTrnsWithDesc"
+ :grow="false"
+ :title="$t('trns.filter.showTrnsWithDesc')"
+ icon="mdi mdi-comment-text-outline"
+ showCheckbox
+ @onClick="isShowTrnsWithDesc = !isShowTrnsWithDesc"
+ )
+
.trnsList__content
template(v-if="trnsIds.length > 0")
//- history view
@@ -129,6 +142,11 @@ export default {
<style lang="stylus" scoped>
@import '~assets/stylus/variables'
+.filter
+ display flex
+ justify-content flex-end
+ padding-bottom $m6
+
.button
button-base-1()
margin-top $m7
diff --git a/components/wallets/Modal.vue b/components/wallets/Modal.vue
index d9e734ab..67b4662b 100644
--- a/components/wallets/Modal.vue
+++ b/components/wallets/Modal.vue
@@ -57,8 +57,6 @@ export default {
this.$store.commit('wallets/hideWalletsModalWalletModal')
this.$store.commit('wallets/setWalletsModalWalletModalId', null)
- this.$store.dispatch('ui/setActiveTab', 'stat')
- this.$store.dispatch('ui/setActiveTabViewName', 'stat')
this.$store.dispatch('ui/setActiveTabStat', 'details')
},
diff --git a/components/wallets/form/WalletForm.vue b/components/wallets/form/WalletForm.vue
index 3c42e237..9ff75e63 100644
--- a/components/wallets/form/WalletForm.vue
+++ b/components/wallets/form/WalletForm.vue
@@ -71,7 +71,6 @@ export default {
this.$store.dispatch('wallets/addWallet', { id, values: walletsValues })
this.$store.commit('wallets/setWalletEditId', null)
- this.$store.dispatch('ui/setActiveTab', 'wallets')
if (this.$listeners.callback) this.$listeners.callback()
}
@@ -125,7 +124,7 @@ export default {
</script>
<template lang="pug">
-LayoutComponentWrap
+LayoutBaseWrap
template(slot="headerLeft")
template(v-if="!walletId") {{ $t('wallets.createNewTitle') }}
template(v-else) {{ $t('wallets.editTitle') }}
@@ -156,10 +155,11 @@ LayoutComponentWrap
.inputModal__label {{ $t('wallets.form.color.label') }}
.form-line._p0._clean
- SharedInputsCheckbox(
- v-model="wallet.countTotal"
+ SharedContextMenuItem(
+ :checkboxValue="wallet.countTotal"
:title="$t('wallets.form.total.placeholder')"
- :alt="true"
+ showCheckbox
+ @onClick="wallet.countTotal = !wallet.countTotal"
)
//- colors
@@ -203,7 +203,7 @@ LayoutComponentWrap
) {{ currency }}
template(slot="bottom")
- .col
+ .col(style="padding-top: 16px")
SharedButton(
:class="['_text-center _blue2', { _inline: $store.state.ui.pc }]"
:title="$t('wallets.form.save')"
@@ -253,7 +253,6 @@ LayoutComponentWrap
+media-laptop()
grid-column-gap $m10
grid-row-gap $m10
- padding-bottom 24px
&__i._full
grid-column 1 / -1
diff --git a/components/wallets/item/WalletItem.vue b/components/wallets/item/WalletItem.vue
index 30a8361b..11049099 100644
--- a/components/wallets/item/WalletItem.vue
+++ b/components/wallets/item/WalletItem.vue
@@ -39,13 +39,12 @@ export default {
methods: {
handleClick () {
- if (this.$listeners.onClick) {
+ if (this.$listeners.onClick)
this.$listeners.onClick(this.id)
- }
},
handleIconClick () {
- this.$store.dispatch('ui/setActiveTab', 'stat')
+ this.$store.dispatch('ui/setActiveTabStat', 'details')
this.$store.dispatch('filter/setFilterWalletId', this.id)
}
}
diff --git a/components/wallets/item/WalletItem2.vue b/components/wallets/item/WalletItem2.vue
index 3c9bee2a..ebe8544d 100644
--- a/components/wallets/item/WalletItem2.vue
+++ b/components/wallets/item/WalletItem2.vue
@@ -3,30 +3,11 @@ export default {
name: 'WalletItem2',
props: {
- id: {
- type: String,
- required: true
- },
-
- showBase: {
- type: Boolean,
- default: true
- },
-
- vertical: {
- type: String,
- default: 'left'
- },
-
- size: {
- type: String,
- default: null
- },
-
- activeItemId: {
- type: String,
- default: null
- }
+ id: { type: String, required: true },
+ showBase: { type: Boolean, default: true },
+ vertical: { type: String, default: 'left' },
+ size: { type: String, default: null },
+ activeItemId: { type: String, default: null }
},
computed: {
@@ -40,14 +21,8 @@ export default {
methods: {
handleClick () {
- if (this.$listeners.onClick) {
+ if (this.$listeners.onClick)
this.$listeners.onClick(this.id)
- }
- },
-
- handleIconClick () {
- this.$store.dispatch('ui/setActiveTab', 'stat')
- this.$store.dispatch('filter/setFilterWalletId', this.id)
}
}
}
@@ -55,8 +30,8 @@ export default {
<template lang="pug">
.walletItemGrid(
- @click="handleClick"
:class="{ _active: activeItemId === id }"
+ @click="handleClick"
)
.walletItemGrid__active(v-if="activeItemId === id")
.walletItemGrid__line(:style="{ background: wallet.color || $store.state.ui.defaultBgColor }")
diff --git a/components/wallets/sort/WalletsSort.vue b/components/wallets/sort/WalletsSort.vue
index d5ed6e9b..8d08ca36 100644
--- a/components/wallets/sort/WalletsSort.vue
+++ b/components/wallets/sort/WalletsSort.vue
@@ -44,7 +44,7 @@ export default {
</script>
<template lang="pug">
-LayoutComponentWrap(:contentPadding="$store.state.ui.pc")
+LayoutBaseWrap(:contentPadding="$store.state.ui.pc")
template(slot="headerLeft") {{ $t('wallets.sortTitle') }}
template(slot="content")
diff --git a/components/wallets/total/WalletsTotal.vue b/components/wallets/total/WalletsTotal.vue
index ccec7d7b..a8edfac6 100644
--- a/components/wallets/total/WalletsTotal.vue
+++ b/components/wallets/total/WalletsTotal.vue
@@ -64,18 +64,19 @@ export default {
flex-wrap wrap
align-items center
justify-content center
- padding-bottom 16px
+ gap $m8
+ padding 0 $m8
+ padding-bottom $m8
+
+ +media(600px)
+ gap $m8
+ padding 0 $m8
+ padding-bottom $m8
&__item
flex 0 0 0
align-self start
justify-self start
- padding 0 16px
- padding-bottom 16px
-
- +media(600px)
- padding 0 $m9
- padding-bottom $m9
&__title
opacity .6
diff --git a/layouts/default.vue b/layouts/default.vue
index 85757e89..b8cccc09 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -6,7 +6,7 @@ import detectTouch from '~/assets/js/isTouchDevice'
import useUIView from '~/components/layout/useUIView'
export default {
- name: 'AppLayout',
+ name: 'DefaultLayout',
setup () {
const { store } = useContext()
@@ -25,10 +25,7 @@ export default {
const { ui } = useUIView()
// Computed
- const activeTabViewName = computed(() => store.state.ui.activeTabViewName)
const activeTab = computed(() => store.state.ui.activeTab)
- const activeTabStat = computed(() => store.state.ui.activeTabStat)
- const isStatPage = computed(() => activeTabViewName.value === 'stat')
const statCurrentPeriod = computed(() => store.getters['stat/statCurrentPeriod'])
const statAverage = computed(() => store.getters['stat/statAverage'])
@@ -62,8 +59,6 @@ export default {
}
const className = computed(() => ({
- _stat: !!isStatPage.value,
- [`_${activeTabViewName.value}`]: true,
isNotTouchDevice: !isTouchDevice.value,
isTouchDevice: isTouchDevice.value
}))
@@ -80,17 +75,12 @@ export default {
ui,
- activeTabViewName,
activeTab,
- activeTabStat,
- isStatPage,
statCurrentPeriod,
statAverage,
className,
-
- isShowUpdateApp,
- className
+ isShowUpdateApp
}
}
}
@@ -99,11 +89,7 @@ export default {
<template lang="pug">
.layoutNew(:class="className")
.layoutNew__modals
- //- Modals
- //-----------------------------------
- CategoriesModal
- CurrenciesCurrencyModal
-
+ //- trn: form
BaseBottomSheet(
keepAlive
:show="$store.getters['wallets/hasWallets'] && $store.getters['categories/hasCategories'] && $store.state.trnForm.show"
@@ -112,50 +98,45 @@ export default {
template(#handler="{ close }")
.handler
BaseBottomSheetClose(@onClick="close")
-
TrnForm(:show="$store.getters['wallets/hasWallets'] && $store.getters['categories/hasCategories'] && $store.state.trnForm.show")
+ //- trn: item
TrnsModal
- WalletsModal
- //- Base Menu
- LazyLayoutMobileMenuModal(v-if="activeTab === 'menu'")
+ //- menu
+ LazyLayoutMenuModal(v-if="activeTab === 'menu'")
- //- category
- LazyCategoriesEditModal(
- v-if="activeTab === 'createCategory'"
- @onClose="$store.dispatch('ui/setActiveTab', 'stat')"
- )
+ //- currencies
+ CurrenciesModal
- //- Settings
- Portal(
- v-if="activeTab === 'settings'"
- to="modal"
- )
- ModalBottom(@onClose="$store.dispatch('ui/setActiveTab', 'stat')")
+ //- category: item
+ CategoriesModal
+
+ //- category: create or edit
+ LazyCategoriesEditModal(v-if="activeTab === 'createCategory'")
+
+ //- settings
+ Portal(v-if="activeTab === 'settings'" to="modal")
+ ModalBottom(@onClose="$store.dispatch('ui/setActiveTab', null)")
Settings(v-if="activeTab === 'settings'")
- //- Wallet Form: create or edit
- Portal(
- v-if="activeTab === 'createWallet'"
- to="modal"
- )
+ //- wallet item
+ WalletsModal
+
+ //- wallet: create or edit
+ Portal(v-if="activeTab === 'createWallet'" to="modal")
ModalBottom(
:key="$store.state.wallets.editId"
- @onClose="$store.dispatch('ui/setActiveTab', 'stat')"
+ @onClose="$store.dispatch('ui/setActiveTab', null)"
)
WalletsFormWalletForm
- //- Wallet Sort
- Portal(
- v-if="activeTab === 'walletsSort'"
- to="modal"
- key="walletsSort"
- )
+ //- wallet: sort
+ Portal(v-if="activeTab === 'walletsSort'" to="modal" key="walletsSort")
ModalBottom(
isShow
key="walletsSort"
- @onClose="$store.dispatch('ui/setActiveTab', 'stat')"
+ @onClose="$store.dispatch('ui/setActiveTab', null)"
)
template(#default="{ closeModal }")
WalletsSort(
@@ -163,24 +144,24 @@ export default {
@closeModal="closeModal"
)
- //- Loading
+ //- loading
template(v-if="!$store.state.app.status.ready")
LoaderSharedLoader
- //- Notifications
+ //- notifications
Notifications(
:position="$store.state.ui.mobile ? 'top center' : 'top left'"
:width="$store.state.ui.mobile ? '94%' : '380px'"
classes="notifications"
)
- //- Modals
+ //- portal
PortalTarget(
multiple
name="modal"
)
- //- Update modal
+ //- update app
LazyAppUpdateAppModal(
v-if="isShowUpdateApp"
@onClose="isShowUpdateApp = false"
@@ -190,14 +171,14 @@ export default {
//-----------------------------------
.layoutNew__wrap
.layoutNew__sidebar
- LayoutPcSidebar
+ LayoutSidebar
.layoutNew__content
.page2
Nuxt(keep-alive :keep-alive-props="{ include: keepAliveInclude }")
.layoutNew__menu
- LayoutMobileBottomMenu
+ LayoutBottomMenu
</template>
<style lang="stylus">
diff --git a/layouts/login.vue b/layouts/login.vue
index f64d1e02..c7664513 100644
--- a/layouts/login.vue
+++ b/layouts/login.vue
@@ -39,11 +39,6 @@ export default {
isTouchDevice: isTouchDevice.value
}))
- /**
- * Is production
- */
- const isProduction = process.env.NODE_ENV === 'production'
-
/**
* Page dimensions
*/
@@ -61,8 +56,7 @@ export default {
return {
isShowUpdateApp,
- className,
- isProduction
+ className
}
}
}
@@ -97,9 +91,6 @@ export default {
v-if="isShowUpdateApp"
@onClose="isShowUpdateApp = false"
)
-
- //- Metrica
- LazyMetrica(v-if="isProduction")
</template>
<style lang="css">
diff --git a/locales/en-US.js b/locales/en-US.js
index 92035c93..183b10f3 100644
--- a/locales/en-US.js
+++ b/locales/en-US.js
@@ -260,7 +260,10 @@ export default {
trns: {
shortTitle: 'Trns',
history: 'History',
- more: 'Show more'
+ more: 'Show more',
+ filter: {
+ showTrnsWithDesc: 'Only with description'
+ }
},
create: {
diff --git a/locales/ru-RU.js b/locales/ru-RU.js
index 2498136c..d42058e7 100644
--- a/locales/ru-RU.js
+++ b/locales/ru-RU.js
@@ -262,7 +262,10 @@ export default {
trns: {
shortTitle: 'Транзакции',
history: 'История',
- more: 'Показать еще'
+ more: 'Показать еще',
+ filter: {
+ showTrnsWithDesc: 'Только с описанием'
+ }
},
create: {
diff --git a/package.json b/package.json
index e365161e..ead661ec 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "finapp",
- "version": "3.15.2",
+ "version": "3.16.0",
"scripts": {
"dev": "cross-env NUXT_HOST=0.0.0.0 nuxt",
"build": "nuxt build",
diff --git a/pages/categories.vue b/pages/categories.vue
index 6fbe963e..144c7ebc 100644
--- a/pages/categories.vue
+++ b/pages/categories.vue
@@ -1,18 +1,17 @@
<script>
export default {
name: 'CategoriesPage',
- layout: 'app',
head () {
return {
title: this.$t('categories.title')
}
- },
+ }
}
</script>
<template lang="pug">
-LayoutComponentWrap(:contentPadding="false")
+LayoutBaseWrap(:contentPadding="false")
template(slot="content")
.header {{ $t('categories.name') }}
CategoriesList(
diff --git a/pages/clear.vue b/pages/clear.vue
deleted file mode 100644
index f7480600..00000000
--- a/pages/clear.vue
+++ /dev/null
@@ -1,28 +0,0 @@
-<script>
-import localforage from 'localforage'
-
-export default {
- auth: false,
-
- data () {
- return {
- done: false
- }
- },
-
- mounted () {
- localforage.clear()
- this.done = true
- }
-}
-</script>
-
-<template lang="pug">
-div
- template(v-if="done") Ура, кеш почистился
- h1(@click="$router.push('/')") Index
-</template>
-
-<style lang="stylus" scoped>
-
-</style>
diff --git a/pages/groups.vue b/pages/groups.vue
deleted file mode 100644
index 531d0e2b..00000000
--- a/pages/groups.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-<script>
-export default {
- name: 'GroupsPage'
-}
-</script>
-
-<template lang="pug">
-Groups
-</template>
diff --git a/pages/index.vue b/pages/index.vue
index 6bab9ef7..f8173356 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -11,5 +11,57 @@ export default {
</script>
<template lang="pug">
-LayoutBase
+.h100
+ LazyStatDashboard(v-if="$store.getters['trns/hasTrns']")
+ LazyStatNoStatActions(v-if="!$store.getters['trns/hasTrns']")
+
+ //- Analytics
+ //-----------------------------
+ //- template(v-if="activeTabViewName === 'analytics'")
+ //- .pageAnalytics
+ //- Analytics
+ //- template(#incomes)
+ //- .boxTitle {{ $t('money.incomes') }}
+
+ //- .boxSummary2
+ //- .boxSummary2__item
+ //- Amount(
+ //- :currency="$store.state.currencies.base"
+ //- :type="1"
+ //- :value="statCurrentPeriod.incomes.total"
+ //- size="xl"
+ //- vertical="left"
+ //- )
+ //- StatSummaryRowItemView(
+ //- :type="1"
+ //- :amount="statAverage.incomes"
+ //- :title="$t('money.average.incomes')"
+ //- )
+
+ //- template(#expenses)
+ //- .boxTitle {{ $t('money.expenses') }}
+
+ //- .boxSummary2
+ //- .boxSummary2__item
+ //- Amount(
+ //- :currency="$store.state.currencies.base"
+ //- :type="0"
+ //- :value="statCurrentPeriod.expenses.total"
+ //- size="xl"
+ //- vertical="left"
+ //- )
+ //- StatSummaryRowItemView(
+ //- :type="0"
+ //- :amount="statAverage.expenses"
+ //- :title="$t('money.average.expenses')"
+ //- )
</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.h100
+ overflow hidden
+ display grid
+ height 100%
+</style>
diff --git a/pages/settings.vue b/pages/settings.vue
index 011e5510..466ee329 100644
--- a/pages/settings.vue
+++ b/pages/settings.vue
@@ -3,7 +3,6 @@ import pkg from '~/package'
export default {
name: 'SettingsPage',
- layout: 'app',
data () {
return {
@@ -25,7 +24,7 @@ export default {
this.$store.dispatch('demo/createDemo')
if (this.$route.name !== 'index')
- this.$router.push('/')
+ this.$router.push('/welcome')
},
removeUserData () {
@@ -33,14 +32,14 @@ export default {
this.$store.dispatch('user/removeUserData')
if (this.$route.name !== 'index')
- this.$router.push('/')
+ this.$router.push('/welcome')
}
}
}
</script>
<template lang="pug">
-LayoutComponentWrap(:contentPadding="false")
+LayoutBaseWrap(:contentPadding="false")
template(slot="content")
.header {{ $t('settings.title') }}
diff --git a/pages/users.vue b/pages/users.vue
deleted file mode 100644
index 8bad38e7..00000000
--- a/pages/users.vue
+++ /dev/null
@@ -1,287 +0,0 @@
-<script>
-import { db } from '~/services/firebaseConfig'
-
-export default {
- data () {
- return {
- users: null,
- usersUid: {
- wK0dbJDL8xTdfQiyTOhK5dx11nC2: 'ilkome',
- empty: 'Empty',
- demoru: 'demoru',
- nd9fycmgEfMiWKq6cBoui9pszjN2: 'Lesya',
- kXVGIN19Mhd7WZUeTtZRqUSo2aJ3: 'Jenya',
- '8WDRZqvN2AauTXAl4mGwAGyKbbr1': 'Senya',
- tDJ0Bozi9iXh51BWZXzPnE2SnrG3: 'Solves',
- // GB5TxVedunVQuNIqBM4vPwndw9N2: 'Anya',
- Z44Qw7tRHVcBUhd6pTDZxW9oWok2: 'Dev'
- // '9nFJjMSSPMfmTtp8mzaPRoxDDq82': 'Nadya'
- }
- }
- },
-
- head () {
- return {
- title: 'Users'
- }
- },
-
- mounted () {
- this.getUsers()
- },
-
- methods: {
- async getUsers () {
- const monthAgo = this.$day().subtract(2, 'month').valueOf()
- const firebaseItemsReq = await db.ref('users-info')
- .orderByChild('loginDate')
- .startAt(monthAgo)
- .limitToFirst(100)
- .once('value')
-
- const users = firebaseItemsReq.val() || null
- const sortedUsers = []
- if (users) {
- const uids = Object.keys(users)
- .sort((a, b) => {
- if (users[a].loginDate > users[b].loginDate) { return -1 }
- if (users[a].loginDate < users[b].loginDate) { return 1 }
- return 0
- })
-
- // uids
- for (const uid of uids) {
- sortedUsers.push({
- uid,
- ...users[uid]
- })
- }
- }
- this.users = sortedUsers
- },
-
- async getCustomUserData (userUid) {
- this.$store.commit('app/setAppStatus', 'loading')
-
- await this.$store.dispatch('user/setUser', {
- ...this.$store.state.user.user,
- uid: userUid
- })
-
- await this.$store.dispatch('currencies/initCurrencies', null, { root: true })
- await this.$store.dispatch('currencies/initCurrencies', null, { root: true })
- await this.$store.dispatch('categories/initCategories', null, { root: true })
- await this.$store.dispatch('wallets/initWallets', null, { root: true })
- await this.$store.dispatch('trns/initTrns', null, { root: true })
- await this.$store.dispatch('lang/initDbLang', null, { root: true })
-
- this.$router.push('/')
- this.$store.commit('app/setAppStatus', 'ready')
- },
-
- deleteUserOpened (version, uid) {
- if (window.confirm('?')) {
- db.ref(`users-info/${uid}/opensApp/${version}`).set(null)
- this.getUsers()
- }
- },
-
- deleteUserAction (action, uid) {
- if (window.confirm('?')) {
- db.ref(`users-info/${uid}/actions/${action}`).set(null)
- this.getUsers()
- }
- }
- }
-}
-</script>
-
-<template lang="pug">
-LayoutComponentWrap(:contentPadding="false")
- template(slot="content")
- .header Users
-
- template(v-if="$store.getters['user/isTester']")
- .items
- .item(
- v-for="(userName, userUid) in usersUid"
- @click="getCustomUserData(userUid)"
- ) {{ userName }}
-
- .pb_baseOneAndHalf
- SharedButton(
- @click="getUsers"
- title="Update users"
- )
-
- .usersWrap
- .item(
- v-for="user in users"
- )
- .tags
- .tagItem._one(v-if="$day(user.creationDate).isSame(user.loginDate, 'day')") once
- .tagItem._one(v-if="$day(user.creationDate).isSame($day(), 'week')") new
- .tagItem._one(v-if="!$day(user.creationDate).isSame(user.loginDate, 'day')") {{ $day(user.loginDate).from(user.creationDate, true) }}
-
- h2(@click="getCustomUserData(user.uid)") {{ user.name }}
- .pb_base {{ user.uid }}
- .pb_base(v-if="user.theme")
- .item__info._noPad
- .item__title Theme
- .item__date {{ user.theme }}
-
- .div
- .item__info._noPad
- .item__title Last login
- .item__date {{ $day(user.loginDate).format('D MMMM YYYY HH:mm') }}
-
- .pb_base
- .item__info._noPad(v-if="user.creationDate")
- .item__title Creation
- .item__date {{ $day(user.creationDate).format('D MMMM YYYY HH:mm') }}
-
- .pb_base(v-if="user.opensApp")
- .item__info._noPad Opened
- .item__info._noPad(
- v-for="(date, version) in user.opensApp"
- @click="deleteUserOpened(version, user.uid)"
- )
- .item__title {{ version }}
- .item__date {{ $day(date).format('D MMMM YYYY HH:mm') }}
-
- .pb_base(v-if="user.actions")
- .item__info._noPad Actions
- .item__info._noPad(
- v-for="(action, date) in user.actions"
- @click="deleteUserAction(date, user.uid)"
- )
- .item__title {{ action }}
- .item__date {{ $day(date).format('D MMMM YYYY HH:mm') }}
-
- .item__links
- a.item__link(
- :href="`https://finapp-17474.firebaseio.com/users/${user.uid}`"
- target="_blank"
- ) User Data
-
- a.item__link(
- :href="`https://finapp-17474.firebaseio.com/users-info/${user.uid}`"
- target="_blank"
- ) User Info
-</template>
-
-<style lang="stylus" scoped>
-@import '~assets/stylus/variables'
-
-.header
- header-title()
-
-.pb_base
- padding-bottom 12px
-
-.tags
- position absolute
- top 16px
- right 16px
- display flex
- align-items center
- justify-content center
-
-.tagItem
- margin-left 16px
-
-.pageFlow
- overflowScrollY()
- display grid
- width 100%
- height 100%
- padding 0 16px
-
- +media-tablet()
- padding 0 32px
-
-.pageHeader
- position relative
- display flex
- align-items center
- justify-content center
- margin-bottom 32px
-
- &__name
- fontFamilyNunito()
- font-size 2em
- font-weight bold
-
-.usersWrap
-.items
- display grid
- grid-template-columns repeat(auto-fill, minmax(300px, 1fr))
- grid-column-gap 16px
- grid-row-gap 16px
- padding-bottom 32px
- color var(--c-font-2)
-
-.items
- display grid
- grid-template-columns repeat(auto-fill, minmax(100px, 1fr))
- grid-column-gap 16px
- grid-row-gap 16px
-
- .item
- margin 0
- text-align center
-
- &:first-letter
- color var(--blue1)
-
-.item
- position relative
- width 100%
- padding $m8
- background var(--c-item-bg-main)
- border 1px solid transparent
- border-radius $m7
- flex-grow 1
- anim()
-
- +media-hover()
- color var(--c-text-1)
- background var(--c-item-bg-hover)
- border 1px solid var(--c-item-bd-hover)
-
- h2
- padding-right 40px
- padding-bottom 24px
- font-size 24px
- text-transform none
- fontFamilyNunito()
-
- &:first-letter
- color #0094ff
-
- &__info
- display flex
- align-items center
- padding-bottom 8px
-
- &._noPad
- padding-bottom 0
-
- &__icon
- padding-right 8px
-
- &__title
- opacity .6
- padding-right 8px
-
- &__links
- display flex
-
- &__link
- display inline-block
- margin-right 16px
- padding 16px 16px
- color var(--c-font-3)
- font-size 14px
- border-radius 4px
-</style>
diff --git a/pages/wallets.vue b/pages/wallets.vue
index f902fa12..cbfba914 100644
--- a/pages/wallets.vue
+++ b/pages/wallets.vue
@@ -1,7 +1,6 @@
<script>
export default {
name: 'WalletsPage',
- layout: 'app',
head () {
return {
@@ -19,10 +18,13 @@ export default {
</script>
<template lang="pug">
-LayoutComponentWrap(:contentPadding="false")
+LayoutBaseWrap(:contentPadding="false")
template(slot="content")
.header {{ $t('wallets.name') }}
- WalletsTotal
+
+ div(style="padding: 0 0 16px 0")
+ WalletsTotal
+
WalletsList3(
:limit="6"
showToogle
diff --git a/pages/welcome.vue b/pages/welcome.vue
index ea6cf18d..e3d1d168 100644
--- a/pages/welcome.vue
+++ b/pages/welcome.vue
@@ -38,7 +38,6 @@ export default {
methods: {
categoryCreatedCallback () {
this.showCategoryForm = false
- this.$store.dispatch('ui/setActiveTab', 'stat')
},
changeLang (lang) {
@@ -173,9 +172,7 @@ export default {
transition(name="fadeIn")
.tab(v-if="showCategoryForm")
.tab__content
- LazyCategoriesForm(
- @callback="categoryCreatedCallback"
- )
+ LazyCategoriesForm(@callback="categoryCreatedCallback")
.copyright
SharedCopyright
diff --git a/store/app/actions.js b/store/app/actions.js
index d1cea4ec..07f3bb8a 100644
--- a/store/app/actions.js
+++ b/store/app/actions.js
@@ -3,22 +3,20 @@ import { app } from '~/services/firebaseConfig'
export default {
async initApp ({ rootState, commit, dispatch }) {
- if (this.$router.currentRoute.name === 'login') {
+ if (this.$router.currentRoute.name === 'login')
commit('setAppStatus', 'loading')
- }
await dispatch('demo/getDemoDataStatus', null, { root: true })
app.auth().onAuthStateChanged(async (user) => {
- if (this.$router.currentRoute.name === 'login') {
+ if (this.$router.currentRoute.name === 'login')
commit('setAppStatus', 'loading')
- }
if (user) {
try {
- if (rootState.user.user && rootState.user.user.uid && rootState.user.user.uid !== user.uid) {
+ if (rootState.user.user && rootState.user.user.uid && rootState.user.user.uid !== user.uid)
dispatch('clearUserData')
- }
+
await dispatch('user/initUser', user, { root: true })
await dispatch('currencies/initCurrencies', null, { root: true })
await dispatch('categories/initCategories', null, { root: true })
@@ -60,19 +58,19 @@ export default {
localforage.getItem('finapp.filter.period')
])
- if (ativeTab) { dispatch('ui/setActiveTab', ativeTab, { root: true }) }
- if (user) { commit('user/setUser', user, { root: true }) }
- if (currencies) { commit('currencies/setCurrencies', currencies, { root: true }) }
- if (categories) { commit('categories/setCategories', categories, { root: true }) }
- if (wallets) { commit('wallets/setWallets', wallets, { root: true }) }
- if (trns) { commit('trns/setTrns', trns, { root: true }) }
- if (filterPeriod) { dispatch('filter/setPeriod', filterPeriod, { root: true }) }
+ if (ativeTab) dispatch('ui/setActiveTab', ativeTab, { root: true })
+ if (user) commit('user/setUser', user, { root: true })
+ if (currencies) commit('currencies/setCurrencies', currencies, { root: true })
+ if (categories) commit('categories/setCategories', categories, { root: true })
+ if (wallets) commit('wallets/setWallets', wallets, { root: true })
+ if (trns) commit('trns/setTrns', trns, { root: true })
+ if (filterPeriod) dispatch('filter/setPeriod', filterPeriod, { root: true })
// ready
if (categories && user && trns && wallets) {
- if (this.$router.currentRoute.name === 'login') {
+ if (this.$router.currentRoute.name === 'login')
this.app.context.redirect('/')
- }
+
resolve()
}
else {
diff --git a/store/dashboard/actions.js b/store/dashboard/actions.js
deleted file mode 100644
index efba7fa6..00000000
--- a/store/dashboard/actions.js
+++ /dev/null
@@ -1,2 +0,0 @@
-export default {
-}
diff --git a/store/dashboard/getters.js b/store/dashboard/getters.js
deleted file mode 100644
index ee90b165..00000000
--- a/store/dashboard/getters.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export default {
- dashboard (state, getters, rootState, rootGetters) {}
-}
diff --git a/store/dashboard/index.js b/store/dashboard/index.js
deleted file mode 100644
index f9828b45..00000000
--- a/store/dashboard/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import actions from './actions'
-import getters from './getters'
-import mutations from './mutations'
-
-const state = () => ({
- activeTab: 'stat'
-})
-
-export default {
- state,
- actions,
- getters,
- mutations
-}
diff --git a/store/dashboard/mutations.js b/store/dashboard/mutations.js
deleted file mode 100644
index 4f90a9d7..00000000
--- a/store/dashboard/mutations.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default {
- setDashboardActiveTab (state, nextTab) {
- state.activeTab = nextTab
- }
-}
diff --git a/store/ui/actions.js b/store/ui/actions.js
index 4a6d24b1..7f688e76 100644
--- a/store/ui/actions.js
+++ b/store/ui/actions.js
@@ -1,28 +1,13 @@
import localforage from 'localforage'
export default {
- async initUi ({ commit, dispatch }) {
+ async initUi ({ dispatch }) {
const uiLocalStore = await localforage.getItem('finapp.stat')
- const activeTabViewName = await localforage.getItem('finapp.activeTabViewName')
-
- if (activeTabViewName)
- commit('setActiveTabViewName', activeTabViewName)
// ui
if (uiLocalStore) {
if (uiLocalStore.activeTab)
dispatch('setActiveTab', uiLocalStore.activeTab)
-
- if (uiLocalStore.activeTabViewName)
- dispatch('setActiveTabViewName', uiLocalStore.activeTabViewName)
- }
- },
-
- setActiveTabViewName ({ state, commit }, value) {
- if (state.activeTabViewName !== value) {
- commit('setActiveTabViewName', value)
- localforage.setItem('finapp.activeTabViewName', value)
- // TODO: save to composition api
}
},
@@ -87,16 +72,6 @@ export default {
localforage.setItem('finapp.stat', state)
},
- 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
*/
@@ -106,8 +81,7 @@ export default {
const walletName = rootState.filter.walletId || 'root'
const periodName = rootState.filter.period || 'month'
const categoryName = rootState.filter.categoryId || 'root'
- const activeTabViewName = rootState.ui.activeTabViewName || 'expenses'
- const uiItemName = `${walletName}${categoryName}${periodName}${activeTabViewName}`
+ const uiItemName = `${walletName}${categoryName}${periodName}`
await localforage.setItem(localName, {
...localFilterUi,
diff --git a/store/ui/index.js b/store/ui/index.js
index e272e2ca..52f7da30 100644
--- a/store/ui/index.js
+++ b/store/ui/index.js
@@ -3,15 +3,14 @@ import mutations from './mutations'
const state = () => ({
activeTab: 'stat',
- defaultBgColor: '#455a64',
+ activeTabStat: 'details',
width: 0,
height: 0,
mobile: false,
pc: false,
- activeTabStat: 'details',
- activeTabViewName: 'stat'
+ defaultBgColor: '#455a64'
})
export default {
diff --git a/store/ui/mutations.js b/store/ui/mutations.js
index 8a0530eb..33082c10 100644
--- a/store/ui/mutations.js
+++ b/store/ui/mutations.js
@@ -1,9 +1,4 @@
export default {
- // Active Tab in stat v2
- setActiveTabViewName (state, tabViewName) {
- state.activeTabViewName = tabViewName
- },
-
setActiveTab (state, tabName) {
state.activeTab = tabName
},
@@ -17,9 +12,5 @@ export default {
state.pc = props.pc
state.height = props.height
state.width = props.width
- },
-
- setShow (state, { id, value }) {
- state.stat[id] = value
}
}
diff --git a/store/user/actions.js b/store/user/actions.js
index ae4ced5d..ca318ca4 100644
--- a/store/user/actions.js
+++ b/store/user/actions.js
@@ -71,7 +71,7 @@ export default {
removeUserData ({ rootState, commit, dispatch }) {
commit('app/setAppStatus', 'loading', { root: true })
- dispatch('ui/setActiveTab', 'stat', { root: true })
+ dispatch('ui/setActiveTab', null, { root: true })
const uid = rootState.user.user.uid
db.ref(`users/${uid}/accounts/`).set(null)