@vgroup/dialbox 0.2.3 → 0.2.5
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/esm2020/lib/components/call-progress/call-progress.component.mjs +16 -3
- package/esm2020/lib/components/call-progress/incoming-call/incoming-call.component.mjs +25 -19
- package/fesm2015/vgroup-dialbox.mjs +39 -20
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +39 -20
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/components/call-progress/call-progress.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1774,27 +1774,33 @@ class IncomingCallComponent {
|
|
|
1774
1774
|
return false;
|
|
1775
1775
|
}
|
|
1776
1776
|
onClickExpand(data) {
|
|
1777
|
-
if (this.selectedIncomingCall === data && this.isClickExpand) {
|
|
1778
|
-
|
|
1777
|
+
if (this.selectedIncomingCall === data && this.selectedIncomingCall?.isClickExpand) {
|
|
1778
|
+
// Collapse if clicking the same expanded item
|
|
1779
|
+
const updatedCall = {
|
|
1780
|
+
...this.selectedIncomingCall,
|
|
1781
|
+
isClickExpand: false
|
|
1782
|
+
};
|
|
1779
1783
|
this.selectedIncomingCall = null;
|
|
1780
|
-
this.selectedIncomingCallInfo.emit(
|
|
1784
|
+
this.selectedIncomingCallInfo.emit(updatedCall);
|
|
1781
1785
|
return;
|
|
1782
1786
|
}
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1787
|
+
// Expand the clicked item
|
|
1788
|
+
const updatedCall = {
|
|
1789
|
+
...data,
|
|
1790
|
+
isClickExpand: true
|
|
1791
|
+
};
|
|
1792
|
+
this.selectedIncomingCall = updatedCall;
|
|
1793
|
+
// Update the newIncomingCallsList with the updated call
|
|
1794
|
+
if (this.newIncomingCallsList?.length) {
|
|
1795
|
+
this.newIncomingCallsList = this.newIncomingCallsList.map((call) => call.parameters?.CallSid === updatedCall.parameters?.CallSid
|
|
1796
|
+
? updatedCall
|
|
1797
|
+
: { ...call, isClickExpand: false });
|
|
1798
|
+
}
|
|
1799
|
+
// Emit the updated call to parent
|
|
1800
|
+
this.selectedIncomingCallInfo.emit(updatedCall);
|
|
1801
|
+
// Fetch user info if needed
|
|
1802
|
+
if (!updatedCall.userInfo || updatedCall.userInfo?.status === 201) {
|
|
1803
|
+
this.getUserInformation(updatedCall);
|
|
1798
1804
|
}
|
|
1799
1805
|
}
|
|
1800
1806
|
getUserInformation(incomingCallData) {
|
|
@@ -2663,8 +2669,21 @@ class CallProgressComponent {
|
|
|
2663
2669
|
this.newIncomingCallsList = data;
|
|
2664
2670
|
this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
|
|
2665
2671
|
}
|
|
2666
|
-
selectedIncomingCallInfo(
|
|
2667
|
-
|
|
2672
|
+
selectedIncomingCallInfo(updatedCall) {
|
|
2673
|
+
if (!updatedCall || Object.keys(updatedCall).length === 0) {
|
|
2674
|
+
this.selectedIncomingCall = null;
|
|
2675
|
+
this.cdr.detectChanges();
|
|
2676
|
+
return;
|
|
2677
|
+
}
|
|
2678
|
+
// Update the call in the array if it exists
|
|
2679
|
+
if (this.newIncomingCallsList) {
|
|
2680
|
+
this.newIncomingCallsList = this.newIncomingCallsList.map((call) => call.parameters?.CallSid === updatedCall.parameters?.CallSid
|
|
2681
|
+
? { ...call, ...updatedCall }
|
|
2682
|
+
: { ...call, isClickExpand: false });
|
|
2683
|
+
}
|
|
2684
|
+
// Update the selected call reference
|
|
2685
|
+
this.selectedIncomingCall = updatedCall;
|
|
2686
|
+
this.cdr.detectChanges();
|
|
2668
2687
|
}
|
|
2669
2688
|
ngOnDestroy() {
|
|
2670
2689
|
this.callData.dial = false;
|