contentoh-components-library 21.3.11 → 21.3.13
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 +0 -5
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/components/atoms/ButtonFileChooser/index.js +25 -33
- package/dist/components/atoms/ImagePreview/index.js +0 -14
- package/dist/components/atoms/ProgressBar/index.js +6 -36
- package/dist/components/atoms/ProgressBar/styles.js +3 -11
- package/dist/components/molecules/ButtonDownloadFile/index.js +2 -2
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
- package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
- package/dist/components/molecules/HeaderTop/index.js +6 -23
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +4 -6
- package/dist/components/organisms/Chat/ContainerItems/index.js +15 -49
- package/dist/components/organisms/Chat/ContentChat/index.js +81 -131
- package/dist/components/organisms/Chat/Footer/index.js +25 -33
- package/dist/components/organisms/FullProductNameHeader/index.js +0 -1
- package/dist/components/pages/Dashboard/index.js +21 -13
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +50 -65
- package/dist/components/pages/ProviderProductEdition/index.js +11 -15
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +86 -60
- package/dist/components/pages/RetailerProductEdition/index.js +12 -13
- package/dist/global-files/fonts.css +0 -6
- package/dist/global-files/handle_http.js +7 -9
- package/dist/global-files/utils.js +3 -9
- package/dist/global-files/variables.js +0 -2
- package/dist/index.js +46 -267
- package/package.json +1 -12
- package/src/assets/images/generalButton/closeIcon.svg +2 -2
- package/src/components/atoms/ProgressBar/index.js +5 -40
- package/src/components/atoms/ProgressBar/styles.js +0 -24
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/HeaderTop/index.js +8 -29
- package/src/components/molecules/HeaderTop/styles.js +0 -4
- package/src/components/molecules/ProductNameHeader/index.js +2 -7
- package/src/components/organisms/FullProductNameHeader/index.js +0 -1
- package/src/components/pages/Dashboard/index.js +37 -31
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +49 -67
- package/src/components/pages/ProviderProductEdition/index.js +7 -16
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +85 -62
- package/src/components/pages/RetailerProductEdition/index.js +10 -12
- package/src/global-files/fonts.css +0 -6
- package/src/global-files/variables.js +0 -2
- package/src/index.js +0 -17
- package/src/assets/images/customSelect/starIcon.svg +0 -14
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +0 -124
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
- package/src/components/atoms/ButtonFileChooser/index.js +0 -69
- package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -53
- package/src/components/atoms/ButtonV2/index.js +0 -85
- package/src/components/atoms/ButtonV2/styles.js +0 -217
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
- package/src/components/atoms/CustomIcon/index.js +0 -41
- package/src/components/atoms/CustomIcon/styles.js +0 -85
- package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
- package/src/components/atoms/IconFile/index.js +0 -119
- package/src/components/atoms/IconFile/styles.js +0 -67
- package/src/components/atoms/Image/Image.stories.js +0 -51
- package/src/components/atoms/Image/index.js +0 -55
- package/src/components/atoms/Image/styles.js +0 -34
- package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
- package/src/components/atoms/ImageLink/index.js +0 -57
- package/src/components/atoms/ImageLink/styles.js +0 -30
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
- package/src/components/atoms/ImagePreview/index.js +0 -191
- package/src/components/atoms/ImagePreview/styles.js +0 -77
- package/src/components/atoms/InputText/InputText.stories.js +0 -39
- package/src/components/atoms/InputText/index.js +0 -61
- package/src/components/atoms/InputText/styles.js +0 -89
- package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
- package/src/components/atoms/NotFound/index.js +0 -52
- package/src/components/atoms/NotFound/styles.js +0 -55
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
- package/src/components/atoms/SelectItemV2/index.js +0 -61
- package/src/components/atoms/SelectItemV2/styles.js +0 -90
- package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
- package/src/components/atoms/Tooltip/index.js +0 -59
- package/src/components/atoms/Tooltip/styles.js +0 -42
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
- package/src/components/molecules/ButtonDownloadFile/index.js +0 -111
- package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
- package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -103
- package/src/components/molecules/Dropdown/index.js +0 -150
- package/src/components/molecules/Dropdown/styles.js +0 -75
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -68
- package/src/components/molecules/ImageTooltip/index.js +0 -63
- package/src/components/molecules/ImageTooltip/styles.js +0 -18
- package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -115
- package/src/components/molecules/SelectV2/index.js +0 -357
- package/src/components/molecules/SelectV2/styles.js +0 -105
- package/src/components/molecules/SelectV2/test.js +0 -61
- package/src/components/molecules/SelectV2/test.stories.js +0 -10
- package/src/components/organisms/Chat/Chat.stories.js +0 -147
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +0 -141
- package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chat/ContainerItems/index.js +0 -550
- package/src/components/organisms/Chat/ContainerItems/styles.js +0 -328
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +0 -947
- package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
- package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chat/Footer/index.js +0 -669
- package/src/components/organisms/Chat/Footer/styles.js +0 -286
- package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chat/Header/index.js +0 -94
- package/src/components/organisms/Chat/Header/styles.js +0 -49
- package/src/components/organisms/Chat/index.js +0 -235
- package/src/components/organisms/Chat/styles.js +0 -42
- package/src/components/organisms/Modal/Modal.stories.js +0 -55
- package/src/components/organisms/Modal/index.js +0 -97
- package/src/components/organisms/Modal/styles.js +0 -103
- package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -16
- package/src/components/organisms/RangeCalendar/index.js +0 -121
- package/src/components/organisms/RangeCalendar/styles.js +0 -883
- package/src/global-files/handle_http.js +0 -231
- package/src/global-files/handle_userTech.js +0 -7
- package/src/global-files/utils.js +0 -322
|
@@ -148,7 +148,6 @@ var Footer = function Footer(props) {
|
|
|
148
148
|
var containerRef = (0, _react.useRef)();
|
|
149
149
|
var refInputTextMessage = (0, _react.useRef)();
|
|
150
150
|
(0, _react.useEffect)(function () {
|
|
151
|
-
//console.log("filesPreview: ", filesPreview.slice());
|
|
152
151
|
setTooltipFileName({
|
|
153
152
|
show: false,
|
|
154
153
|
fileName: ""
|
|
@@ -171,7 +170,7 @@ var Footer = function Footer(props) {
|
|
|
171
170
|
switch (_context.prev = _context.next) {
|
|
172
171
|
case 0:
|
|
173
172
|
if (!createItemsChat) {
|
|
174
|
-
_context.next =
|
|
173
|
+
_context.next = 87;
|
|
175
174
|
break;
|
|
176
175
|
}
|
|
177
176
|
|
|
@@ -195,9 +194,7 @@ var Footer = function Footer(props) {
|
|
|
195
194
|
|
|
196
195
|
customFiles = [];
|
|
197
196
|
_context.prev = 7;
|
|
198
|
-
|
|
199
|
-
fileUploadRequests = []; //console.log(dataChat);
|
|
200
|
-
|
|
197
|
+
fileUploadRequests = [];
|
|
201
198
|
_iterator = (0, _createForOfIteratorHelper2.default)(files);
|
|
202
199
|
_context.prev = 10;
|
|
203
200
|
|
|
@@ -272,8 +269,7 @@ var Footer = function Footer(props) {
|
|
|
272
269
|
fileKey += "".concat((0, _uuid.v4)(), "-").concat(today.getTime(), ".").concat((0, _utils.getFileExtension)(file.name));
|
|
273
270
|
} else {
|
|
274
271
|
fileKey = undefined;
|
|
275
|
-
} //
|
|
276
|
-
// enviar file a AWS
|
|
272
|
+
} // enviar file a AWS
|
|
277
273
|
|
|
278
274
|
|
|
279
275
|
customFiles.push({
|
|
@@ -316,7 +312,6 @@ var Footer = function Footer(props) {
|
|
|
316
312
|
|
|
317
313
|
case 49:
|
|
318
314
|
responseAWS = _context.sent;
|
|
319
|
-
console.log("responseAWS:", responseAWS);
|
|
320
315
|
responseAWS.forEach(function (responseFile, index) {
|
|
321
316
|
if (responseFile.status === "rejected") {
|
|
322
317
|
customFiles[index].errorAWS = responseFile.reason.message;
|
|
@@ -324,13 +319,12 @@ var Footer = function Footer(props) {
|
|
|
324
319
|
} else {
|
|
325
320
|
customFiles[index].uploaded = true;
|
|
326
321
|
}
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
_context.next = 59;
|
|
322
|
+
});
|
|
323
|
+
_context.next = 58;
|
|
330
324
|
break;
|
|
331
325
|
|
|
332
|
-
case
|
|
333
|
-
_context.prev =
|
|
326
|
+
case 53:
|
|
327
|
+
_context.prev = 53;
|
|
334
328
|
_context.t2 = _context["catch"](7);
|
|
335
329
|
disableSecondaryContainer(false);
|
|
336
330
|
setModalAlert({
|
|
@@ -341,21 +335,21 @@ var Footer = function Footer(props) {
|
|
|
341
335
|
});
|
|
342
336
|
return _context.abrupt("return");
|
|
343
337
|
|
|
344
|
-
case
|
|
338
|
+
case 58:
|
|
345
339
|
// obtener las keys de los files subidos
|
|
346
340
|
items = [];
|
|
347
341
|
index = 0;
|
|
348
342
|
|
|
349
|
-
case
|
|
343
|
+
case 60:
|
|
350
344
|
if (!(index < customFiles.length)) {
|
|
351
|
-
_context.next =
|
|
345
|
+
_context.next = 73;
|
|
352
346
|
break;
|
|
353
347
|
}
|
|
354
348
|
|
|
355
349
|
_file = customFiles[index];
|
|
356
350
|
|
|
357
351
|
if (!_file.uploaded) {
|
|
358
|
-
_context.next =
|
|
352
|
+
_context.next = 70;
|
|
359
353
|
break;
|
|
360
354
|
}
|
|
361
355
|
|
|
@@ -365,14 +359,14 @@ var Footer = function Footer(props) {
|
|
|
365
359
|
}; // caso imagen -> obtener width y height
|
|
366
360
|
|
|
367
361
|
if (!(_file.itemType === "img")) {
|
|
368
|
-
_context.next =
|
|
362
|
+
_context.next = 69;
|
|
369
363
|
break;
|
|
370
364
|
}
|
|
371
365
|
|
|
372
|
-
_context.next =
|
|
366
|
+
_context.next = 67;
|
|
373
367
|
return (0, _utils.getImageSize)(files[index]);
|
|
374
368
|
|
|
375
|
-
case
|
|
369
|
+
case 67:
|
|
376
370
|
imgSize = _context.sent;
|
|
377
371
|
|
|
378
372
|
if (imgSize) {
|
|
@@ -380,32 +374,31 @@ var Footer = function Footer(props) {
|
|
|
380
374
|
valueItem.height = imgSize.height;
|
|
381
375
|
}
|
|
382
376
|
|
|
383
|
-
case
|
|
384
|
-
console.log("valueItemFile:", valueItem);
|
|
377
|
+
case 69:
|
|
385
378
|
items.push({
|
|
386
379
|
type: _file.itemType,
|
|
387
380
|
value: JSON.stringify(valueItem)
|
|
388
381
|
});
|
|
389
382
|
|
|
390
|
-
case
|
|
383
|
+
case 70:
|
|
391
384
|
index++;
|
|
392
|
-
_context.next =
|
|
385
|
+
_context.next = 60;
|
|
393
386
|
break;
|
|
394
387
|
|
|
395
|
-
case
|
|
388
|
+
case 73:
|
|
396
389
|
if (!items.length) {
|
|
397
|
-
_context.next =
|
|
390
|
+
_context.next = 81;
|
|
398
391
|
break;
|
|
399
392
|
}
|
|
400
393
|
|
|
401
|
-
_context.next =
|
|
394
|
+
_context.next = 76;
|
|
402
395
|
return createItemsChat(items);
|
|
403
396
|
|
|
404
|
-
case
|
|
397
|
+
case 76:
|
|
405
398
|
responseError = _context.sent;
|
|
406
399
|
|
|
407
400
|
if (!responseError) {
|
|
408
|
-
_context.next =
|
|
401
|
+
_context.next = 81;
|
|
409
402
|
break;
|
|
410
403
|
}
|
|
411
404
|
|
|
@@ -418,7 +411,7 @@ var Footer = function Footer(props) {
|
|
|
418
411
|
disableSecondaryContainer(false);
|
|
419
412
|
return _context.abrupt("return");
|
|
420
413
|
|
|
421
|
-
case
|
|
414
|
+
case 81:
|
|
422
415
|
// obtener los errores de los files no subidos a AWS
|
|
423
416
|
failedFiles = [];
|
|
424
417
|
errorDetailFiles = "";
|
|
@@ -447,12 +440,12 @@ var Footer = function Footer(props) {
|
|
|
447
440
|
disableSecondaryContainer(false);
|
|
448
441
|
setFilesPreview(failedFiles);
|
|
449
442
|
|
|
450
|
-
case
|
|
443
|
+
case 87:
|
|
451
444
|
case "end":
|
|
452
445
|
return _context.stop();
|
|
453
446
|
}
|
|
454
447
|
}
|
|
455
|
-
}, _callee, null, [[7,
|
|
448
|
+
}, _callee, null, [[7, 53], [10, 41, 44, 47]]);
|
|
456
449
|
}));
|
|
457
450
|
|
|
458
451
|
return function sendFilesPreview() {
|
|
@@ -696,7 +689,6 @@ var Footer = function Footer(props) {
|
|
|
696
689
|
while (1) {
|
|
697
690
|
switch (_context7.prev = _context7.next) {
|
|
698
691
|
case 0:
|
|
699
|
-
//console.log("selected files: ", selectedFiles);
|
|
700
692
|
newFiles = filesPreview.slice();
|
|
701
693
|
newFiles = newFiles.concat(selectedFiles);
|
|
702
694
|
setFilesPreview(newFiles);
|
|
@@ -59,7 +59,6 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
59
59
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductNameHeader.ProductNameHeader, {
|
|
60
60
|
productName: (headerData === null || headerData === void 0 ? void 0 : (_headerData$article = headerData.article) === null || _headerData$article === void 0 ? void 0 : _headerData$article.name) || (headerData === null || headerData === void 0 ? void 0 : headerData.name),
|
|
61
61
|
statusType: (headerData === null || headerData === void 0 ? void 0 : headerData.version_status) || (headerData === null || headerData === void 0 ? void 0 : headerData.status) || (headerData === null || headerData === void 0 ? void 0 : headerData.article_status),
|
|
62
|
-
percentRequired: percent,
|
|
63
62
|
percent: percent === null || percent === void 0 ? void 0 : percent.toFixed(0),
|
|
64
63
|
priority: headerData === null || headerData === void 0 ? void 0 : headerData.prio,
|
|
65
64
|
date: new Date((headerData === null || headerData === void 0 ? void 0 : (_headerData$article2 = headerData.article) === null || _headerData$article2 === void 0 ? void 0 : _headerData$article2.timestamp) || (headerData === null || headerData === void 0 ? void 0 : headerData.timestamp)).toLocaleDateString()
|
|
@@ -183,12 +183,12 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
183
183
|
|
|
184
184
|
var getRetailers = /*#__PURE__*/function () {
|
|
185
185
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
186
|
-
var
|
|
186
|
+
var isRetailer, retailersResponse, parsed, retailers, retailersValid;
|
|
187
187
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
188
188
|
while (1) {
|
|
189
189
|
switch (_context2.prev = _context2.next) {
|
|
190
190
|
case 0:
|
|
191
|
-
|
|
191
|
+
isRetailer = user.is_retailer && company.retailers;
|
|
192
192
|
_context2.next = 3;
|
|
193
193
|
return _axios.default.get("".concat(process.env.REACT_APP_RETAILER_ENDPOINT), {
|
|
194
194
|
headers: {
|
|
@@ -199,12 +199,20 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
199
199
|
case 3:
|
|
200
200
|
retailersResponse = _context2.sent;
|
|
201
201
|
parsed = JSON.parse(retailersResponse.data.body).data;
|
|
202
|
-
retailers =
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
retailers = Object.values(parsed);
|
|
203
|
+
|
|
204
|
+
if (isRetailer) {
|
|
205
|
+
retailersValid = company.retailers.map(function (e) {
|
|
206
|
+
return e.id;
|
|
207
|
+
});
|
|
208
|
+
retailers = retailers.filter(function (value) {
|
|
209
|
+
return retailersValid.includes(value.id);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
205
213
|
setRetailers(retailers);
|
|
206
214
|
|
|
207
|
-
case
|
|
215
|
+
case 8:
|
|
208
216
|
case "end":
|
|
209
217
|
return _context2.stop();
|
|
210
218
|
}
|
|
@@ -218,14 +226,14 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
218
226
|
}();
|
|
219
227
|
|
|
220
228
|
var loadProductsByStatus = /*#__PURE__*/function () {
|
|
221
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(orderByStatus
|
|
222
|
-
var
|
|
229
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(orderByStatus) {
|
|
230
|
+
var isRetailer, isProvider, isCollaborator, _ref5, ordersBydate, ordersByStatus, _ordersByStatus$total, total, _ordersByStatus$R, R, _ordersByStatus$PA, PA, _ordersByStatus$Ex, Ex, _ordersByStatus$ACA, ACA, productsFinished, inProcess, metricsArray;
|
|
223
231
|
|
|
224
232
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
225
233
|
while (1) {
|
|
226
234
|
switch (_context3.prev = _context3.next) {
|
|
227
235
|
case 0:
|
|
228
|
-
|
|
236
|
+
isRetailer = user.is_retailer && company.retailers;
|
|
229
237
|
isProvider = !user.is_retailer && user.id_role === 0;
|
|
230
238
|
isCollaborator = user.id_role > 0;
|
|
231
239
|
_context3.next = 5;
|
|
@@ -247,7 +255,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
247
255
|
ordersByStatus = _ref5.ordersByStatus;
|
|
248
256
|
_ordersByStatus$total = ordersByStatus.total, total = _ordersByStatus$total === void 0 ? 0 : _ordersByStatus$total, _ordersByStatus$R = ordersByStatus.R, R = _ordersByStatus$R === void 0 ? 0 : _ordersByStatus$R, _ordersByStatus$PA = ordersByStatus.PA, PA = _ordersByStatus$PA === void 0 ? 0 : _ordersByStatus$PA, _ordersByStatus$Ex = ordersByStatus.Ex, Ex = _ordersByStatus$Ex === void 0 ? 0 : _ordersByStatus$Ex, _ordersByStatus$ACA = ordersByStatus.ACA, ACA = _ordersByStatus$ACA === void 0 ? 0 : _ordersByStatus$ACA;
|
|
249
257
|
productsFinished = 0;
|
|
250
|
-
if (
|
|
258
|
+
if (isRetailer) productsFinished = Ex;
|
|
251
259
|
if (isProvider) productsFinished = ACA;
|
|
252
260
|
if (isCollaborator) productsFinished = Ex + ACA;
|
|
253
261
|
inProcess = Object.keys(ordersByStatus).reduce(function (prev, curr) {
|
|
@@ -284,7 +292,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
284
292
|
}, _callee3);
|
|
285
293
|
}));
|
|
286
294
|
|
|
287
|
-
return function loadProductsByStatus(_x2
|
|
295
|
+
return function loadProductsByStatus(_x2) {
|
|
288
296
|
return _ref4.apply(this, arguments);
|
|
289
297
|
};
|
|
290
298
|
}();
|
|
@@ -447,7 +455,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
447
455
|
parameterArray: datesRange,
|
|
448
456
|
setParameterArray: setDatesRange,
|
|
449
457
|
isSingleSelect: true
|
|
450
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomSelect.CustomSelect, {
|
|
458
|
+
}), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomSelect.CustomSelect, {
|
|
451
459
|
showFilterString: true,
|
|
452
460
|
showSearchBar: true,
|
|
453
461
|
options: providers,
|
|
@@ -467,7 +475,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
467
475
|
parameterArray: categoryId,
|
|
468
476
|
setParameterArray: setCategoryId,
|
|
469
477
|
defaultOption: "Todas las categor\xEDas"
|
|
470
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomSelect.CustomSelect, {
|
|
478
|
+
}), (retailers === null || retailers === void 0 ? void 0 : retailers.length) > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomSelect.CustomSelect, {
|
|
471
479
|
showFilterString: true,
|
|
472
480
|
showSearchBar: true,
|
|
473
481
|
options: retailers,
|
|
@@ -31,73 +31,70 @@ ProviderProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": true,
|
|
32
32
|
Imágenes: true
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyOWY3YWY3Zi0yNmQ0LTRiMWItODZmZS0zOWY2ZTUyMDFhNzAiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2OTkyNzAyMSwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2Njk5MzA2MjEsImlhdCI6MTY2OTkyNzAyMSwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.NK6hVSiBksguboJ1m8yYqtDq19kzgE3GqYDEJHLUya_n_TsXriv6W1ypq7XiSo9zrqWcmHBpOoJQS7WbWzjGe__NlJEXjo8bykS8QBTTOiMrKxz1KzGRYJkwgG0axk-zVysUQH0_y-fbwgEgMPtd6qO46DB_KlFI_PEL1-uR5MJ9U0kNkS61gMbHwFQFs_DU-sS01NxjBsjUEp783rs1r-jm7TelZac1rGaFNUyi5vHdSozYzlnzfzGcuACZ0lHqvah2FHbDyurp-G_uhpUn5lNmcL4rVNh2lDd4TOnhJ3AtN1wGSmtErmhjmBHTvavh1ub9pklA1B9qjVuTRpYANw",
|
|
35
35
|
articleId: 238,
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
upc: "102852",
|
|
39
|
+
id_article: 3,
|
|
40
|
+
id_category: 2032,
|
|
41
|
+
name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
|
|
42
|
+
upc: "161157",
|
|
43
|
+
timestamp: "2022-11-14T16:02:47.000Z",
|
|
44
|
+
categoryName: "Decoración|Cortinas y Persianas|Cortinas",
|
|
46
45
|
version: 1,
|
|
47
46
|
retailersAvailable: [{
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
name: "The Home Depot Golden",
|
|
48
|
+
id: 58
|
|
50
49
|
}]
|
|
51
50
|
},
|
|
52
51
|
productToEdit: {
|
|
53
|
-
idCategory:
|
|
54
|
-
ArticleId:
|
|
52
|
+
idCategory: 2032,
|
|
53
|
+
ArticleId: 3,
|
|
55
54
|
product: [{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
upc: "102852",
|
|
55
|
+
id_article: 3,
|
|
56
|
+
id_category: 2032,
|
|
57
|
+
name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
|
|
58
|
+
upc: "161157",
|
|
59
|
+
timestamp: "2022-11-14T16:02:47.000Z",
|
|
60
|
+
categoryName: "Decoración|Cortinas y Persianas|Cortinas",
|
|
63
61
|
version: 1,
|
|
64
62
|
retailersAvailable: [{
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
name: "The Home Depot Golden",
|
|
64
|
+
id: 58
|
|
67
65
|
}]
|
|
68
66
|
}]
|
|
69
67
|
},
|
|
70
68
|
location: {
|
|
71
69
|
state: {
|
|
72
|
-
origin: "Contentoh"
|
|
73
|
-
withChat: true
|
|
70
|
+
origin: "Contentoh"
|
|
74
71
|
}
|
|
75
72
|
},
|
|
76
73
|
user: {
|
|
77
|
-
id_user:
|
|
78
|
-
name: "
|
|
79
|
-
last_name: "
|
|
80
|
-
email: "
|
|
81
|
-
position: "
|
|
82
|
-
telephone: "+
|
|
74
|
+
id_user: 28,
|
|
75
|
+
name: "Ismael",
|
|
76
|
+
last_name: "López",
|
|
77
|
+
email: "ilopez@contentoh.com",
|
|
78
|
+
position: "Test States",
|
|
79
|
+
telephone: "+523111366336",
|
|
83
80
|
country: "México",
|
|
84
|
-
id_company:
|
|
85
|
-
id_cognito: "
|
|
81
|
+
id_company: 1,
|
|
82
|
+
id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
|
|
86
83
|
birth_Date: null,
|
|
87
|
-
about_me:
|
|
88
|
-
zip_code:
|
|
89
|
-
address:
|
|
90
|
-
job:
|
|
91
|
-
id_stripe:
|
|
84
|
+
about_me: "",
|
|
85
|
+
zip_code: "",
|
|
86
|
+
address: "",
|
|
87
|
+
job: "",
|
|
88
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
92
89
|
id_role: 0,
|
|
93
90
|
active: 1,
|
|
94
91
|
is_retailer: 0,
|
|
95
|
-
email_notify:
|
|
96
|
-
is_user_tech:
|
|
92
|
+
email_notify: 0,
|
|
93
|
+
is_user_tech: "AS",
|
|
97
94
|
membership: {
|
|
98
|
-
id:
|
|
99
|
-
start_date: "
|
|
100
|
-
end_date: "
|
|
95
|
+
id: 76,
|
|
96
|
+
start_date: "2022-01-18T17:25:35.000Z",
|
|
97
|
+
end_date: "2023-01-18T17:25:35.000Z",
|
|
101
98
|
planID: 8,
|
|
102
99
|
plan: "prod_KtlhECVSFG2iro",
|
|
103
100
|
name: "Plan Pro",
|
|
@@ -105,33 +102,21 @@ ProviderProductEditionDefault.args = {
|
|
|
105
102
|
products_limit: "5000",
|
|
106
103
|
type: "Enterprise"
|
|
107
104
|
},
|
|
108
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
105
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1669927021851"
|
|
109
106
|
},
|
|
110
107
|
company: {
|
|
111
|
-
id_company:
|
|
112
|
-
trade_name: "
|
|
113
|
-
company_name: "
|
|
114
|
-
rfc: "
|
|
115
|
-
adress: "
|
|
116
|
-
about_company:
|
|
117
|
-
telephone:
|
|
118
|
-
web_site:
|
|
119
|
-
zip_code:
|
|
108
|
+
id_company: 1,
|
|
109
|
+
trade_name: "GRUPO BRAHMA",
|
|
110
|
+
company_name: "GRUPO BRAHMA",
|
|
111
|
+
rfc: "XAXX010101000",
|
|
112
|
+
adress: "AA",
|
|
113
|
+
about_company: "",
|
|
114
|
+
telephone: "",
|
|
115
|
+
web_site: "",
|
|
116
|
+
zip_code: "",
|
|
120
117
|
email: null,
|
|
121
|
-
social_link:
|
|
122
|
-
is_retailer: 0
|
|
123
|
-
financedRetailers: [{
|
|
124
|
-
id: 68,
|
|
125
|
-
name: "The Home Depot Merchants",
|
|
126
|
-
country: "México",
|
|
127
|
-
id_region: 1,
|
|
128
|
-
active: 1
|
|
129
|
-
}],
|
|
130
|
-
retailers: [{
|
|
131
|
-
id: null,
|
|
132
|
-
name: null,
|
|
133
|
-
country: null
|
|
134
|
-
}]
|
|
118
|
+
social_link: "",
|
|
119
|
+
is_retailer: 0
|
|
135
120
|
},
|
|
136
121
|
showSurvey: function showSurvey(v) {
|
|
137
122
|
return v && alert("se muestra");
|
|
@@ -212,7 +212,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
212
212
|
});
|
|
213
213
|
|
|
214
214
|
var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
215
|
-
var _product$retailers, _product$retailersAva, _location$state,
|
|
215
|
+
var _product$retailers, _product$retailersAva, _location$state, _datasheets$, _datasheets$$data;
|
|
216
216
|
|
|
217
217
|
var tabsSections = _ref.tabsSections,
|
|
218
218
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -227,8 +227,7 @@ 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
|
|
231
|
-
withChat = _ref.withChat;
|
|
230
|
+
company = _ref.company;
|
|
232
231
|
|
|
233
232
|
var _useState = (0, _react.useState)("Descripción"),
|
|
234
233
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -566,7 +565,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
566
565
|
(0, _data.getPercentage)({
|
|
567
566
|
data: [product]
|
|
568
567
|
}).then(function (res) {
|
|
569
|
-
return setPercentages(res
|
|
568
|
+
return setPercentages(res);
|
|
570
569
|
});
|
|
571
570
|
setLoading(false);
|
|
572
571
|
|
|
@@ -721,17 +720,17 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
721
720
|
loadAssignations(product);
|
|
722
721
|
}, [userGroups]);
|
|
723
722
|
(0, _react.useEffect)(function () {
|
|
724
|
-
var
|
|
723
|
+
var _retailers$;
|
|
725
724
|
|
|
726
725
|
var productTemp = product;
|
|
727
726
|
var retailers = (productTemp === null || productTemp === void 0 ? void 0 : productTemp.retailersAvailable) || (productTemp === null || productTemp === void 0 ? void 0 : productTemp.retailers);
|
|
727
|
+
retailers === null || retailers === void 0 ? void 0 : retailers.forEach(function (retailer) {
|
|
728
|
+
var _percentages$find;
|
|
728
729
|
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
}
|
|
734
|
-
|
|
730
|
+
retailer["percentage"] = percentages === null || percentages === void 0 ? void 0 : (_percentages$find = percentages.find(function (percent) {
|
|
731
|
+
return (retailer === null || retailer === void 0 ? void 0 : retailer.id) === (percent === null || percent === void 0 ? void 0 : percent.id_retailer);
|
|
732
|
+
})) === null || _percentages$find === void 0 ? void 0 : _percentages$find.percentage;
|
|
733
|
+
});
|
|
735
734
|
setProduct(productTemp);
|
|
736
735
|
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
737
736
|
}, [percentages]);
|
|
@@ -1681,10 +1680,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1681
1680
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
1682
1681
|
headerTop: headerTop,
|
|
1683
1682
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
1684
|
-
setHeaderTop: setHeaderTop
|
|
1685
|
-
withChat: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.withChat,
|
|
1686
|
-
productSelected: productSelected,
|
|
1687
|
-
token: token
|
|
1683
|
+
setHeaderTop: setHeaderTop
|
|
1688
1684
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1689
1685
|
className: "data-container",
|
|
1690
1686
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|