contentoh-components-library 21.1.29 → 21.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/Commentary/styles.js +1 -1
- package/dist/components/atoms/GeneralInput/styles.js +3 -3
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/atoms/SliderToolTip/index.js +14 -9
- package/dist/components/atoms/SliderToolTip/styles.js +1 -1
- package/dist/components/atoms/StatusTag/index.js +2 -17
- package/dist/components/atoms/StatusTag/styles.js +1 -1
- package/dist/components/atoms/ValidationPanel/index.js +4 -3
- package/dist/components/molecules/AvatarAndValidation/index.js +4 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +6 -2
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +62 -74
- package/dist/components/pages/ProviderProductEdition/index.js +433 -323
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +107 -71
- package/dist/components/pages/RetailerProductEdition/index.js +314 -194
- package/dist/global-files/data.js +10 -9
- package/package.json +1 -1
- package/src/components/atoms/Commentary/styles.js +2 -2
- package/src/components/atoms/GeneralInput/styles.js +5 -5
- package/src/components/atoms/InputFormatter/styles.js +3 -3
- package/src/components/atoms/SliderToolTip/index.js +20 -13
- package/src/components/atoms/SliderToolTip/styles.js +21 -25
- package/src/components/atoms/StatusTag/index.js +2 -12
- package/src/components/atoms/StatusTag/styles.js +11 -11
- package/src/components/atoms/ValidationPanel/index.js +5 -4
- package/src/components/molecules/AvatarAndValidation/index.js +5 -1
- package/src/components/organisms/FullProductNameHeader/index.js +6 -2
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +63 -79
- package/src/components/pages/ProviderProductEdition/index.js +236 -168
- package/src/components/pages/ProviderProductEdition/styles.js +1 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +108 -70
- package/src/components/pages/RetailerProductEdition/index.js +238 -166
- package/src/global-files/data.js +10 -9
- package/dist/assets/fonts/avenirnext/AvenirNextLTPro-Bold.otf +0 -0
- package/dist/assets/fonts/avenirnext/AvenirNextLTPro-It.otf +0 -0
- package/dist/assets/fonts/avenirnext/AvenirNextLTPro-Regular.otf +0 -0
- package/dist/assets/fonts/lato/Lato-Bold.ttf +0 -0
- package/dist/assets/fonts/lato/Lato-Italic.ttf +0 -0
- package/dist/assets/fonts/lato/Lato-Light.ttf +0 -0
- package/dist/assets/fonts/lato/Lato-Regular.ttf +0 -0
- package/dist/assets/fonts/lato/Lato-Thin.ttf +0 -0
- package/dist/assets/fonts/lato/OFL.txt +0 -93
- package/dist/assets/fonts/raleway/Raleway-Black.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-Bold.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-ExtraBold.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-Italic.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-Medium.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-Regular.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-SemiBold.ttf +0 -0
- package/dist/assets/images/activedFilter/removeFilter.svg +0 -3
- package/dist/assets/images/arrow/arrowIcon.svg +0 -3
- package/dist/assets/images/arrow/polygon.svg +0 -3
- package/dist/assets/images/asignationOptions/availableIcon.svg +0 -3
- package/dist/assets/images/asignationOptions/removeAsigned.svg +0 -4
- package/dist/assets/images/asignationOptions/requestToProvider.svg +0 -3
- package/dist/assets/images/asignationOptions/requestToTeam.svg +0 -3
- package/dist/assets/images/card/masterCardIcon.svg +0 -5
- package/dist/assets/images/carouselImagesLogin/login2.svg +0 -117
- package/dist/assets/images/carouselImagesLogin/login3.svg +0 -147
- package/dist/assets/images/carouselImagesLogin/loginImage.svg +0 -301
- package/dist/assets/images/checkBox/checked.svg +0 -3
- package/dist/assets/images/checkBox/unchecked.svg +0 -3
- package/dist/assets/images/componentAssigned/assignedImage1.svg +0 -9
- package/dist/assets/images/componentAssigned/assignedImage2.svg +0 -9
- package/dist/assets/images/componentAssigned/clock.svg +0 -4
- package/dist/assets/images/componentAssigned/flag.svg +0 -3
- package/dist/assets/images/defaultImages/defaultProductImage.png +0 -0
- package/dist/assets/images/defaultImages/defaultProfileImage.svg +0 -13
- package/dist/assets/images/defaultImages/defaultUpdate.png +0 -0
- package/dist/assets/images/dropDownButton/dropDownArrowButton.svg +0 -3
- package/dist/assets/images/editField/editField.svg +0 -3
- package/dist/assets/images/editField/showPassword.png +0 -0
- package/dist/assets/images/flags/highPriority.svg +0 -3
- package/dist/assets/images/flags/lowPriority.svg +0 -3
- package/dist/assets/images/flags/mediumPriority.svg +0 -3
- package/dist/assets/images/flags/noPriority.svg +0 -3
- package/dist/assets/images/generalButton/acceptIcon.svg +0 -3
- package/dist/assets/images/generalButton/closeIcon.svg +0 -4
- package/dist/assets/images/generalButton/deleteIcon.svg +0 -13
- package/dist/assets/images/generalButton/deleteIconHover.svg +0 -13
- package/dist/assets/images/generalButton/downloadIcon.svg +0 -3
- package/dist/assets/images/generalButton/gridLayout.svg +0 -3
- package/dist/assets/images/generalButton/nullIcon.svg +0 -3
- package/dist/assets/images/generalButton/openModal.svg +0 -3
- package/dist/assets/images/generalButton/rejectIcon.svg +0 -3
- package/dist/assets/images/generalButton/rowLayout.svg +0 -3
- package/dist/assets/images/generalButton/saveIcon.svg +0 -3
- package/dist/assets/images/generalButton/saveIconHover.svg +0 -3
- package/dist/assets/images/generalImage/assigned.svg +0 -14
- package/dist/assets/images/generalImage/bags.svg +0 -25
- package/dist/assets/images/generalImage/clock.svg +0 -4
- package/dist/assets/images/generalImage/flag.svg +0 -3
- package/dist/assets/images/genericModal/closeWhite.svg +0 -3
- package/dist/assets/images/genericModal/errorModal.svg +0 -3
- package/dist/assets/images/genericModal/genericModalCheck.svg +0 -3
- package/dist/assets/images/genericModal/genericModalClose.svg +0 -3
- package/dist/assets/images/genericModal/genericModalDown.svg +0 -3
- package/dist/assets/images/genericModal/genericModalUp.svg +0 -3
- package/dist/assets/images/genericModal/genericModalWarning.svg +0 -12
- package/dist/assets/images/genericModal/yellowAlert.svg +0 -12
- package/dist/assets/images/logo/logoLogin.svg +0 -15
- package/dist/assets/images/menuNotification/menuNotificationComment.svg +0 -3
- package/dist/assets/images/menuNotification/menuNotificationProduct.svg +0 -3
- package/dist/assets/images/menuProfile/logOut.svg +0 -3
- package/dist/assets/images/menuProfile/myAccount.svg +0 -3
- package/dist/assets/images/menuProfile/settings.svg +0 -3
- package/dist/assets/images/modalsSVGs/attributesSent.svg +0 -208
- package/dist/assets/images/modalsSVGs/descriptionSent.svg +0 -237
- package/dist/assets/images/modalsSVGs/providerSent.svg +0 -445
- package/dist/assets/images/modalsSVGs/uploadingImages.svg +0 -148
- package/dist/assets/images/productImage/openModal.svg +0 -3
- package/dist/assets/images/productNotification/productNotification.svg +0 -3
- package/dist/assets/images/profileHeader/profilePicture.svg +0 -9
- package/dist/assets/images/providerAndCadena/Cadena.svg +0 -188
- package/dist/assets/images/providerAndCadena/LoginContentoh.svg +0 -15
- package/dist/assets/images/providerAndCadena/Proveedor.svg +0 -231
- package/dist/assets/images/sideMenuButton/contenoh.svg +0 -5
- package/dist/assets/images/sideMenuButton/dashboard.svg +0 -5
- package/dist/assets/images/sideMenuButton/products.svg +0 -10
- package/dist/assets/images/sideMenuButton/providers.svg +0 -10
- package/dist/assets/images/sideMenuButton/tasks.svg +0 -3
- package/dist/assets/images/sliderToolTip/infoIcon.svg +0 -4
- package/dist/assets/images/sliderToolTip/slide1.svg +0 -5
- package/dist/assets/images/sliderToolTip/slide2.svg +0 -9
- package/dist/assets/images/sliderToolTip/slide21.svg +0 -9
- package/dist/assets/images/sliderToolTip/slide22.svg +0 -9
- package/dist/assets/images/sliderToolTip/slide23.svg +0 -9
- package/dist/assets/images/sliderToolTip/slide3.svg +0 -9
- package/dist/assets/images/sliderToolTip/slide4.svg +0 -9
- package/dist/assets/images/sliderToolTip/slide5.svg +0 -40
- package/dist/assets/images/verticalSideMenuMainPage/closeMenu.svg +0 -4
- package/dist/assets/images/verticalSideMenuMainPage/iconFAQS.svg +0 -12
- package/dist/assets/images/verticalSideMenuMainPage/iconGroup.svg +0 -3
- package/dist/assets/images/verticalSideMenuMainPage/iconLogo.svg +0 -12
- package/dist/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +0 -15
- package/dist/assets/images/verticalSideMenuMainPage/iconProduct.svg +0 -3
- package/dist/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +0 -12
- package/dist/assets/images/verticalSideMenuMainPage/iconTask.svg +0 -10
- package/dist/assets/images/verticalSideMenuMainPage/openMenu.svg +0 -4
- package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +0 -36
- package/dist/components/atoms/ListCommercialRetailers/index.js +0 -64
- package/dist/components/atoms/ListCommercialRetailers/styles.js +0 -20
- package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +0 -37
- package/dist/components/atoms/MenuCommercialRetailers/index.js +0 -25
- package/dist/components/atoms/MenuCommercialRetailers/styles.js +0 -20
- package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +0 -28
- package/dist/components/atoms/MenuProductImage/index.js +0 -88
- package/dist/components/atoms/MenuProductImage/styles.js +0 -20
- package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +0 -25
- package/dist/components/molecules/ApproveRejetPanel/index.js +0 -49
- package/dist/components/molecules/ApproveRejetPanel/styles.js +0 -18
- package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +0 -28
- package/dist/components/molecules/SignInLoginCreationApp/index.js +0 -270
- package/dist/components/molecules/SignInLoginCreationApp/styles.js +0 -20
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +0 -37
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +0 -269
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +0 -20
- package/dist/global-files/fonts.css +0 -45
- package/dist/global-files/global-styles.css +0 -40
|
@@ -39,7 +39,7 @@ var _GalleryElement = require("../../molecules/GalleryElement");
|
|
|
39
39
|
|
|
40
40
|
var _fileSaver = require("file-saver");
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _data = require("../../../global-files/data");
|
|
43
43
|
|
|
44
44
|
var _GalleryHeader = require("../../molecules/GalleryHeader");
|
|
45
45
|
|
|
@@ -479,7 +479,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
479
479
|
|
|
480
480
|
var loadData = /*#__PURE__*/function () {
|
|
481
481
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
482
|
-
var _product$article, _product$article2, _services$, _services$$values;
|
|
482
|
+
var _product$article, _product$article2, _product$article3, _services$, _services$$values;
|
|
483
483
|
|
|
484
484
|
var services;
|
|
485
485
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
@@ -487,7 +487,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
487
487
|
switch (_context2.prev = _context2.next) {
|
|
488
488
|
case 0:
|
|
489
489
|
_context2.next = 2;
|
|
490
|
-
return (0,
|
|
490
|
+
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)), product === null || product === void 0 ? void 0 : product.version);
|
|
491
491
|
|
|
492
492
|
case 2:
|
|
493
493
|
services = _context2.sent;
|
|
@@ -497,7 +497,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
497
497
|
|
|
498
498
|
if (!originProp) {
|
|
499
499
|
setActiveRetailer(product !== null && product !== void 0 && product.retailers ? product === null || product === void 0 ? void 0 : product.retailers[0] : product === null || product === void 0 ? void 0 : product.retailersAvailable[0]);
|
|
500
|
-
} //setActiveRetailer(product?.retailers[0]);
|
|
500
|
+
} // setActiveRetailer(product?.retailers[0]);
|
|
501
501
|
|
|
502
502
|
|
|
503
503
|
setImages({
|
|
@@ -505,7 +505,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
505
505
|
init: services[2]
|
|
506
506
|
});
|
|
507
507
|
if (((_services$ = services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
|
|
508
|
-
(0,
|
|
508
|
+
(0, _data.getPercentage)({
|
|
509
509
|
data: [product]
|
|
510
510
|
}).then(function (res) {
|
|
511
511
|
return setPercentages(res);
|
|
@@ -527,19 +527,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
527
527
|
|
|
528
528
|
var getServices = /*#__PURE__*/function () {
|
|
529
529
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
530
|
-
var _product$
|
|
530
|
+
var _product$article4;
|
|
531
531
|
|
|
532
|
-
var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailers, active;
|
|
532
|
+
var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailerResponse, retailers, active;
|
|
533
533
|
|
|
534
534
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
535
535
|
while (1) {
|
|
536
536
|
switch (_context3.prev = _context3.next) {
|
|
537
537
|
case 0:
|
|
538
538
|
productInOrder = product.id_order || product.orderId;
|
|
539
|
-
idArticle = (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$
|
|
539
|
+
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);
|
|
540
540
|
|
|
541
541
|
if (!(isRevision() || productInOrder)) {
|
|
542
|
-
_context3.next =
|
|
542
|
+
_context3.next = 12;
|
|
543
543
|
break;
|
|
544
544
|
}
|
|
545
545
|
|
|
@@ -549,16 +549,17 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
549
549
|
case 5:
|
|
550
550
|
servicesResponse = _context3.sent;
|
|
551
551
|
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;
|
|
552
|
+
retailerResponse = parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.map(function (srv) {
|
|
553
|
+
return srv.id_retailer;
|
|
554
|
+
});
|
|
552
555
|
retailers = product.retailers || product.retailersAvailable;
|
|
553
|
-
active = retailers === null || retailers === void 0 ? void 0 : retailers.
|
|
554
|
-
return
|
|
555
|
-
|
|
556
|
-
}).includes(retailer.id);
|
|
557
|
-
})[0];
|
|
556
|
+
active = retailers === null || retailers === void 0 ? void 0 : retailers.find(function (retailer) {
|
|
557
|
+
return retailerResponse.includes(retailer.id);
|
|
558
|
+
});
|
|
558
559
|
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
559
560
|
setServicesData(parsedResponse);
|
|
560
561
|
|
|
561
|
-
case
|
|
562
|
+
case 12:
|
|
562
563
|
case "end":
|
|
563
564
|
return _context3.stop();
|
|
564
565
|
}
|
|
@@ -586,7 +587,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
586
587
|
if (_revision && currentService === "AP") return true;
|
|
587
588
|
} else {
|
|
588
589
|
var _product = productEdit.product;
|
|
589
|
-
|
|
590
|
+
var isRequestWithoutContentoh = orgn === "RequestWithoutContentoh" && (["R", "CA"].includes(currentService) || currentService === "RCA" && (!_product.id_order || !_product.orderId));
|
|
591
|
+
var isRequestWithContentoh = orgn === "RequestWithContentoh" && currentService === "AA";
|
|
592
|
+
var isContentoh = orgn === "Contentoh" && currentService === "AA";
|
|
593
|
+
if (isContentoh || isRequestWithoutContentoh || isRequestWithContentoh) return true;
|
|
590
594
|
}
|
|
591
595
|
}
|
|
592
596
|
|
|
@@ -629,53 +633,36 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
629
633
|
};
|
|
630
634
|
}();
|
|
631
635
|
|
|
632
|
-
(0, _react.useEffect)(
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
getCart();
|
|
641
|
-
_context5.t0 = setUserGroups;
|
|
642
|
-
_context5.next = 6;
|
|
643
|
-
return (0, _data2.fetchUsers)(token);
|
|
644
|
-
|
|
645
|
-
case 6:
|
|
646
|
-
_context5.t1 = _context5.sent;
|
|
647
|
-
(0, _context5.t0)(_context5.t1);
|
|
648
|
-
arr = [];
|
|
649
|
-
_context5.t2 = user.id_role;
|
|
650
|
-
_context5.next = _context5.t2 === 7 ? 12 : _context5.t2 === 8 ? 12 : _context5.t2 === 4 ? 14 : _context5.t2 === 5 ? 14 : _context5.t2 === 6 ? 16 : 18;
|
|
651
|
-
break;
|
|
652
|
-
|
|
653
|
-
case 12:
|
|
654
|
-
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
655
|
-
return _context5.abrupt("break", 20);
|
|
636
|
+
(0, _react.useEffect)(function () {
|
|
637
|
+
sessionStorage.setItem("user", JSON.stringify(user));
|
|
638
|
+
loadData();
|
|
639
|
+
getCart();
|
|
640
|
+
(0, _data.fetchUsers)(token).then(function (res) {
|
|
641
|
+
return setUserGroups(res);
|
|
642
|
+
});
|
|
643
|
+
var arr = []; // ?? Que sentido tiene verificar los roles de colaborador en la app de proveedor
|
|
656
644
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
645
|
+
switch (user.id_role) {
|
|
646
|
+
case 7:
|
|
647
|
+
case 8:
|
|
648
|
+
arr = ["CA", "RC", "RA"];
|
|
649
|
+
break;
|
|
660
650
|
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
651
|
+
case 4:
|
|
652
|
+
case 5:
|
|
653
|
+
arr = ["RC", "AC", "AA", "AP", "ACA"];
|
|
654
|
+
break;
|
|
664
655
|
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
656
|
+
case 6:
|
|
657
|
+
arr = ["RP", "RCA", "AC"];
|
|
658
|
+
break;
|
|
668
659
|
|
|
669
|
-
|
|
670
|
-
|
|
660
|
+
default:
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
671
663
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
return _context5.stop();
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
}, _callee5);
|
|
678
|
-
})), [product]);
|
|
664
|
+
setStatusArray(arr);
|
|
665
|
+
}, [product]);
|
|
679
666
|
|
|
680
667
|
var loadAssignations = function loadAssignations(currentProduct) {
|
|
681
668
|
setAssig(product === null || product === void 0 ? void 0 : product.asignations);
|
|
@@ -690,11 +677,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
690
677
|
var productTemp = product;
|
|
691
678
|
var retailers = (productTemp === null || productTemp === void 0 ? void 0 : productTemp.retailersAvailable) || (productTemp === null || productTemp === void 0 ? void 0 : productTemp.retailers);
|
|
692
679
|
retailers === null || retailers === void 0 ? void 0 : retailers.forEach(function (retailer) {
|
|
693
|
-
var _percentages$
|
|
680
|
+
var _percentages$find;
|
|
694
681
|
|
|
695
|
-
retailer["percentage"] = percentages === null || percentages === void 0 ? void 0 : (_percentages$
|
|
682
|
+
retailer["percentage"] = percentages === null || percentages === void 0 ? void 0 : (_percentages$find = percentages.find(function (percent) {
|
|
696
683
|
return (retailer === null || retailer === void 0 ? void 0 : retailer.id) === (percent === null || percent === void 0 ? void 0 : percent.id_retailer);
|
|
697
|
-
})
|
|
684
|
+
})) === null || _percentages$find === void 0 ? void 0 : _percentages$find.percentage;
|
|
698
685
|
});
|
|
699
686
|
setProduct(productTemp);
|
|
700
687
|
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
@@ -773,11 +760,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
773
760
|
}, [images]);
|
|
774
761
|
|
|
775
762
|
var saveDescriptions = /*#__PURE__*/function () {
|
|
776
|
-
var
|
|
777
|
-
var dataObject;
|
|
778
|
-
|
|
763
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
764
|
+
var dataObject, _res;
|
|
765
|
+
|
|
766
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
779
767
|
while (1) {
|
|
780
|
-
switch (
|
|
768
|
+
switch (_context5.prev = _context5.next) {
|
|
781
769
|
case 0:
|
|
782
770
|
setLoading(true);
|
|
783
771
|
dataObject = {
|
|
@@ -785,8 +773,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
785
773
|
articleData: updatedDescriptions
|
|
786
774
|
};
|
|
787
775
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
788
|
-
|
|
789
|
-
|
|
776
|
+
_context5.prev = 3;
|
|
777
|
+
_context5.next = 6;
|
|
790
778
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
|
|
791
779
|
headers: {
|
|
792
780
|
Authorization: token
|
|
@@ -794,35 +782,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
794
782
|
});
|
|
795
783
|
|
|
796
784
|
case 6:
|
|
785
|
+
_res = _context5.sent;
|
|
786
|
+
|
|
787
|
+
if (!(_res.data.statusCode === 200)) {
|
|
788
|
+
_context5.next = 11;
|
|
789
|
+
break;
|
|
790
|
+
}
|
|
791
|
+
|
|
797
792
|
setMessage("Descripciones guardadas con éxito");
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
break;
|
|
793
|
+
_context5.next = 11;
|
|
794
|
+
return loadData();
|
|
801
795
|
|
|
802
|
-
case
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
console.log(_context6.t0);
|
|
796
|
+
case 11:
|
|
797
|
+
_context5.next = 16;
|
|
798
|
+
break;
|
|
806
799
|
|
|
807
800
|
case 13:
|
|
801
|
+
_context5.prev = 13;
|
|
802
|
+
_context5.t0 = _context5["catch"](3);
|
|
803
|
+
console.log(_context5.t0);
|
|
804
|
+
|
|
805
|
+
case 16:
|
|
808
806
|
case "end":
|
|
809
|
-
return
|
|
807
|
+
return _context5.stop();
|
|
810
808
|
}
|
|
811
809
|
}
|
|
812
|
-
},
|
|
810
|
+
}, _callee5, null, [[3, 13]]);
|
|
813
811
|
}));
|
|
814
812
|
|
|
815
813
|
return function saveDescriptions() {
|
|
816
|
-
return
|
|
814
|
+
return _ref6.apply(this, arguments);
|
|
817
815
|
};
|
|
818
816
|
}();
|
|
819
817
|
|
|
820
818
|
var saveDatasheets = /*#__PURE__*/function () {
|
|
821
|
-
var
|
|
819
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
822
820
|
var dataObject;
|
|
823
|
-
return _regenerator.default.wrap(function
|
|
821
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
824
822
|
while (1) {
|
|
825
|
-
switch (
|
|
823
|
+
switch (_context6.prev = _context6.next) {
|
|
826
824
|
case 0:
|
|
827
825
|
setLoading(true);
|
|
828
826
|
dataObject = {
|
|
@@ -830,8 +828,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
830
828
|
articleData: updatedDatasheets
|
|
831
829
|
};
|
|
832
830
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
833
|
-
|
|
834
|
-
|
|
831
|
+
_context6.prev = 3;
|
|
832
|
+
_context6.next = 6;
|
|
835
833
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
|
|
836
834
|
headers: {
|
|
837
835
|
Authorization: token
|
|
@@ -839,37 +837,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
839
837
|
});
|
|
840
838
|
|
|
841
839
|
case 6:
|
|
840
|
+
if (!(res.data.statusCode === 200)) {
|
|
841
|
+
_context6.next = 10;
|
|
842
|
+
break;
|
|
843
|
+
}
|
|
844
|
+
|
|
842
845
|
setMessage("Fichas técnicas guardadas");
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
break;
|
|
846
|
+
_context6.next = 10;
|
|
847
|
+
return loadData();
|
|
846
848
|
|
|
847
849
|
case 10:
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
console.log(_context7.t0);
|
|
850
|
+
_context6.next = 15;
|
|
851
|
+
break;
|
|
851
852
|
|
|
852
|
-
case
|
|
853
|
+
case 12:
|
|
854
|
+
_context6.prev = 12;
|
|
855
|
+
_context6.t0 = _context6["catch"](3);
|
|
856
|
+
console.log(_context6.t0);
|
|
857
|
+
|
|
858
|
+
case 15:
|
|
853
859
|
case "end":
|
|
854
|
-
return
|
|
860
|
+
return _context6.stop();
|
|
855
861
|
}
|
|
856
862
|
}
|
|
857
|
-
},
|
|
863
|
+
}, _callee6, null, [[3, 12]]);
|
|
858
864
|
}));
|
|
859
865
|
|
|
860
866
|
return function saveDatasheets() {
|
|
861
|
-
return
|
|
867
|
+
return _ref7.apply(this, arguments);
|
|
862
868
|
};
|
|
863
869
|
}();
|
|
864
870
|
|
|
865
|
-
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
871
|
+
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
866
872
|
var _images$values2, _data$articleData, _data$articleData2, _data$updateImages;
|
|
867
873
|
|
|
868
874
|
var imagesList, imagesListTemp, duplicated, attrForImgs, data, valid, _data$updateImages2, _data$articleData3, _data$articleData4, _data$articleData5, promiseArray;
|
|
869
875
|
|
|
870
|
-
return _regenerator.default.wrap(function
|
|
876
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
871
877
|
while (1) {
|
|
872
|
-
switch (
|
|
878
|
+
switch (_context7.prev = _context7.next) {
|
|
873
879
|
case 0:
|
|
874
880
|
imagesList = images === null || images === void 0 ? void 0 : (_images$values2 = images.values) === null || _images$values2 === void 0 ? void 0 : _images$values2.slice();
|
|
875
881
|
imagesListTemp = imagesList === null || imagesList === void 0 ? void 0 : imagesList.reduce(function (acc, image) {
|
|
@@ -918,19 +924,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
918
924
|
}
|
|
919
925
|
|
|
920
926
|
if (!(valid && (duplicated === null || duplicated === void 0 ? void 0 : duplicated.length) === 0)) {
|
|
921
|
-
|
|
927
|
+
_context7.next = 31;
|
|
922
928
|
break;
|
|
923
929
|
}
|
|
924
930
|
|
|
925
931
|
setLoading(true);
|
|
926
|
-
|
|
932
|
+
_context7.prev = 11;
|
|
927
933
|
data === null || data === void 0 ? void 0 : (_data$articleData3 = data.articleData) === null || _data$articleData3 === void 0 ? void 0 : _data$articleData3.forEach(function (e) {
|
|
928
934
|
e.uuid = (0, _uuid.v4)();
|
|
929
935
|
});
|
|
930
936
|
setDataImages(data);
|
|
931
937
|
|
|
932
938
|
if (!((data === null || data === void 0 ? void 0 : (_data$articleData4 = data.articleData) === null || _data$articleData4 === void 0 ? void 0 : _data$articleData4.length) > 0)) {
|
|
933
|
-
|
|
939
|
+
_context7.next = 23;
|
|
934
940
|
break;
|
|
935
941
|
}
|
|
936
942
|
|
|
@@ -946,28 +952,28 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
946
952
|
};
|
|
947
953
|
promiseArray.push(myBucket.putObject(params).promise());
|
|
948
954
|
});
|
|
949
|
-
|
|
955
|
+
_context7.next = 20;
|
|
950
956
|
return Promise.all(promiseArray);
|
|
951
957
|
|
|
952
958
|
case 20:
|
|
953
959
|
setImagesUploaded(true);
|
|
954
|
-
|
|
960
|
+
_context7.next = 24;
|
|
955
961
|
break;
|
|
956
962
|
|
|
957
963
|
case 23:
|
|
958
964
|
setImagesUploaded(true);
|
|
959
965
|
|
|
960
966
|
case 24:
|
|
961
|
-
|
|
967
|
+
_context7.next = 29;
|
|
962
968
|
break;
|
|
963
969
|
|
|
964
970
|
case 26:
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
console.log(
|
|
971
|
+
_context7.prev = 26;
|
|
972
|
+
_context7.t0 = _context7["catch"](11);
|
|
973
|
+
console.log(_context7.t0); // setMainLoading(false);
|
|
968
974
|
|
|
969
975
|
case 29:
|
|
970
|
-
|
|
976
|
+
_context7.next = 32;
|
|
971
977
|
break;
|
|
972
978
|
|
|
973
979
|
case 31:
|
|
@@ -976,18 +982,20 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
976
982
|
|
|
977
983
|
case 32:
|
|
978
984
|
case "end":
|
|
979
|
-
return
|
|
985
|
+
return _context7.stop();
|
|
980
986
|
}
|
|
981
987
|
}
|
|
982
|
-
},
|
|
988
|
+
}, _callee7, null, [[11, 26]]);
|
|
983
989
|
})), [images, imagesUploaded]);
|
|
984
|
-
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
985
|
-
|
|
990
|
+
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
991
|
+
var _res2;
|
|
992
|
+
|
|
993
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
986
994
|
while (1) {
|
|
987
|
-
switch (
|
|
995
|
+
switch (_context8.prev = _context8.next) {
|
|
988
996
|
case 0:
|
|
989
997
|
if (!imagesUploaded) {
|
|
990
|
-
|
|
998
|
+
_context8.next = 16;
|
|
991
999
|
break;
|
|
992
1000
|
}
|
|
993
1001
|
|
|
@@ -999,8 +1007,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
999
1007
|
if (product !== null && product !== void 0 && product.orderId) e["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
1000
1008
|
return e;
|
|
1001
1009
|
});
|
|
1002
|
-
|
|
1003
|
-
|
|
1010
|
+
_context8.prev = 2;
|
|
1011
|
+
_context8.next = 5;
|
|
1004
1012
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?image=true&version=").concat(version), dataImages, {
|
|
1005
1013
|
headers: {
|
|
1006
1014
|
Authorization: token
|
|
@@ -1008,23 +1016,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1008
1016
|
});
|
|
1009
1017
|
|
|
1010
1018
|
case 5:
|
|
1019
|
+
_res2 = _context8.sent;
|
|
1020
|
+
|
|
1021
|
+
if (!(_res2.data.statusCode === 200)) {
|
|
1022
|
+
_context8.next = 11;
|
|
1023
|
+
break;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1011
1026
|
setMessage("Imágenes guardadas con éxito");
|
|
1012
1027
|
sessionStorage.removeItem("imagesList");
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
break;
|
|
1028
|
+
_context8.next = 11;
|
|
1029
|
+
return loadData();
|
|
1016
1030
|
|
|
1017
|
-
case
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
console.log(_context9.t0);
|
|
1031
|
+
case 11:
|
|
1032
|
+
_context8.next = 16;
|
|
1033
|
+
break;
|
|
1021
1034
|
|
|
1022
1035
|
case 13:
|
|
1036
|
+
_context8.prev = 13;
|
|
1037
|
+
_context8.t0 = _context8["catch"](2);
|
|
1038
|
+
console.log(_context8.t0);
|
|
1039
|
+
|
|
1040
|
+
case 16:
|
|
1023
1041
|
case "end":
|
|
1024
|
-
return
|
|
1042
|
+
return _context8.stop();
|
|
1025
1043
|
}
|
|
1026
1044
|
}
|
|
1027
|
-
},
|
|
1045
|
+
}, _callee8, null, [[2, 13]]);
|
|
1028
1046
|
})), [dataImages, imagesUploaded]);
|
|
1029
1047
|
|
|
1030
1048
|
var getConcept = function getConcept(tab) {
|
|
@@ -1060,28 +1078,28 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1060
1078
|
};
|
|
1061
1079
|
|
|
1062
1080
|
var createComment = /*#__PURE__*/function () {
|
|
1063
|
-
var
|
|
1081
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(e, body, tab) {
|
|
1064
1082
|
var concept, data;
|
|
1065
|
-
return _regenerator.default.wrap(function
|
|
1083
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1066
1084
|
while (1) {
|
|
1067
|
-
switch (
|
|
1085
|
+
switch (_context9.prev = _context9.next) {
|
|
1068
1086
|
case 0:
|
|
1069
1087
|
concept = "";
|
|
1070
|
-
|
|
1071
|
-
|
|
1088
|
+
_context9.t0 = activeTab;
|
|
1089
|
+
_context9.next = _context9.t0 === "Ficha técnica" ? 4 : _context9.t0 === "Imágenes" ? 6 : 8;
|
|
1072
1090
|
break;
|
|
1073
1091
|
|
|
1074
1092
|
case 4:
|
|
1075
1093
|
concept = "datasheet";
|
|
1076
|
-
return
|
|
1094
|
+
return _context9.abrupt("break", 10);
|
|
1077
1095
|
|
|
1078
1096
|
case 6:
|
|
1079
1097
|
concept = "images";
|
|
1080
|
-
return
|
|
1098
|
+
return _context9.abrupt("break", 10);
|
|
1081
1099
|
|
|
1082
1100
|
case 8:
|
|
1083
1101
|
concept = "description";
|
|
1084
|
-
return
|
|
1102
|
+
return _context9.abrupt("break", 10);
|
|
1085
1103
|
|
|
1086
1104
|
case 10:
|
|
1087
1105
|
data = {
|
|
@@ -1091,7 +1109,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1091
1109
|
concept: concept,
|
|
1092
1110
|
version: version
|
|
1093
1111
|
};
|
|
1094
|
-
|
|
1112
|
+
_context9.next = 13;
|
|
1095
1113
|
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1096
1114
|
headers: {
|
|
1097
1115
|
Authorization: token
|
|
@@ -1100,14 +1118,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1100
1118
|
|
|
1101
1119
|
case 13:
|
|
1102
1120
|
case "end":
|
|
1103
|
-
return
|
|
1121
|
+
return _context9.stop();
|
|
1104
1122
|
}
|
|
1105
1123
|
}
|
|
1106
|
-
},
|
|
1124
|
+
}, _callee9);
|
|
1107
1125
|
}));
|
|
1108
1126
|
|
|
1109
1127
|
return function createComment(_x2, _x3, _x4) {
|
|
1110
|
-
return
|
|
1128
|
+
return _ref10.apply(this, arguments);
|
|
1111
1129
|
};
|
|
1112
1130
|
}();
|
|
1113
1131
|
|
|
@@ -1116,16 +1134,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1116
1134
|
}, [activeTab]);
|
|
1117
1135
|
|
|
1118
1136
|
var commentRevised = /*#__PURE__*/function () {
|
|
1119
|
-
var
|
|
1137
|
+
var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
1120
1138
|
var data;
|
|
1121
|
-
return _regenerator.default.wrap(function
|
|
1139
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
1122
1140
|
while (1) {
|
|
1123
|
-
switch (
|
|
1141
|
+
switch (_context10.prev = _context10.next) {
|
|
1124
1142
|
case 0:
|
|
1125
1143
|
data = {
|
|
1126
1144
|
commentId: comment.id
|
|
1127
1145
|
};
|
|
1128
|
-
|
|
1146
|
+
_context10.next = 3;
|
|
1129
1147
|
return _axios.default.put("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1130
1148
|
headers: {
|
|
1131
1149
|
Authorization: token
|
|
@@ -1137,52 +1155,54 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1137
1155
|
|
|
1138
1156
|
case 4:
|
|
1139
1157
|
case "end":
|
|
1140
|
-
return
|
|
1158
|
+
return _context10.stop();
|
|
1141
1159
|
}
|
|
1142
1160
|
}
|
|
1143
|
-
},
|
|
1161
|
+
}, _callee10);
|
|
1144
1162
|
}));
|
|
1145
1163
|
|
|
1146
1164
|
return function commentRevised() {
|
|
1147
|
-
return
|
|
1165
|
+
return _ref11.apply(this, arguments);
|
|
1148
1166
|
};
|
|
1149
1167
|
}();
|
|
1150
1168
|
|
|
1151
1169
|
var setAssignation = /*#__PURE__*/function () {
|
|
1152
|
-
var
|
|
1170
|
+
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(assignationType, assignationId) {
|
|
1153
1171
|
var concept, productTemp, data;
|
|
1154
|
-
return _regenerator.default.wrap(function
|
|
1172
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1155
1173
|
while (1) {
|
|
1156
|
-
switch (
|
|
1174
|
+
switch (_context11.prev = _context11.next) {
|
|
1157
1175
|
case 0:
|
|
1158
1176
|
concept = "";
|
|
1159
|
-
|
|
1160
|
-
|
|
1177
|
+
_context11.t0 = activeTab;
|
|
1178
|
+
_context11.next = _context11.t0 === "Ficha técnica" ? 4 : _context11.t0 === "Imágenes" ? 6 : 8;
|
|
1161
1179
|
break;
|
|
1162
1180
|
|
|
1163
1181
|
case 4:
|
|
1164
1182
|
concept = "datasheet";
|
|
1165
|
-
return
|
|
1183
|
+
return _context11.abrupt("break", 10);
|
|
1166
1184
|
|
|
1167
1185
|
case 6:
|
|
1168
1186
|
concept = "images";
|
|
1169
|
-
return
|
|
1187
|
+
return _context11.abrupt("break", 10);
|
|
1170
1188
|
|
|
1171
1189
|
case 8:
|
|
1172
1190
|
concept = "description";
|
|
1173
|
-
return
|
|
1191
|
+
return _context11.abrupt("break", 10);
|
|
1174
1192
|
|
|
1175
1193
|
case 10:
|
|
1176
1194
|
productTemp = product;
|
|
1177
1195
|
productTemp.article["id_".concat(concept, "_").concat(assignationType)] = assignationId;
|
|
1178
|
-
data =
|
|
1196
|
+
data = {
|
|
1179
1197
|
articleList: [{
|
|
1180
1198
|
orderId: product.orderId,
|
|
1181
1199
|
articleId: product === null || product === void 0 ? void 0 : product.id_article
|
|
1182
1200
|
}],
|
|
1183
|
-
concept: concept
|
|
1184
|
-
|
|
1185
|
-
|
|
1201
|
+
concept: concept,
|
|
1202
|
+
userId: assignationId
|
|
1203
|
+
};
|
|
1204
|
+
_context11.next = 15;
|
|
1205
|
+
return (0, _axios.default)({
|
|
1186
1206
|
method: "post",
|
|
1187
1207
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
1188
1208
|
data: data,
|
|
@@ -1190,19 +1210,21 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1190
1210
|
Authorization: token
|
|
1191
1211
|
}
|
|
1192
1212
|
});
|
|
1213
|
+
|
|
1214
|
+
case 15:
|
|
1193
1215
|
loadAssignations(productTemp);
|
|
1194
1216
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1195
1217
|
|
|
1196
|
-
case
|
|
1218
|
+
case 17:
|
|
1197
1219
|
case "end":
|
|
1198
|
-
return
|
|
1220
|
+
return _context11.stop();
|
|
1199
1221
|
}
|
|
1200
1222
|
}
|
|
1201
|
-
},
|
|
1223
|
+
}, _callee11);
|
|
1202
1224
|
}));
|
|
1203
1225
|
|
|
1204
1226
|
return function setAssignation(_x5, _x6) {
|
|
1205
|
-
return
|
|
1227
|
+
return _ref12.apply(this, arguments);
|
|
1206
1228
|
};
|
|
1207
1229
|
}();
|
|
1208
1230
|
|
|
@@ -1218,7 +1240,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1218
1240
|
});
|
|
1219
1241
|
}
|
|
1220
1242
|
|
|
1221
|
-
var statusArray = user.is_retailer === 1 ? ["
|
|
1243
|
+
var statusArray = user.is_retailer === 1 ? ["ACA", "RCA"] : ["AP", "RP", "ACA"];
|
|
1222
1244
|
return serv.length > 0 && serv.every(function (item) {
|
|
1223
1245
|
return statusArray.includes(item.status);
|
|
1224
1246
|
});
|
|
@@ -1250,10 +1272,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1250
1272
|
});
|
|
1251
1273
|
|
|
1252
1274
|
if (imgsInBack.length > 0) {
|
|
1253
|
-
var _product$
|
|
1275
|
+
var _product$article5;
|
|
1254
1276
|
|
|
1255
1277
|
var data = {
|
|
1256
|
-
articleId: (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$
|
|
1278
|
+
articleId: (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.id_article),
|
|
1257
1279
|
deleteImages: imgsInBack
|
|
1258
1280
|
};
|
|
1259
1281
|
|
|
@@ -1307,7 +1329,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1307
1329
|
var datasheet_status = product.datasheet_status,
|
|
1308
1330
|
description_status = product.description_status,
|
|
1309
1331
|
images_status = product.images_status;
|
|
1310
|
-
var completionStates = user.is_retailer === 1 ? ["
|
|
1332
|
+
var completionStates = user.is_retailer === 1 ? ["ACA", "Evaluated", "NS"] : ["AP", "Evaluated", "NS"];
|
|
1311
1333
|
var dsEvaluated = completionStates.includes(datasheet_status);
|
|
1312
1334
|
var descsEvaluated = completionStates.includes(description_status);
|
|
1313
1335
|
var imgsEvaluated = completionStates.includes(images_status);
|
|
@@ -1316,155 +1338,204 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1316
1338
|
};
|
|
1317
1339
|
|
|
1318
1340
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
1319
|
-
var
|
|
1320
|
-
var
|
|
1341
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(result) {
|
|
1342
|
+
var _productTemp$id_order;
|
|
1321
1343
|
|
|
1322
|
-
|
|
1344
|
+
var concept, productTemp, articleId, orderId, evalStatus, data, retailerId, res, newProductEdit;
|
|
1345
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1323
1346
|
while (1) {
|
|
1324
|
-
switch (
|
|
1347
|
+
switch (_context12.prev = _context12.next) {
|
|
1325
1348
|
case 0:
|
|
1326
1349
|
setLoading(true);
|
|
1327
|
-
|
|
1350
|
+
concept = getConcept(activeTab);
|
|
1351
|
+
productTemp = product;
|
|
1352
|
+
articleId = productTemp.id_article;
|
|
1353
|
+
orderId = (_productTemp$id_order = productTemp.id_order) !== null && _productTemp$id_order !== void 0 ? _productTemp$id_order : productTemp.orderId;
|
|
1354
|
+
evalStatus = product["".concat(getConcept(activeTab), "_status")] || (product === null || product === void 0 ? void 0 : product.version_status);
|
|
1355
|
+
data = {
|
|
1356
|
+
articleId: articleId,
|
|
1357
|
+
orderId: orderId,
|
|
1358
|
+
concept: concept,
|
|
1359
|
+
evalStatus: evalStatus
|
|
1360
|
+
};
|
|
1328
1361
|
retailerId = activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id;
|
|
1362
|
+
_context12.prev = 8;
|
|
1329
1363
|
|
|
1330
1364
|
if (!result) {
|
|
1331
|
-
|
|
1365
|
+
_context12.next = 17;
|
|
1332
1366
|
break;
|
|
1333
1367
|
}
|
|
1334
1368
|
|
|
1335
|
-
data =
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
concept: getConcept(activeTab),
|
|
1339
|
-
result: result,
|
|
1340
|
-
retailerId: retailerId
|
|
1341
|
-
};
|
|
1342
|
-
_context13.next = 7;
|
|
1369
|
+
data.result = result;
|
|
1370
|
+
data.retailerId = retailerId;
|
|
1371
|
+
_context12.next = 14;
|
|
1343
1372
|
return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1344
1373
|
headers: {
|
|
1345
1374
|
Authorization: token
|
|
1346
1375
|
}
|
|
1347
1376
|
});
|
|
1348
1377
|
|
|
1349
|
-
case
|
|
1350
|
-
|
|
1378
|
+
case 14:
|
|
1379
|
+
res = _context12.sent;
|
|
1380
|
+
_context12.next = 20;
|
|
1351
1381
|
break;
|
|
1352
1382
|
|
|
1353
|
-
case
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
productTemp["".concat(concept, "_status")] = "Evaluated";
|
|
1357
|
-
data = {
|
|
1358
|
-
articleId: product.id_article,
|
|
1359
|
-
orderId: (_product$id_order3 = product.id_order) !== null && _product$id_order3 !== void 0 ? _product$id_order3 : product.orderId,
|
|
1360
|
-
concept: concept
|
|
1361
|
-
};
|
|
1362
|
-
|
|
1363
|
-
_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1383
|
+
case 17:
|
|
1384
|
+
_context12.next = 19;
|
|
1385
|
+
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1364
1386
|
headers: {
|
|
1365
1387
|
Authorization: token
|
|
1366
1388
|
}
|
|
1367
1389
|
});
|
|
1368
1390
|
|
|
1391
|
+
case 19:
|
|
1392
|
+
res = _context12.sent;
|
|
1393
|
+
|
|
1394
|
+
case 20:
|
|
1395
|
+
if (!(res.data.statusCode === 200)) {
|
|
1396
|
+
_context12.next = 31;
|
|
1397
|
+
break;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
productTemp["".concat(concept, "_status")] = "Evaluated";
|
|
1369
1401
|
setProduct(productTemp);
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
product: productTemp
|
|
1374
|
-
});
|
|
1375
|
-
sessionStorage.setItem("productEdit", JSON.stringify({
|
|
1376
|
-
ArticleId: productTemp.id_article,
|
|
1402
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1403
|
+
newProductEdit = {
|
|
1404
|
+
ArticleId: articleId,
|
|
1377
1405
|
idCategory: productTemp.article.id_category,
|
|
1378
1406
|
product: productTemp
|
|
1379
|
-
}
|
|
1407
|
+
};
|
|
1408
|
+
setProductEdit(newProductEdit);
|
|
1409
|
+
sessionStorage.setItem("productEdit", JSON.stringify(newProductEdit));
|
|
1380
1410
|
setOrigin(function (prev) {
|
|
1381
1411
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, "Evaluated"));
|
|
1382
1412
|
});
|
|
1413
|
+
_context12.next = 30;
|
|
1414
|
+
return loadData();
|
|
1383
1415
|
|
|
1384
|
-
case
|
|
1385
|
-
loadData();
|
|
1416
|
+
case 30:
|
|
1386
1417
|
showSurvey && showSurvey(confirmStatusComplete());
|
|
1387
1418
|
|
|
1388
|
-
case
|
|
1419
|
+
case 31:
|
|
1420
|
+
_context12.next = 36;
|
|
1421
|
+
break;
|
|
1422
|
+
|
|
1423
|
+
case 33:
|
|
1424
|
+
_context12.prev = 33;
|
|
1425
|
+
_context12.t0 = _context12["catch"](8);
|
|
1426
|
+
console.log(_context12.t0);
|
|
1427
|
+
|
|
1428
|
+
case 36:
|
|
1389
1429
|
case "end":
|
|
1390
|
-
return
|
|
1430
|
+
return _context12.stop();
|
|
1391
1431
|
}
|
|
1392
1432
|
}
|
|
1393
|
-
},
|
|
1433
|
+
}, _callee12, null, [[8, 33]]);
|
|
1394
1434
|
}));
|
|
1395
1435
|
|
|
1396
1436
|
return function sendEvaluation(_x7) {
|
|
1397
|
-
return
|
|
1437
|
+
return _ref13.apply(this, arguments);
|
|
1398
1438
|
};
|
|
1399
1439
|
}();
|
|
1400
1440
|
|
|
1401
1441
|
var validateAll = /*#__PURE__*/function () {
|
|
1402
|
-
var
|
|
1403
|
-
var evaluationArray, sendAll, conceptArray;
|
|
1404
|
-
return _regenerator.default.wrap(function
|
|
1442
|
+
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
|
|
1443
|
+
var evaluationArray, sendAll, conceptArray, productTemp;
|
|
1444
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
1405
1445
|
while (1) {
|
|
1406
|
-
switch (
|
|
1446
|
+
switch (_context13.prev = _context13.next) {
|
|
1407
1447
|
case 0:
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
+
_context13.prev = 0;
|
|
1449
|
+
setLoading(true);
|
|
1450
|
+
evaluationArray = [];
|
|
1451
|
+
sendAll = [];
|
|
1452
|
+
conceptArray = ["description", "datasheet", "images"];
|
|
1453
|
+
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1454
|
+
var _product$id_order2;
|
|
1455
|
+
|
|
1456
|
+
var data = {
|
|
1457
|
+
articleId: product.id_article,
|
|
1458
|
+
orderId: (_product$id_order2 = product.id_order) !== null && _product$id_order2 !== void 0 ? _product$id_order2 : product.orderId,
|
|
1459
|
+
concept: ret.service,
|
|
1460
|
+
result: result,
|
|
1461
|
+
retailerId: ret.id_retailer
|
|
1462
|
+
};
|
|
1463
|
+
evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1464
|
+
headers: {
|
|
1465
|
+
Authorization: token
|
|
1466
|
+
}
|
|
1467
|
+
}));
|
|
1468
|
+
});
|
|
1469
|
+
_context13.next = 8;
|
|
1470
|
+
return Promise.all(evaluationArray);
|
|
1471
|
+
|
|
1472
|
+
case 8:
|
|
1473
|
+
conceptArray === null || conceptArray === void 0 ? void 0 : conceptArray.forEach(function (concept) {
|
|
1474
|
+
var _product$id_order3;
|
|
1475
|
+
|
|
1476
|
+
var data = {
|
|
1477
|
+
articleId: product.id_article,
|
|
1478
|
+
orderId: (_product$id_order3 = product.id_order) !== null && _product$id_order3 !== void 0 ? _product$id_order3 : product.orderId,
|
|
1479
|
+
concept: concept
|
|
1480
|
+
};
|
|
1481
|
+
sendAll.push(_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1482
|
+
headers: {
|
|
1483
|
+
Authorization: token
|
|
1484
|
+
}
|
|
1485
|
+
}));
|
|
1486
|
+
});
|
|
1487
|
+
_context13.next = 11;
|
|
1488
|
+
return Promise.all(sendAll);
|
|
1489
|
+
|
|
1490
|
+
case 11:
|
|
1491
|
+
productTemp = product;
|
|
1492
|
+
productTemp.article_status = "".concat(result, "CA");
|
|
1493
|
+
productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "CA");
|
|
1494
|
+
productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result, "CA");
|
|
1495
|
+
productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "CA");
|
|
1496
|
+
setProduct(productTemp);
|
|
1497
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1498
|
+
setProductEdit({
|
|
1499
|
+
ArticleId: productTemp.id_article,
|
|
1500
|
+
idCategory: productTemp.article.id_category,
|
|
1501
|
+
product: productTemp
|
|
1502
|
+
});
|
|
1503
|
+
sessionStorage.setItem("productEdit", JSON.stringify({
|
|
1504
|
+
ArticleId: productTemp.id_article,
|
|
1505
|
+
idCategory: productTemp.article.id_category,
|
|
1506
|
+
product: productTemp
|
|
1507
|
+
}));
|
|
1508
|
+
_context13.next = 22;
|
|
1509
|
+
return loadData();
|
|
1510
|
+
|
|
1511
|
+
case 22:
|
|
1512
|
+
_context13.next = 27;
|
|
1513
|
+
break;
|
|
1448
1514
|
|
|
1449
|
-
case
|
|
1515
|
+
case 24:
|
|
1516
|
+
_context13.prev = 24;
|
|
1517
|
+
_context13.t0 = _context13["catch"](0);
|
|
1518
|
+
console.log(_context13.t0);
|
|
1519
|
+
|
|
1520
|
+
case 27:
|
|
1450
1521
|
case "end":
|
|
1451
|
-
return
|
|
1522
|
+
return _context13.stop();
|
|
1452
1523
|
}
|
|
1453
1524
|
}
|
|
1454
|
-
},
|
|
1525
|
+
}, _callee13, null, [[0, 24]]);
|
|
1455
1526
|
}));
|
|
1456
1527
|
|
|
1457
1528
|
return function validateAll(_x8) {
|
|
1458
|
-
return
|
|
1529
|
+
return _ref14.apply(this, arguments);
|
|
1459
1530
|
};
|
|
1460
1531
|
}();
|
|
1461
1532
|
|
|
1462
1533
|
var evaluationToRetailer = /*#__PURE__*/function () {
|
|
1463
|
-
var
|
|
1534
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
|
|
1464
1535
|
var data, prod, statusComplete;
|
|
1465
|
-
return _regenerator.default.wrap(function
|
|
1536
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
1466
1537
|
while (1) {
|
|
1467
|
-
switch (
|
|
1538
|
+
switch (_context14.prev = _context14.next) {
|
|
1468
1539
|
case 0:
|
|
1469
1540
|
data = {
|
|
1470
1541
|
articleId: product.id_article,
|
|
@@ -1472,7 +1543,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1472
1543
|
versionId: product.version,
|
|
1473
1544
|
status: result
|
|
1474
1545
|
};
|
|
1475
|
-
|
|
1546
|
+
_context14.next = 3;
|
|
1476
1547
|
return _axios.default.put("".concat(process.env.REACT_APP_RETAILER_REQUEST), data, {
|
|
1477
1548
|
headers: {
|
|
1478
1549
|
Authorization: token
|
|
@@ -1481,7 +1552,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1481
1552
|
|
|
1482
1553
|
case 3:
|
|
1483
1554
|
prod = productEdit;
|
|
1484
|
-
statusComplete = user.is_retailer ? "".concat(result, "
|
|
1555
|
+
statusComplete = user.is_retailer ? "".concat(result, "CA") : "".concat(result, "P");
|
|
1485
1556
|
prod.product.datasheet_status = statusComplete;
|
|
1486
1557
|
prod.product.description_status = statusComplete;
|
|
1487
1558
|
prod.product.images_status = statusComplete;
|
|
@@ -1490,33 +1561,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1490
1561
|
sessionStorage.setItem("productEdit", JSON.stringify(prod));
|
|
1491
1562
|
setProduct(prod);
|
|
1492
1563
|
setShowGenericModal && setShowGenericModal(false);
|
|
1493
|
-
|
|
1564
|
+
_context14.next = 15;
|
|
1565
|
+
return loadData();
|
|
1494
1566
|
|
|
1495
|
-
case
|
|
1567
|
+
case 15:
|
|
1496
1568
|
case "end":
|
|
1497
|
-
return
|
|
1569
|
+
return _context14.stop();
|
|
1498
1570
|
}
|
|
1499
1571
|
}
|
|
1500
|
-
},
|
|
1572
|
+
}, _callee14);
|
|
1501
1573
|
}));
|
|
1502
1574
|
|
|
1503
1575
|
return function evaluationToRetailer(_x9) {
|
|
1504
|
-
return
|
|
1576
|
+
return _ref15.apply(this, arguments);
|
|
1505
1577
|
};
|
|
1506
1578
|
}();
|
|
1507
1579
|
|
|
1508
1580
|
var getSectionStatus = function getSectionStatus() {
|
|
1509
1581
|
var concept = getConcept(activeTab);
|
|
1510
|
-
return ["AA", "AP", "
|
|
1582
|
+
return ["AA", "AP", "R", "CA", "RCA"].includes(productEdit.product["".concat(concept, "_status")]);
|
|
1511
1583
|
};
|
|
1512
1584
|
|
|
1513
1585
|
var enableActions = function enableActions(versionStatus) {
|
|
1514
1586
|
try {
|
|
1515
|
-
|
|
1516
|
-
if (userIsRetailer) return false;
|
|
1587
|
+
if (user.is_retailer) return false;
|
|
1517
1588
|
|
|
1518
1589
|
if (versionStatus) {
|
|
1519
|
-
return ["AP", "
|
|
1590
|
+
return ["AP", "ACA", "RCA", null].includes(versionStatus);
|
|
1520
1591
|
}
|
|
1521
1592
|
|
|
1522
1593
|
return true;
|
|
@@ -1526,6 +1597,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1526
1597
|
}
|
|
1527
1598
|
};
|
|
1528
1599
|
|
|
1600
|
+
(0, _react.useEffect)(function () {
|
|
1601
|
+
setSaving(loading);
|
|
1602
|
+
}, [loading]);
|
|
1529
1603
|
var slidefront = [{
|
|
1530
1604
|
slide: _slide.default,
|
|
1531
1605
|
description: "Creamos tu contenido, y todo lo que haga falta para tu producto, cada sección puedes socilitar contenido enriquecido, y nosotros lo haremos por ti."
|
|
@@ -1543,10 +1617,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1543
1617
|
title: "Bienvenido al modo Content-oh!",
|
|
1544
1618
|
description: "Finalmente elige la forma de pago que más te guste, procede con el pago y listo."
|
|
1545
1619
|
}];
|
|
1546
|
-
(0, _react.useEffect)(function () {
|
|
1547
|
-
setSaving(loading);
|
|
1548
|
-
}, [loading]);
|
|
1549
|
-
console.log(user.is_retailer === 1, product.id_order || product.orderId, isRevision(), getSectionStatus(), "XD");
|
|
1550
1620
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
1551
1621
|
headerTop: headerTop,
|
|
1552
1622
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
@@ -1584,12 +1654,64 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1584
1654
|
setActiveRetailer: setActiveRetailer,
|
|
1585
1655
|
showValidationButtons: isRevision() && getSectionStatus(),
|
|
1586
1656
|
servicesData: servicesData ? servicesData : null,
|
|
1587
|
-
showApproveRejectAll:
|
|
1657
|
+
showApproveRejectAll: isRevision() && getSectionStatus(),
|
|
1588
1658
|
approveAll: function approveAll() {
|
|
1589
|
-
|
|
1659
|
+
if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
1660
|
+
setDataGenericModal(function (prev) {
|
|
1661
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1662
|
+
button2: {
|
|
1663
|
+
name: "Continuar",
|
|
1664
|
+
action: function action() {
|
|
1665
|
+
return evaluationToRetailer("A");
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1669
|
+
});
|
|
1670
|
+
setShowGenericModal(true);
|
|
1671
|
+
} else if (user.is_retailer) {
|
|
1672
|
+
if (product.id_order || product.orderId) {
|
|
1673
|
+
validateAll("A");
|
|
1674
|
+
} else {
|
|
1675
|
+
setDataGenericModal(function (prev) {
|
|
1676
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1677
|
+
button2: {
|
|
1678
|
+
name: "Continuar",
|
|
1679
|
+
action: function action() {
|
|
1680
|
+
return evaluationToRetailer("A");
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
});
|
|
1684
|
+
});
|
|
1685
|
+
setShowGenericModal(true);
|
|
1686
|
+
}
|
|
1687
|
+
} else {
|
|
1688
|
+
validateAll("A");
|
|
1689
|
+
}
|
|
1590
1690
|
},
|
|
1591
1691
|
rejectAll: function rejectAll() {
|
|
1592
|
-
|
|
1692
|
+
if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
1693
|
+
return;
|
|
1694
|
+
} else if (user.is_retailer) {
|
|
1695
|
+
if (product.id_order || product.orderId) {
|
|
1696
|
+
validateAll("R");
|
|
1697
|
+
setModalViewError(true);
|
|
1698
|
+
} else {
|
|
1699
|
+
setDataGenericModal(function (prev) {
|
|
1700
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1701
|
+
button2: {
|
|
1702
|
+
name: "Continuar",
|
|
1703
|
+
action: function action() {
|
|
1704
|
+
return evaluationToRetailer("R");
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
});
|
|
1708
|
+
});
|
|
1709
|
+
setShowGenericModal(true);
|
|
1710
|
+
}
|
|
1711
|
+
} else {
|
|
1712
|
+
validateAll("R");
|
|
1713
|
+
setModalViewError(true);
|
|
1714
|
+
}
|
|
1593
1715
|
},
|
|
1594
1716
|
approve: function approve() {
|
|
1595
1717
|
if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
@@ -1604,53 +1726,49 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1604
1726
|
});
|
|
1605
1727
|
});
|
|
1606
1728
|
setShowGenericModal(true);
|
|
1607
|
-
} else {
|
|
1608
|
-
if (
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
return evaluationToRetailer("A");
|
|
1618
|
-
}
|
|
1729
|
+
} else if (user.is_retailer) {
|
|
1730
|
+
if (product.id_order || product.orderId) {
|
|
1731
|
+
sendEvaluation("A");
|
|
1732
|
+
} else {
|
|
1733
|
+
setDataGenericModal(function (prev) {
|
|
1734
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1735
|
+
button2: {
|
|
1736
|
+
name: "Continuar",
|
|
1737
|
+
action: function action() {
|
|
1738
|
+
return evaluationToRetailer("A");
|
|
1619
1739
|
}
|
|
1620
|
-
}
|
|
1740
|
+
}
|
|
1621
1741
|
});
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
} else {
|
|
1625
|
-
sendEvaluation("A");
|
|
1742
|
+
});
|
|
1743
|
+
setShowGenericModal(true);
|
|
1626
1744
|
}
|
|
1745
|
+
} else {
|
|
1746
|
+
sendEvaluation("A");
|
|
1627
1747
|
}
|
|
1628
1748
|
},
|
|
1629
1749
|
reject: function reject() {
|
|
1630
1750
|
if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
1631
1751
|
return;
|
|
1632
|
-
} else {
|
|
1633
|
-
if (
|
|
1634
|
-
if (product.id_order || product.orderId) {
|
|
1635
|
-
sendEvaluation("R");
|
|
1636
|
-
setModalViewError(true);
|
|
1637
|
-
} else {
|
|
1638
|
-
setDataGenericModal(function (prev) {
|
|
1639
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1640
|
-
button2: {
|
|
1641
|
-
name: "Continuar",
|
|
1642
|
-
action: function action() {
|
|
1643
|
-
return evaluationToRetailer("R");
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
});
|
|
1647
|
-
});
|
|
1648
|
-
setShowGenericModal(true);
|
|
1649
|
-
}
|
|
1650
|
-
} else {
|
|
1752
|
+
} else if (user.is_retailer) {
|
|
1753
|
+
if (product.id_order || product.orderId) {
|
|
1651
1754
|
sendEvaluation("R");
|
|
1652
1755
|
setModalViewError(true);
|
|
1756
|
+
} else {
|
|
1757
|
+
setDataGenericModal(function (prev) {
|
|
1758
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1759
|
+
button2: {
|
|
1760
|
+
name: "Continuar",
|
|
1761
|
+
action: function action() {
|
|
1762
|
+
return evaluationToRetailer("R");
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
});
|
|
1766
|
+
});
|
|
1767
|
+
setShowGenericModal(true);
|
|
1653
1768
|
}
|
|
1769
|
+
} else {
|
|
1770
|
+
sendEvaluation("R");
|
|
1771
|
+
setModalViewError(true);
|
|
1654
1772
|
}
|
|
1655
1773
|
}
|
|
1656
1774
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
@@ -1729,9 +1847,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1729
1847
|
headerType: "input-name-header"
|
|
1730
1848
|
}))]
|
|
1731
1849
|
})
|
|
1732
|
-
}), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.
|
|
1850
|
+
}), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1733
1851
|
className: "commentary-box",
|
|
1734
|
-
children:
|
|
1852
|
+
children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1735
1853
|
className: "commentary",
|
|
1736
1854
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1737
1855
|
label: "Caja de Comentario",
|
|
@@ -1757,31 +1875,23 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1757
1875
|
reviewed: crossComment
|
|
1758
1876
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1759
1877
|
buttonType: "circular-button accept-button",
|
|
1760
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1761
|
-
return _regenerator.default.wrap(function
|
|
1878
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1879
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1762
1880
|
while (1) {
|
|
1763
|
-
switch (
|
|
1881
|
+
switch (_context15.prev = _context15.next) {
|
|
1764
1882
|
case 0:
|
|
1765
1883
|
setCrossComment(true);
|
|
1766
1884
|
commentRevised();
|
|
1767
1885
|
|
|
1768
1886
|
case 2:
|
|
1769
1887
|
case "end":
|
|
1770
|
-
return
|
|
1888
|
+
return _context15.stop();
|
|
1771
1889
|
}
|
|
1772
1890
|
}
|
|
1773
|
-
},
|
|
1891
|
+
}, _callee15);
|
|
1774
1892
|
}))
|
|
1775
1893
|
})]
|
|
1776
|
-
})
|
|
1777
|
-
buttonType: evaluationComplete(activeTab) && (productEdit.product.id_order || productEdit.product.orderId) ? "general-green-button" : "general-button-disabled",
|
|
1778
|
-
label: "Enviar evaluación",
|
|
1779
|
-
onClick: function onClick() {
|
|
1780
|
-
//setModalSent(true);
|
|
1781
|
-
sendEvaluation();
|
|
1782
|
-
setMessage("\xA1Evaluaci\xF3n de ".concat(activeTab, " completada!"));
|
|
1783
|
-
}
|
|
1784
|
-
})]
|
|
1894
|
+
})
|
|
1785
1895
|
}) : revision ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1786
1896
|
className: "required-inputs-message",
|
|
1787
1897
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|