Skip to content

Open source personal finance application

Remove FilterModal

ilkomeb480e06f4180
diff --git a/src/components/filter/FilterModal.vue b/src/components/filter/FilterModal.vue
deleted file mode 100644
index 459d579f..00000000
--- a/src/components/filter/FilterModal.vue
+++ /dev/null
@@ -1,126 +0,0 @@
-<script>
-import FilterItem from '@/components/filter/FilterItem'
-import ModalBottom from '@/components/modal/ModalBottom'
-
-export default {
- components: {
- FilterItem,
- ModalBottom
- },
-
- computed: {
- filterCategory () {
- return this.$store.state.categories.items[this.$store.state.filter.categoryId]
- },
-
- filterCategoryParent () {
- return this.$store.state.categories.items[this.filterCategory.parentId]
- },
-
- filterWallet () {
- return this.$store.state.wallets.items[this.$store.state.filter.walletId]
- }
- },
-
- methods: {
- clearCategoryFilter () {
- if (!this.$store.state.filter.walletId && !this.filterCategoryParent) {
- this.$store.commit('toogleFilterModal')
- }
- setTimeout(() => {
- const nextCategory = this.filterCategory.parentId !== 0 ? this.filterCategory.parentId : null
- this.$store.dispatch('setFilterCategoryId', nextCategory)
- }, 50)
- },
-
- clearParentCategoryFilter () {
- if (!this.$store.state.filter.walletId) this.$store.commit('toogleFilterModal')
- setTimeout(() => {
- this.$store.dispatch('setFilterCategoryId', null)
- }, 50)
- },
-
- clearWalletFilter () {
- if (!this.$store.state.filter.categoryId) this.$store.commit('toogleFilterModal')
- setTimeout(() => {
- this.$store.dispatch('setFilterWalletId', null)
- }, 50)
- },
-
- clearFilter () {
- this.$store.commit('toogleFilterModal')
- setTimeout(() => {
- this.$store.commit('setFilterCategoryId', null)
- this.$store.commit('setFilterWalletId', null)
- }, 50)
- }
- }
-}
-</script>
-
-<template lang="pug">
-ModalBottom(
- :show="$store.state.filter.showFilterModal"
- title="Filter"
- v-on:onClose="$store.commit('toogleFilterModal')"
-)
- .filterItems
- //- wallet
- template(v-if="$store.state.filter.walletId")
- FilterItem(
- :color="filterWallet.color || $store.state.ui.defaultBgColor"
- :name="filterWallet.name"
- icon="mdi mdi-credit-card-multiple"
- v-on:onClick="clearWalletFilter"
- )
-
- //- parent category
- template(v-if="$store.state.filter.categoryId")
- template(v-if="filterCategory.parentId !== 0")
- FilterItem(
- :color="filterCategoryParent.color || $store.state.ui.defaultBgColor"
- :icon="filterCategoryParent.icon"
- :name="filterCategoryParent.name"
- v-on:onClick="clearParentCategoryFilter"
- )
-
- //- category
- FilterItem(
- :color="filterCategory.color || $store.state.ui.defaultBgColor"
- :icon="filterCategory.icon"
- :name="filterCategory.name"
- v-on:onClick="clearCategoryFilter"
- )
-
- .filterBtnAlign
- .filterBtn(@click="clearFilter")
- .filterBtn__icon: .mdi.mdi-filter-remove-outline
- .filterBtn__name Clear filter
-</template>
-
-<style lang="stylus" scoped>
-@import "~@/stylus/variables/margins"
-
-.filterBtnAlign
- display flex
- justify-content center
-
-.filterBtn
- display flex
- align-items center
- justify-content center
- margin-top $m9
- padding $m7 $m9
- color var(--c-font-1)
- background var(--c-blue-1)
- border-radius $m3
-
- &__icon
- padding-right $m6
- opacity .8
- width 36px
- font-size 22px
-
- &__name
- font-size 18px
-</style>
diff --git a/src/components/filter/store/index.js b/src/components/filter/store/index.js
index ac682b15..333f7750 100644
--- a/src/components/filter/store/index.js
+++ b/src/components/filter/store/index.js
@@ -9,7 +9,6 @@ const state = {
walletId: null,
date: moment().valueOf(),
period: 'week',
- showFilterModal: false
}
export default {
diff --git a/src/components/filter/store/mutations.js b/src/components/filter/store/mutations.js
index 032156e3..76d7bac2 100644
--- a/src/components/filter/store/mutations.js
+++ b/src/components/filter/store/mutations.js
@@ -8,10 +8,6 @@ import moment from 'moment'
// setPeriodNext
// setPeriodPrev
export default {
- toogleFilterModal (state) {
- state.showFilterModal = !state.showFilterModal
- },
-
setDate (state, date) {
state.date = moment(date).valueOf()
},
diff --git a/src/components/layout/LayoutMobile.vue b/src/components/layout/LayoutMobile.vue
index 3963e43e..2cdecccf 100644
--- a/src/components/layout/LayoutMobile.vue
+++ b/src/components/layout/LayoutMobile.vue
@@ -3,7 +3,6 @@ import CategoriesList from '@/components/categories/list/CategoriesList'
import CategoryForm from '@/components/categories/form/CategoryForm'
import CategoryModal from '@/components/categories/modal/CategoryModal'
import CurrencyModal from '@/components/currencies/CurrencyModal'
-import FilterModal from '@/components/filter/FilterModal'
import LayoutMobileMenu from '@/components/layout/LayoutMobileMenu'
import Settings from '@/components/settings/Settings'
import StatChartDonut from '@/components/stat/StatChartDonut'
@@ -23,7 +22,6 @@ export default {
CategoryForm,
CategoryModal,
CurrencyModal,
- FilterModal,
LayoutMobileMenu,
Settings,
StatChartDonut,
@@ -118,7 +116,6 @@ export default {
//- modals
CategoryModal
CurrencyModal
- FilterModal
TrnForm
TrnModal
WalletModal