contentoh-components-library 21.2.58 → 21.2.60
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/.env.development +26 -23
- package/dist/assets/images/chatPopup/Spinner.gif +0 -0
- package/dist/assets/images/chatPopup/close.svg +3 -0
- package/dist/assets/images/chatPopup/defaultImage.png +0 -0
- package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
- package/dist/assets/images/chatPopup/doc.svg +1 -0
- package/dist/assets/images/chatPopup/document.svg +1 -0
- package/dist/assets/images/chatPopup/iconChat.svg +19 -0
- package/dist/assets/images/chatPopup/iconPlus.svg +3 -0
- package/dist/assets/images/chatPopup/pdf.svg +75 -0
- package/dist/assets/images/chatPopup/remove.svg +4 -0
- package/dist/assets/images/chatPopup/send.svg +3 -0
- package/dist/assets/images/chatPopup/svgIcon.svg +109 -0
- package/dist/assets/images/chatPopup/upload_file.svg +3 -0
- package/dist/assets/images/chatPopup/xls.svg +53 -0
- package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +28 -0
- package/dist/components/atoms/ChatPopUp/index.js +841 -0
- package/dist/components/atoms/ChatPopUp/styles.js +27 -0
- package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +182 -0
- package/dist/components/atoms/Graphic/index.js +2 -1
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +36 -0
- package/dist/components/atoms/Tooltip/index.js +55 -0
- package/dist/components/atoms/Tooltip/styles.js +18 -0
- package/dist/components/molecules/CustomSelect/index.js +4 -1
- package/dist/components/molecules/CustomSelect/styles.js +4 -1
- package/dist/components/molecules/HeaderTop/index.js +10 -5
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/organisms/DashboardMetric/dashboardMetricUtils.js +6 -0
- package/dist/components/organisms/DashboardMetric/index.js +3 -4
- package/dist/components/pages/Dashboard/Dashboard.stories.js +25 -25
- package/dist/components/pages/Dashboard/dashboardUtils.js +1 -1
- package/dist/components/pages/Dashboard/index.js +65 -103
- package/package.json +6 -1
- package/src/assets/images/chatPopup/Spinner.gif +0 -0
- package/src/assets/images/chatPopup/close.svg +3 -0
- package/src/assets/images/chatPopup/defaultImage.png +0 -0
- package/src/assets/images/chatPopup/defaultProfile.png +0 -0
- package/src/assets/images/chatPopup/doc.svg +1 -0
- package/src/assets/images/chatPopup/document.svg +1 -0
- package/src/assets/images/chatPopup/iconChat.svg +19 -0
- package/src/assets/images/chatPopup/iconPlus.svg +3 -0
- package/src/assets/images/chatPopup/pdf.svg +75 -0
- package/src/assets/images/chatPopup/remove.svg +4 -0
- package/src/assets/images/chatPopup/send.svg +3 -0
- package/src/assets/images/chatPopup/svgIcon.svg +109 -0
- package/src/assets/images/chatPopup/upload_file.svg +3 -0
- package/src/assets/images/chatPopup/xls.svg +53 -0
- package/src/components/atoms/ChatPopUp/ChatPopUp.stories.js +11 -0
- package/src/components/atoms/ChatPopUp/index.js +541 -0
- package/src/components/atoms/ChatPopUp/styles.js +278 -0
- package/src/components/atoms/ChatPopUp/utils/handlersChat.js +104 -0
- package/src/components/atoms/Graphic/index.js +4 -1
- package/src/components/atoms/Tooltip/Tooltip.stories.js +15 -0
- package/src/components/atoms/Tooltip/index.js +35 -0
- package/src/components/atoms/Tooltip/styles.js +5 -0
- package/src/components/molecules/CustomSelect/index.js +11 -2
- package/src/components/molecules/CustomSelect/styles.js +3 -1
- package/src/components/molecules/HeaderTop/index.js +10 -6
- package/src/components/molecules/HeaderTop/styles.js +4 -0
- package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +4 -0
- package/src/components/organisms/DashboardMetric/index.js +2 -2
- package/src/components/pages/Dashboard/Dashboard.stories.js +25 -25
- package/src/components/pages/Dashboard/dashboardUtils.js +1 -1
- package/src/components/pages/Dashboard/index.js +34 -40
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
3
|
+
|
|
4
|
+
export const Container = styled.button`
|
|
5
|
+
height: 34px;
|
|
6
|
+
width: 34px;
|
|
7
|
+
background-color: transparent;
|
|
8
|
+
border: 1px solid #f0f0f0;
|
|
9
|
+
border-radius: 50px;
|
|
10
|
+
padding: 10px;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
position: relative;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
&:hover {
|
|
17
|
+
background-color: #f0f0f0;
|
|
18
|
+
}
|
|
19
|
+
.icon-chat {
|
|
20
|
+
margin: 0;
|
|
21
|
+
width: 15px;
|
|
22
|
+
height: 15px;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
export const Slider = styled.div`
|
|
26
|
+
-webkit-box-shadow: 0px 0px 10px -1px rgba(0, 0, 0, 0.8);
|
|
27
|
+
box-shadow: 0px 0px 10px -1px rgba(0, 0, 0, 0.8);
|
|
28
|
+
z-index: 200;
|
|
29
|
+
width: 425px;
|
|
30
|
+
height: 600px;
|
|
31
|
+
border-radius: 10px;
|
|
32
|
+
background: white;
|
|
33
|
+
padding: 37px 16px 17px 20px;
|
|
34
|
+
position: absolute;
|
|
35
|
+
right: ${({ showMenu }) => (showMenu ? 2 : -50)}%;
|
|
36
|
+
top: 3%;
|
|
37
|
+
transition: right 2s ease 0;
|
|
38
|
+
.image {
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
align-content: center;
|
|
42
|
+
background-color: #f7f7f7;
|
|
43
|
+
border-radius: 10px;
|
|
44
|
+
#myList {
|
|
45
|
+
list-style: none;
|
|
46
|
+
img {
|
|
47
|
+
width: 365px;
|
|
48
|
+
border-radius: 10px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
.close {
|
|
53
|
+
background-color: #e33aa9;
|
|
54
|
+
border: 3px solid white;
|
|
55
|
+
height: 35px;
|
|
56
|
+
width: 35px;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: -18px;
|
|
60
|
+
display: flex;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
align-items: center;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
}
|
|
65
|
+
.content-chat {
|
|
66
|
+
height: 495px;
|
|
67
|
+
max-height: 495px;
|
|
68
|
+
overflow-y: auto;
|
|
69
|
+
overflow-x: hidden;
|
|
70
|
+
background-color: transparent;
|
|
71
|
+
font-family: sans-serif;
|
|
72
|
+
font-size: 12px;
|
|
73
|
+
& + * {
|
|
74
|
+
margin-top: 12px;
|
|
75
|
+
}
|
|
76
|
+
::-webkit-scrollbar {
|
|
77
|
+
width: 0;
|
|
78
|
+
}
|
|
79
|
+
.cargar-mas {
|
|
80
|
+
border: none;
|
|
81
|
+
border-radius: 10px;
|
|
82
|
+
font: normal normal normal 11px/11px sans-serif;
|
|
83
|
+
letter-spacing: 0.1px;
|
|
84
|
+
color: #8a6caa;
|
|
85
|
+
background-color: #f7f7fc;
|
|
86
|
+
padding: 5px 17px;
|
|
87
|
+
margin: 0 35%;
|
|
88
|
+
display: flex;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
&:hover {
|
|
92
|
+
background-color: #f0f0f0;
|
|
93
|
+
}
|
|
94
|
+
img {
|
|
95
|
+
margin-right: 7px;
|
|
96
|
+
height: 13px;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
#myListChat {
|
|
100
|
+
list-style: none;
|
|
101
|
+
margin: 0;
|
|
102
|
+
padding: 0;
|
|
103
|
+
height: 100%;
|
|
104
|
+
overflow-y: auto;
|
|
105
|
+
overflow-x: hidden;
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column-reverse;
|
|
108
|
+
gap: 3px;
|
|
109
|
+
.group-date {
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
align-items: center;
|
|
113
|
+
hr {
|
|
114
|
+
width: 120px;
|
|
115
|
+
border: 0.3px solid #f0f0f0;
|
|
116
|
+
}
|
|
117
|
+
p {
|
|
118
|
+
margin: 0 10px;
|
|
119
|
+
color: #b3b3b3;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
li {
|
|
123
|
+
width: 100%;
|
|
124
|
+
padding: 5px 0;
|
|
125
|
+
margin: 0;
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: row-reverse;
|
|
128
|
+
justify-content: flex-start;
|
|
129
|
+
flex-wrap: nowrap;
|
|
130
|
+
gap: 5px;
|
|
131
|
+
align-items: center;
|
|
132
|
+
.tooltip-userName {
|
|
133
|
+
background-color: #f0f0f0;
|
|
134
|
+
padding: 6px 10px;
|
|
135
|
+
color: #000000;
|
|
136
|
+
font-size: 11px;
|
|
137
|
+
margin-bottom: 6px;
|
|
138
|
+
.MuiTooltip-arrow {
|
|
139
|
+
color: #f0f0f0;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.profile {
|
|
144
|
+
display: grid;
|
|
145
|
+
place-items: center;
|
|
146
|
+
align-self: start;
|
|
147
|
+
width: 34px;
|
|
148
|
+
height: 34px;
|
|
149
|
+
border-radius: 50%;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
img {
|
|
152
|
+
width: 100%;
|
|
153
|
+
height: 100%;
|
|
154
|
+
border-radius: inherit;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
.img-file {
|
|
158
|
+
margin: 0 10px;
|
|
159
|
+
width: 165px;
|
|
160
|
+
img {
|
|
161
|
+
width: 100%;
|
|
162
|
+
object-fit: contain;
|
|
163
|
+
border-radius: 10px;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
.body-message {
|
|
167
|
+
margin: 0 10px;
|
|
168
|
+
border-radius: 10px;
|
|
169
|
+
box-sizing: border-box;
|
|
170
|
+
background-color: #f0f0f0;
|
|
171
|
+
padding: 10px 10px 10px 12px;
|
|
172
|
+
max-width: 280px;
|
|
173
|
+
p {
|
|
174
|
+
color: #262626;
|
|
175
|
+
margin: 0;
|
|
176
|
+
padding: 0;
|
|
177
|
+
}
|
|
178
|
+
a {
|
|
179
|
+
text-decoration: none;
|
|
180
|
+
}
|
|
181
|
+
div {
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
background-color: white;
|
|
184
|
+
border-radius: 10px;
|
|
185
|
+
padding: 7px 10px;
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
img {
|
|
189
|
+
height: 20px;
|
|
190
|
+
width: 20px;
|
|
191
|
+
margin-right: 5px;
|
|
192
|
+
}
|
|
193
|
+
p {
|
|
194
|
+
color: #262626 !important;
|
|
195
|
+
white-space: nowrap;
|
|
196
|
+
text-overflow: ellipsis;
|
|
197
|
+
overflow: hidden;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
.date {
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
white-space: nowrap;
|
|
205
|
+
p {
|
|
206
|
+
color: #d9d9d9;
|
|
207
|
+
font-size: 9px;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
&.own-message {
|
|
211
|
+
flex-direction: row;
|
|
212
|
+
justify-content: flex-start;
|
|
213
|
+
.body-message {
|
|
214
|
+
background-color: #8386ee;
|
|
215
|
+
p {
|
|
216
|
+
margin: 0;
|
|
217
|
+
padding: 0;
|
|
218
|
+
color: #ffffff;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
.input-chat {
|
|
226
|
+
display: flex;
|
|
227
|
+
align-items: center;
|
|
228
|
+
border-radius: 17px;
|
|
229
|
+
background-color: #f7f7f7;
|
|
230
|
+
padding: 10px 7px 10px 15px;
|
|
231
|
+
.send-message {
|
|
232
|
+
background-color: transparent;
|
|
233
|
+
width: 157%;
|
|
234
|
+
border: none;
|
|
235
|
+
font-family: sans-serif;
|
|
236
|
+
font-size: 13px;
|
|
237
|
+
line-height: initial;
|
|
238
|
+
color: #242424;
|
|
239
|
+
::placeholder {
|
|
240
|
+
font: normal normal medium 12px/14px sans-serif;
|
|
241
|
+
letter-spacing: 0.6px;
|
|
242
|
+
color: #b3b3b3;
|
|
243
|
+
}
|
|
244
|
+
:focus {
|
|
245
|
+
outline: none;
|
|
246
|
+
}
|
|
247
|
+
& + * {
|
|
248
|
+
margin-left: 10px;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
.upload {
|
|
252
|
+
border: none;
|
|
253
|
+
background: transparent;
|
|
254
|
+
cursor: pointer;
|
|
255
|
+
& + * {
|
|
256
|
+
margin-left: 7px;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
.add-picture-input {
|
|
260
|
+
display: none;
|
|
261
|
+
}
|
|
262
|
+
.send {
|
|
263
|
+
width: 35.4px;
|
|
264
|
+
height: 20px;
|
|
265
|
+
border: none;
|
|
266
|
+
background-color: #e33aa9;
|
|
267
|
+
border-radius: 50%;
|
|
268
|
+
display: flex;
|
|
269
|
+
justify-content: center;
|
|
270
|
+
cursor: pointer;
|
|
271
|
+
align-items: center;
|
|
272
|
+
img {
|
|
273
|
+
width: 11px;
|
|
274
|
+
height: 11px;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
`;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export const getBD = (
|
|
6
|
+
id_article,
|
|
7
|
+
version_article,
|
|
8
|
+
get_type,
|
|
9
|
+
item_date ,
|
|
10
|
+
tokenUser
|
|
11
|
+
) => {
|
|
12
|
+
return new Promise(async (response, error) => {
|
|
13
|
+
try {
|
|
14
|
+
let URL = `https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/products-chat`; // endpoint
|
|
15
|
+
URL += `?id_article=${id_article}`;
|
|
16
|
+
URL += `&version_article=${version_article}`;
|
|
17
|
+
URL += `&get_type=${get_type}`;
|
|
18
|
+
URL += `&item_date=${item_date}`;
|
|
19
|
+
|
|
20
|
+
const respHTTPjson = await axios.get(URL, {
|
|
21
|
+
headers: {
|
|
22
|
+
// AQUI COLOCAR EL TOKEN DEL USUARIO CONECTADO
|
|
23
|
+
Authorization: tokenUser,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
//console.log( "respHTTPjson" , respHTTPjson )
|
|
27
|
+
// verificar si existe un error en la peticion realizada
|
|
28
|
+
if (respHTTPjson.status != 200) {
|
|
29
|
+
response({
|
|
30
|
+
message: "No fue posible llevar a cabo la operacion",
|
|
31
|
+
errorDetails: respHTTPjson.statusText,
|
|
32
|
+
});
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// obtener body backend
|
|
36
|
+
const body = JSON.parse(respHTTPjson.data.body);
|
|
37
|
+
//console.log( "resHTTP body:" , body );
|
|
38
|
+
// verificar si existe error desde el backend
|
|
39
|
+
if (respHTTPjson.data.statusCode != 200) {
|
|
40
|
+
response({
|
|
41
|
+
message: body.message,
|
|
42
|
+
errorDetails: body.errorDetail,
|
|
43
|
+
});
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
// cuando se ejecuto bien el create ... tomar un posible message
|
|
47
|
+
response({ body });
|
|
48
|
+
} catch (err) {
|
|
49
|
+
//console.log("error catch get items chat" , err);
|
|
50
|
+
response({
|
|
51
|
+
message: "Algo salio mal al obtener los items del chat",
|
|
52
|
+
errorDetails: err.message,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export const createItemBD = (
|
|
60
|
+
id_article,
|
|
61
|
+
version_article,
|
|
62
|
+
value_type,
|
|
63
|
+
value ,
|
|
64
|
+
tokenUser
|
|
65
|
+
) => {
|
|
66
|
+
return new Promise(async (response, error) => {
|
|
67
|
+
try {
|
|
68
|
+
const URL = `https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/products-chat`;
|
|
69
|
+
const bodyData = {
|
|
70
|
+
id_article: id_article,
|
|
71
|
+
version_article: version_article,
|
|
72
|
+
value_type: value_type,
|
|
73
|
+
value: value,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const respHTTPjson = await axios.post(URL, bodyData, {
|
|
77
|
+
headers: {
|
|
78
|
+
Authorization: tokenUser,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
if (respHTTPjson.status != 200) {
|
|
82
|
+
response({
|
|
83
|
+
message: "No fue posible llevar a cabo la operacion",
|
|
84
|
+
errorDetails: respHTTPjson.statusText,
|
|
85
|
+
});
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const body = JSON.parse(respHTTPjson.data.body);
|
|
89
|
+
if (respHTTPjson.data.statusCode != 200) {
|
|
90
|
+
response({
|
|
91
|
+
message: body.message,
|
|
92
|
+
errorDetails: body.errorDetail,
|
|
93
|
+
});
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
response({ body: true });
|
|
97
|
+
} catch (err) {
|
|
98
|
+
response({
|
|
99
|
+
message: "Algo salio mal al agregar el item en el chat",
|
|
100
|
+
errorDetails: err.message,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
};
|
|
@@ -13,6 +13,9 @@ export const Graphic = ({ data, type, options }) => {
|
|
|
13
13
|
} = chart;
|
|
14
14
|
const x = width / 2;
|
|
15
15
|
const y = height / 2 + (options.fontSize * 0.68) / 2;
|
|
16
|
+
const percent = options.value.toString().includes(".")
|
|
17
|
+
? options.value.toFixed(2)
|
|
18
|
+
: options.value;
|
|
16
19
|
ctx.save();
|
|
17
20
|
ctx.beginPath();
|
|
18
21
|
ctx.arc(x, height / 2, 60, 0, 2 * Math.PI);
|
|
@@ -23,7 +26,7 @@ export const Graphic = ({ data, type, options }) => {
|
|
|
23
26
|
ctx.font = `${options.fontSize}px ${options.fontFamily}`;
|
|
24
27
|
ctx.textAlign = options.textAlign;
|
|
25
28
|
ctx.fillStyle = options.fontColor;
|
|
26
|
-
ctx.fillText(
|
|
29
|
+
ctx.fillText(percent + "%", x, y);
|
|
27
30
|
},
|
|
28
31
|
};
|
|
29
32
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CustomTooltip } from "./index";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/atoms/CustomTooltip",
|
|
5
|
+
component: CustomTooltip
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => <CustomTooltip {...args} />;
|
|
9
|
+
|
|
10
|
+
export const TooltipDefault = Template.bind({});
|
|
11
|
+
TooltipDefault.args = {
|
|
12
|
+
componentTooltip: (<p> hola soy tooltip </p>) ,
|
|
13
|
+
children: (<button> abrir tooltip </button>) ,
|
|
14
|
+
className: "container-tooltip"
|
|
15
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { Tooltip } from "@mui/material";
|
|
3
|
+
import { Container } from "./styles";
|
|
4
|
+
import React from "react";
|
|
5
|
+
|
|
6
|
+
export const CustomTooltip = ({
|
|
7
|
+
componentTooltip ,
|
|
8
|
+
children ,
|
|
9
|
+
className ,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
|
|
13
|
+
const MyComponent = React.forwardRef(function MyComponent(props, ref) {
|
|
14
|
+
return (
|
|
15
|
+
<div {...props} ref={ref}>
|
|
16
|
+
Bin
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Tooltip
|
|
23
|
+
{...props}
|
|
24
|
+
arrow
|
|
25
|
+
placement="top"
|
|
26
|
+
componentsProps={{
|
|
27
|
+
tooltip: {className: className} ,
|
|
28
|
+
popper: {disablePortal: true}
|
|
29
|
+
}}
|
|
30
|
+
title={ componentTooltip }
|
|
31
|
+
>
|
|
32
|
+
{children}
|
|
33
|
+
</Tooltip>
|
|
34
|
+
)
|
|
35
|
+
};
|
|
@@ -4,6 +4,7 @@ import searchIcon from "../../../assets/images/customSelect/searchIcon.png";
|
|
|
4
4
|
import { useCloseModal } from "../../../global-files/customHooks";
|
|
5
5
|
import { SelecItem } from "./SelectItem";
|
|
6
6
|
import { Calendar } from "../../organisms/Calendar";
|
|
7
|
+
import { formatDate } from "../../pages/Dashboard/dashboardUtils";
|
|
7
8
|
|
|
8
9
|
export const CustomSelect = ({
|
|
9
10
|
options,
|
|
@@ -94,12 +95,20 @@ export const CustomSelect = ({
|
|
|
94
95
|
counter++;
|
|
95
96
|
}
|
|
96
97
|
});
|
|
97
|
-
|
|
98
|
+
setFiltersCounter(counter);
|
|
98
99
|
setFiltersString(newFiltersString);
|
|
99
100
|
}, [activeFilters]);
|
|
100
101
|
|
|
101
102
|
return (
|
|
102
|
-
<Container
|
|
103
|
+
<Container
|
|
104
|
+
id={customSelectId}
|
|
105
|
+
selectLabel={selectLabel}
|
|
106
|
+
filterActive={
|
|
107
|
+
Object.keys(activeFilters).length > 0 ||
|
|
108
|
+
(customSelectId === "dates-select" &&
|
|
109
|
+
filtersString !== "Todo el tiempo")
|
|
110
|
+
}
|
|
111
|
+
>
|
|
103
112
|
<div className="button-list" onClick={() => setShowList(!showList)}>
|
|
104
113
|
<p>{filtersString} </p>
|
|
105
114
|
<p>{filtersCounter > 0 && `+${filtersCounter}`}</p>
|
|
@@ -15,7 +15,8 @@ export const Container = styled.div`
|
|
|
15
15
|
//padding: 5px 5px;
|
|
16
16
|
justify-content: space-between;
|
|
17
17
|
border-radius: 50px;
|
|
18
|
-
background-color:
|
|
18
|
+
background-color: ${({ filterActive }) =>
|
|
19
|
+
filterActive ? "#F7F7FC" : "#fff"};
|
|
19
20
|
border: 1px solid #f0f0f0;
|
|
20
21
|
cursor: pointer;
|
|
21
22
|
|
|
@@ -93,6 +94,7 @@ export const Container = styled.div`
|
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
.sub-menu {
|
|
97
|
+
margin-top: 10px;
|
|
96
98
|
padding-left: 20px;
|
|
97
99
|
.sub-filter {
|
|
98
100
|
& + * {
|
|
@@ -2,6 +2,7 @@ import { Container } from "./styles";
|
|
|
2
2
|
import { ScreenHeader } from "../../atoms/ScreenHeader/index";
|
|
3
3
|
import { Button } from "../../atoms/GeneralButton/index";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
|
+
import { ChatPopUp } from "../../atoms/ChatPopUp/index";
|
|
5
6
|
|
|
6
7
|
export const HeaderTop = ({ setHeaderTop }) => {
|
|
7
8
|
const headerTop = useRef();
|
|
@@ -13,12 +14,15 @@ export const HeaderTop = ({ setHeaderTop }) => {
|
|
|
13
14
|
return (
|
|
14
15
|
<Container ref={headerTop}>
|
|
15
16
|
<ScreenHeader text="Edición de producto" />
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
<div className="buttons-top">
|
|
18
|
+
<ChatPopUp />
|
|
19
|
+
<Button
|
|
20
|
+
buttonType="close-button"
|
|
21
|
+
onClick={() => {
|
|
22
|
+
window.location.href = `/products`;
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
22
26
|
</Container>
|
|
23
27
|
);
|
|
24
28
|
};
|
|
@@ -31,6 +31,8 @@ export const getFullStatus = (status) => {
|
|
|
31
31
|
return "Aprobado Cadena";
|
|
32
32
|
case "R":
|
|
33
33
|
return "Por Recibir/Recibido";
|
|
34
|
+
case "Ex":
|
|
35
|
+
return "Exportado";
|
|
34
36
|
}
|
|
35
37
|
};
|
|
36
38
|
|
|
@@ -67,6 +69,8 @@ export const getStatusColor = (status) => {
|
|
|
67
69
|
return "#839192";
|
|
68
70
|
case "R":
|
|
69
71
|
return "#D35400";
|
|
72
|
+
case "Ex":
|
|
73
|
+
return "#09CAD8";
|
|
70
74
|
default:
|
|
71
75
|
return "white";
|
|
72
76
|
}
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
removeOldStatus,
|
|
6
6
|
getStatusColor,
|
|
7
7
|
} from "./dashboardMetricUtils";
|
|
8
|
-
import { FontFamily } from "../../../global-files/variables";
|
|
9
8
|
|
|
10
9
|
export const DashboardMetric = ({
|
|
11
10
|
label,
|
|
@@ -19,6 +18,7 @@ export const DashboardMetric = ({
|
|
|
19
18
|
showPercent = false,
|
|
20
19
|
borderColor,
|
|
21
20
|
total,
|
|
21
|
+
totalFiltered,
|
|
22
22
|
}) => {
|
|
23
23
|
const labels =
|
|
24
24
|
type === "doughnut"
|
|
@@ -80,7 +80,7 @@ export const DashboardMetric = ({
|
|
|
80
80
|
fontSize: 25,
|
|
81
81
|
fontColor: "#707070",
|
|
82
82
|
textAlign: "center",
|
|
83
|
-
value: total || 0,
|
|
83
|
+
value: (totalFiltered / total) * 100 || 0,
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
86
|
scales: {
|
|
@@ -9,37 +9,37 @@ const Template = (args) => <Dashboard {...args} />;
|
|
|
9
9
|
export const DashboardDeafult = Template.bind({});
|
|
10
10
|
DashboardDeafult.args = {
|
|
11
11
|
user: {
|
|
12
|
-
id_user:
|
|
13
|
-
name: "
|
|
14
|
-
last_name: "
|
|
15
|
-
email: "
|
|
16
|
-
position: "
|
|
17
|
-
telephone: "
|
|
12
|
+
id_user: 30,
|
|
13
|
+
name: "Admin",
|
|
14
|
+
last_name: "Ulises",
|
|
15
|
+
email: "salmeron.5@hotmail.com",
|
|
16
|
+
position: "Admin",
|
|
17
|
+
telephone: "",
|
|
18
18
|
country: "México",
|
|
19
|
-
id_company:
|
|
20
|
-
id_cognito: "
|
|
19
|
+
id_company: 2,
|
|
20
|
+
id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
|
|
21
21
|
birth_Date: null,
|
|
22
|
-
about_me:
|
|
23
|
-
zip_code:
|
|
24
|
-
address:
|
|
25
|
-
job:
|
|
26
|
-
id_stripe: "
|
|
27
|
-
id_role:
|
|
22
|
+
about_me: "",
|
|
23
|
+
zip_code: "",
|
|
24
|
+
address: "",
|
|
25
|
+
job: "",
|
|
26
|
+
id_stripe: "",
|
|
27
|
+
id_role: 6,
|
|
28
28
|
active: 1,
|
|
29
29
|
is_retailer: 0,
|
|
30
30
|
email_notify: 1,
|
|
31
31
|
membership: {
|
|
32
|
-
id:
|
|
33
|
-
start_date: "
|
|
34
|
-
end_date: "
|
|
35
|
-
planID:
|
|
36
|
-
plan: "
|
|
37
|
-
name: "Plan
|
|
38
|
-
user_limit: "
|
|
39
|
-
products_limit: "
|
|
40
|
-
type: "
|
|
32
|
+
id: 2,
|
|
33
|
+
start_date: "2021-11-05T02:35:12.000Z",
|
|
34
|
+
end_date: "2022-11-05T02:34:49.000Z",
|
|
35
|
+
planID: 1,
|
|
36
|
+
plan: "prod_KtkvuFFLpOdP6e",
|
|
37
|
+
name: "Plan Free",
|
|
38
|
+
user_limit: "1",
|
|
39
|
+
products_limit: "3",
|
|
40
|
+
type: "PyMES",
|
|
41
41
|
},
|
|
42
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
42
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1666294798400",
|
|
43
43
|
},
|
|
44
|
-
jwt: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
44
|
+
jwt: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjOTRhNzMwNS05MzY1LTQ2ZmYtYTQyMy00YjRiYzNiOGIxODAiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiYzk0YTczMDUtOTM2NS00NmZmLWE0MjMtNGI0YmMzYjhiMTgwIiwiY29nbml0bzpyb2xlcyI6WyJhcm46YXdzOmlhbTo6ODk4NjcwMjMyODA3OnJvbGVcL2NvbnRlbnRvaC1kZXYtdXMtZWFzdC0xLWxhbWJkYVJvbGUiXSwiYXVkIjoiNWFjOHRwZ3M2Z2JzcTEzZnJ2cnBpZWVwNDAiLCJldmVudF9pZCI6ImJmODBhZmM4LTVjMWMtNDJmNi1hY2RhLTg0M2I1NDg3OWExZSIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjY2Mjk0Nzk2LCJuYW1lIjoiQ29sYWJvcmFkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIxMTExIiwiZXhwIjoxNjY2Mjk4Mzk2LCJpYXQiOjE2NjYyOTQ3OTYsImVtYWlsIjoic2FsbWVyb24uNUBob3RtYWlsLmNvbSJ9.RHigufdS172zrKNRuSKB9AALBvpHW2_xkHKMIVl5o4UtwiLOFyCI2gtdHDb7pgXxJH1Lk5n4OyNIiD6rta40o-eq7oY5unlUI38UVO0f8VXvjkvoi2CQ3J6JdNCZVzSzpT29vk0qvT39HFKVKfru4UxjTbPvVX77yZZ_QYoQvZ6gTjhzcvQslBSlQHh-RDAIwI9jbcePBDLIExbt_fq7Q6T5WdhnXkam8xBavF-3c3tVK9SjCAD_Y2gQhVmnAO5Co2Mqh59XfdT6uwNLTtwWd3aK5YX1thWW_oACfKBWAvLMSoYO3mjiXGWzKKLe7uNSvv92VhpLUeoYnVfrtafXAg",
|
|
45
45
|
};
|