contentoh-components-library 21.3.54 → 21.3.56
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/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- 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/pages/Dashboard/Dashboard.stories.js +41 -34
- package/dist/components/pages/Dashboard/index.js +2 -2
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +127 -172
- package/dist/components/pages/ProviderProductEdition/index.js +129 -188
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +78 -75
- package/dist/components/pages/RetailerProductEdition/index.js +296 -287
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/package.json +1 -1
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- 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/OrderDetail/index.js +0 -1
- package/src/components/pages/Dashboard/Dashboard.stories.js +43 -34
- package/src/components/pages/Dashboard/index.js +2 -2
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +130 -177
- package/src/components/pages/ProviderProductEdition/index.js +55 -105
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +74 -69
- package/src/components/pages/RetailerProductEdition/index.js +157 -129
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
|
@@ -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$state, _location$state2,
|
|
209
|
+
var _product$retailers, _product$retailersAva, _location$state, _location$state2, _datasheets$, _datasheets$$data;
|
|
216
210
|
|
|
217
211
|
var tabsSections = _ref.tabsSections,
|
|
218
212
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -452,28 +446,23 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
452
446
|
validatedAll = _useState60[0],
|
|
453
447
|
setValidatedAll = _useState60[1];
|
|
454
448
|
|
|
455
|
-
var _useState61 = (0, _react.useState)(false),
|
|
456
|
-
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
457
|
-
showRejectModal = _useState62[0],
|
|
458
|
-
setShowRejectModal = _useState62[1];
|
|
459
|
-
|
|
460
449
|
var originProp = location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.origin;
|
|
461
450
|
|
|
462
|
-
var
|
|
451
|
+
var _useState61 = (0, _react.useState)({
|
|
463
452
|
"Ficha técnica": originProp,
|
|
464
453
|
Descripción: originProp,
|
|
465
454
|
Imágenes: originProp
|
|
466
455
|
}),
|
|
467
|
-
|
|
468
|
-
origin =
|
|
469
|
-
setOrigin =
|
|
456
|
+
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
457
|
+
origin = _useState62[0],
|
|
458
|
+
setOrigin = _useState62[1];
|
|
470
459
|
|
|
471
|
-
var
|
|
472
|
-
|
|
473
|
-
inCart =
|
|
474
|
-
setInCart =
|
|
460
|
+
var _useState63 = (0, _react.useState)(false),
|
|
461
|
+
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
462
|
+
inCart = _useState64[0],
|
|
463
|
+
setInCart = _useState64[1];
|
|
475
464
|
|
|
476
|
-
var
|
|
465
|
+
var _useState65 = (0, _react.useState)({
|
|
477
466
|
message: "¿Estás seguro de continuar?",
|
|
478
467
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
479
468
|
button1: {
|
|
@@ -488,34 +477,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
488
477
|
},
|
|
489
478
|
img: _defaultProfileImage.default
|
|
490
479
|
}),
|
|
480
|
+
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
481
|
+
dataGenericModal = _useState66[0],
|
|
482
|
+
setDataGenericModal = _useState66[1];
|
|
483
|
+
|
|
484
|
+
var _useState67 = (0, _react.useState)(null),
|
|
491
485
|
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
492
|
-
|
|
493
|
-
|
|
486
|
+
socketType = _useState68[0],
|
|
487
|
+
setSocketType = _useState68[1];
|
|
494
488
|
|
|
495
|
-
var _useState69 = (0, _react.useState)(
|
|
489
|
+
var _useState69 = (0, _react.useState)(loading),
|
|
496
490
|
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
497
|
-
|
|
498
|
-
|
|
491
|
+
saving = _useState70[0],
|
|
492
|
+
setSaving = _useState70[1];
|
|
499
493
|
|
|
500
|
-
var _useState71 = (0, _react.useState)(
|
|
494
|
+
var _useState71 = (0, _react.useState)(product.statusByRetailer),
|
|
501
495
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
var _useState73 = (0, _react.useState)(product.statusByRetailer),
|
|
506
|
-
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
507
|
-
retailerStatus = _useState74[0],
|
|
508
|
-
setRetailerStatus = _useState74[1];
|
|
496
|
+
retailerStatus = _useState72[0],
|
|
497
|
+
setRetailerStatus = _useState72[1];
|
|
509
498
|
|
|
510
499
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
511
500
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
512
501
|
showVersionSelector = _useCloseModal2[0],
|
|
513
502
|
setShowVersionSelector = _useCloseModal2[1];
|
|
514
503
|
|
|
515
|
-
var
|
|
516
|
-
|
|
517
|
-
globalModal =
|
|
518
|
-
setGlobalModal =
|
|
504
|
+
var _useState73 = (0, _react.useState)(),
|
|
505
|
+
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
506
|
+
globalModal = _useState74[0],
|
|
507
|
+
setGlobalModal = _useState74[1];
|
|
519
508
|
|
|
520
509
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
521
510
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -687,6 +676,30 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
687
676
|
});
|
|
688
677
|
|
|
689
678
|
switch (type) {
|
|
679
|
+
case "error":
|
|
680
|
+
setGlobalModal({
|
|
681
|
+
message: "".concat(activeTab, " rechazada"),
|
|
682
|
+
detail: "Agrega tu comentarios para enviar el rechazo",
|
|
683
|
+
img: _errorModal.default,
|
|
684
|
+
textArea: true,
|
|
685
|
+
button1: {
|
|
686
|
+
name: "Enviar",
|
|
687
|
+
action: function action(e) {
|
|
688
|
+
var textArea = document.querySelector("#area");
|
|
689
|
+
|
|
690
|
+
if (textArea.value) {
|
|
691
|
+
textArea.style.border = "none";
|
|
692
|
+
createComment(e, textArea.value);
|
|
693
|
+
showGlobalModal("commentsSent");
|
|
694
|
+
validatedAll ? validateAll("R") : sendEvaluation("R");
|
|
695
|
+
} else {
|
|
696
|
+
textArea.style.border = "2px solid red";
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
break;
|
|
702
|
+
|
|
690
703
|
case "generic":
|
|
691
704
|
setGlobalModal(dataGenericModal);
|
|
692
705
|
break;
|
|
@@ -949,7 +962,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
949
962
|
setServicesData(parsedResponse);
|
|
950
963
|
|
|
951
964
|
case 12:
|
|
952
|
-
|
|
965
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
953
966
|
|
|
954
967
|
case 13:
|
|
955
968
|
case "end":
|
|
@@ -1067,7 +1080,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1067
1080
|
}
|
|
1068
1081
|
|
|
1069
1082
|
setProduct(productTemp);
|
|
1070
|
-
|
|
1083
|
+
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1071
1084
|
}, [percentages]);
|
|
1072
1085
|
|
|
1073
1086
|
var loadInputs = function loadInputs() {
|
|
@@ -1446,33 +1459,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1446
1459
|
};
|
|
1447
1460
|
|
|
1448
1461
|
var createComment = /*#__PURE__*/function () {
|
|
1449
|
-
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1450
|
-
var
|
|
1451
|
-
retailerId,
|
|
1452
|
-
data,
|
|
1453
|
-
_args15 = arguments;
|
|
1462
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
|
|
1463
|
+
var concept, data;
|
|
1454
1464
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1455
1465
|
while (1) {
|
|
1456
1466
|
switch (_context15.prev = _context15.next) {
|
|
1457
1467
|
case 0:
|
|
1458
|
-
|
|
1459
|
-
|
|
1468
|
+
concept = "";
|
|
1469
|
+
_context15.t0 = activeTab;
|
|
1470
|
+
_context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
|
|
1471
|
+
break;
|
|
1472
|
+
|
|
1473
|
+
case 4:
|
|
1474
|
+
concept = "datasheet";
|
|
1475
|
+
return _context15.abrupt("break", 10);
|
|
1476
|
+
|
|
1477
|
+
case 6:
|
|
1478
|
+
concept = "images";
|
|
1479
|
+
return _context15.abrupt("break", 10);
|
|
1480
|
+
|
|
1481
|
+
case 8:
|
|
1482
|
+
concept = "description";
|
|
1483
|
+
return _context15.abrupt("break", 10);
|
|
1484
|
+
|
|
1485
|
+
case 10:
|
|
1460
1486
|
data = {
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1487
|
+
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1488
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1489
|
+
message: body,
|
|
1490
|
+
concept: concept,
|
|
1491
|
+
version: version
|
|
1492
|
+
};
|
|
1493
|
+
_context15.next = 13;
|
|
1494
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1495
|
+
headers: {
|
|
1469
1496
|
Authorization: token
|
|
1470
1497
|
}
|
|
1471
|
-
};
|
|
1472
|
-
setMessage("");
|
|
1473
|
-
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1498
|
+
});
|
|
1474
1499
|
|
|
1475
|
-
case
|
|
1500
|
+
case 13:
|
|
1476
1501
|
case "end":
|
|
1477
1502
|
return _context15.stop();
|
|
1478
1503
|
}
|
|
@@ -1480,7 +1505,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1480
1505
|
}, _callee15);
|
|
1481
1506
|
}));
|
|
1482
1507
|
|
|
1483
|
-
return function createComment() {
|
|
1508
|
+
return function createComment(_x4, _x5, _x6) {
|
|
1484
1509
|
return _ref13.apply(this, arguments);
|
|
1485
1510
|
};
|
|
1486
1511
|
}();
|
|
@@ -1579,7 +1604,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1579
1604
|
}, _callee17);
|
|
1580
1605
|
}));
|
|
1581
1606
|
|
|
1582
|
-
return function setAssignation(
|
|
1607
|
+
return function setAssignation(_x7, _x8) {
|
|
1583
1608
|
return _ref15.apply(this, arguments);
|
|
1584
1609
|
};
|
|
1585
1610
|
}();
|
|
@@ -1667,7 +1692,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1667
1692
|
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1668
1693
|
var _productTemp$id_order2;
|
|
1669
1694
|
|
|
1670
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus,
|
|
1695
|
+
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1671
1696
|
|
|
1672
1697
|
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1673
1698
|
while (1) {
|
|
@@ -1729,77 +1754,53 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1729
1754
|
res = _context18.sent;
|
|
1730
1755
|
|
|
1731
1756
|
case 30:
|
|
1732
|
-
if (
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
items: [{
|
|
1744
|
-
type: "status",
|
|
1745
|
-
value: _message
|
|
1746
|
-
}],
|
|
1747
|
-
retailerId: activeRetailer.id,
|
|
1748
|
-
status: product.status || productEdit.product.status
|
|
1749
|
-
},
|
|
1750
|
-
paramsHeader: {
|
|
1751
|
-
Authorization: token
|
|
1757
|
+
if (res.data.statusCode === 200) {
|
|
1758
|
+
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1759
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1760
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1761
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1762
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1763
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1764
|
+
|
|
1765
|
+
if (newServiceStatus) {
|
|
1766
|
+
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1767
|
+
productTemp["".concat(concept, "_status")] = status;
|
|
1752
1768
|
}
|
|
1753
|
-
};
|
|
1754
|
-
_context18.next = 36;
|
|
1755
|
-
return (0, _utils.sendMessage)(messageData);
|
|
1756
1769
|
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1763
|
-
|
|
1764
|
-
if (newServiceStatus) {
|
|
1765
|
-
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1766
|
-
productTemp["".concat(concept, "_status")] = status;
|
|
1770
|
+
setProduct(productTemp);
|
|
1771
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1772
|
+
setOrigin(function (prev) {
|
|
1773
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1774
|
+
});
|
|
1767
1775
|
}
|
|
1768
1776
|
|
|
1769
|
-
|
|
1770
|
-
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1771
|
-
setOrigin(function (prev) {
|
|
1772
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1773
|
-
});
|
|
1774
|
-
|
|
1775
|
-
case 45:
|
|
1776
|
-
_context18.next = 50;
|
|
1777
|
+
_context18.next = 36;
|
|
1777
1778
|
break;
|
|
1778
1779
|
|
|
1779
|
-
case
|
|
1780
|
-
_context18.prev =
|
|
1780
|
+
case 33:
|
|
1781
|
+
_context18.prev = 33;
|
|
1781
1782
|
_context18.t0 = _context18["catch"](9);
|
|
1782
1783
|
console.log(_context18.t0);
|
|
1783
1784
|
|
|
1784
|
-
case
|
|
1785
|
+
case 36:
|
|
1785
1786
|
loadData();
|
|
1786
1787
|
|
|
1787
|
-
case
|
|
1788
|
+
case 37:
|
|
1788
1789
|
case "end":
|
|
1789
1790
|
return _context18.stop();
|
|
1790
1791
|
}
|
|
1791
1792
|
}
|
|
1792
|
-
}, _callee18, null, [[9,
|
|
1793
|
+
}, _callee18, null, [[9, 33]]);
|
|
1793
1794
|
}));
|
|
1794
1795
|
|
|
1795
|
-
return function sendEvaluation(
|
|
1796
|
+
return function sendEvaluation(_x9) {
|
|
1796
1797
|
return _ref16.apply(this, arguments);
|
|
1797
1798
|
};
|
|
1798
1799
|
}();
|
|
1799
1800
|
|
|
1800
1801
|
var validateAll = /*#__PURE__*/function () {
|
|
1801
1802
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1802
|
-
var _product$id_order2, evaluationArray, conceptArray, dataGeneral,
|
|
1803
|
+
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1803
1804
|
|
|
1804
1805
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1805
1806
|
while (1) {
|
|
@@ -1815,7 +1816,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1815
1816
|
result: result,
|
|
1816
1817
|
isAproved: result === "A"
|
|
1817
1818
|
};
|
|
1818
|
-
messages = [];
|
|
1819
1819
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1820
1820
|
var service = ret.service,
|
|
1821
1821
|
id_retailer = ret.id_retailer;
|
|
@@ -1830,20 +1830,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1830
1830
|
Authorization: token
|
|
1831
1831
|
}
|
|
1832
1832
|
}));
|
|
1833
|
-
|
|
1834
|
-
if (product["".concat(ret.service, "_status")] !== "NS") {
|
|
1835
|
-
var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
|
|
1836
|
-
|
|
1837
|
-
messages.push(createComment([{
|
|
1838
|
-
type: "status",
|
|
1839
|
-
value: _message2
|
|
1840
|
-
}], ret.id_retailer));
|
|
1841
|
-
}
|
|
1842
1833
|
});
|
|
1843
|
-
_context19.next =
|
|
1834
|
+
_context19.next = 8;
|
|
1844
1835
|
return Promise.all(evaluationArray);
|
|
1845
1836
|
|
|
1846
|
-
case
|
|
1837
|
+
case 8:
|
|
1847
1838
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1848
1839
|
productTemp = product;
|
|
1849
1840
|
status = "".concat(result).concat(userType);
|
|
@@ -1873,31 +1864,27 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1873
1864
|
idCategory: productTemp.article.id_category,
|
|
1874
1865
|
product: productTemp
|
|
1875
1866
|
}));
|
|
1876
|
-
_context19.next =
|
|
1877
|
-
return Promise.all(messages);
|
|
1878
|
-
|
|
1879
|
-
case 26:
|
|
1880
|
-
_context19.next = 28;
|
|
1867
|
+
_context19.next = 25;
|
|
1881
1868
|
return loadData();
|
|
1882
1869
|
|
|
1883
|
-
case
|
|
1884
|
-
_context19.next =
|
|
1870
|
+
case 25:
|
|
1871
|
+
_context19.next = 30;
|
|
1885
1872
|
break;
|
|
1886
1873
|
|
|
1887
|
-
case
|
|
1888
|
-
_context19.prev =
|
|
1874
|
+
case 27:
|
|
1875
|
+
_context19.prev = 27;
|
|
1889
1876
|
_context19.t0 = _context19["catch"](0);
|
|
1890
1877
|
console.log(_context19.t0);
|
|
1891
1878
|
|
|
1892
|
-
case
|
|
1879
|
+
case 30:
|
|
1893
1880
|
case "end":
|
|
1894
1881
|
return _context19.stop();
|
|
1895
1882
|
}
|
|
1896
1883
|
}
|
|
1897
|
-
}, _callee19, null, [[0,
|
|
1884
|
+
}, _callee19, null, [[0, 27]]);
|
|
1898
1885
|
}));
|
|
1899
1886
|
|
|
1900
|
-
return function validateAll(
|
|
1887
|
+
return function validateAll(_x10) {
|
|
1901
1888
|
return _ref17.apply(this, arguments);
|
|
1902
1889
|
};
|
|
1903
1890
|
}();
|
|
@@ -1944,7 +1931,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1944
1931
|
}, _callee20);
|
|
1945
1932
|
}));
|
|
1946
1933
|
|
|
1947
|
-
return function evaluationToRetailer(
|
|
1934
|
+
return function evaluationToRetailer(_x11) {
|
|
1948
1935
|
return _ref18.apply(this, arguments);
|
|
1949
1936
|
};
|
|
1950
1937
|
}();
|
|
@@ -2028,7 +2015,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2028
2015
|
return;
|
|
2029
2016
|
} else if (user.is_retailer) {
|
|
2030
2017
|
if (product.id_order || product.orderId) {
|
|
2031
|
-
|
|
2018
|
+
setValidatedAll(true);
|
|
2019
|
+
showGlobalModal("error");
|
|
2032
2020
|
} else {
|
|
2033
2021
|
setDataGenericModal(function (prev) {
|
|
2034
2022
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2043,7 +2031,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2043
2031
|
showGlobalModal("generic");
|
|
2044
2032
|
}
|
|
2045
2033
|
} else {
|
|
2046
|
-
|
|
2034
|
+
setValidatedAll(true);
|
|
2035
|
+
showGlobalModal("error");
|
|
2047
2036
|
}
|
|
2048
2037
|
}
|
|
2049
2038
|
};
|
|
@@ -2053,7 +2042,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2053
2042
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2054
2043
|
setHeaderTop: setHeaderTop,
|
|
2055
2044
|
withChat: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.withChat,
|
|
2056
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.chatType,
|
|
2057
2045
|
productSelected: productSelected,
|
|
2058
2046
|
token: token,
|
|
2059
2047
|
activeRetailer: activeRetailer
|
|
@@ -2132,7 +2120,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2132
2120
|
} else if (user.is_retailer) {
|
|
2133
2121
|
if (product.id_order || product.orderId) {
|
|
2134
2122
|
setValidatedAll(true);
|
|
2135
|
-
|
|
2123
|
+
showGlobalModal("error");
|
|
2136
2124
|
} else {
|
|
2137
2125
|
setDataGenericModal(function (prev) {
|
|
2138
2126
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2147,15 +2135,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2147
2135
|
showGlobalModal("generic");
|
|
2148
2136
|
}
|
|
2149
2137
|
} else {
|
|
2150
|
-
setShowRejectModal(true);
|
|
2151
2138
|
setValidatedAll(true);
|
|
2139
|
+
showGlobalModal("error");
|
|
2152
2140
|
}
|
|
2153
2141
|
},
|
|
2154
2142
|
approve: function approve() {
|
|
2155
2143
|
return sendToEvaluation("A");
|
|
2156
2144
|
},
|
|
2157
2145
|
reject: function reject() {
|
|
2158
|
-
|
|
2146
|
+
return sendToEvaluation("R");
|
|
2159
2147
|
}
|
|
2160
2148
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2161
2149
|
tabsSections: tabsSections,
|
|
@@ -2340,53 +2328,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2340
2328
|
currentVersion: version,
|
|
2341
2329
|
setShowVersionSelector: setShowVersionSelector,
|
|
2342
2330
|
jwt: token
|
|
2343
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2344
|
-
title: "Agregar mensaje de rechazo",
|
|
2345
|
-
show: showRejectModal,
|
|
2346
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2347
|
-
label: "Caja de Comentario",
|
|
2348
|
-
inputType: "textarea",
|
|
2349
|
-
inputId: "modal-message-box",
|
|
2350
|
-
index: 0,
|
|
2351
|
-
color: "white"
|
|
2352
|
-
}),
|
|
2353
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2354
|
-
type: "white",
|
|
2355
|
-
label: "Cancelar",
|
|
2356
|
-
size: 12,
|
|
2357
|
-
onClick: function onClick() {
|
|
2358
|
-
setShowRejectModal(false);
|
|
2359
|
-
}
|
|
2360
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2361
|
-
type: "pink",
|
|
2362
|
-
label: "Aceptar",
|
|
2363
|
-
size: 12,
|
|
2364
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
2365
|
-
var body, messages;
|
|
2366
|
-
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
2367
|
-
while (1) {
|
|
2368
|
-
switch (_context22.prev = _context22.next) {
|
|
2369
|
-
case 0:
|
|
2370
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2371
|
-
messages = [{
|
|
2372
|
-
type: "message",
|
|
2373
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2374
|
-
}];
|
|
2375
|
-
_context22.next = 4;
|
|
2376
|
-
return createComment(messages, activeRetailer.id);
|
|
2377
|
-
|
|
2378
|
-
case 4:
|
|
2379
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2380
|
-
setShowRejectModal(false);
|
|
2381
|
-
|
|
2382
|
-
case 6:
|
|
2383
|
-
case "end":
|
|
2384
|
-
return _context22.stop();
|
|
2385
|
-
}
|
|
2386
|
-
}
|
|
2387
|
-
}, _callee22);
|
|
2388
|
-
}))
|
|
2389
|
-
}, "btn-Aceptar")]
|
|
2390
2331
|
})]
|
|
2391
2332
|
});
|
|
2392
2333
|
};
|
|
@@ -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);
|