contentoh-components-library 21.3.66 → 21.3.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.development +0 -2
- package/dist/assets/fonts/roboto/LICENSE.txt +202 -0
- package/dist/components/atoms/ButtonV2/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 +1 -21
- 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 +191 -343
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +3 -48
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/organisms/SideModal/index.js +0 -11
- package/dist/components/organisms/SideModal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +96 -171
- package/dist/components/pages/ProviderProductEdition/index.js +182 -191
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +28 -40
- package/dist/components/pages/RetailerProductEdition/index.js +273 -265
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/index.js +0 -13
- package/package.json +1 -1
- package/src/components/atoms/ButtonV2/styles.js +1 -1
- package/src/components/atoms/InputFormatter/styles.js +1 -2
- package/src/components/molecules/AvatarAndValidation/index.js +1 -1
- 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 +0 -21
- 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 +6 -81
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +3 -47
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +98 -181
- package/src/components/pages/ProviderProductEdition/index.js +133 -135
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +26 -38
- package/src/components/pages/RetailerProductEdition/index.js +135 -109
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/index.js +0 -1
- 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() {
|
|
@@ -1453,33 +1466,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1453
1466
|
};
|
|
1454
1467
|
|
|
1455
1468
|
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;
|
|
1469
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
|
|
1470
|
+
var concept, data;
|
|
1461
1471
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1462
1472
|
while (1) {
|
|
1463
1473
|
switch (_context15.prev = _context15.next) {
|
|
1464
1474
|
case 0:
|
|
1465
|
-
|
|
1466
|
-
|
|
1475
|
+
concept = "";
|
|
1476
|
+
_context15.t0 = activeTab;
|
|
1477
|
+
_context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
|
|
1478
|
+
break;
|
|
1479
|
+
|
|
1480
|
+
case 4:
|
|
1481
|
+
concept = "datasheet";
|
|
1482
|
+
return _context15.abrupt("break", 10);
|
|
1483
|
+
|
|
1484
|
+
case 6:
|
|
1485
|
+
concept = "images";
|
|
1486
|
+
return _context15.abrupt("break", 10);
|
|
1487
|
+
|
|
1488
|
+
case 8:
|
|
1489
|
+
concept = "description";
|
|
1490
|
+
return _context15.abrupt("break", 10);
|
|
1491
|
+
|
|
1492
|
+
case 10:
|
|
1467
1493
|
data = {
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1494
|
+
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1495
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1496
|
+
message: body,
|
|
1497
|
+
concept: concept,
|
|
1498
|
+
version: version
|
|
1499
|
+
};
|
|
1500
|
+
_context15.next = 13;
|
|
1501
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1502
|
+
headers: {
|
|
1476
1503
|
Authorization: token
|
|
1477
1504
|
}
|
|
1478
|
-
};
|
|
1479
|
-
setMessage("");
|
|
1480
|
-
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1505
|
+
});
|
|
1481
1506
|
|
|
1482
|
-
case
|
|
1507
|
+
case 13:
|
|
1483
1508
|
case "end":
|
|
1484
1509
|
return _context15.stop();
|
|
1485
1510
|
}
|
|
@@ -1487,7 +1512,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1487
1512
|
}, _callee15);
|
|
1488
1513
|
}));
|
|
1489
1514
|
|
|
1490
|
-
return function createComment() {
|
|
1515
|
+
return function createComment(_x4, _x5, _x6) {
|
|
1491
1516
|
return _ref13.apply(this, arguments);
|
|
1492
1517
|
};
|
|
1493
1518
|
}();
|
|
@@ -1586,7 +1611,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1586
1611
|
}, _callee17);
|
|
1587
1612
|
}));
|
|
1588
1613
|
|
|
1589
|
-
return function setAssignation(
|
|
1614
|
+
return function setAssignation(_x7, _x8) {
|
|
1590
1615
|
return _ref15.apply(this, arguments);
|
|
1591
1616
|
};
|
|
1592
1617
|
}();
|
|
@@ -1674,7 +1699,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1674
1699
|
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1675
1700
|
var _productTemp$id_order2;
|
|
1676
1701
|
|
|
1677
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus,
|
|
1702
|
+
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1678
1703
|
|
|
1679
1704
|
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1680
1705
|
while (1) {
|
|
@@ -1736,77 +1761,53 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1736
1761
|
res = _context18.sent;
|
|
1737
1762
|
|
|
1738
1763
|
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
|
|
1764
|
+
if (res.data.statusCode === 200) {
|
|
1765
|
+
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1766
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1767
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1768
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1769
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1770
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1771
|
+
|
|
1772
|
+
if (newServiceStatus) {
|
|
1773
|
+
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1774
|
+
productTemp["".concat(concept, "_status")] = status;
|
|
1759
1775
|
}
|
|
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
1776
|
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1777
|
+
setProduct(productTemp);
|
|
1778
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1779
|
+
setOrigin(function (prev) {
|
|
1780
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1781
|
+
});
|
|
1774
1782
|
}
|
|
1775
1783
|
|
|
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;
|
|
1784
|
+
_context18.next = 36;
|
|
1784
1785
|
break;
|
|
1785
1786
|
|
|
1786
|
-
case
|
|
1787
|
-
_context18.prev =
|
|
1787
|
+
case 33:
|
|
1788
|
+
_context18.prev = 33;
|
|
1788
1789
|
_context18.t0 = _context18["catch"](9);
|
|
1789
1790
|
console.log(_context18.t0);
|
|
1790
1791
|
|
|
1791
|
-
case
|
|
1792
|
+
case 36:
|
|
1792
1793
|
loadData();
|
|
1793
1794
|
|
|
1794
|
-
case
|
|
1795
|
+
case 37:
|
|
1795
1796
|
case "end":
|
|
1796
1797
|
return _context18.stop();
|
|
1797
1798
|
}
|
|
1798
1799
|
}
|
|
1799
|
-
}, _callee18, null, [[9,
|
|
1800
|
+
}, _callee18, null, [[9, 33]]);
|
|
1800
1801
|
}));
|
|
1801
1802
|
|
|
1802
|
-
return function sendEvaluation(
|
|
1803
|
+
return function sendEvaluation(_x9) {
|
|
1803
1804
|
return _ref16.apply(this, arguments);
|
|
1804
1805
|
};
|
|
1805
1806
|
}();
|
|
1806
1807
|
|
|
1807
1808
|
var validateAll = /*#__PURE__*/function () {
|
|
1808
1809
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1809
|
-
var _product$id_order2, evaluationArray, conceptArray, dataGeneral,
|
|
1810
|
+
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1810
1811
|
|
|
1811
1812
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1812
1813
|
while (1) {
|
|
@@ -1822,7 +1823,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1822
1823
|
result: result,
|
|
1823
1824
|
isAproved: result === "A"
|
|
1824
1825
|
};
|
|
1825
|
-
messages = [];
|
|
1826
1826
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1827
1827
|
var service = ret.service,
|
|
1828
1828
|
id_retailer = ret.id_retailer;
|
|
@@ -1837,20 +1837,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1837
1837
|
Authorization: token
|
|
1838
1838
|
}
|
|
1839
1839
|
}));
|
|
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
1840
|
});
|
|
1850
|
-
_context19.next =
|
|
1841
|
+
_context19.next = 8;
|
|
1851
1842
|
return Promise.all(evaluationArray);
|
|
1852
1843
|
|
|
1853
|
-
case
|
|
1844
|
+
case 8:
|
|
1854
1845
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1855
1846
|
productTemp = product;
|
|
1856
1847
|
status = "".concat(result).concat(userType);
|
|
@@ -1880,31 +1871,27 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1880
1871
|
idCategory: productTemp.article.id_category,
|
|
1881
1872
|
product: productTemp
|
|
1882
1873
|
}));
|
|
1883
|
-
_context19.next =
|
|
1884
|
-
return Promise.all(messages);
|
|
1885
|
-
|
|
1886
|
-
case 26:
|
|
1887
|
-
_context19.next = 28;
|
|
1874
|
+
_context19.next = 25;
|
|
1888
1875
|
return loadData();
|
|
1889
1876
|
|
|
1890
|
-
case
|
|
1891
|
-
_context19.next =
|
|
1877
|
+
case 25:
|
|
1878
|
+
_context19.next = 30;
|
|
1892
1879
|
break;
|
|
1893
1880
|
|
|
1894
|
-
case
|
|
1895
|
-
_context19.prev =
|
|
1881
|
+
case 27:
|
|
1882
|
+
_context19.prev = 27;
|
|
1896
1883
|
_context19.t0 = _context19["catch"](0);
|
|
1897
1884
|
console.log(_context19.t0);
|
|
1898
1885
|
|
|
1899
|
-
case
|
|
1886
|
+
case 30:
|
|
1900
1887
|
case "end":
|
|
1901
1888
|
return _context19.stop();
|
|
1902
1889
|
}
|
|
1903
1890
|
}
|
|
1904
|
-
}, _callee19, null, [[0,
|
|
1891
|
+
}, _callee19, null, [[0, 27]]);
|
|
1905
1892
|
}));
|
|
1906
1893
|
|
|
1907
|
-
return function validateAll(
|
|
1894
|
+
return function validateAll(_x10) {
|
|
1908
1895
|
return _ref17.apply(this, arguments);
|
|
1909
1896
|
};
|
|
1910
1897
|
}();
|
|
@@ -1951,7 +1938,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1951
1938
|
}, _callee20);
|
|
1952
1939
|
}));
|
|
1953
1940
|
|
|
1954
|
-
return function evaluationToRetailer(
|
|
1941
|
+
return function evaluationToRetailer(_x11) {
|
|
1955
1942
|
return _ref18.apply(this, arguments);
|
|
1956
1943
|
};
|
|
1957
1944
|
}();
|
|
@@ -1998,6 +1985,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1998
1985
|
}];
|
|
1999
1986
|
|
|
2000
1987
|
var sendToEvaluation = function sendToEvaluation(result) {
|
|
1988
|
+
console.log({
|
|
1989
|
+
result: result
|
|
1990
|
+
});
|
|
1991
|
+
|
|
2001
1992
|
if (result === "A") {
|
|
2002
1993
|
if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
2003
1994
|
setDataGenericModal(function (prev) {
|
|
@@ -2031,11 +2022,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2031
2022
|
sendEvaluation("A");
|
|
2032
2023
|
}
|
|
2033
2024
|
} else {
|
|
2034
|
-
if (
|
|
2025
|
+
if (origin === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
2035
2026
|
return;
|
|
2036
2027
|
} else if (user.is_retailer) {
|
|
2037
2028
|
if (product.id_order || product.orderId) {
|
|
2038
|
-
|
|
2029
|
+
setValidatedAll(true);
|
|
2030
|
+
showGlobalModal("error");
|
|
2039
2031
|
} else {
|
|
2040
2032
|
setDataGenericModal(function (prev) {
|
|
2041
2033
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2050,7 +2042,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2050
2042
|
showGlobalModal("generic");
|
|
2051
2043
|
}
|
|
2052
2044
|
} else {
|
|
2053
|
-
|
|
2045
|
+
setValidatedAll(true);
|
|
2046
|
+
showGlobalModal("error");
|
|
2054
2047
|
}
|
|
2055
2048
|
}
|
|
2056
2049
|
};
|
|
@@ -2060,7 +2053,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2060
2053
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2061
2054
|
setHeaderTop: setHeaderTop,
|
|
2062
2055
|
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
2063
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
2064
2056
|
productSelected: productSelected,
|
|
2065
2057
|
token: token,
|
|
2066
2058
|
activeRetailer: activeRetailer
|
|
@@ -2101,7 +2093,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2101
2093
|
servicesData: servicesData ? servicesData : null,
|
|
2102
2094
|
showApproveRejectAll: isRevision() && getSectionStatus(),
|
|
2103
2095
|
approveAll: function approveAll() {
|
|
2104
|
-
if (
|
|
2096
|
+
if (origin === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
2105
2097
|
setDataGenericModal(function (prev) {
|
|
2106
2098
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
2107
2099
|
button2: {
|
|
@@ -2134,12 +2126,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2134
2126
|
}
|
|
2135
2127
|
},
|
|
2136
2128
|
rejectAll: function rejectAll() {
|
|
2137
|
-
if (
|
|
2129
|
+
if (origin === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
2138
2130
|
return;
|
|
2139
2131
|
} else if (user.is_retailer) {
|
|
2140
2132
|
if (product.id_order || product.orderId) {
|
|
2141
2133
|
setValidatedAll(true);
|
|
2142
|
-
|
|
2134
|
+
showGlobalModal("error");
|
|
2143
2135
|
} else {
|
|
2144
2136
|
setDataGenericModal(function (prev) {
|
|
2145
2137
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2154,15 +2146,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2154
2146
|
showGlobalModal("generic");
|
|
2155
2147
|
}
|
|
2156
2148
|
} else {
|
|
2157
|
-
setShowRejectModal(true);
|
|
2158
2149
|
setValidatedAll(true);
|
|
2150
|
+
showGlobalModal("error");
|
|
2159
2151
|
}
|
|
2160
2152
|
},
|
|
2161
2153
|
approve: function approve() {
|
|
2162
2154
|
return sendToEvaluation("A");
|
|
2163
2155
|
},
|
|
2164
2156
|
reject: function reject() {
|
|
2165
|
-
|
|
2157
|
+
return sendToEvaluation("R");
|
|
2166
2158
|
}
|
|
2167
2159
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2168
2160
|
tabsSections: tabsSections,
|
|
@@ -2242,7 +2234,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2242
2234
|
headerType: "input-name-header"
|
|
2243
2235
|
}))]
|
|
2244
2236
|
})
|
|
2245
|
-
}),
|
|
2237
|
+
}), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2238
|
+
className: "commentary-box",
|
|
2239
|
+
children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2240
|
+
className: "commentary",
|
|
2241
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2242
|
+
label: "Caja de Comentario",
|
|
2243
|
+
inputType: "textarea",
|
|
2244
|
+
inputCols: 80,
|
|
2245
|
+
inputRows: 4,
|
|
2246
|
+
inputId: "commentary-box",
|
|
2247
|
+
index: 0
|
|
2248
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2249
|
+
className: "buttons-box",
|
|
2250
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2251
|
+
buttonType: "general-transparent-button",
|
|
2252
|
+
label: "Enviar comentario",
|
|
2253
|
+
onClick: function onClick(e) {
|
|
2254
|
+
return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2255
|
+
}
|
|
2256
|
+
})
|
|
2257
|
+
})]
|
|
2258
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2259
|
+
className: "feedback-box",
|
|
2260
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2261
|
+
comment: comment.message,
|
|
2262
|
+
reviewed: crossComment
|
|
2263
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2264
|
+
buttonType: "circular-button accept-button",
|
|
2265
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2266
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2267
|
+
while (1) {
|
|
2268
|
+
switch (_context21.prev = _context21.next) {
|
|
2269
|
+
case 0:
|
|
2270
|
+
setCrossComment(true);
|
|
2271
|
+
commentRevised();
|
|
2272
|
+
|
|
2273
|
+
case 2:
|
|
2274
|
+
case "end":
|
|
2275
|
+
return _context21.stop();
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
}, _callee21);
|
|
2279
|
+
}))
|
|
2280
|
+
})]
|
|
2281
|
+
})
|
|
2282
|
+
}) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2246
2283
|
className: "required-inputs-message",
|
|
2247
2284
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2248
2285
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -2302,52 +2339,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2302
2339
|
currentVersion: version,
|
|
2303
2340
|
setShowVersionSelector: setShowVersionSelector,
|
|
2304
2341
|
jwt: token
|
|
2305
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2306
|
-
title: "Agregar mensaje de rechazo",
|
|
2307
|
-
show: showRejectModal,
|
|
2308
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2309
|
-
inputType: "textarea",
|
|
2310
|
-
inputId: "modal-message-box",
|
|
2311
|
-
index: 0,
|
|
2312
|
-
color: "white"
|
|
2313
|
-
}),
|
|
2314
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2315
|
-
type: "white",
|
|
2316
|
-
label: "Cancelar",
|
|
2317
|
-
size: 12,
|
|
2318
|
-
onClick: function onClick() {
|
|
2319
|
-
setShowRejectModal(false);
|
|
2320
|
-
}
|
|
2321
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2322
|
-
type: "pink",
|
|
2323
|
-
label: "Aceptar",
|
|
2324
|
-
size: 12,
|
|
2325
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2326
|
-
var body, messages;
|
|
2327
|
-
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2328
|
-
while (1) {
|
|
2329
|
-
switch (_context21.prev = _context21.next) {
|
|
2330
|
-
case 0:
|
|
2331
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2332
|
-
messages = [{
|
|
2333
|
-
type: "message",
|
|
2334
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2335
|
-
}];
|
|
2336
|
-
_context21.next = 4;
|
|
2337
|
-
return createComment(messages, activeRetailer.id);
|
|
2338
|
-
|
|
2339
|
-
case 4:
|
|
2340
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2341
|
-
setShowRejectModal(false);
|
|
2342
|
-
|
|
2343
|
-
case 6:
|
|
2344
|
-
case "end":
|
|
2345
|
-
return _context21.stop();
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
}, _callee21);
|
|
2349
|
-
}))
|
|
2350
|
-
}, "btn-Aceptar")]
|
|
2351
2342
|
})]
|
|
2352
2343
|
});
|
|
2353
2344
|
};
|
|
@@ -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
|
|
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) {
|
|
19
19
|
var headerTop = _ref.headerTop;
|
|
20
20
|
return headerTop;
|
|
21
21
|
}, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4);
|