@visns-studio/visns-components 4.7.0 → 4.7.2
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/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 +8 -0
- package/dist/399.b8f57fa3f8c0c10119e4.js +1 -0
- 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/index.css +2902 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +150 -0
- package/dist/main.83b033670d64419bb497.css +1 -0
- package/dist/main.b1723d17cd2d3513ab62.js +1 -0
- package/dist/report.html +39 -0
- package/dist/runtime.33c276593b23f8035b8d.js +1 -0
- package/package.json +26 -6
- package/.idea/codeStyles/Project.xml +0 -50
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/deployment.xml +0 -4
- package/.idea/modules.xml +0 -8
- package/.idea/php.xml +0 -19
- package/.idea/vcs.xml +0 -6
- package/.idea/visns-components.iml +0 -8
- package/.prettierrc.json +0 -7
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
- package/.yarn/releases/yarn-3.6.1.cjs +0 -874
- package/.yarnrc.yml +0 -7
- package/components/cms/DataGrid.jsx +0 -1461
- package/components/cms/DropZone.jsx +0 -349
- package/components/cms/Field.jsx +0 -802
- package/components/cms/Form.jsx +0 -476
- package/components/cms/generic/CmsDetail.jsx +0 -36
- package/components/cms/generic/CmsIndex.jsx +0 -73
- package/components/cms/generic/CmsSort.jsx +0 -125
- package/components/cms/sorting/Item.jsx +0 -115
- package/components/cms/sorting/List.jsx +0 -30
- package/components/crm/AsyncSelect.jsx +0 -125
- package/components/crm/Autocomplete.jsx +0 -174
- package/components/crm/Breadcrumb.jsx +0 -52
- package/components/crm/Call.jsx +0 -220
- package/components/crm/DataGrid.jsx +0 -2701
- package/components/crm/Download.jsx +0 -101
- package/components/crm/Fetch.jsx +0 -119
- package/components/crm/Field.jsx +0 -1557
- package/components/crm/Form.jsx +0 -1409
- package/components/crm/Loader.jsx +0 -29
- package/components/crm/MultiSelect.jsx +0 -78
- package/components/crm/Navigation.jsx +0 -619
- package/components/crm/Notification.jsx +0 -197
- package/components/crm/QrCode.jsx +0 -83
- package/components/crm/Select.jsx +0 -58
- package/components/crm/SelectList.jsx +0 -21
- package/components/crm/TableFilter.jsx +0 -198
- package/components/crm/auth/Login.jsx +0 -223
- package/components/crm/auth/Profile.jsx +0 -280
- package/components/crm/auth/Reset.jsx +0 -111
- package/components/crm/auth/Verify.jsx +0 -174
- package/components/crm/auth/styles/Login.module.css +0 -243
- package/components/crm/auth/styles/Profile.module.css +0 -222
- package/components/crm/auth/styles/Reset.module.css +0 -216
- package/components/crm/auth/styles/Verify.module.css +0 -216
- package/components/crm/generic/AuditLog.jsx +0 -108
- package/components/crm/generic/AuditLogs.jsx +0 -115
- package/components/crm/generic/GenericAuth.jsx +0 -166
- package/components/crm/generic/GenericDashboard.jsx +0 -42
- package/components/crm/generic/GenericDetail.jsx +0 -1499
- package/components/crm/generic/GenericDynamic.jsx +0 -915
- package/components/crm/generic/GenericFormBuilder.jsx +0 -1765
- package/components/crm/generic/GenericIndex.jsx +0 -376
- package/components/crm/generic/GenericMain.jsx +0 -129
- package/components/crm/generic/GenericSort.jsx +0 -188
- package/components/crm/generic/NotificationList.jsx +0 -64
- package/components/crm/generic/styles/AuditLog.module.css +0 -147
- package/components/crm/generic/styles/AuditLogs.module.css +0 -92
- package/components/crm/generic/styles/GenericDetail.module.css +0 -634
- package/components/crm/generic/styles/GenericDynamic.module.css +0 -932
- package/components/crm/generic/styles/GenericFormBuilder.module.css +0 -944
- package/components/crm/generic/styles/GenericIndex.module.css +0 -247
- package/components/crm/generic/styles/GenericMain.module.css +0 -91
- package/components/crm/generic/styles/GenericSort.module.css +0 -123
- package/components/crm/generic/styles/NotificationList.module.css +0 -67
- package/components/crm/sorting/Item.jsx +0 -117
- package/components/crm/sorting/List.jsx +0 -32
- package/components/crm/sorting/styles/Item.module.css +0 -68
- package/components/crm/sorting/styles/List.module.css +0 -68
- package/components/crm/styles/AsyncSelect.module.css +0 -8
- package/components/crm/styles/Autocomplete.module.css +0 -44
- package/components/crm/styles/DataGrid.module.css +0 -210
- package/components/crm/styles/Field.module.css +0 -311
- package/components/crm/styles/Form.module.css +0 -499
- package/components/crm/styles/Loader.module.css +0 -94
- package/components/crm/styles/MultiSelect.module.css +0 -8
- package/components/crm/styles/Navigation.module.css +0 -978
- package/components/crm/styles/Notification.module.css +0 -147
- package/components/crm/styles/QrCode.module.css +0 -87
- package/components/crm/styles/TableFilter.module.css +0 -52
- package/components/styles/global.css +0 -73
- package/index.js +0 -86
package/components/crm/Call.jsx
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
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;
|