@visns-studio/visns-components 4.7.1 → 4.7.3
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/package.json +13 -9
- package/src/components/cms/DataGrid.jsx +1461 -0
- package/src/components/cms/DropZone.jsx +349 -0
- package/src/components/cms/Field.jsx +802 -0
- package/src/components/cms/Form.jsx +476 -0
- package/src/components/cms/generic/CmsDetail.jsx +36 -0
- package/src/components/cms/generic/CmsIndex.jsx +73 -0
- package/src/components/cms/generic/CmsSort.jsx +125 -0
- package/src/components/cms/sorting/Item.jsx +115 -0
- package/src/components/cms/sorting/List.jsx +30 -0
- package/src/components/crm/AsyncSelect.jsx +125 -0
- package/src/components/crm/Autocomplete.jsx +174 -0
- package/src/components/crm/Breadcrumb.jsx +52 -0
- package/src/components/crm/Call.jsx +220 -0
- package/src/components/crm/DataGrid.jsx +2701 -0
- package/src/components/crm/Download.jsx +101 -0
- package/src/components/crm/Fetch.jsx +119 -0
- package/src/components/crm/Field.jsx +1557 -0
- package/src/components/crm/Form.jsx +1409 -0
- package/src/components/crm/Loader.jsx +29 -0
- package/src/components/crm/MultiSelect.jsx +78 -0
- package/src/components/crm/Navigation.jsx +619 -0
- package/src/components/crm/Notification.jsx +197 -0
- package/src/components/crm/QrCode.jsx +83 -0
- package/src/components/crm/Select.jsx +58 -0
- package/src/components/crm/SelectList.jsx +21 -0
- package/src/components/crm/TableFilter.jsx +198 -0
- package/src/components/crm/auth/Login.jsx +223 -0
- package/src/components/crm/auth/Profile.jsx +280 -0
- package/src/components/crm/auth/Reset.jsx +111 -0
- package/src/components/crm/auth/Verify.jsx +174 -0
- package/src/components/crm/auth/styles/Login.module.scss +243 -0
- package/src/components/crm/auth/styles/Profile.module.scss +222 -0
- package/src/components/crm/auth/styles/Reset.module.scss +216 -0
- package/src/components/crm/auth/styles/Verify.module.scss +216 -0
- package/src/components/crm/generic/AuditLog.jsx +108 -0
- package/src/components/crm/generic/AuditLogs.jsx +115 -0
- package/src/components/crm/generic/GenericAuth.jsx +166 -0
- package/src/components/crm/generic/GenericDashboard.jsx +42 -0
- package/src/components/crm/generic/GenericDetail.jsx +1499 -0
- package/src/components/crm/generic/GenericDynamic.jsx +915 -0
- package/src/components/crm/generic/GenericFormBuilder.jsx +1765 -0
- package/src/components/crm/generic/GenericIndex.jsx +376 -0
- package/src/components/crm/generic/GenericMain.jsx +129 -0
- package/src/components/crm/generic/GenericSort.jsx +188 -0
- package/src/components/crm/generic/NotificationList.jsx +64 -0
- package/src/components/crm/generic/styles/AuditLog.module.scss +147 -0
- package/src/components/crm/generic/styles/AuditLogs.module.scss +92 -0
- package/src/components/crm/generic/styles/GenericDetail.module.scss +634 -0
- package/src/components/crm/generic/styles/GenericDynamic.module.scss +932 -0
- package/src/components/crm/generic/styles/GenericFormBuilder.module.scss +944 -0
- package/src/components/crm/generic/styles/GenericIndex.module.scss +247 -0
- package/src/components/crm/generic/styles/GenericMain.module.scss +91 -0
- package/src/components/crm/generic/styles/GenericSort.module.scss +123 -0
- package/src/components/crm/generic/styles/NotificationList.module.scss +67 -0
- package/src/components/crm/sorting/Item.jsx +117 -0
- package/src/components/crm/sorting/List.jsx +32 -0
- package/src/components/crm/sorting/styles/Item.module.scss +68 -0
- package/src/components/crm/sorting/styles/List.module.scss +68 -0
- package/src/components/crm/styles/AsyncSelect.module.scss +8 -0
- package/src/components/crm/styles/Autocomplete.module.scss +44 -0
- package/src/components/crm/styles/DataGrid.module.scss +210 -0
- package/src/components/crm/styles/Field.module.scss +311 -0
- package/src/components/crm/styles/Form.module.scss +499 -0
- package/src/components/crm/styles/Loader.module.scss +94 -0
- package/src/components/crm/styles/MultiSelect.module.scss +8 -0
- package/src/components/crm/styles/Navigation.module.scss +978 -0
- package/src/components/crm/styles/Notification.module.scss +147 -0
- package/src/components/crm/styles/QrCode.module.scss +87 -0
- package/src/components/crm/styles/TableFilter.module.scss +52 -0
- package/src/components/styles/global.css +73 -0
- package/src/index.js +86 -0
- package/dist/104e5636d8ddb791614c.woff2 +0 -0
- package/dist/11fe6a83d647de5daf95.woff +0 -0
- package/dist/141e2a8c7836495afe2a.woff +0 -0
- package/dist/2ba5877f7079830b5383.woff +0 -0
- package/dist/2d6836f45b2037be41f3.woff +0 -0
- package/dist/399.0a0f3e0d21be1057d599.css +0 -8
- package/dist/399.b8f57fa3f8c0c10119e4.js +0 -1
- package/dist/47d566c3b1293dfd9d77.woff +0 -0
- package/dist/6282a13cbba671a71913.woff2 +0 -0
- package/dist/78266f551031aa9db127.woff +0 -0
- package/dist/7b7da89f1e3fdcbfe36c.woff2 +0 -0
- package/dist/7e78e8338af7efeda712.woff2 +0 -0
- package/dist/7fa387951673abf164b1.woff2 +0 -0
- package/dist/819d59862c2d0640aad8.woff +0 -0
- package/dist/b615e1a6c838ea059a56.woff +0 -0
- package/dist/b9b1aa739c660c4ce67c.woff2 +0 -0
- package/dist/c5f3640b11df9414facb.woff +0 -0
- package/dist/da26d162ff5af71d6590.woff2 +0 -0
- package/dist/dd5b2912dbf896310865.woff2 +0 -0
- package/dist/f282b331272463c1aa6c.woff2 +0 -0
- package/dist/main.83b033670d64419bb497.css +0 -1
- package/dist/main.b1723d17cd2d3513ab62.js +0 -1
- package/dist/report.html +0 -39
- package/dist/runtime.33c276593b23f8035b8d.js +0 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
|
+
import Popup from "reactjs-popup";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
|
|
5
|
+
import CustomFetch from "./Fetch";
|
|
6
|
+
|
|
7
|
+
function CallPop(props) {
|
|
8
|
+
const { incomingCallData } = props;
|
|
9
|
+
const [modalShow, setModalShow] = useState(false);
|
|
10
|
+
const [client, setClient] = useState({});
|
|
11
|
+
const [tasks, setTasks] = useState([]);
|
|
12
|
+
const [callShow, setCallShow] = useState(false);
|
|
13
|
+
const [timerId, setTimerId] = useState(0);
|
|
14
|
+
|
|
15
|
+
const formatPhone = (value) => {
|
|
16
|
+
if (value) {
|
|
17
|
+
let _value = value.replace("61", 0);
|
|
18
|
+
let match;
|
|
19
|
+
let type = _value.substr(0, 2);
|
|
20
|
+
|
|
21
|
+
if (_value && _value !== "") {
|
|
22
|
+
switch (type) {
|
|
23
|
+
case "04":
|
|
24
|
+
match = _value.match(/^(\d{4})(\d{3})(\d{3})$/);
|
|
25
|
+
if (match) {
|
|
26
|
+
_value = match[1] + " " + match[2] + " " + match[3];
|
|
27
|
+
}
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
match = _value.match(/^(\d{2})(\d{4})(\d{4})$/);
|
|
31
|
+
if (match) {
|
|
32
|
+
_value = match[1] + " " + match[2] + " " + match[3];
|
|
33
|
+
}
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return _value;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const viewModal = () => {
|
|
43
|
+
setModalShow(true);
|
|
44
|
+
|
|
45
|
+
if (timerId > 0) {
|
|
46
|
+
clearTimeout(timerId);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (
|
|
52
|
+
incomingCallData &&
|
|
53
|
+
incomingCallData.number &&
|
|
54
|
+
incomingCallData.number != ""
|
|
55
|
+
) {
|
|
56
|
+
CustomFetch(
|
|
57
|
+
"/incoming/check",
|
|
58
|
+
"POST",
|
|
59
|
+
{
|
|
60
|
+
user_id: incomingCallData.user_id,
|
|
61
|
+
},
|
|
62
|
+
function (result) {
|
|
63
|
+
if (result.show === true) {
|
|
64
|
+
setCallShow(true);
|
|
65
|
+
|
|
66
|
+
let _timerId = setTimeout(() => {
|
|
67
|
+
setCallShow(false);
|
|
68
|
+
}, 20000);
|
|
69
|
+
|
|
70
|
+
setTimerId(_timerId);
|
|
71
|
+
|
|
72
|
+
CustomFetch(
|
|
73
|
+
"/company/call",
|
|
74
|
+
"POST",
|
|
75
|
+
{
|
|
76
|
+
search: incomingCallData.number,
|
|
77
|
+
},
|
|
78
|
+
function (result) {
|
|
79
|
+
setClient(result);
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
} else {
|
|
83
|
+
setCallShow(false);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}, [incomingCallData]);
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<>
|
|
92
|
+
{callShow === true ? (
|
|
93
|
+
<>
|
|
94
|
+
<div className="callpop callpop--alive">
|
|
95
|
+
<div className="callpop__left">
|
|
96
|
+
<span>
|
|
97
|
+
<strong>Active Call:</strong>{" "}
|
|
98
|
+
{formatPhone(incomingCallData.number)}{" "}
|
|
99
|
+
<strong>Client:</strong>{" "}
|
|
100
|
+
{setData
|
|
101
|
+
? setData.firstname === ""
|
|
102
|
+
? "No contacts found with the incoming number."
|
|
103
|
+
: setData.firstname +
|
|
104
|
+
" " +
|
|
105
|
+
setData.surname +
|
|
106
|
+
" (" +
|
|
107
|
+
setData.customer.name +
|
|
108
|
+
")"
|
|
109
|
+
: "No contacts found with the incoming number."}
|
|
110
|
+
</span>
|
|
111
|
+
</div>
|
|
112
|
+
<div className="callpop__right">
|
|
113
|
+
<button className="btn cpview" onClick={viewModal}>
|
|
114
|
+
View{" "}
|
|
115
|
+
<i className="cil-chevron-circle-up-alt "></i>
|
|
116
|
+
</button>
|
|
117
|
+
<button
|
|
118
|
+
className="btn cpdismiss"
|
|
119
|
+
onClick={() => {
|
|
120
|
+
setCallShow(false);
|
|
121
|
+
}}
|
|
122
|
+
>
|
|
123
|
+
Dismiss
|
|
124
|
+
</button>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
<Popup
|
|
128
|
+
open={modalShow}
|
|
129
|
+
onClose={() => {
|
|
130
|
+
setCallShow(false);
|
|
131
|
+
setModalShow(false);
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
<div className="modalwrap">
|
|
135
|
+
<div className="grid">
|
|
136
|
+
<div className="grid__row">
|
|
137
|
+
<div className="grid__full crmtitle callborder">
|
|
138
|
+
<i className="cil-phone-in-talk"></i>
|
|
139
|
+
<h1>
|
|
140
|
+
Active Call:{" "}
|
|
141
|
+
<span>
|
|
142
|
+
{formatPhone(
|
|
143
|
+
incomingCallData.number
|
|
144
|
+
)}
|
|
145
|
+
</span>{" "}
|
|
146
|
+
Client:{" "}
|
|
147
|
+
<span>
|
|
148
|
+
{setData
|
|
149
|
+
? setData.firstname === ""
|
|
150
|
+
? "No contacts found with the incoming number."
|
|
151
|
+
: setData.firstname +
|
|
152
|
+
" " +
|
|
153
|
+
setData.surname +
|
|
154
|
+
" (" +
|
|
155
|
+
setData.customer
|
|
156
|
+
.name +
|
|
157
|
+
")"
|
|
158
|
+
: "No contacts found with the incoming number."}
|
|
159
|
+
</span>{" "}
|
|
160
|
+
</h1>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
<div className="grid">
|
|
165
|
+
<div className="grid__row">
|
|
166
|
+
<div className="grid__full">
|
|
167
|
+
<table className="content-table">
|
|
168
|
+
<thead>
|
|
169
|
+
<tr className="grid-headers">
|
|
170
|
+
<th>Ticket #</th>
|
|
171
|
+
<th>Subject</th>
|
|
172
|
+
<th>Status</th>
|
|
173
|
+
<th>Created</th>
|
|
174
|
+
</tr>
|
|
175
|
+
</thead>
|
|
176
|
+
<tbody>
|
|
177
|
+
{data &&
|
|
178
|
+
data.tickets &&
|
|
179
|
+
data.tickets.length > 0 ? (
|
|
180
|
+
data.tickets.map((a) => (
|
|
181
|
+
<tr
|
|
182
|
+
key={`task-id-${a.id}`}
|
|
183
|
+
>
|
|
184
|
+
<td>{a.id}</td>
|
|
185
|
+
<td>{a.subject}</td>
|
|
186
|
+
<td>
|
|
187
|
+
{a.status.label}
|
|
188
|
+
</td>
|
|
189
|
+
<td>
|
|
190
|
+
{moment(
|
|
191
|
+
a.created_at
|
|
192
|
+
).format(
|
|
193
|
+
"DD-MM-YYYY"
|
|
194
|
+
)}
|
|
195
|
+
</td>
|
|
196
|
+
</tr>
|
|
197
|
+
))
|
|
198
|
+
) : (
|
|
199
|
+
<tr colSpan="10">
|
|
200
|
+
<td>
|
|
201
|
+
No tickets found
|
|
202
|
+
with the incoming
|
|
203
|
+
number.
|
|
204
|
+
</td>
|
|
205
|
+
</tr>
|
|
206
|
+
)}
|
|
207
|
+
</tbody>
|
|
208
|
+
</table>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
</Popup>
|
|
214
|
+
</>
|
|
215
|
+
) : null}
|
|
216
|
+
</>
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export default CallPop;
|