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