diff --git a/app/javascript/dashboard/routes/dashboard/conversation/conversation.routes.js b/app/javascript/dashboard/routes/dashboard/conversation/conversation.routes.js index 2411acdbf..14487682e 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/conversation.routes.js +++ b/app/javascript/dashboard/routes/dashboard/conversation/conversation.routes.js @@ -1,28 +1,9 @@ /* eslint arrow-body-style: 0 */ import { frontendURL } from '../../../helper/URLHelper'; const ConversationView = () => 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/:notification_id'), - name: 'inbox_view_conversation', - roles: ['administrator', 'agent'], - component: InboxView, - props: route => { - return { inboxId: 0, notificationId: route.params.notification_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/InboxDetail.vue b/app/javascript/dashboard/routes/dashboard/inbox/InboxDetail.vue new file mode 100644 index 000000000..6b928396f --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/inbox/InboxDetail.vue @@ -0,0 +1,156 @@ + + + + + + + + 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..c6c14a484 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/inbox/InboxEmptyState.vue @@ -0,0 +1,28 @@ + + + + + + + {{ $t('INBOX.LIST.NOTE') }} + + + + + + diff --git a/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue b/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue index bdfda61fe..3651c485c 100644 --- a/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue +++ b/app/javascript/dashboard/routes/dashboard/inbox/InboxList.vue @@ -1,6 +1,7 @@ - - - - - - - - - - - {{ $t('INBOX.LIST.NOTE') }} - - - + + diff --git a/app/javascript/dashboard/routes/dashboard/inbox/routes.js b/app/javascript/dashboard/routes/dashboard/inbox/routes.js new file mode 100644 index 000000000..aa34e892e --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/inbox/routes.js @@ -0,0 +1,32 @@ +import { frontendURL } from 'dashboard/helper/URLHelper'; +const InboxView = () => import('./InboxView.vue'); +const InboxListView = () => import('./InboxList.vue'); +const InboxDetailView = () => import('./InboxDetail.vue'); +const InboxEmptyStateView = () => import('./InboxEmptyState.vue'); + +export const routes = [ + { + path: frontendURL('accounts/:accountId/inbox-view'), + component: InboxView, + children: [ + { + path: '', + name: 'inbox_view', + components: { + default: InboxListView, + detailView: InboxEmptyStateView, + }, + roles: ['administrator', 'agent'], + }, + { + path: ':notification_id', + name: 'inbox_view_conversation', + components: { + default: InboxListView, + detailView: InboxDetailView, + }, + roles: ['administrator', 'agent'], + }, + ], + }, +];