diff --git a/aselo-webchat-react-app/package.json b/aselo-webchat-react-app/package.json index 79e372b1b0..fbc525e497 100644 --- a/aselo-webchat-react-app/package.json +++ b/aselo-webchat-react-app/package.json @@ -109,6 +109,7 @@ "start:uscr_stg": "cross-env REACT_APP_CONFIG_URL='http://localhost:9090/uscr/staging.json' REACT_APP_FORM_DEFINITIONS_BASE_URL='http://localhost:8091' run-p staging:merge-configs dev:local-config-server dev:local-form-definition-server start", "start:ca_stg": "cross-env REACT_APP_CONFIG_URL='http://localhost:9090/ca/staging.json' REACT_APP_FORM_DEFINITIONS_BASE_URL='http://localhost:8091' run-p staging:merge-configs dev:local-config-server dev:local-form-definition-server start", "start:ca_prod": "cross-env REACT_APP_CONFIG_URL='http://localhost:9090/ca/production.json' REACT_APP_FORM_DEFINITIONS_BASE_URL='http://localhost:8091' run-p production:merge-configs dev:local-config-server dev:local-form-definition-server start", + "start:nzba_prod": "cross-env REACT_APP_CONFIG_URL='http://localhost:9090/nzba/production.json' REACT_APP_FORM_DEFINITIONS_BASE_URL='http://localhost:8091' run-p production:merge-configs dev:local-config-server dev:local-form-definition-server start", "build": "react-app-rewired build", "lint": "eslint --ext js --ext jsx --ext ts --ext tsx src/", "lint:fix": "npm run lint -- --fix", diff --git a/plugin-hrm-form/src/components/Conference/ConferenceActions/ConferencePanel.tsx b/plugin-hrm-form/src/components/Conference/ConferenceActions/ConferencePanel.tsx index 9cf9abacd5..783e423ad3 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..841da969bc 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: 'Conference-PhoneInputDialog-QuickDialItem/988-English', phoneNumber: '+35314482861' }, + { labelKey: 'Conference-PhoneInputDialog-QuickDialItem/988-Spanish', phoneNumber: '+35317712424 ' }, +]; + +const ALLOW_MANUAL_DIAL: boolean = true; + const PhoneInputDialog: React.FC = ({ targetNumber, setTargetNumber, - handleClick, + handleQuickDialClick, + handleManualDialClick, setIsDialogOpen, isLoading, }) => { + const dialButton = (handleClick: () => void) => { + return ( + + {isLoading ? ( + + ) : ( + <> +     +