From 28950a8fb8d1aac57cb397be7b276861c37b1578 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 24 Sep 2020 23:56:59 +0300 Subject: [PATCH] Add Unconfirmed filter --- src/lang/en.js | 3 ++- src/store/modules/users.js | 15 ++++++++++++--- src/views/users/components/UsersFilter.vue | 16 +++++++++------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/lang/en.js b/src/lang/en.js index affc2772..a6a26f27 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -350,7 +350,8 @@ export default { byStatus: 'By status', active: 'Active', pending: 'Pending Approval', - deactivated: 'Deactivated' + deactivated: 'Deactivated', + unconfirmed: 'Unconfirmed' }, reports: { reports: 'Reports', diff --git a/src/store/modules/users.js b/src/store/modules/users.js index 572c0fd7..1fe39f1b 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -36,7 +36,8 @@ const users = { external: false, active: false, need_approval: false, - deactivated: false + deactivated: false, + need_confirmed: false }, passwordResetToken: { token: '', @@ -148,7 +149,14 @@ const users = { }, ClearUsersState({ commit }) { commit('SET_SEARCH_QUERY', '') - commit('SET_USERS_FILTERS', { local: false, external: false, active: false, need_approval: false, deactivated: false }) + commit('SET_USERS_FILTERS', + { local: false, + external: false, + active: false, + need_approval: false, + deactivated: false, + need_confirmed: false + }) }, async ClearFilters({ commit, dispatch, state }) { commit('CLEAR_USERS_FILTERS') @@ -308,7 +316,8 @@ const users = { external: false, active: false, need_approval: false, - deactivated: false + deactivated: false, + need_confirmed: false } const currentFilters = { ...defaultFilters, ...filters } commit('SET_USERS_FILTERS', currentFilters) diff --git a/src/views/users/components/UsersFilter.vue b/src/views/users/components/UsersFilter.vue index 9ba4e3fa..ff54e27d 100644 --- a/src/views/users/components/UsersFilter.vue +++ b/src/views/users/components/UsersFilter.vue @@ -7,13 +7,14 @@ class="select-field" @change="toggleFilters"> - {{ $t('usersFilter.local') }} - {{ $t('usersFilter.external') }} + {{ $t('usersFilter.local') }} + {{ $t('usersFilter.external') }} - {{ $t('usersFilter.active') }} - {{ $t('usersFilter.pending') }} - {{ $t('usersFilter.deactivated') }} + {{ $t('usersFilter.active') }} + {{ $t('usersFilter.deactivated') }} + {{ $t('usersFilter.pending') }} + {{ $t('usersFilter.unconfirmed') }} @@ -43,6 +44,7 @@ export default { const indexOfActive = this.$data.value.indexOf('active') const indexOfDeactivated = this.$data.value.indexOf('deactivated') const indexOfPending = this.$data.value.indexOf('need_approval') + const indexOfUnconfirmed = this.$data.value.indexOf('need_confirmed') if (this.$data.value.length === filtersQuantity) { return [] @@ -52,8 +54,8 @@ export default { ? currentFilters.push(this.$data.value[Math.max(indexOfLocal, indexOfExternal)]) : currentFilters - Math.max(indexOfActive, indexOfDeactivated, indexOfPending) > -1 - ? currentFilters.push(this.$data.value[Math.max(indexOfActive, indexOfDeactivated, indexOfPending)]) + Math.max(indexOfActive, indexOfDeactivated, indexOfPending, indexOfUnconfirmed) > -1 + ? currentFilters.push(this.$data.value[Math.max(indexOfActive, indexOfDeactivated, indexOfPending, indexOfUnconfirmed)]) : currentFilters return currentFilters