contentoh-components-library 21.3.87 → 21.3.89
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 -5
- package/.env.production +0 -3
- package/dist/assets/fonts/roboto/LICENSE.txt +202 -0
- package/dist/components/atoms/ButtonV2/styles.js +1 -1
- package/dist/components/atoms/Card/index.js +5 -46
- package/dist/components/atoms/Card/styles.js +1 -3
- package/dist/components/atoms/CheckBox/index.js +2 -4
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/atoms/ProgressBar/index.js +18 -10
- package/dist/components/atoms/TabSection/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +96 -171
- package/dist/components/pages/ProviderProductEdition/index.js +175 -188
- 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 +12 -51
- package/package.json +1 -3
- package/src/components/atoms/ButtonV2/styles.js +1 -1
- package/src/components/atoms/Card/index.js +2 -35
- package/src/components/atoms/Card/styles.js +5 -41
- package/src/components/atoms/CheckBox/index.js +0 -2
- package/src/components/atoms/InputFormatter/styles.js +1 -2
- package/src/components/atoms/ProgressBar/index.js +17 -8
- package/src/components/atoms/TabSection/styles.js +1 -0
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/TagAndInput/index.js +8 -10
- package/src/components/organisms/Chat/Chat.stories.js +7 -27
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
- package/src/components/organisms/Chat/ContentChat/index.js +12 -88
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +4 -46
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +98 -181
- package/src/components/pages/ProviderProductEdition/index.js +129 -132
- 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 -3
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
- package/src/components/molecules/StripeCardForm/index.js +0 -42
- package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
- package/src/components/molecules/StripeCardForm/styles.js +0 -73
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
- package/src/components/molecules/StripeCardSelector/index.js +0 -44
- package/src/components/molecules/StripeCardSelector/styles.js +0 -4
- package/src/components/molecules/StripeCardSelector/utils.js +0 -17
- package/src/components/organisms/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
|
}();
|
|
@@ -2039,7 +2026,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2039
2026
|
return;
|
|
2040
2027
|
} else if (user.is_retailer) {
|
|
2041
2028
|
if (product.id_order || product.orderId) {
|
|
2042
|
-
|
|
2029
|
+
setValidatedAll(true);
|
|
2030
|
+
showGlobalModal("error");
|
|
2043
2031
|
} else {
|
|
2044
2032
|
setDataGenericModal(function (prev) {
|
|
2045
2033
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2054,7 +2042,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2054
2042
|
showGlobalModal("generic");
|
|
2055
2043
|
}
|
|
2056
2044
|
} else {
|
|
2057
|
-
|
|
2045
|
+
setValidatedAll(true);
|
|
2046
|
+
showGlobalModal("error");
|
|
2058
2047
|
}
|
|
2059
2048
|
}
|
|
2060
2049
|
};
|
|
@@ -2064,7 +2053,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2064
2053
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2065
2054
|
setHeaderTop: setHeaderTop,
|
|
2066
2055
|
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
2067
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
2068
2056
|
productSelected: productSelected,
|
|
2069
2057
|
token: token,
|
|
2070
2058
|
activeRetailer: activeRetailer
|
|
@@ -2143,7 +2131,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2143
2131
|
} else if (user.is_retailer) {
|
|
2144
2132
|
if (product.id_order || product.orderId) {
|
|
2145
2133
|
setValidatedAll(true);
|
|
2146
|
-
|
|
2134
|
+
showGlobalModal("error");
|
|
2147
2135
|
} else {
|
|
2148
2136
|
setDataGenericModal(function (prev) {
|
|
2149
2137
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2158,15 +2146,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2158
2146
|
showGlobalModal("generic");
|
|
2159
2147
|
}
|
|
2160
2148
|
} else {
|
|
2161
|
-
setShowRejectModal(true);
|
|
2162
2149
|
setValidatedAll(true);
|
|
2150
|
+
showGlobalModal("error");
|
|
2163
2151
|
}
|
|
2164
2152
|
},
|
|
2165
2153
|
approve: function approve() {
|
|
2166
2154
|
return sendToEvaluation("A");
|
|
2167
2155
|
},
|
|
2168
2156
|
reject: function reject() {
|
|
2169
|
-
|
|
2157
|
+
return sendToEvaluation("R");
|
|
2170
2158
|
}
|
|
2171
2159
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2172
2160
|
tabsSections: tabsSections,
|
|
@@ -2253,7 +2241,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2253
2241
|
headerType: "input-name-header"
|
|
2254
2242
|
}))]
|
|
2255
2243
|
})
|
|
2256
|
-
}),
|
|
2244
|
+
}), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2245
|
+
className: "commentary-box",
|
|
2246
|
+
children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2247
|
+
className: "commentary",
|
|
2248
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2249
|
+
label: "Caja de Comentario",
|
|
2250
|
+
inputType: "textarea",
|
|
2251
|
+
inputCols: 80,
|
|
2252
|
+
inputRows: 4,
|
|
2253
|
+
inputId: "commentary-box",
|
|
2254
|
+
index: 0
|
|
2255
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2256
|
+
className: "buttons-box",
|
|
2257
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2258
|
+
buttonType: "general-transparent-button",
|
|
2259
|
+
label: "Enviar comentario",
|
|
2260
|
+
onClick: function onClick(e) {
|
|
2261
|
+
return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2262
|
+
}
|
|
2263
|
+
})
|
|
2264
|
+
})]
|
|
2265
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2266
|
+
className: "feedback-box",
|
|
2267
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2268
|
+
comment: comment.message,
|
|
2269
|
+
reviewed: crossComment
|
|
2270
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2271
|
+
buttonType: "circular-button accept-button",
|
|
2272
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2273
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2274
|
+
while (1) {
|
|
2275
|
+
switch (_context21.prev = _context21.next) {
|
|
2276
|
+
case 0:
|
|
2277
|
+
setCrossComment(true);
|
|
2278
|
+
commentRevised();
|
|
2279
|
+
|
|
2280
|
+
case 2:
|
|
2281
|
+
case "end":
|
|
2282
|
+
return _context21.stop();
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
}, _callee21);
|
|
2286
|
+
}))
|
|
2287
|
+
})]
|
|
2288
|
+
})
|
|
2289
|
+
}) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2257
2290
|
className: "required-inputs-message",
|
|
2258
2291
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2259
2292
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -2313,52 +2346,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2313
2346
|
currentVersion: version,
|
|
2314
2347
|
setShowVersionSelector: setShowVersionSelector,
|
|
2315
2348
|
jwt: token
|
|
2316
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2317
|
-
title: "Agregar mensaje de rechazo",
|
|
2318
|
-
show: showRejectModal,
|
|
2319
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2320
|
-
inputType: "textarea",
|
|
2321
|
-
inputId: "modal-message-box",
|
|
2322
|
-
index: 0,
|
|
2323
|
-
color: "white"
|
|
2324
|
-
}),
|
|
2325
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2326
|
-
type: "white",
|
|
2327
|
-
label: "Cancelar",
|
|
2328
|
-
size: 12,
|
|
2329
|
-
onClick: function onClick() {
|
|
2330
|
-
setShowRejectModal(false);
|
|
2331
|
-
}
|
|
2332
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2333
|
-
type: "pink",
|
|
2334
|
-
label: "Aceptar",
|
|
2335
|
-
size: 12,
|
|
2336
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2337
|
-
var body, messages;
|
|
2338
|
-
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2339
|
-
while (1) {
|
|
2340
|
-
switch (_context21.prev = _context21.next) {
|
|
2341
|
-
case 0:
|
|
2342
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2343
|
-
messages = [{
|
|
2344
|
-
type: "message",
|
|
2345
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2346
|
-
}];
|
|
2347
|
-
_context21.next = 4;
|
|
2348
|
-
return createComment(messages, activeRetailer.id);
|
|
2349
|
-
|
|
2350
|
-
case 4:
|
|
2351
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2352
|
-
setShowRejectModal(false);
|
|
2353
|
-
|
|
2354
|
-
case 6:
|
|
2355
|
-
case "end":
|
|
2356
|
-
return _context21.stop();
|
|
2357
|
-
}
|
|
2358
|
-
}
|
|
2359
|
-
}, _callee21);
|
|
2360
|
-
}))
|
|
2361
|
-
}, "btn-Aceptar")]
|
|
2362
2349
|
})]
|
|
2363
2350
|
});
|
|
2364
2351
|
};
|
|
@@ -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);
|