feat: Add inbox view page (#8814)
* feat: Add inbox view page * Update accounts.js * Update index.js
This commit is contained in:
@@ -5,6 +5,7 @@ import { routes as contactRoutes } from './contacts/routes';
|
||||
import { routes as notificationRoutes } from './notifications/routes';
|
||||
import { frontendURL } from '../../helper/URLHelper';
|
||||
import helpcenterRoutes from './helpcenter/helpcenter.routes';
|
||||
import { routes as inboxRoutes } from './inbox/routes';
|
||||
|
||||
const AppContainer = () => import('./Dashboard.vue');
|
||||
const Suspended = () => import('./suspended/Index.vue');
|
||||
@@ -21,6 +22,7 @@ export default {
|
||||
...contactRoutes,
|
||||
...searchRoutes,
|
||||
...notificationRoutes,
|
||||
...inboxRoutes,
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<h1>Inbox View</h1>
|
||||
</template>
|
||||
|
||||
<script setup></script>
|
||||
25
app/javascript/dashboard/routes/dashboard/inbox/routes.js
Normal file
25
app/javascript/dashboard/routes/dashboard/inbox/routes.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/* eslint arrow-body-style: 0 */
|
||||
import { frontendURL } from '../../../helper/URLHelper';
|
||||
const SettingsWrapper = () => import('../settings/Wrapper.vue');
|
||||
const InboxView = () => import('./components/InboxView.vue');
|
||||
|
||||
export const routes = [
|
||||
{
|
||||
path: frontendURL('accounts/:accountId/inbox'),
|
||||
component: SettingsWrapper,
|
||||
props: {
|
||||
headerTitle: 'INBOX_PAGE.HEADER',
|
||||
icon: 'alert',
|
||||
showNewButton: false,
|
||||
showSidemenuIcon: false,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'inbox_index',
|
||||
component: InboxView,
|
||||
roles: ['administrator', 'agent'],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -5,6 +5,7 @@ import dashboard from './dashboard/dashboard.routes';
|
||||
import store from '../store';
|
||||
import { validateLoggedInRoutes } from '../helper/routeHelpers';
|
||||
import AnalyticsHelper from '../helper/AnalyticsHelper';
|
||||
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
||||
|
||||
const routes = [...dashboard.routes];
|
||||
|
||||
@@ -41,6 +42,16 @@ export const validateAuthenticateRoutePermission = (to, next, { getters }) => {
|
||||
return '/app/login';
|
||||
}
|
||||
|
||||
// Open inbox view if inbox view feature is enabled, else redirect to dashboard
|
||||
// TODO: Remove this code once inbox view feature is enabled for all accounts
|
||||
const isInboxViewEnabled = store.getters['accounts/isFeatureEnabledGlobally'](
|
||||
user.account_id,
|
||||
FEATURE_FLAGS.INBOX_VIEW
|
||||
);
|
||||
if (to.name === 'inbox_index' && !isInboxViewEnabled) {
|
||||
return next(frontendURL(`accounts/${user.account_id}/dashboard`));
|
||||
}
|
||||
|
||||
if (!to.name) {
|
||||
return next(frontendURL(`accounts/${user.account_id}/dashboard`));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user