From 3b9deb24342b68d4a38c055034902335f992fc92 Mon Sep 17 00:00:00 2001 From: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com> Date: Tue, 19 Oct 2021 21:16:46 +0530 Subject: [PATCH] Refactor to make the filter component resuable. --- .../dashboard/components/ChatList.vue | 5 +- .../conversation/ChatAdvancedFilter.vue | 86 +++++---- .../conversation/components/FilterInput.vue | 176 ++++++++++++++++++ 3 files changed, 231 insertions(+), 36 deletions(-) create mode 100644 app/javascript/dashboard/components/widgets/conversation/components/FilterInput.vue diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue index 1fb15e50c..0b66b6b6a 100644 --- a/app/javascript/dashboard/components/ChatList.vue +++ b/app/javascript/dashboard/components/ChatList.vue @@ -6,7 +6,7 @@ {{ pageTitle }} - + @@ -61,6 +61,7 @@ > @@ -77,6 +78,7 @@ import timeMixin from '../mixins/time'; import eventListenerMixins from 'shared/mixins/eventListenerMixins'; import conversationMixin from '../mixins/conversations'; import wootConstants from '../constants'; +import advancedFilterTypes from './widgets/conversation/advancedFilterItems'; import { hasPressedAltAndJKey, hasPressedAltAndKKey, @@ -108,6 +110,7 @@ export default { activeAssigneeTab: wootConstants.ASSIGNEE_TYPE.ME, activeStatus: wootConstants.STATUS_TYPE.OPEN, showAdvancedFilters: false, + advancedFilterTypes, }; }, computed: { diff --git a/app/javascript/dashboard/components/widgets/conversation/ChatAdvancedFilter.vue b/app/javascript/dashboard/components/widgets/conversation/ChatAdvancedFilter.vue index 3e63fff39..ea3c88009 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ChatAdvancedFilter.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ChatAdvancedFilter.vue @@ -1,39 +1,37 @@ - - - - {{ $t('FILTER.SUBTITLE') }} - - - - - - - - - {{ $t('FILTER.ADD_NEW_FILTER') }} - - -
- {{ $t('FILTER.SUBTITLE') }} -