feat: Add inbox view page (#8814)

* feat: Add inbox view page

* Update accounts.js

* Update index.js
This commit is contained in:
Muhsin Keloth
2024-01-30 13:55:20 +05:30
committed by GitHub
parent 0805f362d3
commit f2115b15f7
9 changed files with 91 additions and 2 deletions

View File

@@ -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`));
}