ahs-cti 0.0.1
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/LICENSE +53 -0
- package/LICENSE-ACHALA +80 -0
- package/README.md +639 -0
- package/dist/agentDetailReport-7TDO6MYQ.mjs +11 -0
- package/dist/agentDetailReport-7TDO6MYQ.mjs.map +1 -0
- package/dist/agentPerformanceReport-R3WY7Q7D.mjs +531 -0
- package/dist/agentPerformanceReport-R3WY7Q7D.mjs.map +1 -0
- package/dist/auditReport-CJ23LXIZ.mjs +15 -0
- package/dist/auditReport-CJ23LXIZ.mjs.map +1 -0
- package/dist/callHistory-743J7EKD.mjs +783 -0
- package/dist/callHistory-743J7EKD.mjs.map +1 -0
- package/dist/campaigns-N2RLUJHH.mjs +3005 -0
- package/dist/campaigns-N2RLUJHH.mjs.map +1 -0
- package/dist/caroQualityAuditDashboard-NRWY6SEC.mjs +66 -0
- package/dist/caroQualityAuditDashboard-NRWY6SEC.mjs.map +1 -0
- package/dist/caroVoiceAI-Z5BDDDSY.mjs +21 -0
- package/dist/caroVoiceAI-Z5BDDDSY.mjs.map +1 -0
- package/dist/cdrReport-577UYGZA.mjs +798 -0
- package/dist/cdrReport-577UYGZA.mjs.map +1 -0
- package/dist/chunk-6ICPXSN6.mjs +61 -0
- package/dist/chunk-6ICPXSN6.mjs.map +1 -0
- package/dist/chunk-BU6FMNBY.mjs +82 -0
- package/dist/chunk-BU6FMNBY.mjs.map +1 -0
- package/dist/chunk-DBSNJ3QH.mjs +1060 -0
- package/dist/chunk-DBSNJ3QH.mjs.map +1 -0
- package/dist/chunk-EJIWPC3H.mjs +747 -0
- package/dist/chunk-EJIWPC3H.mjs.map +1 -0
- package/dist/chunk-GTDWTI5S.mjs +17217 -0
- package/dist/chunk-GTDWTI5S.mjs.map +1 -0
- package/dist/chunk-L4LLUMYA.mjs +57 -0
- package/dist/chunk-L4LLUMYA.mjs.map +1 -0
- package/dist/chunk-NQL4VODC.mjs +180 -0
- package/dist/chunk-NQL4VODC.mjs.map +1 -0
- package/dist/chunk-NUYGQI7D.mjs +678 -0
- package/dist/chunk-NUYGQI7D.mjs.map +1 -0
- package/dist/chunk-RZZQ42MG.mjs +115 -0
- package/dist/chunk-RZZQ42MG.mjs.map +1 -0
- package/dist/chunk-UB5HSUGK.mjs +65 -0
- package/dist/chunk-UB5HSUGK.mjs.map +1 -0
- package/dist/chunk-VGVOMFYH.mjs +5781 -0
- package/dist/chunk-VGVOMFYH.mjs.map +1 -0
- package/dist/chunk-VZCHJLAW.mjs +61 -0
- package/dist/chunk-VZCHJLAW.mjs.map +1 -0
- package/dist/incoming-4WP3FJI4.mp3 +0 -0
- package/dist/incoming.mp3 +0 -0
- package/dist/index.d.mts +2476 -0
- package/dist/index.d.ts +2477 -0
- package/dist/index.js +41208 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4641 -0
- package/dist/index.mjs.map +1 -0
- package/dist/liveStatus-IQIEZZE5.mjs +1077 -0
- package/dist/liveStatus-IQIEZZE5.mjs.map +1 -0
- package/dist/loginReport-H6XJU2MY.mjs +826 -0
- package/dist/loginReport-H6XJU2MY.mjs.map +1 -0
- package/dist/managementDashboard-NZMAJPPB.mjs +527 -0
- package/dist/managementDashboard-NZMAJPPB.mjs.map +1 -0
- package/dist/qualityAuditDashboard-ZJEEAMBS.mjs +66 -0
- package/dist/qualityAuditDashboard-ZJEEAMBS.mjs.map +1 -0
- package/package.json +114 -0
|
@@ -0,0 +1,798 @@
|
|
|
1
|
+
import {
|
|
2
|
+
exportCdrReportToExcel,
|
|
3
|
+
getCdrReport,
|
|
4
|
+
getQueues,
|
|
5
|
+
getRecordingByCall
|
|
6
|
+
} from "./chunk-VZCHJLAW.mjs";
|
|
7
|
+
import {
|
|
8
|
+
AuditReportDialog
|
|
9
|
+
} from "./chunk-NUYGQI7D.mjs";
|
|
10
|
+
import {
|
|
11
|
+
ReportFilterBar,
|
|
12
|
+
SearchBar,
|
|
13
|
+
headCellSx
|
|
14
|
+
} from "./chunk-VGVOMFYH.mjs";
|
|
15
|
+
import {
|
|
16
|
+
SDKPermissionGuard
|
|
17
|
+
} from "./chunk-NQL4VODC.mjs";
|
|
18
|
+
import {
|
|
19
|
+
AdapterDayjs,
|
|
20
|
+
AppButton,
|
|
21
|
+
LocalizationProvider,
|
|
22
|
+
PageHeader
|
|
23
|
+
} from "./chunk-GTDWTI5S.mjs";
|
|
24
|
+
import {
|
|
25
|
+
SDKProvider
|
|
26
|
+
} from "./chunk-6ICPXSN6.mjs";
|
|
27
|
+
import {
|
|
28
|
+
SDK_PERMISSIONS,
|
|
29
|
+
deepFindArray
|
|
30
|
+
} from "./chunk-DBSNJ3QH.mjs";
|
|
31
|
+
import {
|
|
32
|
+
__spreadProps,
|
|
33
|
+
__spreadValues
|
|
34
|
+
} from "./chunk-UB5HSUGK.mjs";
|
|
35
|
+
|
|
36
|
+
// call-control-sdk/lib/pages/cdrReport/index.tsx
|
|
37
|
+
import {
|
|
38
|
+
useCallback,
|
|
39
|
+
useEffect,
|
|
40
|
+
useMemo,
|
|
41
|
+
useRef,
|
|
42
|
+
useState
|
|
43
|
+
} from "react";
|
|
44
|
+
import {
|
|
45
|
+
Alert,
|
|
46
|
+
Box,
|
|
47
|
+
Chip,
|
|
48
|
+
Paper,
|
|
49
|
+
Stack,
|
|
50
|
+
Table,
|
|
51
|
+
TableBody,
|
|
52
|
+
TableCell,
|
|
53
|
+
TableContainer,
|
|
54
|
+
TableHead,
|
|
55
|
+
TableRow,
|
|
56
|
+
TablePagination,
|
|
57
|
+
TableSortLabel,
|
|
58
|
+
CircularProgress,
|
|
59
|
+
IconButton,
|
|
60
|
+
Tooltip
|
|
61
|
+
} from "@mui/material";
|
|
62
|
+
import DownloadIcon from "@mui/icons-material/Download";
|
|
63
|
+
import RefreshIcon from "@mui/icons-material/Refresh";
|
|
64
|
+
import PlayArrowIcon from "@mui/icons-material/PlayArrow";
|
|
65
|
+
import FileDownloadIcon from "@mui/icons-material/FileDownload";
|
|
66
|
+
import AssignmentIcon from "@mui/icons-material/Assignment";
|
|
67
|
+
import dayjs from "dayjs";
|
|
68
|
+
import isoWeek from "dayjs/plugin/isoWeek";
|
|
69
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
70
|
+
dayjs.extend(isoWeek);
|
|
71
|
+
var FONT = "'Inter', 'Segoe UI', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif";
|
|
72
|
+
var COLORS = {
|
|
73
|
+
navy: "#0d2a56",
|
|
74
|
+
blue: "#1565c8",
|
|
75
|
+
green: "#0a9a62",
|
|
76
|
+
amber: "#c47c00",
|
|
77
|
+
red: "#cc2a2a",
|
|
78
|
+
purple: "#6b3fbf",
|
|
79
|
+
bg: "transparent",
|
|
80
|
+
surface: "transparent"
|
|
81
|
+
};
|
|
82
|
+
var DEFAULT_PAGE_SIZE = 15;
|
|
83
|
+
var comparator = (a, b, key) => {
|
|
84
|
+
const av = a[key];
|
|
85
|
+
const bv = b[key];
|
|
86
|
+
if (typeof av === "number" && typeof bv === "number") return av - bv;
|
|
87
|
+
if (typeof av === "boolean" && typeof bv === "boolean")
|
|
88
|
+
return (av ? 1 : 0) - (bv ? 1 : 0);
|
|
89
|
+
return String(av != null ? av : "").localeCompare(String(bv != null ? bv : ""));
|
|
90
|
+
};
|
|
91
|
+
function CallTypePill({ value }) {
|
|
92
|
+
const v = (value || "").toLowerCase();
|
|
93
|
+
let color = "#6b7b8d";
|
|
94
|
+
let bg = "transparent";
|
|
95
|
+
if (v.includes("inbound")) {
|
|
96
|
+
color = COLORS.green;
|
|
97
|
+
bg = "#e6f7ef";
|
|
98
|
+
} else if (v.includes("outbound")) {
|
|
99
|
+
color = COLORS.blue;
|
|
100
|
+
bg = "#e3eefa";
|
|
101
|
+
} else if (v.includes("internal")) {
|
|
102
|
+
color = COLORS.purple;
|
|
103
|
+
bg = "#f0e8ff";
|
|
104
|
+
}
|
|
105
|
+
return /* @__PURE__ */ jsx(
|
|
106
|
+
Chip,
|
|
107
|
+
{
|
|
108
|
+
label: value,
|
|
109
|
+
size: "small",
|
|
110
|
+
sx: {
|
|
111
|
+
fontFamily: FONT,
|
|
112
|
+
bgcolor: bg,
|
|
113
|
+
color,
|
|
114
|
+
fontWeight: 600,
|
|
115
|
+
fontSize: "0.65rem",
|
|
116
|
+
height: 20,
|
|
117
|
+
borderRadius: "6px"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
function StatusPill({ value }) {
|
|
123
|
+
const v = (value || "").toLowerCase();
|
|
124
|
+
let color = "#6b7b8d";
|
|
125
|
+
let bg = "transparent";
|
|
126
|
+
if (v.includes("answered")) {
|
|
127
|
+
color = COLORS.green;
|
|
128
|
+
bg = "#e6f7ef";
|
|
129
|
+
} else if (v.includes("abandoned") || v.includes("missed")) {
|
|
130
|
+
color = COLORS.red;
|
|
131
|
+
bg = "#fce8e8";
|
|
132
|
+
}
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
Chip,
|
|
135
|
+
{
|
|
136
|
+
label: value,
|
|
137
|
+
size: "small",
|
|
138
|
+
sx: {
|
|
139
|
+
fontFamily: FONT,
|
|
140
|
+
bgcolor: bg,
|
|
141
|
+
color,
|
|
142
|
+
fontWeight: 600,
|
|
143
|
+
fontSize: "0.65rem",
|
|
144
|
+
height: 20,
|
|
145
|
+
borderRadius: "6px"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
function RecordingCell({
|
|
151
|
+
callUuid,
|
|
152
|
+
recordingPath
|
|
153
|
+
}) {
|
|
154
|
+
const [audioUrl, setAudioUrl] = useState(null);
|
|
155
|
+
const [loading, setLoading] = useState(false);
|
|
156
|
+
const [error, setError] = useState(false);
|
|
157
|
+
const unavailable = recordingPath === null;
|
|
158
|
+
const handlePlay = async () => {
|
|
159
|
+
if (audioUrl) return;
|
|
160
|
+
try {
|
|
161
|
+
setLoading(true);
|
|
162
|
+
setError(false);
|
|
163
|
+
const blob = await getRecordingByCall(callUuid);
|
|
164
|
+
const url = URL.createObjectURL(blob);
|
|
165
|
+
setAudioUrl(url);
|
|
166
|
+
} catch (e) {
|
|
167
|
+
setError(true);
|
|
168
|
+
} finally {
|
|
169
|
+
setLoading(false);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const handleDownload = async () => {
|
|
173
|
+
try {
|
|
174
|
+
const blob = audioUrl ? await fetch(audioUrl).then((r) => r.blob()) : await getRecordingByCall(callUuid);
|
|
175
|
+
const url = URL.createObjectURL(blob);
|
|
176
|
+
const a = document.createElement("a");
|
|
177
|
+
a.href = url;
|
|
178
|
+
a.download = `recording_${callUuid}.wav`;
|
|
179
|
+
a.click();
|
|
180
|
+
URL.revokeObjectURL(url);
|
|
181
|
+
} catch (e) {
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
if (audioUrl) {
|
|
185
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
186
|
+
/* @__PURE__ */ jsx(
|
|
187
|
+
"audio",
|
|
188
|
+
{
|
|
189
|
+
controls: true,
|
|
190
|
+
autoPlay: true,
|
|
191
|
+
src: audioUrl,
|
|
192
|
+
onEnded: () => {
|
|
193
|
+
if (audioUrl.startsWith("blob:")) URL.revokeObjectURL(audioUrl);
|
|
194
|
+
setAudioUrl(null);
|
|
195
|
+
},
|
|
196
|
+
style: { width: 180, height: 30 }
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "Download", children: /* @__PURE__ */ jsx(
|
|
200
|
+
IconButton,
|
|
201
|
+
{
|
|
202
|
+
size: "small",
|
|
203
|
+
onClick: handleDownload,
|
|
204
|
+
sx: { color: COLORS.blue, p: 0.4 },
|
|
205
|
+
children: /* @__PURE__ */ jsx(FileDownloadIcon, { sx: { fontSize: 16 } })
|
|
206
|
+
}
|
|
207
|
+
) })
|
|
208
|
+
] });
|
|
209
|
+
}
|
|
210
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.3 }, children: [
|
|
211
|
+
/* @__PURE__ */ jsx(Tooltip, { title: unavailable || error ? "Recording Unavailable" : "Play", children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
212
|
+
IconButton,
|
|
213
|
+
{
|
|
214
|
+
size: "small",
|
|
215
|
+
onClick: handlePlay,
|
|
216
|
+
disabled: loading || error || unavailable,
|
|
217
|
+
sx: { color: unavailable ? "#b0b8c8" : COLORS.green, p: 0.4 },
|
|
218
|
+
children: loading ? /* @__PURE__ */ jsx(CircularProgress, { size: 14 }) : /* @__PURE__ */ jsx(PlayArrowIcon, { sx: { fontSize: 16 } })
|
|
219
|
+
}
|
|
220
|
+
) }) }),
|
|
221
|
+
/* @__PURE__ */ jsx(
|
|
222
|
+
Tooltip,
|
|
223
|
+
{
|
|
224
|
+
title: unavailable || error ? "Recording Unavailable" : "Download",
|
|
225
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
226
|
+
IconButton,
|
|
227
|
+
{
|
|
228
|
+
size: "small",
|
|
229
|
+
onClick: handleDownload,
|
|
230
|
+
disabled: loading || error || unavailable,
|
|
231
|
+
sx: { color: unavailable ? "#b0b8c8" : COLORS.blue, p: 0.4 },
|
|
232
|
+
children: /* @__PURE__ */ jsx(FileDownloadIcon, { sx: { fontSize: 16 } })
|
|
233
|
+
}
|
|
234
|
+
) })
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
] });
|
|
238
|
+
}
|
|
239
|
+
function CdrReportContent() {
|
|
240
|
+
const [startDate, setStartDate] = useState(
|
|
241
|
+
dayjs().startOf("day")
|
|
242
|
+
);
|
|
243
|
+
const [endDate, setEndDate] = useState(dayjs());
|
|
244
|
+
const [activeQuickDate, setActiveQuickDate] = useState("today");
|
|
245
|
+
const [searchText, setSearchText] = useState("");
|
|
246
|
+
const [selectedAgents, setSelectedAgents] = useState([]);
|
|
247
|
+
const [isAllUsersSelected, setIsAllUsersSelected] = useState(false);
|
|
248
|
+
const [queues, setQueues] = useState([]);
|
|
249
|
+
const [selectedQueues, setSelectedQueues] = useState([]);
|
|
250
|
+
const [callType, setCallType] = useState("");
|
|
251
|
+
const [callStatus, setCallStatus] = useState("");
|
|
252
|
+
const [records, setRecords] = useState([]);
|
|
253
|
+
const [totalRecords, setTotalRecords] = useState(0);
|
|
254
|
+
const [loading, setLoading] = useState(false);
|
|
255
|
+
const [error, setError] = useState("");
|
|
256
|
+
const [page, setPage] = useState(0);
|
|
257
|
+
const [rowsPerPage, setRowsPerPage] = useState(DEFAULT_PAGE_SIZE);
|
|
258
|
+
const [sortKey, setSortKey] = useState("callStartTime");
|
|
259
|
+
const [sortDir, setSortDir] = useState("desc");
|
|
260
|
+
const [auditDialogOpen, setAuditDialogOpen] = useState(false);
|
|
261
|
+
const [selectedAuditRow, setSelectedAuditRow] = useState(null);
|
|
262
|
+
useEffect(() => {
|
|
263
|
+
getQueues().then((data) => setQueues(data || [])).catch(() => setError("Failed to load filter options"));
|
|
264
|
+
}, []);
|
|
265
|
+
const handleQuickRangeChange = (range) => {
|
|
266
|
+
setActiveQuickDate(range || null);
|
|
267
|
+
};
|
|
268
|
+
const [debouncedSearch, setDebouncedSearch] = useState("");
|
|
269
|
+
const debounceRef = useRef(void 0);
|
|
270
|
+
useEffect(() => {
|
|
271
|
+
debounceRef.current = setTimeout(
|
|
272
|
+
() => setDebouncedSearch(searchText.trim()),
|
|
273
|
+
400
|
|
274
|
+
);
|
|
275
|
+
return () => clearTimeout(debounceRef.current);
|
|
276
|
+
}, [searchText]);
|
|
277
|
+
const fetchReport = useCallback(
|
|
278
|
+
async (pageNum) => {
|
|
279
|
+
var _a, _b, _c, _d, _e;
|
|
280
|
+
const sd = startDate != null ? startDate : dayjs();
|
|
281
|
+
const ed = endDate != null ? endDate : dayjs();
|
|
282
|
+
if (!sd || !ed) {
|
|
283
|
+
setError("Select a valid date range");
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
const params = {
|
|
287
|
+
start_date: sd.format("YYYY-MM-DDTHH:mm:ss"),
|
|
288
|
+
end_date: ed.format("YYYY-MM-DDTHH:mm:ss"),
|
|
289
|
+
agent_id: !isAllUsersSelected && selectedAgents.length > 0 ? selectedAgents.map((a) => a.id) : void 0,
|
|
290
|
+
// All queues selected → send no queue_id (backend returns all).
|
|
291
|
+
queue_id: selectedQueues.length > 0 && selectedQueues.length < queues.length ? selectedQueues.map((q) => q.id) : void 0,
|
|
292
|
+
call_type: callType || void 0,
|
|
293
|
+
status: callStatus || void 0,
|
|
294
|
+
search: debouncedSearch || void 0,
|
|
295
|
+
page: pageNum + 1,
|
|
296
|
+
pageSize: rowsPerPage
|
|
297
|
+
};
|
|
298
|
+
try {
|
|
299
|
+
setError("");
|
|
300
|
+
setLoading(true);
|
|
301
|
+
const response = await getCdrReport(params);
|
|
302
|
+
setRecords(
|
|
303
|
+
deepFindArray(response, ["data", "records"])
|
|
304
|
+
);
|
|
305
|
+
setTotalRecords(
|
|
306
|
+
(_e = (_d = (_b = (_a = response == null ? void 0 : response.records) == null ? void 0 : _a.total) != null ? _b : response == null ? void 0 : response.total) != null ? _d : (_c = response == null ? void 0 : response.data) == null ? void 0 : _c.total) != null ? _e : 0
|
|
307
|
+
);
|
|
308
|
+
} catch (err) {
|
|
309
|
+
setError((err == null ? void 0 : err.message) || "Failed to fetch CDR report");
|
|
310
|
+
setRecords([]);
|
|
311
|
+
} finally {
|
|
312
|
+
setLoading(false);
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
[
|
|
316
|
+
startDate,
|
|
317
|
+
endDate,
|
|
318
|
+
selectedAgents,
|
|
319
|
+
isAllUsersSelected,
|
|
320
|
+
selectedQueues,
|
|
321
|
+
callType,
|
|
322
|
+
callStatus,
|
|
323
|
+
debouncedSearch,
|
|
324
|
+
rowsPerPage
|
|
325
|
+
]
|
|
326
|
+
);
|
|
327
|
+
useEffect(() => {
|
|
328
|
+
setPage(0);
|
|
329
|
+
fetchReport(0);
|
|
330
|
+
}, [fetchReport]);
|
|
331
|
+
const handleRefresh = () => {
|
|
332
|
+
if (activeQuickDate) {
|
|
333
|
+
const now = dayjs();
|
|
334
|
+
let sd = now.startOf("day");
|
|
335
|
+
const ed = now;
|
|
336
|
+
if (activeQuickDate === "week") sd = now.startOf("week").startOf("day");
|
|
337
|
+
else if (activeQuickDate === "month")
|
|
338
|
+
sd = now.startOf("month").startOf("day");
|
|
339
|
+
setStartDate(sd);
|
|
340
|
+
setEndDate(ed);
|
|
341
|
+
} else {
|
|
342
|
+
fetchReport(page);
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
const handlePageChange = useCallback(
|
|
346
|
+
(_event, newPage) => {
|
|
347
|
+
setPage(newPage);
|
|
348
|
+
fetchReport(newPage);
|
|
349
|
+
},
|
|
350
|
+
[fetchReport]
|
|
351
|
+
);
|
|
352
|
+
const handleSort = (key) => {
|
|
353
|
+
if (sortKey === key) {
|
|
354
|
+
setSortDir((d) => d === "asc" ? "desc" : "asc");
|
|
355
|
+
} else {
|
|
356
|
+
setSortKey(key);
|
|
357
|
+
setSortDir("asc");
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
const sortedRecords = useMemo(() => {
|
|
361
|
+
const rows = [...records];
|
|
362
|
+
rows.sort((a, b) => {
|
|
363
|
+
const cmp = comparator(a, b, sortKey);
|
|
364
|
+
return sortDir === "asc" ? cmp : -cmp;
|
|
365
|
+
});
|
|
366
|
+
return rows;
|
|
367
|
+
}, [records, sortKey, sortDir]);
|
|
368
|
+
const handleExportExcel = async () => {
|
|
369
|
+
const sd = startDate != null ? startDate : dayjs();
|
|
370
|
+
const ed = endDate != null ? endDate : dayjs();
|
|
371
|
+
const params = {
|
|
372
|
+
start_date: sd.format("YYYY-MM-DDTHH:mm:ss"),
|
|
373
|
+
end_date: ed.format("YYYY-MM-DDTHH:mm:ss"),
|
|
374
|
+
agent_id: !isAllUsersSelected && selectedAgents.length > 0 ? selectedAgents.map((a) => a.id) : void 0,
|
|
375
|
+
queue_id: selectedQueues.length > 0 && selectedQueues.length < queues.length ? selectedQueues.map((q) => q.id) : void 0,
|
|
376
|
+
call_type: callType || void 0,
|
|
377
|
+
status: callStatus || void 0,
|
|
378
|
+
search: debouncedSearch || void 0
|
|
379
|
+
};
|
|
380
|
+
try {
|
|
381
|
+
await exportCdrReportToExcel(params);
|
|
382
|
+
} catch (err) {
|
|
383
|
+
setError((err == null ? void 0 : err.message) || "Failed to export Excel");
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
return /* @__PURE__ */ jsxs(LocalizationProvider, { dateAdapter: AdapterDayjs, children: [
|
|
387
|
+
/* @__PURE__ */ jsxs(
|
|
388
|
+
Box,
|
|
389
|
+
{
|
|
390
|
+
sx: {
|
|
391
|
+
height: "100%",
|
|
392
|
+
display: "flex",
|
|
393
|
+
flexDirection: "column",
|
|
394
|
+
fontFamily: FONT
|
|
395
|
+
},
|
|
396
|
+
children: [
|
|
397
|
+
/* @__PURE__ */ jsx(
|
|
398
|
+
PageHeader,
|
|
399
|
+
{
|
|
400
|
+
title: "CDR Report",
|
|
401
|
+
actions: /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", spacing: 1, children: [
|
|
402
|
+
/* @__PURE__ */ jsx(
|
|
403
|
+
SearchBar,
|
|
404
|
+
{
|
|
405
|
+
value: searchText,
|
|
406
|
+
onChange: setSearchText,
|
|
407
|
+
placeholder: "Search phone, agent...",
|
|
408
|
+
width: 250
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
/* @__PURE__ */ jsx(
|
|
412
|
+
SDKPermissionGuard,
|
|
413
|
+
{
|
|
414
|
+
permissions: [
|
|
415
|
+
SDK_PERMISSIONS.REPORTS_CDR_EXPORT,
|
|
416
|
+
SDK_PERMISSIONS.REPORTS_CDR_MANAGE
|
|
417
|
+
],
|
|
418
|
+
showFallback: false,
|
|
419
|
+
children: /* @__PURE__ */ jsx(
|
|
420
|
+
AppButton,
|
|
421
|
+
{
|
|
422
|
+
startIcon: /* @__PURE__ */ jsx(DownloadIcon, { sx: { fontSize: "0.95rem !important" } }),
|
|
423
|
+
disabled: !records.length,
|
|
424
|
+
onClick: handleExportExcel,
|
|
425
|
+
sx: { height: 36 },
|
|
426
|
+
children: "Export Excel"
|
|
427
|
+
}
|
|
428
|
+
)
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
] })
|
|
432
|
+
}
|
|
433
|
+
),
|
|
434
|
+
/* @__PURE__ */ jsxs(Box, { sx: { flex: 1, overflow: "auto", py: 0.8, px: 0 }, children: [
|
|
435
|
+
/* @__PURE__ */ jsxs(Box, { sx: { mb: 0.8 }, children: [
|
|
436
|
+
/* @__PURE__ */ jsx(
|
|
437
|
+
ReportFilterBar,
|
|
438
|
+
{
|
|
439
|
+
startDate,
|
|
440
|
+
endDate,
|
|
441
|
+
onStartChange: setStartDate,
|
|
442
|
+
onEndChange: setEndDate,
|
|
443
|
+
quickRange: activeQuickDate || "",
|
|
444
|
+
onQuickRangeChange: handleQuickRangeChange,
|
|
445
|
+
showAgentSelect: true,
|
|
446
|
+
selectedAgents,
|
|
447
|
+
onAgentsChange: setSelectedAgents,
|
|
448
|
+
setIsAllUsersSelected,
|
|
449
|
+
showQueueSelect: true,
|
|
450
|
+
queues,
|
|
451
|
+
selectedQueues,
|
|
452
|
+
onQueuesChange: setSelectedQueues,
|
|
453
|
+
showCallTypeSelect: true,
|
|
454
|
+
selectedCallType: callType,
|
|
455
|
+
onCallTypeChange: setCallType,
|
|
456
|
+
showStatusSelect: true,
|
|
457
|
+
selectedStatus: callStatus,
|
|
458
|
+
onStatusChange: setCallStatus,
|
|
459
|
+
extra: /* @__PURE__ */ jsx(
|
|
460
|
+
AppButton,
|
|
461
|
+
{
|
|
462
|
+
startIcon: /* @__PURE__ */ jsx(RefreshIcon, { sx: { fontSize: "0.9rem !important" } }),
|
|
463
|
+
disabled: loading,
|
|
464
|
+
onClick: handleRefresh,
|
|
465
|
+
sx: { height: 32 },
|
|
466
|
+
children: "Refresh"
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
}
|
|
470
|
+
),
|
|
471
|
+
error && /* @__PURE__ */ jsx(
|
|
472
|
+
Alert,
|
|
473
|
+
{
|
|
474
|
+
severity: "error",
|
|
475
|
+
sx: { mt: 1, fontFamily: FONT, fontSize: "0.78rem" },
|
|
476
|
+
children: error
|
|
477
|
+
}
|
|
478
|
+
)
|
|
479
|
+
] }),
|
|
480
|
+
loading && /* @__PURE__ */ jsx(Box, { sx: { textAlign: "center", py: 2.5 }, children: /* @__PURE__ */ jsx(CircularProgress, { sx: { color: COLORS.blue }, size: 28 }) }),
|
|
481
|
+
/* @__PURE__ */ jsxs(
|
|
482
|
+
Paper,
|
|
483
|
+
{
|
|
484
|
+
elevation: 0,
|
|
485
|
+
sx: {
|
|
486
|
+
borderRadius: "8px",
|
|
487
|
+
border: "1px solid #e0e7ef",
|
|
488
|
+
overflow: "hidden",
|
|
489
|
+
mb: 2
|
|
490
|
+
},
|
|
491
|
+
children: [
|
|
492
|
+
/* @__PURE__ */ jsx(TableContainer, { children: /* @__PURE__ */ jsxs(
|
|
493
|
+
Table,
|
|
494
|
+
{
|
|
495
|
+
size: "small",
|
|
496
|
+
sx: {
|
|
497
|
+
minWidth: 1400,
|
|
498
|
+
fontFamily: FONT,
|
|
499
|
+
"& .MuiTableCell-root": {
|
|
500
|
+
fontFamily: FONT,
|
|
501
|
+
fontSize: "0.75rem",
|
|
502
|
+
borderBottom: "1px solid #eef1f6",
|
|
503
|
+
py: 0.6,
|
|
504
|
+
px: 1
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
children: [
|
|
508
|
+
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
509
|
+
/* @__PURE__ */ jsx(
|
|
510
|
+
TableCell,
|
|
511
|
+
{
|
|
512
|
+
sx: __spreadProps(__spreadValues({}, headCellSx), { minWidth: 110, textAlign: "center" }),
|
|
513
|
+
children: "Audit Report"
|
|
514
|
+
}
|
|
515
|
+
),
|
|
516
|
+
/* @__PURE__ */ jsx(
|
|
517
|
+
TableCell,
|
|
518
|
+
{
|
|
519
|
+
sx: __spreadProps(__spreadValues({}, headCellSx), { minWidth: 100 }),
|
|
520
|
+
children: "Recording"
|
|
521
|
+
}
|
|
522
|
+
),
|
|
523
|
+
[
|
|
524
|
+
{ id: "phoneNumber", label: "Phone Number" },
|
|
525
|
+
{ id: "callStartTime", label: "Call Start" },
|
|
526
|
+
{ id: "callType", label: "Call Type" },
|
|
527
|
+
{ id: "callStatus", label: "Status" },
|
|
528
|
+
{ id: "agentName", label: "User Name" },
|
|
529
|
+
{ id: "queueName", label: "Queues" },
|
|
530
|
+
{ id: "extension", label: "Extension" },
|
|
531
|
+
{
|
|
532
|
+
id: "talkDurationFmt",
|
|
533
|
+
label: "Talk Duration"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
id: "holdDurationFmt",
|
|
537
|
+
label: "Hold Duration"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
id: "ringingDurationFmt",
|
|
541
|
+
label: "Ringing Duration"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
id: "queueDurationFmt",
|
|
545
|
+
label: "Queue Duration"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
id: "wrapupDurationFmt",
|
|
549
|
+
label: "Wrapup Duration"
|
|
550
|
+
},
|
|
551
|
+
{ id: "disposition", label: "Disposition" },
|
|
552
|
+
{ id: "remarks", label: "Remarks" },
|
|
553
|
+
{
|
|
554
|
+
id: "wasTransferred",
|
|
555
|
+
label: "Transferred"
|
|
556
|
+
}
|
|
557
|
+
].map((col) => /* @__PURE__ */ jsx(TableCell, { sx: headCellSx, children: /* @__PURE__ */ jsx(
|
|
558
|
+
TableSortLabel,
|
|
559
|
+
{
|
|
560
|
+
active: sortKey === col.id,
|
|
561
|
+
direction: sortKey === col.id ? sortDir : "asc",
|
|
562
|
+
onClick: () => handleSort(col.id),
|
|
563
|
+
sx: {
|
|
564
|
+
"&.MuiTableSortLabel-root": { color: "#333" },
|
|
565
|
+
"&.MuiTableSortLabel-root:hover": { color: "#555" },
|
|
566
|
+
"&.Mui-active": { color: "#333" },
|
|
567
|
+
"& .MuiTableSortLabel-icon": {
|
|
568
|
+
color: "#333 !important"
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
children: col.label
|
|
572
|
+
}
|
|
573
|
+
) }, col.id))
|
|
574
|
+
] }) }),
|
|
575
|
+
/* @__PURE__ */ jsx(TableBody, { children: sortedRecords.map((row, idx) => /* @__PURE__ */ jsxs(
|
|
576
|
+
TableRow,
|
|
577
|
+
{
|
|
578
|
+
hover: true,
|
|
579
|
+
sx: {
|
|
580
|
+
backgroundColor: "#fff",
|
|
581
|
+
"&:hover": { backgroundColor: "#f0f7f8" }
|
|
582
|
+
},
|
|
583
|
+
children: [
|
|
584
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { textAlign: "center", verticalAlign: "middle" }, children: /* @__PURE__ */ jsx(Tooltip, { title: "View Audit Report", children: /* @__PURE__ */ jsx(
|
|
585
|
+
IconButton,
|
|
586
|
+
{
|
|
587
|
+
size: "small",
|
|
588
|
+
onClick: () => {
|
|
589
|
+
setSelectedAuditRow(row);
|
|
590
|
+
setAuditDialogOpen(true);
|
|
591
|
+
},
|
|
592
|
+
sx: { color: COLORS.blue, p: 0.4 },
|
|
593
|
+
children: /* @__PURE__ */ jsx(AssignmentIcon, { sx: { fontSize: 16 } })
|
|
594
|
+
}
|
|
595
|
+
) }) }),
|
|
596
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { verticalAlign: "middle" }, children: row.callUuid ? /* @__PURE__ */ jsx(
|
|
597
|
+
RecordingCell,
|
|
598
|
+
{
|
|
599
|
+
callUuid: row.callUuid,
|
|
600
|
+
recordingPath: row.recordingPath
|
|
601
|
+
}
|
|
602
|
+
) : null }),
|
|
603
|
+
/* @__PURE__ */ jsx(
|
|
604
|
+
TableCell,
|
|
605
|
+
{
|
|
606
|
+
sx: {
|
|
607
|
+
fontWeight: 600,
|
|
608
|
+
color: COLORS.navy,
|
|
609
|
+
fontSize: "0.75rem"
|
|
610
|
+
},
|
|
611
|
+
children: row.phoneNumber || ""
|
|
612
|
+
}
|
|
613
|
+
),
|
|
614
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { fontSize: "0.73rem", color: "#4a5568" }, children: row.callStartTime ? dayjs(row.callStartTime).format(
|
|
615
|
+
"DD MMM YYYY hh:mm A"
|
|
616
|
+
) : "" }),
|
|
617
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(CallTypePill, { value: row.callType || "" }) }),
|
|
618
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(StatusPill, { value: row.callStatus || "" }) }),
|
|
619
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { fontSize: "0.73rem", color: "#4a5568" }, children: row.agentName || "" }),
|
|
620
|
+
/* @__PURE__ */ jsx(TableCell, { children: row.queueName ? /* @__PURE__ */ jsx(
|
|
621
|
+
Chip,
|
|
622
|
+
{
|
|
623
|
+
label: row.queueName,
|
|
624
|
+
size: "small",
|
|
625
|
+
sx: {
|
|
626
|
+
fontFamily: FONT,
|
|
627
|
+
backgroundColor: "#f0ebfa",
|
|
628
|
+
color: COLORS.purple,
|
|
629
|
+
fontWeight: 500,
|
|
630
|
+
fontSize: "0.67rem",
|
|
631
|
+
height: 22
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
) : null }),
|
|
635
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { fontSize: "0.73rem", color: "#4a5568" }, children: row.extension || "" }),
|
|
636
|
+
/* @__PURE__ */ jsx(
|
|
637
|
+
TableCell,
|
|
638
|
+
{
|
|
639
|
+
sx: {
|
|
640
|
+
fontWeight: 600,
|
|
641
|
+
color: COLORS.blue,
|
|
642
|
+
fontSize: "0.75rem",
|
|
643
|
+
fontVariantNumeric: "tabular-nums"
|
|
644
|
+
},
|
|
645
|
+
children: row.talkDurationFmt || ""
|
|
646
|
+
}
|
|
647
|
+
),
|
|
648
|
+
/* @__PURE__ */ jsx(
|
|
649
|
+
TableCell,
|
|
650
|
+
{
|
|
651
|
+
sx: {
|
|
652
|
+
fontWeight: 500,
|
|
653
|
+
color: COLORS.amber,
|
|
654
|
+
fontSize: "0.75rem",
|
|
655
|
+
fontVariantNumeric: "tabular-nums"
|
|
656
|
+
},
|
|
657
|
+
children: row.holdDurationFmt || ""
|
|
658
|
+
}
|
|
659
|
+
),
|
|
660
|
+
/* @__PURE__ */ jsx(
|
|
661
|
+
TableCell,
|
|
662
|
+
{
|
|
663
|
+
sx: {
|
|
664
|
+
fontWeight: 500,
|
|
665
|
+
fontSize: "0.75rem",
|
|
666
|
+
fontVariantNumeric: "tabular-nums"
|
|
667
|
+
},
|
|
668
|
+
children: row.ringingDurationFmt || ""
|
|
669
|
+
}
|
|
670
|
+
),
|
|
671
|
+
/* @__PURE__ */ jsx(
|
|
672
|
+
TableCell,
|
|
673
|
+
{
|
|
674
|
+
sx: {
|
|
675
|
+
fontWeight: 500,
|
|
676
|
+
fontSize: "0.75rem",
|
|
677
|
+
fontVariantNumeric: "tabular-nums"
|
|
678
|
+
},
|
|
679
|
+
children: row.queueDurationFmt || ""
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
/* @__PURE__ */ jsx(
|
|
683
|
+
TableCell,
|
|
684
|
+
{
|
|
685
|
+
sx: {
|
|
686
|
+
fontWeight: 500,
|
|
687
|
+
fontSize: "0.75rem",
|
|
688
|
+
fontVariantNumeric: "tabular-nums"
|
|
689
|
+
},
|
|
690
|
+
children: row.wrapupDurationFmt || ""
|
|
691
|
+
}
|
|
692
|
+
),
|
|
693
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { fontSize: "0.73rem", color: "#4a5568" }, children: row.disposition || "" }),
|
|
694
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { fontSize: "0.73rem", color: "#4a5568" }, children: row.remarks ? /* @__PURE__ */ jsx(Tooltip, { title: row.remarks, children: /* @__PURE__ */ jsx(
|
|
695
|
+
"span",
|
|
696
|
+
{
|
|
697
|
+
style: {
|
|
698
|
+
display: "inline-block",
|
|
699
|
+
maxWidth: 180,
|
|
700
|
+
overflow: "hidden",
|
|
701
|
+
textOverflow: "ellipsis",
|
|
702
|
+
whiteSpace: "nowrap",
|
|
703
|
+
verticalAlign: "bottom"
|
|
704
|
+
},
|
|
705
|
+
children: row.remarks
|
|
706
|
+
}
|
|
707
|
+
) }) : "" }),
|
|
708
|
+
/* @__PURE__ */ jsx(TableCell, { children: row.wasTransferred ? /* @__PURE__ */ jsx(
|
|
709
|
+
Chip,
|
|
710
|
+
{
|
|
711
|
+
label: "Yes",
|
|
712
|
+
size: "small",
|
|
713
|
+
sx: {
|
|
714
|
+
fontFamily: FONT,
|
|
715
|
+
backgroundColor: "#e6f7ef",
|
|
716
|
+
color: COLORS.green,
|
|
717
|
+
fontWeight: 600,
|
|
718
|
+
fontSize: "0.65rem",
|
|
719
|
+
height: 20,
|
|
720
|
+
borderRadius: "6px"
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
) : /* @__PURE__ */ jsx(
|
|
724
|
+
Chip,
|
|
725
|
+
{
|
|
726
|
+
label: "No",
|
|
727
|
+
size: "small",
|
|
728
|
+
sx: {
|
|
729
|
+
fontFamily: FONT,
|
|
730
|
+
backgroundColor: "transparent",
|
|
731
|
+
color: "#6b7b8d",
|
|
732
|
+
fontWeight: 600,
|
|
733
|
+
fontSize: "0.65rem",
|
|
734
|
+
height: 20,
|
|
735
|
+
borderRadius: "6px"
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
) })
|
|
739
|
+
]
|
|
740
|
+
},
|
|
741
|
+
row.callUuid || idx
|
|
742
|
+
)) })
|
|
743
|
+
]
|
|
744
|
+
}
|
|
745
|
+
) }),
|
|
746
|
+
/* @__PURE__ */ jsx(
|
|
747
|
+
TablePagination,
|
|
748
|
+
{
|
|
749
|
+
component: "div",
|
|
750
|
+
count: totalRecords,
|
|
751
|
+
page,
|
|
752
|
+
onPageChange: handlePageChange,
|
|
753
|
+
rowsPerPage,
|
|
754
|
+
rowsPerPageOptions: [10, 15, 25, 50, 100],
|
|
755
|
+
onRowsPerPageChange: (e) => {
|
|
756
|
+
setRowsPerPage(parseInt(e.target.value, 10));
|
|
757
|
+
setPage(0);
|
|
758
|
+
},
|
|
759
|
+
sx: {
|
|
760
|
+
borderTop: "1px solid #eef1f6",
|
|
761
|
+
fontFamily: FONT,
|
|
762
|
+
"& .MuiTablePagination-displayedRows": {
|
|
763
|
+
fontFamily: FONT,
|
|
764
|
+
fontSize: "0.73rem"
|
|
765
|
+
},
|
|
766
|
+
"& .MuiTablePagination-selectLabel": {
|
|
767
|
+
fontFamily: FONT,
|
|
768
|
+
fontSize: "0.73rem"
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
)
|
|
773
|
+
]
|
|
774
|
+
}
|
|
775
|
+
)
|
|
776
|
+
] })
|
|
777
|
+
]
|
|
778
|
+
}
|
|
779
|
+
),
|
|
780
|
+
/* @__PURE__ */ jsx(
|
|
781
|
+
AuditReportDialog,
|
|
782
|
+
{
|
|
783
|
+
open: auditDialogOpen,
|
|
784
|
+
onClose: () => {
|
|
785
|
+
setAuditDialogOpen(false);
|
|
786
|
+
setSelectedAuditRow(null);
|
|
787
|
+
},
|
|
788
|
+
rowData: selectedAuditRow != null ? selectedAuditRow : void 0
|
|
789
|
+
}
|
|
790
|
+
)
|
|
791
|
+
] });
|
|
792
|
+
}
|
|
793
|
+
var CdrReport = () => /* @__PURE__ */ jsx(SDKProvider, { children: /* @__PURE__ */ jsx(CdrReportContent, {}) });
|
|
794
|
+
var cdrReport_default = CdrReport;
|
|
795
|
+
export {
|
|
796
|
+
cdrReport_default as default
|
|
797
|
+
};
|
|
798
|
+
//# sourceMappingURL=cdrReport-577UYGZA.mjs.map
|