chore: Add router views for agent_bots (#5600)
This commit is contained in:
parent
38776906ab
commit
9b5c0de0ea
12 changed files with 168 additions and 61 deletions
|
@ -3,6 +3,7 @@ import { frontendURL } from '../../../../helper/URLHelper';
|
|||
const settings = accountId => ({
|
||||
parentNav: 'settings',
|
||||
routes: [
|
||||
'agent_bots',
|
||||
'agent_list',
|
||||
'canned_list',
|
||||
'labels_list',
|
||||
|
@ -74,10 +75,20 @@ const settings = accountId => ({
|
|||
{
|
||||
icon: 'automation',
|
||||
label: 'AUTOMATION',
|
||||
beta: true,
|
||||
hasSubMenu: false,
|
||||
toState: frontendURL(`accounts/${accountId}/settings/automation/list`),
|
||||
toStateName: 'automation_list',
|
||||
},
|
||||
{
|
||||
icon: 'bot',
|
||||
label: 'AGENT_BOTS',
|
||||
beta: true,
|
||||
hasSubMenu: false,
|
||||
toState: frontendURL(`accounts/${accountId}/settings/agent-bots`),
|
||||
toStateName: 'agent_bots',
|
||||
featureFlagKey: 'agent_bots',
|
||||
},
|
||||
{
|
||||
icon: 'chat-multiple',
|
||||
label: 'CANNED_RESPONSES',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<li class="sidebar-item">
|
||||
<li v-show="isMenuItemVisible" class="sidebar-item">
|
||||
<div v-if="hasSubMenu" class="secondary-menu--wrap">
|
||||
<span class="secondary-menu--header fs-small">
|
||||
{{ $t(`SIDEBAR.${menuItem.label}`) }}
|
||||
|
@ -36,7 +36,7 @@
|
|||
{{ `${menuItem.count}` }}
|
||||
</span>
|
||||
<span
|
||||
v-if="menuItem.label === 'AUTOMATION'"
|
||||
v-if="menuItem.beta"
|
||||
data-view-component="true"
|
||||
label="Beta"
|
||||
class="beta"
|
||||
|
@ -114,10 +114,23 @@ export default {
|
|||
},
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({ activeInbox: 'getSelectedInbox' }),
|
||||
...mapGetters({
|
||||
activeInbox: 'getSelectedInbox',
|
||||
accountId: 'getCurrentAccountId',
|
||||
isFeatureEnabledonAccount: 'accounts/isFeatureEnabledonAccount',
|
||||
}),
|
||||
hasSubMenu() {
|
||||
return !!this.menuItem.children;
|
||||
},
|
||||
isMenuItemVisible() {
|
||||
if (!this.menuItem.featureFlagKey) {
|
||||
return true;
|
||||
}
|
||||
return this.isFeatureEnabledonAccount(
|
||||
this.accountId,
|
||||
this.menuItem.featureFlagKey
|
||||
);
|
||||
},
|
||||
isInboxConversation() {
|
||||
return (
|
||||
this.$store.state.route.name === 'inbox_conversation' &&
|
||||
|
|
5
app/javascript/dashboard/i18n/locale/en/agentBots.json
Normal file
5
app/javascript/dashboard/i18n/locale/en/agentBots.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"AGENT_BOTS": {
|
||||
"HEADER": "Bots"
|
||||
}
|
||||
}
|
|
@ -1,55 +1,57 @@
|
|||
import { default as _advancedFilters } from './advancedFilters.json';
|
||||
import { default as _agentMgmt } from './agentMgmt.json';
|
||||
import { default as _attributesMgmt } from './attributesMgmt.json';
|
||||
import { default as _automation } from './automation.json';
|
||||
import { default as _bulkActions } from './bulkActions.json';
|
||||
import { default as _campaign } from './campaign.json';
|
||||
import { default as _cannedMgmt } from './cannedMgmt.json';
|
||||
import { default as _chatlist } from './chatlist.json';
|
||||
import { default as _contact } from './contact.json';
|
||||
import { default as _contactFilters } from './contactFilters.json';
|
||||
import { default as _conversation } from './conversation.json';
|
||||
import { default as _csatMgmtMgmt } from './csatMgmt.json';
|
||||
import { default as _generalSettings } from './generalSettings.json';
|
||||
import { default as _inboxMgmt } from './inboxMgmt.json';
|
||||
import { default as _integrationApps } from './integrationApps.json';
|
||||
import { default as _integrations } from './integrations.json';
|
||||
import { default as _labelsMgmt } from './labelsMgmt.json';
|
||||
import { default as _login } from './login.json';
|
||||
import { default as _report } from './report.json';
|
||||
import { default as _resetPassword } from './resetPassword.json';
|
||||
import { default as _setNewPassword } from './setNewPassword.json';
|
||||
import { default as _settings } from './settings.json';
|
||||
import { default as _signup } from './signup.json';
|
||||
import { default as _teamsSettings } from './teamsSettings.json';
|
||||
import { default as _whatsappTemplates } from './whatsappTemplates.json';
|
||||
import { default as _helpCenter } from './helpCenter.json';
|
||||
import advancedFilters from './advancedFilters.json';
|
||||
import agentBots from './agentBots.json';
|
||||
import agentMgmt from './agentMgmt.json';
|
||||
import attributesMgmt from './attributesMgmt.json';
|
||||
import automation from './automation.json';
|
||||
import bulkActions from './bulkActions.json';
|
||||
import campaign from './campaign.json';
|
||||
import cannedMgmt from './cannedMgmt.json';
|
||||
import chatlist from './chatlist.json';
|
||||
import contact from './contact.json';
|
||||
import contactFilters from './contactFilters.json';
|
||||
import conversation from './conversation.json';
|
||||
import csatMgmtMgmt from './csatMgmt.json';
|
||||
import generalSettings from './generalSettings.json';
|
||||
import helpCenter from './helpCenter.json';
|
||||
import inboxMgmt from './inboxMgmt.json';
|
||||
import integrationApps from './integrationApps.json';
|
||||
import integrations from './integrations.json';
|
||||
import labelsMgmt from './labelsMgmt.json';
|
||||
import login from './login.json';
|
||||
import report from './report.json';
|
||||
import resetPassword from './resetPassword.json';
|
||||
import setNewPassword from './setNewPassword.json';
|
||||
import settings from './settings.json';
|
||||
import signup from './signup.json';
|
||||
import teamsSettings from './teamsSettings.json';
|
||||
import whatsappTemplates from './whatsappTemplates.json';
|
||||
|
||||
export default {
|
||||
..._advancedFilters,
|
||||
..._agentMgmt,
|
||||
..._attributesMgmt,
|
||||
..._automation,
|
||||
..._campaign,
|
||||
..._cannedMgmt,
|
||||
..._chatlist,
|
||||
..._contact,
|
||||
..._contactFilters,
|
||||
..._conversation,
|
||||
..._csatMgmtMgmt,
|
||||
..._generalSettings,
|
||||
..._inboxMgmt,
|
||||
..._integrationApps,
|
||||
..._integrations,
|
||||
..._labelsMgmt,
|
||||
..._login,
|
||||
..._report,
|
||||
..._resetPassword,
|
||||
..._setNewPassword,
|
||||
..._settings,
|
||||
..._signup,
|
||||
..._teamsSettings,
|
||||
..._whatsappTemplates,
|
||||
..._bulkActions,
|
||||
..._helpCenter,
|
||||
...advancedFilters,
|
||||
...agentBots,
|
||||
...agentMgmt,
|
||||
...attributesMgmt,
|
||||
...automation,
|
||||
...bulkActions,
|
||||
...campaign,
|
||||
...cannedMgmt,
|
||||
...chatlist,
|
||||
...contact,
|
||||
...contactFilters,
|
||||
...conversation,
|
||||
...csatMgmtMgmt,
|
||||
...generalSettings,
|
||||
...helpCenter,
|
||||
...inboxMgmt,
|
||||
...integrationApps,
|
||||
...integrations,
|
||||
...labelsMgmt,
|
||||
...login,
|
||||
...report,
|
||||
...resetPassword,
|
||||
...setNewPassword,
|
||||
...settings,
|
||||
...signup,
|
||||
...teamsSettings,
|
||||
...whatsappTemplates,
|
||||
};
|
||||
|
|
|
@ -175,6 +175,7 @@
|
|||
"CONTACTS": "Contacts",
|
||||
"HOME": "Home",
|
||||
"AGENTS": "Agents",
|
||||
"AGENT_BOTS": "Bots",
|
||||
"INBOXES": "Inboxes",
|
||||
"NOTIFICATIONS": "Notifications",
|
||||
"CANNED_RESPONSES": "Canned Responses",
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<template>
|
||||
<div>Agent Bot list</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
computed: {
|
||||
...mapGetters({
|
||||
agentBots: 'agentBots/getBots',
|
||||
uiFlags: 'agentBots/getUIFlags',
|
||||
}),
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch('agentBots/get');
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,40 @@
|
|||
import SettingsContent from '../Wrapper';
|
||||
const Bot = () => import('./Index.vue');
|
||||
const CsmlEditBot = () => import('./csml/Edit.vue');
|
||||
const CsmlNewBot = () => import('./csml/New.vue');
|
||||
import { frontendURL } from '../../../../helper/URLHelper';
|
||||
|
||||
export default {
|
||||
routes: [
|
||||
{
|
||||
path: frontendURL('accounts/:accountId/settings/agent-bots'),
|
||||
roles: ['administrator'],
|
||||
component: SettingsContent,
|
||||
props: {
|
||||
headerTitle: 'AGENT_BOTS.HEADER',
|
||||
icon: 'bot',
|
||||
showNewButton: false,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'agent_bots',
|
||||
component: Bot,
|
||||
roles: ['administrator'],
|
||||
},
|
||||
{
|
||||
path: 'csml/new',
|
||||
name: 'agent_bots_csml_new',
|
||||
component: CsmlNewBot,
|
||||
roles: ['administrator'],
|
||||
},
|
||||
{
|
||||
path: 'csml/:botId',
|
||||
name: 'agent_bots_csml_edit',
|
||||
component: CsmlEditBot,
|
||||
roles: ['administrator'],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
<template>
|
||||
<div>Component to edit CSML Bots</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {};
|
||||
</script>
|
|
@ -0,0 +1,6 @@
|
|||
<template>
|
||||
<div>Component to create CSML Bots</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {};
|
||||
</script>
|
|
@ -1,19 +1,20 @@
|
|||
import { frontendURL } from '../../../helper/URLHelper';
|
||||
import account from './account/account.routes';
|
||||
import agent from './agents/agent.routes';
|
||||
import agentBot from './agentBots/agentBot.routes';
|
||||
import attributes from './attributes/attributes.routes';
|
||||
import automation from './automation/automation.routes';
|
||||
import billing from './billing/billing.routes';
|
||||
import campaigns from './campaigns/campaigns.routes';
|
||||
import canned from './canned/canned.routes';
|
||||
import inbox from './inbox/inbox.routes';
|
||||
import integrations from './integrations/integrations.routes';
|
||||
import integrationapps from './integrationapps/integrations.routes';
|
||||
import integrations from './integrations/integrations.routes';
|
||||
import labels from './labels/labels.routes';
|
||||
import profile from './profile/profile.routes';
|
||||
import reports from './reports/reports.routes';
|
||||
import campaigns from './campaigns/campaigns.routes';
|
||||
import teams from './teams/teams.routes';
|
||||
import attributes from './attributes/attributes.routes';
|
||||
import automation from './automation/automation.routes';
|
||||
import store from '../../../store';
|
||||
import billing from './billing/billing.routes';
|
||||
import teams from './teams/teams.routes';
|
||||
|
||||
export default {
|
||||
routes: [
|
||||
|
@ -30,6 +31,7 @@ export default {
|
|||
},
|
||||
...account.routes,
|
||||
...agent.routes,
|
||||
...agentBot.routes,
|
||||
...attributes.routes,
|
||||
...automation.routes,
|
||||
...billing.routes,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue