contentoh-components-library 21.3.8 → 21.3.10
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 +2 -0
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/components/molecules/HeaderTop/index.js +16 -4
- package/dist/components/molecules/ProductNameHeader/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +31 -86
- package/dist/components/organisms/Chat/ContainerItems/index.js +4 -2
- package/dist/components/organisms/Chat/ContentChat/index.js +107 -50
- package/dist/components/organisms/Chat/index.js +51 -125
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +65 -50
- package/dist/components/pages/ProviderProductEdition/index.js +6 -2
- package/dist/global-files/handle_userTech.js +20 -0
- package/dist/global-files/utils.js +18 -2
- package/package.json +1 -1
- package/src/assets/images/generalButton/closeIcon.svg +2 -2
- package/src/components/molecules/HeaderTop/index.js +19 -3
- package/src/components/molecules/ProductNameHeader/index.js +1 -1
- package/src/components/organisms/Chat/Chat.stories.js +31 -83
- package/src/components/organisms/Chat/ContainerItems/index.js +3 -2
- package/src/components/organisms/Chat/ContentChat/index.js +82 -35
- package/src/components/organisms/Chat/index.js +66 -125
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +67 -48
- package/src/components/pages/ProviderProductEdition/index.js +7 -1
- package/src/global-files/handle_userTech.js +7 -0
- package/src/global-files/utils.js +13 -0
|
@@ -7,10 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.Chat = void 0;
|
|
9
9
|
|
|
10
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
15
11
|
|
|
16
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
@@ -35,7 +31,9 @@ var Chat = function Chat(props) {
|
|
|
35
31
|
var chatType = props.chatType,
|
|
36
32
|
chatContainerType = props.chatContainerType,
|
|
37
33
|
chatData = props.chatData,
|
|
38
|
-
classNameContainerFixed = props.classNameContainerFixed
|
|
34
|
+
classNameContainerFixed = props.classNameContainerFixed,
|
|
35
|
+
_props$size = props.size,
|
|
36
|
+
size = _props$size === void 0 ? 14 : _props$size;
|
|
39
37
|
|
|
40
38
|
var _useState = (0, _react.useState)(false),
|
|
41
39
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -68,25 +66,31 @@ var Chat = function Chat(props) {
|
|
|
68
66
|
errorDetail: ""
|
|
69
67
|
});
|
|
70
68
|
}
|
|
71
|
-
}, [chatType]);
|
|
72
|
-
|
|
73
|
-
var validateChatOrderProduct = function validateChatOrderProduct() {
|
|
74
|
-
var userToken = chatData.userToken,
|
|
75
|
-
id = chatData.id,
|
|
76
|
-
orderId = chatData.orderId,
|
|
77
|
-
retailerId = chatData.retailerId; // validar token del user
|
|
69
|
+
}, [chatType]);
|
|
78
70
|
|
|
71
|
+
var isValidGeneral = function isValidGeneral(userToken, id) {
|
|
72
|
+
// validar token del user
|
|
79
73
|
if ((0, _utils.isStringEmpty)(userToken)) {
|
|
80
74
|
setDataError("El token del usuario no es valido");
|
|
81
|
-
return;
|
|
75
|
+
return false;
|
|
82
76
|
} // validar ID del producto
|
|
83
77
|
|
|
84
78
|
|
|
85
79
|
if (!(0, _utils.isValidNaturalNumber)(id)) {
|
|
86
80
|
setDataError("El ID del producto no es valido");
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
89
83
|
|
|
84
|
+
return true;
|
|
85
|
+
}; // validar props que se requieren para el tipo de chat "order_product"
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
var validateChatOrderProduct = function validateChatOrderProduct() {
|
|
89
|
+
var userToken = chatData.userToken,
|
|
90
|
+
id = chatData.id,
|
|
91
|
+
orderId = chatData.orderId,
|
|
92
|
+
retailerId = chatData.retailerId;
|
|
93
|
+
if (!isValidGeneral(userToken, id)) return; // validar el ID de la OT en donde se encuentra el producto
|
|
90
94
|
|
|
91
95
|
if (!(0, _utils.isValidNaturalNumber)(orderId)) {
|
|
92
96
|
setDataError("El ID de la orden del producto no es valido");
|
|
@@ -111,19 +115,8 @@ var Chat = function Chat(props) {
|
|
|
111
115
|
var validateChatMerchantProduct = function validateChatMerchantProduct() {
|
|
112
116
|
var userToken = chatData.userToken,
|
|
113
117
|
id = chatData.id,
|
|
114
|
-
version = chatData.version;
|
|
115
|
-
|
|
116
|
-
if ((0, _utils.isStringEmpty)(userToken)) {
|
|
117
|
-
setDataError("El token del usuario no es valido");
|
|
118
|
-
return;
|
|
119
|
-
} // validar ID del producto
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (!(0, _utils.isValidNaturalNumber)(id)) {
|
|
123
|
-
setDataError("El ID del producto no es valido");
|
|
124
|
-
return;
|
|
125
|
-
} // validar la version del producto
|
|
126
|
-
|
|
118
|
+
version = chatData.version;
|
|
119
|
+
if (!isValidGeneral(userToken, id)) return; // validar la version del producto
|
|
127
120
|
|
|
128
121
|
if (!(0, _utils.isValidNaturalNumber)(version)) {
|
|
129
122
|
setDataError("La version del producto no es valida");
|
|
@@ -142,7 +135,13 @@ var Chat = function Chat(props) {
|
|
|
142
135
|
var currentUser = chatData.currentUser,
|
|
143
136
|
id = chatData.id,
|
|
144
137
|
statusTicket = chatData.statusTicket,
|
|
145
|
-
ticketOwnerUserId = chatData.ticketOwnerUserId; // validar
|
|
138
|
+
ticketOwnerUserId = chatData.ticketOwnerUserId; // validar el token del usuario conectado
|
|
139
|
+
|
|
140
|
+
if ((0, _utils.isStringEmpty)(currentUser === null || currentUser === void 0 ? void 0 : currentUser.token)) {
|
|
141
|
+
setDataError("Tu identificación de usuario no fue especificado");
|
|
142
|
+
return;
|
|
143
|
+
} // validar si ID del usuario conectado
|
|
144
|
+
|
|
146
145
|
|
|
147
146
|
if (!(0, _utils.isValidNaturalNumber)(currentUser === null || currentUser === void 0 ? void 0 : currentUser.id)) {
|
|
148
147
|
setDataError("Tu ID de usuario no fue especificado");
|
|
@@ -156,7 +155,7 @@ var Chat = function Chat(props) {
|
|
|
156
155
|
} // validar si el usuario conectado es de tecnologia o no
|
|
157
156
|
|
|
158
157
|
|
|
159
|
-
if ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.isUserTech)
|
|
158
|
+
if (![false, true].includes(currentUser === null || currentUser === void 0 ? void 0 : currentUser.isUserTech)) {
|
|
160
159
|
setDataError("Tu tipo de usuario no fue especificado");
|
|
161
160
|
return;
|
|
162
161
|
} // validar ID del ticket
|
|
@@ -174,7 +173,7 @@ var Chat = function Chat(props) {
|
|
|
174
173
|
} // validar el status del chat
|
|
175
174
|
|
|
176
175
|
|
|
177
|
-
if (
|
|
176
|
+
if (!["IN_PROGRESS", "PENDING", "COMPLETED"].includes(statusTicket)) {
|
|
178
177
|
setDataError("El estatus del ticket no es valido");
|
|
179
178
|
return;
|
|
180
179
|
}
|
|
@@ -204,105 +203,31 @@ var Chat = function Chat(props) {
|
|
|
204
203
|
errorDetail: errorDetail
|
|
205
204
|
});
|
|
206
205
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
valueType: valueType,
|
|
218
|
-
value: valueInput,
|
|
219
|
-
isOrderProduct: "1",
|
|
220
|
-
orderId: orderId,
|
|
221
|
-
retailerId: retailerId,
|
|
222
|
-
};
|
|
223
|
-
paramsHeaders = { Authorization: userToken };
|
|
224
|
-
break;
|
|
225
|
-
default:
|
|
226
|
-
// merchants_products--------------------------------------
|
|
227
|
-
paramsBody = {
|
|
228
|
-
articleId: articleId,
|
|
229
|
-
articleVersion: articleVersion,
|
|
230
|
-
valueType: valueType,
|
|
231
|
-
value: valueInput,
|
|
232
|
-
isOrderProduct: "0",
|
|
233
|
-
};
|
|
234
|
-
paramsHeaders = { Authorization: userToken };
|
|
235
|
-
}
|
|
236
|
-
const response = await fetchPOST(
|
|
237
|
-
process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
|
|
238
|
-
paramsBody,
|
|
239
|
-
paramsHeaders
|
|
240
|
-
);
|
|
241
|
-
if (!response.body) {
|
|
242
|
-
let itemType =
|
|
243
|
-
valueType === "txt"
|
|
244
|
-
? "el mensaje"
|
|
245
|
-
: valueType === "img"
|
|
246
|
-
? "la imagen"
|
|
247
|
-
: "el archivo";
|
|
248
|
-
showModalAlert(
|
|
249
|
-
`No fue posible agregar ${itemType} en el chat`,
|
|
250
|
-
response.errorDetail,
|
|
251
|
-
"error"
|
|
252
|
-
);
|
|
253
|
-
setItems(currentItems);
|
|
254
|
-
} else {
|
|
255
|
-
if (currentItems?.length == 0) {
|
|
256
|
-
// console.log("NUEVO ITEM <> NUEVO INITIAL");
|
|
257
|
-
await getInitial();
|
|
258
|
-
} else {
|
|
259
|
-
// console.log("NUEVO ITEM <> NUEVO UPDATE");
|
|
260
|
-
await getUpdate();
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
*/
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
268
|
-
children: (chatContainerType === null || chatContainerType === void 0 ? void 0 : chatContainerType.toLowerCase()) === "fixed" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
269
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ContainerFixed, {
|
|
270
|
-
className: classNameContainerFixed,
|
|
271
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ContentChat.ContentChat, {
|
|
272
|
-
chatType: chatType === null || chatType === void 0 ? void 0 : chatType.toLowerCase(),
|
|
273
|
-
chatContainerType: "fixed",
|
|
274
|
-
dataChat: data,
|
|
275
|
-
showBtnClose: false
|
|
276
|
-
})
|
|
206
|
+
|
|
207
|
+
if ((chatContainerType === null || chatContainerType === void 0 ? void 0 : chatContainerType.toLowerCase()) === "fixed") {
|
|
208
|
+
/* chat tipo fixed */
|
|
209
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ContainerFixed, {
|
|
210
|
+
className: classNameContainerFixed,
|
|
211
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ContentChat.ContentChat, {
|
|
212
|
+
chatType: chatType === null || chatType === void 0 ? void 0 : chatType.toLowerCase(),
|
|
213
|
+
chatContainerType: "fixed",
|
|
214
|
+
dataChat: data,
|
|
215
|
+
showBtnClose: false
|
|
277
216
|
})
|
|
278
|
-
})
|
|
217
|
+
});
|
|
218
|
+
} else {
|
|
219
|
+
/* chat tipo popUp */
|
|
220
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
279
221
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ContainerBtnPopUpChat, {
|
|
280
222
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
281
223
|
className: "container-btn-popUpChat",
|
|
282
224
|
type: "whiteS2",
|
|
283
|
-
size:
|
|
225
|
+
size: size,
|
|
284
226
|
borderType: "circle",
|
|
285
227
|
icon: _freeSolidSvgIcons.faComments,
|
|
286
|
-
onClick:
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
while (1) {
|
|
290
|
-
switch (_context.prev = _context.next) {
|
|
291
|
-
case 0:
|
|
292
|
-
setShowPopUpChat(!showPopUpChat);
|
|
293
|
-
|
|
294
|
-
case 1:
|
|
295
|
-
case "end":
|
|
296
|
-
return _context.stop();
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}, _callee);
|
|
300
|
-
}));
|
|
301
|
-
|
|
302
|
-
return function (_x) {
|
|
303
|
-
return _ref.apply(this, arguments);
|
|
304
|
-
};
|
|
305
|
-
}()
|
|
228
|
+
onClick: function onClick() {
|
|
229
|
+
setShowPopUpChat(!showPopUpChat);
|
|
230
|
+
}
|
|
306
231
|
})
|
|
307
232
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Slide, {
|
|
308
233
|
direction: "left",
|
|
@@ -313,6 +238,7 @@ var Chat = function Chat(props) {
|
|
|
313
238
|
chatType: chatType === null || chatType === void 0 ? void 0 : chatType.toLowerCase(),
|
|
314
239
|
chatContainerType: "popUp",
|
|
315
240
|
dataChat: data,
|
|
241
|
+
showPopUpChat: showPopUpChat,
|
|
316
242
|
showBtnClose: true,
|
|
317
243
|
onClickBtnClose: function onClickBtnClose() {
|
|
318
244
|
setShowPopUpChat(false);
|
|
@@ -320,8 +246,8 @@ var Chat = function Chat(props) {
|
|
|
320
246
|
})
|
|
321
247
|
})
|
|
322
248
|
})]
|
|
323
|
-
})
|
|
324
|
-
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
325
251
|
};
|
|
326
252
|
|
|
327
253
|
exports.Chat = Chat;
|
|
@@ -31,37 +31,39 @@ ProviderProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": true,
|
|
32
32
|
Imágenes: true
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwM2ViMjZhMC1hYjU2LTQ3NjctYjY0Zi04NDkyNTgwNzcwMmEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjAzZWIyNmEwLWFiNTYtNDc2Ny1iNjRmLTg0OTI1ODA3NzAyYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJmNmNkMzA1My1iODE4LTQzYzgtOGZhMC0yNTZmMTBhMDYwNjciLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY3NDU5OTgwNiwibmFtZSI6IlBydWViYSBNZXJjaGFudHMiLCJwaG9uZV9udW1iZXIiOiIrNTIxMjM0NTY3ODkxIiwiZXhwIjoxNjc0NjAzNDA2LCJpYXQiOjE2NzQ1OTk4MDYsImVtYWlsIjoibWVyY2hhbnRzMjRlbmVAYWxsZnJlZW1haWwubmV0In0.osGY8Rdr20hTwL86dZ_CzXxHLvPe-L0iaLtWVwJ78prdMlbDoEZWNePr-Di1rb8F2efV6FAsf9mELW6Tw3PETo_d5yeDEPVAGD0pXFvVntTlSrJGtfEDMnpNWTG2uaMlL1_zJ8BcFYmIUniZN8VvEKW6ezFOt01cK3We-Vrv92TqKa-ePQRkDnhKu52nnTgxs5aysGf-mYLxLumQ4TcOPXJ2x6OsszedJaujFDeCPN7JVGbg9HC68__WklpgocSasU6fQg4Glh1kXWQ-fy4XaFw6cBParJjkqic2Gg1iqwB5wGbrwD4E0crZyPkgwwPydTLLu6WguGWBuQHhcoG-xg",
|
|
35
35
|
articleId: 238,
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
category: "Decoración|Accesorios Decorativos|Accesorios Decorativos",
|
|
40
|
+
company_name: "merchants24ene@allfreemail.net",
|
|
41
|
+
company_id: 918,
|
|
42
|
+
id_category: "2028",
|
|
43
|
+
id_article: 432,
|
|
44
|
+
name: "VELA AROMA 18 OZ MAN/CAN",
|
|
45
|
+
upc: "102852",
|
|
45
46
|
version: 1,
|
|
46
47
|
retailersAvailable: [{
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
id: 68,
|
|
49
|
+
name: "The Home Depot Merchants"
|
|
49
50
|
}]
|
|
50
51
|
},
|
|
51
52
|
productToEdit: {
|
|
52
|
-
idCategory:
|
|
53
|
-
ArticleId:
|
|
53
|
+
idCategory: "2028",
|
|
54
|
+
ArticleId: 432,
|
|
54
55
|
product: [{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
category: "Decoración|Accesorios Decorativos|Accesorios Decorativos",
|
|
57
|
+
company_name: "merchants24ene@allfreemail.net",
|
|
58
|
+
company_id: 918,
|
|
59
|
+
id_category: "2028",
|
|
60
|
+
id_article: 432,
|
|
61
|
+
name: "VELA AROMA 18 OZ MAN/CAN",
|
|
62
|
+
upc: "102852",
|
|
61
63
|
version: 1,
|
|
62
64
|
retailersAvailable: [{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
id: 68,
|
|
66
|
+
name: "The Home Depot Merchants"
|
|
65
67
|
}]
|
|
66
68
|
}]
|
|
67
69
|
},
|
|
@@ -71,30 +73,30 @@ ProviderProductEditionDefault.args = {
|
|
|
71
73
|
}
|
|
72
74
|
},
|
|
73
75
|
user: {
|
|
74
|
-
id_user:
|
|
75
|
-
name: "
|
|
76
|
-
last_name: "
|
|
77
|
-
email: "
|
|
78
|
-
position: "
|
|
79
|
-
telephone: "+
|
|
76
|
+
id_user: 140,
|
|
77
|
+
name: "Prueba",
|
|
78
|
+
last_name: "Merchants",
|
|
79
|
+
email: "merchants24ene@allfreemail.net",
|
|
80
|
+
position: "merchants24ene@allfreemail.net",
|
|
81
|
+
telephone: "+521234567891",
|
|
80
82
|
country: "México",
|
|
81
|
-
id_company:
|
|
82
|
-
id_cognito: "
|
|
83
|
+
id_company: 918,
|
|
84
|
+
id_cognito: "03eb26a0-ab56-4767-b64f-84925807702a",
|
|
83
85
|
birth_Date: null,
|
|
84
|
-
about_me:
|
|
85
|
-
zip_code:
|
|
86
|
-
address:
|
|
87
|
-
job:
|
|
88
|
-
id_stripe:
|
|
86
|
+
about_me: null,
|
|
87
|
+
zip_code: null,
|
|
88
|
+
address: null,
|
|
89
|
+
job: null,
|
|
90
|
+
id_stripe: null,
|
|
89
91
|
id_role: 0,
|
|
90
92
|
active: 1,
|
|
91
93
|
is_retailer: 0,
|
|
92
|
-
email_notify:
|
|
93
|
-
is_user_tech:
|
|
94
|
+
email_notify: 1,
|
|
95
|
+
is_user_tech: null,
|
|
94
96
|
membership: {
|
|
95
|
-
id:
|
|
96
|
-
start_date: "
|
|
97
|
-
end_date: "
|
|
97
|
+
id: 109,
|
|
98
|
+
start_date: "2023-01-24T22:07:34.000Z",
|
|
99
|
+
end_date: "2024-01-24T22:07:34.000Z",
|
|
98
100
|
planID: 8,
|
|
99
101
|
plan: "prod_KtlhECVSFG2iro",
|
|
100
102
|
name: "Plan Pro",
|
|
@@ -102,23 +104,36 @@ ProviderProductEditionDefault.args = {
|
|
|
102
104
|
products_limit: "5000",
|
|
103
105
|
type: "Enterprise"
|
|
104
106
|
},
|
|
105
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
107
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-140/140.png?1674599807427"
|
|
106
108
|
},
|
|
107
109
|
company: {
|
|
108
|
-
id_company:
|
|
109
|
-
trade_name: "
|
|
110
|
-
company_name: "
|
|
111
|
-
rfc: "
|
|
112
|
-
adress: "
|
|
113
|
-
about_company:
|
|
114
|
-
telephone:
|
|
115
|
-
web_site:
|
|
116
|
-
zip_code:
|
|
110
|
+
id_company: 918,
|
|
111
|
+
trade_name: "merchants24ene@allfreemail.net",
|
|
112
|
+
company_name: "merchants24ene@allfreemail.net",
|
|
113
|
+
rfc: "merchants24ene@allfreemail.net",
|
|
114
|
+
adress: "merchants24ene@allfreemail.net",
|
|
115
|
+
about_company: null,
|
|
116
|
+
telephone: null,
|
|
117
|
+
web_site: null,
|
|
118
|
+
zip_code: null,
|
|
117
119
|
email: null,
|
|
118
|
-
social_link:
|
|
119
|
-
is_retailer: 0
|
|
120
|
+
social_link: null,
|
|
121
|
+
is_retailer: 0,
|
|
122
|
+
financedRetailers: [{
|
|
123
|
+
id: 68,
|
|
124
|
+
name: "The Home Depot Merchants",
|
|
125
|
+
country: "México",
|
|
126
|
+
id_region: 1,
|
|
127
|
+
active: 1
|
|
128
|
+
}],
|
|
129
|
+
retailers: [{
|
|
130
|
+
id: null,
|
|
131
|
+
name: null,
|
|
132
|
+
country: null
|
|
133
|
+
}]
|
|
120
134
|
},
|
|
121
135
|
showSurvey: function showSurvey(v) {
|
|
122
136
|
return v && alert("se muestra");
|
|
123
|
-
}
|
|
137
|
+
},
|
|
138
|
+
withChat: true
|
|
124
139
|
};
|
|
@@ -227,7 +227,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
227
227
|
revision = _ref$revision === void 0 ? false : _ref$revision,
|
|
228
228
|
setShowContentohRequestModal = _ref.setShowContentohRequestModal,
|
|
229
229
|
showSurvey = _ref.showSurvey,
|
|
230
|
-
company = _ref.company
|
|
230
|
+
company = _ref.company,
|
|
231
|
+
withChat = _ref.withChat;
|
|
231
232
|
|
|
232
233
|
var _useState = (0, _react.useState)("Descripción"),
|
|
233
234
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -1680,7 +1681,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1680
1681
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
1681
1682
|
headerTop: headerTop,
|
|
1682
1683
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
1683
|
-
setHeaderTop: setHeaderTop
|
|
1684
|
+
setHeaderTop: setHeaderTop,
|
|
1685
|
+
withChat: withChat,
|
|
1686
|
+
productSelected: productSelected,
|
|
1687
|
+
token: token
|
|
1684
1688
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1685
1689
|
className: "data-container",
|
|
1686
1690
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isUserTech = exports.isUserAdminTech = void 0;
|
|
7
|
+
|
|
8
|
+
var isUserTech = function isUserTech() {
|
|
9
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
10
|
+
return ["AS", "ADMIN-AS", "ADMIN"].includes(value);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.isUserTech = isUserTech;
|
|
14
|
+
|
|
15
|
+
var isUserAdminTech = function isUserAdminTech() {
|
|
16
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
17
|
+
return ["ADMIN-AS", "ADMIN"].includes(value);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.isUserAdminTech = isUserAdminTech;
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.isValidNaturalNumber = exports.isStringEmpty = exports.isObject = exports.isArrayEmpty = exports.getTime = exports.getResizeImgHeight = exports.getImageURL = exports.getImageSize = exports.getFullDate = exports.getFileName = exports.getFileExtension = exports.getDataBuffer = exports.getDataBase64 = exports.getCustomDate = exports.getBase64 = exports.decodeJSON = void 0;
|
|
8
|
+
exports.isValidNaturalNumber = exports.isStringEmpty = exports.isObject = exports.isArrayEmpty = exports.getTime = exports.getResizeImgHeight = exports.getImageURL = exports.getImageSize = exports.getFullDate = exports.getFileName = exports.getFileExtension = exports.getDataBuffer = exports.getDataBase64 = exports.getCustomDate = exports.getBase64 = exports.encodeUriJson = exports.decodeJSON = void 0;
|
|
9
9
|
|
|
10
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
11
|
|
|
@@ -480,5 +480,21 @@ var isObject = function isObject(obj) {
|
|
|
480
480
|
if (obj && (0, _typeof2.default)(obj) === "object" && !Array.isArray(obj)) return true;
|
|
481
481
|
return false;
|
|
482
482
|
};
|
|
483
|
+
/*------------------------
|
|
484
|
+
recibe un value y lo codifica
|
|
485
|
+
primero a JSON y luego a URI
|
|
486
|
+
--------------------------*/
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
exports.isObject = isObject;
|
|
490
|
+
|
|
491
|
+
var encodeUriJson = function encodeUriJson(value) {
|
|
492
|
+
try {
|
|
493
|
+
var encodeValue = encodeURIComponent(JSON.stringify(value));
|
|
494
|
+
return encodeValue;
|
|
495
|
+
} catch (err) {
|
|
496
|
+
return undefined;
|
|
497
|
+
}
|
|
498
|
+
};
|
|
483
499
|
|
|
484
|
-
exports.
|
|
500
|
+
exports.encodeUriJson = encodeUriJson;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg width="52" height="52" viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<line x1="13.3585" y1="12.1333" x2="39.8661" y2="38.641" stroke="#E33AA9" stroke-width="
|
|
3
|
-
<path d="M39.8672 12.1333L13.8672 38.1333" stroke="#E33AA9" stroke-width="
|
|
2
|
+
<line x1="13.3585" y1="12.1333" x2="39.8661" y2="38.641" stroke="#E33AA9" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M39.8672 12.1333L13.8672 38.1333" stroke="#E33AA9" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
4
|
</svg>
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { Container } from "./styles";
|
|
2
2
|
import { ScreenHeader } from "../../atoms/ScreenHeader/index";
|
|
3
3
|
import { Button } from "../../atoms/GeneralButton/index";
|
|
4
|
-
import { useEffect, useRef } from "react";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
5
|
import { Chat } from "../../organisms/Chat";
|
|
6
6
|
|
|
7
|
-
export const HeaderTop = ({
|
|
7
|
+
export const HeaderTop = ({
|
|
8
|
+
setHeaderTop,
|
|
9
|
+
withChat,
|
|
10
|
+
productSelected,
|
|
11
|
+
token,
|
|
12
|
+
}) => {
|
|
8
13
|
const headerTop = useRef();
|
|
9
14
|
|
|
10
15
|
useEffect(() => {
|
|
@@ -15,7 +20,18 @@ export const HeaderTop = ({ setHeaderTop }) => {
|
|
|
15
20
|
<Container ref={headerTop}>
|
|
16
21
|
<ScreenHeader text="Edición de producto" />
|
|
17
22
|
<div className="buttons-top">
|
|
18
|
-
{
|
|
23
|
+
{withChat && (
|
|
24
|
+
<Chat
|
|
25
|
+
chatType="merchant_product"
|
|
26
|
+
chatContainerType="popUp"
|
|
27
|
+
chatData={{
|
|
28
|
+
userToken: token,
|
|
29
|
+
id: productSelected.id_article,
|
|
30
|
+
version: productSelected.version,
|
|
31
|
+
}}
|
|
32
|
+
size={18}
|
|
33
|
+
/>
|
|
34
|
+
)}
|
|
19
35
|
|
|
20
36
|
<Button
|
|
21
37
|
buttonType="close-button"
|
|
@@ -15,7 +15,7 @@ export const ProductNameHeader = ({
|
|
|
15
15
|
return (
|
|
16
16
|
<Container>
|
|
17
17
|
<ScreenHeader headerType={"product-name-header"} text={productName} />
|
|
18
|
-
<Status statusType={statusType} />
|
|
18
|
+
{statusType && <Status statusType={statusType} />}
|
|
19
19
|
<ProgressBar
|
|
20
20
|
percent={percentRequired}
|
|
21
21
|
progressBarType={statusType}
|