From 9019320a12f140f66fb0b02cae3bb79d3408ace9 Mon Sep 17 00:00:00 2001 From: Stephen Hand Date: Mon, 10 Aug 2026 14:56:28 +0100 Subject: [PATCH 1/2] WIP quick dial --- .../ConferenceActions/ConferencePanel.tsx | 7 +- .../ConferenceActions/PhoneInputDialog.tsx | 87 +++++++++++++------ .../states/contacts/selectContactByTaskSid.ts | 6 +- 3 files changed, 70 insertions(+), 30 deletions(-) diff --git a/plugin-hrm-form/src/components/Conference/ConferenceActions/ConferencePanel.tsx b/plugin-hrm-form/src/components/Conference/ConferenceActions/ConferencePanel.tsx index 9cf9abacd5..0bd969ebe6 100644 --- a/plugin-hrm-form/src/components/Conference/ConferenceActions/ConferencePanel.tsx +++ b/plugin-hrm-form/src/components/Conference/ConferenceActions/ConferencePanel.tsx @@ -59,7 +59,7 @@ const ConferencePanel: React.FC = ({ task, conference }) => { return null; } - const handleClick = async () => { + const handleClick = (phoneNumberGetter: () => string) => async () => { try { const { status, callStatusSyncDocument } = await createCallStatusSyncDocument(({ data }) => { setCallStatus(data.CallStatus); @@ -70,7 +70,7 @@ const ConferencePanel: React.FC = ({ task, conference }) => { } const from = Manager.getInstance().serviceConfiguration.outbound_call_flows.default.caller_id; - const to = phoneNumber; + const to = phoneNumberGetter(); const label = `External party ${to}`; await Promise.all( @@ -117,7 +117,8 @@ const ConferencePanel: React.FC = ({ task, conference }) => { phoneNumber)} + handleQuickDialClick={(numberToDial: string) => handleClick(() => numberToDial)} setIsDialogOpen={setIsDialogOpen} isLoading={isCallStatusLoading(callStatus)} /> diff --git a/plugin-hrm-form/src/components/Conference/ConferenceActions/PhoneInputDialog.tsx b/plugin-hrm-form/src/components/Conference/ConferenceActions/PhoneInputDialog.tsx index 13538696e6..81227075a8 100644 --- a/plugin-hrm-form/src/components/Conference/ConferenceActions/PhoneInputDialog.tsx +++ b/plugin-hrm-form/src/components/Conference/ConferenceActions/PhoneInputDialog.tsx @@ -24,20 +24,49 @@ import { PhoneDialogWrapper, DialogArrow } from './styles'; type PhoneDialogProps = { targetNumber: string; setTargetNumber: (targetNumber: string) => void; - handleClick: () => void; + handleManualDialClick: () => void; + handleQuickDialClick: (phoneNumber: string) => void; setIsDialogOpen: (isDialogOpen: boolean) => void; isLoading: boolean; }; const ENTER_NUMBER_KEY = 'Conference-EnterPhoneNumber'; +type QuickDialItem = { + labelKey: string; + phoneNumber: string; +}; + +const TEMPORARY_HARDCODED_QUICKDIAL: QuickDialItem[] = [ + { labelKey: 'ConferencingPanel-PhoneInputDialog-QuickDialItem/988-English', phoneNumber: '+353873447272' }, + { labelKey: 'ConferencingPanel-PhoneInputDialog-QuickDialItem/988-Spanish', phoneNumber: '+353873447272' }, +]; + +const ALLOW_MANUAL_DIAL: boolean = true; + const PhoneInputDialog: React.FC = ({ targetNumber, setTargetNumber, - handleClick, + handleQuickDialClick, + handleManualDialClick, setIsDialogOpen, isLoading, }) => { + const dialButton = (handleClick: () => void) => { + return ( + + {isLoading ? ( + + ) : ( + <> +     +