From 0685e04aae25b17460a1b0abe5575d0eea7a9aff Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Fri, 8 Mar 2024 07:57:39 +0530 Subject: [PATCH] feat: Add inbox view under feature flag on the sidebar (#9049) Co-authored-by: Pranav --- .../components/buttons/ResolveAction.vue | 2 +- .../layout/config/sidebarItems/primaryMenu.js | 9 + .../widgets/conversation/ConversationBox.vue | 7 +- .../conversation/ConversationHeader.vue | 7 +- .../dashboard/i18n/locale/en/inbox.json | 5 +- .../dashboard/i18n/locale/en/settings.json | 1 + .../conversation/conversation.routes.js | 19 -- .../routes/dashboard/dashboard.routes.js | 2 + .../dashboard/inbox/InboxEmptyState.vue | 40 ++++ .../routes/dashboard/inbox/InboxList.vue | 102 ++++---- .../routes/dashboard/inbox/InboxView.vue | 221 ++++++++---------- .../dashboard/inbox/components/InboxCard.vue | 55 ++--- .../inbox/components/InboxItemHeader.vue | 42 ++-- .../inbox/components/InboxListHeader.vue | 42 ++-- .../inbox/components/PaginationButton.vue | 4 +- .../routes/dashboard/inbox/routes.js | 25 ++ .../store/modules/notifications/getters.js | 3 + .../specs/notifications/getters.spec.js | 10 + 18 files changed, 340 insertions(+), 256 deletions(-) create mode 100644 app/javascript/dashboard/routes/dashboard/inbox/InboxEmptyState.vue create mode 100644 app/javascript/dashboard/routes/dashboard/inbox/routes.js diff --git a/app/javascript/dashboard/components/buttons/ResolveAction.vue b/app/javascript/dashboard/components/buttons/ResolveAction.vue index 1d80defeb..84e33cc42 100644 --- a/app/javascript/dashboard/components/buttons/ResolveAction.vue +++ b/app/javascript/dashboard/components/buttons/ResolveAction.vue @@ -48,7 +48,7 @@ v-on-clickaway="closeDropdown" class="dropdown-pane dropdown-pane--open" > - + [ + { + icon: 'mail-inbox', + key: 'inboxView', + label: 'INBOX_VIEW', + featureFlag: FEATURE_FLAGS.INBOX_VIEW, + toState: frontendURL(`accounts/${accountId}/inbox-view`), + toStateName: 'inbox_view', + roles: ['administrator', 'agent'], + }, { icon: 'chat', key: 'conversations', diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationBox.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationBox.vue index dad5c9c0b..2ad77452d 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ConversationBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ConversationBox.vue @@ -8,7 +8,7 @@ :chat="currentChat" :is-inbox-view="isInboxView" :is-contact-panel-open="isContactPanelOpen" - :show-back-button="isOnExpandedLayout" + :show-back-button="isOnExpandedLayout && !isInboxView" @contact-panel-toggle="onToggleContactPanel" /> - +
import('./ConversationView'); -const InboxView = () => import('../inbox/InboxView.vue'); export default { routes: [ - { - path: frontendURL('accounts/:accountId/inbox-view'), - name: 'inbox_view', - roles: ['administrator', 'agent'], - component: InboxView, - props: () => { - return { inboxId: 0 }; - }, - }, - { - path: frontendURL('accounts/:accountId/inbox-view/:conversation_id'), - name: 'inbox_view_conversation', - roles: ['administrator', 'agent'], - component: InboxView, - props: route => { - return { inboxId: 0, conversationId: route.params.conversation_id }; - }, - }, { path: frontendURL('accounts/:accountId/dashboard'), name: 'home', diff --git a/app/javascript/dashboard/routes/dashboard/dashboard.routes.js b/app/javascript/dashboard/routes/dashboard/dashboard.routes.js index 712e05928..9e18ca42c 100644 --- a/app/javascript/dashboard/routes/dashboard/dashboard.routes.js +++ b/app/javascript/dashboard/routes/dashboard/dashboard.routes.js @@ -3,6 +3,7 @@ import conversation from './conversation/conversation.routes'; import { routes as searchRoutes } from '../../modules/search/search.routes'; import { routes as contactRoutes } from './contacts/routes'; import { routes as notificationRoutes } from './notifications/routes'; +import { routes as inboxRoutes } from './inbox/routes'; import { frontendURL } from '../../helper/URLHelper'; import helpcenterRoutes from './helpcenter/helpcenter.routes'; @@ -16,6 +17,7 @@ export default { path: frontendURL('accounts/:account_id'), component: AppContainer, children: [ + ...inboxRoutes, ...conversation.routes, ...settings.routes, ...contactRoutes, diff --git a/app/javascript/dashboard/routes/dashboard/inbox/InboxEmptyState.vue b/app/javascript/dashboard/routes/dashboard/inbox/InboxEmptyState.vue new file mode 100644 index 000000000..49ab0a709 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/inbox/InboxEmptyState.vue @@ -0,0 +1,40 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue b/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue index bb0f2e7df..93ba310c3 100644 --- a/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue +++ b/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue @@ -1,43 +1,47 @@ +