From 4398734bdfd8e59df33a5e75896c8b4aa0062dd9 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Mon, 17 Jan 2022 09:18:54 +0530 Subject: [PATCH] feat: Adds the ability to have custom view for conversations (#3666) * feat: Adds the ability to save custom filters and display folders on the sidebar * Minor fixes * Review fixes * Review fixes * i18n fixes * Shows conversations when the user click on the folder sidebar item * Spacing fixes * Review fixes Co-authored-by: Muhsin Keloth --- app/javascript/dashboard/api/customViews.js | 14 ++ .../dashboard/components/ChatList.vue | 122 +++++++++++++++--- .../dashboard/components/layout/Sidebar.vue | 3 + .../config/sidebarItems/conversations.js | 2 + .../layout/sidebarComponents/Secondary.vue | 28 ++++ .../sidebarComponents/SecondaryNavItem.vue | 2 +- .../widgets/conversation/ConversationCard.vue | 5 + app/javascript/dashboard/helper/URLHelper.js | 3 + .../i18n/locale/en/advancedFilters.json | 14 ++ .../dashboard/i18n/locale/en/settings.json | 7 +- .../conversation/ConversationView.vue | 5 + .../conversation/conversation.routes.js | 19 +++ .../dashboard/customviews/AddCustomViews.vue | 97 ++++++++++++++ app/javascript/dashboard/store/index.js | 2 + .../dashboard/store/modules/customViews.js | 79 ++++++++++++ .../modules/specs/customViews/actions.spec.js | 72 +++++++++++ .../modules/specs/customViews/fixtures.js | 42 ++++++ .../modules/specs/customViews/getters.spec.js | 65 ++++++++++ .../specs/customViews/mutations.spec.js | 29 +++++ .../dashboard/store/mutation-types.js | 6 + .../FluentIcon/dashboard-icons.json | 1 + 21 files changed, 594 insertions(+), 23 deletions(-) create mode 100644 app/javascript/dashboard/api/customViews.js create mode 100644 app/javascript/dashboard/routes/dashboard/customviews/AddCustomViews.vue create mode 100644 app/javascript/dashboard/store/modules/customViews.js create mode 100644 app/javascript/dashboard/store/modules/specs/customViews/actions.spec.js create mode 100644 app/javascript/dashboard/store/modules/specs/customViews/fixtures.js create mode 100644 app/javascript/dashboard/store/modules/specs/customViews/getters.spec.js create mode 100644 app/javascript/dashboard/store/modules/specs/customViews/mutations.spec.js diff --git a/app/javascript/dashboard/api/customViews.js b/app/javascript/dashboard/api/customViews.js new file mode 100644 index 000000000..bb09047ba --- /dev/null +++ b/app/javascript/dashboard/api/customViews.js @@ -0,0 +1,14 @@ +/* global axios */ +import ApiClient from './ApiClient'; + +class CustomViewsAPI extends ApiClient { + constructor() { + super('custom_filters', { accountScoped: true }); + } + + getCustomViews() { + return axios.get(this.url); + } +} + +export default new CustomViewsAPI(); diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue index bb7858e6c..8affb6066 100644 --- a/app/javascript/dashboard/components/ChatList.vue +++ b/app/javascript/dashboard/components/ChatList.vue @@ -1,26 +1,39 @@ -l