contentoh-components-library 21.3.59 → 21.3.60
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 +2 -0
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +68 -11
- package/dist/components/organisms/Chat/Chat.stories.js +21 -1
- package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +343 -191
- package/dist/components/organisms/Chat/Footer/index.js +48 -39
- package/dist/components/organisms/Chat/index.js +48 -3
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/SideModal/SideModal.stories.js +42 -0
- package/dist/components/organisms/SideModal/index.js +61 -0
- package/dist/components/organisms/SideModal/styles.js +18 -0
- package/dist/components/pages/Dashboard/Dashboard.stories.js +38 -45
- package/dist/components/pages/Dashboard/index.js +8 -4
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +172 -127
- package/dist/components/pages/ProviderProductEdition/index.js +188 -129
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +7 -3
- package/dist/components/pages/RetailerProductEdition/index.js +267 -274
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
- package/package.json +1 -1
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +52 -6
- package/src/components/organisms/Chat/Chat.stories.js +21 -0
- package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
- package/src/components/organisms/Chat/ContainerItems/styles.js +10 -2
- package/src/components/organisms/Chat/ContentChat/index.js +81 -6
- package/src/components/organisms/Chat/Footer/index.js +11 -0
- package/src/components/organisms/Chat/index.js +47 -3
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
- package/src/components/organisms/SideModal/index.js +41 -0
- package/src/components/organisms/SideModal/styles.js +21 -0
- package/src/components/pages/Dashboard/Dashboard.stories.js +38 -47
- package/src/components/pages/Dashboard/index.js +4 -3
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +177 -130
- package/src/components/pages/ProviderProductEdition/index.js +105 -55
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +6 -2
- package/src/components/pages/RetailerProductEdition/index.js +111 -135
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
|
@@ -93,6 +93,12 @@ var _VersionSelector = require("../../organisms/VersionSelector");
|
|
|
93
93
|
|
|
94
94
|
var _customHooks = require("../../../global-files/customHooks");
|
|
95
95
|
|
|
96
|
+
var _utils = require("../RetailerProductEdition/utils");
|
|
97
|
+
|
|
98
|
+
var _Modal = require("../../organisms/Modal");
|
|
99
|
+
|
|
100
|
+
var _ButtonV = require("../../atoms/ButtonV2");
|
|
101
|
+
|
|
96
102
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
97
103
|
|
|
98
104
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -206,7 +212,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
206
212
|
});
|
|
207
213
|
|
|
208
214
|
var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
209
|
-
var _product$retailers, _product$retailersAva, _location$state, _location$state2, _datasheets$, _datasheets$$data;
|
|
215
|
+
var _product$retailers, _product$retailersAva, _location$state, _location$state2, _location$state3, _datasheets$, _datasheets$$data;
|
|
210
216
|
|
|
211
217
|
var tabsSections = _ref.tabsSections,
|
|
212
218
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -446,23 +452,28 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
446
452
|
validatedAll = _useState60[0],
|
|
447
453
|
setValidatedAll = _useState60[1];
|
|
448
454
|
|
|
455
|
+
var _useState61 = (0, _react.useState)(false),
|
|
456
|
+
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
457
|
+
showRejectModal = _useState62[0],
|
|
458
|
+
setShowRejectModal = _useState62[1];
|
|
459
|
+
|
|
449
460
|
var originProp = location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.origin;
|
|
450
461
|
|
|
451
|
-
var
|
|
462
|
+
var _useState63 = (0, _react.useState)({
|
|
452
463
|
"Ficha técnica": originProp,
|
|
453
464
|
Descripción: originProp,
|
|
454
465
|
Imágenes: originProp
|
|
455
466
|
}),
|
|
456
|
-
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
457
|
-
origin = _useState62[0],
|
|
458
|
-
setOrigin = _useState62[1];
|
|
459
|
-
|
|
460
|
-
var _useState63 = (0, _react.useState)(false),
|
|
461
467
|
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
462
|
-
|
|
463
|
-
|
|
468
|
+
origin = _useState64[0],
|
|
469
|
+
setOrigin = _useState64[1];
|
|
470
|
+
|
|
471
|
+
var _useState65 = (0, _react.useState)(false),
|
|
472
|
+
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
473
|
+
inCart = _useState66[0],
|
|
474
|
+
setInCart = _useState66[1];
|
|
464
475
|
|
|
465
|
-
var
|
|
476
|
+
var _useState67 = (0, _react.useState)({
|
|
466
477
|
message: "¿Estás seguro de continuar?",
|
|
467
478
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
468
479
|
button1: {
|
|
@@ -477,34 +488,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
477
488
|
},
|
|
478
489
|
img: _defaultProfileImage.default
|
|
479
490
|
}),
|
|
480
|
-
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
481
|
-
dataGenericModal = _useState66[0],
|
|
482
|
-
setDataGenericModal = _useState66[1];
|
|
483
|
-
|
|
484
|
-
var _useState67 = (0, _react.useState)(null),
|
|
485
491
|
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
486
|
-
|
|
487
|
-
|
|
492
|
+
dataGenericModal = _useState68[0],
|
|
493
|
+
setDataGenericModal = _useState68[1];
|
|
488
494
|
|
|
489
|
-
var _useState69 = (0, _react.useState)(
|
|
495
|
+
var _useState69 = (0, _react.useState)(null),
|
|
490
496
|
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
491
|
-
|
|
492
|
-
|
|
497
|
+
socketType = _useState70[0],
|
|
498
|
+
setSocketType = _useState70[1];
|
|
493
499
|
|
|
494
|
-
var _useState71 = (0, _react.useState)(
|
|
500
|
+
var _useState71 = (0, _react.useState)(loading),
|
|
495
501
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
496
|
-
|
|
497
|
-
|
|
502
|
+
saving = _useState72[0],
|
|
503
|
+
setSaving = _useState72[1];
|
|
504
|
+
|
|
505
|
+
var _useState73 = (0, _react.useState)(product.statusByRetailer),
|
|
506
|
+
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
507
|
+
retailerStatus = _useState74[0],
|
|
508
|
+
setRetailerStatus = _useState74[1];
|
|
498
509
|
|
|
499
510
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
500
511
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
501
512
|
showVersionSelector = _useCloseModal2[0],
|
|
502
513
|
setShowVersionSelector = _useCloseModal2[1];
|
|
503
514
|
|
|
504
|
-
var
|
|
505
|
-
|
|
506
|
-
globalModal =
|
|
507
|
-
setGlobalModal =
|
|
515
|
+
var _useState75 = (0, _react.useState)(),
|
|
516
|
+
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
517
|
+
globalModal = _useState76[0],
|
|
518
|
+
setGlobalModal = _useState76[1];
|
|
508
519
|
|
|
509
520
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
510
521
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -676,30 +687,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
676
687
|
});
|
|
677
688
|
|
|
678
689
|
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
|
-
|
|
703
690
|
case "generic":
|
|
704
691
|
setGlobalModal(dataGenericModal);
|
|
705
692
|
break;
|
|
@@ -962,7 +949,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
962
949
|
setServicesData(parsedResponse);
|
|
963
950
|
|
|
964
951
|
case 12:
|
|
965
|
-
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
952
|
+
retailers && !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
966
953
|
|
|
967
954
|
case 13:
|
|
968
955
|
case "end":
|
|
@@ -1080,7 +1067,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1080
1067
|
}
|
|
1081
1068
|
|
|
1082
1069
|
setProduct(productTemp);
|
|
1083
|
-
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1070
|
+
retailers && setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1084
1071
|
}, [percentages]);
|
|
1085
1072
|
|
|
1086
1073
|
var loadInputs = function loadInputs() {
|
|
@@ -1459,45 +1446,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1459
1446
|
};
|
|
1460
1447
|
|
|
1461
1448
|
var createComment = /*#__PURE__*/function () {
|
|
1462
|
-
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(
|
|
1463
|
-
var
|
|
1449
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1450
|
+
var messages,
|
|
1451
|
+
retailerId,
|
|
1452
|
+
data,
|
|
1453
|
+
_args15 = arguments;
|
|
1464
1454
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1465
1455
|
while (1) {
|
|
1466
1456
|
switch (_context15.prev = _context15.next) {
|
|
1467
1457
|
case 0:
|
|
1468
|
-
|
|
1469
|
-
|
|
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:
|
|
1458
|
+
messages = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : [];
|
|
1459
|
+
retailerId = _args15.length > 1 ? _args15[1] : undefined;
|
|
1486
1460
|
data = {
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
headers: {
|
|
1461
|
+
paramsBody: {
|
|
1462
|
+
id: product.article.id_article || productEdit.ArticleId,
|
|
1463
|
+
version: version,
|
|
1464
|
+
items: messages,
|
|
1465
|
+
retailerId: retailerId,
|
|
1466
|
+
status: product.status || productEdit.product.status
|
|
1467
|
+
},
|
|
1468
|
+
paramsHeader: {
|
|
1496
1469
|
Authorization: token
|
|
1497
1470
|
}
|
|
1498
|
-
}
|
|
1471
|
+
};
|
|
1472
|
+
setMessage("");
|
|
1473
|
+
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1499
1474
|
|
|
1500
|
-
case
|
|
1475
|
+
case 5:
|
|
1501
1476
|
case "end":
|
|
1502
1477
|
return _context15.stop();
|
|
1503
1478
|
}
|
|
@@ -1505,7 +1480,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1505
1480
|
}, _callee15);
|
|
1506
1481
|
}));
|
|
1507
1482
|
|
|
1508
|
-
return function createComment(
|
|
1483
|
+
return function createComment() {
|
|
1509
1484
|
return _ref13.apply(this, arguments);
|
|
1510
1485
|
};
|
|
1511
1486
|
}();
|
|
@@ -1604,7 +1579,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1604
1579
|
}, _callee17);
|
|
1605
1580
|
}));
|
|
1606
1581
|
|
|
1607
|
-
return function setAssignation(
|
|
1582
|
+
return function setAssignation(_x4, _x5) {
|
|
1608
1583
|
return _ref15.apply(this, arguments);
|
|
1609
1584
|
};
|
|
1610
1585
|
}();
|
|
@@ -1692,7 +1667,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1692
1667
|
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1693
1668
|
var _productTemp$id_order2;
|
|
1694
1669
|
|
|
1695
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1670
|
+
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, _message, messageData, retailerStatusCopy, status;
|
|
1696
1671
|
|
|
1697
1672
|
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1698
1673
|
while (1) {
|
|
@@ -1754,53 +1729,77 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1754
1729
|
res = _context18.sent;
|
|
1755
1730
|
|
|
1756
1731
|
case 30:
|
|
1757
|
-
if (res.data.statusCode === 200) {
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1732
|
+
if (!(res.data.statusCode === 200)) {
|
|
1733
|
+
_context18.next = 45;
|
|
1734
|
+
break;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1738
|
+
_message = (0, _utils.createMessage)(product.retailers || product.retailersAvailable, activeRetailer.id, product[sectionStatusKey], newStatus, activeTab);
|
|
1739
|
+
messageData = {
|
|
1740
|
+
paramsBody: {
|
|
1741
|
+
id: product.article.id_article || productEdit.ArticleId,
|
|
1742
|
+
version: version,
|
|
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
|
|
1768
1752
|
}
|
|
1753
|
+
};
|
|
1754
|
+
_context18.next = 36;
|
|
1755
|
+
return (0, _utils.sendMessage)(messageData);
|
|
1769
1756
|
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1757
|
+
case 36:
|
|
1758
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1759
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1760
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1761
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1762
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1763
|
+
|
|
1764
|
+
if (newServiceStatus) {
|
|
1765
|
+
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1766
|
+
productTemp["".concat(concept, "_status")] = status;
|
|
1775
1767
|
}
|
|
1776
1768
|
|
|
1777
|
-
|
|
1769
|
+
setProduct(productTemp);
|
|
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;
|
|
1778
1777
|
break;
|
|
1779
1778
|
|
|
1780
|
-
case
|
|
1781
|
-
_context18.prev =
|
|
1779
|
+
case 47:
|
|
1780
|
+
_context18.prev = 47;
|
|
1782
1781
|
_context18.t0 = _context18["catch"](9);
|
|
1783
1782
|
console.log(_context18.t0);
|
|
1784
1783
|
|
|
1785
|
-
case
|
|
1784
|
+
case 50:
|
|
1786
1785
|
loadData();
|
|
1787
1786
|
|
|
1788
|
-
case
|
|
1787
|
+
case 51:
|
|
1789
1788
|
case "end":
|
|
1790
1789
|
return _context18.stop();
|
|
1791
1790
|
}
|
|
1792
1791
|
}
|
|
1793
|
-
}, _callee18, null, [[9,
|
|
1792
|
+
}, _callee18, null, [[9, 47]]);
|
|
1794
1793
|
}));
|
|
1795
1794
|
|
|
1796
|
-
return function sendEvaluation(
|
|
1795
|
+
return function sendEvaluation(_x6) {
|
|
1797
1796
|
return _ref16.apply(this, arguments);
|
|
1798
1797
|
};
|
|
1799
1798
|
}();
|
|
1800
1799
|
|
|
1801
1800
|
var validateAll = /*#__PURE__*/function () {
|
|
1802
1801
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1803
|
-
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1802
|
+
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, messages, userType, productTemp, status, retailerStatusCopy;
|
|
1804
1803
|
|
|
1805
1804
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1806
1805
|
while (1) {
|
|
@@ -1816,6 +1815,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1816
1815
|
result: result,
|
|
1817
1816
|
isAproved: result === "A"
|
|
1818
1817
|
};
|
|
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,11 +1830,20 @@ 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
|
+
}
|
|
1833
1842
|
});
|
|
1834
|
-
_context19.next =
|
|
1843
|
+
_context19.next = 9;
|
|
1835
1844
|
return Promise.all(evaluationArray);
|
|
1836
1845
|
|
|
1837
|
-
case
|
|
1846
|
+
case 9:
|
|
1838
1847
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1839
1848
|
productTemp = product;
|
|
1840
1849
|
status = "".concat(result).concat(userType);
|
|
@@ -1864,27 +1873,31 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1864
1873
|
idCategory: productTemp.article.id_category,
|
|
1865
1874
|
product: productTemp
|
|
1866
1875
|
}));
|
|
1867
|
-
_context19.next =
|
|
1876
|
+
_context19.next = 26;
|
|
1877
|
+
return Promise.all(messages);
|
|
1878
|
+
|
|
1879
|
+
case 26:
|
|
1880
|
+
_context19.next = 28;
|
|
1868
1881
|
return loadData();
|
|
1869
1882
|
|
|
1870
|
-
case
|
|
1871
|
-
_context19.next =
|
|
1883
|
+
case 28:
|
|
1884
|
+
_context19.next = 33;
|
|
1872
1885
|
break;
|
|
1873
1886
|
|
|
1874
|
-
case
|
|
1875
|
-
_context19.prev =
|
|
1887
|
+
case 30:
|
|
1888
|
+
_context19.prev = 30;
|
|
1876
1889
|
_context19.t0 = _context19["catch"](0);
|
|
1877
1890
|
console.log(_context19.t0);
|
|
1878
1891
|
|
|
1879
|
-
case
|
|
1892
|
+
case 33:
|
|
1880
1893
|
case "end":
|
|
1881
1894
|
return _context19.stop();
|
|
1882
1895
|
}
|
|
1883
1896
|
}
|
|
1884
|
-
}, _callee19, null, [[0,
|
|
1897
|
+
}, _callee19, null, [[0, 30]]);
|
|
1885
1898
|
}));
|
|
1886
1899
|
|
|
1887
|
-
return function validateAll(
|
|
1900
|
+
return function validateAll(_x7) {
|
|
1888
1901
|
return _ref17.apply(this, arguments);
|
|
1889
1902
|
};
|
|
1890
1903
|
}();
|
|
@@ -1931,7 +1944,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1931
1944
|
}, _callee20);
|
|
1932
1945
|
}));
|
|
1933
1946
|
|
|
1934
|
-
return function evaluationToRetailer(
|
|
1947
|
+
return function evaluationToRetailer(_x8) {
|
|
1935
1948
|
return _ref18.apply(this, arguments);
|
|
1936
1949
|
};
|
|
1937
1950
|
}();
|
|
@@ -2015,8 +2028,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2015
2028
|
return;
|
|
2016
2029
|
} else if (user.is_retailer) {
|
|
2017
2030
|
if (product.id_order || product.orderId) {
|
|
2018
|
-
|
|
2019
|
-
showGlobalModal("error");
|
|
2031
|
+
sendEvaluation("R");
|
|
2020
2032
|
} else {
|
|
2021
2033
|
setDataGenericModal(function (prev) {
|
|
2022
2034
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2031,8 +2043,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2031
2043
|
showGlobalModal("generic");
|
|
2032
2044
|
}
|
|
2033
2045
|
} else {
|
|
2034
|
-
|
|
2035
|
-
showGlobalModal("error");
|
|
2046
|
+
sendEvaluation("R");
|
|
2036
2047
|
}
|
|
2037
2048
|
}
|
|
2038
2049
|
};
|
|
@@ -2042,6 +2053,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2042
2053
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2043
2054
|
setHeaderTop: setHeaderTop,
|
|
2044
2055
|
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,
|
|
2045
2057
|
productSelected: productSelected,
|
|
2046
2058
|
token: token,
|
|
2047
2059
|
activeRetailer: activeRetailer
|
|
@@ -2120,7 +2132,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2120
2132
|
} else if (user.is_retailer) {
|
|
2121
2133
|
if (product.id_order || product.orderId) {
|
|
2122
2134
|
setValidatedAll(true);
|
|
2123
|
-
|
|
2135
|
+
setShowRejectModal(true);
|
|
2124
2136
|
} else {
|
|
2125
2137
|
setDataGenericModal(function (prev) {
|
|
2126
2138
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2135,15 +2147,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2135
2147
|
showGlobalModal("generic");
|
|
2136
2148
|
}
|
|
2137
2149
|
} else {
|
|
2150
|
+
setShowRejectModal(true);
|
|
2138
2151
|
setValidatedAll(true);
|
|
2139
|
-
showGlobalModal("error");
|
|
2140
2152
|
}
|
|
2141
2153
|
},
|
|
2142
2154
|
approve: function approve() {
|
|
2143
2155
|
return sendToEvaluation("A");
|
|
2144
2156
|
},
|
|
2145
2157
|
reject: function reject() {
|
|
2146
|
-
|
|
2158
|
+
setShowRejectModal(true);
|
|
2147
2159
|
}
|
|
2148
2160
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2149
2161
|
tabsSections: tabsSections,
|
|
@@ -2328,6 +2340,53 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2328
2340
|
currentVersion: version,
|
|
2329
2341
|
setShowVersionSelector: setShowVersionSelector,
|
|
2330
2342
|
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")]
|
|
2331
2390
|
})]
|
|
2332
2391
|
});
|
|
2333
2392
|
};
|
|
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n flex: 1;\n overflow: auto;\n\n .data-container {\n display: flex;\n flex: 0%;\n height: calc(100% - ", "px);\n .image-data-panel {\n width: 340px;\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .product-information {\n width: 100%;\n display: flex;\n flex-direction: column;\n\n .services-information-container {\n height: 100%;\n overflow: auto;\n }\n\n .image-services {\n aside {\n display: grid;\n grid-template-columns: repeat(auto-fill, 179px);\n column-gap: 15px;\n row-gap: 15px;\n padding: 20px;\n }\n }\n\n .commentary-box {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n padding: 10px;\n padding-left: 0;\n\n .commentary {\n display: flex;\n align-items: flex-end;\n\n .input-container {\n width: 500px;\n\n .quill {\n height: 100px;\n }\n\n & + * {\n margin-left: 5px;\n }\n }\n\n .buttons-box {\n display: flex;\n width: 210px;\n flex-wrap: wrap;\n\n .general-transparent-button {\n & + * {\n margin-top: 5px;\n }\n }\n\n .general-transparent-button,\n .general-green-button,\n .general-button-disabled {\n width: fit-content;\n min-width: 201px;\n height: 40px;\n }\n }\n }\n }\n\n .feedback-box {\n display: flex;\n }\n\n .required-inputs-message {\n font-family: ", ";\n font-size: 13px;\n color: ", ";\n padding: 10px;\n display: flex;\n align-items: center;\n\n p + * {\n margin-top: 10px;\n }\n\n button {\n min-width: fit-content;\n }\n }\n }\n }\n .container {\n width: 100%;\n height: 100%;\n .dropzone {\n height: 100%;\n width: 100%;\n }\n }\n"])), function (_ref) {
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n flex: 1;\n overflow: auto;\n\n .data-container {\n display: flex;\n flex: 0%;\n height: calc(100% - ", "px);\n .image-data-panel {\n width: 340px;\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .product-information {\n width: 100%;\n display: flex;\n flex-direction: column;\n\n .services-information-container {\n height: 100%;\n overflow: auto;\n }\n\n .image-services {\n aside {\n display: grid;\n grid-template-columns: repeat(auto-fill, 179px);\n column-gap: 15px;\n row-gap: 15px;\n padding: 20px;\n }\n }\n\n .commentary-box {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n padding: 10px;\n padding-left: 0;\n\n .commentary {\n display: flex;\n align-items: flex-end;\n\n .input-container {\n width: 500px;\n\n .quill {\n height: 100px;\n }\n\n & + * {\n margin-left: 5px;\n }\n }\n\n .buttons-box {\n display: flex;\n width: 210px;\n flex-wrap: wrap;\n\n .general-transparent-button {\n & + * {\n margin-top: 5px;\n }\n }\n\n .general-transparent-button,\n .general-green-button,\n .general-button-disabled {\n width: fit-content;\n min-width: 201px;\n height: 40px;\n }\n }\n }\n }\n\n .feedback-box {\n display: flex;\n }\n\n .required-inputs-message {\n font-family: ", ";\n font-size: 13px;\n color: ", ";\n padding: 10px;\n display: flex;\n align-items: center;\n\n p + * {\n margin-top: 10px;\n }\n\n button {\n min-width: fit-content;\n }\n }\n }\n }\n #modal-message-box {\n width: 400px;\n height: 100px;\n }\n .container {\n width: 100%;\n height: 100%;\n .dropzone {\n height: 100%;\n width: 100%;\n }\n }\n"])), function (_ref) {
|
|
19
19
|
var headerTop = _ref.headerTop;
|
|
20
20
|
return headerTop;
|
|
21
21
|
}, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4);
|
|
@@ -31,7 +31,7 @@ RetailerProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": false,
|
|
32
32
|
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI5OGE0NzYxMy04ZGIyLTRlZjUtYjA0Mi01ZDU3MWRkZjIwMWIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4Mzg3NTIyNiwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY4Mzg3ODgyNiwiaWF0IjoxNjgzODc1MjI2LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.EtgmT_THMx-Zy_zB5yZK4gz6TXNTVVJEKFt5X0JK2UkGVrp_q_92YCEuejS4n976fyTez0jkwOee6IkVHLV71uZWRBDFt-3Yw4ZxfsZYPNJWhoHXGNxhMU8MCkSntfu597esBTk-VsUpstT5R7L-WJfN8viE7R-qVo-42RlPTG0TFrWA9q0oTcqjv8vbxLpOBUjiEpjmqRhg4blJZwgkGNta6MOlw1vfmisOVbo9wMvqwnCZ9xx9KMKoH9U4uNObK_JomjbvPmTmkcUXsE-wGSD7XcoSwtuhBngLC7-jiu1u8MvL_ff5Z0Qp70sSpLdUglcSS8d1Xf7j_fcZuJ5jKA",
|
|
35
35
|
productSelected: {
|
|
36
36
|
orderId: 14606,
|
|
37
37
|
status: "RA",
|
|
@@ -95,8 +95,12 @@ RetailerProductEditionDefault.args = {
|
|
|
95
95
|
},
|
|
96
96
|
location: {
|
|
97
97
|
product: {
|
|
98
|
-
articleId:
|
|
99
|
-
versionId:
|
|
98
|
+
articleId: 354,
|
|
99
|
+
versionId: 3
|
|
100
|
+
},
|
|
101
|
+
state: {
|
|
102
|
+
withChat: true,
|
|
103
|
+
chatType: "product_status"
|
|
100
104
|
}
|
|
101
105
|
},
|
|
102
106
|
user: {
|