feat: Add macros routes and views (#5604)

This commit is contained in:
Fayaz Ahmed
2022-10-12 11:50:20 +05:30
committed by GitHub
parent 6c160ccad5
commit 32d885a19b
10 changed files with 112 additions and 26 deletions

View File

@@ -5,34 +5,37 @@ const settings = accountId => ({
routes: [
'agent_bots',
'agent_list',
'canned_list',
'labels_list',
'settings_inbox',
'attributes_list',
'settings_inbox_new',
'settings_inbox_list',
'settings_inbox_show',
'settings_inboxes_page_channel',
'settings_inboxes_add_agents',
'settings_inbox_finish',
'settings_integrations',
'settings_integrations_webhook',
'settings_integrations_integration',
'settings_applications',
'settings_integrations_dashboard_apps',
'settings_applications_webhook',
'settings_applications_integration',
'general_settings',
'automation_list',
'billing_settings_index',
'canned_list',
'general_settings_index',
'general_settings',
'labels_list',
'macros_edit',
'macros_new',
'macros_wrapper',
'settings_applications_integration',
'settings_applications_webhook',
'settings_applications',
'settings_inbox_finish',
'settings_inbox_list',
'settings_inbox_new',
'settings_inbox_show',
'settings_inbox',
'settings_inboxes_add_agents',
'settings_inboxes_page_channel',
'settings_integrations_dashboard_apps',
'settings_integrations_integration',
'settings_integrations_webhook',
'settings_integrations',
'settings_teams_add_agents',
'settings_teams_edit_finish',
'settings_teams_edit_members',
'settings_teams_edit',
'settings_teams_finish',
'settings_teams_list',
'settings_teams_new',
'settings_teams_add_agents',
'settings_teams_finish',
'settings_teams_edit',
'settings_teams_edit_members',
'settings_teams_edit_finish',
'billing_settings_index',
'automation_list',
],
menuItems: [
{
@@ -89,6 +92,15 @@ const settings = accountId => ({
toStateName: 'agent_bots',
featureFlagKey: 'agent_bots',
},
{
icon: 'flash-settings',
label: 'MACROS',
hasSubMenu: false,
toState: frontendURL(`accounts/${accountId}/settings/macros`),
toStateName: 'macros_wrapper',
beta: true,
featureFlagKey: 'macros',
},
{
icon: 'chat-multiple',
label: 'CANNED_RESPONSES',

View File

@@ -18,6 +18,7 @@ import integrationApps from './integrationApps.json';
import integrations from './integrations.json';
import labelsMgmt from './labelsMgmt.json';
import login from './login.json';
import macros from './macros.json';
import report from './report.json';
import resetPassword from './resetPassword.json';
import setNewPassword from './setNewPassword.json';
@@ -47,6 +48,7 @@ export default {
...integrations,
...labelsMgmt,
...login,
...macros,
...report,
...resetPassword,
...setNewPassword,

View File

@@ -0,0 +1,5 @@
{
"MACROS": {
"HEADER": "Macros"
}
}

View File

@@ -99,7 +99,11 @@
},
"AVAILABILITY": {
"LABEL": "Availability",
"STATUSES_LIST": ["Online", "Busy", "Offline"]
"STATUSES_LIST": [
"Online",
"Busy",
"Offline"
]
},
"EMAIL": {
"LABEL": "Your email address",
@@ -186,6 +190,7 @@
"LABELS": "Labels",
"CUSTOM_ATTRIBUTES": "Custom Attributes",
"AUTOMATION": "Automation",
"MACROS": "Macros",
"TEAMS": "Teams",
"BILLING": "Billing",
"CUSTOM_VIEWS_FOLDER": "Folders",
@@ -230,7 +235,6 @@
"DESCRIPTION": "View your previous invoices, edit your billing details, or cancel your subscription.",
"BUTTON_TXT": "Go to the billing portal"
},
"CHAT_WITH_US": {
"TITLE": "Need help?",
"DESCRIPTION": "Do you face any issues in billing? We are here to help.",

View File

@@ -0,0 +1,11 @@
<template>
<div>
Macros
</div>
</template>
<script>
export default {};
</script>
<style></style>

View File

@@ -0,0 +1,9 @@
<template>
<div>MacrosEditor</div>
</template>
<script>
export default {};
</script>
<style></style>

View File

@@ -0,0 +1,38 @@
import SettingsContent from '../Wrapper';
import Macros from './Index';
const MacroEditor = () => import('./MacroEditor');
import { frontendURL } from 'dashboard/helper/URLHelper';
export default {
routes: [
{
path: frontendURL('accounts/:accountId/settings/macros'),
component: SettingsContent,
props: {
headerTitle: 'MACROS.HEADER',
icon: 'flash-settings',
showNewButton: false,
},
children: [
{
path: '',
name: 'macros_wrapper',
component: Macros,
roles: ['administrator', 'agent'],
},
{
path: 'new',
name: 'macros_new',
component: MacroEditor,
roles: ['administrator', 'agent'],
},
{
path: ':macroId/edit',
name: 'macros_edit',
component: MacroEditor,
roles: ['administrator', 'agent'],
},
],
},
],
};

View File

@@ -11,6 +11,7 @@ import inbox from './inbox/inbox.routes';
import integrationapps from './integrationapps/integrations.routes';
import integrations from './integrations/integrations.routes';
import labels from './labels/labels.routes';
import macros from './macros/macros.routes';
import profile from './profile/profile.routes';
import reports from './reports/reports.routes';
import store from '../../../store';
@@ -41,6 +42,7 @@ export default {
...integrationapps.routes,
...integrations.routes,
...labels.routes,
...macros.routes,
...profile.routes,
...reports.routes,
...teams.routes,