contentoh-components-library 21.3.52 → 21.3.54
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/pages/ProviderProductEdition/ProviderProductEdition.stories.js +190 -111
- package/dist/components/pages/ProviderProductEdition/index.js +193 -152
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +87 -57
- package/dist/components/pages/RetailerProductEdition/index.js +266 -277
- 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/AvatarAndValidation/index.js +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/pages/ProviderProductEdition/ProviderProductEdition.stories.js +202 -115
- package/src/components/pages/ProviderProductEdition/index.js +109 -75
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +93 -59
- package/src/components/pages/RetailerProductEdition/index.js +110 -136
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
|
@@ -93,6 +93,12 @@ var _VersionSelector = require("../../organisms/VersionSelector");
|
|
|
93
93
|
|
|
94
94
|
var _customHooks = require("../../../global-files/customHooks");
|
|
95
95
|
|
|
96
|
+
var _utils = require("../RetailerProductEdition/utils");
|
|
97
|
+
|
|
98
|
+
var _Modal = require("../../organisms/Modal");
|
|
99
|
+
|
|
100
|
+
var _ButtonV = require("../../atoms/ButtonV2");
|
|
101
|
+
|
|
96
102
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
97
103
|
|
|
98
104
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -206,7 +212,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
206
212
|
});
|
|
207
213
|
|
|
208
214
|
var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
209
|
-
var _product$retailers, _product$retailersAva, _location$
|
|
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,21 +452,28 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
446
452
|
validatedAll = _useState60[0],
|
|
447
453
|
setValidatedAll = _useState60[1];
|
|
448
454
|
|
|
449
|
-
var _useState61 = (0, _react.useState)(
|
|
450
|
-
"Ficha técnica": null,
|
|
451
|
-
Descripción: null,
|
|
452
|
-
Imágenes: null
|
|
453
|
-
}),
|
|
455
|
+
var _useState61 = (0, _react.useState)(false),
|
|
454
456
|
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
455
|
-
|
|
456
|
-
|
|
457
|
+
showRejectModal = _useState62[0],
|
|
458
|
+
setShowRejectModal = _useState62[1];
|
|
459
|
+
|
|
460
|
+
var originProp = location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.origin;
|
|
457
461
|
|
|
458
|
-
var _useState63 = (0, _react.useState)(
|
|
462
|
+
var _useState63 = (0, _react.useState)({
|
|
463
|
+
"Ficha técnica": originProp,
|
|
464
|
+
Descripción: originProp,
|
|
465
|
+
Imágenes: originProp
|
|
466
|
+
}),
|
|
459
467
|
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
460
|
-
|
|
461
|
-
|
|
468
|
+
origin = _useState64[0],
|
|
469
|
+
setOrigin = _useState64[1];
|
|
462
470
|
|
|
463
|
-
var _useState65 = (0, _react.useState)(
|
|
471
|
+
var _useState65 = (0, _react.useState)(false),
|
|
472
|
+
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
473
|
+
inCart = _useState66[0],
|
|
474
|
+
setInCart = _useState66[1];
|
|
475
|
+
|
|
476
|
+
var _useState67 = (0, _react.useState)({
|
|
464
477
|
message: "¿Estás seguro de continuar?",
|
|
465
478
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
466
479
|
button1: {
|
|
@@ -475,34 +488,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
475
488
|
},
|
|
476
489
|
img: _defaultProfileImage.default
|
|
477
490
|
}),
|
|
478
|
-
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
479
|
-
dataGenericModal = _useState66[0],
|
|
480
|
-
setDataGenericModal = _useState66[1];
|
|
481
|
-
|
|
482
|
-
var _useState67 = (0, _react.useState)(null),
|
|
483
491
|
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
484
|
-
|
|
485
|
-
|
|
492
|
+
dataGenericModal = _useState68[0],
|
|
493
|
+
setDataGenericModal = _useState68[1];
|
|
486
494
|
|
|
487
|
-
var _useState69 = (0, _react.useState)(
|
|
495
|
+
var _useState69 = (0, _react.useState)(null),
|
|
488
496
|
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
489
|
-
|
|
490
|
-
|
|
497
|
+
socketType = _useState70[0],
|
|
498
|
+
setSocketType = _useState70[1];
|
|
491
499
|
|
|
492
|
-
var _useState71 = (0, _react.useState)(
|
|
500
|
+
var _useState71 = (0, _react.useState)(loading),
|
|
493
501
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
494
|
-
|
|
495
|
-
|
|
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];
|
|
496
509
|
|
|
497
510
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
498
511
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
499
512
|
showVersionSelector = _useCloseModal2[0],
|
|
500
513
|
setShowVersionSelector = _useCloseModal2[1];
|
|
501
514
|
|
|
502
|
-
var
|
|
503
|
-
|
|
504
|
-
globalModal =
|
|
505
|
-
setGlobalModal =
|
|
515
|
+
var _useState75 = (0, _react.useState)(),
|
|
516
|
+
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
517
|
+
globalModal = _useState76[0],
|
|
518
|
+
setGlobalModal = _useState76[1];
|
|
506
519
|
|
|
507
520
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
508
521
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -674,30 +687,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
674
687
|
});
|
|
675
688
|
|
|
676
689
|
switch (type) {
|
|
677
|
-
case "error":
|
|
678
|
-
setGlobalModal({
|
|
679
|
-
message: "".concat(activeTab, " rechazada"),
|
|
680
|
-
detail: "Agrega tu comentarios para enviar el rechazo",
|
|
681
|
-
img: _errorModal.default,
|
|
682
|
-
textArea: true,
|
|
683
|
-
button1: {
|
|
684
|
-
name: "Enviar",
|
|
685
|
-
action: function action(e) {
|
|
686
|
-
var textArea = document.querySelector("#area");
|
|
687
|
-
|
|
688
|
-
if (textArea.value) {
|
|
689
|
-
textArea.style.border = "none";
|
|
690
|
-
createComment(e, textArea.value);
|
|
691
|
-
showGlobalModal("commentsSent");
|
|
692
|
-
validatedAll ? validateAll("R") : sendEvaluation("R");
|
|
693
|
-
} else {
|
|
694
|
-
textArea.style.border = "2px solid red";
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
});
|
|
699
|
-
break;
|
|
700
|
-
|
|
701
690
|
case "generic":
|
|
702
691
|
setGlobalModal(dataGenericModal);
|
|
703
692
|
break;
|
|
@@ -879,18 +868,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
879
868
|
setActiveTab("Imágenes");
|
|
880
869
|
}
|
|
881
870
|
}, [showModal]);
|
|
882
|
-
(0, _react.useEffect)(function () {
|
|
883
|
-
var _location$state, _location$state2, _location$state3;
|
|
884
|
-
|
|
885
|
-
console.log({
|
|
886
|
-
location: location
|
|
887
|
-
});
|
|
888
|
-
setOrigin({
|
|
889
|
-
"Ficha técnica": location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.origin,
|
|
890
|
-
Descripción: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.origin,
|
|
891
|
-
Imágenes: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.origin
|
|
892
|
-
});
|
|
893
|
-
}, [location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.origin]);
|
|
894
871
|
|
|
895
872
|
var loadData = /*#__PURE__*/function () {
|
|
896
873
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
@@ -972,7 +949,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
972
949
|
setServicesData(parsedResponse);
|
|
973
950
|
|
|
974
951
|
case 12:
|
|
975
|
-
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
952
|
+
retailers && !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
976
953
|
|
|
977
954
|
case 13:
|
|
978
955
|
case "end":
|
|
@@ -999,13 +976,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
999
976
|
var _revision = ["RequestWithContentoh", "RequestWithoutContentoh", "Contentoh"].includes(orgn);
|
|
1000
977
|
|
|
1001
978
|
if (_isRetailer) {
|
|
1002
|
-
console.log({
|
|
1003
|
-
origin: origin[activeTab],
|
|
1004
|
-
concept: concept,
|
|
1005
|
-
orgn: orgn,
|
|
1006
|
-
revision: _revision,
|
|
1007
|
-
currentService: currentService
|
|
1008
|
-
});
|
|
1009
979
|
if (_revision && currentService === "AP") return true;
|
|
1010
980
|
} else {
|
|
1011
981
|
var _product = productEdit.product;
|
|
@@ -1097,7 +1067,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1097
1067
|
}
|
|
1098
1068
|
|
|
1099
1069
|
setProduct(productTemp);
|
|
1100
|
-
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);
|
|
1101
1071
|
}, [percentages]);
|
|
1102
1072
|
|
|
1103
1073
|
var loadInputs = function loadInputs() {
|
|
@@ -1476,45 +1446,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1476
1446
|
};
|
|
1477
1447
|
|
|
1478
1448
|
var createComment = /*#__PURE__*/function () {
|
|
1479
|
-
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(
|
|
1480
|
-
var
|
|
1449
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1450
|
+
var messages,
|
|
1451
|
+
retailerId,
|
|
1452
|
+
data,
|
|
1453
|
+
_args15 = arguments;
|
|
1481
1454
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1482
1455
|
while (1) {
|
|
1483
1456
|
switch (_context15.prev = _context15.next) {
|
|
1484
1457
|
case 0:
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
_context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
|
|
1488
|
-
break;
|
|
1489
|
-
|
|
1490
|
-
case 4:
|
|
1491
|
-
concept = "datasheet";
|
|
1492
|
-
return _context15.abrupt("break", 10);
|
|
1493
|
-
|
|
1494
|
-
case 6:
|
|
1495
|
-
concept = "images";
|
|
1496
|
-
return _context15.abrupt("break", 10);
|
|
1497
|
-
|
|
1498
|
-
case 8:
|
|
1499
|
-
concept = "description";
|
|
1500
|
-
return _context15.abrupt("break", 10);
|
|
1501
|
-
|
|
1502
|
-
case 10:
|
|
1458
|
+
messages = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : [];
|
|
1459
|
+
retailerId = _args15.length > 1 ? _args15[1] : undefined;
|
|
1503
1460
|
data = {
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
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: {
|
|
1513
1469
|
Authorization: token
|
|
1514
1470
|
}
|
|
1515
|
-
}
|
|
1471
|
+
};
|
|
1472
|
+
setMessage("");
|
|
1473
|
+
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1516
1474
|
|
|
1517
|
-
case
|
|
1475
|
+
case 5:
|
|
1518
1476
|
case "end":
|
|
1519
1477
|
return _context15.stop();
|
|
1520
1478
|
}
|
|
@@ -1522,7 +1480,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1522
1480
|
}, _callee15);
|
|
1523
1481
|
}));
|
|
1524
1482
|
|
|
1525
|
-
return function createComment(
|
|
1483
|
+
return function createComment() {
|
|
1526
1484
|
return _ref13.apply(this, arguments);
|
|
1527
1485
|
};
|
|
1528
1486
|
}();
|
|
@@ -1621,7 +1579,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1621
1579
|
}, _callee17);
|
|
1622
1580
|
}));
|
|
1623
1581
|
|
|
1624
|
-
return function setAssignation(
|
|
1582
|
+
return function setAssignation(_x4, _x5) {
|
|
1625
1583
|
return _ref15.apply(this, arguments);
|
|
1626
1584
|
};
|
|
1627
1585
|
}();
|
|
@@ -1709,7 +1667,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1709
1667
|
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1710
1668
|
var _productTemp$id_order2;
|
|
1711
1669
|
|
|
1712
|
-
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;
|
|
1713
1671
|
|
|
1714
1672
|
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1715
1673
|
while (1) {
|
|
@@ -1771,53 +1729,77 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1771
1729
|
res = _context18.sent;
|
|
1772
1730
|
|
|
1773
1731
|
case 30:
|
|
1774
|
-
if (res.data.statusCode === 200) {
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
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
|
|
1785
1752
|
}
|
|
1753
|
+
};
|
|
1754
|
+
_context18.next = 36;
|
|
1755
|
+
return (0, _utils.sendMessage)(messageData);
|
|
1786
1756
|
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
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;
|
|
1792
1767
|
}
|
|
1793
1768
|
|
|
1794
|
-
|
|
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;
|
|
1795
1777
|
break;
|
|
1796
1778
|
|
|
1797
|
-
case
|
|
1798
|
-
_context18.prev =
|
|
1779
|
+
case 47:
|
|
1780
|
+
_context18.prev = 47;
|
|
1799
1781
|
_context18.t0 = _context18["catch"](9);
|
|
1800
1782
|
console.log(_context18.t0);
|
|
1801
1783
|
|
|
1802
|
-
case
|
|
1784
|
+
case 50:
|
|
1803
1785
|
loadData();
|
|
1804
1786
|
|
|
1805
|
-
case
|
|
1787
|
+
case 51:
|
|
1806
1788
|
case "end":
|
|
1807
1789
|
return _context18.stop();
|
|
1808
1790
|
}
|
|
1809
1791
|
}
|
|
1810
|
-
}, _callee18, null, [[9,
|
|
1792
|
+
}, _callee18, null, [[9, 47]]);
|
|
1811
1793
|
}));
|
|
1812
1794
|
|
|
1813
|
-
return function sendEvaluation(
|
|
1795
|
+
return function sendEvaluation(_x6) {
|
|
1814
1796
|
return _ref16.apply(this, arguments);
|
|
1815
1797
|
};
|
|
1816
1798
|
}();
|
|
1817
1799
|
|
|
1818
1800
|
var validateAll = /*#__PURE__*/function () {
|
|
1819
1801
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1820
|
-
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1802
|
+
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, messages, userType, productTemp, status, retailerStatusCopy;
|
|
1821
1803
|
|
|
1822
1804
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1823
1805
|
while (1) {
|
|
@@ -1833,6 +1815,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1833
1815
|
result: result,
|
|
1834
1816
|
isAproved: result === "A"
|
|
1835
1817
|
};
|
|
1818
|
+
messages = [];
|
|
1836
1819
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1837
1820
|
var service = ret.service,
|
|
1838
1821
|
id_retailer = ret.id_retailer;
|
|
@@ -1847,11 +1830,20 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1847
1830
|
Authorization: token
|
|
1848
1831
|
}
|
|
1849
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
|
+
}
|
|
1850
1842
|
});
|
|
1851
|
-
_context19.next =
|
|
1843
|
+
_context19.next = 9;
|
|
1852
1844
|
return Promise.all(evaluationArray);
|
|
1853
1845
|
|
|
1854
|
-
case
|
|
1846
|
+
case 9:
|
|
1855
1847
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1856
1848
|
productTemp = product;
|
|
1857
1849
|
status = "".concat(result).concat(userType);
|
|
@@ -1881,27 +1873,31 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1881
1873
|
idCategory: productTemp.article.id_category,
|
|
1882
1874
|
product: productTemp
|
|
1883
1875
|
}));
|
|
1884
|
-
_context19.next =
|
|
1876
|
+
_context19.next = 26;
|
|
1877
|
+
return Promise.all(messages);
|
|
1878
|
+
|
|
1879
|
+
case 26:
|
|
1880
|
+
_context19.next = 28;
|
|
1885
1881
|
return loadData();
|
|
1886
1882
|
|
|
1887
|
-
case
|
|
1888
|
-
_context19.next =
|
|
1883
|
+
case 28:
|
|
1884
|
+
_context19.next = 33;
|
|
1889
1885
|
break;
|
|
1890
1886
|
|
|
1891
|
-
case
|
|
1892
|
-
_context19.prev =
|
|
1887
|
+
case 30:
|
|
1888
|
+
_context19.prev = 30;
|
|
1893
1889
|
_context19.t0 = _context19["catch"](0);
|
|
1894
1890
|
console.log(_context19.t0);
|
|
1895
1891
|
|
|
1896
|
-
case
|
|
1892
|
+
case 33:
|
|
1897
1893
|
case "end":
|
|
1898
1894
|
return _context19.stop();
|
|
1899
1895
|
}
|
|
1900
1896
|
}
|
|
1901
|
-
}, _callee19, null, [[0,
|
|
1897
|
+
}, _callee19, null, [[0, 30]]);
|
|
1902
1898
|
}));
|
|
1903
1899
|
|
|
1904
|
-
return function validateAll(
|
|
1900
|
+
return function validateAll(_x7) {
|
|
1905
1901
|
return _ref17.apply(this, arguments);
|
|
1906
1902
|
};
|
|
1907
1903
|
}();
|
|
@@ -1948,14 +1944,13 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1948
1944
|
}, _callee20);
|
|
1949
1945
|
}));
|
|
1950
1946
|
|
|
1951
|
-
return function evaluationToRetailer(
|
|
1947
|
+
return function evaluationToRetailer(_x8) {
|
|
1952
1948
|
return _ref18.apply(this, arguments);
|
|
1953
1949
|
};
|
|
1954
1950
|
}();
|
|
1955
1951
|
|
|
1956
1952
|
var getSectionStatus = function getSectionStatus() {
|
|
1957
1953
|
var concept = getConcept(activeTab);
|
|
1958
|
-
console.log("getSectionStatus", productEdit.product["".concat(concept, "_status")]);
|
|
1959
1954
|
return ["AA", "AP", "R", "CA", "RCA"].includes(productEdit.product["".concat(concept, "_status")]);
|
|
1960
1955
|
};
|
|
1961
1956
|
|
|
@@ -2033,8 +2028,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2033
2028
|
return;
|
|
2034
2029
|
} else if (user.is_retailer) {
|
|
2035
2030
|
if (product.id_order || product.orderId) {
|
|
2036
|
-
|
|
2037
|
-
showGlobalModal("error");
|
|
2031
|
+
sendEvaluation("R");
|
|
2038
2032
|
} else {
|
|
2039
2033
|
setDataGenericModal(function (prev) {
|
|
2040
2034
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2049,8 +2043,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2049
2043
|
showGlobalModal("generic");
|
|
2050
2044
|
}
|
|
2051
2045
|
} else {
|
|
2052
|
-
|
|
2053
|
-
showGlobalModal("error");
|
|
2046
|
+
sendEvaluation("R");
|
|
2054
2047
|
}
|
|
2055
2048
|
}
|
|
2056
2049
|
};
|
|
@@ -2059,7 +2052,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2059
2052
|
headerTop: headerTop,
|
|
2060
2053
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2061
2054
|
setHeaderTop: setHeaderTop,
|
|
2062
|
-
withChat: location === null || location === void 0 ? void 0 : (_location$
|
|
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,
|
|
2063
2057
|
productSelected: productSelected,
|
|
2064
2058
|
token: token,
|
|
2065
2059
|
activeRetailer: activeRetailer
|
|
@@ -2138,7 +2132,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2138
2132
|
} else if (user.is_retailer) {
|
|
2139
2133
|
if (product.id_order || product.orderId) {
|
|
2140
2134
|
setValidatedAll(true);
|
|
2141
|
-
|
|
2135
|
+
setShowRejectModal(true);
|
|
2142
2136
|
} else {
|
|
2143
2137
|
setDataGenericModal(function (prev) {
|
|
2144
2138
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2153,15 +2147,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2153
2147
|
showGlobalModal("generic");
|
|
2154
2148
|
}
|
|
2155
2149
|
} else {
|
|
2150
|
+
setShowRejectModal(true);
|
|
2156
2151
|
setValidatedAll(true);
|
|
2157
|
-
showGlobalModal("error");
|
|
2158
2152
|
}
|
|
2159
2153
|
},
|
|
2160
2154
|
approve: function approve() {
|
|
2161
2155
|
return sendToEvaluation("A");
|
|
2162
2156
|
},
|
|
2163
2157
|
reject: function reject() {
|
|
2164
|
-
|
|
2158
|
+
setShowRejectModal(true);
|
|
2165
2159
|
}
|
|
2166
2160
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2167
2161
|
tabsSections: tabsSections,
|
|
@@ -2346,6 +2340,53 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2346
2340
|
currentVersion: version,
|
|
2347
2341
|
setShowVersionSelector: setShowVersionSelector,
|
|
2348
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")]
|
|
2349
2390
|
})]
|
|
2350
2391
|
});
|
|
2351
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);
|