contentoh-components-library 21.3.67 → 21.3.69
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 +4 -0
- package/.env.production +3 -0
- package/dist/components/atoms/ButtonV2/styles.js +1 -1
- package/dist/components/atoms/Card/index.js +47 -7
- package/dist/components/atoms/Card/styles.js +3 -1
- package/dist/components/atoms/CheckBox/index.js +4 -2
- 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/StripeCardForm/StripeCardForm.stories.js +31 -0
- package/dist/components/molecules/StripeCardForm/index.js +81 -0
- package/dist/components/molecules/StripeCardForm/paymentForm.js +187 -0
- package/dist/components/molecules/StripeCardForm/styles.js +24 -0
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +30 -0
- package/dist/components/molecules/StripeCardSelector/index.js +103 -0
- package/dist/components/molecules/StripeCardSelector/styles.js +19 -0
- package/dist/components/molecules/StripeCardSelector/utils.js +56 -0
- package/dist/components/molecules/TabsMenu/index.js +128 -13
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +21 -1
- 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 +343 -191
- package/dist/components/organisms/Chat/Footer/index.js +48 -39
- package/dist/components/organisms/Chat/index.js +48 -3
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/FullTabsMenu/index.js +27 -2
- package/dist/components/organisms/ImageDataTable/index.js +2 -0
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/organisms/SideModal/index.js +11 -0
- package/dist/components/organisms/SideModal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +172 -127
- package/dist/components/pages/ProviderProductEdition/index.js +223 -177
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +40 -28
- package/dist/components/pages/RetailerProductEdition/index.js +298 -273
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
- package/dist/index.js +51 -12
- package/package.json +1 -1
- package/src/components/atoms/ButtonV2/styles.js +1 -1
- 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 +2 -0
- package/src/components/atoms/InputFormatter/styles.js +2 -1
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/GalleryElement/index.js +5 -0
- package/src/components/molecules/HeaderTop/index.js +52 -6
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +13 -0
- package/src/components/molecules/StripeCardForm/index.js +33 -0
- package/src/components/molecules/StripeCardForm/paymentForm.js +121 -0
- package/src/components/molecules/StripeCardForm/styles.js +72 -0
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -0
- package/src/components/molecules/StripeCardSelector/index.js +42 -0
- package/src/components/molecules/StripeCardSelector/styles.js +4 -0
- package/src/components/molecules/StripeCardSelector/utils.js +17 -0
- package/src/components/molecules/TabsMenu/index.js +126 -3
- package/src/components/molecules/TagAndInput/index.js +12 -8
- package/src/components/organisms/Chat/Chat.stories.js +21 -0
- 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 +81 -6
- package/src/components/organisms/Chat/Footer/index.js +11 -0
- package/src/components/organisms/Chat/index.js +47 -3
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/FullTabsMenu/index.js +28 -1
- package/src/components/organisms/ImageDataTable/index.js +3 -0
- package/src/components/organisms/InputGroup/index.js +4 -1
- package/src/components/organisms/Modal/styles.js +4 -1
- 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 +177 -130
- package/src/components/pages/ProviderProductEdition/index.js +160 -129
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +38 -26
- package/src/components/pages/RetailerProductEdition/index.js +142 -135
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/index.js +3 -0
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
|
@@ -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,47 @@ 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]; //! ==========================================Daniel===========================================
|
|
462
468
|
|
|
463
|
-
|
|
469
|
+
/* ====================================== Cambios =================================*/
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
var _useState65 = (0, _react.useState)([]),
|
|
473
|
+
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
474
|
+
desc = _useState66[0],
|
|
475
|
+
setDesc = _useState66[1];
|
|
476
|
+
|
|
477
|
+
var _useState67 = (0, _react.useState)([]),
|
|
478
|
+
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
479
|
+
fich = _useState68[0],
|
|
480
|
+
setFich = _useState68[1];
|
|
481
|
+
|
|
482
|
+
var _useState69 = (0, _react.useState)([]),
|
|
483
|
+
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
484
|
+
imag = _useState70[0],
|
|
485
|
+
setImag = _useState70[1];
|
|
486
|
+
/* ------------------------------------- Cambios ----------------------------------*/
|
|
487
|
+
//! ==========================================Daniel===========================================
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
var _useState71 = (0, _react.useState)(false),
|
|
491
|
+
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
492
|
+
inCart = _useState72[0],
|
|
493
|
+
setInCart = _useState72[1];
|
|
494
|
+
|
|
495
|
+
var _useState73 = (0, _react.useState)({
|
|
464
496
|
message: "¿Estás seguro de continuar?",
|
|
465
497
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
466
498
|
button1: {
|
|
@@ -475,34 +507,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
475
507
|
},
|
|
476
508
|
img: _defaultProfileImage.default
|
|
477
509
|
}),
|
|
478
|
-
|
|
479
|
-
dataGenericModal =
|
|
480
|
-
setDataGenericModal =
|
|
510
|
+
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
511
|
+
dataGenericModal = _useState74[0],
|
|
512
|
+
setDataGenericModal = _useState74[1];
|
|
481
513
|
|
|
482
|
-
var
|
|
483
|
-
|
|
484
|
-
socketType =
|
|
485
|
-
setSocketType =
|
|
514
|
+
var _useState75 = (0, _react.useState)(null),
|
|
515
|
+
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
516
|
+
socketType = _useState76[0],
|
|
517
|
+
setSocketType = _useState76[1];
|
|
486
518
|
|
|
487
|
-
var
|
|
488
|
-
|
|
489
|
-
saving =
|
|
490
|
-
setSaving =
|
|
519
|
+
var _useState77 = (0, _react.useState)(loading),
|
|
520
|
+
_useState78 = (0, _slicedToArray2.default)(_useState77, 2),
|
|
521
|
+
saving = _useState78[0],
|
|
522
|
+
setSaving = _useState78[1];
|
|
491
523
|
|
|
492
|
-
var
|
|
493
|
-
|
|
494
|
-
retailerStatus =
|
|
495
|
-
setRetailerStatus =
|
|
524
|
+
var _useState79 = (0, _react.useState)(product.statusByRetailer),
|
|
525
|
+
_useState80 = (0, _slicedToArray2.default)(_useState79, 2),
|
|
526
|
+
retailerStatus = _useState80[0],
|
|
527
|
+
setRetailerStatus = _useState80[1];
|
|
496
528
|
|
|
497
529
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
498
530
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
499
531
|
showVersionSelector = _useCloseModal2[0],
|
|
500
532
|
setShowVersionSelector = _useCloseModal2[1];
|
|
501
533
|
|
|
502
|
-
var
|
|
503
|
-
|
|
504
|
-
globalModal =
|
|
505
|
-
setGlobalModal =
|
|
534
|
+
var _useState81 = (0, _react.useState)(),
|
|
535
|
+
_useState82 = (0, _slicedToArray2.default)(_useState81, 2),
|
|
536
|
+
globalModal = _useState82[0],
|
|
537
|
+
setGlobalModal = _useState82[1];
|
|
506
538
|
|
|
507
539
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
508
540
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -674,30 +706,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
674
706
|
});
|
|
675
707
|
|
|
676
708
|
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
709
|
case "generic":
|
|
702
710
|
setGlobalModal(dataGenericModal);
|
|
703
711
|
break;
|
|
@@ -969,7 +977,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
969
977
|
setServicesData(parsedResponse);
|
|
970
978
|
|
|
971
979
|
case 12:
|
|
972
|
-
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
980
|
+
retailers && !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
973
981
|
|
|
974
982
|
case 13:
|
|
975
983
|
case "end":
|
|
@@ -1087,7 +1095,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1087
1095
|
}
|
|
1088
1096
|
|
|
1089
1097
|
setProduct(productTemp);
|
|
1090
|
-
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1098
|
+
retailers && setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1091
1099
|
}, [percentages]);
|
|
1092
1100
|
|
|
1093
1101
|
var loadInputs = function loadInputs() {
|
|
@@ -1466,45 +1474,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1466
1474
|
};
|
|
1467
1475
|
|
|
1468
1476
|
var createComment = /*#__PURE__*/function () {
|
|
1469
|
-
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(
|
|
1470
|
-
var
|
|
1477
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1478
|
+
var messages,
|
|
1479
|
+
retailerId,
|
|
1480
|
+
data,
|
|
1481
|
+
_args15 = arguments;
|
|
1471
1482
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1472
1483
|
while (1) {
|
|
1473
1484
|
switch (_context15.prev = _context15.next) {
|
|
1474
1485
|
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:
|
|
1486
|
+
messages = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : [];
|
|
1487
|
+
retailerId = _args15.length > 1 ? _args15[1] : undefined;
|
|
1493
1488
|
data = {
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
headers: {
|
|
1489
|
+
paramsBody: {
|
|
1490
|
+
id: product.article.id_article || productEdit.ArticleId,
|
|
1491
|
+
version: version,
|
|
1492
|
+
items: messages,
|
|
1493
|
+
retailerId: retailerId,
|
|
1494
|
+
status: product.status || productEdit.product.status
|
|
1495
|
+
},
|
|
1496
|
+
paramsHeader: {
|
|
1503
1497
|
Authorization: token
|
|
1504
1498
|
}
|
|
1505
|
-
}
|
|
1499
|
+
};
|
|
1500
|
+
setMessage("");
|
|
1501
|
+
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1506
1502
|
|
|
1507
|
-
case
|
|
1503
|
+
case 5:
|
|
1508
1504
|
case "end":
|
|
1509
1505
|
return _context15.stop();
|
|
1510
1506
|
}
|
|
@@ -1512,7 +1508,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1512
1508
|
}, _callee15);
|
|
1513
1509
|
}));
|
|
1514
1510
|
|
|
1515
|
-
return function createComment(
|
|
1511
|
+
return function createComment() {
|
|
1516
1512
|
return _ref13.apply(this, arguments);
|
|
1517
1513
|
};
|
|
1518
1514
|
}();
|
|
@@ -1611,7 +1607,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1611
1607
|
}, _callee17);
|
|
1612
1608
|
}));
|
|
1613
1609
|
|
|
1614
|
-
return function setAssignation(
|
|
1610
|
+
return function setAssignation(_x4, _x5) {
|
|
1615
1611
|
return _ref15.apply(this, arguments);
|
|
1616
1612
|
};
|
|
1617
1613
|
}();
|
|
@@ -1699,7 +1695,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1699
1695
|
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1700
1696
|
var _productTemp$id_order2;
|
|
1701
1697
|
|
|
1702
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1698
|
+
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
1699
|
|
|
1704
1700
|
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1705
1701
|
while (1) {
|
|
@@ -1761,53 +1757,77 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1761
1757
|
res = _context18.sent;
|
|
1762
1758
|
|
|
1763
1759
|
case 30:
|
|
1764
|
-
if (res.data.statusCode === 200) {
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1760
|
+
if (!(res.data.statusCode === 200)) {
|
|
1761
|
+
_context18.next = 45;
|
|
1762
|
+
break;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1766
|
+
_message = (0, _utils.createMessage)(product.retailers || product.retailersAvailable, activeRetailer.id, product[sectionStatusKey], newStatus, activeTab);
|
|
1767
|
+
messageData = {
|
|
1768
|
+
paramsBody: {
|
|
1769
|
+
id: product.article.id_article || productEdit.ArticleId,
|
|
1770
|
+
version: version,
|
|
1771
|
+
items: [{
|
|
1772
|
+
type: "status",
|
|
1773
|
+
value: _message
|
|
1774
|
+
}],
|
|
1775
|
+
retailerId: activeRetailer.id,
|
|
1776
|
+
status: product.status || productEdit.product.status
|
|
1777
|
+
},
|
|
1778
|
+
paramsHeader: {
|
|
1779
|
+
Authorization: token
|
|
1775
1780
|
}
|
|
1781
|
+
};
|
|
1782
|
+
_context18.next = 36;
|
|
1783
|
+
return (0, _utils.sendMessage)(messageData);
|
|
1776
1784
|
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1785
|
+
case 36:
|
|
1786
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1787
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1788
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1789
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1790
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1791
|
+
|
|
1792
|
+
if (newServiceStatus) {
|
|
1793
|
+
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1794
|
+
productTemp["".concat(concept, "_status")] = status;
|
|
1782
1795
|
}
|
|
1783
1796
|
|
|
1784
|
-
|
|
1797
|
+
setProduct(productTemp);
|
|
1798
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1799
|
+
setOrigin(function (prev) {
|
|
1800
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1801
|
+
});
|
|
1802
|
+
|
|
1803
|
+
case 45:
|
|
1804
|
+
_context18.next = 50;
|
|
1785
1805
|
break;
|
|
1786
1806
|
|
|
1787
|
-
case
|
|
1788
|
-
_context18.prev =
|
|
1807
|
+
case 47:
|
|
1808
|
+
_context18.prev = 47;
|
|
1789
1809
|
_context18.t0 = _context18["catch"](9);
|
|
1790
1810
|
console.log(_context18.t0);
|
|
1791
1811
|
|
|
1792
|
-
case
|
|
1812
|
+
case 50:
|
|
1793
1813
|
loadData();
|
|
1794
1814
|
|
|
1795
|
-
case
|
|
1815
|
+
case 51:
|
|
1796
1816
|
case "end":
|
|
1797
1817
|
return _context18.stop();
|
|
1798
1818
|
}
|
|
1799
1819
|
}
|
|
1800
|
-
}, _callee18, null, [[9,
|
|
1820
|
+
}, _callee18, null, [[9, 47]]);
|
|
1801
1821
|
}));
|
|
1802
1822
|
|
|
1803
|
-
return function sendEvaluation(
|
|
1823
|
+
return function sendEvaluation(_x6) {
|
|
1804
1824
|
return _ref16.apply(this, arguments);
|
|
1805
1825
|
};
|
|
1806
1826
|
}();
|
|
1807
1827
|
|
|
1808
1828
|
var validateAll = /*#__PURE__*/function () {
|
|
1809
1829
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1810
|
-
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1830
|
+
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, messages, userType, productTemp, status, retailerStatusCopy;
|
|
1811
1831
|
|
|
1812
1832
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1813
1833
|
while (1) {
|
|
@@ -1823,6 +1843,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1823
1843
|
result: result,
|
|
1824
1844
|
isAproved: result === "A"
|
|
1825
1845
|
};
|
|
1846
|
+
messages = [];
|
|
1826
1847
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1827
1848
|
var service = ret.service,
|
|
1828
1849
|
id_retailer = ret.id_retailer;
|
|
@@ -1837,11 +1858,20 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1837
1858
|
Authorization: token
|
|
1838
1859
|
}
|
|
1839
1860
|
}));
|
|
1861
|
+
|
|
1862
|
+
if (product["".concat(ret.service, "_status")] !== "NS") {
|
|
1863
|
+
var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
|
|
1864
|
+
|
|
1865
|
+
messages.push(createComment([{
|
|
1866
|
+
type: "status",
|
|
1867
|
+
value: _message2
|
|
1868
|
+
}], ret.id_retailer));
|
|
1869
|
+
}
|
|
1840
1870
|
});
|
|
1841
|
-
_context19.next =
|
|
1871
|
+
_context19.next = 9;
|
|
1842
1872
|
return Promise.all(evaluationArray);
|
|
1843
1873
|
|
|
1844
|
-
case
|
|
1874
|
+
case 9:
|
|
1845
1875
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1846
1876
|
productTemp = product;
|
|
1847
1877
|
status = "".concat(result).concat(userType);
|
|
@@ -1871,27 +1901,31 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1871
1901
|
idCategory: productTemp.article.id_category,
|
|
1872
1902
|
product: productTemp
|
|
1873
1903
|
}));
|
|
1874
|
-
_context19.next =
|
|
1904
|
+
_context19.next = 26;
|
|
1905
|
+
return Promise.all(messages);
|
|
1906
|
+
|
|
1907
|
+
case 26:
|
|
1908
|
+
_context19.next = 28;
|
|
1875
1909
|
return loadData();
|
|
1876
1910
|
|
|
1877
|
-
case
|
|
1878
|
-
_context19.next =
|
|
1911
|
+
case 28:
|
|
1912
|
+
_context19.next = 33;
|
|
1879
1913
|
break;
|
|
1880
1914
|
|
|
1881
|
-
case
|
|
1882
|
-
_context19.prev =
|
|
1915
|
+
case 30:
|
|
1916
|
+
_context19.prev = 30;
|
|
1883
1917
|
_context19.t0 = _context19["catch"](0);
|
|
1884
1918
|
console.log(_context19.t0);
|
|
1885
1919
|
|
|
1886
|
-
case
|
|
1920
|
+
case 33:
|
|
1887
1921
|
case "end":
|
|
1888
1922
|
return _context19.stop();
|
|
1889
1923
|
}
|
|
1890
1924
|
}
|
|
1891
|
-
}, _callee19, null, [[0,
|
|
1925
|
+
}, _callee19, null, [[0, 30]]);
|
|
1892
1926
|
}));
|
|
1893
1927
|
|
|
1894
|
-
return function validateAll(
|
|
1928
|
+
return function validateAll(_x7) {
|
|
1895
1929
|
return _ref17.apply(this, arguments);
|
|
1896
1930
|
};
|
|
1897
1931
|
}();
|
|
@@ -1938,7 +1972,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1938
1972
|
}, _callee20);
|
|
1939
1973
|
}));
|
|
1940
1974
|
|
|
1941
|
-
return function evaluationToRetailer(
|
|
1975
|
+
return function evaluationToRetailer(_x8) {
|
|
1942
1976
|
return _ref18.apply(this, arguments);
|
|
1943
1977
|
};
|
|
1944
1978
|
}();
|
|
@@ -2022,8 +2056,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2022
2056
|
return;
|
|
2023
2057
|
} else if (user.is_retailer) {
|
|
2024
2058
|
if (product.id_order || product.orderId) {
|
|
2025
|
-
|
|
2026
|
-
showGlobalModal("error");
|
|
2059
|
+
sendEvaluation("R");
|
|
2027
2060
|
} else {
|
|
2028
2061
|
setDataGenericModal(function (prev) {
|
|
2029
2062
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2038,8 +2071,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2038
2071
|
showGlobalModal("generic");
|
|
2039
2072
|
}
|
|
2040
2073
|
} else {
|
|
2041
|
-
|
|
2042
|
-
showGlobalModal("error");
|
|
2074
|
+
sendEvaluation("R");
|
|
2043
2075
|
}
|
|
2044
2076
|
}
|
|
2045
2077
|
};
|
|
@@ -2049,6 +2081,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2049
2081
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2050
2082
|
setHeaderTop: setHeaderTop,
|
|
2051
2083
|
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
2084
|
+
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
2052
2085
|
productSelected: productSelected,
|
|
2053
2086
|
token: token,
|
|
2054
2087
|
activeRetailer: activeRetailer
|
|
@@ -2127,7 +2160,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2127
2160
|
} else if (user.is_retailer) {
|
|
2128
2161
|
if (product.id_order || product.orderId) {
|
|
2129
2162
|
setValidatedAll(true);
|
|
2130
|
-
|
|
2163
|
+
setShowRejectModal(true);
|
|
2131
2164
|
} else {
|
|
2132
2165
|
setDataGenericModal(function (prev) {
|
|
2133
2166
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2142,15 +2175,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2142
2175
|
showGlobalModal("generic");
|
|
2143
2176
|
}
|
|
2144
2177
|
} else {
|
|
2178
|
+
setShowRejectModal(true);
|
|
2145
2179
|
setValidatedAll(true);
|
|
2146
|
-
showGlobalModal("error");
|
|
2147
2180
|
}
|
|
2148
2181
|
},
|
|
2149
2182
|
approve: function approve() {
|
|
2150
2183
|
return sendToEvaluation("A");
|
|
2151
2184
|
},
|
|
2152
2185
|
reject: function reject() {
|
|
2153
|
-
|
|
2186
|
+
setShowRejectModal(true);
|
|
2154
2187
|
}
|
|
2155
2188
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2156
2189
|
tabsSections: tabsSections,
|
|
@@ -2165,6 +2198,18 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2165
2198
|
isRetailer: isRetailer,
|
|
2166
2199
|
showSaveButton: enableActions(product.version_status),
|
|
2167
2200
|
version: version,
|
|
2201
|
+
desc: desc,
|
|
2202
|
+
setDesc: setDesc,
|
|
2203
|
+
fich: fich,
|
|
2204
|
+
setFich: setFich,
|
|
2205
|
+
imag: imag,
|
|
2206
|
+
setImag: setImag,
|
|
2207
|
+
updatedDescriptions: updatedDescriptions,
|
|
2208
|
+
updatedDatasheets: updatedDatasheets,
|
|
2209
|
+
selectedImages: selectedImages,
|
|
2210
|
+
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2211
|
+
setUpdatedDatasheets: setUpdatedDatasheets,
|
|
2212
|
+
setSelectedImages: setSelectedImages,
|
|
2168
2213
|
setShowVersionSelector: setShowVersionSelector,
|
|
2169
2214
|
onClickSave: function onClickSave() {
|
|
2170
2215
|
switch (activeTab) {
|
|
@@ -2230,52 +2275,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2230
2275
|
headerType: "input-name-header"
|
|
2231
2276
|
}))]
|
|
2232
2277
|
})
|
|
2233
|
-
}), isRevision() && getSectionStatus()
|
|
2234
|
-
className: "commentary-box",
|
|
2235
|
-
children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2236
|
-
className: "commentary",
|
|
2237
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2238
|
-
label: "Caja de Comentario",
|
|
2239
|
-
inputType: "textarea",
|
|
2240
|
-
inputCols: 80,
|
|
2241
|
-
inputRows: 4,
|
|
2242
|
-
inputId: "commentary-box",
|
|
2243
|
-
index: 0
|
|
2244
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2245
|
-
className: "buttons-box",
|
|
2246
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2247
|
-
buttonType: "general-transparent-button",
|
|
2248
|
-
label: "Enviar comentario",
|
|
2249
|
-
onClick: function onClick(e) {
|
|
2250
|
-
return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2251
|
-
}
|
|
2252
|
-
})
|
|
2253
|
-
})]
|
|
2254
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2255
|
-
className: "feedback-box",
|
|
2256
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2257
|
-
comment: comment.message,
|
|
2258
|
-
reviewed: crossComment
|
|
2259
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2260
|
-
buttonType: "circular-button accept-button",
|
|
2261
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2262
|
-
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2263
|
-
while (1) {
|
|
2264
|
-
switch (_context21.prev = _context21.next) {
|
|
2265
|
-
case 0:
|
|
2266
|
-
setCrossComment(true);
|
|
2267
|
-
commentRevised();
|
|
2268
|
-
|
|
2269
|
-
case 2:
|
|
2270
|
-
case "end":
|
|
2271
|
-
return _context21.stop();
|
|
2272
|
-
}
|
|
2273
|
-
}
|
|
2274
|
-
}, _callee21);
|
|
2275
|
-
}))
|
|
2276
|
-
})]
|
|
2277
|
-
})
|
|
2278
|
-
}) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2278
|
+
}), !(isRevision() && getSectionStatus()) && !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2279
2279
|
className: "required-inputs-message",
|
|
2280
2280
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2281
2281
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -2335,6 +2335,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2335
2335
|
currentVersion: version,
|
|
2336
2336
|
setShowVersionSelector: setShowVersionSelector,
|
|
2337
2337
|
jwt: token
|
|
2338
|
+
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2339
|
+
title: "Agregar mensaje de rechazo",
|
|
2340
|
+
show: showRejectModal,
|
|
2341
|
+
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2342
|
+
inputType: "textarea",
|
|
2343
|
+
inputId: "modal-message-box",
|
|
2344
|
+
index: 0,
|
|
2345
|
+
color: "white"
|
|
2346
|
+
}),
|
|
2347
|
+
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2348
|
+
type: "white",
|
|
2349
|
+
label: "Cancelar",
|
|
2350
|
+
size: 12,
|
|
2351
|
+
onClick: function onClick() {
|
|
2352
|
+
setShowRejectModal(false);
|
|
2353
|
+
}
|
|
2354
|
+
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2355
|
+
type: "pink",
|
|
2356
|
+
label: "Aceptar",
|
|
2357
|
+
size: 12,
|
|
2358
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2359
|
+
var body, messages;
|
|
2360
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2361
|
+
while (1) {
|
|
2362
|
+
switch (_context21.prev = _context21.next) {
|
|
2363
|
+
case 0:
|
|
2364
|
+
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2365
|
+
messages = [{
|
|
2366
|
+
type: "message",
|
|
2367
|
+
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2368
|
+
}];
|
|
2369
|
+
_context21.next = 4;
|
|
2370
|
+
return createComment(messages, activeRetailer.id);
|
|
2371
|
+
|
|
2372
|
+
case 4:
|
|
2373
|
+
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2374
|
+
setShowRejectModal(false);
|
|
2375
|
+
|
|
2376
|
+
case 6:
|
|
2377
|
+
case "end":
|
|
2378
|
+
return _context21.stop();
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
}, _callee21);
|
|
2382
|
+
}))
|
|
2383
|
+
}, "btn-Aceptar")]
|
|
2338
2384
|
})]
|
|
2339
2385
|
});
|
|
2340
2386
|
};
|
|
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n flex: 1;\n overflow: auto;\n\n .data-container {\n display: flex;\n flex: 0%;\n height: calc(100% - ", "px);\n .image-data-panel {\n width: 340px;\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .product-information {\n width: 100%;\n display: flex;\n flex-direction: column;\n\n .services-information-container {\n height: 100%;\n overflow: auto;\n }\n\n .image-services {\n aside {\n display: grid;\n grid-template-columns: repeat(auto-fill, 179px);\n column-gap: 15px;\n row-gap: 15px;\n padding: 20px;\n }\n }\n\n .commentary-box {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n padding: 10px;\n padding-left: 0;\n\n .commentary {\n display: flex;\n align-items: flex-end;\n\n .input-container {\n width: 500px;\n\n .quill {\n height: 100px;\n }\n\n & + * {\n margin-left: 5px;\n }\n }\n\n .buttons-box {\n display: flex;\n width: 210px;\n flex-wrap: wrap;\n\n .general-transparent-button {\n & + * {\n margin-top: 5px;\n }\n }\n\n .general-transparent-button,\n .general-green-button,\n .general-button-disabled {\n width: fit-content;\n min-width: 201px;\n height: 40px;\n }\n }\n }\n }\n\n .feedback-box {\n display: flex;\n }\n\n .required-inputs-message {\n font-family: ", ";\n font-size: 13px;\n color: ", ";\n padding: 10px;\n display: flex;\n align-items: center;\n\n p + * {\n margin-top: 10px;\n }\n\n button {\n min-width: fit-content;\n }\n }\n }\n }\n .container {\n width: 100%;\n height: 100%;\n .dropzone {\n height: 100%;\n width: 100%;\n }\n }\n"])), function (_ref) {
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n flex: 1;\n overflow: auto;\n\n .data-container {\n display: flex;\n flex: 0%;\n height: calc(100% - ", "px);\n .image-data-panel {\n width: 340px;\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .product-information {\n width: 100%;\n display: flex;\n flex-direction: column;\n\n .services-information-container {\n height: 100%;\n overflow: auto;\n }\n\n .image-services {\n aside {\n display: grid;\n grid-template-columns: repeat(auto-fill, 179px);\n column-gap: 15px;\n row-gap: 15px;\n padding: 20px;\n }\n }\n\n .commentary-box {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n padding: 10px;\n padding-left: 0;\n\n .commentary {\n display: flex;\n align-items: flex-end;\n\n .input-container {\n width: 500px;\n\n .quill {\n height: 100px;\n }\n\n & + * {\n margin-left: 5px;\n }\n }\n\n .buttons-box {\n display: flex;\n width: 210px;\n flex-wrap: wrap;\n\n .general-transparent-button {\n & + * {\n margin-top: 5px;\n }\n }\n\n .general-transparent-button,\n .general-green-button,\n .general-button-disabled {\n width: fit-content;\n min-width: 201px;\n height: 40px;\n }\n }\n }\n }\n\n .feedback-box {\n display: flex;\n }\n\n .required-inputs-message {\n font-family: ", ";\n font-size: 13px;\n color: ", ";\n padding: 10px;\n display: flex;\n align-items: center;\n\n p + * {\n margin-top: 10px;\n }\n\n button {\n min-width: fit-content;\n }\n }\n }\n }\n #modal-message-box {\n width: 400px;\n height: 100px;\n }\n .container {\n width: 100%;\n height: 100%;\n .dropzone {\n height: 100%;\n width: 100%;\n }\n }\n"])), function (_ref) {
|
|
19
19
|
var headerTop = _ref.headerTop;
|
|
20
20
|
return headerTop;
|
|
21
21
|
}, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4);
|