Chatwoot/app/javascript/dashboard/routes/dashboard/settings/inbox/inbox.routes.js
Sojan Jose 19ab0fe108
Chore: Scope URLs with account_id (#601)
* Chore: Enable Users to create multiple accounts

Addresses: #402
- migrations to split roles and other attributes from users table
- make changes in code to accommodate this change

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
2020-03-09 23:27:10 +05:30

81 lines
2.3 KiB
JavaScript

/* eslint arrow-body-style: 0 */
import SettingsContent from '../Wrapper';
import Settings from './Settings';
import InboxHome from './Index';
import InboxChannel from './InboxChannels';
import ChannelList from './ChannelList';
import channelFactory from './channel-factory';
import AddAgents from './AddAgents';
import FinishSetup from './FinishSetup';
import { frontendURL } from '../../../../helper/URLHelper';
export default {
routes: [
{
path: frontendURL('accounts/:accountId/settings/inboxes'),
component: SettingsContent,
props: params => {
const showBackButton = params.name !== 'settings_inbox_list';
return {
headerTitle: 'INBOX_MGMT.HEADER',
headerButtonText: 'SETTINGS.INBOXES.NEW_INBOX',
icon: 'ion-archive',
newButtonRoutes: ['settings_inbox_list'],
showBackButton,
};
},
children: [
{
path: '',
name: 'settings_inbox',
redirect: 'list',
},
{
path: 'list',
name: 'settings_inbox_list',
component: InboxHome,
roles: ['administrator', 'agent'],
},
{
path: 'new',
component: InboxChannel,
children: [
{
path: '',
name: 'settings_inbox_new',
component: ChannelList,
roles: ['administrator'],
},
{
path: ':inbox_id/finish',
name: 'settings_inbox_finish',
component: FinishSetup,
roles: ['administrator'],
},
{
path: ':sub_page',
name: 'settings_inboxes_page_channel',
component: channelFactory.create(),
roles: ['administrator'],
props: route => {
return { channel_name: route.params.sub_page };
},
},
{
path: ':inbox_id/agents',
name: 'settings_inboxes_add_agents',
roles: ['administrator'],
component: AddAgents,
},
],
},
{
path: ':inboxId',
name: 'settings_inbox_show',
component: Settings,
roles: ['administrator'],
},
],
},
],
};