contentoh-components-library 21.3.22 → 21.3.23

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.
Files changed (48) hide show
  1. package/.env.development +1 -0
  2. package/dist/assets/fonts/roboto/Roboto-Black.ttf +0 -0
  3. package/dist/assets/fonts/roboto/Roboto-BlackItalic.ttf +0 -0
  4. package/dist/assets/fonts/roboto/Roboto-Bold.ttf +0 -0
  5. package/dist/assets/fonts/roboto/Roboto-BoldItalic.ttf +0 -0
  6. package/dist/assets/fonts/roboto/Roboto-Italic.ttf +0 -0
  7. package/dist/assets/fonts/roboto/Roboto-Light.ttf +0 -0
  8. package/dist/assets/fonts/roboto/Roboto-LightItalic.ttf +0 -0
  9. package/dist/assets/fonts/roboto/Roboto-Medium.ttf +0 -0
  10. package/dist/assets/fonts/roboto/Roboto-MediumItalic.ttf +0 -0
  11. package/dist/assets/fonts/roboto/Roboto-Regular.ttf +0 -0
  12. package/dist/assets/fonts/roboto/Roboto-Thin.ttf +0 -0
  13. package/dist/assets/fonts/roboto/Roboto-ThinItalic.ttf +0 -0
  14. package/dist/components/atoms/GeneralInput/index.js +3 -1
  15. package/dist/components/atoms/GeneralInput/styles.js +1 -1
  16. package/dist/components/molecules/GalleryElement/index.js +12 -3
  17. package/dist/components/molecules/GalleryElement/styles.js +1 -1
  18. package/dist/components/molecules/HeaderTop/index.js +12 -14
  19. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  20. package/dist/components/molecules/TagAndInput/index.js +6 -2
  21. package/dist/components/organisms/InputGroup/index.js +19 -8
  22. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +38 -46
  23. package/dist/components/pages/RetailerProductEdition/index.js +331 -235
  24. package/dist/components/pages/RetailerProductEdition/utils.js +68 -0
  25. package/package.json +1 -1
  26. package/src/assets/fonts/roboto/Roboto-Black.ttf +0 -0
  27. package/src/assets/fonts/roboto/Roboto-BlackItalic.ttf +0 -0
  28. package/src/assets/fonts/roboto/Roboto-Bold.ttf +0 -0
  29. package/src/assets/fonts/roboto/Roboto-BoldItalic.ttf +0 -0
  30. package/src/assets/fonts/roboto/Roboto-Italic.ttf +0 -0
  31. package/src/assets/fonts/roboto/Roboto-Light.ttf +0 -0
  32. package/src/assets/fonts/roboto/Roboto-LightItalic.ttf +0 -0
  33. package/src/assets/fonts/roboto/Roboto-Medium.ttf +0 -0
  34. package/src/assets/fonts/roboto/Roboto-MediumItalic.ttf +0 -0
  35. package/src/assets/fonts/roboto/Roboto-Regular.ttf +0 -0
  36. package/src/assets/fonts/roboto/Roboto-Thin.ttf +0 -0
  37. package/src/assets/fonts/roboto/Roboto-ThinItalic.ttf +0 -0
  38. package/src/components/atoms/GeneralInput/index.js +2 -1
  39. package/src/components/atoms/GeneralInput/styles.js +9 -1
  40. package/src/components/molecules/GalleryElement/index.js +14 -2
  41. package/src/components/molecules/GalleryElement/styles.js +5 -0
  42. package/src/components/molecules/HeaderTop/index.js +9 -18
  43. package/src/components/molecules/HeaderTop/styles.js +19 -0
  44. package/src/components/molecules/TagAndInput/index.js +4 -0
  45. package/src/components/organisms/InputGroup/index.js +31 -4
  46. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +38 -47
  47. package/src/components/pages/RetailerProductEdition/index.js +61 -18
  48. package/src/components/pages/RetailerProductEdition/utils.js +34 -0
@@ -77,6 +77,8 @@ var _VersionSelector = require("../../organisms/VersionSelector");
77
77
 
78
78
  var _customHooks = require("../../../global-files/customHooks");
79
79
 
80
+ var _utils = require("./utils");
81
+
80
82
  var _jsxRuntime = require("react/jsx-runtime");
81
83
 
82
84
  var reducerImages = function reducerImages(state, action) {
@@ -200,7 +202,7 @@ var myBucket = new _awsSdk.default.S3({
200
202
  });
201
203
 
202
204
  var RetailerProductEdition = function RetailerProductEdition(_ref) {
203
- var _product$retailers, _product$services2, _datasheets$, _datasheets$$data, _product$article15, _comment$message;
205
+ var _product$retailers, _product$services2, _datasheets$, _datasheets$$data, _product$article18, _comment$message;
204
206
 
205
207
  var tabsSections = _ref.tabsSections,
206
208
  _ref$productSelected = _ref.productSelected,
@@ -443,25 +445,124 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
443
445
  setShowVersionSelector = _useCloseModal2[1];
444
446
 
445
447
  var shotThd = [58, 59, 60, 61].includes(activeRetailer.id);
448
+
449
+ var _useState69 = (0, _react.useState)(null),
450
+ _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
451
+ auditableVersion = _useState70[0],
452
+ setAuditableVersion = _useState70[1];
453
+
454
+ var _useState71 = (0, _react.useState)([]),
455
+ _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
456
+ auditServices = _useState72[0],
457
+ setAuditServices = _useState72[1];
458
+
459
+ var _useState73 = (0, _react.useState)([]),
460
+ _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
461
+ auditDatasheets = _useState74[0],
462
+ setAuditDatasheets = _useState74[1];
463
+
464
+ var _useState75 = (0, _react.useState)([]),
465
+ _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
466
+ auditDescriptions = _useState76[0],
467
+ setAuditDescriptions = _useState76[1];
468
+
469
+ var _useState77 = (0, _react.useState)([]),
470
+ _useState78 = (0, _slicedToArray2.default)(_useState77, 2),
471
+ auditImages = _useState78[0],
472
+ setAuditImages = _useState78[1];
473
+
474
+ var _useState79 = (0, _react.useState)(false),
475
+ _useState80 = (0, _slicedToArray2.default)(_useState79, 2),
476
+ compare = _useState80[0],
477
+ setCompare = _useState80[1];
478
+
479
+ (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
480
+ var _ref3, id_article;
481
+
482
+ return _regenerator.default.wrap(function _callee$(_context) {
483
+ while (1) {
484
+ switch (_context.prev = _context.next) {
485
+ case 0:
486
+ _ref3 = (product === null || product === void 0 ? void 0 : product.article) || {}, id_article = _ref3.id_article;
487
+
488
+ if (!id_article) {
489
+ _context.next = 4;
490
+ break;
491
+ }
492
+
493
+ _context.next = 4;
494
+ return (0, _utils.getAuditVersion)(id_article, setAuditableVersion, token);
495
+
496
+ case 4:
497
+ case "end":
498
+ return _context.stop();
499
+ }
500
+ }
501
+ }, _callee);
502
+ })), []);
503
+
504
+ var loadAuditableData = /*#__PURE__*/function () {
505
+ var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
506
+ var _product$article, _product$article2, _product$article3, _auditServices;
507
+
508
+ return _regenerator.default.wrap(function _callee2$(_context2) {
509
+ while (1) {
510
+ switch (_context2.prev = _context2.next) {
511
+ case 0:
512
+ if (!auditableVersion) {
513
+ _context2.next = 7;
514
+ break;
515
+ }
516
+
517
+ _context2.next = 3;
518
+ return (0, _data.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article, product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category), auditableVersion.version);
519
+
520
+ case 3:
521
+ _auditServices = _context2.sent;
522
+ (0, _utils.getInputsData)(_auditServices, activeRetailer, setAuditDatasheets, setAuditDescriptions);
523
+ setAuditServices(_auditServices);
524
+ setAuditImages(_auditServices[2]);
525
+
526
+ case 7:
527
+ case "end":
528
+ return _context2.stop();
529
+ }
530
+ }
531
+ }, _callee2);
532
+ }));
533
+
534
+ return function loadAuditableData() {
535
+ return _ref4.apply(this, arguments);
536
+ };
537
+ }();
538
+
539
+ (0, _react.useEffect)(function () {
540
+ loadAuditableData();
541
+ }, [auditableVersion]);
446
542
  (0, _react.useEffect)(function () {
447
543
  checkAll && setSelectedImages(images.values);
448
544
  }, [checkAll]);
449
545
 
450
546
  var loadData = /*#__PURE__*/function () {
451
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
452
- var _product$article, _product$article2, _product$article3, _services$, _services$$values, _services;
547
+ var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
548
+ var _product$article4, _product$article5, _product$article6, _services$, _services$$values, _services;
453
549
 
454
- return _regenerator.default.wrap(function _callee$(_context) {
550
+ return _regenerator.default.wrap(function _callee3$(_context3) {
455
551
  while (1) {
456
- switch (_context.prev = _context.next) {
552
+ switch (_context3.prev = _context3.next) {
457
553
  case 0:
458
- _context.prev = 0;
459
- _context.next = 3;
460
- return (0, _data.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article, product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category), version);
554
+ _context3.prev = 0;
555
+ _context3.next = 3;
556
+ return (0, _data.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article, product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article6 = product.article) === null || _product$article6 === void 0 ? void 0 : _product$article6.id_category), version);
461
557
 
462
558
  case 3:
463
- _services = _context.sent;
464
- //Converts the data inside the datasheets object to array
559
+ _services = _context3.sent;
560
+
561
+ if (auditableVersion) {
562
+ loadAuditableData();
563
+ } //Converts the data inside the datasheets object to array
564
+
565
+
465
566
  setServices(_services);
466
567
  getServices();
467
568
  setImages({
@@ -475,41 +576,41 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
475
576
  return setPercentages(res[0]);
476
577
  });
477
578
  setLoading(false);
478
- _context.next = 15;
579
+ _context3.next = 16;
479
580
  break;
480
581
 
481
- case 12:
482
- _context.prev = 12;
483
- _context.t0 = _context["catch"](0);
484
- console.log(_context.t0);
582
+ case 13:
583
+ _context3.prev = 13;
584
+ _context3.t0 = _context3["catch"](0);
585
+ console.log(_context3.t0);
485
586
 
486
- case 15:
587
+ case 16:
487
588
  case "end":
488
- return _context.stop();
589
+ return _context3.stop();
489
590
  }
490
591
  }
491
- }, _callee, null, [[0, 12]]);
592
+ }, _callee3, null, [[0, 13]]);
492
593
  }));
493
594
 
494
595
  return function loadData() {
495
- return _ref2.apply(this, arguments);
596
+ return _ref5.apply(this, arguments);
496
597
  };
497
598
  }();
498
599
 
499
600
  var getServices = /*#__PURE__*/function () {
500
- var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
501
- var _product$article4, _product$article5, _servicesResponse$dat;
601
+ var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
602
+ var _product$article7, _product$article8, _servicesResponse$dat;
502
603
 
503
604
  var servicesResponse, parsedResponse, retailers, retailerResponse, active;
504
- return _regenerator.default.wrap(function _callee2$(_context2) {
605
+ return _regenerator.default.wrap(function _callee4$(_context4) {
505
606
  while (1) {
506
- switch (_context2.prev = _context2.next) {
607
+ switch (_context4.prev = _context4.next) {
507
608
  case 0:
508
- _context2.next = 2;
509
- return _axios.default.get("".concat(process.env.REACT_APP_SERVICES_ENDPOINT, "?articleId=").concat(product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article, "&orderId=").concat((product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.id_order) || product.orderId, "&end=true"));
609
+ _context4.next = 2;
610
+ return _axios.default.get("".concat(process.env.REACT_APP_SERVICES_ENDPOINT, "?articleId=").concat(product === null || product === void 0 ? void 0 : (_product$article7 = product.article) === null || _product$article7 === void 0 ? void 0 : _product$article7.id_article, "&orderId=").concat((product === null || product === void 0 ? void 0 : (_product$article8 = product.article) === null || _product$article8 === void 0 ? void 0 : _product$article8.id_order) || product.orderId, "&end=true"));
510
611
 
511
612
  case 2:
512
- servicesResponse = _context2.sent;
613
+ servicesResponse = _context4.sent;
513
614
  parsedResponse = JSON.parse(servicesResponse === null || servicesResponse === void 0 ? void 0 : (_servicesResponse$dat = servicesResponse.data) === null || _servicesResponse$dat === void 0 ? void 0 : _servicesResponse$dat.body).data;
514
615
  retailers = product.retailers || product.retailersAvailable;
515
616
  retailerResponse = parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.map(function (srv) {
@@ -523,14 +624,14 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
523
624
 
524
625
  case 9:
525
626
  case "end":
526
- return _context2.stop();
627
+ return _context4.stop();
527
628
  }
528
629
  }
529
- }, _callee2);
630
+ }, _callee4);
530
631
  }));
531
632
 
532
633
  return function getServices() {
533
- return _ref3.apply(this, arguments);
634
+ return _ref6.apply(this, arguments);
534
635
  };
535
636
  }();
536
637
 
@@ -544,23 +645,23 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
544
645
  };
545
646
 
546
647
  var getComments = /*#__PURE__*/function () {
547
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
548
- var _product$article6, _product$article7, _product$article8;
648
+ var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
649
+ var _product$article9, _product$article10, _product$article11;
549
650
 
550
651
  var tab,
551
652
  commentsResponse,
552
653
  comments,
553
- _args3 = arguments;
554
- return _regenerator.default.wrap(function _callee3$(_context3) {
654
+ _args5 = arguments;
655
+ return _regenerator.default.wrap(function _callee5$(_context5) {
555
656
  while (1) {
556
- switch (_context3.prev = _context3.next) {
657
+ switch (_context5.prev = _context5.next) {
557
658
  case 0:
558
- tab = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : "Descripción";
559
- _context3.next = 3;
560
- return Promise.all([_axios.default.get("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT, "?articleId=").concat(product === null || product === void 0 ? void 0 : (_product$article6 = product.article) === null || _product$article6 === void 0 ? void 0 : _product$article6.id_article, "&concept=description&orderIdColab=").concat(product === null || product === void 0 ? void 0 : product.orderId, "&version=").concat(version)), _axios.default.get("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT, "?articleId=").concat(product === null || product === void 0 ? void 0 : (_product$article7 = product.article) === null || _product$article7 === void 0 ? void 0 : _product$article7.id_article, "&concept=datasheet&orderIdColab=").concat(product === null || product === void 0 ? void 0 : product.orderId, "&version=").concat(version)), _axios.default.get("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT, "?articleId=").concat(product === null || product === void 0 ? void 0 : (_product$article8 = product.article) === null || _product$article8 === void 0 ? void 0 : _product$article8.id_article, "&concept=images&orderIdColab=").concat(product === null || product === void 0 ? void 0 : product.orderId, "&version=").concat(version))]);
659
+ tab = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : "Descripción";
660
+ _context5.next = 3;
661
+ return Promise.all([_axios.default.get("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT, "?articleId=").concat(product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article, "&concept=description&orderIdColab=").concat(product === null || product === void 0 ? void 0 : product.orderId, "&version=").concat(version)), _axios.default.get("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT, "?articleId=").concat(product === null || product === void 0 ? void 0 : (_product$article10 = product.article) === null || _product$article10 === void 0 ? void 0 : _product$article10.id_article, "&concept=datasheet&orderIdColab=").concat(product === null || product === void 0 ? void 0 : product.orderId, "&version=").concat(version)), _axios.default.get("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT, "?articleId=").concat(product === null || product === void 0 ? void 0 : (_product$article11 = product.article) === null || _product$article11 === void 0 ? void 0 : _product$article11.id_article, "&concept=images&orderIdColab=").concat(product === null || product === void 0 ? void 0 : product.orderId, "&version=").concat(version))]);
561
662
 
562
663
  case 3:
563
- commentsResponse = _context3.sent;
664
+ commentsResponse = _context5.sent;
564
665
  comments = {};
565
666
  commentsResponse.forEach(function (comment) {
566
667
  var _comment$data, _JSON$parse, _JSON$parse$data$, _comment$data2, _comment$data3;
@@ -572,63 +673,63 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
572
673
 
573
674
  case 8:
574
675
  case "end":
575
- return _context3.stop();
676
+ return _context5.stop();
576
677
  }
577
678
  }
578
- }, _callee3);
679
+ }, _callee5);
579
680
  }));
580
681
 
581
682
  return function getComments() {
582
- return _ref4.apply(this, arguments);
683
+ return _ref7.apply(this, arguments);
583
684
  };
584
685
  }();
585
686
 
586
- (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
687
+ (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
587
688
  var arr;
588
- return _regenerator.default.wrap(function _callee4$(_context4) {
689
+ return _regenerator.default.wrap(function _callee6$(_context6) {
589
690
  while (1) {
590
- switch (_context4.prev = _context4.next) {
691
+ switch (_context6.prev = _context6.next) {
591
692
  case 0:
592
693
  setLoading(true);
593
694
  loadData();
594
695
  getComments();
595
- _context4.t0 = setUserGroups;
596
- _context4.next = 6;
696
+ _context6.t0 = setUserGroups;
697
+ _context6.next = 6;
597
698
  return (0, _data.fetchUsers)(token);
598
699
 
599
700
  case 6:
600
- _context4.t1 = _context4.sent;
601
- (0, _context4.t0)(_context4.t1);
701
+ _context6.t1 = _context6.sent;
702
+ (0, _context6.t0)(_context6.t1);
602
703
  arr = [];
603
- _context4.t2 = user.id_role;
604
- _context4.next = _context4.t2 === 7 ? 12 : _context4.t2 === 8 ? 12 : _context4.t2 === 4 ? 14 : _context4.t2 === 5 ? 14 : _context4.t2 === 6 ? 16 : 18;
704
+ _context6.t2 = user.id_role;
705
+ _context6.next = _context6.t2 === 7 ? 12 : _context6.t2 === 8 ? 12 : _context6.t2 === 4 ? 14 : _context6.t2 === 5 ? 14 : _context6.t2 === 6 ? 16 : 18;
605
706
  break;
606
707
 
607
708
  case 12:
608
709
  arr = ["AS", "CA", "RC", "RA", "RP", "RCA"];
609
- return _context4.abrupt("break", 20);
710
+ return _context6.abrupt("break", 20);
610
711
 
611
712
  case 14:
612
713
  arr = ["RC", "AC", "AA", "AP", "ACA"];
613
- return _context4.abrupt("break", 20);
714
+ return _context6.abrupt("break", 20);
614
715
 
615
716
  case 16:
616
717
  arr = ["RP", "RCA", "AC", "RA"];
617
- return _context4.abrupt("break", 20);
718
+ return _context6.abrupt("break", 20);
618
719
 
619
720
  case 18:
620
721
  arr = [];
621
- return _context4.abrupt("break", 20);
722
+ return _context6.abrupt("break", 20);
622
723
 
623
724
  case 20:
624
725
  setStatusArray(arr);
625
726
 
626
727
  case 21:
627
728
  case "end":
628
- return _context4.stop();
729
+ return _context6.stop();
629
730
  }
630
731
  }
631
- }, _callee4);
732
+ }, _callee6);
632
733
  })), [product, version]);
633
734
 
634
735
  var loadAssignations = function loadAssignations(currentProduct) {
@@ -694,22 +795,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
694
795
  setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
695
796
  }, [percentages]);
696
797
  (0, _react.useEffect)(function () {
697
- if (services.length > 0) {
698
- var _services$0$activeRet, _services$2, _services$3;
699
-
700
- if ((_services$0$activeRet = services[0][activeRetailer.id]) !== null && _services$0$activeRet !== void 0 && _services$0$activeRet.data) services[0][activeRetailer.id].data = Object.values(services[0][activeRetailer.id].data);
701
- setActivePercentage(Math.round(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.percentage, 0));
702
- var datagroups = services[0][activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id];
703
- var inputs = (_services$2 = services[0]) === null || _services$2 === void 0 ? void 0 : _services$2.inputs;
704
-
705
- var _descriptions = (_services$3 = services[1]) === null || _services$3 === void 0 ? void 0 : _services$3.filter(function (service) {
706
- return (service === null || service === void 0 ? void 0 : service.id) === (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id);
707
- });
708
-
709
- setDatasheets([datagroups, inputs]);
710
- setDescriptions(_descriptions);
711
- }
712
-
798
+ (0, _utils.getInputsData)(services, activeRetailer, setDatasheets, setDescriptions);
799
+ auditableVersion && (0, _utils.getInputsData)(auditServices, activeRetailer, setAuditDatasheets, setAuditDescriptions);
800
+ setActivePercentage(Math.round(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.percentage, 0));
713
801
  (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id) && setImages({
714
802
  action: "orderImages",
715
803
  retailerId: activeRetailer.id
@@ -744,7 +832,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
744
832
  image: image,
745
833
  gridLayout: imageLayout,
746
834
  id: "gallery-element-" + index,
747
- index: index + "-" + image.name,
835
+ index: index + "-" + image.name + "-" + compare,
748
836
  number: index,
749
837
  imageType: imageType,
750
838
  imagePackagingType: imagePackagingType,
@@ -753,38 +841,40 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
753
841
  setSocketType: setSocketType,
754
842
  changeImage: setImages,
755
843
  selectedImages: selectedImages,
756
- setSelectedImages: setSelectedImages
844
+ setSelectedImages: setSelectedImages,
845
+ auditImages: auditImages,
846
+ compare: compare
757
847
  }, index + "-" + imageType.name);
758
848
  });
759
849
  };
760
850
 
761
851
  var saveDescriptions = /*#__PURE__*/function () {
762
- var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
763
- var dataClean, _product$article9, productTemp, articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
852
+ var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
853
+ var dataClean, _product$article12, productTemp, articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
764
854
 
765
- return _regenerator.default.wrap(function _callee5$(_context5) {
855
+ return _regenerator.default.wrap(function _callee7$(_context7) {
766
856
  while (1) {
767
- switch (_context5.prev = _context5.next) {
857
+ switch (_context7.prev = _context7.next) {
768
858
  case 0:
769
859
  dataClean = updatedDescriptions.filter(function (f) {
770
- return f.value !== '';
860
+ return f.value !== "";
771
861
  });
772
862
 
773
863
  if (!(dataClean.length > 0)) {
774
- _context5.next = 25;
864
+ _context7.next = 25;
775
865
  break;
776
866
  }
777
867
 
778
868
  setLoading(true);
779
869
  productTemp = product;
780
- articleId = product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article;
870
+ articleId = product === null || product === void 0 ? void 0 : (_product$article12 = product.article) === null || _product$article12 === void 0 ? void 0 : _product$article12.id_article;
781
871
  dataObject = {
782
872
  articleId: articleId,
783
873
  articleData: dataClean
784
874
  };
785
875
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
786
- _context5.prev = 7;
787
- _context5.next = 10;
876
+ _context7.prev = 7;
877
+ _context7.next = 10;
788
878
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
789
879
  headers: {
790
880
  Authorization: token
@@ -792,10 +882,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
792
882
  });
793
883
 
794
884
  case 10:
795
- res = _context5.sent;
885
+ res = _context7.sent;
796
886
 
797
887
  if (!(res.data.statusCode === 200)) {
798
- _context5.next = 20;
888
+ _context7.next = 20;
799
889
  break;
800
890
  }
801
891
 
@@ -805,58 +895,58 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
805
895
  setProduct(productTemp);
806
896
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
807
897
  setMessage("Descripciones guardadas con éxito");
808
- _context5.next = 20;
898
+ _context7.next = 20;
809
899
  return loadData();
810
900
 
811
901
  case 20:
812
- _context5.next = 25;
902
+ _context7.next = 25;
813
903
  break;
814
904
 
815
905
  case 22:
816
- _context5.prev = 22;
817
- _context5.t0 = _context5["catch"](7);
818
- console.log(_context5.t0);
906
+ _context7.prev = 22;
907
+ _context7.t0 = _context7["catch"](7);
908
+ console.log(_context7.t0);
819
909
 
820
910
  case 25:
821
911
  case "end":
822
- return _context5.stop();
912
+ return _context7.stop();
823
913
  }
824
914
  }
825
- }, _callee5, null, [[7, 22]]);
915
+ }, _callee7, null, [[7, 22]]);
826
916
  }));
827
917
 
828
918
  return function saveDescriptions() {
829
- return _ref6.apply(this, arguments);
919
+ return _ref9.apply(this, arguments);
830
920
  };
831
921
  }();
832
922
 
833
923
  var saveDatasheets = /*#__PURE__*/function () {
834
- var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
835
- var dataClean, _product$article10, productTemp, articleId, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
924
+ var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
925
+ var dataClean, _product$article13, productTemp, articleId, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
836
926
 
837
- return _regenerator.default.wrap(function _callee6$(_context6) {
927
+ return _regenerator.default.wrap(function _callee8$(_context8) {
838
928
  while (1) {
839
- switch (_context6.prev = _context6.next) {
929
+ switch (_context8.prev = _context8.next) {
840
930
  case 0:
841
931
  dataClean = updatedDatasheets.filter(function (f) {
842
- return f.value !== '';
932
+ return f.value !== "";
843
933
  });
844
934
 
845
935
  if (!(dataClean.length > 0)) {
846
- _context6.next = 25;
936
+ _context8.next = 25;
847
937
  break;
848
938
  }
849
939
 
850
940
  setLoading(true);
851
941
  productTemp = product;
852
- articleId = product === null || product === void 0 ? void 0 : (_product$article10 = product.article) === null || _product$article10 === void 0 ? void 0 : _product$article10.id_article;
942
+ articleId = product === null || product === void 0 ? void 0 : (_product$article13 = product.article) === null || _product$article13 === void 0 ? void 0 : _product$article13.id_article;
853
943
  dataObject = {
854
944
  articleId: articleId,
855
945
  articleData: dataClean
856
946
  };
857
947
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
858
- _context6.prev = 7;
859
- _context6.next = 10;
948
+ _context8.prev = 7;
949
+ _context8.next = 10;
860
950
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
861
951
  headers: {
862
952
  Authorization: token
@@ -864,10 +954,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
864
954
  });
865
955
 
866
956
  case 10:
867
- res = _context6.sent;
957
+ res = _context8.sent;
868
958
 
869
959
  if (!(res.data.statusCode === 200)) {
870
- _context6.next = 20;
960
+ _context8.next = 20;
871
961
  break;
872
962
  }
873
963
 
@@ -877,28 +967,28 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
877
967
  setProduct(productTemp);
878
968
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
879
969
  setMessage("Fichas técnicas guardadas");
880
- _context6.next = 20;
970
+ _context8.next = 20;
881
971
  return loadData();
882
972
 
883
973
  case 20:
884
- _context6.next = 25;
974
+ _context8.next = 25;
885
975
  break;
886
976
 
887
977
  case 22:
888
- _context6.prev = 22;
889
- _context6.t0 = _context6["catch"](7);
890
- console.log(_context6.t0);
978
+ _context8.prev = 22;
979
+ _context8.t0 = _context8["catch"](7);
980
+ console.log(_context8.t0);
891
981
 
892
982
  case 25:
893
983
  case "end":
894
- return _context6.stop();
984
+ return _context8.stop();
895
985
  }
896
986
  }
897
- }, _callee6, null, [[7, 22]]);
987
+ }, _callee8, null, [[7, 22]]);
898
988
  }));
899
989
 
900
990
  return function saveDatasheets() {
901
- return _ref7.apply(this, arguments);
991
+ return _ref10.apply(this, arguments);
902
992
  };
903
993
  }();
904
994
 
@@ -919,14 +1009,14 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
919
1009
  });
920
1010
  setSocketType(imageInputs);
921
1011
  }, [images]);
922
- var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
923
- var _images$values3, _images$attrForImgs, _product$article11, _data$articleData, _data$articleData2, _data$updateImages;
1012
+ var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
1013
+ var _images$values3, _images$attrForImgs, _product$article14, _data$articleData, _data$articleData2, _data$updateImages;
924
1014
 
925
1015
  var imagesList, imagesListTemp, duplicated, attrForImgs, data, valid, _data$updateImages2, _data$articleData3, _data$articleData4, _data$articleData5, promiseArray;
926
1016
 
927
- return _regenerator.default.wrap(function _callee7$(_context7) {
1017
+ return _regenerator.default.wrap(function _callee9$(_context9) {
928
1018
  while (1) {
929
- switch (_context7.prev = _context7.next) {
1019
+ switch (_context9.prev = _context9.next) {
930
1020
  case 0:
931
1021
  imagesList = images === null || images === void 0 ? void 0 : (_images$values3 = images.values) === null || _images$values3 === void 0 ? void 0 : _images$values3.slice();
932
1022
  imagesListTemp = imagesList === null || imagesList === void 0 ? void 0 : imagesList.reduce(function (acc, image) {
@@ -938,7 +1028,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
938
1028
  });
939
1029
  attrForImgs = Object.values((_images$attrForImgs = images === null || images === void 0 ? void 0 : images.attrForImgs) !== null && _images$attrForImgs !== void 0 ? _images$attrForImgs : {}).pop();
940
1030
  data = {
941
- articleId: product === null || product === void 0 ? void 0 : (_product$article11 = product.article) === null || _product$article11 === void 0 ? void 0 : _product$article11.id_article,
1031
+ articleId: product === null || product === void 0 ? void 0 : (_product$article14 = product.article) === null || _product$article14 === void 0 ? void 0 : _product$article14.id_article,
942
1032
  attrReqImgs: attrForImgs === null || attrForImgs === void 0 ? void 0 : attrForImgs.map(function (e) {
943
1033
  var _e$value;
944
1034
 
@@ -974,19 +1064,19 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
974
1064
  }
975
1065
 
976
1066
  if (!(valid && (duplicated === null || duplicated === void 0 ? void 0 : duplicated.length) === 0)) {
977
- _context7.next = 30;
1067
+ _context9.next = 30;
978
1068
  break;
979
1069
  }
980
1070
 
981
1071
  setLoading(true);
982
- _context7.prev = 10;
1072
+ _context9.prev = 10;
983
1073
  data === null || data === void 0 ? void 0 : (_data$articleData3 = data.articleData) === null || _data$articleData3 === void 0 ? void 0 : _data$articleData3.forEach(function (e) {
984
1074
  e.uuid = (0, _uuid.v4)();
985
1075
  });
986
1076
  setDataImages(data);
987
1077
 
988
1078
  if (!((data === null || data === void 0 ? void 0 : (_data$articleData4 = data.articleData) === null || _data$articleData4 === void 0 ? void 0 : _data$articleData4.length) > 0)) {
989
- _context7.next = 22;
1079
+ _context9.next = 22;
990
1080
  break;
991
1081
  }
992
1082
 
@@ -1002,28 +1092,28 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1002
1092
  };
1003
1093
  promiseArray.push(myBucket.putObject(params).promise());
1004
1094
  });
1005
- _context7.next = 19;
1095
+ _context9.next = 19;
1006
1096
  return Promise.all(promiseArray);
1007
1097
 
1008
1098
  case 19:
1009
1099
  setImagesUploaded(true);
1010
- _context7.next = 23;
1100
+ _context9.next = 23;
1011
1101
  break;
1012
1102
 
1013
1103
  case 22:
1014
1104
  setImagesUploaded(true);
1015
1105
 
1016
1106
  case 23:
1017
- _context7.next = 28;
1107
+ _context9.next = 28;
1018
1108
  break;
1019
1109
 
1020
1110
  case 25:
1021
- _context7.prev = 25;
1022
- _context7.t0 = _context7["catch"](10);
1023
- console.log(_context7.t0); // setMainLoading(false);
1111
+ _context9.prev = 25;
1112
+ _context9.t0 = _context9["catch"](10);
1113
+ console.log(_context9.t0); // setMainLoading(false);
1024
1114
 
1025
1115
  case 28:
1026
- _context7.next = 31;
1116
+ _context9.next = 31;
1027
1117
  break;
1028
1118
 
1029
1119
  case 30:
@@ -1032,20 +1122,20 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1032
1122
 
1033
1123
  case 31:
1034
1124
  case "end":
1035
- return _context7.stop();
1125
+ return _context9.stop();
1036
1126
  }
1037
1127
  }
1038
- }, _callee7, null, [[10, 25]]);
1128
+ }, _callee9, null, [[10, 25]]);
1039
1129
  })), [images, imagesUploaded]);
1040
- (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
1041
- var res, _product$article12, productTemp, _JSON$parse4, newStatus, newArticleStatus;
1130
+ (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
1131
+ var res, _product$article15, productTemp, _JSON$parse4, newStatus, newArticleStatus;
1042
1132
 
1043
- return _regenerator.default.wrap(function _callee8$(_context8) {
1133
+ return _regenerator.default.wrap(function _callee10$(_context10) {
1044
1134
  while (1) {
1045
- switch (_context8.prev = _context8.next) {
1135
+ switch (_context10.prev = _context10.next) {
1046
1136
  case 0:
1047
1137
  if (!imagesUploaded) {
1048
- _context8.next = 22;
1138
+ _context10.next = 22;
1049
1139
  break;
1050
1140
  }
1051
1141
 
@@ -1057,8 +1147,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1057
1147
  if (product !== null && product !== void 0 && product.orderId) e["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
1058
1148
  return e;
1059
1149
  });
1060
- _context8.prev = 2;
1061
- _context8.next = 5;
1150
+ _context10.prev = 2;
1151
+ _context10.next = 5;
1062
1152
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?image=true&version=").concat(version), dataImages, {
1063
1153
  headers: {
1064
1154
  Authorization: token
@@ -1066,39 +1156,39 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1066
1156
  });
1067
1157
 
1068
1158
  case 5:
1069
- res = _context8.sent;
1159
+ res = _context10.sent;
1070
1160
 
1071
1161
  if (!(res.data.statusCode === 200)) {
1072
- _context8.next = 17;
1162
+ _context10.next = 17;
1073
1163
  break;
1074
1164
  }
1075
1165
 
1076
1166
  productTemp = product;
1077
1167
  _JSON$parse4 = JSON.parse(res.data.body), newStatus = _JSON$parse4.newStatus, newArticleStatus = _JSON$parse4.newArticleStatus;
1078
- if (newArticleStatus) productTemp.status = newArticleStatus[product === null || product === void 0 ? void 0 : (_product$article12 = product.article) === null || _product$article12 === void 0 ? void 0 : _product$article12.id_article];
1168
+ if (newArticleStatus) productTemp.status = newArticleStatus[product === null || product === void 0 ? void 0 : (_product$article15 = product.article) === null || _product$article15 === void 0 ? void 0 : _product$article15.id_article];
1079
1169
  if (newStatus) productTemp.images_status = newStatus;
1080
1170
  setProduct(productTemp);
1081
1171
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1082
1172
  setMessage("Imágenes guardadas con éxito");
1083
1173
  sessionStorage.removeItem("imagesList");
1084
- _context8.next = 17;
1174
+ _context10.next = 17;
1085
1175
  return loadData();
1086
1176
 
1087
1177
  case 17:
1088
- _context8.next = 22;
1178
+ _context10.next = 22;
1089
1179
  break;
1090
1180
 
1091
1181
  case 19:
1092
- _context8.prev = 19;
1093
- _context8.t0 = _context8["catch"](2);
1094
- console.log(_context8.t0);
1182
+ _context10.prev = 19;
1183
+ _context10.t0 = _context10["catch"](2);
1184
+ console.log(_context10.t0);
1095
1185
 
1096
1186
  case 22:
1097
1187
  case "end":
1098
- return _context8.stop();
1188
+ return _context10.stop();
1099
1189
  }
1100
1190
  }
1101
- }, _callee8, null, [[2, 19]]);
1191
+ }, _callee10, null, [[2, 19]]);
1102
1192
  })), [dataImages, imagesUploaded]);
1103
1193
 
1104
1194
  var evaluationFinished = function evaluationFinished(userId, tab, statusArray) {
@@ -1184,8 +1274,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1184
1274
  break;
1185
1275
  }
1186
1276
 
1187
- var services = servicesData.filter(function (_ref10) {
1188
- var service = _ref10.service;
1277
+ var services = servicesData.filter(function (_ref13) {
1278
+ var service = _ref13.service;
1189
1279
  return concepts.includes(service);
1190
1280
  });
1191
1281
  var adminFacilitatorCanEvaluate = services.every(function (srv) {
@@ -1222,15 +1312,15 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1222
1312
  };
1223
1313
 
1224
1314
  var sendToFacilitator = /*#__PURE__*/function () {
1225
- var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
1315
+ var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
1226
1316
  var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
1227
1317
 
1228
- return _regenerator.default.wrap(function _callee9$(_context9) {
1318
+ return _regenerator.default.wrap(function _callee11$(_context11) {
1229
1319
  while (1) {
1230
- switch (_context9.prev = _context9.next) {
1320
+ switch (_context11.prev = _context11.next) {
1231
1321
  case 0:
1232
1322
  setLoading(true);
1233
- _context9.prev = 1;
1323
+ _context11.prev = 1;
1234
1324
  concept = getConcept(activeTab);
1235
1325
  productTemp = (0, _objectSpread2.default)({}, product);
1236
1326
  evalStatus = retailerStatus;
@@ -1245,12 +1335,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1245
1335
  };
1246
1336
 
1247
1337
  if (!result) {
1248
- _context9.next = 16;
1338
+ _context11.next = 16;
1249
1339
  break;
1250
1340
  }
1251
1341
 
1252
1342
  data.result = result;
1253
- _context9.next = 12;
1343
+ _context11.next = 12;
1254
1344
  return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1255
1345
  headers: {
1256
1346
  Authorization: token
@@ -1258,9 +1348,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1258
1348
  });
1259
1349
 
1260
1350
  case 12:
1261
- res = _context9.sent;
1351
+ res = _context11.sent;
1262
1352
  getServices();
1263
- _context9.next = 21;
1353
+ _context11.next = 21;
1264
1354
  break;
1265
1355
 
1266
1356
  case 16:
@@ -1274,7 +1364,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1274
1364
  getSectionIcon();
1275
1365
  }
1276
1366
 
1277
- _context9.next = 20;
1367
+ _context11.next = 20;
1278
1368
  return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1279
1369
  headers: {
1280
1370
  Authorization: token
@@ -1282,18 +1372,18 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1282
1372
  });
1283
1373
 
1284
1374
  case 20:
1285
- res = _context9.sent;
1375
+ res = _context11.sent;
1286
1376
 
1287
1377
  case 21:
1288
1378
  if (!(res.data.statusCode === 200)) {
1289
- _context9.next = 30;
1379
+ _context11.next = 30;
1290
1380
  break;
1291
1381
  }
1292
1382
 
1293
1383
  _JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
1294
1384
  if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
1295
1385
  productTemp["".concat(concept, "_status")] = newStatus;
1296
- _context9.next = 27;
1386
+ _context11.next = 27;
1297
1387
  return loadData();
1298
1388
 
1299
1389
  case 27:
@@ -1302,27 +1392,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1302
1392
  setProduct(productTemp);
1303
1393
 
1304
1394
  case 30:
1305
- _context9.next = 35;
1395
+ _context11.next = 35;
1306
1396
  break;
1307
1397
 
1308
1398
  case 32:
1309
- _context9.prev = 32;
1310
- _context9.t0 = _context9["catch"](1);
1311
- console.log(_context9.t0);
1399
+ _context11.prev = 32;
1400
+ _context11.t0 = _context11["catch"](1);
1401
+ console.log(_context11.t0);
1312
1402
 
1313
1403
  case 35:
1314
1404
  setLoading(false);
1315
1405
 
1316
1406
  case 36:
1317
1407
  case "end":
1318
- return _context9.stop();
1408
+ return _context11.stop();
1319
1409
  }
1320
1410
  }
1321
- }, _callee9, null, [[1, 32]]);
1411
+ }, _callee11, null, [[1, 32]]);
1322
1412
  }));
1323
1413
 
1324
1414
  return function sendToFacilitator(_x) {
1325
- return _ref11.apply(this, arguments);
1415
+ return _ref14.apply(this, arguments);
1326
1416
  };
1327
1417
  }();
1328
1418
 
@@ -1353,40 +1443,40 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1353
1443
  };
1354
1444
 
1355
1445
  var createComment = /*#__PURE__*/function () {
1356
- var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, body, tab) {
1357
- var _product$article13;
1446
+ var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(e, body, tab) {
1447
+ var _product$article16;
1358
1448
 
1359
1449
  var concept, data;
1360
- return _regenerator.default.wrap(function _callee10$(_context10) {
1450
+ return _regenerator.default.wrap(function _callee12$(_context12) {
1361
1451
  while (1) {
1362
- switch (_context10.prev = _context10.next) {
1452
+ switch (_context12.prev = _context12.next) {
1363
1453
  case 0:
1364
1454
  concept = "";
1365
- _context10.t0 = activeTab;
1366
- _context10.next = _context10.t0 === "Ficha técnica" ? 4 : _context10.t0 === "Imágenes" ? 6 : 8;
1455
+ _context12.t0 = activeTab;
1456
+ _context12.next = _context12.t0 === "Ficha técnica" ? 4 : _context12.t0 === "Imágenes" ? 6 : 8;
1367
1457
  break;
1368
1458
 
1369
1459
  case 4:
1370
1460
  concept = "datasheet";
1371
- return _context10.abrupt("break", 10);
1461
+ return _context12.abrupt("break", 10);
1372
1462
 
1373
1463
  case 6:
1374
1464
  concept = "images";
1375
- return _context10.abrupt("break", 10);
1465
+ return _context12.abrupt("break", 10);
1376
1466
 
1377
1467
  case 8:
1378
1468
  concept = "description";
1379
- return _context10.abrupt("break", 10);
1469
+ return _context12.abrupt("break", 10);
1380
1470
 
1381
1471
  case 10:
1382
1472
  data = {
1383
- articleId: product === null || product === void 0 ? void 0 : (_product$article13 = product.article) === null || _product$article13 === void 0 ? void 0 : _product$article13.id_article,
1473
+ articleId: product === null || product === void 0 ? void 0 : (_product$article16 = product.article) === null || _product$article16 === void 0 ? void 0 : _product$article16.id_article,
1384
1474
  orderId: product === null || product === void 0 ? void 0 : product.orderId,
1385
1475
  message: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, ""),
1386
1476
  concept: concept,
1387
1477
  version: version
1388
1478
  };
1389
- _context10.next = 13;
1479
+ _context12.next = 13;
1390
1480
  return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1391
1481
  headers: {
1392
1482
  Authorization: token
@@ -1394,7 +1484,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1394
1484
  });
1395
1485
 
1396
1486
  case 13:
1397
- _context10.next = 15;
1487
+ _context12.next = 15;
1398
1488
  return getComments(tab);
1399
1489
 
1400
1490
  case 15:
@@ -1403,20 +1493,20 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1403
1493
 
1404
1494
  case 17:
1405
1495
  case "end":
1406
- return _context10.stop();
1496
+ return _context12.stop();
1407
1497
  }
1408
1498
  }
1409
- }, _callee10);
1499
+ }, _callee12);
1410
1500
  }));
1411
1501
 
1412
1502
  return function createComment(_x2, _x3, _x4) {
1413
- return _ref12.apply(this, arguments);
1503
+ return _ref15.apply(this, arguments);
1414
1504
  };
1415
1505
  }();
1416
1506
 
1417
1507
  var getRequired = function getRequired(services) {
1418
1508
  try {
1419
- var _services$4, _services$4$retailerM, _services$5, _services$5$inputs;
1509
+ var _services$2, _services$2$retailerM, _services$3, _services$3$inputs;
1420
1510
 
1421
1511
  var objetcTemp = {};
1422
1512
  var datasheetServicesArray = Object.values(services[0]);
@@ -1458,12 +1548,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1458
1548
  });
1459
1549
  objetcTemp["Descripción"] = desInputsRequired;
1460
1550
  var retailersRequested = [];
1461
- (_services$4 = services[2]) === null || _services$4 === void 0 ? void 0 : (_services$4$retailerM = _services$4.retailerMandatories) === null || _services$4$retailerM === void 0 ? void 0 : _services$4$retailerM.forEach(function (retMan) {
1551
+ (_services$2 = services[2]) === null || _services$2 === void 0 ? void 0 : (_services$2$retailerM = _services$2.retailerMandatories) === null || _services$2$retailerM === void 0 ? void 0 : _services$2$retailerM.forEach(function (retMan) {
1462
1552
  return retMan.forEach(function (rm) {
1463
1553
  return retailersRequested.push(rm);
1464
1554
  });
1465
1555
  });
1466
- var requiredImages = (_services$5 = services[2]) === null || _services$5 === void 0 ? void 0 : (_services$5$inputs = _services$5.inputs) === null || _services$5$inputs === void 0 ? void 0 : _services$5$inputs.filter(function (e) {
1556
+ var requiredImages = (_services$3 = services[2]) === null || _services$3 === void 0 ? void 0 : (_services$3$inputs = _services$3.inputs) === null || _services$3$inputs === void 0 ? void 0 : _services$3$inputs.filter(function (e) {
1467
1557
  return e.required === 1 && retailersRequested.filter(function (ret) {
1468
1558
  return ret.id_image === e.id && servicesData.filter(function (srv) {
1469
1559
  return srv.id_retailer === ret.id_retailer;
@@ -1488,16 +1578,16 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1488
1578
  }, [activeTab]);
1489
1579
 
1490
1580
  var commentRevised = /*#__PURE__*/function () {
1491
- var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
1581
+ var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
1492
1582
  var data;
1493
- return _regenerator.default.wrap(function _callee11$(_context11) {
1583
+ return _regenerator.default.wrap(function _callee13$(_context13) {
1494
1584
  while (1) {
1495
- switch (_context11.prev = _context11.next) {
1585
+ switch (_context13.prev = _context13.next) {
1496
1586
  case 0:
1497
1587
  data = {
1498
1588
  commentId: comment.id
1499
1589
  };
1500
- _context11.next = 3;
1590
+ _context13.next = 3;
1501
1591
  return _axios.default.put("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1502
1592
  headers: {
1503
1593
  Authorization: sessionStorage.getItem("jwt")
@@ -1506,47 +1596,47 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1506
1596
 
1507
1597
  case 3:
1508
1598
  setCrossComment(false);
1509
- _context11.next = 6;
1599
+ _context13.next = 6;
1510
1600
  return getComments();
1511
1601
 
1512
1602
  case 6:
1513
1603
  case "end":
1514
- return _context11.stop();
1604
+ return _context13.stop();
1515
1605
  }
1516
1606
  }
1517
- }, _callee11);
1607
+ }, _callee13);
1518
1608
  }));
1519
1609
 
1520
1610
  return function commentRevised() {
1521
- return _ref13.apply(this, arguments);
1611
+ return _ref16.apply(this, arguments);
1522
1612
  };
1523
1613
  }();
1524
1614
 
1525
1615
  var setAssignation = /*#__PURE__*/function () {
1526
- var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(assignationType, assignationId) {
1527
- var _product$article14;
1616
+ var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
1617
+ var _product$article17;
1528
1618
 
1529
1619
  var concept, productTemp, data;
1530
- return _regenerator.default.wrap(function _callee12$(_context12) {
1620
+ return _regenerator.default.wrap(function _callee14$(_context14) {
1531
1621
  while (1) {
1532
- switch (_context12.prev = _context12.next) {
1622
+ switch (_context14.prev = _context14.next) {
1533
1623
  case 0:
1534
1624
  concept = "";
1535
- _context12.t0 = activeTab;
1536
- _context12.next = _context12.t0 === "Ficha técnica" ? 4 : _context12.t0 === "Imágenes" ? 6 : 8;
1625
+ _context14.t0 = activeTab;
1626
+ _context14.next = _context14.t0 === "Ficha técnica" ? 4 : _context14.t0 === "Imágenes" ? 6 : 8;
1537
1627
  break;
1538
1628
 
1539
1629
  case 4:
1540
1630
  concept = "datasheet";
1541
- return _context12.abrupt("break", 10);
1631
+ return _context14.abrupt("break", 10);
1542
1632
 
1543
1633
  case 6:
1544
1634
  concept = "images";
1545
- return _context12.abrupt("break", 10);
1635
+ return _context14.abrupt("break", 10);
1546
1636
 
1547
1637
  case 8:
1548
1638
  concept = "description";
1549
- return _context12.abrupt("break", 10);
1639
+ return _context14.abrupt("break", 10);
1550
1640
 
1551
1641
  case 10:
1552
1642
  productTemp = product;
@@ -1554,12 +1644,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1554
1644
  data = {
1555
1645
  articleList: [{
1556
1646
  orderId: product.orderId,
1557
- articleId: product === null || product === void 0 ? void 0 : (_product$article14 = product.article) === null || _product$article14 === void 0 ? void 0 : _product$article14.id_article
1647
+ articleId: product === null || product === void 0 ? void 0 : (_product$article17 = product.article) === null || _product$article17 === void 0 ? void 0 : _product$article17.id_article
1558
1648
  }],
1559
1649
  concept: concept,
1560
1650
  userId: assignationId
1561
1651
  };
1562
- _context12.next = 15;
1652
+ _context14.next = 15;
1563
1653
  return (0, _axios.default)({
1564
1654
  method: "post",
1565
1655
  url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
@@ -1575,14 +1665,14 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1575
1665
 
1576
1666
  case 17:
1577
1667
  case "end":
1578
- return _context12.stop();
1668
+ return _context14.stop();
1579
1669
  }
1580
1670
  }
1581
- }, _callee12);
1671
+ }, _callee14);
1582
1672
  }));
1583
1673
 
1584
1674
  return function setAssignation(_x5, _x6) {
1585
- return _ref14.apply(this, arguments);
1675
+ return _ref17.apply(this, arguments);
1586
1676
  };
1587
1677
  }();
1588
1678
 
@@ -1694,33 +1784,33 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1694
1784
  }, [loading]);
1695
1785
 
1696
1786
  var validateAll = /*#__PURE__*/function () {
1697
- var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
1787
+ var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(result) {
1698
1788
  var _conceptArray, evaluationArray, sendAll, conceptArray, productTemp;
1699
1789
 
1700
- return _regenerator.default.wrap(function _callee13$(_context13) {
1790
+ return _regenerator.default.wrap(function _callee15$(_context15) {
1701
1791
  while (1) {
1702
- switch (_context13.prev = _context13.next) {
1792
+ switch (_context15.prev = _context15.next) {
1703
1793
  case 0:
1704
- _context13.prev = 0;
1794
+ _context15.prev = 0;
1705
1795
  setLoading(true);
1706
1796
  evaluationArray = [];
1707
1797
  sendAll = [];
1708
1798
  conceptArray = [];
1709
- _context13.t0 = user.id_role;
1710
- _context13.next = _context13.t0 === 4 ? 8 : _context13.t0 === 5 ? 10 : 12;
1799
+ _context15.t0 = user.id_role;
1800
+ _context15.next = _context15.t0 === 4 ? 8 : _context15.t0 === 5 ? 10 : 12;
1711
1801
  break;
1712
1802
 
1713
1803
  case 8:
1714
1804
  conceptArray = ["description", "datasheet"];
1715
- return _context13.abrupt("break", 14);
1805
+ return _context15.abrupt("break", 14);
1716
1806
 
1717
1807
  case 10:
1718
1808
  conceptArray = ["images"];
1719
- return _context13.abrupt("break", 14);
1809
+ return _context15.abrupt("break", 14);
1720
1810
 
1721
1811
  case 12:
1722
1812
  conceptArray = ["description", "datasheet", "images"];
1723
- return _context13.abrupt("break", 14);
1813
+ return _context15.abrupt("break", 14);
1724
1814
 
1725
1815
  case 14:
1726
1816
  servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
@@ -1742,7 +1832,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1742
1832
  }));
1743
1833
  }
1744
1834
  });
1745
- _context13.next = 17;
1835
+ _context15.next = 17;
1746
1836
  return Promise.all(evaluationArray);
1747
1837
 
1748
1838
  case 17:
@@ -1761,7 +1851,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1761
1851
  }
1762
1852
  }));
1763
1853
  });
1764
- _context13.next = 20;
1854
+ _context15.next = 20;
1765
1855
  return Promise.all(sendAll);
1766
1856
 
1767
1857
  case 20:
@@ -1772,35 +1862,37 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1772
1862
  productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "A");
1773
1863
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1774
1864
  setProduct(productTemp);
1775
- _context13.next = 29;
1865
+ _context15.next = 29;
1776
1866
  return loadData();
1777
1867
 
1778
1868
  case 29:
1779
- _context13.next = 34;
1869
+ _context15.next = 34;
1780
1870
  break;
1781
1871
 
1782
1872
  case 31:
1783
- _context13.prev = 31;
1784
- _context13.t1 = _context13["catch"](0);
1785
- console.log(_context13.t1);
1873
+ _context15.prev = 31;
1874
+ _context15.t1 = _context15["catch"](0);
1875
+ console.log(_context15.t1);
1786
1876
 
1787
1877
  case 34:
1788
1878
  case "end":
1789
- return _context13.stop();
1879
+ return _context15.stop();
1790
1880
  }
1791
1881
  }
1792
- }, _callee13, null, [[0, 31]]);
1882
+ }, _callee15, null, [[0, 31]]);
1793
1883
  }));
1794
1884
 
1795
1885
  return function validateAll(_x7) {
1796
- return _ref15.apply(this, arguments);
1886
+ return _ref18.apply(this, arguments);
1797
1887
  };
1798
1888
  }();
1799
1889
 
1800
1890
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
1801
1891
  headerTop: headerTop,
1802
1892
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
1803
- setHeaderTop: setHeaderTop
1893
+ setHeaderTop: setHeaderTop,
1894
+ auditableVersion: auditableVersion,
1895
+ setCompare: setCompare
1804
1896
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1805
1897
  className: "data-container",
1806
1898
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -1940,8 +2032,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1940
2032
  activeSection: activeTab,
1941
2033
  inputGroup: dataGroup,
1942
2034
  dataInputs: datasheets[1],
2035
+ auditInputs: auditDatasheets[1],
1943
2036
  updatedDatasheets: updatedDatasheets,
1944
- setUpdatedDatasheets: setUpdatedDatasheets
2037
+ setUpdatedDatasheets: setUpdatedDatasheets,
2038
+ compare: compare
1945
2039
  }, index + "-" + activeRetailer.name);
1946
2040
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1947
2041
  text: "No cuentas con este servicio",
@@ -1949,11 +2043,13 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1949
2043
  })), activeTab === "Descripción" && ((product === null || product === void 0 ? void 0 : product.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1950
2044
  activeSection: activeTab,
1951
2045
  inputGroup: descriptions[0],
2046
+ auditInputGroup: auditDescriptions[0],
1952
2047
  updatedDescriptions: updatedDescriptions,
1953
2048
  setUpdatedDescriptions: setUpdatedDescriptions,
1954
- articleId: product === null || product === void 0 ? void 0 : (_product$article15 = product.article) === null || _product$article15 === void 0 ? void 0 : _product$article15.id_article,
2049
+ articleId: product === null || product === void 0 ? void 0 : (_product$article18 = product.article) === null || _product$article18 === void 0 ? void 0 : _product$article18.id_article,
1955
2050
  version: version,
1956
- dinamicHeight: true
2051
+ dinamicHeight: true,
2052
+ compare: compare
1957
2053
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1958
2054
  text: "No cuentas con este servicio",
1959
2055
  headerType: "input-name-header"
@@ -1999,20 +2095,20 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1999
2095
  reviewed: crossComment
2000
2096
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2001
2097
  buttonType: "circular-button accept-button",
2002
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
2003
- return _regenerator.default.wrap(function _callee14$(_context14) {
2098
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
2099
+ return _regenerator.default.wrap(function _callee16$(_context16) {
2004
2100
  while (1) {
2005
- switch (_context14.prev = _context14.next) {
2101
+ switch (_context16.prev = _context16.next) {
2006
2102
  case 0:
2007
2103
  setCrossComment(true);
2008
2104
  commentRevised();
2009
2105
 
2010
2106
  case 2:
2011
2107
  case "end":
2012
- return _context14.stop();
2108
+ return _context16.stop();
2013
2109
  }
2014
2110
  }
2015
- }, _callee14);
2111
+ }, _callee16);
2016
2112
  }))
2017
2113
  })]
2018
2114
  }), [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {