contentoh-components-library 21.4.7 → 21.4.9
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/assets/fonts/roboto/LICENSE.txt +202 -0
- 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 +29 -169
- package/dist/components/pages/ProviderProductEdition/index.js +203 -213
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +60 -85
- package/dist/components/pages/RetailerProductEdition/index.js +303 -315
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/index.js +52 -234
- 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 +34 -188
- package/src/components/pages/ProviderProductEdition/index.js +132 -132
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -72
- package/src/components/pages/RetailerProductEdition/index.js +138 -122
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/index.js +0 -15
- 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 -96
- 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 -97
- 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/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,29 +1191,30 @@ 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 = 12;
|
|
1182
1195
|
break;
|
|
1183
1196
|
}
|
|
1184
1197
|
|
|
1198
|
+
setUpdatedDescriptions([]);
|
|
1185
1199
|
setMessage("Descripciones guardadas con éxito");
|
|
1186
|
-
_context11.next =
|
|
1200
|
+
_context11.next = 12;
|
|
1187
1201
|
return loadData();
|
|
1188
1202
|
|
|
1189
|
-
case
|
|
1190
|
-
_context11.next =
|
|
1203
|
+
case 12:
|
|
1204
|
+
_context11.next = 17;
|
|
1191
1205
|
break;
|
|
1192
1206
|
|
|
1193
|
-
case
|
|
1194
|
-
_context11.prev =
|
|
1207
|
+
case 14:
|
|
1208
|
+
_context11.prev = 14;
|
|
1195
1209
|
_context11.t0 = _context11["catch"](3);
|
|
1196
1210
|
console.log(_context11.t0);
|
|
1197
1211
|
|
|
1198
|
-
case
|
|
1212
|
+
case 17:
|
|
1199
1213
|
case "end":
|
|
1200
1214
|
return _context11.stop();
|
|
1201
1215
|
}
|
|
1202
1216
|
}
|
|
1203
|
-
}, _callee11, null, [[3,
|
|
1217
|
+
}, _callee11, null, [[3, 14]]);
|
|
1204
1218
|
}));
|
|
1205
1219
|
|
|
1206
1220
|
return function saveDescriptions() {
|
|
@@ -1233,29 +1247,30 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1233
1247
|
res = _context12.sent;
|
|
1234
1248
|
|
|
1235
1249
|
if (!(res.data.statusCode === 200)) {
|
|
1236
|
-
_context12.next =
|
|
1250
|
+
_context12.next = 12;
|
|
1237
1251
|
break;
|
|
1238
1252
|
}
|
|
1239
1253
|
|
|
1254
|
+
setUpdatedDatasheets([]);
|
|
1240
1255
|
setMessage("Fichas técnicas guardadas");
|
|
1241
|
-
_context12.next =
|
|
1256
|
+
_context12.next = 12;
|
|
1242
1257
|
return loadData();
|
|
1243
1258
|
|
|
1244
|
-
case
|
|
1245
|
-
_context12.next =
|
|
1259
|
+
case 12:
|
|
1260
|
+
_context12.next = 17;
|
|
1246
1261
|
break;
|
|
1247
1262
|
|
|
1248
|
-
case
|
|
1249
|
-
_context12.prev =
|
|
1263
|
+
case 14:
|
|
1264
|
+
_context12.prev = 14;
|
|
1250
1265
|
_context12.t0 = _context12["catch"](3);
|
|
1251
1266
|
console.log(_context12.t0);
|
|
1252
1267
|
|
|
1253
|
-
case
|
|
1268
|
+
case 17:
|
|
1254
1269
|
case "end":
|
|
1255
1270
|
return _context12.stop();
|
|
1256
1271
|
}
|
|
1257
1272
|
}
|
|
1258
|
-
}, _callee12, null, [[3,
|
|
1273
|
+
}, _callee12, null, [[3, 14]]);
|
|
1259
1274
|
}));
|
|
1260
1275
|
|
|
1261
1276
|
return function saveDatasheets() {
|
|
@@ -1389,7 +1404,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1389
1404
|
switch (_context14.prev = _context14.next) {
|
|
1390
1405
|
case 0:
|
|
1391
1406
|
if (!imagesUploaded) {
|
|
1392
|
-
_context14.next =
|
|
1407
|
+
_context14.next = 17;
|
|
1393
1408
|
break;
|
|
1394
1409
|
}
|
|
1395
1410
|
|
|
@@ -1413,30 +1428,31 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1413
1428
|
res = _context14.sent;
|
|
1414
1429
|
|
|
1415
1430
|
if (!(res.data.statusCode === 200)) {
|
|
1416
|
-
_context14.next =
|
|
1431
|
+
_context14.next = 12;
|
|
1417
1432
|
break;
|
|
1418
1433
|
}
|
|
1419
1434
|
|
|
1435
|
+
setImages({});
|
|
1420
1436
|
setMessage("Imágenes guardadas con éxito");
|
|
1421
1437
|
sessionStorage.removeItem("imagesList");
|
|
1422
|
-
_context14.next =
|
|
1438
|
+
_context14.next = 12;
|
|
1423
1439
|
return loadData();
|
|
1424
1440
|
|
|
1425
|
-
case
|
|
1426
|
-
_context14.next =
|
|
1441
|
+
case 12:
|
|
1442
|
+
_context14.next = 17;
|
|
1427
1443
|
break;
|
|
1428
1444
|
|
|
1429
|
-
case
|
|
1430
|
-
_context14.prev =
|
|
1445
|
+
case 14:
|
|
1446
|
+
_context14.prev = 14;
|
|
1431
1447
|
_context14.t0 = _context14["catch"](2);
|
|
1432
1448
|
console.log(_context14.t0);
|
|
1433
1449
|
|
|
1434
|
-
case
|
|
1450
|
+
case 17:
|
|
1435
1451
|
case "end":
|
|
1436
1452
|
return _context14.stop();
|
|
1437
1453
|
}
|
|
1438
1454
|
}
|
|
1439
|
-
}, _callee14, null, [[2,
|
|
1455
|
+
}, _callee14, null, [[2, 14]]);
|
|
1440
1456
|
})), [dataImages, imagesUploaded]);
|
|
1441
1457
|
|
|
1442
1458
|
var getConcept = function getConcept(tab) {
|
|
@@ -1453,33 +1469,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1453
1469
|
};
|
|
1454
1470
|
|
|
1455
1471
|
var createComment = /*#__PURE__*/function () {
|
|
1456
|
-
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1457
|
-
var
|
|
1458
|
-
retailerId,
|
|
1459
|
-
data,
|
|
1460
|
-
_args15 = arguments;
|
|
1472
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
|
|
1473
|
+
var concept, data;
|
|
1461
1474
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1462
1475
|
while (1) {
|
|
1463
1476
|
switch (_context15.prev = _context15.next) {
|
|
1464
1477
|
case 0:
|
|
1465
|
-
|
|
1466
|
-
|
|
1478
|
+
concept = "";
|
|
1479
|
+
_context15.t0 = activeTab;
|
|
1480
|
+
_context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
|
|
1481
|
+
break;
|
|
1482
|
+
|
|
1483
|
+
case 4:
|
|
1484
|
+
concept = "datasheet";
|
|
1485
|
+
return _context15.abrupt("break", 10);
|
|
1486
|
+
|
|
1487
|
+
case 6:
|
|
1488
|
+
concept = "images";
|
|
1489
|
+
return _context15.abrupt("break", 10);
|
|
1490
|
+
|
|
1491
|
+
case 8:
|
|
1492
|
+
concept = "description";
|
|
1493
|
+
return _context15.abrupt("break", 10);
|
|
1494
|
+
|
|
1495
|
+
case 10:
|
|
1467
1496
|
data = {
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1497
|
+
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1498
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1499
|
+
message: body,
|
|
1500
|
+
concept: concept,
|
|
1501
|
+
version: version
|
|
1502
|
+
};
|
|
1503
|
+
_context15.next = 13;
|
|
1504
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1505
|
+
headers: {
|
|
1476
1506
|
Authorization: token
|
|
1477
1507
|
}
|
|
1478
|
-
};
|
|
1479
|
-
setMessage("");
|
|
1480
|
-
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1508
|
+
});
|
|
1481
1509
|
|
|
1482
|
-
case
|
|
1510
|
+
case 13:
|
|
1483
1511
|
case "end":
|
|
1484
1512
|
return _context15.stop();
|
|
1485
1513
|
}
|
|
@@ -1487,7 +1515,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1487
1515
|
}, _callee15);
|
|
1488
1516
|
}));
|
|
1489
1517
|
|
|
1490
|
-
return function createComment() {
|
|
1518
|
+
return function createComment(_x4, _x5, _x6) {
|
|
1491
1519
|
return _ref13.apply(this, arguments);
|
|
1492
1520
|
};
|
|
1493
1521
|
}();
|
|
@@ -1586,7 +1614,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1586
1614
|
}, _callee17);
|
|
1587
1615
|
}));
|
|
1588
1616
|
|
|
1589
|
-
return function setAssignation(
|
|
1617
|
+
return function setAssignation(_x7, _x8) {
|
|
1590
1618
|
return _ref15.apply(this, arguments);
|
|
1591
1619
|
};
|
|
1592
1620
|
}();
|
|
@@ -1674,7 +1702,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1674
1702
|
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1675
1703
|
var _productTemp$id_order2;
|
|
1676
1704
|
|
|
1677
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus,
|
|
1705
|
+
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1678
1706
|
|
|
1679
1707
|
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1680
1708
|
while (1) {
|
|
@@ -1736,77 +1764,53 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1736
1764
|
res = _context18.sent;
|
|
1737
1765
|
|
|
1738
1766
|
case 30:
|
|
1739
|
-
if (
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
items: [{
|
|
1751
|
-
type: "status",
|
|
1752
|
-
value: _message
|
|
1753
|
-
}],
|
|
1754
|
-
retailerId: activeRetailer.id,
|
|
1755
|
-
status: product.status || productEdit.product.status
|
|
1756
|
-
},
|
|
1757
|
-
paramsHeader: {
|
|
1758
|
-
Authorization: token
|
|
1767
|
+
if (res.data.statusCode === 200) {
|
|
1768
|
+
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1769
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1770
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1771
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1772
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1773
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1774
|
+
|
|
1775
|
+
if (newServiceStatus) {
|
|
1776
|
+
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1777
|
+
productTemp["".concat(concept, "_status")] = status;
|
|
1759
1778
|
}
|
|
1760
|
-
};
|
|
1761
|
-
_context18.next = 36;
|
|
1762
|
-
return (0, _utils.sendMessage)(messageData);
|
|
1763
|
-
|
|
1764
|
-
case 36:
|
|
1765
|
-
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1766
|
-
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1767
|
-
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1768
|
-
setRetailerStatus(retailerStatusCopy);
|
|
1769
|
-
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1770
1779
|
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1780
|
+
setProduct(productTemp);
|
|
1781
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1782
|
+
setOrigin(function (prev) {
|
|
1783
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1784
|
+
});
|
|
1774
1785
|
}
|
|
1775
1786
|
|
|
1776
|
-
|
|
1777
|
-
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1778
|
-
setOrigin(function (prev) {
|
|
1779
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1780
|
-
});
|
|
1781
|
-
|
|
1782
|
-
case 45:
|
|
1783
|
-
_context18.next = 50;
|
|
1787
|
+
_context18.next = 36;
|
|
1784
1788
|
break;
|
|
1785
1789
|
|
|
1786
|
-
case
|
|
1787
|
-
_context18.prev =
|
|
1790
|
+
case 33:
|
|
1791
|
+
_context18.prev = 33;
|
|
1788
1792
|
_context18.t0 = _context18["catch"](9);
|
|
1789
1793
|
console.log(_context18.t0);
|
|
1790
1794
|
|
|
1791
|
-
case
|
|
1795
|
+
case 36:
|
|
1792
1796
|
loadData();
|
|
1793
1797
|
|
|
1794
|
-
case
|
|
1798
|
+
case 37:
|
|
1795
1799
|
case "end":
|
|
1796
1800
|
return _context18.stop();
|
|
1797
1801
|
}
|
|
1798
1802
|
}
|
|
1799
|
-
}, _callee18, null, [[9,
|
|
1803
|
+
}, _callee18, null, [[9, 33]]);
|
|
1800
1804
|
}));
|
|
1801
1805
|
|
|
1802
|
-
return function sendEvaluation(
|
|
1806
|
+
return function sendEvaluation(_x9) {
|
|
1803
1807
|
return _ref16.apply(this, arguments);
|
|
1804
1808
|
};
|
|
1805
1809
|
}();
|
|
1806
1810
|
|
|
1807
1811
|
var validateAll = /*#__PURE__*/function () {
|
|
1808
1812
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1809
|
-
var _product$id_order2, evaluationArray, conceptArray, dataGeneral,
|
|
1813
|
+
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1810
1814
|
|
|
1811
1815
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1812
1816
|
while (1) {
|
|
@@ -1822,7 +1826,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1822
1826
|
result: result,
|
|
1823
1827
|
isAproved: result === "A"
|
|
1824
1828
|
};
|
|
1825
|
-
messages = [];
|
|
1826
1829
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1827
1830
|
var service = ret.service,
|
|
1828
1831
|
id_retailer = ret.id_retailer;
|
|
@@ -1837,20 +1840,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1837
1840
|
Authorization: token
|
|
1838
1841
|
}
|
|
1839
1842
|
}));
|
|
1840
|
-
|
|
1841
|
-
if (product["".concat(ret.service, "_status")] !== "NS") {
|
|
1842
|
-
var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
|
|
1843
|
-
|
|
1844
|
-
messages.push(createComment([{
|
|
1845
|
-
type: "status",
|
|
1846
|
-
value: _message2
|
|
1847
|
-
}], ret.id_retailer));
|
|
1848
|
-
}
|
|
1849
1843
|
});
|
|
1850
|
-
_context19.next =
|
|
1844
|
+
_context19.next = 8;
|
|
1851
1845
|
return Promise.all(evaluationArray);
|
|
1852
1846
|
|
|
1853
|
-
case
|
|
1847
|
+
case 8:
|
|
1854
1848
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1855
1849
|
productTemp = product;
|
|
1856
1850
|
status = "".concat(result).concat(userType);
|
|
@@ -1880,31 +1874,27 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1880
1874
|
idCategory: productTemp.article.id_category,
|
|
1881
1875
|
product: productTemp
|
|
1882
1876
|
}));
|
|
1883
|
-
_context19.next =
|
|
1884
|
-
return Promise.all(messages);
|
|
1885
|
-
|
|
1886
|
-
case 26:
|
|
1887
|
-
_context19.next = 28;
|
|
1877
|
+
_context19.next = 25;
|
|
1888
1878
|
return loadData();
|
|
1889
1879
|
|
|
1890
|
-
case
|
|
1891
|
-
_context19.next =
|
|
1880
|
+
case 25:
|
|
1881
|
+
_context19.next = 30;
|
|
1892
1882
|
break;
|
|
1893
1883
|
|
|
1894
|
-
case
|
|
1895
|
-
_context19.prev =
|
|
1884
|
+
case 27:
|
|
1885
|
+
_context19.prev = 27;
|
|
1896
1886
|
_context19.t0 = _context19["catch"](0);
|
|
1897
1887
|
console.log(_context19.t0);
|
|
1898
1888
|
|
|
1899
|
-
case
|
|
1889
|
+
case 30:
|
|
1900
1890
|
case "end":
|
|
1901
1891
|
return _context19.stop();
|
|
1902
1892
|
}
|
|
1903
1893
|
}
|
|
1904
|
-
}, _callee19, null, [[0,
|
|
1894
|
+
}, _callee19, null, [[0, 27]]);
|
|
1905
1895
|
}));
|
|
1906
1896
|
|
|
1907
|
-
return function validateAll(
|
|
1897
|
+
return function validateAll(_x10) {
|
|
1908
1898
|
return _ref17.apply(this, arguments);
|
|
1909
1899
|
};
|
|
1910
1900
|
}();
|
|
@@ -1951,7 +1941,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1951
1941
|
}, _callee20);
|
|
1952
1942
|
}));
|
|
1953
1943
|
|
|
1954
|
-
return function evaluationToRetailer(
|
|
1944
|
+
return function evaluationToRetailer(_x11) {
|
|
1955
1945
|
return _ref18.apply(this, arguments);
|
|
1956
1946
|
};
|
|
1957
1947
|
}();
|
|
@@ -2039,7 +2029,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2039
2029
|
return;
|
|
2040
2030
|
} else if (user.is_retailer) {
|
|
2041
2031
|
if (product.id_order || product.orderId) {
|
|
2042
|
-
|
|
2032
|
+
setValidatedAll(true);
|
|
2033
|
+
showGlobalModal("error");
|
|
2043
2034
|
} else {
|
|
2044
2035
|
setDataGenericModal(function (prev) {
|
|
2045
2036
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2054,7 +2045,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2054
2045
|
showGlobalModal("generic");
|
|
2055
2046
|
}
|
|
2056
2047
|
} else {
|
|
2057
|
-
|
|
2048
|
+
setValidatedAll(true);
|
|
2049
|
+
showGlobalModal("error");
|
|
2058
2050
|
}
|
|
2059
2051
|
}
|
|
2060
2052
|
};
|
|
@@ -2064,7 +2056,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2064
2056
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2065
2057
|
setHeaderTop: setHeaderTop,
|
|
2066
2058
|
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
2067
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
2068
2059
|
productSelected: productSelected,
|
|
2069
2060
|
token: token,
|
|
2070
2061
|
activeRetailer: activeRetailer
|
|
@@ -2143,7 +2134,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2143
2134
|
} else if (user.is_retailer) {
|
|
2144
2135
|
if (product.id_order || product.orderId) {
|
|
2145
2136
|
setValidatedAll(true);
|
|
2146
|
-
|
|
2137
|
+
showGlobalModal("error");
|
|
2147
2138
|
} else {
|
|
2148
2139
|
setDataGenericModal(function (prev) {
|
|
2149
2140
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2158,15 +2149,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2158
2149
|
showGlobalModal("generic");
|
|
2159
2150
|
}
|
|
2160
2151
|
} else {
|
|
2161
|
-
setShowRejectModal(true);
|
|
2162
2152
|
setValidatedAll(true);
|
|
2153
|
+
showGlobalModal("error");
|
|
2163
2154
|
}
|
|
2164
2155
|
},
|
|
2165
2156
|
approve: function approve() {
|
|
2166
2157
|
return sendToEvaluation("A");
|
|
2167
2158
|
},
|
|
2168
2159
|
reject: function reject() {
|
|
2169
|
-
|
|
2160
|
+
return sendToEvaluation("R");
|
|
2170
2161
|
}
|
|
2171
2162
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2172
2163
|
tabsSections: tabsSections,
|
|
@@ -2254,7 +2245,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2254
2245
|
headerType: "input-name-header"
|
|
2255
2246
|
}))]
|
|
2256
2247
|
})
|
|
2257
|
-
}),
|
|
2248
|
+
}), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2249
|
+
className: "commentary-box",
|
|
2250
|
+
children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2251
|
+
className: "commentary",
|
|
2252
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2253
|
+
label: "Caja de Comentario",
|
|
2254
|
+
inputType: "textarea",
|
|
2255
|
+
inputCols: 80,
|
|
2256
|
+
inputRows: 4,
|
|
2257
|
+
inputId: "commentary-box",
|
|
2258
|
+
index: 0
|
|
2259
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2260
|
+
className: "buttons-box",
|
|
2261
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2262
|
+
buttonType: "general-transparent-button",
|
|
2263
|
+
label: "Enviar comentario",
|
|
2264
|
+
onClick: function onClick(e) {
|
|
2265
|
+
return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2266
|
+
}
|
|
2267
|
+
})
|
|
2268
|
+
})]
|
|
2269
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2270
|
+
className: "feedback-box",
|
|
2271
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2272
|
+
comment: comment.message,
|
|
2273
|
+
reviewed: crossComment
|
|
2274
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2275
|
+
buttonType: "circular-button accept-button",
|
|
2276
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2277
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2278
|
+
while (1) {
|
|
2279
|
+
switch (_context21.prev = _context21.next) {
|
|
2280
|
+
case 0:
|
|
2281
|
+
setCrossComment(true);
|
|
2282
|
+
commentRevised();
|
|
2283
|
+
|
|
2284
|
+
case 2:
|
|
2285
|
+
case "end":
|
|
2286
|
+
return _context21.stop();
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
}, _callee21);
|
|
2290
|
+
}))
|
|
2291
|
+
})]
|
|
2292
|
+
})
|
|
2293
|
+
}) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2258
2294
|
className: "required-inputs-message",
|
|
2259
2295
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2260
2296
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -2314,52 +2350,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2314
2350
|
currentVersion: version,
|
|
2315
2351
|
setShowVersionSelector: setShowVersionSelector,
|
|
2316
2352
|
jwt: token
|
|
2317
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2318
|
-
title: "Agregar mensaje de rechazo",
|
|
2319
|
-
show: showRejectModal,
|
|
2320
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2321
|
-
inputType: "textarea",
|
|
2322
|
-
inputId: "modal-message-box",
|
|
2323
|
-
index: 0,
|
|
2324
|
-
color: "white"
|
|
2325
|
-
}),
|
|
2326
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2327
|
-
type: "white",
|
|
2328
|
-
label: "Cancelar",
|
|
2329
|
-
size: 12,
|
|
2330
|
-
onClick: function onClick() {
|
|
2331
|
-
setShowRejectModal(false);
|
|
2332
|
-
}
|
|
2333
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2334
|
-
type: "pink",
|
|
2335
|
-
label: "Aceptar",
|
|
2336
|
-
size: 12,
|
|
2337
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2338
|
-
var body, messages;
|
|
2339
|
-
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2340
|
-
while (1) {
|
|
2341
|
-
switch (_context21.prev = _context21.next) {
|
|
2342
|
-
case 0:
|
|
2343
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2344
|
-
messages = [{
|
|
2345
|
-
type: "message",
|
|
2346
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2347
|
-
}];
|
|
2348
|
-
_context21.next = 4;
|
|
2349
|
-
return createComment(messages, activeRetailer.id);
|
|
2350
|
-
|
|
2351
|
-
case 4:
|
|
2352
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2353
|
-
setShowRejectModal(false);
|
|
2354
|
-
|
|
2355
|
-
case 6:
|
|
2356
|
-
case "end":
|
|
2357
|
-
return _context21.stop();
|
|
2358
|
-
}
|
|
2359
|
-
}
|
|
2360
|
-
}, _callee21);
|
|
2361
|
-
}))
|
|
2362
|
-
}, "btn-Aceptar")]
|
|
2363
2353
|
})]
|
|
2364
2354
|
});
|
|
2365
2355
|
};
|