call-control-sdk 6.5.5-uat.3 → 6.5.5-uat.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1162,7 +1162,7 @@ var styles_default = useStyles;
1162
1162
 
1163
1163
  // call-control-sdk/lib/components/dialog.tsx
1164
1164
  import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
1165
- var ConferenceTableRow = ({ each }) => {
1165
+ var ConferenceTableRow = ({ each, isLineDialing }) => {
1166
1166
  var _a2, _b, _c, _d, _e, _f;
1167
1167
  const state = useSDKState();
1168
1168
  const theme = useTheme2();
@@ -1352,7 +1352,7 @@ var ConferenceTableRow = ({ each }) => {
1352
1352
  placeholder: "Phone Number",
1353
1353
  fullWidth: true,
1354
1354
  value: (each == null ? void 0 : each.phone) || "",
1355
- disabled: (each == null ? void 0 : each.line) === 1 || ["ONCALL" /* ONCALL */, "DISCONNECTED" /* DISCONNECTED */, "CONFERENCE" /* CONFERENCE */, "HOLD" /* HOLD */, "MUTE" /* MUTE */, "DIALING" /* DIALING */, "RINGING" /* RINGING */].includes((_f = each == null ? void 0 : each.status) != null ? _f : ""),
1355
+ disabled: (each == null ? void 0 : each.line) === 1 || ["ONCALL" /* ONCALL */, "DISCONNECTED" /* DISCONNECTED */, "CONFERENCE" /* CONFERENCE */, "HOLD" /* HOLD */, "MUTE" /* MUTE */, "DIALING" /* DIALING */, "RINGING" /* RINGING */].includes((_f = each == null ? void 0 : each.status) != null ? _f : "") || isLineDialing,
1356
1356
  onChange: (e) => {
1357
1357
  onConferenceLineUpdate(each, { phone: e.target.value });
1358
1358
  }
@@ -1480,7 +1480,7 @@ var ConferenceTableRow = ({ each }) => {
1480
1480
  onClick: () => {
1481
1481
  onConferenceCallStart(each, {});
1482
1482
  },
1483
- disabled: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */,
1483
+ disabled: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */ || isLineDialing,
1484
1484
  children: conferenceCallStart ? /* @__PURE__ */ jsx2(
1485
1485
  CircularProgress,
1486
1486
  {
@@ -1581,7 +1581,7 @@ var ConferenceTableRow = ({ each }) => {
1581
1581
  );
1582
1582
  };
1583
1583
  function ConferenceDialog() {
1584
- var _a2;
1584
+ var _a2, _b;
1585
1585
  const state = useSDKState();
1586
1586
  const { showToast } = useToast();
1587
1587
  const [conferenceCallEndAll, setConferenceCallEndAll] = useState8(false);
@@ -1589,12 +1589,12 @@ function ConferenceDialog() {
1589
1589
  sdkStateManager.setOpenConferenceDialog(false);
1590
1590
  };
1591
1591
  const onEndAllConferenceCalls = () => {
1592
- var _a3, _b, _c, _d;
1592
+ var _a3, _b2, _c, _d;
1593
1593
  setConferenceCallEndAll(true);
1594
1594
  const payload = {
1595
1595
  action: "EXTERNAL_CONFERENCE",
1596
1596
  operation: "ENDCONFERENCE",
1597
- userid: (_b = (_a3 = state.callData) == null ? void 0 : _a3.agent_id) != null ? _b : "",
1597
+ userid: (_b2 = (_a3 = state.callData) == null ? void 0 : _a3.agent_id) != null ? _b2 : "",
1598
1598
  process: (_d = (_c = state.callData) == null ? void 0 : _c.process_name) != null ? _d : ""
1599
1599
  };
1600
1600
  axios_default.post(END_POINT.CONFERENCE_CALL_END_ALL, payload).then((res) => {
@@ -1603,13 +1603,15 @@ function ConferenceDialog() {
1603
1603
  sdkStateManager.resetConferenceLines();
1604
1604
  handleClose();
1605
1605
  }).catch((err) => {
1606
- var _a4, _b2, _c2, _d2;
1607
- const message = ((_b2 = (_a4 = err.response) == null ? void 0 : _a4.data) == null ? void 0 : _b2.detail) || ((_d2 = (_c2 = err.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || err.message || "An unknown error occurred";
1606
+ var _a4, _b3, _c2, _d2;
1607
+ const message = ((_b3 = (_a4 = err.response) == null ? void 0 : _a4.data) == null ? void 0 : _b3.detail) || ((_d2 = (_c2 = err.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || err.message || "An unknown error occurred";
1608
1608
  showToast(message, "error");
1609
1609
  }).finally(() => {
1610
1610
  setConferenceCallEndAll(false);
1611
1611
  });
1612
1612
  };
1613
+ const isLineDialing = (_a2 = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _a2.some((item) => (item == null ? void 0 : item.status) === "DIALING" /* DIALING */);
1614
+ console.log("dataaaaa", state == null ? void 0 : state.conferenceLine, isLineDialing);
1613
1615
  return /* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2(
1614
1616
  Dialog,
1615
1617
  {
@@ -1629,7 +1631,7 @@ function ConferenceDialog() {
1629
1631
  },
1630
1632
  children: [
1631
1633
  /* @__PURE__ */ jsxs2(Typography, { variant: "body1", children: [
1632
- (_a2 = state == null ? void 0 : state.agentId) != null ? _a2 : "",
1634
+ (_b = state == null ? void 0 : state.agentId) != null ? _b : "",
1633
1635
  " conference"
1634
1636
  ] }),
1635
1637
  /* @__PURE__ */ jsx2(IconButton, { onClick: handleClose, children: /* @__PURE__ */ jsx2(Close, {}) })
@@ -1705,7 +1707,7 @@ function ConferenceDialog() {
1705
1707
  ]
1706
1708
  }
1707
1709
  ) }),
1708
- /* @__PURE__ */ jsx2(TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ jsx2(ConferenceTableRow, { each })) })
1710
+ /* @__PURE__ */ jsx2(TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ jsx2(ConferenceTableRow, { each, isLineDialing })) })
1709
1711
  ]
1710
1712
  }
1711
1713
  )