contentoh-components-library 21.4.15 → 21.4.17
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 +1 -5
- package/.env.production +1 -3
- package/dist/components/atoms/Avatar/index.js +2 -3
- package/dist/components/atoms/Card/index.js +5 -46
- package/dist/components/atoms/Card/styles.js +1 -3
- package/dist/components/atoms/CheckBox/index.js +2 -7
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +120 -88
- package/dist/components/pages/ProviderProductEdition/index.js +200 -216
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +52 -56
- package/dist/components/pages/RetailerProductEdition/index.js +300 -318
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/index.js +52 -247
- package/package.json +1 -4
- package/src/components/atoms/Avatar/index.js +2 -8
- package/src/components/atoms/Card/index.js +2 -35
- package/src/components/atoms/Card/styles.js +5 -41
- package/src/components/atoms/CheckBox/index.js +1 -4
- package/src/components/atoms/CheckBox/styles.js +0 -2
- package/src/components/atoms/InputFormatter/styles.js +1 -2
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/TagAndInput/index.js +8 -10
- package/src/components/organisms/Chat/Chat.stories.js +7 -27
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
- package/src/components/organisms/Chat/ContentChat/index.js +12 -88
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +4 -46
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +127 -95
- package/src/components/pages/ProviderProductEdition/index.js +129 -135
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +52 -55
- package/src/components/pages/RetailerProductEdition/index.js +136 -124
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/index.js +0 -16
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
- package/src/components/atoms/ImageCarousel/index.js +0 -103
- package/src/components/atoms/ImageCarousel/styles.js +0 -79
- package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
- package/src/components/atoms/PercentTag/index.js +0 -9
- package/src/components/atoms/PercentTag/styles.js +0 -69
- package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
- package/src/components/atoms/RatingStars/index.js +0 -31
- package/src/components/atoms/RatingStars/styles.js +0 -28
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
- package/src/components/atoms/RetailerCatalog/index.js +0 -49
- package/src/components/atoms/RetailerCatalog/styles.js +0 -30
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
- package/src/components/atoms/RetailerOption/index.js +0 -53
- package/src/components/atoms/RetailerOption/styles.js +0 -41
- package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
- package/src/components/atoms/RetailersList/index.js +0 -20
- package/src/components/atoms/RetailersList/styles.js +0 -19
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
- package/src/components/atoms/UserCatalog/index.js +0 -100
- package/src/components/atoms/UserCatalog/styles.js +0 -24
- package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
- package/src/components/atoms/UserOption/index.js +0 -95
- package/src/components/atoms/UserOption/styles.js +0 -61
- package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
- package/src/components/atoms/UserSelector/index.js +0 -86
- package/src/components/atoms/UserSelector/styles.js +0 -55
- package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
- package/src/components/molecules/GridItem/index.js +0 -105
- package/src/components/molecules/GridItem/styles.js +0 -104
- package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
- package/src/components/molecules/HeaderItem/index.js +0 -26
- package/src/components/molecules/HeaderItem/styles.js +0 -27
- package/src/components/molecules/RowItem/ColumnItem.js +0 -9
- package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
- package/src/components/molecules/RowItem/index.js +0 -45
- package/src/components/molecules/RowItem/styles.js +0 -40
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
- package/src/components/molecules/StripeCardForm/index.js +0 -42
- package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
- package/src/components/molecules/StripeCardForm/styles.js +0 -73
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
- package/src/components/molecules/StripeCardSelector/index.js +0 -44
- package/src/components/molecules/StripeCardSelector/styles.js +0 -4
- package/src/components/molecules/StripeCardSelector/utils.js +0 -17
- package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
- package/src/components/organisms/GridProducts/index.js +0 -50
- package/src/components/organisms/GridProducts/styles.js +0 -14
- package/src/components/organisms/GridProducts/utils.js +0 -111
- package/src/components/organisms/PanelLayout/PanelLayout.stories.js +0 -63
- package/src/components/organisms/PanelLayout/index.js +0 -11
- package/src/components/organisms/PanelLayout/styles.js +0 -33
- package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
- package/src/components/organisms/SideModal/index.js +0 -50
- package/src/components/organisms/SideModal/styles.js +0 -30
|
@@ -93,12 +93,6 @@ var _VersionSelector = require("../../organisms/VersionSelector");
|
|
|
93
93
|
|
|
94
94
|
var _customHooks = require("../../../global-files/customHooks");
|
|
95
95
|
|
|
96
|
-
var _utils = require("../RetailerProductEdition/utils");
|
|
97
|
-
|
|
98
|
-
var _Modal = require("../../organisms/Modal");
|
|
99
|
-
|
|
100
|
-
var _ButtonV = require("../../atoms/ButtonV2");
|
|
101
|
-
|
|
102
96
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
103
97
|
|
|
104
98
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -212,7 +206,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
212
206
|
});
|
|
213
207
|
|
|
214
208
|
var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
215
|
-
var _product$retailers, _product$retailersAva, _location$state4, _location$state5,
|
|
209
|
+
var _product$retailers, _product$retailersAva, _location$state4, _location$state5, _datasheets$, _datasheets$$data;
|
|
216
210
|
|
|
217
211
|
var tabsSections = _ref.tabsSections,
|
|
218
212
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -452,26 +446,21 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
452
446
|
validatedAll = _useState60[0],
|
|
453
447
|
setValidatedAll = _useState60[1];
|
|
454
448
|
|
|
455
|
-
var _useState61 = (0, _react.useState)(
|
|
456
|
-
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
457
|
-
showRejectModal = _useState62[0],
|
|
458
|
-
setShowRejectModal = _useState62[1];
|
|
459
|
-
|
|
460
|
-
var _useState63 = (0, _react.useState)({
|
|
449
|
+
var _useState61 = (0, _react.useState)({
|
|
461
450
|
"Ficha técnica": null,
|
|
462
451
|
Descripción: null,
|
|
463
452
|
Imágenes: null
|
|
464
453
|
}),
|
|
465
|
-
|
|
466
|
-
origin =
|
|
467
|
-
setOrigin =
|
|
454
|
+
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
455
|
+
origin = _useState62[0],
|
|
456
|
+
setOrigin = _useState62[1];
|
|
468
457
|
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
inCart =
|
|
472
|
-
setInCart =
|
|
458
|
+
var _useState63 = (0, _react.useState)(false),
|
|
459
|
+
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
460
|
+
inCart = _useState64[0],
|
|
461
|
+
setInCart = _useState64[1];
|
|
473
462
|
|
|
474
|
-
var
|
|
463
|
+
var _useState65 = (0, _react.useState)({
|
|
475
464
|
message: "¿Estás seguro de continuar?",
|
|
476
465
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
477
466
|
button1: {
|
|
@@ -486,34 +475,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
486
475
|
},
|
|
487
476
|
img: _defaultProfileImage.default
|
|
488
477
|
}),
|
|
478
|
+
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
479
|
+
dataGenericModal = _useState66[0],
|
|
480
|
+
setDataGenericModal = _useState66[1];
|
|
481
|
+
|
|
482
|
+
var _useState67 = (0, _react.useState)(null),
|
|
489
483
|
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
490
|
-
|
|
491
|
-
|
|
484
|
+
socketType = _useState68[0],
|
|
485
|
+
setSocketType = _useState68[1];
|
|
492
486
|
|
|
493
|
-
var _useState69 = (0, _react.useState)(
|
|
487
|
+
var _useState69 = (0, _react.useState)(loading),
|
|
494
488
|
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
495
|
-
|
|
496
|
-
|
|
489
|
+
saving = _useState70[0],
|
|
490
|
+
setSaving = _useState70[1];
|
|
497
491
|
|
|
498
|
-
var _useState71 = (0, _react.useState)(
|
|
492
|
+
var _useState71 = (0, _react.useState)(product.statusByRetailer),
|
|
499
493
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
var _useState73 = (0, _react.useState)(product.statusByRetailer),
|
|
504
|
-
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
505
|
-
retailerStatus = _useState74[0],
|
|
506
|
-
setRetailerStatus = _useState74[1];
|
|
494
|
+
retailerStatus = _useState72[0],
|
|
495
|
+
setRetailerStatus = _useState72[1];
|
|
507
496
|
|
|
508
497
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
509
498
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
510
499
|
showVersionSelector = _useCloseModal2[0],
|
|
511
500
|
setShowVersionSelector = _useCloseModal2[1];
|
|
512
501
|
|
|
513
|
-
var
|
|
514
|
-
|
|
515
|
-
globalModal =
|
|
516
|
-
setGlobalModal =
|
|
502
|
+
var _useState73 = (0, _react.useState)(),
|
|
503
|
+
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
504
|
+
globalModal = _useState74[0],
|
|
505
|
+
setGlobalModal = _useState74[1];
|
|
517
506
|
|
|
518
507
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
519
508
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -685,6 +674,30 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
685
674
|
});
|
|
686
675
|
|
|
687
676
|
switch (type) {
|
|
677
|
+
case "error":
|
|
678
|
+
setGlobalModal({
|
|
679
|
+
message: "".concat(activeTab, " rechazada"),
|
|
680
|
+
detail: "Agrega tu comentarios para enviar el rechazo",
|
|
681
|
+
img: _errorModal.default,
|
|
682
|
+
textArea: true,
|
|
683
|
+
button1: {
|
|
684
|
+
name: "Enviar",
|
|
685
|
+
action: function action(e) {
|
|
686
|
+
var textArea = document.querySelector("#area");
|
|
687
|
+
|
|
688
|
+
if (textArea.value) {
|
|
689
|
+
textArea.style.border = "none";
|
|
690
|
+
createComment(e, textArea.value);
|
|
691
|
+
showGlobalModal("commentsSent");
|
|
692
|
+
validatedAll ? validateAll("R") : sendEvaluation("R");
|
|
693
|
+
} else {
|
|
694
|
+
textArea.style.border = "2px solid red";
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
break;
|
|
700
|
+
|
|
688
701
|
case "generic":
|
|
689
702
|
setGlobalModal(dataGenericModal);
|
|
690
703
|
break;
|
|
@@ -956,7 +969,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
956
969
|
setServicesData(parsedResponse);
|
|
957
970
|
|
|
958
971
|
case 12:
|
|
959
|
-
|
|
972
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
960
973
|
|
|
961
974
|
case 13:
|
|
962
975
|
case "end":
|
|
@@ -1074,7 +1087,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1074
1087
|
}
|
|
1075
1088
|
|
|
1076
1089
|
setProduct(productTemp);
|
|
1077
|
-
|
|
1090
|
+
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1078
1091
|
}, [percentages]);
|
|
1079
1092
|
|
|
1080
1093
|
var loadInputs = function loadInputs() {
|
|
@@ -1178,30 +1191,29 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1178
1191
|
res = _context11.sent;
|
|
1179
1192
|
|
|
1180
1193
|
if (!(res.data.statusCode === 200)) {
|
|
1181
|
-
_context11.next =
|
|
1194
|
+
_context11.next = 11;
|
|
1182
1195
|
break;
|
|
1183
1196
|
}
|
|
1184
1197
|
|
|
1185
|
-
setUpdatedDescriptions([]);
|
|
1186
1198
|
setMessage("Descripciones guardadas con éxito");
|
|
1187
|
-
_context11.next =
|
|
1199
|
+
_context11.next = 11;
|
|
1188
1200
|
return loadData();
|
|
1189
1201
|
|
|
1190
|
-
case
|
|
1191
|
-
_context11.next =
|
|
1202
|
+
case 11:
|
|
1203
|
+
_context11.next = 16;
|
|
1192
1204
|
break;
|
|
1193
1205
|
|
|
1194
|
-
case
|
|
1195
|
-
_context11.prev =
|
|
1206
|
+
case 13:
|
|
1207
|
+
_context11.prev = 13;
|
|
1196
1208
|
_context11.t0 = _context11["catch"](3);
|
|
1197
1209
|
console.log(_context11.t0);
|
|
1198
1210
|
|
|
1199
|
-
case
|
|
1211
|
+
case 16:
|
|
1200
1212
|
case "end":
|
|
1201
1213
|
return _context11.stop();
|
|
1202
1214
|
}
|
|
1203
1215
|
}
|
|
1204
|
-
}, _callee11, null, [[3,
|
|
1216
|
+
}, _callee11, null, [[3, 13]]);
|
|
1205
1217
|
}));
|
|
1206
1218
|
|
|
1207
1219
|
return function saveDescriptions() {
|
|
@@ -1234,30 +1246,29 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1234
1246
|
res = _context12.sent;
|
|
1235
1247
|
|
|
1236
1248
|
if (!(res.data.statusCode === 200)) {
|
|
1237
|
-
_context12.next =
|
|
1249
|
+
_context12.next = 11;
|
|
1238
1250
|
break;
|
|
1239
1251
|
}
|
|
1240
1252
|
|
|
1241
|
-
setUpdatedDatasheets([]);
|
|
1242
1253
|
setMessage("Fichas técnicas guardadas");
|
|
1243
|
-
_context12.next =
|
|
1254
|
+
_context12.next = 11;
|
|
1244
1255
|
return loadData();
|
|
1245
1256
|
|
|
1246
|
-
case
|
|
1247
|
-
_context12.next =
|
|
1257
|
+
case 11:
|
|
1258
|
+
_context12.next = 16;
|
|
1248
1259
|
break;
|
|
1249
1260
|
|
|
1250
|
-
case
|
|
1251
|
-
_context12.prev =
|
|
1261
|
+
case 13:
|
|
1262
|
+
_context12.prev = 13;
|
|
1252
1263
|
_context12.t0 = _context12["catch"](3);
|
|
1253
1264
|
console.log(_context12.t0);
|
|
1254
1265
|
|
|
1255
|
-
case
|
|
1266
|
+
case 16:
|
|
1256
1267
|
case "end":
|
|
1257
1268
|
return _context12.stop();
|
|
1258
1269
|
}
|
|
1259
1270
|
}
|
|
1260
|
-
}, _callee12, null, [[3,
|
|
1271
|
+
}, _callee12, null, [[3, 13]]);
|
|
1261
1272
|
}));
|
|
1262
1273
|
|
|
1263
1274
|
return function saveDatasheets() {
|
|
@@ -1391,7 +1402,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1391
1402
|
switch (_context14.prev = _context14.next) {
|
|
1392
1403
|
case 0:
|
|
1393
1404
|
if (!imagesUploaded) {
|
|
1394
|
-
_context14.next =
|
|
1405
|
+
_context14.next = 16;
|
|
1395
1406
|
break;
|
|
1396
1407
|
}
|
|
1397
1408
|
|
|
@@ -1415,31 +1426,30 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1415
1426
|
res = _context14.sent;
|
|
1416
1427
|
|
|
1417
1428
|
if (!(res.data.statusCode === 200)) {
|
|
1418
|
-
_context14.next =
|
|
1429
|
+
_context14.next = 11;
|
|
1419
1430
|
break;
|
|
1420
1431
|
}
|
|
1421
1432
|
|
|
1422
|
-
setImages({});
|
|
1423
1433
|
setMessage("Imágenes guardadas con éxito");
|
|
1424
1434
|
sessionStorage.removeItem("imagesList");
|
|
1425
|
-
_context14.next =
|
|
1435
|
+
_context14.next = 11;
|
|
1426
1436
|
return loadData();
|
|
1427
1437
|
|
|
1428
|
-
case
|
|
1429
|
-
_context14.next =
|
|
1438
|
+
case 11:
|
|
1439
|
+
_context14.next = 16;
|
|
1430
1440
|
break;
|
|
1431
1441
|
|
|
1432
|
-
case
|
|
1433
|
-
_context14.prev =
|
|
1442
|
+
case 13:
|
|
1443
|
+
_context14.prev = 13;
|
|
1434
1444
|
_context14.t0 = _context14["catch"](2);
|
|
1435
1445
|
console.log(_context14.t0);
|
|
1436
1446
|
|
|
1437
|
-
case
|
|
1447
|
+
case 16:
|
|
1438
1448
|
case "end":
|
|
1439
1449
|
return _context14.stop();
|
|
1440
1450
|
}
|
|
1441
1451
|
}
|
|
1442
|
-
}, _callee14, null, [[2,
|
|
1452
|
+
}, _callee14, null, [[2, 13]]);
|
|
1443
1453
|
})), [dataImages, imagesUploaded]);
|
|
1444
1454
|
|
|
1445
1455
|
var getConcept = function getConcept(tab) {
|
|
@@ -1456,33 +1466,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1456
1466
|
};
|
|
1457
1467
|
|
|
1458
1468
|
var createComment = /*#__PURE__*/function () {
|
|
1459
|
-
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1460
|
-
var
|
|
1461
|
-
retailerId,
|
|
1462
|
-
data,
|
|
1463
|
-
_args15 = arguments;
|
|
1469
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
|
|
1470
|
+
var concept, data;
|
|
1464
1471
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1465
1472
|
while (1) {
|
|
1466
1473
|
switch (_context15.prev = _context15.next) {
|
|
1467
1474
|
case 0:
|
|
1468
|
-
|
|
1469
|
-
|
|
1475
|
+
concept = "";
|
|
1476
|
+
_context15.t0 = activeTab;
|
|
1477
|
+
_context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
|
|
1478
|
+
break;
|
|
1479
|
+
|
|
1480
|
+
case 4:
|
|
1481
|
+
concept = "datasheet";
|
|
1482
|
+
return _context15.abrupt("break", 10);
|
|
1483
|
+
|
|
1484
|
+
case 6:
|
|
1485
|
+
concept = "images";
|
|
1486
|
+
return _context15.abrupt("break", 10);
|
|
1487
|
+
|
|
1488
|
+
case 8:
|
|
1489
|
+
concept = "description";
|
|
1490
|
+
return _context15.abrupt("break", 10);
|
|
1491
|
+
|
|
1492
|
+
case 10:
|
|
1470
1493
|
data = {
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1494
|
+
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1495
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1496
|
+
message: body,
|
|
1497
|
+
concept: concept,
|
|
1498
|
+
version: version
|
|
1499
|
+
};
|
|
1500
|
+
_context15.next = 13;
|
|
1501
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1502
|
+
headers: {
|
|
1479
1503
|
Authorization: token
|
|
1480
1504
|
}
|
|
1481
|
-
};
|
|
1482
|
-
setMessage("");
|
|
1483
|
-
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1505
|
+
});
|
|
1484
1506
|
|
|
1485
|
-
case
|
|
1507
|
+
case 13:
|
|
1486
1508
|
case "end":
|
|
1487
1509
|
return _context15.stop();
|
|
1488
1510
|
}
|
|
@@ -1490,7 +1512,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1490
1512
|
}, _callee15);
|
|
1491
1513
|
}));
|
|
1492
1514
|
|
|
1493
|
-
return function createComment() {
|
|
1515
|
+
return function createComment(_x4, _x5, _x6) {
|
|
1494
1516
|
return _ref13.apply(this, arguments);
|
|
1495
1517
|
};
|
|
1496
1518
|
}();
|
|
@@ -1589,7 +1611,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1589
1611
|
}, _callee17);
|
|
1590
1612
|
}));
|
|
1591
1613
|
|
|
1592
|
-
return function setAssignation(
|
|
1614
|
+
return function setAssignation(_x7, _x8) {
|
|
1593
1615
|
return _ref15.apply(this, arguments);
|
|
1594
1616
|
};
|
|
1595
1617
|
}();
|
|
@@ -1677,7 +1699,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1677
1699
|
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1678
1700
|
var _productTemp$id_order2;
|
|
1679
1701
|
|
|
1680
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus,
|
|
1702
|
+
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1681
1703
|
|
|
1682
1704
|
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1683
1705
|
while (1) {
|
|
@@ -1739,77 +1761,53 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1739
1761
|
res = _context18.sent;
|
|
1740
1762
|
|
|
1741
1763
|
case 30:
|
|
1742
|
-
if (
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
items: [{
|
|
1754
|
-
type: "status",
|
|
1755
|
-
value: _message
|
|
1756
|
-
}],
|
|
1757
|
-
retailerId: activeRetailer.id,
|
|
1758
|
-
status: product.status || productEdit.product.status
|
|
1759
|
-
},
|
|
1760
|
-
paramsHeader: {
|
|
1761
|
-
Authorization: token
|
|
1764
|
+
if (res.data.statusCode === 200) {
|
|
1765
|
+
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1766
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1767
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1768
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1769
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1770
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1771
|
+
|
|
1772
|
+
if (newServiceStatus) {
|
|
1773
|
+
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1774
|
+
productTemp["".concat(concept, "_status")] = status;
|
|
1762
1775
|
}
|
|
1763
|
-
};
|
|
1764
|
-
_context18.next = 36;
|
|
1765
|
-
return (0, _utils.sendMessage)(messageData);
|
|
1766
|
-
|
|
1767
|
-
case 36:
|
|
1768
|
-
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1769
|
-
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1770
|
-
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1771
|
-
setRetailerStatus(retailerStatusCopy);
|
|
1772
|
-
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1773
1776
|
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
+
setProduct(productTemp);
|
|
1778
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1779
|
+
setOrigin(function (prev) {
|
|
1780
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1781
|
+
});
|
|
1777
1782
|
}
|
|
1778
1783
|
|
|
1779
|
-
|
|
1780
|
-
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1781
|
-
setOrigin(function (prev) {
|
|
1782
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1783
|
-
});
|
|
1784
|
-
|
|
1785
|
-
case 45:
|
|
1786
|
-
_context18.next = 50;
|
|
1784
|
+
_context18.next = 36;
|
|
1787
1785
|
break;
|
|
1788
1786
|
|
|
1789
|
-
case
|
|
1790
|
-
_context18.prev =
|
|
1787
|
+
case 33:
|
|
1788
|
+
_context18.prev = 33;
|
|
1791
1789
|
_context18.t0 = _context18["catch"](9);
|
|
1792
1790
|
console.log(_context18.t0);
|
|
1793
1791
|
|
|
1794
|
-
case
|
|
1792
|
+
case 36:
|
|
1795
1793
|
loadData();
|
|
1796
1794
|
|
|
1797
|
-
case
|
|
1795
|
+
case 37:
|
|
1798
1796
|
case "end":
|
|
1799
1797
|
return _context18.stop();
|
|
1800
1798
|
}
|
|
1801
1799
|
}
|
|
1802
|
-
}, _callee18, null, [[9,
|
|
1800
|
+
}, _callee18, null, [[9, 33]]);
|
|
1803
1801
|
}));
|
|
1804
1802
|
|
|
1805
|
-
return function sendEvaluation(
|
|
1803
|
+
return function sendEvaluation(_x9) {
|
|
1806
1804
|
return _ref16.apply(this, arguments);
|
|
1807
1805
|
};
|
|
1808
1806
|
}();
|
|
1809
1807
|
|
|
1810
1808
|
var validateAll = /*#__PURE__*/function () {
|
|
1811
1809
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1812
|
-
var _product$id_order2, evaluationArray, conceptArray, dataGeneral,
|
|
1810
|
+
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1813
1811
|
|
|
1814
1812
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1815
1813
|
while (1) {
|
|
@@ -1825,7 +1823,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1825
1823
|
result: result,
|
|
1826
1824
|
isAproved: result === "A"
|
|
1827
1825
|
};
|
|
1828
|
-
messages = [];
|
|
1829
1826
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1830
1827
|
var service = ret.service,
|
|
1831
1828
|
id_retailer = ret.id_retailer;
|
|
@@ -1840,20 +1837,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1840
1837
|
Authorization: token
|
|
1841
1838
|
}
|
|
1842
1839
|
}));
|
|
1843
|
-
|
|
1844
|
-
if (product["".concat(ret.service, "_status")] !== "NS") {
|
|
1845
|
-
var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
|
|
1846
|
-
|
|
1847
|
-
messages.push(createComment([{
|
|
1848
|
-
type: "status",
|
|
1849
|
-
value: _message2
|
|
1850
|
-
}], ret.id_retailer));
|
|
1851
|
-
}
|
|
1852
1840
|
});
|
|
1853
|
-
_context19.next =
|
|
1841
|
+
_context19.next = 8;
|
|
1854
1842
|
return Promise.all(evaluationArray);
|
|
1855
1843
|
|
|
1856
|
-
case
|
|
1844
|
+
case 8:
|
|
1857
1845
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1858
1846
|
productTemp = product;
|
|
1859
1847
|
status = "".concat(result).concat(userType);
|
|
@@ -1883,31 +1871,27 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1883
1871
|
idCategory: productTemp.article.id_category,
|
|
1884
1872
|
product: productTemp
|
|
1885
1873
|
}));
|
|
1886
|
-
_context19.next =
|
|
1887
|
-
return Promise.all(messages);
|
|
1888
|
-
|
|
1889
|
-
case 26:
|
|
1890
|
-
_context19.next = 28;
|
|
1874
|
+
_context19.next = 25;
|
|
1891
1875
|
return loadData();
|
|
1892
1876
|
|
|
1893
|
-
case
|
|
1894
|
-
_context19.next =
|
|
1877
|
+
case 25:
|
|
1878
|
+
_context19.next = 30;
|
|
1895
1879
|
break;
|
|
1896
1880
|
|
|
1897
|
-
case
|
|
1898
|
-
_context19.prev =
|
|
1881
|
+
case 27:
|
|
1882
|
+
_context19.prev = 27;
|
|
1899
1883
|
_context19.t0 = _context19["catch"](0);
|
|
1900
1884
|
console.log(_context19.t0);
|
|
1901
1885
|
|
|
1902
|
-
case
|
|
1886
|
+
case 30:
|
|
1903
1887
|
case "end":
|
|
1904
1888
|
return _context19.stop();
|
|
1905
1889
|
}
|
|
1906
1890
|
}
|
|
1907
|
-
}, _callee19, null, [[0,
|
|
1891
|
+
}, _callee19, null, [[0, 27]]);
|
|
1908
1892
|
}));
|
|
1909
1893
|
|
|
1910
|
-
return function validateAll(
|
|
1894
|
+
return function validateAll(_x10) {
|
|
1911
1895
|
return _ref17.apply(this, arguments);
|
|
1912
1896
|
};
|
|
1913
1897
|
}();
|
|
@@ -1954,7 +1938,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1954
1938
|
}, _callee20);
|
|
1955
1939
|
}));
|
|
1956
1940
|
|
|
1957
|
-
return function evaluationToRetailer(
|
|
1941
|
+
return function evaluationToRetailer(_x11) {
|
|
1958
1942
|
return _ref18.apply(this, arguments);
|
|
1959
1943
|
};
|
|
1960
1944
|
}();
|
|
@@ -2042,7 +2026,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2042
2026
|
return;
|
|
2043
2027
|
} else if (user.is_retailer) {
|
|
2044
2028
|
if (product.id_order || product.orderId) {
|
|
2045
|
-
|
|
2029
|
+
setValidatedAll(true);
|
|
2030
|
+
showGlobalModal("error");
|
|
2046
2031
|
} else {
|
|
2047
2032
|
setDataGenericModal(function (prev) {
|
|
2048
2033
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2057,7 +2042,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2057
2042
|
showGlobalModal("generic");
|
|
2058
2043
|
}
|
|
2059
2044
|
} else {
|
|
2060
|
-
|
|
2045
|
+
setValidatedAll(true);
|
|
2046
|
+
showGlobalModal("error");
|
|
2061
2047
|
}
|
|
2062
2048
|
}
|
|
2063
2049
|
};
|
|
@@ -2067,7 +2053,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2067
2053
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2068
2054
|
setHeaderTop: setHeaderTop,
|
|
2069
2055
|
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
2070
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
2071
2056
|
productSelected: productSelected,
|
|
2072
2057
|
token: token,
|
|
2073
2058
|
activeRetailer: activeRetailer
|
|
@@ -2146,7 +2131,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2146
2131
|
} else if (user.is_retailer) {
|
|
2147
2132
|
if (product.id_order || product.orderId) {
|
|
2148
2133
|
setValidatedAll(true);
|
|
2149
|
-
|
|
2134
|
+
showGlobalModal("error");
|
|
2150
2135
|
} else {
|
|
2151
2136
|
setDataGenericModal(function (prev) {
|
|
2152
2137
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2161,15 +2146,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2161
2146
|
showGlobalModal("generic");
|
|
2162
2147
|
}
|
|
2163
2148
|
} else {
|
|
2164
|
-
setShowRejectModal(true);
|
|
2165
2149
|
setValidatedAll(true);
|
|
2150
|
+
showGlobalModal("error");
|
|
2166
2151
|
}
|
|
2167
2152
|
},
|
|
2168
2153
|
approve: function approve() {
|
|
2169
2154
|
return sendToEvaluation("A");
|
|
2170
2155
|
},
|
|
2171
2156
|
reject: function reject() {
|
|
2172
|
-
|
|
2157
|
+
return sendToEvaluation("R");
|
|
2173
2158
|
}
|
|
2174
2159
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2175
2160
|
tabsSections: tabsSections,
|
|
@@ -2257,7 +2242,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2257
2242
|
headerType: "input-name-header"
|
|
2258
2243
|
}))]
|
|
2259
2244
|
})
|
|
2260
|
-
}),
|
|
2245
|
+
}), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2246
|
+
className: "commentary-box",
|
|
2247
|
+
children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2248
|
+
className: "commentary",
|
|
2249
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2250
|
+
label: "Caja de Comentario",
|
|
2251
|
+
inputType: "textarea",
|
|
2252
|
+
inputCols: 80,
|
|
2253
|
+
inputRows: 4,
|
|
2254
|
+
inputId: "commentary-box",
|
|
2255
|
+
index: 0
|
|
2256
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2257
|
+
className: "buttons-box",
|
|
2258
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2259
|
+
buttonType: "general-transparent-button",
|
|
2260
|
+
label: "Enviar comentario",
|
|
2261
|
+
onClick: function onClick(e) {
|
|
2262
|
+
return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2263
|
+
}
|
|
2264
|
+
})
|
|
2265
|
+
})]
|
|
2266
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2267
|
+
className: "feedback-box",
|
|
2268
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2269
|
+
comment: comment.message,
|
|
2270
|
+
reviewed: crossComment
|
|
2271
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2272
|
+
buttonType: "circular-button accept-button",
|
|
2273
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2274
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2275
|
+
while (1) {
|
|
2276
|
+
switch (_context21.prev = _context21.next) {
|
|
2277
|
+
case 0:
|
|
2278
|
+
setCrossComment(true);
|
|
2279
|
+
commentRevised();
|
|
2280
|
+
|
|
2281
|
+
case 2:
|
|
2282
|
+
case "end":
|
|
2283
|
+
return _context21.stop();
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
}, _callee21);
|
|
2287
|
+
}))
|
|
2288
|
+
})]
|
|
2289
|
+
})
|
|
2290
|
+
}) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2261
2291
|
className: "required-inputs-message",
|
|
2262
2292
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2263
2293
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -2317,52 +2347,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2317
2347
|
currentVersion: version,
|
|
2318
2348
|
setShowVersionSelector: setShowVersionSelector,
|
|
2319
2349
|
jwt: token
|
|
2320
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2321
|
-
title: "Agregar mensaje de rechazo",
|
|
2322
|
-
show: showRejectModal,
|
|
2323
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2324
|
-
inputType: "textarea",
|
|
2325
|
-
inputId: "modal-message-box",
|
|
2326
|
-
index: 0,
|
|
2327
|
-
color: "white"
|
|
2328
|
-
}),
|
|
2329
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2330
|
-
type: "white",
|
|
2331
|
-
label: "Cancelar",
|
|
2332
|
-
size: 12,
|
|
2333
|
-
onClick: function onClick() {
|
|
2334
|
-
setShowRejectModal(false);
|
|
2335
|
-
}
|
|
2336
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2337
|
-
type: "pink",
|
|
2338
|
-
label: "Aceptar",
|
|
2339
|
-
size: 12,
|
|
2340
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2341
|
-
var body, messages;
|
|
2342
|
-
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2343
|
-
while (1) {
|
|
2344
|
-
switch (_context21.prev = _context21.next) {
|
|
2345
|
-
case 0:
|
|
2346
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2347
|
-
messages = [{
|
|
2348
|
-
type: "message",
|
|
2349
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2350
|
-
}];
|
|
2351
|
-
_context21.next = 4;
|
|
2352
|
-
return createComment(messages, activeRetailer.id);
|
|
2353
|
-
|
|
2354
|
-
case 4:
|
|
2355
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2356
|
-
setShowRejectModal(false);
|
|
2357
|
-
|
|
2358
|
-
case 6:
|
|
2359
|
-
case "end":
|
|
2360
|
-
return _context21.stop();
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
}, _callee21);
|
|
2364
|
-
}))
|
|
2365
|
-
}, "btn-Aceptar")]
|
|
2366
2350
|
})]
|
|
2367
2351
|
});
|
|
2368
2352
|
};
|