## Summary Frontend for WhatsApp Cloud Calling: header / contact-panel call buttons, ringing widget, accept/reject/hangup, mute, in-bubble audio player + transcript, recording-on-hangup upload, mid-call reload warning. WebRTC is browser-direct to Meta — no media server bridge. ## Closes - https://linear.app/chatwoot/issue/PLA-150 ## How to test Requires backend support — the controller, services, model changes, and routes ship in **#14334** (`feature/pla-150`). Merge / deploy that first (or simultaneously); the FE alone won't function without those endpoints. Then on staging, for a WhatsApp Cloud + embedded-signup inbox with the new \`Configuration → Enable voice calling\` toggle ON and webhook registered: 1. **Outbound** — open a conversation, click the phone icon in the conversation header (or contact panel), grant mic, your phone rings, answer, audio both ways, hang up. Recording + transcript land in the bubble within ~10s. 2. **Inbound** — call the business number from your phone. The FloatingCallWidget appears bottom-right with caller name. Click accept, audio both ways, hang up. Recording + transcript appear. 3. **Mute** — during an active WhatsApp call, click the mic icon next to hangup. Speech stops reaching Meta until you click again. 4. **Mid-call reload guard** — try `Cmd-R` during an active call; browser shows a confirm prompt. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: iamsivin <iamsivin@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
87 lines
2.3 KiB
Vue
87 lines
2.3 KiB
Vue
<script setup>
|
|
import { useI18n } from 'vue-i18n';
|
|
import Icon from 'next/icon/Icon.vue';
|
|
import Label from 'dashboard/components-next/label/Label.vue';
|
|
|
|
defineProps({
|
|
title: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
description: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
icon: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
isComingSoon: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
isBeta: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
hasVoiceBadge: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
});
|
|
|
|
const { t } = useI18n();
|
|
</script>
|
|
|
|
<template>
|
|
<button
|
|
class="relative bg-n-solid-1 gap-6 cursor-pointer rounded-2xl flex flex-col justify-start transition-all duration-200 ease-in -m-px py-6 px-5 items-start border border-solid border-n-weak"
|
|
:class="{
|
|
'hover:enabled:border-n-blue-9 hover:enabled:shadow-md disabled:opacity-60 disabled:cursor-not-allowed':
|
|
!isComingSoon,
|
|
'cursor-not-allowed disabled:opacity-80': isComingSoon,
|
|
}"
|
|
>
|
|
<div class="relative">
|
|
<div
|
|
class="flex size-10 items-center justify-center rounded-full bg-n-alpha-2"
|
|
>
|
|
<Icon :icon="icon" class="text-n-slate-10 size-6" />
|
|
</div>
|
|
<div
|
|
v-if="hasVoiceBadge"
|
|
class="absolute -top-1 ltr:-right-1 rtl:-left-1 flex size-4 items-center justify-center rounded-full bg-n-alpha-2 ring-2 ring-n-solid-1"
|
|
>
|
|
<Icon icon="i-lucide-audio-lines" class="text-n-slate-10 size-2.5" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex flex-col items-start gap-1.5">
|
|
<div class="flex items-center gap-2">
|
|
<h3 class="text-n-slate-12 text-sm text-start font-medium capitalize">
|
|
{{ title }}
|
|
</h3>
|
|
<Label
|
|
v-if="isBeta && !isComingSoon"
|
|
v-tooltip.top="t('GENERAL.BETA_DESCRIPTION')"
|
|
:label="t('GENERAL.BETA')"
|
|
color="blue"
|
|
compact
|
|
/>
|
|
</div>
|
|
<p class="text-n-slate-11 text-start text-sm">
|
|
{{ description }}
|
|
</p>
|
|
</div>
|
|
|
|
<div
|
|
v-if="isComingSoon"
|
|
class="absolute inset-0 flex items-center justify-center backdrop-blur-[2px] rounded-2xl bg-gradient-to-br from-n-surface-1/90 via-n-surface-1/70 to-n-surface-1/95 cursor-not-allowed"
|
|
>
|
|
<span class="text-n-slate-12 font-medium text-sm">
|
|
{{ t('CHANNEL_SELECTOR.COMING_SOON') }} 🚀
|
|
</span>
|
|
</div>
|
|
</button>
|
|
</template>
|