contentoh-components-library 21.3.81 → 21.3.83
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/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/GeneralInput/index.js +20 -24
- package/dist/components/atoms/InputFormatter/index.js +16 -14
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/TabsMenu/index.js +48 -22
- package/dist/components/molecules/TagAndInput/index.js +3 -1
- package/dist/components/organisms/Chat/Chat.stories.js +1 -21
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +200 -348
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +3 -48
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/FullTabsMenu/index.js +12 -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 +196 -189
- 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 +290 -262
- 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/GeneralInput/index.js +21 -20
- package/src/components/atoms/InputFormatter/index.js +18 -14
- package/src/components/atoms/InputFormatter/styles.js +1 -2
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/TabsMenu/index.js +88 -65
- package/src/components/molecules/TagAndInput/index.js +12 -10
- package/src/components/organisms/Chat/Chat.stories.js +0 -21
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
- package/src/components/organisms/Chat/ContentChat/index.js +15 -86
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +3 -47
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/FullTabsMenu/index.js +16 -4
- 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 +142 -134
- 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 +148 -111
- 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/dist/assets/fonts/roboto/LICENSE.txt +0 -202
- 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,36 @@ 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
|
}),
|
|
454
|
+
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
455
|
+
origin = _useState62[0],
|
|
456
|
+
setOrigin = _useState62[1];
|
|
457
|
+
|
|
458
|
+
var _useState63 = (0, _react.useState)([]),
|
|
465
459
|
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
466
|
-
|
|
467
|
-
|
|
460
|
+
desc = _useState64[0],
|
|
461
|
+
setDesc = _useState64[1];
|
|
468
462
|
|
|
469
|
-
var _useState65 = (0, _react.useState)(
|
|
463
|
+
var _useState65 = (0, _react.useState)([]),
|
|
470
464
|
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
471
|
-
|
|
472
|
-
|
|
465
|
+
fich = _useState66[0],
|
|
466
|
+
setFich = _useState66[1];
|
|
473
467
|
|
|
474
|
-
var _useState67 = (0, _react.useState)(
|
|
468
|
+
var _useState67 = (0, _react.useState)([]),
|
|
469
|
+
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
470
|
+
imag = _useState68[0],
|
|
471
|
+
setImag = _useState68[1];
|
|
472
|
+
|
|
473
|
+
var _useState69 = (0, _react.useState)(false),
|
|
474
|
+
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
475
|
+
inCart = _useState70[0],
|
|
476
|
+
setInCart = _useState70[1];
|
|
477
|
+
|
|
478
|
+
var _useState71 = (0, _react.useState)({
|
|
475
479
|
message: "¿Estás seguro de continuar?",
|
|
476
480
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
477
481
|
button1: {
|
|
@@ -486,34 +490,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
486
490
|
},
|
|
487
491
|
img: _defaultProfileImage.default
|
|
488
492
|
}),
|
|
489
|
-
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
490
|
-
dataGenericModal = _useState68[0],
|
|
491
|
-
setDataGenericModal = _useState68[1];
|
|
492
|
-
|
|
493
|
-
var _useState69 = (0, _react.useState)(null),
|
|
494
|
-
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
495
|
-
socketType = _useState70[0],
|
|
496
|
-
setSocketType = _useState70[1];
|
|
497
|
-
|
|
498
|
-
var _useState71 = (0, _react.useState)(loading),
|
|
499
493
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
500
|
-
|
|
501
|
-
|
|
494
|
+
dataGenericModal = _useState72[0],
|
|
495
|
+
setDataGenericModal = _useState72[1];
|
|
502
496
|
|
|
503
|
-
var _useState73 = (0, _react.useState)(
|
|
497
|
+
var _useState73 = (0, _react.useState)(null),
|
|
504
498
|
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
505
|
-
|
|
506
|
-
|
|
499
|
+
socketType = _useState74[0],
|
|
500
|
+
setSocketType = _useState74[1];
|
|
501
|
+
|
|
502
|
+
var _useState75 = (0, _react.useState)(loading),
|
|
503
|
+
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
504
|
+
saving = _useState76[0],
|
|
505
|
+
setSaving = _useState76[1];
|
|
506
|
+
|
|
507
|
+
var _useState77 = (0, _react.useState)(product.statusByRetailer),
|
|
508
|
+
_useState78 = (0, _slicedToArray2.default)(_useState77, 2),
|
|
509
|
+
retailerStatus = _useState78[0],
|
|
510
|
+
setRetailerStatus = _useState78[1];
|
|
507
511
|
|
|
508
512
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
509
513
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
510
514
|
showVersionSelector = _useCloseModal2[0],
|
|
511
515
|
setShowVersionSelector = _useCloseModal2[1];
|
|
512
516
|
|
|
513
|
-
var
|
|
514
|
-
|
|
515
|
-
globalModal =
|
|
516
|
-
setGlobalModal =
|
|
517
|
+
var _useState79 = (0, _react.useState)(),
|
|
518
|
+
_useState80 = (0, _slicedToArray2.default)(_useState79, 2),
|
|
519
|
+
globalModal = _useState80[0],
|
|
520
|
+
setGlobalModal = _useState80[1];
|
|
517
521
|
|
|
518
522
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
519
523
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -685,6 +689,30 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
685
689
|
});
|
|
686
690
|
|
|
687
691
|
switch (type) {
|
|
692
|
+
case "error":
|
|
693
|
+
setGlobalModal({
|
|
694
|
+
message: "".concat(activeTab, " rechazada"),
|
|
695
|
+
detail: "Agrega tu comentarios para enviar el rechazo",
|
|
696
|
+
img: _errorModal.default,
|
|
697
|
+
textArea: true,
|
|
698
|
+
button1: {
|
|
699
|
+
name: "Enviar",
|
|
700
|
+
action: function action(e) {
|
|
701
|
+
var textArea = document.querySelector("#area");
|
|
702
|
+
|
|
703
|
+
if (textArea.value) {
|
|
704
|
+
textArea.style.border = "none";
|
|
705
|
+
createComment(e, textArea.value);
|
|
706
|
+
showGlobalModal("commentsSent");
|
|
707
|
+
validatedAll ? validateAll("R") : sendEvaluation("R");
|
|
708
|
+
} else {
|
|
709
|
+
textArea.style.border = "2px solid red";
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
break;
|
|
715
|
+
|
|
688
716
|
case "generic":
|
|
689
717
|
setGlobalModal(dataGenericModal);
|
|
690
718
|
break;
|
|
@@ -956,7 +984,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
956
984
|
setServicesData(parsedResponse);
|
|
957
985
|
|
|
958
986
|
case 12:
|
|
959
|
-
|
|
987
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
960
988
|
|
|
961
989
|
case 13:
|
|
962
990
|
case "end":
|
|
@@ -1074,7 +1102,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1074
1102
|
}
|
|
1075
1103
|
|
|
1076
1104
|
setProduct(productTemp);
|
|
1077
|
-
|
|
1105
|
+
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1078
1106
|
}, [percentages]);
|
|
1079
1107
|
|
|
1080
1108
|
var loadInputs = function loadInputs() {
|
|
@@ -1453,33 +1481,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1453
1481
|
};
|
|
1454
1482
|
|
|
1455
1483
|
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;
|
|
1484
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
|
|
1485
|
+
var concept, data;
|
|
1461
1486
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1462
1487
|
while (1) {
|
|
1463
1488
|
switch (_context15.prev = _context15.next) {
|
|
1464
1489
|
case 0:
|
|
1465
|
-
|
|
1466
|
-
|
|
1490
|
+
concept = "";
|
|
1491
|
+
_context15.t0 = activeTab;
|
|
1492
|
+
_context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
|
|
1493
|
+
break;
|
|
1494
|
+
|
|
1495
|
+
case 4:
|
|
1496
|
+
concept = "datasheet";
|
|
1497
|
+
return _context15.abrupt("break", 10);
|
|
1498
|
+
|
|
1499
|
+
case 6:
|
|
1500
|
+
concept = "images";
|
|
1501
|
+
return _context15.abrupt("break", 10);
|
|
1502
|
+
|
|
1503
|
+
case 8:
|
|
1504
|
+
concept = "description";
|
|
1505
|
+
return _context15.abrupt("break", 10);
|
|
1506
|
+
|
|
1507
|
+
case 10:
|
|
1467
1508
|
data = {
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1509
|
+
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1510
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1511
|
+
message: body,
|
|
1512
|
+
concept: concept,
|
|
1513
|
+
version: version
|
|
1514
|
+
};
|
|
1515
|
+
_context15.next = 13;
|
|
1516
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1517
|
+
headers: {
|
|
1476
1518
|
Authorization: token
|
|
1477
1519
|
}
|
|
1478
|
-
};
|
|
1479
|
-
setMessage("");
|
|
1480
|
-
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1520
|
+
});
|
|
1481
1521
|
|
|
1482
|
-
case
|
|
1522
|
+
case 13:
|
|
1483
1523
|
case "end":
|
|
1484
1524
|
return _context15.stop();
|
|
1485
1525
|
}
|
|
@@ -1487,7 +1527,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1487
1527
|
}, _callee15);
|
|
1488
1528
|
}));
|
|
1489
1529
|
|
|
1490
|
-
return function createComment() {
|
|
1530
|
+
return function createComment(_x4, _x5, _x6) {
|
|
1491
1531
|
return _ref13.apply(this, arguments);
|
|
1492
1532
|
};
|
|
1493
1533
|
}();
|
|
@@ -1586,7 +1626,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1586
1626
|
}, _callee17);
|
|
1587
1627
|
}));
|
|
1588
1628
|
|
|
1589
|
-
return function setAssignation(
|
|
1629
|
+
return function setAssignation(_x7, _x8) {
|
|
1590
1630
|
return _ref15.apply(this, arguments);
|
|
1591
1631
|
};
|
|
1592
1632
|
}();
|
|
@@ -1674,7 +1714,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1674
1714
|
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1675
1715
|
var _productTemp$id_order2;
|
|
1676
1716
|
|
|
1677
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus,
|
|
1717
|
+
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1678
1718
|
|
|
1679
1719
|
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1680
1720
|
while (1) {
|
|
@@ -1736,77 +1776,53 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1736
1776
|
res = _context18.sent;
|
|
1737
1777
|
|
|
1738
1778
|
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
|
|
1779
|
+
if (res.data.statusCode === 200) {
|
|
1780
|
+
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1781
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1782
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1783
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1784
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1785
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1786
|
+
|
|
1787
|
+
if (newServiceStatus) {
|
|
1788
|
+
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1789
|
+
productTemp["".concat(concept, "_status")] = status;
|
|
1759
1790
|
}
|
|
1760
|
-
};
|
|
1761
|
-
_context18.next = 36;
|
|
1762
|
-
return (0, _utils.sendMessage)(messageData);
|
|
1763
1791
|
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1770
|
-
|
|
1771
|
-
if (newServiceStatus) {
|
|
1772
|
-
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1773
|
-
productTemp["".concat(concept, "_status")] = status;
|
|
1792
|
+
setProduct(productTemp);
|
|
1793
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1794
|
+
setOrigin(function (prev) {
|
|
1795
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1796
|
+
});
|
|
1774
1797
|
}
|
|
1775
1798
|
|
|
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;
|
|
1799
|
+
_context18.next = 36;
|
|
1784
1800
|
break;
|
|
1785
1801
|
|
|
1786
|
-
case
|
|
1787
|
-
_context18.prev =
|
|
1802
|
+
case 33:
|
|
1803
|
+
_context18.prev = 33;
|
|
1788
1804
|
_context18.t0 = _context18["catch"](9);
|
|
1789
1805
|
console.log(_context18.t0);
|
|
1790
1806
|
|
|
1791
|
-
case
|
|
1807
|
+
case 36:
|
|
1792
1808
|
loadData();
|
|
1793
1809
|
|
|
1794
|
-
case
|
|
1810
|
+
case 37:
|
|
1795
1811
|
case "end":
|
|
1796
1812
|
return _context18.stop();
|
|
1797
1813
|
}
|
|
1798
1814
|
}
|
|
1799
|
-
}, _callee18, null, [[9,
|
|
1815
|
+
}, _callee18, null, [[9, 33]]);
|
|
1800
1816
|
}));
|
|
1801
1817
|
|
|
1802
|
-
return function sendEvaluation(
|
|
1818
|
+
return function sendEvaluation(_x9) {
|
|
1803
1819
|
return _ref16.apply(this, arguments);
|
|
1804
1820
|
};
|
|
1805
1821
|
}();
|
|
1806
1822
|
|
|
1807
1823
|
var validateAll = /*#__PURE__*/function () {
|
|
1808
1824
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1809
|
-
var _product$id_order2, evaluationArray, conceptArray, dataGeneral,
|
|
1825
|
+
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1810
1826
|
|
|
1811
1827
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1812
1828
|
while (1) {
|
|
@@ -1822,7 +1838,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1822
1838
|
result: result,
|
|
1823
1839
|
isAproved: result === "A"
|
|
1824
1840
|
};
|
|
1825
|
-
messages = [];
|
|
1826
1841
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1827
1842
|
var service = ret.service,
|
|
1828
1843
|
id_retailer = ret.id_retailer;
|
|
@@ -1837,20 +1852,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1837
1852
|
Authorization: token
|
|
1838
1853
|
}
|
|
1839
1854
|
}));
|
|
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
1855
|
});
|
|
1850
|
-
_context19.next =
|
|
1856
|
+
_context19.next = 8;
|
|
1851
1857
|
return Promise.all(evaluationArray);
|
|
1852
1858
|
|
|
1853
|
-
case
|
|
1859
|
+
case 8:
|
|
1854
1860
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1855
1861
|
productTemp = product;
|
|
1856
1862
|
status = "".concat(result).concat(userType);
|
|
@@ -1880,31 +1886,27 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1880
1886
|
idCategory: productTemp.article.id_category,
|
|
1881
1887
|
product: productTemp
|
|
1882
1888
|
}));
|
|
1883
|
-
_context19.next =
|
|
1884
|
-
return Promise.all(messages);
|
|
1885
|
-
|
|
1886
|
-
case 26:
|
|
1887
|
-
_context19.next = 28;
|
|
1889
|
+
_context19.next = 25;
|
|
1888
1890
|
return loadData();
|
|
1889
1891
|
|
|
1890
|
-
case
|
|
1891
|
-
_context19.next =
|
|
1892
|
+
case 25:
|
|
1893
|
+
_context19.next = 30;
|
|
1892
1894
|
break;
|
|
1893
1895
|
|
|
1894
|
-
case
|
|
1895
|
-
_context19.prev =
|
|
1896
|
+
case 27:
|
|
1897
|
+
_context19.prev = 27;
|
|
1896
1898
|
_context19.t0 = _context19["catch"](0);
|
|
1897
1899
|
console.log(_context19.t0);
|
|
1898
1900
|
|
|
1899
|
-
case
|
|
1901
|
+
case 30:
|
|
1900
1902
|
case "end":
|
|
1901
1903
|
return _context19.stop();
|
|
1902
1904
|
}
|
|
1903
1905
|
}
|
|
1904
|
-
}, _callee19, null, [[0,
|
|
1906
|
+
}, _callee19, null, [[0, 27]]);
|
|
1905
1907
|
}));
|
|
1906
1908
|
|
|
1907
|
-
return function validateAll(
|
|
1909
|
+
return function validateAll(_x10) {
|
|
1908
1910
|
return _ref17.apply(this, arguments);
|
|
1909
1911
|
};
|
|
1910
1912
|
}();
|
|
@@ -1951,7 +1953,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1951
1953
|
}, _callee20);
|
|
1952
1954
|
}));
|
|
1953
1955
|
|
|
1954
|
-
return function evaluationToRetailer(
|
|
1956
|
+
return function evaluationToRetailer(_x11) {
|
|
1955
1957
|
return _ref18.apply(this, arguments);
|
|
1956
1958
|
};
|
|
1957
1959
|
}();
|
|
@@ -2039,7 +2041,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2039
2041
|
return;
|
|
2040
2042
|
} else if (user.is_retailer) {
|
|
2041
2043
|
if (product.id_order || product.orderId) {
|
|
2042
|
-
|
|
2044
|
+
setValidatedAll(true);
|
|
2045
|
+
showGlobalModal("error");
|
|
2043
2046
|
} else {
|
|
2044
2047
|
setDataGenericModal(function (prev) {
|
|
2045
2048
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2054,7 +2057,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2054
2057
|
showGlobalModal("generic");
|
|
2055
2058
|
}
|
|
2056
2059
|
} else {
|
|
2057
|
-
|
|
2060
|
+
setValidatedAll(true);
|
|
2061
|
+
showGlobalModal("error");
|
|
2058
2062
|
}
|
|
2059
2063
|
}
|
|
2060
2064
|
};
|
|
@@ -2064,7 +2068,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2064
2068
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2065
2069
|
setHeaderTop: setHeaderTop,
|
|
2066
2070
|
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
2071
|
productSelected: productSelected,
|
|
2069
2072
|
token: token,
|
|
2070
2073
|
activeRetailer: activeRetailer
|
|
@@ -2143,7 +2146,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2143
2146
|
} else if (user.is_retailer) {
|
|
2144
2147
|
if (product.id_order || product.orderId) {
|
|
2145
2148
|
setValidatedAll(true);
|
|
2146
|
-
|
|
2149
|
+
showGlobalModal("error");
|
|
2147
2150
|
} else {
|
|
2148
2151
|
setDataGenericModal(function (prev) {
|
|
2149
2152
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2158,15 +2161,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2158
2161
|
showGlobalModal("generic");
|
|
2159
2162
|
}
|
|
2160
2163
|
} else {
|
|
2161
|
-
setShowRejectModal(true);
|
|
2162
2164
|
setValidatedAll(true);
|
|
2165
|
+
showGlobalModal("error");
|
|
2163
2166
|
}
|
|
2164
2167
|
},
|
|
2165
2168
|
approve: function approve() {
|
|
2166
2169
|
return sendToEvaluation("A");
|
|
2167
2170
|
},
|
|
2168
2171
|
reject: function reject() {
|
|
2169
|
-
|
|
2172
|
+
return sendToEvaluation("R");
|
|
2170
2173
|
}
|
|
2171
2174
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2172
2175
|
tabsSections: tabsSections,
|
|
@@ -2181,9 +2184,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2181
2184
|
isRetailer: isRetailer,
|
|
2182
2185
|
showSaveButton: enableActions(product.version_status),
|
|
2183
2186
|
version: version,
|
|
2187
|
+
desc: desc,
|
|
2188
|
+
setDesc: setDesc,
|
|
2189
|
+
fich: fich,
|
|
2190
|
+
setFich: setFich,
|
|
2191
|
+
imag: imag,
|
|
2192
|
+
setImag: setImag,
|
|
2184
2193
|
updatedDescriptions: updatedDescriptions,
|
|
2185
2194
|
updatedDatasheets: updatedDatasheets,
|
|
2186
|
-
images: images,
|
|
2187
2195
|
selectedImages: selectedImages,
|
|
2188
2196
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2189
2197
|
setUpdatedDatasheets: setUpdatedDatasheets,
|
|
@@ -2253,7 +2261,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2253
2261
|
headerType: "input-name-header"
|
|
2254
2262
|
}))]
|
|
2255
2263
|
})
|
|
2256
|
-
}),
|
|
2264
|
+
}), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2265
|
+
className: "commentary-box",
|
|
2266
|
+
children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2267
|
+
className: "commentary",
|
|
2268
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2269
|
+
label: "Caja de Comentario",
|
|
2270
|
+
inputType: "textarea",
|
|
2271
|
+
inputCols: 80,
|
|
2272
|
+
inputRows: 4,
|
|
2273
|
+
inputId: "commentary-box",
|
|
2274
|
+
index: 0
|
|
2275
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2276
|
+
className: "buttons-box",
|
|
2277
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2278
|
+
buttonType: "general-transparent-button",
|
|
2279
|
+
label: "Enviar comentario",
|
|
2280
|
+
onClick: function onClick(e) {
|
|
2281
|
+
return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2282
|
+
}
|
|
2283
|
+
})
|
|
2284
|
+
})]
|
|
2285
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2286
|
+
className: "feedback-box",
|
|
2287
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2288
|
+
comment: comment.message,
|
|
2289
|
+
reviewed: crossComment
|
|
2290
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2291
|
+
buttonType: "circular-button accept-button",
|
|
2292
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2293
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2294
|
+
while (1) {
|
|
2295
|
+
switch (_context21.prev = _context21.next) {
|
|
2296
|
+
case 0:
|
|
2297
|
+
setCrossComment(true);
|
|
2298
|
+
commentRevised();
|
|
2299
|
+
|
|
2300
|
+
case 2:
|
|
2301
|
+
case "end":
|
|
2302
|
+
return _context21.stop();
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
}, _callee21);
|
|
2306
|
+
}))
|
|
2307
|
+
})]
|
|
2308
|
+
})
|
|
2309
|
+
}) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2257
2310
|
className: "required-inputs-message",
|
|
2258
2311
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2259
2312
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -2313,52 +2366,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2313
2366
|
currentVersion: version,
|
|
2314
2367
|
setShowVersionSelector: setShowVersionSelector,
|
|
2315
2368
|
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
2369
|
})]
|
|
2363
2370
|
});
|
|
2364
2371
|
};
|
|
@@ -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);
|