contentoh-components-library 21.3.55 → 21.3.56

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 (36) hide show
  1. package/dist/components/atoms/ButtonV2/styles.js +1 -1
  2. package/dist/components/atoms/Status/styles.js +1 -1
  3. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +18 -23
  4. package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +4 -4
  5. package/dist/components/organisms/DashboardMetric/dashboardMetricUtils.js +27 -0
  6. package/dist/components/organisms/GlobalModal/styles.js +1 -1
  7. package/dist/components/organisms/OrderDetail/styles.js +1 -1
  8. package/dist/components/organisms/OrderDetail/utils/Table/styles.js +1 -1
  9. package/dist/components/pages/Dashboard/Dashboard.stories.js +35 -47
  10. package/dist/components/pages/Dashboard/index.js +2 -2
  11. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +98 -26
  12. package/dist/components/pages/ProviderProductEdition/index.js +623 -386
  13. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +103 -153
  14. package/dist/components/pages/RetailerProductEdition/index.js +34 -36
  15. package/dist/index.js +13 -0
  16. package/package.json +7 -6
  17. package/src/components/atoms/ButtonV2/styles.js +1 -1
  18. package/src/components/atoms/Status/styles.js +4 -0
  19. package/src/components/atoms/VerticalSideMenuMainPage/index.js +18 -22
  20. package/src/components/atoms/VerticalSideMenuMainPage/styles.js +3 -4
  21. package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +18 -1
  22. package/src/components/organisms/GlobalModal/styles.js +10 -0
  23. package/src/components/organisms/OrderDetail/styles.js +1 -1
  24. package/src/components/organisms/OrderDetail/utils/Table/styles.js +0 -1
  25. package/src/components/organisms/TableResizable/TableResizable.stories.js +17 -0
  26. package/src/components/organisms/TableResizable/index.js +119 -0
  27. package/src/components/organisms/TableResizable/styles.js +133 -0
  28. package/src/components/organisms/TableResizable/utils.js +46 -0
  29. package/src/components/pages/Dashboard/Dashboard.stories.js +35 -50
  30. package/src/components/pages/Dashboard/index.js +2 -2
  31. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +110 -31
  32. package/src/components/pages/ProviderProductEdition/index.js +244 -131
  33. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +93 -145
  34. package/src/components/pages/RetailerProductEdition/index.js +25 -23
  35. package/src/index.js +1 -0
  36. package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
@@ -53,12 +53,6 @@ var _uuid = require("uuid");
53
53
 
54
54
  var _awsSdk = _interopRequireDefault(require("aws-sdk"));
55
55
 
56
- var _attributesSent = _interopRequireDefault(require("../../../assets/images/modalsSVGs/attributesSent.svg"));
57
-
58
- var _descriptionSent = _interopRequireDefault(require("../../../assets/images/modalsSVGs/descriptionSent.svg"));
59
-
60
- var _uploadingImages = _interopRequireDefault(require("../../../assets/images/modalsSVGs/uploadingImages.svg"));
61
-
62
56
  var _index = require("../../molecules/TagAndInput/index");
63
57
 
64
58
  var _GeneralButton = require("../../atoms/GeneralButton");
@@ -227,7 +221,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
227
221
  revision = _ref$revision === void 0 ? false : _ref$revision,
228
222
  setShowContentohRequestModal = _ref.setShowContentohRequestModal,
229
223
  showSurvey = _ref.showSurvey,
230
- company = _ref.company;
224
+ company = _ref.company,
225
+ addToCart = _ref.addToCart;
231
226
 
232
227
  var _useState = (0, _react.useState)("Descripción"),
233
228
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -395,106 +390,84 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
395
390
  productEdit = _useState38[0],
396
391
  setProductEdit = _useState38[1];
397
392
 
398
- var _useState39 = (0, _react.useState)(null),
393
+ var _useState39 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
399
394
  _useState40 = (0, _slicedToArray2.default)(_useState39, 2),
400
- icon = _useState40[0],
401
- setIcon = _useState40[1];
395
+ version = _useState40[0],
396
+ setVersion = _useState40[1];
402
397
 
403
- var _useState41 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
404
- _useState42 = (0, _slicedToArray2.default)(_useState41, 2),
405
- version = _useState42[0],
406
- setVersion = _useState42[1];
398
+ var _useState41 = (0, _react.useState)({}),
399
+ _useState42 = (0, _slicedToArray2.default)(_useState41, 1),
400
+ comments = _useState42[0];
407
401
 
408
- var _useState43 = (0, _react.useState)({}),
409
- _useState44 = (0, _slicedToArray2.default)(_useState43, 1),
410
- comments = _useState44[0];
402
+ var _useState43 = (0, _react.useState)(""),
403
+ _useState44 = (0, _slicedToArray2.default)(_useState43, 2),
404
+ comment = _useState44[0],
405
+ setComment = _useState44[1];
411
406
 
412
- var _useState45 = (0, _react.useState)(""),
407
+ var _useState45 = (0, _react.useState)(false),
413
408
  _useState46 = (0, _slicedToArray2.default)(_useState45, 2),
414
- comment = _useState46[0],
415
- setComment = _useState46[1];
409
+ crossComment = _useState46[0],
410
+ setCrossComment = _useState46[1];
416
411
 
417
- var _useState47 = (0, _react.useState)(false),
412
+ var _useState47 = (0, _react.useState)([]),
418
413
  _useState48 = (0, _slicedToArray2.default)(_useState47, 2),
419
- crossComment = _useState48[0],
420
- setCrossComment = _useState48[1];
414
+ userGroups = _useState48[0],
415
+ setUserGroups = _useState48[1];
421
416
 
422
- var _useState49 = (0, _react.useState)([]),
417
+ var _useState49 = (0, _react.useState)({}),
423
418
  _useState50 = (0, _slicedToArray2.default)(_useState49, 2),
424
- userGroups = _useState50[0],
425
- setUserGroups = _useState50[1];
419
+ assig = _useState50[0],
420
+ setAssig = _useState50[1];
426
421
 
427
- var _useState51 = (0, _react.useState)({}),
422
+ var _useState51 = (0, _react.useState)([]),
428
423
  _useState52 = (0, _slicedToArray2.default)(_useState51, 2),
429
- assig = _useState52[0],
430
- setAssig = _useState52[1];
424
+ selectedImages = _useState52[0],
425
+ setSelectedImages = _useState52[1];
431
426
 
432
427
  var _useState53 = (0, _react.useState)([]),
433
428
  _useState54 = (0, _slicedToArray2.default)(_useState53, 2),
434
- selectedImages = _useState54[0],
435
- setSelectedImages = _useState54[1];
429
+ componentsArray = _useState54[0],
430
+ setComponentsArray = _useState54[1];
436
431
 
437
- var _useState55 = (0, _react.useState)([]),
432
+ var _useState55 = (0, _react.useState)(false),
438
433
  _useState56 = (0, _slicedToArray2.default)(_useState55, 2),
439
- componentsArray = _useState56[0],
440
- setComponentsArray = _useState56[1];
441
-
442
- var _useState57 = (0, _react.useState)(false),
443
- _useState58 = (0, _slicedToArray2.default)(_useState57, 2),
444
- checkAll = _useState58[0],
445
- setCheckAll = _useState58[1];
434
+ checkAll = _useState56[0],
435
+ setCheckAll = _useState56[1];
446
436
 
447
437
  var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
448
438
 
449
- var _useState59 = (0, _react.useState)(true),
450
- _useState60 = (0, _slicedToArray2.default)(_useState59, 2),
451
- loading = _useState60[0],
452
- setLoading = _useState60[1];
439
+ var _useState57 = (0, _react.useState)(true),
440
+ _useState58 = (0, _slicedToArray2.default)(_useState57, 2),
441
+ loading = _useState58[0],
442
+ setLoading = _useState58[1];
453
443
 
454
- var _useState61 = (0, _react.useState)(false),
455
- _useState62 = (0, _slicedToArray2.default)(_useState61, 2),
456
- validatedAll = _useState62[0],
457
- setValidatedAll = _useState62[1];
444
+ var _useState59 = (0, _react.useState)(false),
445
+ _useState60 = (0, _slicedToArray2.default)(_useState59, 2),
446
+ validatedAll = _useState60[0],
447
+ setValidatedAll = _useState60[1];
458
448
 
459
449
  var originProp = location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.origin;
460
450
 
461
- var _useState63 = (0, _react.useState)({
451
+ var _useState61 = (0, _react.useState)({
462
452
  "Ficha técnica": originProp,
463
453
  Descripción: originProp,
464
454
  Imágenes: originProp
465
455
  }),
466
- _useState64 = (0, _slicedToArray2.default)(_useState63, 2),
467
- origin = _useState64[0],
468
- setOrigin = _useState64[1];
469
-
470
- var _useState65 = (0, _react.useState)(false),
471
- _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
472
- inCart = _useState66[0],
473
- setInCart = _useState66[1];
474
-
475
- var _useState67 = (0, _react.useState)(false),
476
- _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
477
- modalSent = _useState68[0],
478
- setModalSent = _useState68[1];
479
-
480
- var _useState69 = (0, _react.useState)(false),
481
- _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
482
- modalViewError = _useState70[0],
483
- setModalViewError = _useState70[1];
456
+ _useState62 = (0, _slicedToArray2.default)(_useState61, 2),
457
+ origin = _useState62[0],
458
+ setOrigin = _useState62[1];
484
459
 
485
- var _useState71 = (0, _react.useState)(false),
486
- _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
487
- showGenericModal = _useState72[0],
488
- setShowGenericModal = _useState72[1];
460
+ var _useState63 = (0, _react.useState)(false),
461
+ _useState64 = (0, _slicedToArray2.default)(_useState63, 2),
462
+ inCart = _useState64[0],
463
+ setInCart = _useState64[1];
489
464
 
490
- var _useState73 = (0, _react.useState)({
465
+ var _useState65 = (0, _react.useState)({
491
466
  message: "¿Estás seguro de continuar?",
492
467
  detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
493
468
  button1: {
494
469
  name: "Cerrar",
495
- action: function action() {
496
- return setModalViewTextArea(false);
497
- }
470
+ action: closeGlobalModal
498
471
  },
499
472
  button2: {
500
473
  name: "Continuar",
@@ -504,35 +477,402 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
504
477
  },
505
478
  img: _defaultProfileImage.default
506
479
  }),
507
- _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
508
- dataGenericModal = _useState74[0],
509
- setDataGenericModal = _useState74[1];
510
-
511
- var _useState75 = (0, _react.useState)(false),
512
- _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
513
- modalViewTextArea = _useState76[0],
514
- setModalViewTextArea = _useState76[1];
480
+ _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
481
+ dataGenericModal = _useState66[0],
482
+ setDataGenericModal = _useState66[1];
515
483
 
516
- var _useState77 = (0, _react.useState)(null),
517
- _useState78 = (0, _slicedToArray2.default)(_useState77, 2),
518
- socketType = _useState78[0],
519
- setSocketType = _useState78[1];
484
+ var _useState67 = (0, _react.useState)(null),
485
+ _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
486
+ socketType = _useState68[0],
487
+ setSocketType = _useState68[1];
520
488
 
521
- var _useState79 = (0, _react.useState)(loading),
522
- _useState80 = (0, _slicedToArray2.default)(_useState79, 2),
523
- saving = _useState80[0],
524
- setSaving = _useState80[1];
489
+ var _useState69 = (0, _react.useState)(loading),
490
+ _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
491
+ saving = _useState70[0],
492
+ setSaving = _useState70[1];
525
493
 
526
- var _useState81 = (0, _react.useState)(product.statusByRetailer),
527
- _useState82 = (0, _slicedToArray2.default)(_useState81, 2),
528
- retailerStatus = _useState82[0],
529
- setRetailerStatus = _useState82[1];
494
+ var _useState71 = (0, _react.useState)(product.statusByRetailer),
495
+ _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
496
+ retailerStatus = _useState72[0],
497
+ setRetailerStatus = _useState72[1];
530
498
 
531
499
  var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
532
500
  _useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
533
501
  showVersionSelector = _useCloseModal2[0],
534
502
  setShowVersionSelector = _useCloseModal2[1];
535
503
 
504
+ var _useState73 = (0, _react.useState)(),
505
+ _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
506
+ globalModal = _useState74[0],
507
+ setGlobalModal = _useState74[1];
508
+
509
+ var updateAuditStatus = /*#__PURE__*/function () {
510
+ var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
511
+ var productTemp, retailerStatusCopy, conceptArray;
512
+ return _regenerator.default.wrap(function _callee2$(_context2) {
513
+ while (1) {
514
+ switch (_context2.prev = _context2.next) {
515
+ case 0:
516
+ productTemp = product;
517
+ productTemp.article_status = status;
518
+ productTemp.datasheet_status = status;
519
+ productTemp.description_status = status;
520
+ productTemp.images_status = status;
521
+ retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
522
+ conceptArray = ["description", "datasheet", "images"];
523
+ Object.keys(retailerStatusCopy).forEach(function (key) {
524
+ conceptArray.forEach(function (concept) {
525
+ if (retailerStatusCopy[key][concept]) {
526
+ retailerStatusCopy[key][concept] = status;
527
+ }
528
+ });
529
+ });
530
+ setRetailerStatus(retailerStatusCopy);
531
+ productTemp.statusByRetailer = retailerStatusCopy;
532
+ setProduct(productTemp);
533
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
534
+ setProductEdit({
535
+ ArticleId: productTemp.id_article,
536
+ idCategory: productTemp.article.id_category,
537
+ product: productTemp
538
+ });
539
+ sessionStorage.setItem("productEdit", JSON.stringify({
540
+ ArticleId: productTemp.id_article,
541
+ idCategory: productTemp.article.id_category,
542
+ product: productTemp
543
+ }));
544
+ _context2.next = 16;
545
+ return loadData();
546
+
547
+ case 16:
548
+ case "end":
549
+ return _context2.stop();
550
+ }
551
+ }
552
+ }, _callee2);
553
+ }));
554
+
555
+ return function updateAuditStatus(_x2) {
556
+ return _ref3.apply(this, arguments);
557
+ };
558
+ }();
559
+
560
+ var addCart = /*#__PURE__*/function () {
561
+ var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(retailers) {
562
+ var article, version, articleToOrder, modatlType, resCart;
563
+ return _regenerator.default.wrap(function _callee3$(_context3) {
564
+ while (1) {
565
+ switch (_context3.prev = _context3.next) {
566
+ case 0:
567
+ article = product.article, version = product.version;
568
+ articleToOrder = [{
569
+ articleId: article.id_article,
570
+ version: version,
571
+ userId: user.id_user,
572
+ discount: 0,
573
+ subtotal: 0,
574
+ companyId: user.id_company,
575
+ datasheet: retailers,
576
+ description: retailers,
577
+ image: retailers,
578
+ attributeTranslations: false,
579
+ descriptionTranslations: false,
580
+ build: "[]",
581
+ manual: "[]",
582
+ userCreated: user.id_user
583
+ }];
584
+ modatlType = "addedToCartError";
585
+
586
+ if (!addToCart) {
587
+ _context3.next = 8;
588
+ break;
589
+ }
590
+
591
+ _context3.next = 6;
592
+ return addToCart({
593
+ data: articleToOrder
594
+ });
595
+
596
+ case 6:
597
+ resCart = _context3.sent;
598
+
599
+ if (resCart.data.statusCode === 200) {
600
+ modatlType = "addedToCart";
601
+ }
602
+
603
+ case 8:
604
+ showGlobalModal(modatlType);
605
+
606
+ case 9:
607
+ case "end":
608
+ return _context3.stop();
609
+ }
610
+ }
611
+ }, _callee3);
612
+ }));
613
+
614
+ return function addCart(_x3) {
615
+ return _ref4.apply(this, arguments);
616
+ };
617
+ }();
618
+
619
+ var closeGlobalModal = function closeGlobalModal() {
620
+ return setGlobalModal();
621
+ };
622
+
623
+ var seenByProvider = /*#__PURE__*/function () {
624
+ var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
625
+ var _productTemp$id_order;
626
+
627
+ var productTemp, articleId, orderId, promises, conceptArray;
628
+ return _regenerator.default.wrap(function _callee4$(_context4) {
629
+ while (1) {
630
+ switch (_context4.prev = _context4.next) {
631
+ case 0:
632
+ productTemp = product;
633
+ articleId = productTemp.id_article;
634
+ orderId = (_productTemp$id_order = productTemp.id_order) !== null && _productTemp$id_order !== void 0 ? _productTemp$id_order : productTemp.orderId;
635
+ promises = [];
636
+ conceptArray = ["description", "datasheet", "images"];
637
+ conceptArray.forEach(function (concept) {
638
+ var sectionStatusKey = "".concat(concept, "_status");
639
+ var evalStatus = product[sectionStatusKey] || (product === null || product === void 0 ? void 0 : product.version_status);
640
+ var data = {
641
+ articleId: articleId,
642
+ orderId: orderId,
643
+ concept: concept,
644
+ evalStatus: evalStatus
645
+ };
646
+ promises.push(_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
647
+ headers: {
648
+ Authorization: token
649
+ }
650
+ }));
651
+ });
652
+ _context4.next = 8;
653
+ return Promise.all(promises);
654
+
655
+ case 8:
656
+ closeGlobalModal();
657
+ _context4.next = 11;
658
+ return updateAuditStatus("FAP");
659
+
660
+ case 11:
661
+ case "end":
662
+ return _context4.stop();
663
+ }
664
+ }
665
+ }, _callee4);
666
+ }));
667
+
668
+ return function seenByProvider() {
669
+ return _ref5.apply(this, arguments);
670
+ };
671
+ }();
672
+
673
+ var showGlobalModal = (0, _react.useCallback)(function (type) {
674
+ var formatter = new Intl.ListFormat("es", {
675
+ type: "conjunction"
676
+ });
677
+
678
+ switch (type) {
679
+ case "error":
680
+ setGlobalModal({
681
+ message: "".concat(activeTab, " rechazada"),
682
+ detail: "Agrega tu comentarios para enviar el rechazo",
683
+ img: _errorModal.default,
684
+ textArea: true,
685
+ button1: {
686
+ name: "Enviar",
687
+ action: function action(e) {
688
+ var textArea = document.querySelector("#area");
689
+
690
+ if (textArea.value) {
691
+ textArea.style.border = "none";
692
+ createComment(e, textArea.value);
693
+ showGlobalModal("commentsSent");
694
+ validatedAll ? validateAll("R") : sendEvaluation("R");
695
+ } else {
696
+ textArea.style.border = "2px solid red";
697
+ }
698
+ }
699
+ }
700
+ });
701
+ break;
702
+
703
+ case "generic":
704
+ setGlobalModal(dataGenericModal);
705
+ break;
706
+
707
+ case "commentsSent":
708
+ setGlobalModal({
709
+ message: "Gracias, tus comentarios fueron entregados.",
710
+ detail: "Trabajaremos en conjunto para resolverlo.",
711
+ button1: {
712
+ name: "Cerrar",
713
+ action: closeGlobalModal
714
+ },
715
+ img: _defaultProfileImage.default,
716
+ textArea: false
717
+ });
718
+ break;
719
+
720
+ case "RAC":
721
+ var servicesRejected = [];
722
+ var translateServices = {
723
+ datasheet: "ficha técnica",
724
+ description: "descripción",
725
+ images: "imágenes"
726
+ };
727
+ Object.keys(translateServices).forEach(function (service) {
728
+ if (product["".concat(service, "_status")] === "RAC") {
729
+ servicesRejected.push(translateServices[service]);
730
+ }
731
+ });
732
+ var plural = ["Los servicios", "cumplen"];
733
+ var singular = ["El servicio", "cumple"];
734
+ var grammar = servicesRejected.length > 1 ? plural : singular;
735
+ var formatted = formatter.format(servicesRejected);
736
+ var text1 = "".concat(grammar[0], " de ").concat(formatted, " no ").concat(grammar[1], " con lo que la cadena necesita.");
737
+ var text2 = "\xA1Solicita el servicio de Content-oh! para completarlo!";
738
+ var retailers = product.retailersWithService.map(function (retailer) {
739
+ return Number(retailer);
740
+ });
741
+ setGlobalModal({
742
+ message: "Tu producto no cumple con los requerimientos de la cadena",
743
+ customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
744
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
745
+ className: "generic-text",
746
+ children: [text1, /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), text2]
747
+ })
748
+ }),
749
+ button1: {
750
+ name: "Continuar",
751
+ action: function () {
752
+ var _action = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
753
+ return _regenerator.default.wrap(function _callee5$(_context5) {
754
+ while (1) {
755
+ switch (_context5.prev = _context5.next) {
756
+ case 0:
757
+ _context5.next = 2;
758
+ return seenByProvider();
759
+
760
+ case 2:
761
+ return _context5.abrupt("return", _context5.sent);
762
+
763
+ case 3:
764
+ case "end":
765
+ return _context5.stop();
766
+ }
767
+ }
768
+ }, _callee5);
769
+ }));
770
+
771
+ function action() {
772
+ return _action.apply(this, arguments);
773
+ }
774
+
775
+ return action;
776
+ }()
777
+ },
778
+ button2: {
779
+ name: "Solicitar a Content-oh!",
780
+ action: function () {
781
+ var _action2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
782
+ return _regenerator.default.wrap(function _callee6$(_context6) {
783
+ while (1) {
784
+ switch (_context6.prev = _context6.next) {
785
+ case 0:
786
+ _context6.next = 2;
787
+ return addCart(retailers);
788
+
789
+ case 2:
790
+ _context6.next = 4;
791
+ return seenByProvider();
792
+
793
+ case 4:
794
+ case "end":
795
+ return _context6.stop();
796
+ }
797
+ }
798
+ }, _callee6);
799
+ }));
800
+
801
+ function action() {
802
+ return _action2.apply(this, arguments);
803
+ }
804
+
805
+ return action;
806
+ }()
807
+ },
808
+ img: _errorModal.default
809
+ });
810
+ break;
811
+
812
+ case "AAC":
813
+ setGlobalModal({
814
+ message: "Felicidades",
815
+ detail: "Tu producto cumple con los requerimientos de la cadena.",
816
+ button1: {
817
+ name: "Continuar",
818
+ action: function () {
819
+ var _action3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
820
+ return _regenerator.default.wrap(function _callee7$(_context7) {
821
+ while (1) {
822
+ switch (_context7.prev = _context7.next) {
823
+ case 0:
824
+ _context7.next = 2;
825
+ return seenByProvider();
826
+
827
+ case 2:
828
+ return _context7.abrupt("return", _context7.sent);
829
+
830
+ case 3:
831
+ case "end":
832
+ return _context7.stop();
833
+ }
834
+ }
835
+ }, _callee7);
836
+ }));
837
+
838
+ function action() {
839
+ return _action3.apply(this, arguments);
840
+ }
841
+
842
+ return action;
843
+ }()
844
+ },
845
+ img: _defaultProfileImage.default
846
+ });
847
+ break;
848
+
849
+ case "addedToCartError":
850
+ setGlobalModal({
851
+ detail: "Parece que algo salió mal al intentar añadir tu producto a tu carrito.",
852
+ button1: {
853
+ name: "Continuar",
854
+ action: closeGlobalModal
855
+ }
856
+ });
857
+ break;
858
+
859
+ case "addedToCart":
860
+ setGlobalModal({
861
+ message: "Producto añadido",
862
+ detail: "Tu producto se añadió al carrito de compras.",
863
+ button1: {
864
+ name: "Continuar",
865
+ action: closeGlobalModal
866
+ },
867
+ img: _defaultProfileImage.default
868
+ });
869
+ break;
870
+
871
+ default:
872
+ closeGlobalModal();
873
+ break;
874
+ }
875
+ }, [activeTab, dataGenericModal, product]);
536
876
  (0, _react.useEffect)(function () {
537
877
  checkAll && setSelectedImages(images.values);
538
878
  }, [checkAll]);
@@ -543,22 +883,22 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
543
883
  }, [showModal]);
544
884
 
545
885
  var loadData = /*#__PURE__*/function () {
546
- var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
886
+ var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
547
887
  var _product$article, _product$article2, _product$article3, _services$, _services$$values;
548
888
 
549
889
  var services;
550
- return _regenerator.default.wrap(function _callee2$(_context2) {
890
+ return _regenerator.default.wrap(function _callee8$(_context8) {
551
891
  while (1) {
552
- switch (_context2.prev = _context2.next) {
892
+ switch (_context8.prev = _context8.next) {
553
893
  case 0:
554
- _context2.next = 2;
894
+ _context8.next = 2;
555
895
  return (0, _data.getRetailerServices)((product === null || product === void 0 ? void 0 : product.id_article) || (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.company_name) || (product === null || product === void 0 ? void 0 : product.categoryName), parseInt((product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category) || (product === null || product === void 0 ? void 0 : product.id_category)), version);
556
896
 
557
897
  case 2:
558
- services = _context2.sent;
898
+ services = _context8.sent;
559
899
  //Converts the data inside the datasheets object to array
560
900
  setServices(services);
561
- _context2.next = 6;
901
+ _context8.next = 6;
562
902
  return getServices();
563
903
 
564
904
  case 6:
@@ -576,26 +916,26 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
576
916
 
577
917
  case 10:
578
918
  case "end":
579
- return _context2.stop();
919
+ return _context8.stop();
580
920
  }
581
921
  }
582
- }, _callee2);
922
+ }, _callee8);
583
923
  }));
584
924
 
585
925
  return function loadData() {
586
- return _ref3.apply(this, arguments);
926
+ return _ref6.apply(this, arguments);
587
927
  };
588
928
  }();
589
929
 
590
930
  var getServices = /*#__PURE__*/function () {
591
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
931
+ var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
592
932
  var _product$article4;
593
933
 
594
934
  var productInOrder, idArticle, retailers, active, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailerResponse;
595
935
 
596
- return _regenerator.default.wrap(function _callee3$(_context3) {
936
+ return _regenerator.default.wrap(function _callee9$(_context9) {
597
937
  while (1) {
598
- switch (_context3.prev = _context3.next) {
938
+ switch (_context9.prev = _context9.next) {
599
939
  case 0:
600
940
  productInOrder = product.id_order || product.orderId;
601
941
  idArticle = (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article);
@@ -603,15 +943,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
603
943
  active = null;
604
944
 
605
945
  if (!(isRevision() || productInOrder)) {
606
- _context3.next = 12;
946
+ _context9.next = 12;
607
947
  break;
608
948
  }
609
949
 
610
- _context3.next = 7;
950
+ _context9.next = 7;
611
951
  return _axios.default.get("".concat(process.env.REACT_APP_SERVICES_ENDPOINT, "?articleId=").concat(idArticle, "&orderId=").concat((_product$id_order = product === null || product === void 0 ? void 0 : product.id_order) !== null && _product$id_order !== void 0 ? _product$id_order : product.orderId, "&end=true"));
612
952
 
613
953
  case 7:
614
- servicesResponse = _context3.sent;
954
+ servicesResponse = _context9.sent;
615
955
  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;
616
956
  retailerResponse = parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.map(function (srv) {
617
957
  return srv.id_retailer;
@@ -626,14 +966,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
626
966
 
627
967
  case 13:
628
968
  case "end":
629
- return _context3.stop();
969
+ return _context9.stop();
630
970
  }
631
971
  }
632
- }, _callee3);
972
+ }, _callee9);
633
973
  }));
634
974
 
635
975
  return function getServices() {
636
- return _ref4.apply(this, arguments);
976
+ return _ref7.apply(this, arguments);
637
977
  };
638
978
  }();
639
979
 
@@ -663,13 +1003,13 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
663
1003
  };
664
1004
 
665
1005
  var getCart = /*#__PURE__*/function () {
666
- var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
1006
+ var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
667
1007
  var res, arr;
668
- return _regenerator.default.wrap(function _callee4$(_context4) {
1008
+ return _regenerator.default.wrap(function _callee10$(_context10) {
669
1009
  while (1) {
670
- switch (_context4.prev = _context4.next) {
1010
+ switch (_context10.prev = _context10.next) {
671
1011
  case 0:
672
- _context4.next = 2;
1012
+ _context10.next = 2;
673
1013
  return _axios.default.get(process.env.REACT_APP_CART, {
674
1014
  headers: {
675
1015
  Authorization: token
@@ -677,7 +1017,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
677
1017
  });
678
1018
 
679
1019
  case 2:
680
- res = _context4.sent;
1020
+ res = _context10.sent;
681
1021
  arr = JSON.parse(res.data.body).data.map(function (e) {
682
1022
  return e.article_id;
683
1023
  });
@@ -687,14 +1027,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
687
1027
 
688
1028
  case 5:
689
1029
  case "end":
690
- return _context4.stop();
1030
+ return _context10.stop();
691
1031
  }
692
1032
  }
693
- }, _callee4);
1033
+ }, _callee10);
694
1034
  }));
695
1035
 
696
1036
  return function getCart() {
697
- return _ref5.apply(this, arguments);
1037
+ return _ref8.apply(this, arguments);
698
1038
  };
699
1039
  }();
700
1040
 
@@ -709,6 +1049,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
709
1049
  action: "orderImages",
710
1050
  retailerId: activeRetailer.id
711
1051
  });
1052
+ if (["RAC", "AAC"].includes(product.article_status)) showGlobalModal(product.article_status);
712
1053
  }, [product, version]);
713
1054
  (0, _react.useEffect)(function () {
714
1055
  setImages({
@@ -819,11 +1160,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
819
1160
  }, [images]);
820
1161
 
821
1162
  var saveDescriptions = /*#__PURE__*/function () {
822
- var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
1163
+ var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
823
1164
  var dataObject, res;
824
- return _regenerator.default.wrap(function _callee5$(_context5) {
1165
+ return _regenerator.default.wrap(function _callee11$(_context11) {
825
1166
  while (1) {
826
- switch (_context5.prev = _context5.next) {
1167
+ switch (_context11.prev = _context11.next) {
827
1168
  case 0:
828
1169
  setLoading(true);
829
1170
  dataObject = {
@@ -831,8 +1172,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
831
1172
  articleData: updatedDescriptions
832
1173
  };
833
1174
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
834
- _context5.prev = 3;
835
- _context5.next = 6;
1175
+ _context11.prev = 3;
1176
+ _context11.next = 6;
836
1177
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
837
1178
  headers: {
838
1179
  Authorization: token
@@ -840,45 +1181,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
840
1181
  });
841
1182
 
842
1183
  case 6:
843
- res = _context5.sent;
1184
+ res = _context11.sent;
844
1185
 
845
1186
  if (!(res.data.statusCode === 200)) {
846
- _context5.next = 11;
1187
+ _context11.next = 11;
847
1188
  break;
848
1189
  }
849
1190
 
850
1191
  setMessage("Descripciones guardadas con éxito");
851
- _context5.next = 11;
1192
+ _context11.next = 11;
852
1193
  return loadData();
853
1194
 
854
1195
  case 11:
855
- _context5.next = 16;
1196
+ _context11.next = 16;
856
1197
  break;
857
1198
 
858
1199
  case 13:
859
- _context5.prev = 13;
860
- _context5.t0 = _context5["catch"](3);
861
- console.log(_context5.t0);
1200
+ _context11.prev = 13;
1201
+ _context11.t0 = _context11["catch"](3);
1202
+ console.log(_context11.t0);
862
1203
 
863
1204
  case 16:
864
1205
  case "end":
865
- return _context5.stop();
1206
+ return _context11.stop();
866
1207
  }
867
1208
  }
868
- }, _callee5, null, [[3, 13]]);
1209
+ }, _callee11, null, [[3, 13]]);
869
1210
  }));
870
1211
 
871
1212
  return function saveDescriptions() {
872
- return _ref6.apply(this, arguments);
1213
+ return _ref9.apply(this, arguments);
873
1214
  };
874
1215
  }();
875
1216
 
876
1217
  var saveDatasheets = /*#__PURE__*/function () {
877
- var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
1218
+ var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
878
1219
  var dataObject, res;
879
- return _regenerator.default.wrap(function _callee6$(_context6) {
1220
+ return _regenerator.default.wrap(function _callee12$(_context12) {
880
1221
  while (1) {
881
- switch (_context6.prev = _context6.next) {
1222
+ switch (_context12.prev = _context12.next) {
882
1223
  case 0:
883
1224
  setLoading(true);
884
1225
  dataObject = {
@@ -886,8 +1227,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
886
1227
  articleData: updatedDatasheets
887
1228
  };
888
1229
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
889
- _context6.prev = 3;
890
- _context6.next = 6;
1230
+ _context12.prev = 3;
1231
+ _context12.next = 6;
891
1232
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
892
1233
  headers: {
893
1234
  Authorization: token
@@ -895,47 +1236,47 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
895
1236
  });
896
1237
 
897
1238
  case 6:
898
- res = _context6.sent;
1239
+ res = _context12.sent;
899
1240
 
900
1241
  if (!(res.data.statusCode === 200)) {
901
- _context6.next = 11;
1242
+ _context12.next = 11;
902
1243
  break;
903
1244
  }
904
1245
 
905
1246
  setMessage("Fichas técnicas guardadas");
906
- _context6.next = 11;
1247
+ _context12.next = 11;
907
1248
  return loadData();
908
1249
 
909
1250
  case 11:
910
- _context6.next = 16;
1251
+ _context12.next = 16;
911
1252
  break;
912
1253
 
913
1254
  case 13:
914
- _context6.prev = 13;
915
- _context6.t0 = _context6["catch"](3);
916
- console.log(_context6.t0);
1255
+ _context12.prev = 13;
1256
+ _context12.t0 = _context12["catch"](3);
1257
+ console.log(_context12.t0);
917
1258
 
918
1259
  case 16:
919
1260
  case "end":
920
- return _context6.stop();
1261
+ return _context12.stop();
921
1262
  }
922
1263
  }
923
- }, _callee6, null, [[3, 13]]);
1264
+ }, _callee12, null, [[3, 13]]);
924
1265
  }));
925
1266
 
926
1267
  return function saveDatasheets() {
927
- return _ref7.apply(this, arguments);
1268
+ return _ref10.apply(this, arguments);
928
1269
  };
929
1270
  }();
930
1271
 
931
- var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
1272
+ var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
932
1273
  var _images$values2, _data$articleData, _data$articleData2, _data$updateImages;
933
1274
 
934
1275
  var imagesList, imagesListTemp, duplicated, attrForImgs, data, valid, _data$updateImages2, _data$articleData3, _data$articleData4, _data$articleData5, promiseArray;
935
1276
 
936
- return _regenerator.default.wrap(function _callee7$(_context7) {
1277
+ return _regenerator.default.wrap(function _callee13$(_context13) {
937
1278
  while (1) {
938
- switch (_context7.prev = _context7.next) {
1279
+ switch (_context13.prev = _context13.next) {
939
1280
  case 0:
940
1281
  imagesList = images === null || images === void 0 ? void 0 : (_images$values2 = images.values) === null || _images$values2 === void 0 ? void 0 : _images$values2.slice();
941
1282
  imagesListTemp = imagesList === null || imagesList === void 0 ? void 0 : imagesList.reduce(function (acc, image) {
@@ -984,19 +1325,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
984
1325
  }
985
1326
 
986
1327
  if (!(valid && (duplicated === null || duplicated === void 0 ? void 0 : duplicated.length) === 0)) {
987
- _context7.next = 31;
1328
+ _context13.next = 31;
988
1329
  break;
989
1330
  }
990
1331
 
991
1332
  setLoading(true);
992
- _context7.prev = 11;
1333
+ _context13.prev = 11;
993
1334
  data === null || data === void 0 ? void 0 : (_data$articleData3 = data.articleData) === null || _data$articleData3 === void 0 ? void 0 : _data$articleData3.forEach(function (e) {
994
1335
  e.uuid = (0, _uuid.v4)();
995
1336
  });
996
1337
  setDataImages(data);
997
1338
 
998
1339
  if (!((data === null || data === void 0 ? void 0 : (_data$articleData4 = data.articleData) === null || _data$articleData4 === void 0 ? void 0 : _data$articleData4.length) > 0)) {
999
- _context7.next = 23;
1340
+ _context13.next = 23;
1000
1341
  break;
1001
1342
  }
1002
1343
 
@@ -1012,28 +1353,28 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1012
1353
  };
1013
1354
  promiseArray.push(myBucket.putObject(params).promise());
1014
1355
  });
1015
- _context7.next = 20;
1356
+ _context13.next = 20;
1016
1357
  return Promise.all(promiseArray);
1017
1358
 
1018
1359
  case 20:
1019
1360
  setImagesUploaded(true);
1020
- _context7.next = 24;
1361
+ _context13.next = 24;
1021
1362
  break;
1022
1363
 
1023
1364
  case 23:
1024
1365
  setImagesUploaded(true);
1025
1366
 
1026
1367
  case 24:
1027
- _context7.next = 29;
1368
+ _context13.next = 29;
1028
1369
  break;
1029
1370
 
1030
1371
  case 26:
1031
- _context7.prev = 26;
1032
- _context7.t0 = _context7["catch"](11);
1033
- console.log(_context7.t0); // setMainLoading(false);
1372
+ _context13.prev = 26;
1373
+ _context13.t0 = _context13["catch"](11);
1374
+ console.log(_context13.t0); // setMainLoading(false);
1034
1375
 
1035
1376
  case 29:
1036
- _context7.next = 32;
1377
+ _context13.next = 32;
1037
1378
  break;
1038
1379
 
1039
1380
  case 31:
@@ -1042,19 +1383,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1042
1383
 
1043
1384
  case 32:
1044
1385
  case "end":
1045
- return _context7.stop();
1386
+ return _context13.stop();
1046
1387
  }
1047
1388
  }
1048
- }, _callee7, null, [[11, 26]]);
1389
+ }, _callee13, null, [[11, 26]]);
1049
1390
  })), [images, imagesUploaded]);
1050
- (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
1391
+ (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
1051
1392
  var res;
1052
- return _regenerator.default.wrap(function _callee8$(_context8) {
1393
+ return _regenerator.default.wrap(function _callee14$(_context14) {
1053
1394
  while (1) {
1054
- switch (_context8.prev = _context8.next) {
1395
+ switch (_context14.prev = _context14.next) {
1055
1396
  case 0:
1056
1397
  if (!imagesUploaded) {
1057
- _context8.next = 16;
1398
+ _context14.next = 16;
1058
1399
  break;
1059
1400
  }
1060
1401
 
@@ -1066,8 +1407,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1066
1407
  if (product !== null && product !== void 0 && product.orderId) e["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
1067
1408
  return e;
1068
1409
  });
1069
- _context8.prev = 2;
1070
- _context8.next = 5;
1410
+ _context14.prev = 2;
1411
+ _context14.next = 5;
1071
1412
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?image=true&version=").concat(version), dataImages, {
1072
1413
  headers: {
1073
1414
  Authorization: token
@@ -1075,33 +1416,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1075
1416
  });
1076
1417
 
1077
1418
  case 5:
1078
- res = _context8.sent;
1419
+ res = _context14.sent;
1079
1420
 
1080
1421
  if (!(res.data.statusCode === 200)) {
1081
- _context8.next = 11;
1422
+ _context14.next = 11;
1082
1423
  break;
1083
1424
  }
1084
1425
 
1085
1426
  setMessage("Imágenes guardadas con éxito");
1086
1427
  sessionStorage.removeItem("imagesList");
1087
- _context8.next = 11;
1428
+ _context14.next = 11;
1088
1429
  return loadData();
1089
1430
 
1090
1431
  case 11:
1091
- _context8.next = 16;
1432
+ _context14.next = 16;
1092
1433
  break;
1093
1434
 
1094
1435
  case 13:
1095
- _context8.prev = 13;
1096
- _context8.t0 = _context8["catch"](2);
1097
- console.log(_context8.t0);
1436
+ _context14.prev = 13;
1437
+ _context14.t0 = _context14["catch"](2);
1438
+ console.log(_context14.t0);
1098
1439
 
1099
1440
  case 16:
1100
1441
  case "end":
1101
- return _context8.stop();
1442
+ return _context14.stop();
1102
1443
  }
1103
1444
  }
1104
- }, _callee8, null, [[2, 13]]);
1445
+ }, _callee14, null, [[2, 13]]);
1105
1446
  })), [dataImages, imagesUploaded]);
1106
1447
 
1107
1448
  var getConcept = function getConcept(tab) {
@@ -1117,48 +1458,29 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1117
1458
  }
1118
1459
  };
1119
1460
 
1120
- var getSectionIcon = function getSectionIcon() {
1121
- switch (activeTab) {
1122
- case "Ficha técnica":
1123
- setIcon(_attributesSent.default);
1124
- break;
1125
-
1126
- case "Descripción":
1127
- setIcon(_descriptionSent.default);
1128
- break;
1129
-
1130
- case "Imágenes0,,":
1131
- setIcon(_uploadingImages.default);
1132
- break;
1133
-
1134
- default:
1135
- break;
1136
- }
1137
- };
1138
-
1139
1461
  var createComment = /*#__PURE__*/function () {
1140
- var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(e, body, tab) {
1462
+ var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
1141
1463
  var concept, data;
1142
- return _regenerator.default.wrap(function _callee9$(_context9) {
1464
+ return _regenerator.default.wrap(function _callee15$(_context15) {
1143
1465
  while (1) {
1144
- switch (_context9.prev = _context9.next) {
1466
+ switch (_context15.prev = _context15.next) {
1145
1467
  case 0:
1146
1468
  concept = "";
1147
- _context9.t0 = activeTab;
1148
- _context9.next = _context9.t0 === "Ficha técnica" ? 4 : _context9.t0 === "Imágenes" ? 6 : 8;
1469
+ _context15.t0 = activeTab;
1470
+ _context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
1149
1471
  break;
1150
1472
 
1151
1473
  case 4:
1152
1474
  concept = "datasheet";
1153
- return _context9.abrupt("break", 10);
1475
+ return _context15.abrupt("break", 10);
1154
1476
 
1155
1477
  case 6:
1156
1478
  concept = "images";
1157
- return _context9.abrupt("break", 10);
1479
+ return _context15.abrupt("break", 10);
1158
1480
 
1159
1481
  case 8:
1160
1482
  concept = "description";
1161
- return _context9.abrupt("break", 10);
1483
+ return _context15.abrupt("break", 10);
1162
1484
 
1163
1485
  case 10:
1164
1486
  data = {
@@ -1168,7 +1490,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1168
1490
  concept: concept,
1169
1491
  version: version
1170
1492
  };
1171
- _context9.next = 13;
1493
+ _context15.next = 13;
1172
1494
  return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1173
1495
  headers: {
1174
1496
  Authorization: token
@@ -1177,14 +1499,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1177
1499
 
1178
1500
  case 13:
1179
1501
  case "end":
1180
- return _context9.stop();
1502
+ return _context15.stop();
1181
1503
  }
1182
1504
  }
1183
- }, _callee9);
1505
+ }, _callee15);
1184
1506
  }));
1185
1507
 
1186
- return function createComment(_x2, _x3, _x4) {
1187
- return _ref10.apply(this, arguments);
1508
+ return function createComment(_x4, _x5, _x6) {
1509
+ return _ref13.apply(this, arguments);
1188
1510
  };
1189
1511
  }();
1190
1512
 
@@ -1193,16 +1515,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1193
1515
  }, [activeTab]);
1194
1516
 
1195
1517
  var commentRevised = /*#__PURE__*/function () {
1196
- var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
1518
+ var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
1197
1519
  var data;
1198
- return _regenerator.default.wrap(function _callee10$(_context10) {
1520
+ return _regenerator.default.wrap(function _callee16$(_context16) {
1199
1521
  while (1) {
1200
- switch (_context10.prev = _context10.next) {
1522
+ switch (_context16.prev = _context16.next) {
1201
1523
  case 0:
1202
1524
  data = {
1203
1525
  commentId: comment.id
1204
1526
  };
1205
- _context10.next = 3;
1527
+ _context16.next = 3;
1206
1528
  return _axios.default.put("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1207
1529
  headers: {
1208
1530
  Authorization: token
@@ -1214,40 +1536,40 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1214
1536
 
1215
1537
  case 4:
1216
1538
  case "end":
1217
- return _context10.stop();
1539
+ return _context16.stop();
1218
1540
  }
1219
1541
  }
1220
- }, _callee10);
1542
+ }, _callee16);
1221
1543
  }));
1222
1544
 
1223
1545
  return function commentRevised() {
1224
- return _ref11.apply(this, arguments);
1546
+ return _ref14.apply(this, arguments);
1225
1547
  };
1226
1548
  }();
1227
1549
 
1228
1550
  var setAssignation = /*#__PURE__*/function () {
1229
- var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(assignationType, assignationId) {
1551
+ var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(assignationType, assignationId) {
1230
1552
  var concept, productTemp, data;
1231
- return _regenerator.default.wrap(function _callee11$(_context11) {
1553
+ return _regenerator.default.wrap(function _callee17$(_context17) {
1232
1554
  while (1) {
1233
- switch (_context11.prev = _context11.next) {
1555
+ switch (_context17.prev = _context17.next) {
1234
1556
  case 0:
1235
1557
  concept = "";
1236
- _context11.t0 = activeTab;
1237
- _context11.next = _context11.t0 === "Ficha técnica" ? 4 : _context11.t0 === "Imágenes" ? 6 : 8;
1558
+ _context17.t0 = activeTab;
1559
+ _context17.next = _context17.t0 === "Ficha técnica" ? 4 : _context17.t0 === "Imágenes" ? 6 : 8;
1238
1560
  break;
1239
1561
 
1240
1562
  case 4:
1241
1563
  concept = "datasheet";
1242
- return _context11.abrupt("break", 10);
1564
+ return _context17.abrupt("break", 10);
1243
1565
 
1244
1566
  case 6:
1245
1567
  concept = "images";
1246
- return _context11.abrupt("break", 10);
1568
+ return _context17.abrupt("break", 10);
1247
1569
 
1248
1570
  case 8:
1249
1571
  concept = "description";
1250
- return _context11.abrupt("break", 10);
1572
+ return _context17.abrupt("break", 10);
1251
1573
 
1252
1574
  case 10:
1253
1575
  productTemp = product;
@@ -1260,7 +1582,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1260
1582
  concept: concept,
1261
1583
  userId: assignationId
1262
1584
  };
1263
- _context11.next = 15;
1585
+ _context17.next = 15;
1264
1586
  return (0, _axios.default)({
1265
1587
  method: "post",
1266
1588
  url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
@@ -1276,35 +1598,17 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1276
1598
 
1277
1599
  case 17:
1278
1600
  case "end":
1279
- return _context11.stop();
1601
+ return _context17.stop();
1280
1602
  }
1281
1603
  }
1282
- }, _callee11);
1604
+ }, _callee17);
1283
1605
  }));
1284
1606
 
1285
- return function setAssignation(_x5, _x6) {
1286
- return _ref12.apply(this, arguments);
1607
+ return function setAssignation(_x7, _x8) {
1608
+ return _ref15.apply(this, arguments);
1287
1609
  };
1288
1610
  }();
1289
1611
 
1290
- var evaluationComplete = function evaluationComplete(tab) {
1291
- var concept = getConcept(tab);
1292
- var serv = servicesData.filter(function (item) {
1293
- return item.service === concept;
1294
- });
1295
-
1296
- if (["RequestWithContentoh", "RequestWithoutContentoh"].includes(origin[tab])) {
1297
- serv = serv.filter(function (f) {
1298
- return f.id_retailer === activeRetailer.id;
1299
- });
1300
- }
1301
-
1302
- var statusArray = user.is_retailer === 1 ? ["ACA", "RCA"] : ["AP", "RP", "ACA"];
1303
- return serv.length > 0 && serv.every(function (item) {
1304
- return statusArray.includes(item.status);
1305
- });
1306
- };
1307
-
1308
1612
  var downloadImages = function downloadImages() {
1309
1613
  var _images$values3;
1310
1614
 
@@ -1384,33 +1688,21 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1384
1688
  }
1385
1689
  };
1386
1690
 
1387
- var confirmStatusComplete = function confirmStatusComplete() {
1388
- var datasheet_status = product.datasheet_status,
1389
- description_status = product.description_status,
1390
- images_status = product.images_status;
1391
- var completionStates = user.is_retailer === 1 ? ["ACA", "Evaluated", "NS"] : ["AP", "Evaluated", "NS"];
1392
- var dsEvaluated = completionStates.includes(datasheet_status);
1393
- var descsEvaluated = completionStates.includes(description_status);
1394
- var imgsEvaluated = completionStates.includes(images_status);
1395
- var AllEvaluated = dsEvaluated && descsEvaluated && imgsEvaluated;
1396
- return AllEvaluated;
1397
- };
1398
-
1399
1691
  var sendEvaluation = /*#__PURE__*/function () {
1400
- var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(result) {
1401
- var _productTemp$id_order;
1692
+ var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
1693
+ var _productTemp$id_order2;
1402
1694
 
1403
1695
  var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
1404
1696
 
1405
- return _regenerator.default.wrap(function _callee12$(_context12) {
1697
+ return _regenerator.default.wrap(function _callee18$(_context18) {
1406
1698
  while (1) {
1407
- switch (_context12.prev = _context12.next) {
1699
+ switch (_context18.prev = _context18.next) {
1408
1700
  case 0:
1409
1701
  setLoading(true);
1410
1702
  concept = getConcept(activeTab);
1411
1703
  productTemp = product;
1412
1704
  articleId = productTemp.id_article;
1413
- orderId = (_productTemp$id_order = productTemp.id_order) !== null && _productTemp$id_order !== void 0 ? _productTemp$id_order : productTemp.orderId;
1705
+ orderId = (_productTemp$id_order2 = productTemp.id_order) !== null && _productTemp$id_order2 !== void 0 ? _productTemp$id_order2 : productTemp.orderId;
1414
1706
  sectionStatusKey = "".concat(getConcept(activeTab), "_status");
1415
1707
  evalStatus = product[sectionStatusKey] || (product === null || product === void 0 ? void 0 : product.version_status);
1416
1708
  data = {
@@ -1420,16 +1712,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1420
1712
  evalStatus: evalStatus
1421
1713
  };
1422
1714
  retailerId = activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id;
1423
- _context12.prev = 9;
1715
+ _context18.prev = 9;
1424
1716
 
1425
1717
  if (!result) {
1426
- _context12.next = 27;
1718
+ _context18.next = 27;
1427
1719
  break;
1428
1720
  }
1429
1721
 
1430
1722
  data.result = result;
1431
1723
  data.retailerId = retailerId;
1432
- _context12.next = 15;
1724
+ _context18.next = 15;
1433
1725
  return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1434
1726
  headers: {
1435
1727
  Authorization: token
@@ -1437,7 +1729,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1437
1729
  });
1438
1730
 
1439
1731
  case 15:
1440
- res = _context12.sent;
1732
+ res = _context18.sent;
1441
1733
  newStatuses = JSON.parse(res.data.body);
1442
1734
  orderStatus = newStatuses.newOrderStatus;
1443
1735
  serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(getConcept(activeTab), "Status")];
@@ -1447,11 +1739,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1447
1739
  showSurveyByProvider = !user.is_retailer && orderStatus[orderId] === "AP";
1448
1740
  showSurveyByRetailer = user.is_retailer && orderStatus[orderId] === "ACA";
1449
1741
  showSurvey && showSurvey(showSurveyByProvider || showSurveyByRetailer);
1450
- _context12.next = 30;
1742
+ _context18.next = 30;
1451
1743
  break;
1452
1744
 
1453
1745
  case 27:
1454
- _context12.next = 29;
1746
+ _context18.next = 29;
1455
1747
  return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1456
1748
  headers: {
1457
1749
  Authorization: token
@@ -1459,7 +1751,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1459
1751
  });
1460
1752
 
1461
1753
  case 29:
1462
- res = _context12.sent;
1754
+ res = _context18.sent;
1463
1755
 
1464
1756
  case 30:
1465
1757
  if (res.data.statusCode === 200) {
@@ -1482,39 +1774,39 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1482
1774
  });
1483
1775
  }
1484
1776
 
1485
- _context12.next = 36;
1777
+ _context18.next = 36;
1486
1778
  break;
1487
1779
 
1488
1780
  case 33:
1489
- _context12.prev = 33;
1490
- _context12.t0 = _context12["catch"](9);
1491
- console.log(_context12.t0);
1781
+ _context18.prev = 33;
1782
+ _context18.t0 = _context18["catch"](9);
1783
+ console.log(_context18.t0);
1492
1784
 
1493
1785
  case 36:
1494
1786
  loadData();
1495
1787
 
1496
1788
  case 37:
1497
1789
  case "end":
1498
- return _context12.stop();
1790
+ return _context18.stop();
1499
1791
  }
1500
1792
  }
1501
- }, _callee12, null, [[9, 33]]);
1793
+ }, _callee18, null, [[9, 33]]);
1502
1794
  }));
1503
1795
 
1504
- return function sendEvaluation(_x7) {
1505
- return _ref13.apply(this, arguments);
1796
+ return function sendEvaluation(_x9) {
1797
+ return _ref16.apply(this, arguments);
1506
1798
  };
1507
1799
  }();
1508
1800
 
1509
1801
  var validateAll = /*#__PURE__*/function () {
1510
- var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
1511
- var _product$id_order2, evaluationArray, conceptArray, dataGeneral, evalResponse, userType, productTemp, retailerStatusCopy;
1802
+ var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
1803
+ var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
1512
1804
 
1513
- return _regenerator.default.wrap(function _callee13$(_context13) {
1805
+ return _regenerator.default.wrap(function _callee19$(_context19) {
1514
1806
  while (1) {
1515
- switch (_context13.prev = _context13.next) {
1807
+ switch (_context19.prev = _context19.next) {
1516
1808
  case 0:
1517
- _context13.prev = 0;
1809
+ _context19.prev = 0;
1518
1810
  setLoading(true);
1519
1811
  evaluationArray = [];
1520
1812
  conceptArray = ["description", "datasheet", "images"];
@@ -1539,22 +1831,22 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1539
1831
  }
1540
1832
  }));
1541
1833
  });
1542
- _context13.next = 8;
1834
+ _context19.next = 8;
1543
1835
  return Promise.all(evaluationArray);
1544
1836
 
1545
1837
  case 8:
1546
- evalResponse = _context13.sent;
1547
1838
  userType = user.is_retailer === 1 ? "CA" : "P";
1548
1839
  productTemp = product;
1549
- productTemp.article_status = "".concat(result).concat(userType);
1550
- productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result).concat(userType);
1551
- productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result).concat(userType);
1552
- productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result).concat(userType);
1840
+ status = "".concat(result).concat(userType);
1841
+ productTemp.article_status = status;
1842
+ productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : status;
1843
+ productTemp.description_status = productTemp.description_status === "NA" ? "NA" : status;
1844
+ productTemp.images_status = productTemp.images_status === "NA" ? "NA" : status;
1553
1845
  retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
1554
1846
  Object.keys(retailerStatusCopy).forEach(function (key) {
1555
1847
  conceptArray.forEach(function (concept) {
1556
1848
  if (retailerStatusCopy[key][concept]) {
1557
- retailerStatusCopy[key][concept] = "".concat(result).concat(userType);
1849
+ retailerStatusCopy[key][concept] = status;
1558
1850
  }
1559
1851
  });
1560
1852
  });
@@ -1572,37 +1864,37 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1572
1864
  idCategory: productTemp.article.id_category,
1573
1865
  product: productTemp
1574
1866
  }));
1575
- _context13.next = 25;
1867
+ _context19.next = 25;
1576
1868
  return loadData();
1577
1869
 
1578
1870
  case 25:
1579
- _context13.next = 30;
1871
+ _context19.next = 30;
1580
1872
  break;
1581
1873
 
1582
1874
  case 27:
1583
- _context13.prev = 27;
1584
- _context13.t0 = _context13["catch"](0);
1585
- console.log(_context13.t0);
1875
+ _context19.prev = 27;
1876
+ _context19.t0 = _context19["catch"](0);
1877
+ console.log(_context19.t0);
1586
1878
 
1587
1879
  case 30:
1588
1880
  case "end":
1589
- return _context13.stop();
1881
+ return _context19.stop();
1590
1882
  }
1591
1883
  }
1592
- }, _callee13, null, [[0, 27]]);
1884
+ }, _callee19, null, [[0, 27]]);
1593
1885
  }));
1594
1886
 
1595
- return function validateAll(_x8) {
1596
- return _ref14.apply(this, arguments);
1887
+ return function validateAll(_x10) {
1888
+ return _ref17.apply(this, arguments);
1597
1889
  };
1598
1890
  }();
1599
1891
 
1600
1892
  var evaluationToRetailer = /*#__PURE__*/function () {
1601
- var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
1893
+ var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(result) {
1602
1894
  var data, prod, statusComplete;
1603
- return _regenerator.default.wrap(function _callee14$(_context14) {
1895
+ return _regenerator.default.wrap(function _callee20$(_context20) {
1604
1896
  while (1) {
1605
- switch (_context14.prev = _context14.next) {
1897
+ switch (_context20.prev = _context20.next) {
1606
1898
  case 0:
1607
1899
  data = {
1608
1900
  articleId: product.id_article,
@@ -1610,7 +1902,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1610
1902
  versionId: product.version,
1611
1903
  status: result
1612
1904
  };
1613
- _context14.next = 3;
1905
+ _context20.next = 3;
1614
1906
  return _axios.default.put("".concat(process.env.REACT_APP_RETAILER_REQUEST), data, {
1615
1907
  headers: {
1616
1908
  Authorization: token
@@ -1627,20 +1919,20 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1627
1919
  prod.product.services_status = "[\"".concat(statusComplete, "\",\"").concat(statusComplete, "\",\"").concat(statusComplete, "\"]");
1628
1920
  sessionStorage.setItem("productEdit", JSON.stringify(prod));
1629
1921
  setProduct(prod);
1630
- setShowGenericModal && setShowGenericModal(false);
1631
- _context14.next = 15;
1922
+ showGlobalModal("generic");
1923
+ _context20.next = 15;
1632
1924
  return loadData();
1633
1925
 
1634
1926
  case 15:
1635
1927
  case "end":
1636
- return _context14.stop();
1928
+ return _context20.stop();
1637
1929
  }
1638
1930
  }
1639
- }, _callee14);
1931
+ }, _callee20);
1640
1932
  }));
1641
1933
 
1642
- return function evaluationToRetailer(_x9) {
1643
- return _ref15.apply(this, arguments);
1934
+ return function evaluationToRetailer(_x11) {
1935
+ return _ref18.apply(this, arguments);
1644
1936
  };
1645
1937
  }();
1646
1938
 
@@ -1698,7 +1990,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1698
1990
  }
1699
1991
  });
1700
1992
  });
1701
- setShowGenericModal(true);
1993
+ showGlobalModal("generic");
1702
1994
  } else if (user.is_retailer) {
1703
1995
  if (product.id_order || product.orderId) {
1704
1996
  sendEvaluation("A");
@@ -1713,7 +2005,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1713
2005
  }
1714
2006
  });
1715
2007
  });
1716
- setShowGenericModal(true);
2008
+ showGlobalModal("generic");
1717
2009
  }
1718
2010
  } else {
1719
2011
  sendEvaluation("A");
@@ -1724,7 +2016,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1724
2016
  } else if (user.is_retailer) {
1725
2017
  if (product.id_order || product.orderId) {
1726
2018
  setValidatedAll(true);
1727
- setModalViewError(true);
2019
+ showGlobalModal("error");
1728
2020
  } else {
1729
2021
  setDataGenericModal(function (prev) {
1730
2022
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
@@ -1736,11 +2028,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1736
2028
  }
1737
2029
  });
1738
2030
  });
1739
- setShowGenericModal(true);
2031
+ showGlobalModal("generic");
1740
2032
  }
1741
2033
  } else {
1742
2034
  setValidatedAll(true);
1743
- setModalViewError(true);
2035
+ showGlobalModal("error");
1744
2036
  }
1745
2037
  }
1746
2038
  };
@@ -1801,7 +2093,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1801
2093
  }
1802
2094
  });
1803
2095
  });
1804
- setShowGenericModal(true);
2096
+ showGlobalModal("generic");
1805
2097
  } else if (user.is_retailer) {
1806
2098
  if (product.id_order || product.orderId) {
1807
2099
  validateAll("A");
@@ -1816,7 +2108,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1816
2108
  }
1817
2109
  });
1818
2110
  });
1819
- setShowGenericModal(true);
2111
+ showGlobalModal("generic");
1820
2112
  }
1821
2113
  } else {
1822
2114
  validateAll("A");
@@ -1828,7 +2120,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1828
2120
  } else if (user.is_retailer) {
1829
2121
  if (product.id_order || product.orderId) {
1830
2122
  setValidatedAll(true);
1831
- setModalViewError(true);
2123
+ showGlobalModal("error");
1832
2124
  } else {
1833
2125
  setDataGenericModal(function (prev) {
1834
2126
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
@@ -1840,11 +2132,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1840
2132
  }
1841
2133
  });
1842
2134
  });
1843
- setShowGenericModal(true);
2135
+ showGlobalModal("generic");
1844
2136
  }
1845
2137
  } else {
1846
2138
  setValidatedAll(true);
1847
- setModalViewError(true);
2139
+ showGlobalModal("error");
1848
2140
  }
1849
2141
  },
1850
2142
  approve: function approve() {
@@ -1959,20 +2251,20 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1959
2251
  reviewed: crossComment
1960
2252
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1961
2253
  buttonType: "circular-button accept-button",
1962
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
1963
- return _regenerator.default.wrap(function _callee15$(_context15) {
2254
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
2255
+ return _regenerator.default.wrap(function _callee21$(_context21) {
1964
2256
  while (1) {
1965
- switch (_context15.prev = _context15.next) {
2257
+ switch (_context21.prev = _context21.next) {
1966
2258
  case 0:
1967
2259
  setCrossComment(true);
1968
2260
  commentRevised();
1969
2261
 
1970
2262
  case 2:
1971
2263
  case "end":
1972
- return _context15.stop();
2264
+ return _context21.stop();
1973
2265
  }
1974
2266
  }
1975
- }, _callee15);
2267
+ }, _callee21);
1976
2268
  }))
1977
2269
  })]
1978
2270
  })
@@ -2026,64 +2318,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2026
2318
  onClick: function onClick() {
2027
2319
  return setMessage("");
2028
2320
  }
2029
- }), modalSent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.GlobalModal, {
2030
- close: function close() {
2031
- return setModalSent(false);
2032
- },
2033
- message: message,
2034
- detail: "",
2035
- bold: !evaluationComplete(activeTab) && "Aprueba / Rechaza",
2036
- widthImg: !evaluationComplete(activeTab) ? "160px" : "354px",
2037
- heightImg: !evaluationComplete(activeTab) ? "84px" : "354px",
2038
- img: getSectionIcon()
2039
- }), modalViewError && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.GlobalModal, {
2040
- close: function close() {
2041
- return setModalViewError(false);
2042
- },
2043
- message: "".concat(activeTab, " rechazada"),
2044
- detail: "Agrega tu comentarios para enviar el rechazo",
2045
- button1: {
2046
- name: "Enviar",
2047
- action: function action(e) {
2048
- var textArea = document.querySelector("#area");
2049
-
2050
- if (textArea.value) {
2051
- textArea.style.border = "none";
2052
- createComment(e, textArea.value);
2053
- setModalViewError(false);
2054
- setModalViewTextArea(true);
2055
- validatedAll ? validateAll("R") : sendEvaluation("R");
2056
- } else {
2057
- textArea.style.border = "2px solid red";
2058
- }
2059
- }
2060
- },
2061
- img: _errorModal.default,
2062
- textArea: true
2063
- }), showGenericModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.GlobalModal, {
2064
- close: function close() {
2065
- return setShowGenericModal(false);
2066
- },
2067
- message: dataGenericModal.message,
2068
- detail: dataGenericModal.detail,
2069
- button1: dataGenericModal.button1,
2070
- button2: dataGenericModal.button2,
2071
- img: dataGenericModal.img
2072
- }), modalViewTextArea && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.GlobalModal, {
2073
- close: function close() {
2074
- return setModalViewTextArea(false);
2075
- },
2076
- message: "Gracias, tus comentarios fueron entregados.",
2077
- detail: "Trabajaremos en conjunto para resolverlo.",
2078
- button1: {
2079
- name: "Cerrar",
2080
- action: function action() {
2081
- return setModalViewTextArea(false);
2082
- }
2083
- },
2084
- img: _defaultProfileImage.default,
2085
- textArea: false
2086
- }), showVersionSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelector.VersionSelector, {
2321
+ }), globalModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.GlobalModal, (0, _objectSpread3.default)({
2322
+ close: closeGlobalModal
2323
+ }, globalModal)), showVersionSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelector.VersionSelector, {
2087
2324
  modalId: "version-selector",
2088
2325
  articleId: product.id_article,
2089
2326
  setVersion: setVersion,