From 9b8a6d5495bf522175eed66816c9b1032f59f697 Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Mon, 27 Jun 2022 10:34:02 +0530 Subject: [PATCH] feat: Add a view for Agent Bots --- app/javascript/dashboard/api/agentBots.js | 9 + .../dashboard/components/layout/Sidebar.vue | 8 +- .../layout/config/default-sidebar.js | 4 +- .../layout/config/sidebarItems/settings.js | 236 ++++++++++-------- .../sidebarComponents/SecondaryNavItem.vue | 2 +- .../dashboard/components/widgets/ShowMore.vue | 8 +- .../dashboard/i18n/locale/en/agentBot.json | 61 +++++ .../dashboard/i18n/locale/en/index.js | 102 ++++---- .../dashboard/i18n/locale/en/settings.json | 61 ++--- .../dashboard/settings/agentBots/Index.vue | 87 +++++++ .../settings/agentBots/agentBot.routes.js | 40 +++ .../agentBots/components/AgentBotRow.vue | 91 +++++++ .../agentBots/components/AgentBotType.vue | 41 +++ .../agentBots/components/CSMLBotEditor.vue | 112 +++++++++ .../settings/agentBots/csml/Edit.vue | 3 + .../dashboard/settings/agentBots/csml/New.vue | 24 ++ .../dashboard/settings/settings.routes.js | 10 +- app/javascript/dashboard/store/index.js | 2 + .../dashboard/store/modules/accounts.js | 2 +- .../dashboard/store/modules/agentBots.js | 107 ++++++++ .../dashboard/store/mutation-types.js | 7 + .../FluentIcon/dashboard-icons.json | 1 + config/features.yml | 4 +- config/webpack/environment.js | 9 + public/dashboard/images/agent-bots/csml.png | Bin 0 -> 6376 bytes .../dashboard/images/agent-bots/webhook.svg | 64 +++++ 26 files changed, 894 insertions(+), 201 deletions(-) create mode 100644 app/javascript/dashboard/api/agentBots.js create mode 100644 app/javascript/dashboard/i18n/locale/en/agentBot.json create mode 100644 app/javascript/dashboard/routes/dashboard/settings/agentBots/Index.vue create mode 100644 app/javascript/dashboard/routes/dashboard/settings/agentBots/agentBot.routes.js create mode 100644 app/javascript/dashboard/routes/dashboard/settings/agentBots/components/AgentBotRow.vue create mode 100644 app/javascript/dashboard/routes/dashboard/settings/agentBots/components/AgentBotType.vue create mode 100644 app/javascript/dashboard/routes/dashboard/settings/agentBots/components/CSMLBotEditor.vue create mode 100644 app/javascript/dashboard/routes/dashboard/settings/agentBots/csml/Edit.vue create mode 100644 app/javascript/dashboard/routes/dashboard/settings/agentBots/csml/New.vue create mode 100644 app/javascript/dashboard/store/modules/agentBots.js create mode 100644 public/dashboard/images/agent-bots/csml.png create mode 100644 public/dashboard/images/agent-bots/webhook.svg diff --git a/app/javascript/dashboard/api/agentBots.js b/app/javascript/dashboard/api/agentBots.js new file mode 100644 index 000000000..4de6fcee0 --- /dev/null +++ b/app/javascript/dashboard/api/agentBots.js @@ -0,0 +1,9 @@ +import ApiClient from './ApiClient'; + +class AgentBotsAPI extends ApiClient { + constructor() { + super('agent_bots', { accountScoped: true }); + } +} + +export default new AgentBotsAPI(); diff --git a/app/javascript/dashboard/components/layout/Sidebar.vue b/app/javascript/dashboard/components/layout/Sidebar.vue index 87100e4b4..0eede5ffb 100644 --- a/app/javascript/dashboard/components/layout/Sidebar.vue +++ b/app/javascript/dashboard/components/layout/Sidebar.vue @@ -58,11 +58,12 @@ export default { computed: { ...mapGetters({ + getAccount: 'accounts/getAccount', + accountId: 'getCurrentAccountId', + currentRole: 'getCurrentRole', currentUser: 'getCurrentUser', globalConfig: 'globalConfig/get', inboxes: 'inboxes/getInboxes', - accountId: 'getCurrentAccountId', - currentRole: 'getCurrentRole', labels: 'labels/getLabelsOnSidebar', teams: 'teams/getMyTeams', }), @@ -87,7 +88,8 @@ export default { ); }, sideMenuConfig() { - return getSidebarItems(this.accountId); + const { features = {} } = this.getAccount(this.accountId); + return getSidebarItems(this.accountId, features); }, primaryMenuItems() { const menuItems = this.sideMenuConfig.primaryMenu; diff --git a/app/javascript/dashboard/components/layout/config/default-sidebar.js b/app/javascript/dashboard/components/layout/config/default-sidebar.js index bbe2c44cd..efc9e1f4e 100644 --- a/app/javascript/dashboard/components/layout/config/default-sidebar.js +++ b/app/javascript/dashboard/components/layout/config/default-sidebar.js @@ -6,14 +6,14 @@ import settings from './sidebarItems/settings'; import notifications from './sidebarItems/notifications'; import primaryMenu from './sidebarItems/primaryMenu'; -export const getSidebarItems = accountId => ({ +export const getSidebarItems = (accountId, features = {}) => ({ primaryMenu: primaryMenu(accountId), secondaryMenu: [ conversations(accountId), contacts(accountId), reports(accountId), campaigns(accountId), - settings(accountId), + settings(accountId, features), notifications(accountId), ], }); diff --git a/app/javascript/dashboard/components/layout/config/sidebarItems/settings.js b/app/javascript/dashboard/components/layout/config/sidebarItems/settings.js index 176fd152c..655300d04 100644 --- a/app/javascript/dashboard/components/layout/config/sidebarItems/settings.js +++ b/app/javascript/dashboard/components/layout/config/sidebarItems/settings.js @@ -1,112 +1,134 @@ import { frontendURL } from '../../../../helper/URLHelper'; -const settings = accountId => ({ - parentNav: 'settings', - routes: [ - '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_applications_webhook', - 'settings_applications_integration', - 'general_settings', - 'general_settings_index', - 'settings_teams_list', - 'settings_teams_new', - 'settings_teams_add_agents', - 'settings_teams_finish', - 'settings_teams_edit', - 'settings_teams_edit_members', - 'settings_teams_edit_finish', - 'automation_list', - ], - menuItems: [ - { - icon: 'people', - label: 'AGENTS', +const isFeatureEnabled = (featureFlags, key) => featureFlags[key]; + +const settings = (accountId, features) => { + const config = { + parentNav: 'settings', + routes: [ + 'agent_bots', + 'agent_list', + 'attributes_list', + 'automation_list', + 'canned_list', + 'general_settings_index', + 'general_settings', + 'labels_list', + '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_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', + ], + menuItems: [ + { + icon: 'people', + label: 'AGENTS', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/settings/agents/list`), + toStateName: 'agent_list', + }, + { + icon: 'people-team', + label: 'TEAMS', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/settings/teams/list`), + toStateName: 'settings_teams_list', + }, + { + icon: 'mail-inbox-all', + label: 'INBOXES', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/settings/inboxes/list`), + toStateName: 'settings_inbox_list', + }, + { + icon: 'tag', + label: 'LABELS', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/settings/labels/list`), + toStateName: 'labels_list', + }, + { + icon: 'code', + label: 'CUSTOM_ATTRIBUTES', + hasSubMenu: false, + toState: frontendURL( + `accounts/${accountId}/settings/custom-attributes/list` + ), + toStateName: 'attributes_list', + }, + { + icon: 'automation', + label: 'AUTOMATION', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/settings/automation/list`), + toStateName: 'automation_list', + beta: true, + }, + { + icon: 'chat-multiple', + label: 'CANNED_RESPONSES', + hasSubMenu: false, + toState: frontendURL( + `accounts/${accountId}/settings/canned-response/list` + ), + toStateName: 'canned_list', + }, + { + icon: 'flash-on', + label: 'INTEGRATIONS', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/settings/integrations`), + toStateName: 'settings_integrations', + }, + { + icon: 'star-emphasis', + label: 'APPLICATIONS', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/settings/applications`), + toStateName: 'settings_applications', + }, + { + icon: 'settings', + label: 'ACCOUNT_SETTINGS', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/settings/general`), + toStateName: 'general_settings_index', + }, + ], + }; + + if (isFeatureEnabled(features, 'agent_bots')) { + const agentBotRouteConfig = { + icon: 'bot', + label: 'AGENT_BOTS', hasSubMenu: false, - toState: frontendURL(`accounts/${accountId}/settings/agents/list`), - toStateName: 'agent_list', - }, - { - icon: 'people-team', - label: 'TEAMS', - hasSubMenu: false, - toState: frontendURL(`accounts/${accountId}/settings/teams/list`), - toStateName: 'settings_teams_list', - }, - { - icon: 'mail-inbox-all', - label: 'INBOXES', - hasSubMenu: false, - toState: frontendURL(`accounts/${accountId}/settings/inboxes/list`), - toStateName: 'settings_inbox_list', - }, - { - icon: 'tag', - label: 'LABELS', - hasSubMenu: false, - toState: frontendURL(`accounts/${accountId}/settings/labels/list`), - toStateName: 'labels_list', - }, - { - icon: 'code', - label: 'CUSTOM_ATTRIBUTES', - hasSubMenu: false, - toState: frontendURL( - `accounts/${accountId}/settings/custom-attributes/list` - ), - toStateName: 'attributes_list', - }, - { - icon: 'automation', - label: 'AUTOMATION', - hasSubMenu: false, - toState: frontendURL(`accounts/${accountId}/settings/automation/list`), - toStateName: 'automation_list', - }, - { - icon: 'chat-multiple', - label: 'CANNED_RESPONSES', - hasSubMenu: false, - toState: frontendURL( - `accounts/${accountId}/settings/canned-response/list` - ), - toStateName: 'canned_list', - }, - { - icon: 'flash-on', - label: 'INTEGRATIONS', - hasSubMenu: false, - toState: frontendURL(`accounts/${accountId}/settings/integrations`), - toStateName: 'settings_integrations', - }, - { - icon: 'star-emphasis', - label: 'APPLICATIONS', - hasSubMenu: false, - toState: frontendURL(`accounts/${accountId}/settings/applications`), - toStateName: 'settings_applications', - }, - { - icon: 'settings', - label: 'ACCOUNT_SETTINGS', - hasSubMenu: false, - toState: frontendURL(`accounts/${accountId}/settings/general`), - toStateName: 'general_settings_index', - }, - ], -}); + toState: frontendURL(`accounts/${accountId}/settings/agent-bots`), + toStateName: 'agent_bots', + beta: true, + }; + const routeIndex = config.menuItems.findIndex( + route => route.label === 'INTEGRATIONS' + ); + config.menuItems.splice(routeIndex, 0, agentBotRouteConfig); + } + return config; +}; export default settings; diff --git a/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue b/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue index 1fcde8948..ac0501ff0 100644 --- a/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue +++ b/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue @@ -16,7 +16,7 @@ /> {{ $t(`SIDEBAR.${menuItem.label}`) }} {{ textToBeDisplayed }} - @@ -25,7 +29,7 @@ export default { }, computed: { textToBeDisplayed() { - if (this.showMore) { + if (this.showMore || this.text.length <= this.limit) { return this.text; } diff --git a/app/javascript/dashboard/i18n/locale/en/agentBot.json b/app/javascript/dashboard/i18n/locale/en/agentBot.json new file mode 100644 index 000000000..c16597347 --- /dev/null +++ b/app/javascript/dashboard/i18n/locale/en/agentBot.json @@ -0,0 +1,61 @@ +{ + "AGENT_BOTS": { + "HEADER": "Bots", + "HEADER_BTN_TXT": "Add Bot Configuration", + "SIDEBAR_TXT": "

CSML Bots

You can create your own custom bots using csml.dev. Read more about csml in their docs here.

Bots will allow you to add more rich features to your conversations like buttons, and links pre configured right from chatwoot editor.

", + "CSML_BOT_EDITOR": { + "NAME": { + "LABEL": "Bot Name", + "PLACEHOLDER": "Give your bot a name", + "ERROR": "Bot name is required" + }, + "DESCRIPTION": { + "LABEL": "Bot Description", + "PLACEHOLDER": "What does this bot do?" + }, + "BOT_CONFIG": { + "ERROR": "Please enter your CSML bot configuration above", + "API_ERROR": "Your CSML configuration is invalid, please fix it and try again." + }, + "SUBMIT": "Validate and save" + }, + "ADD": { + "TITLE": "Configure new bot", + "CANCEL_BUTTON_TEXT": "Cancel", + "API": { + "SUCCESS_MESSAGE": "Bot added successfully", + "ERROR_MESSAGE": "Could not add bot, Please try again later" + } + }, + "LIST": { + "404": "No Bots found, you can create a bot by clicking the 'Configure new bot' Button ↗", + "LOADING": "Fetching Bots...", + "TYPE": "Bot Type" + }, + "DELETE": { + "BUTTON_TEXT": "Delete", + "TITLE": "Delete Bot", + "SUBMIT": "Delete", + "CANCEL_BUTTON_TEXT": "Cancel", + "DESCRIPTION": "Are you sure you want to delete this bot? This action is irreversible", + "API": { + "SUCCESS_MESSAGE": "Bot deleted successfully", + "ERROR_MESSAGE": "Could not able to delete bot, Please try again later" + } + }, + "EDIT": { + "BUTTON_TEXT": "Edit", + "LOADING": "Fetching Bots...", + "TITLE": "Edit Bot", + "CANCEL_BUTTON_TEXT": "Cancel", + "API": { + "SUCCESS_MESSAGE": "Bot updated successfully", + "ERROR_MESSAGE": "Could not update bot, Please try again later" + } + }, + "TYPES": { + "WEBHOOK": "Webhook Bot", + "CSML": "CSML Bot" + } + } +} diff --git a/app/javascript/dashboard/i18n/locale/en/index.js b/app/javascript/dashboard/i18n/locale/en/index.js index 9b8773a64..f75ed3df2 100644 --- a/app/javascript/dashboard/i18n/locale/en/index.js +++ b/app/javascript/dashboard/i18n/locale/en/index.js @@ -1,53 +1,55 @@ -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 advancedFilters from './advancedFilters.json'; +import agentBot from './agentBot.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 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, + ...advancedFilters, + ...agentBot, + ...agentMgmt, + ...attributesMgmt, + ...automation, + ...bulkActions, + ...campaign, + ...cannedMgmt, + ...chatlist, + ...contact, + ...contactFilters, + ...conversation, + ...csatMgmtMgmt, + ...generalSettings, + ...inboxMgmt, + ...integrationApps, + ...integrations, + ...labelsMgmt, + ...login, + ...report, + ...resetPassword, + ...setNewPassword, + ...settings, + ...signup, + ...teamsSettings, + ...whatsappTemplates, }; diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index 9299be2b5..9e04ac0f6 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -146,47 +146,48 @@ } }, "SIDEBAR": { - "CURRENTLY_VIEWING_ACCOUNT": "Currently viewing:", - "SWITCH": "Switch", - "CONVERSATIONS": "Conversations", - "ALL_CONVERSATIONS": "All Conversations", - "MENTIONED_CONVERSATIONS": "Mentions", - "REPORTS": "Reports", - "SETTINGS": "Settings", - "CONTACTS": "Contacts", - "HOME": "Home", - "AGENTS": "Agents", - "INBOXES": "Inboxes", - "NOTIFICATIONS": "Notifications", - "CANNED_RESPONSES": "Canned Responses", - "INTEGRATIONS": "Integrations", - "PROFILE_SETTINGS": "Profile Settings", "ACCOUNT_SETTINGS": "Account Settings", + "AGENT_BOTS": "Bots", + "AGENTS": "Agents", + "ALL_CONTACTS": "All Contacts", + "ALL_CONVERSATIONS": "All Conversations", "APPLICATIONS": "Applications", - "LABELS": "Labels", - "CUSTOM_ATTRIBUTES": "Custom Attributes", "AUTOMATION": "Automation", - "TEAMS": "Teams", + "BETA": "Beta", + "CAMPAIGNS": "Campaigns", + "CANNED_RESPONSES": "Canned Responses", + "CONTACTS": "Contacts", + "CONVERSATIONS": "Conversations", + "CSAT": "CSAT", + "CURRENTLY_VIEWING_ACCOUNT": "Currently viewing:", + "CUSTOM_ATTRIBUTES": "Custom Attributes", "CUSTOM_VIEWS_FOLDER": "Folders", "CUSTOM_VIEWS_SEGMENTS": "Segments", - "ALL_CONTACTS": "All Contacts", - "TAGGED_WITH": "Tagged with", + "FACEBOOK_REAUTHORIZE": "Your Facebook connection has expired, please reconnect your Facebook page to continue services", + "HOME": "Home", + "INBOXES": "Inboxes", + "INTEGRATIONS": "Integrations", + "LABELS": "Labels", + "MENTIONED_CONVERSATIONS": "Mentions", + "NEW_INBOX": "New inbox", "NEW_LABEL": "New label", "NEW_TEAM": "New team", - "NEW_INBOX": "New inbox", - "REPORTS_CONVERSATION": "Conversations", - "CSAT": "CSAT", - "CAMPAIGNS": "Campaigns", - "ONGOING": "Ongoing", + "NOTIFICATIONS": "Notifications", "ONE_OFF": "One off", + "ONGOING": "Ongoing", + "PROFILE_SETTINGS": "Profile Settings", "REPORTS_AGENT": "Agents", - "REPORTS_LABEL": "Labels", + "REPORTS_CONVERSATION": "Conversations", "REPORTS_INBOX": "Inbox", - "REPORTS_TEAM": "Team", - "SET_AVAILABILITY_TITLE": "Set yourself as", - "BETA": "Beta", + "REPORTS_LABEL": "Labels", "REPORTS_OVERVIEW": "Overview", - "FACEBOOK_REAUTHORIZE": "Your Facebook connection has expired, please reconnect your Facebook page to continue services" + "REPORTS_TEAM": "Team", + "REPORTS": "Reports", + "SET_AVAILABILITY_TITLE": "Set yourself as", + "SETTINGS": "Settings", + "SWITCH": "Switch", + "TAGGED_WITH": "Tagged with", + "TEAMS": "Teams" }, "CREATE_ACCOUNT": { "NO_ACCOUNT_WARNING": "Uh oh! We could not find any Chatwoot accounts. Please create a new account to continue.", diff --git a/app/javascript/dashboard/routes/dashboard/settings/agentBots/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/agentBots/Index.vue new file mode 100644 index 000000000..77d413c7e --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/agentBots/Index.vue @@ -0,0 +1,87 @@ + + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/agentBots/agentBot.routes.js b/app/javascript/dashboard/routes/dashboard/settings/agentBots/agentBot.routes.js new file mode 100644 index 000000000..e06f18a0b --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/agentBots/agentBot.routes.js @@ -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'], + }, + ], + }, + ], +}; diff --git a/app/javascript/dashboard/routes/dashboard/settings/agentBots/components/AgentBotRow.vue b/app/javascript/dashboard/routes/dashboard/settings/agentBots/components/AgentBotRow.vue new file mode 100644 index 000000000..6a3a4dd8d --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/agentBots/components/AgentBotRow.vue @@ -0,0 +1,91 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/agentBots/components/AgentBotType.vue b/app/javascript/dashboard/routes/dashboard/settings/agentBots/components/AgentBotType.vue new file mode 100644 index 000000000..f24c659f0 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/agentBots/components/AgentBotType.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/agentBots/components/CSMLBotEditor.vue b/app/javascript/dashboard/routes/dashboard/settings/agentBots/components/CSMLBotEditor.vue new file mode 100644 index 000000000..f0f4a2f4b --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/agentBots/components/CSMLBotEditor.vue @@ -0,0 +1,112 @@ +