diff --git a/app/controllers/devise_overrides/passwords_controller.rb b/app/controllers/devise_overrides/passwords_controller.rb index 501b9f90c..06092c5ab 100644 --- a/app/controllers/devise_overrides/passwords_controller.rb +++ b/app/controllers/devise_overrides/passwords_controller.rb @@ -11,7 +11,7 @@ class DeviseOverrides::PasswordsController < Devise::PasswordsController @recoverable = User.find_by(reset_password_token: reset_password_token) if @recoverable && reset_password_and_confirmation(@recoverable) send_auth_headers(@recoverable) - render partial: 'devise/auth.json', locals: { resource: @recoverable } + render partial: 'devise/auth', formats: [:json], locals: { resource: @recoverable } else render json: { message: 'Invalid token', redirect_url: '/' }, status: :unprocessable_entity end 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/api/macros.js b/app/javascript/dashboard/api/macros.js index d515b7b52..7b123c9e8 100644 --- a/app/javascript/dashboard/api/macros.js +++ b/app/javascript/dashboard/api/macros.js @@ -6,10 +6,6 @@ class MacrosAPI extends ApiClient { super('macros', { accountScoped: true }); } - getSingleMacro(macroId) { - return axios.get(`${this.url}/${macroId}`); - } - executeMacro({ macroId, conversationIds }) { return axios.post(`${this.url}/${macroId}/execute`, { conversation_ids: conversationIds, diff --git a/app/javascript/dashboard/api/specs/agentBots.spec.js b/app/javascript/dashboard/api/specs/agentBots.spec.js new file mode 100644 index 000000000..c89dbfdf5 --- /dev/null +++ b/app/javascript/dashboard/api/specs/agentBots.spec.js @@ -0,0 +1,13 @@ +import AgentBotsAPI from '../agentBots'; +import ApiClient from '../ApiClient'; + +describe('#AgentBotsAPI', () => { + it('creates correct instance', () => { + expect(AgentBotsAPI).toBeInstanceOf(ApiClient); + expect(AgentBotsAPI).toHaveProperty('get'); + expect(AgentBotsAPI).toHaveProperty('show'); + expect(AgentBotsAPI).toHaveProperty('create'); + expect(AgentBotsAPI).toHaveProperty('update'); + expect(AgentBotsAPI).toHaveProperty('delete'); + }); +}); diff --git a/app/javascript/dashboard/api/specs/macros.spec.js b/app/javascript/dashboard/api/specs/macros.spec.js index e970d3a2d..94e936521 100644 --- a/app/javascript/dashboard/api/specs/macros.spec.js +++ b/app/javascript/dashboard/api/specs/macros.spec.js @@ -8,6 +8,7 @@ describe('#macrosAPI', () => { expect(macros).toHaveProperty('create'); expect(macros).toHaveProperty('update'); expect(macros).toHaveProperty('delete'); + expect(macros).toHaveProperty('show'); expect(macros.url).toBe('/api/v1/macros'); }); }); diff --git a/app/javascript/dashboard/components/layout/config/sidebarItems/settings.js b/app/javascript/dashboard/components/layout/config/sidebarItems/settings.js index a9302a7e0..c8e8ba221 100644 --- a/app/javascript/dashboard/components/layout/config/sidebarItems/settings.js +++ b/app/javascript/dashboard/components/layout/config/sidebarItems/settings.js @@ -3,6 +3,7 @@ import { frontendURL } from '../../../../helper/URLHelper'; const settings = accountId => ({ parentNav: 'settings', routes: [ + 'agent_bots', 'agent_list', 'canned_list', 'labels_list', @@ -77,6 +78,7 @@ const settings = accountId => ({ { icon: 'automation', label: 'AUTOMATION', + beta: true, hasSubMenu: false, toState: frontendURL(`accounts/${accountId}/settings/automation/list`), toStateName: 'automation_list', @@ -88,6 +90,15 @@ const settings = accountId => ({ toState: frontendURL(`accounts/${accountId}/settings/macros`), toStateName: 'macros_wrapper', }, + { + 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', diff --git a/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue b/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue index 220ab18fa..a7a6761cf 100644 --- a/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue +++ b/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue @@ -1,5 +1,5 @@