diff --git a/packages/plugin-calls-ui/src/components/Form.tsx b/packages/plugin-calls-ui/src/components/Form.tsx
index 45aea947122..2f3f305b7e5 100644
--- a/packages/plugin-calls-ui/src/components/Form.tsx
+++ b/packages/plugin-calls-ui/src/components/Form.tsx
@@ -10,10 +10,10 @@ import { IFormProps } from '@erxes/ui/src/types';
import { __ } from '@erxes/ui/src/utils';
import React, { useState } from 'react';
-interface Props {
+interface IProps {
closeModal?: () => void;
data: any;
- callData?: { callerNumber: String };
+ callData?: { callerNumber: string };
setConfig?: any;
}
@@ -26,12 +26,17 @@ const renderInput = (
return (
{label}
-
+
);
};
-const CallIntegrationForm = (props: Props) => {
+const CallIntegrationForm = (props: IProps) => {
const { closeModal, data = {}, setConfig } = props;
const [selectedIntegrationId, setSelectedIntegrationId] = useState('');
const integration = selectedIntegrationId
@@ -39,6 +44,7 @@ const CallIntegrationForm = (props: Props) => {
: data?.[0];
const saveCallConfig = () => {
+ // tslint:disable-next-line:no-unused-expression
integration &&
localStorage.setItem(
'config:call_integrations',
@@ -51,6 +57,7 @@ const CallIntegrationForm = (props: Props) => {
isAvailable: true
})
);
+ // tslint:disable-next-line:no-unused-expression
integration &&
setConfig({
inboxId: integration.inboxId,
@@ -63,6 +70,33 @@ const CallIntegrationForm = (props: Props) => {
closeModal();
};
+ const skipCallConnection = () => {
+ // tslint:disable-next-line:no-unused-expression
+ integration &&
+ localStorage.setItem(
+ 'config:call_integrations',
+ JSON.stringify({
+ inboxId: integration?.inboxId,
+ phone: integration?.phone,
+ wsServer: integration?.wsServer,
+ token: integration?.token,
+ operators: integration?.operators,
+ isAvailable: false
+ })
+ );
+ // tslint:disable-next-line:no-unused-expression
+ integration &&
+ setConfig({
+ inboxId: integration.inboxId,
+ phone: integration.phone,
+ wsServer: integration.wsServer,
+ token: integration.token,
+ operators: integration.operators,
+ isAvailable: false
+ });
+ closeModal();
+ };
+
const onChange = e => {
setSelectedIntegrationId(e.target.value);
};
@@ -124,6 +158,15 @@ const CallIntegrationForm = (props: Props) => {
>
Cancel
+
+