Init CallLinkDetails view in calls tab

This commit is contained in:
Jamie Kyle 2024-05-22 09:24:27 -07:00 committed by GitHub
parent e9b661873b
commit 19083cadf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 665 additions and 222 deletions

View file

@ -3772,8 +3772,6 @@ function getCallHistoryGroupDataSync(
-- Desktop Constraints:
AND callsHistory.status IS c.status
AND ${filterClause}
-- Skip grouping logic for adhoc calls
AND callsHistory.mode IS NOT ${CALL_MODE_ADHOC}
ORDER BY timestamp DESC
) as possibleChildren,
@ -3893,17 +3891,21 @@ async function getCallHistoryGroups(
})
.reverse()
.map(group => {
const { possibleChildren, inPeriod, ...rest } = group;
const { possibleChildren, inPeriod, type, ...rest } = group;
const children = [];
for (const child of possibleChildren) {
if (!taken.has(child.callId) && inPeriod.has(child.callId)) {
children.push(child);
taken.add(child.callId);
if (type === CallType.Adhoc) {
// By spec, limit adhoc call history to the most recent call
break;
}
}
}
return callHistoryGroupSchema.parse({ ...rest, children });
return callHistoryGroupSchema.parse({ ...rest, type, children });
})
.reverse();
}