From 2879a0cd4292e2fb6efa4ebfc45716cd1d1ddae0 Mon Sep 17 00:00:00 2001 From: Sojan Date: Thu, 8 May 2025 03:42:47 -0700 Subject: [PATCH] chore: new floating widget design --- app/javascript/dashboard/App.vue | 25 + .../components/widgets/FloatingCallWidget.vue | 2539 +++++++++++------ .../dashboard/helper/actionCable.js | 16 +- .../conversation/contact/ContactInfo.vue | 45 +- .../voice/conference_status_service.rb | 39 +- app/services/voice/incoming_call_service.rb | 46 +- app/services/voice/outgoing_call_service.rb | 37 +- 7 files changed, 1748 insertions(+), 999 deletions(-) diff --git a/app/javascript/dashboard/App.vue b/app/javascript/dashboard/App.vue index 72b9fa928..366d0e447 100644 --- a/app/javascript/dashboard/App.vue +++ b/app/javascript/dashboard/App.vue @@ -146,6 +146,27 @@ export default { this.showCallWidget = false; this.$store.dispatch('calls/clearActiveCall'); this.$store.dispatch('calls/clearIncomingCall'); + + // Clear the activeCallConversation state in all ContactInfo components + this.$nextTick(() => { + const clearContactInfoCallState = (components) => { + if (!components) return; + + components.forEach(component => { + if (component.$options && component.$options.name === 'ContactInfo') { + if (component.activeCallConversation) { + component.activeCallConversation = null; + component.$forceUpdate(); + } + } + if (component.$children && component.$children.length) { + clearContactInfoCallState(component.$children); + } + }); + }; + + clearContactInfoCallState(this.$children); + }); }, handleCallJoined() { this.showCallWidget = true; @@ -249,6 +270,10 @@ export default { :contact-name="activeCall ? activeCall.contactName : (incomingCall ? incomingCall.contactName : '')" :contact-id="activeCall ? activeCall.contactId : (incomingCall ? incomingCall.contactId : null)" :inbox-id="activeCall ? activeCall.inboxId : (incomingCall ? incomingCall.inboxId : null)" + :inbox-avatar-url="activeCall ? activeCall.inboxAvatarUrl : (incomingCall ? incomingCall.inboxAvatarUrl : '')" + :inbox-phone-number="activeCall ? activeCall.inboxPhoneNumber : (incomingCall ? incomingCall.inboxPhoneNumber : '')" + :avatar-url="activeCall ? activeCall.avatarUrl : (incomingCall ? incomingCall.avatarUrl : '')" + :phone-number="activeCall ? activeCall.phoneNumber : (incomingCall ? incomingCall.phoneNumber : '')" :use-web-rtc="true" @callEnded="handleCallEnded" @callJoined="handleCallJoined" diff --git a/app/javascript/dashboard/components/widgets/FloatingCallWidget.vue b/app/javascript/dashboard/components/widgets/FloatingCallWidget.vue index 1125b0394..0a3e5abd8 100644 --- a/app/javascript/dashboard/components/widgets/FloatingCallWidget.vue +++ b/app/javascript/dashboard/components/widgets/FloatingCallWidget.vue @@ -1,12 +1,14 @@