diff --git a/app/javascript/dashboard/api/integrations/dyte.js b/app/javascript/dashboard/api/integrations/dyte.js new file mode 100644 index 000000000..e22a5893a --- /dev/null +++ b/app/javascript/dashboard/api/integrations/dyte.js @@ -0,0 +1,23 @@ +/* global axios */ + +import ApiClient from '../ApiClient'; + +class DyteAPI extends ApiClient { + constructor() { + super('integrations/dyte', { accountScoped: true }); + } + + createAMeeting(conversationId) { + return axios.post(`${this.url}/create_a_meeting`, { + conversation_id: conversationId, + }); + } + + addParticipantToMeeting(messageId) { + return axios.post(`${this.url}/add_participant_to_meeting`, { + message_id: messageId, + }); + } +} + +export default new DyteAPI(); diff --git a/app/javascript/dashboard/api/specs/integrations/dyte.spec.js b/app/javascript/dashboard/api/specs/integrations/dyte.spec.js new file mode 100644 index 000000000..c89c2106e --- /dev/null +++ b/app/javascript/dashboard/api/specs/integrations/dyte.spec.js @@ -0,0 +1,35 @@ +import DyteAPIClient from '../../integrations/dyte'; +import ApiClient from '../../ApiClient'; +import describeWithAPIMock from '../apiSpecHelper'; + +describe('#accountAPI', () => { + it('creates correct instance', () => { + expect(DyteAPIClient).toBeInstanceOf(ApiClient); + expect(DyteAPIClient).toHaveProperty('createAMeeting'); + expect(DyteAPIClient).toHaveProperty('addParticipantToMeeting'); + }); + + describeWithAPIMock('createAMeeting', context => { + it('creates a valid request', () => { + DyteAPIClient.createAMeeting(1); + expect(context.axiosMock.post).toHaveBeenCalledWith( + '/api/v1/integrations/dyte/create_a_meeting', + { + conversation_id: 1, + } + ); + }); + }); + + describeWithAPIMock('addParticipantToMeeting', context => { + it('creates a valid request', () => { + DyteAPIClient.addParticipantToMeeting(1); + expect(context.axiosMock.post).toHaveBeenCalledWith( + '/api/v1/integrations/dyte/add_participant_to_meeting', + { + message_id: 1, + } + ); + }); + }); +}); diff --git a/app/javascript/dashboard/components/widgets/VideoCallButton.vue b/app/javascript/dashboard/components/widgets/VideoCallButton.vue new file mode 100644 index 000000000..12050c811 --- /dev/null +++ b/app/javascript/dashboard/components/widgets/VideoCallButton.vue @@ -0,0 +1,57 @@ + + diff --git a/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue b/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue index bd67011e5..6922389b0 100644 --- a/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue +++ b/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue @@ -87,6 +87,10 @@ :title="'Whatsapp Templates'" @click="$emit('selectWhatsappTemplate')" /> +
-
  • +
  • + diff --git a/app/javascript/dashboard/components/widgets/conversation/bubble/integrations/Dyte.vue b/app/javascript/dashboard/components/widgets/conversation/bubble/integrations/Dyte.vue new file mode 100644 index 000000000..de4b07da0 --- /dev/null +++ b/app/javascript/dashboard/components/widgets/conversation/bubble/integrations/Dyte.vue @@ -0,0 +1,104 @@ +