contentoh-components-library 21.3.54 → 21.3.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.development +0 -2
- package/dist/assets/fonts/roboto/LICENSE.txt +202 -0
- package/dist/components/atoms/ButtonV2/styles.js +1 -1
- package/dist/components/atoms/Status/styles.js +1 -1
- package/dist/components/atoms/VerticalSideMenuMainPage/index.js +23 -18
- package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +4 -4
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/organisms/Chat/Chat.stories.js +1 -21
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +191 -343
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +3 -48
- package/dist/components/organisms/DashboardMetric/dashboardMetricUtils.js +0 -27
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/GlobalModal/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/utils/Table/styles.js +1 -1
- package/dist/components/pages/Dashboard/Dashboard.stories.js +50 -31
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +81 -198
- package/dist/components/pages/ProviderProductEdition/index.js +429 -725
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +139 -86
- package/dist/components/pages/RetailerProductEdition/index.js +279 -268
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/index.js +0 -13
- package/package.json +6 -7
- package/src/components/atoms/ButtonV2/styles.js +1 -1
- package/src/components/atoms/Status/styles.js +0 -4
- package/src/components/atoms/VerticalSideMenuMainPage/index.js +22 -18
- package/src/components/atoms/VerticalSideMenuMainPage/styles.js +4 -3
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/organisms/Chat/Chat.stories.js +0 -21
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
- package/src/components/organisms/Chat/ContentChat/index.js +6 -81
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +3 -47
- package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +1 -18
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/GlobalModal/styles.js +0 -10
- package/src/components/organisms/OrderDetail/index.js +0 -1
- package/src/components/organisms/OrderDetail/styles.js +1 -1
- package/src/components/organisms/OrderDetail/utils/Table/styles.js +1 -0
- package/src/components/pages/Dashboard/Dashboard.stories.js +55 -31
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +88 -214
- package/src/components/pages/ProviderProductEdition/index.js +160 -323
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +146 -89
- package/src/components/pages/RetailerProductEdition/index.js +138 -112
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/index.js +0 -1
- package/src/components/organisms/TableResizable/TableResizable.stories.js +0 -17
- package/src/components/organisms/TableResizable/index.js +0 -119
- package/src/components/organisms/TableResizable/styles.js +0 -133
- package/src/components/organisms/TableResizable/utils.js +0 -46
|
@@ -53,6 +53,12 @@ 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
|
+
|
|
56
62
|
var _index = require("../../molecules/TagAndInput/index");
|
|
57
63
|
|
|
58
64
|
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
@@ -93,12 +99,6 @@ var _VersionSelector = require("../../organisms/VersionSelector");
|
|
|
93
99
|
|
|
94
100
|
var _customHooks = require("../../../global-files/customHooks");
|
|
95
101
|
|
|
96
|
-
var _utils = require("../RetailerProductEdition/utils");
|
|
97
|
-
|
|
98
|
-
var _Modal = require("../../organisms/Modal");
|
|
99
|
-
|
|
100
|
-
var _ButtonV = require("../../atoms/ButtonV2");
|
|
101
|
-
|
|
102
102
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
103
103
|
|
|
104
104
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -212,7 +212,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
212
212
|
});
|
|
213
213
|
|
|
214
214
|
var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
215
|
-
var _product$retailers, _product$retailersAva, _location$state, _location$state2,
|
|
215
|
+
var _product$retailers, _product$retailersAva, _location$state, _location$state2, _datasheets$, _datasheets$$data;
|
|
216
216
|
|
|
217
217
|
var tabsSections = _ref.tabsSections,
|
|
218
218
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -227,8 +227,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
227
227
|
revision = _ref$revision === void 0 ? false : _ref$revision,
|
|
228
228
|
setShowContentohRequestModal = _ref.setShowContentohRequestModal,
|
|
229
229
|
showSurvey = _ref.showSurvey,
|
|
230
|
-
company = _ref.company
|
|
231
|
-
addToCart = _ref.addToCart;
|
|
230
|
+
company = _ref.company;
|
|
232
231
|
|
|
233
232
|
var _useState = (0, _react.useState)("Descripción"),
|
|
234
233
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -396,66 +395,66 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
396
395
|
productEdit = _useState38[0],
|
|
397
396
|
setProductEdit = _useState38[1];
|
|
398
397
|
|
|
399
|
-
var _useState39 = (0, _react.useState)(
|
|
398
|
+
var _useState39 = (0, _react.useState)(null),
|
|
400
399
|
_useState40 = (0, _slicedToArray2.default)(_useState39, 2),
|
|
401
|
-
|
|
402
|
-
|
|
400
|
+
icon = _useState40[0],
|
|
401
|
+
setIcon = _useState40[1];
|
|
403
402
|
|
|
404
|
-
var _useState41 = (0, _react.useState)(
|
|
405
|
-
_useState42 = (0, _slicedToArray2.default)(_useState41,
|
|
406
|
-
|
|
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];
|
|
407
407
|
|
|
408
|
-
var _useState43 = (0, _react.useState)(
|
|
409
|
-
_useState44 = (0, _slicedToArray2.default)(_useState43,
|
|
410
|
-
|
|
411
|
-
setComment = _useState44[1];
|
|
408
|
+
var _useState43 = (0, _react.useState)({}),
|
|
409
|
+
_useState44 = (0, _slicedToArray2.default)(_useState43, 1),
|
|
410
|
+
comments = _useState44[0];
|
|
412
411
|
|
|
413
|
-
var _useState45 = (0, _react.useState)(
|
|
412
|
+
var _useState45 = (0, _react.useState)(""),
|
|
414
413
|
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
415
|
-
|
|
416
|
-
|
|
414
|
+
comment = _useState46[0],
|
|
415
|
+
setComment = _useState46[1];
|
|
417
416
|
|
|
418
|
-
var _useState47 = (0, _react.useState)(
|
|
417
|
+
var _useState47 = (0, _react.useState)(false),
|
|
419
418
|
_useState48 = (0, _slicedToArray2.default)(_useState47, 2),
|
|
420
|
-
|
|
421
|
-
|
|
419
|
+
crossComment = _useState48[0],
|
|
420
|
+
setCrossComment = _useState48[1];
|
|
422
421
|
|
|
423
|
-
var _useState49 = (0, _react.useState)(
|
|
422
|
+
var _useState49 = (0, _react.useState)([]),
|
|
424
423
|
_useState50 = (0, _slicedToArray2.default)(_useState49, 2),
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
userGroups = _useState50[0],
|
|
425
|
+
setUserGroups = _useState50[1];
|
|
427
426
|
|
|
428
|
-
var _useState51 = (0, _react.useState)(
|
|
427
|
+
var _useState51 = (0, _react.useState)({}),
|
|
429
428
|
_useState52 = (0, _slicedToArray2.default)(_useState51, 2),
|
|
430
|
-
|
|
431
|
-
|
|
429
|
+
assig = _useState52[0],
|
|
430
|
+
setAssig = _useState52[1];
|
|
432
431
|
|
|
433
432
|
var _useState53 = (0, _react.useState)([]),
|
|
434
433
|
_useState54 = (0, _slicedToArray2.default)(_useState53, 2),
|
|
435
|
-
|
|
436
|
-
|
|
434
|
+
selectedImages = _useState54[0],
|
|
435
|
+
setSelectedImages = _useState54[1];
|
|
437
436
|
|
|
438
|
-
var _useState55 = (0, _react.useState)(
|
|
437
|
+
var _useState55 = (0, _react.useState)([]),
|
|
439
438
|
_useState56 = (0, _slicedToArray2.default)(_useState55, 2),
|
|
440
|
-
|
|
441
|
-
|
|
439
|
+
componentsArray = _useState56[0],
|
|
440
|
+
setComponentsArray = _useState56[1];
|
|
442
441
|
|
|
443
|
-
var
|
|
444
|
-
|
|
445
|
-
var _useState57 = (0, _react.useState)(true),
|
|
442
|
+
var _useState57 = (0, _react.useState)(false),
|
|
446
443
|
_useState58 = (0, _slicedToArray2.default)(_useState57, 2),
|
|
447
|
-
|
|
448
|
-
|
|
444
|
+
checkAll = _useState58[0],
|
|
445
|
+
setCheckAll = _useState58[1];
|
|
449
446
|
|
|
450
|
-
var
|
|
447
|
+
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
448
|
+
|
|
449
|
+
var _useState59 = (0, _react.useState)(true),
|
|
451
450
|
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
452
|
-
|
|
453
|
-
|
|
451
|
+
loading = _useState60[0],
|
|
452
|
+
setLoading = _useState60[1];
|
|
454
453
|
|
|
455
454
|
var _useState61 = (0, _react.useState)(false),
|
|
456
455
|
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
457
|
-
|
|
458
|
-
|
|
456
|
+
validatedAll = _useState62[0],
|
|
457
|
+
setValidatedAll = _useState62[1];
|
|
459
458
|
|
|
460
459
|
var originProp = location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.origin;
|
|
461
460
|
|
|
@@ -473,12 +472,29 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
473
472
|
inCart = _useState66[0],
|
|
474
473
|
setInCart = _useState66[1];
|
|
475
474
|
|
|
476
|
-
var _useState67 = (0, _react.useState)(
|
|
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];
|
|
484
|
+
|
|
485
|
+
var _useState71 = (0, _react.useState)(false),
|
|
486
|
+
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
487
|
+
showGenericModal = _useState72[0],
|
|
488
|
+
setShowGenericModal = _useState72[1];
|
|
489
|
+
|
|
490
|
+
var _useState73 = (0, _react.useState)({
|
|
477
491
|
message: "¿Estás seguro de continuar?",
|
|
478
492
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
479
493
|
button1: {
|
|
480
494
|
name: "Cerrar",
|
|
481
|
-
action:
|
|
495
|
+
action: function action() {
|
|
496
|
+
return setModalViewTextArea(false);
|
|
497
|
+
}
|
|
482
498
|
},
|
|
483
499
|
button2: {
|
|
484
500
|
name: "Continuar",
|
|
@@ -488,378 +504,35 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
488
504
|
},
|
|
489
505
|
img: _defaultProfileImage.default
|
|
490
506
|
}),
|
|
491
|
-
|
|
492
|
-
dataGenericModal =
|
|
493
|
-
setDataGenericModal =
|
|
507
|
+
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
508
|
+
dataGenericModal = _useState74[0],
|
|
509
|
+
setDataGenericModal = _useState74[1];
|
|
494
510
|
|
|
495
|
-
var
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
511
|
+
var _useState75 = (0, _react.useState)(false),
|
|
512
|
+
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
513
|
+
modalViewTextArea = _useState76[0],
|
|
514
|
+
setModalViewTextArea = _useState76[1];
|
|
499
515
|
|
|
500
|
-
var
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
516
|
+
var _useState77 = (0, _react.useState)(null),
|
|
517
|
+
_useState78 = (0, _slicedToArray2.default)(_useState77, 2),
|
|
518
|
+
socketType = _useState78[0],
|
|
519
|
+
setSocketType = _useState78[1];
|
|
504
520
|
|
|
505
|
-
var
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
521
|
+
var _useState79 = (0, _react.useState)(loading),
|
|
522
|
+
_useState80 = (0, _slicedToArray2.default)(_useState79, 2),
|
|
523
|
+
saving = _useState80[0],
|
|
524
|
+
setSaving = _useState80[1];
|
|
525
|
+
|
|
526
|
+
var _useState81 = (0, _react.useState)(product.statusByRetailer),
|
|
527
|
+
_useState82 = (0, _slicedToArray2.default)(_useState81, 2),
|
|
528
|
+
retailerStatus = _useState82[0],
|
|
529
|
+
setRetailerStatus = _useState82[1];
|
|
509
530
|
|
|
510
531
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
511
532
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
512
533
|
showVersionSelector = _useCloseModal2[0],
|
|
513
534
|
setShowVersionSelector = _useCloseModal2[1];
|
|
514
535
|
|
|
515
|
-
var _useState75 = (0, _react.useState)(),
|
|
516
|
-
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
517
|
-
globalModal = _useState76[0],
|
|
518
|
-
setGlobalModal = _useState76[1];
|
|
519
|
-
|
|
520
|
-
var updateAuditStatus = /*#__PURE__*/function () {
|
|
521
|
-
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
522
|
-
var productTemp, retailerStatusCopy, conceptArray;
|
|
523
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
524
|
-
while (1) {
|
|
525
|
-
switch (_context2.prev = _context2.next) {
|
|
526
|
-
case 0:
|
|
527
|
-
productTemp = product;
|
|
528
|
-
productTemp.article_status = status;
|
|
529
|
-
productTemp.datasheet_status = status;
|
|
530
|
-
productTemp.description_status = status;
|
|
531
|
-
productTemp.images_status = status;
|
|
532
|
-
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
533
|
-
conceptArray = ["description", "datasheet", "images"];
|
|
534
|
-
Object.keys(retailerStatusCopy).forEach(function (key) {
|
|
535
|
-
conceptArray.forEach(function (concept) {
|
|
536
|
-
if (retailerStatusCopy[key][concept]) {
|
|
537
|
-
retailerStatusCopy[key][concept] = status;
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
});
|
|
541
|
-
setRetailerStatus(retailerStatusCopy);
|
|
542
|
-
productTemp.statusByRetailer = retailerStatusCopy;
|
|
543
|
-
setProduct(productTemp);
|
|
544
|
-
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
545
|
-
setProductEdit({
|
|
546
|
-
ArticleId: productTemp.id_article,
|
|
547
|
-
idCategory: productTemp.article.id_category,
|
|
548
|
-
product: productTemp
|
|
549
|
-
});
|
|
550
|
-
sessionStorage.setItem("productEdit", JSON.stringify({
|
|
551
|
-
ArticleId: productTemp.id_article,
|
|
552
|
-
idCategory: productTemp.article.id_category,
|
|
553
|
-
product: productTemp
|
|
554
|
-
}));
|
|
555
|
-
_context2.next = 16;
|
|
556
|
-
return loadData();
|
|
557
|
-
|
|
558
|
-
case 16:
|
|
559
|
-
case "end":
|
|
560
|
-
return _context2.stop();
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
}, _callee2);
|
|
564
|
-
}));
|
|
565
|
-
|
|
566
|
-
return function updateAuditStatus(_x2) {
|
|
567
|
-
return _ref3.apply(this, arguments);
|
|
568
|
-
};
|
|
569
|
-
}();
|
|
570
|
-
|
|
571
|
-
var addCart = /*#__PURE__*/function () {
|
|
572
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(retailers) {
|
|
573
|
-
var article, version, articleToOrder, modatlType, resCart;
|
|
574
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
575
|
-
while (1) {
|
|
576
|
-
switch (_context3.prev = _context3.next) {
|
|
577
|
-
case 0:
|
|
578
|
-
article = product.article, version = product.version;
|
|
579
|
-
articleToOrder = [{
|
|
580
|
-
articleId: article.id_article,
|
|
581
|
-
version: version,
|
|
582
|
-
userId: user.id_user,
|
|
583
|
-
discount: 0,
|
|
584
|
-
subtotal: 0,
|
|
585
|
-
companyId: user.id_company,
|
|
586
|
-
datasheet: retailers,
|
|
587
|
-
description: retailers,
|
|
588
|
-
image: retailers,
|
|
589
|
-
attributeTranslations: false,
|
|
590
|
-
descriptionTranslations: false,
|
|
591
|
-
build: "[]",
|
|
592
|
-
manual: "[]",
|
|
593
|
-
userCreated: user.id_user
|
|
594
|
-
}];
|
|
595
|
-
modatlType = "addedToCartError";
|
|
596
|
-
|
|
597
|
-
if (!addToCart) {
|
|
598
|
-
_context3.next = 8;
|
|
599
|
-
break;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
_context3.next = 6;
|
|
603
|
-
return addToCart({
|
|
604
|
-
data: articleToOrder
|
|
605
|
-
});
|
|
606
|
-
|
|
607
|
-
case 6:
|
|
608
|
-
resCart = _context3.sent;
|
|
609
|
-
|
|
610
|
-
if (resCart.data.statusCode === 200) {
|
|
611
|
-
modatlType = "addedToCart";
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
case 8:
|
|
615
|
-
showGlobalModal(modatlType);
|
|
616
|
-
|
|
617
|
-
case 9:
|
|
618
|
-
case "end":
|
|
619
|
-
return _context3.stop();
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
}, _callee3);
|
|
623
|
-
}));
|
|
624
|
-
|
|
625
|
-
return function addCart(_x3) {
|
|
626
|
-
return _ref4.apply(this, arguments);
|
|
627
|
-
};
|
|
628
|
-
}();
|
|
629
|
-
|
|
630
|
-
var closeGlobalModal = function closeGlobalModal() {
|
|
631
|
-
return setGlobalModal();
|
|
632
|
-
};
|
|
633
|
-
|
|
634
|
-
var seenByProvider = /*#__PURE__*/function () {
|
|
635
|
-
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
636
|
-
var _productTemp$id_order;
|
|
637
|
-
|
|
638
|
-
var productTemp, articleId, orderId, promises, conceptArray;
|
|
639
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
640
|
-
while (1) {
|
|
641
|
-
switch (_context4.prev = _context4.next) {
|
|
642
|
-
case 0:
|
|
643
|
-
productTemp = product;
|
|
644
|
-
articleId = productTemp.id_article;
|
|
645
|
-
orderId = (_productTemp$id_order = productTemp.id_order) !== null && _productTemp$id_order !== void 0 ? _productTemp$id_order : productTemp.orderId;
|
|
646
|
-
promises = [];
|
|
647
|
-
conceptArray = ["description", "datasheet", "images"];
|
|
648
|
-
conceptArray.forEach(function (concept) {
|
|
649
|
-
var sectionStatusKey = "".concat(concept, "_status");
|
|
650
|
-
var evalStatus = product[sectionStatusKey] || (product === null || product === void 0 ? void 0 : product.version_status);
|
|
651
|
-
var data = {
|
|
652
|
-
articleId: articleId,
|
|
653
|
-
orderId: orderId,
|
|
654
|
-
concept: concept,
|
|
655
|
-
evalStatus: evalStatus
|
|
656
|
-
};
|
|
657
|
-
promises.push(_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
658
|
-
headers: {
|
|
659
|
-
Authorization: token
|
|
660
|
-
}
|
|
661
|
-
}));
|
|
662
|
-
});
|
|
663
|
-
_context4.next = 8;
|
|
664
|
-
return Promise.all(promises);
|
|
665
|
-
|
|
666
|
-
case 8:
|
|
667
|
-
closeGlobalModal();
|
|
668
|
-
_context4.next = 11;
|
|
669
|
-
return updateAuditStatus("FAP");
|
|
670
|
-
|
|
671
|
-
case 11:
|
|
672
|
-
case "end":
|
|
673
|
-
return _context4.stop();
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}, _callee4);
|
|
677
|
-
}));
|
|
678
|
-
|
|
679
|
-
return function seenByProvider() {
|
|
680
|
-
return _ref5.apply(this, arguments);
|
|
681
|
-
};
|
|
682
|
-
}();
|
|
683
|
-
|
|
684
|
-
var showGlobalModal = (0, _react.useCallback)(function (type) {
|
|
685
|
-
var formatter = new Intl.ListFormat("es", {
|
|
686
|
-
type: "conjunction"
|
|
687
|
-
});
|
|
688
|
-
|
|
689
|
-
switch (type) {
|
|
690
|
-
case "generic":
|
|
691
|
-
setGlobalModal(dataGenericModal);
|
|
692
|
-
break;
|
|
693
|
-
|
|
694
|
-
case "commentsSent":
|
|
695
|
-
setGlobalModal({
|
|
696
|
-
message: "Gracias, tus comentarios fueron entregados.",
|
|
697
|
-
detail: "Trabajaremos en conjunto para resolverlo.",
|
|
698
|
-
button1: {
|
|
699
|
-
name: "Cerrar",
|
|
700
|
-
action: closeGlobalModal
|
|
701
|
-
},
|
|
702
|
-
img: _defaultProfileImage.default,
|
|
703
|
-
textArea: false
|
|
704
|
-
});
|
|
705
|
-
break;
|
|
706
|
-
|
|
707
|
-
case "RAC":
|
|
708
|
-
var servicesRejected = [];
|
|
709
|
-
var translateServices = {
|
|
710
|
-
datasheet: "ficha técnica",
|
|
711
|
-
description: "descripción",
|
|
712
|
-
images: "imágenes"
|
|
713
|
-
};
|
|
714
|
-
Object.keys(translateServices).forEach(function (service) {
|
|
715
|
-
if (product["".concat(service, "_status")] === "RAC") {
|
|
716
|
-
servicesRejected.push(translateServices[service]);
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
var plural = ["Los servicios", "cumplen"];
|
|
720
|
-
var singular = ["El servicio", "cumple"];
|
|
721
|
-
var grammar = servicesRejected.length > 1 ? plural : singular;
|
|
722
|
-
var formatted = formatter.format(servicesRejected);
|
|
723
|
-
var text1 = "".concat(grammar[0], " de ").concat(formatted, " no ").concat(grammar[1], " con lo que la cadena necesita.");
|
|
724
|
-
var text2 = "\xA1Solicita el servicio de Content-oh! para completarlo!";
|
|
725
|
-
var retailers = product.retailersWithService.map(function (retailer) {
|
|
726
|
-
return Number(retailer);
|
|
727
|
-
});
|
|
728
|
-
setGlobalModal({
|
|
729
|
-
message: "Tu producto no cumple con los requerimientos de la cadena",
|
|
730
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
731
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
732
|
-
className: "generic-text",
|
|
733
|
-
children: [text1, /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), text2]
|
|
734
|
-
})
|
|
735
|
-
}),
|
|
736
|
-
button1: {
|
|
737
|
-
name: "Continuar",
|
|
738
|
-
action: function () {
|
|
739
|
-
var _action = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
740
|
-
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
741
|
-
while (1) {
|
|
742
|
-
switch (_context5.prev = _context5.next) {
|
|
743
|
-
case 0:
|
|
744
|
-
_context5.next = 2;
|
|
745
|
-
return seenByProvider();
|
|
746
|
-
|
|
747
|
-
case 2:
|
|
748
|
-
return _context5.abrupt("return", _context5.sent);
|
|
749
|
-
|
|
750
|
-
case 3:
|
|
751
|
-
case "end":
|
|
752
|
-
return _context5.stop();
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
}, _callee5);
|
|
756
|
-
}));
|
|
757
|
-
|
|
758
|
-
function action() {
|
|
759
|
-
return _action.apply(this, arguments);
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
return action;
|
|
763
|
-
}()
|
|
764
|
-
},
|
|
765
|
-
button2: {
|
|
766
|
-
name: "Solicitar a Content-oh!",
|
|
767
|
-
action: function () {
|
|
768
|
-
var _action2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
769
|
-
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
770
|
-
while (1) {
|
|
771
|
-
switch (_context6.prev = _context6.next) {
|
|
772
|
-
case 0:
|
|
773
|
-
_context6.next = 2;
|
|
774
|
-
return addCart(retailers);
|
|
775
|
-
|
|
776
|
-
case 2:
|
|
777
|
-
_context6.next = 4;
|
|
778
|
-
return seenByProvider();
|
|
779
|
-
|
|
780
|
-
case 4:
|
|
781
|
-
case "end":
|
|
782
|
-
return _context6.stop();
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
}, _callee6);
|
|
786
|
-
}));
|
|
787
|
-
|
|
788
|
-
function action() {
|
|
789
|
-
return _action2.apply(this, arguments);
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
return action;
|
|
793
|
-
}()
|
|
794
|
-
},
|
|
795
|
-
img: _errorModal.default
|
|
796
|
-
});
|
|
797
|
-
break;
|
|
798
|
-
|
|
799
|
-
case "AAC":
|
|
800
|
-
setGlobalModal({
|
|
801
|
-
message: "Felicidades",
|
|
802
|
-
detail: "Tu producto cumple con los requerimientos de la cadena.",
|
|
803
|
-
button1: {
|
|
804
|
-
name: "Continuar",
|
|
805
|
-
action: function () {
|
|
806
|
-
var _action3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
807
|
-
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
808
|
-
while (1) {
|
|
809
|
-
switch (_context7.prev = _context7.next) {
|
|
810
|
-
case 0:
|
|
811
|
-
_context7.next = 2;
|
|
812
|
-
return seenByProvider();
|
|
813
|
-
|
|
814
|
-
case 2:
|
|
815
|
-
return _context7.abrupt("return", _context7.sent);
|
|
816
|
-
|
|
817
|
-
case 3:
|
|
818
|
-
case "end":
|
|
819
|
-
return _context7.stop();
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
}, _callee7);
|
|
823
|
-
}));
|
|
824
|
-
|
|
825
|
-
function action() {
|
|
826
|
-
return _action3.apply(this, arguments);
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
return action;
|
|
830
|
-
}()
|
|
831
|
-
},
|
|
832
|
-
img: _defaultProfileImage.default
|
|
833
|
-
});
|
|
834
|
-
break;
|
|
835
|
-
|
|
836
|
-
case "addedToCartError":
|
|
837
|
-
setGlobalModal({
|
|
838
|
-
detail: "Parece que algo salió mal al intentar añadir tu producto a tu carrito.",
|
|
839
|
-
button1: {
|
|
840
|
-
name: "Continuar",
|
|
841
|
-
action: closeGlobalModal
|
|
842
|
-
}
|
|
843
|
-
});
|
|
844
|
-
break;
|
|
845
|
-
|
|
846
|
-
case "addedToCart":
|
|
847
|
-
setGlobalModal({
|
|
848
|
-
message: "Producto añadido",
|
|
849
|
-
detail: "Tu producto se añadió al carrito de compras.",
|
|
850
|
-
button1: {
|
|
851
|
-
name: "Continuar",
|
|
852
|
-
action: closeGlobalModal
|
|
853
|
-
},
|
|
854
|
-
img: _defaultProfileImage.default
|
|
855
|
-
});
|
|
856
|
-
break;
|
|
857
|
-
|
|
858
|
-
default:
|
|
859
|
-
closeGlobalModal();
|
|
860
|
-
break;
|
|
861
|
-
}
|
|
862
|
-
}, [activeTab, dataGenericModal, product]);
|
|
863
536
|
(0, _react.useEffect)(function () {
|
|
864
537
|
checkAll && setSelectedImages(images.values);
|
|
865
538
|
}, [checkAll]);
|
|
@@ -870,22 +543,22 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
870
543
|
}, [showModal]);
|
|
871
544
|
|
|
872
545
|
var loadData = /*#__PURE__*/function () {
|
|
873
|
-
var
|
|
546
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
874
547
|
var _product$article, _product$article2, _product$article3, _services$, _services$$values;
|
|
875
548
|
|
|
876
549
|
var services;
|
|
877
|
-
return _regenerator.default.wrap(function
|
|
550
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
878
551
|
while (1) {
|
|
879
|
-
switch (
|
|
552
|
+
switch (_context2.prev = _context2.next) {
|
|
880
553
|
case 0:
|
|
881
|
-
|
|
554
|
+
_context2.next = 2;
|
|
882
555
|
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);
|
|
883
556
|
|
|
884
557
|
case 2:
|
|
885
|
-
services =
|
|
558
|
+
services = _context2.sent;
|
|
886
559
|
//Converts the data inside the datasheets object to array
|
|
887
560
|
setServices(services);
|
|
888
|
-
|
|
561
|
+
_context2.next = 6;
|
|
889
562
|
return getServices();
|
|
890
563
|
|
|
891
564
|
case 6:
|
|
@@ -903,26 +576,26 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
903
576
|
|
|
904
577
|
case 10:
|
|
905
578
|
case "end":
|
|
906
|
-
return
|
|
579
|
+
return _context2.stop();
|
|
907
580
|
}
|
|
908
581
|
}
|
|
909
|
-
},
|
|
582
|
+
}, _callee2);
|
|
910
583
|
}));
|
|
911
584
|
|
|
912
585
|
return function loadData() {
|
|
913
|
-
return
|
|
586
|
+
return _ref3.apply(this, arguments);
|
|
914
587
|
};
|
|
915
588
|
}();
|
|
916
589
|
|
|
917
590
|
var getServices = /*#__PURE__*/function () {
|
|
918
|
-
var
|
|
591
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
919
592
|
var _product$article4;
|
|
920
593
|
|
|
921
594
|
var productInOrder, idArticle, retailers, active, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailerResponse;
|
|
922
595
|
|
|
923
|
-
return _regenerator.default.wrap(function
|
|
596
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
924
597
|
while (1) {
|
|
925
|
-
switch (
|
|
598
|
+
switch (_context3.prev = _context3.next) {
|
|
926
599
|
case 0:
|
|
927
600
|
productInOrder = product.id_order || product.orderId;
|
|
928
601
|
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);
|
|
@@ -930,15 +603,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
930
603
|
active = null;
|
|
931
604
|
|
|
932
605
|
if (!(isRevision() || productInOrder)) {
|
|
933
|
-
|
|
606
|
+
_context3.next = 12;
|
|
934
607
|
break;
|
|
935
608
|
}
|
|
936
609
|
|
|
937
|
-
|
|
610
|
+
_context3.next = 7;
|
|
938
611
|
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"));
|
|
939
612
|
|
|
940
613
|
case 7:
|
|
941
|
-
servicesResponse =
|
|
614
|
+
servicesResponse = _context3.sent;
|
|
942
615
|
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;
|
|
943
616
|
retailerResponse = parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.map(function (srv) {
|
|
944
617
|
return srv.id_retailer;
|
|
@@ -949,18 +622,18 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
949
622
|
setServicesData(parsedResponse);
|
|
950
623
|
|
|
951
624
|
case 12:
|
|
952
|
-
|
|
625
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
953
626
|
|
|
954
627
|
case 13:
|
|
955
628
|
case "end":
|
|
956
|
-
return
|
|
629
|
+
return _context3.stop();
|
|
957
630
|
}
|
|
958
631
|
}
|
|
959
|
-
},
|
|
632
|
+
}, _callee3);
|
|
960
633
|
}));
|
|
961
634
|
|
|
962
635
|
return function getServices() {
|
|
963
|
-
return
|
|
636
|
+
return _ref4.apply(this, arguments);
|
|
964
637
|
};
|
|
965
638
|
}();
|
|
966
639
|
|
|
@@ -990,13 +663,13 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
990
663
|
};
|
|
991
664
|
|
|
992
665
|
var getCart = /*#__PURE__*/function () {
|
|
993
|
-
var
|
|
666
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
994
667
|
var res, arr;
|
|
995
|
-
return _regenerator.default.wrap(function
|
|
668
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
996
669
|
while (1) {
|
|
997
|
-
switch (
|
|
670
|
+
switch (_context4.prev = _context4.next) {
|
|
998
671
|
case 0:
|
|
999
|
-
|
|
672
|
+
_context4.next = 2;
|
|
1000
673
|
return _axios.default.get(process.env.REACT_APP_CART, {
|
|
1001
674
|
headers: {
|
|
1002
675
|
Authorization: token
|
|
@@ -1004,7 +677,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1004
677
|
});
|
|
1005
678
|
|
|
1006
679
|
case 2:
|
|
1007
|
-
res =
|
|
680
|
+
res = _context4.sent;
|
|
1008
681
|
arr = JSON.parse(res.data.body).data.map(function (e) {
|
|
1009
682
|
return e.article_id;
|
|
1010
683
|
});
|
|
@@ -1014,14 +687,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1014
687
|
|
|
1015
688
|
case 5:
|
|
1016
689
|
case "end":
|
|
1017
|
-
return
|
|
690
|
+
return _context4.stop();
|
|
1018
691
|
}
|
|
1019
692
|
}
|
|
1020
|
-
},
|
|
693
|
+
}, _callee4);
|
|
1021
694
|
}));
|
|
1022
695
|
|
|
1023
696
|
return function getCart() {
|
|
1024
|
-
return
|
|
697
|
+
return _ref5.apply(this, arguments);
|
|
1025
698
|
};
|
|
1026
699
|
}();
|
|
1027
700
|
|
|
@@ -1036,7 +709,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1036
709
|
action: "orderImages",
|
|
1037
710
|
retailerId: activeRetailer.id
|
|
1038
711
|
});
|
|
1039
|
-
if (["RAC", "AAC"].includes(product.article_status)) showGlobalModal(product.article_status);
|
|
1040
712
|
}, [product, version]);
|
|
1041
713
|
(0, _react.useEffect)(function () {
|
|
1042
714
|
setImages({
|
|
@@ -1067,7 +739,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1067
739
|
}
|
|
1068
740
|
|
|
1069
741
|
setProduct(productTemp);
|
|
1070
|
-
|
|
742
|
+
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1071
743
|
}, [percentages]);
|
|
1072
744
|
|
|
1073
745
|
var loadInputs = function loadInputs() {
|
|
@@ -1147,11 +819,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1147
819
|
}, [images]);
|
|
1148
820
|
|
|
1149
821
|
var saveDescriptions = /*#__PURE__*/function () {
|
|
1150
|
-
var
|
|
822
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
1151
823
|
var dataObject, res;
|
|
1152
|
-
return _regenerator.default.wrap(function
|
|
824
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
1153
825
|
while (1) {
|
|
1154
|
-
switch (
|
|
826
|
+
switch (_context5.prev = _context5.next) {
|
|
1155
827
|
case 0:
|
|
1156
828
|
setLoading(true);
|
|
1157
829
|
dataObject = {
|
|
@@ -1159,8 +831,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1159
831
|
articleData: updatedDescriptions
|
|
1160
832
|
};
|
|
1161
833
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
1162
|
-
|
|
1163
|
-
|
|
834
|
+
_context5.prev = 3;
|
|
835
|
+
_context5.next = 6;
|
|
1164
836
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
|
|
1165
837
|
headers: {
|
|
1166
838
|
Authorization: token
|
|
@@ -1168,45 +840,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1168
840
|
});
|
|
1169
841
|
|
|
1170
842
|
case 6:
|
|
1171
|
-
res =
|
|
843
|
+
res = _context5.sent;
|
|
1172
844
|
|
|
1173
845
|
if (!(res.data.statusCode === 200)) {
|
|
1174
|
-
|
|
846
|
+
_context5.next = 11;
|
|
1175
847
|
break;
|
|
1176
848
|
}
|
|
1177
849
|
|
|
1178
850
|
setMessage("Descripciones guardadas con éxito");
|
|
1179
|
-
|
|
851
|
+
_context5.next = 11;
|
|
1180
852
|
return loadData();
|
|
1181
853
|
|
|
1182
854
|
case 11:
|
|
1183
|
-
|
|
855
|
+
_context5.next = 16;
|
|
1184
856
|
break;
|
|
1185
857
|
|
|
1186
858
|
case 13:
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
console.log(
|
|
859
|
+
_context5.prev = 13;
|
|
860
|
+
_context5.t0 = _context5["catch"](3);
|
|
861
|
+
console.log(_context5.t0);
|
|
1190
862
|
|
|
1191
863
|
case 16:
|
|
1192
864
|
case "end":
|
|
1193
|
-
return
|
|
865
|
+
return _context5.stop();
|
|
1194
866
|
}
|
|
1195
867
|
}
|
|
1196
|
-
},
|
|
868
|
+
}, _callee5, null, [[3, 13]]);
|
|
1197
869
|
}));
|
|
1198
870
|
|
|
1199
871
|
return function saveDescriptions() {
|
|
1200
|
-
return
|
|
872
|
+
return _ref6.apply(this, arguments);
|
|
1201
873
|
};
|
|
1202
874
|
}();
|
|
1203
875
|
|
|
1204
876
|
var saveDatasheets = /*#__PURE__*/function () {
|
|
1205
|
-
var
|
|
877
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1206
878
|
var dataObject, res;
|
|
1207
|
-
return _regenerator.default.wrap(function
|
|
879
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1208
880
|
while (1) {
|
|
1209
|
-
switch (
|
|
881
|
+
switch (_context6.prev = _context6.next) {
|
|
1210
882
|
case 0:
|
|
1211
883
|
setLoading(true);
|
|
1212
884
|
dataObject = {
|
|
@@ -1214,8 +886,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1214
886
|
articleData: updatedDatasheets
|
|
1215
887
|
};
|
|
1216
888
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
1217
|
-
|
|
1218
|
-
|
|
889
|
+
_context6.prev = 3;
|
|
890
|
+
_context6.next = 6;
|
|
1219
891
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
|
|
1220
892
|
headers: {
|
|
1221
893
|
Authorization: token
|
|
@@ -1223,47 +895,47 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1223
895
|
});
|
|
1224
896
|
|
|
1225
897
|
case 6:
|
|
1226
|
-
res =
|
|
898
|
+
res = _context6.sent;
|
|
1227
899
|
|
|
1228
900
|
if (!(res.data.statusCode === 200)) {
|
|
1229
|
-
|
|
901
|
+
_context6.next = 11;
|
|
1230
902
|
break;
|
|
1231
903
|
}
|
|
1232
904
|
|
|
1233
905
|
setMessage("Fichas técnicas guardadas");
|
|
1234
|
-
|
|
906
|
+
_context6.next = 11;
|
|
1235
907
|
return loadData();
|
|
1236
908
|
|
|
1237
909
|
case 11:
|
|
1238
|
-
|
|
910
|
+
_context6.next = 16;
|
|
1239
911
|
break;
|
|
1240
912
|
|
|
1241
913
|
case 13:
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
console.log(
|
|
914
|
+
_context6.prev = 13;
|
|
915
|
+
_context6.t0 = _context6["catch"](3);
|
|
916
|
+
console.log(_context6.t0);
|
|
1245
917
|
|
|
1246
918
|
case 16:
|
|
1247
919
|
case "end":
|
|
1248
|
-
return
|
|
920
|
+
return _context6.stop();
|
|
1249
921
|
}
|
|
1250
922
|
}
|
|
1251
|
-
},
|
|
923
|
+
}, _callee6, null, [[3, 13]]);
|
|
1252
924
|
}));
|
|
1253
925
|
|
|
1254
926
|
return function saveDatasheets() {
|
|
1255
|
-
return
|
|
927
|
+
return _ref7.apply(this, arguments);
|
|
1256
928
|
};
|
|
1257
929
|
}();
|
|
1258
930
|
|
|
1259
|
-
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
931
|
+
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
1260
932
|
var _images$values2, _data$articleData, _data$articleData2, _data$updateImages;
|
|
1261
933
|
|
|
1262
934
|
var imagesList, imagesListTemp, duplicated, attrForImgs, data, valid, _data$updateImages2, _data$articleData3, _data$articleData4, _data$articleData5, promiseArray;
|
|
1263
935
|
|
|
1264
|
-
return _regenerator.default.wrap(function
|
|
936
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
1265
937
|
while (1) {
|
|
1266
|
-
switch (
|
|
938
|
+
switch (_context7.prev = _context7.next) {
|
|
1267
939
|
case 0:
|
|
1268
940
|
imagesList = images === null || images === void 0 ? void 0 : (_images$values2 = images.values) === null || _images$values2 === void 0 ? void 0 : _images$values2.slice();
|
|
1269
941
|
imagesListTemp = imagesList === null || imagesList === void 0 ? void 0 : imagesList.reduce(function (acc, image) {
|
|
@@ -1312,19 +984,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1312
984
|
}
|
|
1313
985
|
|
|
1314
986
|
if (!(valid && (duplicated === null || duplicated === void 0 ? void 0 : duplicated.length) === 0)) {
|
|
1315
|
-
|
|
987
|
+
_context7.next = 31;
|
|
1316
988
|
break;
|
|
1317
989
|
}
|
|
1318
990
|
|
|
1319
991
|
setLoading(true);
|
|
1320
|
-
|
|
992
|
+
_context7.prev = 11;
|
|
1321
993
|
data === null || data === void 0 ? void 0 : (_data$articleData3 = data.articleData) === null || _data$articleData3 === void 0 ? void 0 : _data$articleData3.forEach(function (e) {
|
|
1322
994
|
e.uuid = (0, _uuid.v4)();
|
|
1323
995
|
});
|
|
1324
996
|
setDataImages(data);
|
|
1325
997
|
|
|
1326
998
|
if (!((data === null || data === void 0 ? void 0 : (_data$articleData4 = data.articleData) === null || _data$articleData4 === void 0 ? void 0 : _data$articleData4.length) > 0)) {
|
|
1327
|
-
|
|
999
|
+
_context7.next = 23;
|
|
1328
1000
|
break;
|
|
1329
1001
|
}
|
|
1330
1002
|
|
|
@@ -1340,28 +1012,28 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1340
1012
|
};
|
|
1341
1013
|
promiseArray.push(myBucket.putObject(params).promise());
|
|
1342
1014
|
});
|
|
1343
|
-
|
|
1015
|
+
_context7.next = 20;
|
|
1344
1016
|
return Promise.all(promiseArray);
|
|
1345
1017
|
|
|
1346
1018
|
case 20:
|
|
1347
1019
|
setImagesUploaded(true);
|
|
1348
|
-
|
|
1020
|
+
_context7.next = 24;
|
|
1349
1021
|
break;
|
|
1350
1022
|
|
|
1351
1023
|
case 23:
|
|
1352
1024
|
setImagesUploaded(true);
|
|
1353
1025
|
|
|
1354
1026
|
case 24:
|
|
1355
|
-
|
|
1027
|
+
_context7.next = 29;
|
|
1356
1028
|
break;
|
|
1357
1029
|
|
|
1358
1030
|
case 26:
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
console.log(
|
|
1031
|
+
_context7.prev = 26;
|
|
1032
|
+
_context7.t0 = _context7["catch"](11);
|
|
1033
|
+
console.log(_context7.t0); // setMainLoading(false);
|
|
1362
1034
|
|
|
1363
1035
|
case 29:
|
|
1364
|
-
|
|
1036
|
+
_context7.next = 32;
|
|
1365
1037
|
break;
|
|
1366
1038
|
|
|
1367
1039
|
case 31:
|
|
@@ -1370,19 +1042,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1370
1042
|
|
|
1371
1043
|
case 32:
|
|
1372
1044
|
case "end":
|
|
1373
|
-
return
|
|
1045
|
+
return _context7.stop();
|
|
1374
1046
|
}
|
|
1375
1047
|
}
|
|
1376
|
-
},
|
|
1048
|
+
}, _callee7, null, [[11, 26]]);
|
|
1377
1049
|
})), [images, imagesUploaded]);
|
|
1378
|
-
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1050
|
+
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1379
1051
|
var res;
|
|
1380
|
-
return _regenerator.default.wrap(function
|
|
1052
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
1381
1053
|
while (1) {
|
|
1382
|
-
switch (
|
|
1054
|
+
switch (_context8.prev = _context8.next) {
|
|
1383
1055
|
case 0:
|
|
1384
1056
|
if (!imagesUploaded) {
|
|
1385
|
-
|
|
1057
|
+
_context8.next = 16;
|
|
1386
1058
|
break;
|
|
1387
1059
|
}
|
|
1388
1060
|
|
|
@@ -1394,8 +1066,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1394
1066
|
if (product !== null && product !== void 0 && product.orderId) e["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
1395
1067
|
return e;
|
|
1396
1068
|
});
|
|
1397
|
-
|
|
1398
|
-
|
|
1069
|
+
_context8.prev = 2;
|
|
1070
|
+
_context8.next = 5;
|
|
1399
1071
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?image=true&version=").concat(version), dataImages, {
|
|
1400
1072
|
headers: {
|
|
1401
1073
|
Authorization: token
|
|
@@ -1403,33 +1075,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1403
1075
|
});
|
|
1404
1076
|
|
|
1405
1077
|
case 5:
|
|
1406
|
-
res =
|
|
1078
|
+
res = _context8.sent;
|
|
1407
1079
|
|
|
1408
1080
|
if (!(res.data.statusCode === 200)) {
|
|
1409
|
-
|
|
1081
|
+
_context8.next = 11;
|
|
1410
1082
|
break;
|
|
1411
1083
|
}
|
|
1412
1084
|
|
|
1413
1085
|
setMessage("Imágenes guardadas con éxito");
|
|
1414
1086
|
sessionStorage.removeItem("imagesList");
|
|
1415
|
-
|
|
1087
|
+
_context8.next = 11;
|
|
1416
1088
|
return loadData();
|
|
1417
1089
|
|
|
1418
1090
|
case 11:
|
|
1419
|
-
|
|
1091
|
+
_context8.next = 16;
|
|
1420
1092
|
break;
|
|
1421
1093
|
|
|
1422
1094
|
case 13:
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
console.log(
|
|
1095
|
+
_context8.prev = 13;
|
|
1096
|
+
_context8.t0 = _context8["catch"](2);
|
|
1097
|
+
console.log(_context8.t0);
|
|
1426
1098
|
|
|
1427
1099
|
case 16:
|
|
1428
1100
|
case "end":
|
|
1429
|
-
return
|
|
1101
|
+
return _context8.stop();
|
|
1430
1102
|
}
|
|
1431
1103
|
}
|
|
1432
|
-
},
|
|
1104
|
+
}, _callee8, null, [[2, 13]]);
|
|
1433
1105
|
})), [dataImages, imagesUploaded]);
|
|
1434
1106
|
|
|
1435
1107
|
var getConcept = function getConcept(tab) {
|
|
@@ -1445,43 +1117,74 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1445
1117
|
}
|
|
1446
1118
|
};
|
|
1447
1119
|
|
|
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
|
+
|
|
1448
1139
|
var createComment = /*#__PURE__*/function () {
|
|
1449
|
-
var
|
|
1450
|
-
var
|
|
1451
|
-
|
|
1452
|
-
data,
|
|
1453
|
-
_args15 = arguments;
|
|
1454
|
-
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1140
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(e, body, tab) {
|
|
1141
|
+
var concept, data;
|
|
1142
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1455
1143
|
while (1) {
|
|
1456
|
-
switch (
|
|
1144
|
+
switch (_context9.prev = _context9.next) {
|
|
1457
1145
|
case 0:
|
|
1458
|
-
|
|
1459
|
-
|
|
1146
|
+
concept = "";
|
|
1147
|
+
_context9.t0 = activeTab;
|
|
1148
|
+
_context9.next = _context9.t0 === "Ficha técnica" ? 4 : _context9.t0 === "Imágenes" ? 6 : 8;
|
|
1149
|
+
break;
|
|
1150
|
+
|
|
1151
|
+
case 4:
|
|
1152
|
+
concept = "datasheet";
|
|
1153
|
+
return _context9.abrupt("break", 10);
|
|
1154
|
+
|
|
1155
|
+
case 6:
|
|
1156
|
+
concept = "images";
|
|
1157
|
+
return _context9.abrupt("break", 10);
|
|
1158
|
+
|
|
1159
|
+
case 8:
|
|
1160
|
+
concept = "description";
|
|
1161
|
+
return _context9.abrupt("break", 10);
|
|
1162
|
+
|
|
1163
|
+
case 10:
|
|
1460
1164
|
data = {
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1165
|
+
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1166
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1167
|
+
message: body,
|
|
1168
|
+
concept: concept,
|
|
1169
|
+
version: version
|
|
1170
|
+
};
|
|
1171
|
+
_context9.next = 13;
|
|
1172
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1173
|
+
headers: {
|
|
1469
1174
|
Authorization: token
|
|
1470
1175
|
}
|
|
1471
|
-
};
|
|
1472
|
-
setMessage("");
|
|
1473
|
-
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1176
|
+
});
|
|
1474
1177
|
|
|
1475
|
-
case
|
|
1178
|
+
case 13:
|
|
1476
1179
|
case "end":
|
|
1477
|
-
return
|
|
1180
|
+
return _context9.stop();
|
|
1478
1181
|
}
|
|
1479
1182
|
}
|
|
1480
|
-
},
|
|
1183
|
+
}, _callee9);
|
|
1481
1184
|
}));
|
|
1482
1185
|
|
|
1483
|
-
return function createComment() {
|
|
1484
|
-
return
|
|
1186
|
+
return function createComment(_x2, _x3, _x4) {
|
|
1187
|
+
return _ref10.apply(this, arguments);
|
|
1485
1188
|
};
|
|
1486
1189
|
}();
|
|
1487
1190
|
|
|
@@ -1490,16 +1193,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1490
1193
|
}, [activeTab]);
|
|
1491
1194
|
|
|
1492
1195
|
var commentRevised = /*#__PURE__*/function () {
|
|
1493
|
-
var
|
|
1196
|
+
var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
1494
1197
|
var data;
|
|
1495
|
-
return _regenerator.default.wrap(function
|
|
1198
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
1496
1199
|
while (1) {
|
|
1497
|
-
switch (
|
|
1200
|
+
switch (_context10.prev = _context10.next) {
|
|
1498
1201
|
case 0:
|
|
1499
1202
|
data = {
|
|
1500
1203
|
commentId: comment.id
|
|
1501
1204
|
};
|
|
1502
|
-
|
|
1205
|
+
_context10.next = 3;
|
|
1503
1206
|
return _axios.default.put("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1504
1207
|
headers: {
|
|
1505
1208
|
Authorization: token
|
|
@@ -1511,40 +1214,40 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1511
1214
|
|
|
1512
1215
|
case 4:
|
|
1513
1216
|
case "end":
|
|
1514
|
-
return
|
|
1217
|
+
return _context10.stop();
|
|
1515
1218
|
}
|
|
1516
1219
|
}
|
|
1517
|
-
},
|
|
1220
|
+
}, _callee10);
|
|
1518
1221
|
}));
|
|
1519
1222
|
|
|
1520
1223
|
return function commentRevised() {
|
|
1521
|
-
return
|
|
1224
|
+
return _ref11.apply(this, arguments);
|
|
1522
1225
|
};
|
|
1523
1226
|
}();
|
|
1524
1227
|
|
|
1525
1228
|
var setAssignation = /*#__PURE__*/function () {
|
|
1526
|
-
var
|
|
1229
|
+
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(assignationType, assignationId) {
|
|
1527
1230
|
var concept, productTemp, data;
|
|
1528
|
-
return _regenerator.default.wrap(function
|
|
1231
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1529
1232
|
while (1) {
|
|
1530
|
-
switch (
|
|
1233
|
+
switch (_context11.prev = _context11.next) {
|
|
1531
1234
|
case 0:
|
|
1532
1235
|
concept = "";
|
|
1533
|
-
|
|
1534
|
-
|
|
1236
|
+
_context11.t0 = activeTab;
|
|
1237
|
+
_context11.next = _context11.t0 === "Ficha técnica" ? 4 : _context11.t0 === "Imágenes" ? 6 : 8;
|
|
1535
1238
|
break;
|
|
1536
1239
|
|
|
1537
1240
|
case 4:
|
|
1538
1241
|
concept = "datasheet";
|
|
1539
|
-
return
|
|
1242
|
+
return _context11.abrupt("break", 10);
|
|
1540
1243
|
|
|
1541
1244
|
case 6:
|
|
1542
1245
|
concept = "images";
|
|
1543
|
-
return
|
|
1246
|
+
return _context11.abrupt("break", 10);
|
|
1544
1247
|
|
|
1545
1248
|
case 8:
|
|
1546
1249
|
concept = "description";
|
|
1547
|
-
return
|
|
1250
|
+
return _context11.abrupt("break", 10);
|
|
1548
1251
|
|
|
1549
1252
|
case 10:
|
|
1550
1253
|
productTemp = product;
|
|
@@ -1557,7 +1260,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1557
1260
|
concept: concept,
|
|
1558
1261
|
userId: assignationId
|
|
1559
1262
|
};
|
|
1560
|
-
|
|
1263
|
+
_context11.next = 15;
|
|
1561
1264
|
return (0, _axios.default)({
|
|
1562
1265
|
method: "post",
|
|
1563
1266
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
@@ -1573,17 +1276,35 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1573
1276
|
|
|
1574
1277
|
case 17:
|
|
1575
1278
|
case "end":
|
|
1576
|
-
return
|
|
1279
|
+
return _context11.stop();
|
|
1577
1280
|
}
|
|
1578
1281
|
}
|
|
1579
|
-
},
|
|
1282
|
+
}, _callee11);
|
|
1580
1283
|
}));
|
|
1581
1284
|
|
|
1582
|
-
return function setAssignation(
|
|
1583
|
-
return
|
|
1285
|
+
return function setAssignation(_x5, _x6) {
|
|
1286
|
+
return _ref12.apply(this, arguments);
|
|
1584
1287
|
};
|
|
1585
1288
|
}();
|
|
1586
1289
|
|
|
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
|
+
|
|
1587
1308
|
var downloadImages = function downloadImages() {
|
|
1588
1309
|
var _images$values3;
|
|
1589
1310
|
|
|
@@ -1663,21 +1384,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1663
1384
|
}
|
|
1664
1385
|
};
|
|
1665
1386
|
|
|
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
|
+
|
|
1666
1399
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
1667
|
-
var
|
|
1668
|
-
var _productTemp$
|
|
1400
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(result) {
|
|
1401
|
+
var _productTemp$id_order;
|
|
1669
1402
|
|
|
1670
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus,
|
|
1403
|
+
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1671
1404
|
|
|
1672
|
-
return _regenerator.default.wrap(function
|
|
1405
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1673
1406
|
while (1) {
|
|
1674
|
-
switch (
|
|
1407
|
+
switch (_context12.prev = _context12.next) {
|
|
1675
1408
|
case 0:
|
|
1676
1409
|
setLoading(true);
|
|
1677
1410
|
concept = getConcept(activeTab);
|
|
1678
1411
|
productTemp = product;
|
|
1679
1412
|
articleId = productTemp.id_article;
|
|
1680
|
-
orderId = (_productTemp$
|
|
1413
|
+
orderId = (_productTemp$id_order = productTemp.id_order) !== null && _productTemp$id_order !== void 0 ? _productTemp$id_order : productTemp.orderId;
|
|
1681
1414
|
sectionStatusKey = "".concat(getConcept(activeTab), "_status");
|
|
1682
1415
|
evalStatus = product[sectionStatusKey] || (product === null || product === void 0 ? void 0 : product.version_status);
|
|
1683
1416
|
data = {
|
|
@@ -1687,16 +1420,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1687
1420
|
evalStatus: evalStatus
|
|
1688
1421
|
};
|
|
1689
1422
|
retailerId = activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id;
|
|
1690
|
-
|
|
1423
|
+
_context12.prev = 9;
|
|
1691
1424
|
|
|
1692
1425
|
if (!result) {
|
|
1693
|
-
|
|
1426
|
+
_context12.next = 27;
|
|
1694
1427
|
break;
|
|
1695
1428
|
}
|
|
1696
1429
|
|
|
1697
1430
|
data.result = result;
|
|
1698
1431
|
data.retailerId = retailerId;
|
|
1699
|
-
|
|
1432
|
+
_context12.next = 15;
|
|
1700
1433
|
return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1701
1434
|
headers: {
|
|
1702
1435
|
Authorization: token
|
|
@@ -1704,7 +1437,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1704
1437
|
});
|
|
1705
1438
|
|
|
1706
1439
|
case 15:
|
|
1707
|
-
res =
|
|
1440
|
+
res = _context12.sent;
|
|
1708
1441
|
newStatuses = JSON.parse(res.data.body);
|
|
1709
1442
|
orderStatus = newStatuses.newOrderStatus;
|
|
1710
1443
|
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(getConcept(activeTab), "Status")];
|
|
@@ -1714,11 +1447,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1714
1447
|
showSurveyByProvider = !user.is_retailer && orderStatus[orderId] === "AP";
|
|
1715
1448
|
showSurveyByRetailer = user.is_retailer && orderStatus[orderId] === "ACA";
|
|
1716
1449
|
showSurvey && showSurvey(showSurveyByProvider || showSurveyByRetailer);
|
|
1717
|
-
|
|
1450
|
+
_context12.next = 30;
|
|
1718
1451
|
break;
|
|
1719
1452
|
|
|
1720
1453
|
case 27:
|
|
1721
|
-
|
|
1454
|
+
_context12.next = 29;
|
|
1722
1455
|
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1723
1456
|
headers: {
|
|
1724
1457
|
Authorization: token
|
|
@@ -1726,86 +1459,62 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1726
1459
|
});
|
|
1727
1460
|
|
|
1728
1461
|
case 29:
|
|
1729
|
-
res =
|
|
1462
|
+
res = _context12.sent;
|
|
1730
1463
|
|
|
1731
1464
|
case 30:
|
|
1732
|
-
if (
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
items: [{
|
|
1744
|
-
type: "status",
|
|
1745
|
-
value: _message
|
|
1746
|
-
}],
|
|
1747
|
-
retailerId: activeRetailer.id,
|
|
1748
|
-
status: product.status || productEdit.product.status
|
|
1749
|
-
},
|
|
1750
|
-
paramsHeader: {
|
|
1751
|
-
Authorization: token
|
|
1465
|
+
if (res.data.statusCode === 200) {
|
|
1466
|
+
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1467
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1468
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1469
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1470
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1471
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1472
|
+
|
|
1473
|
+
if (newServiceStatus) {
|
|
1474
|
+
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1475
|
+
productTemp["".concat(concept, "_status")] = status;
|
|
1752
1476
|
}
|
|
1753
|
-
};
|
|
1754
|
-
_context18.next = 36;
|
|
1755
|
-
return (0, _utils.sendMessage)(messageData);
|
|
1756
|
-
|
|
1757
|
-
case 36:
|
|
1758
|
-
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1759
|
-
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1760
|
-
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1761
|
-
setRetailerStatus(retailerStatusCopy);
|
|
1762
|
-
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1763
1477
|
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1478
|
+
setProduct(productTemp);
|
|
1479
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1480
|
+
setOrigin(function (prev) {
|
|
1481
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1482
|
+
});
|
|
1767
1483
|
}
|
|
1768
1484
|
|
|
1769
|
-
|
|
1770
|
-
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1771
|
-
setOrigin(function (prev) {
|
|
1772
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1773
|
-
});
|
|
1774
|
-
|
|
1775
|
-
case 45:
|
|
1776
|
-
_context18.next = 50;
|
|
1485
|
+
_context12.next = 36;
|
|
1777
1486
|
break;
|
|
1778
1487
|
|
|
1779
|
-
case
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
console.log(
|
|
1488
|
+
case 33:
|
|
1489
|
+
_context12.prev = 33;
|
|
1490
|
+
_context12.t0 = _context12["catch"](9);
|
|
1491
|
+
console.log(_context12.t0);
|
|
1783
1492
|
|
|
1784
|
-
case
|
|
1493
|
+
case 36:
|
|
1785
1494
|
loadData();
|
|
1786
1495
|
|
|
1787
|
-
case
|
|
1496
|
+
case 37:
|
|
1788
1497
|
case "end":
|
|
1789
|
-
return
|
|
1498
|
+
return _context12.stop();
|
|
1790
1499
|
}
|
|
1791
1500
|
}
|
|
1792
|
-
},
|
|
1501
|
+
}, _callee12, null, [[9, 33]]);
|
|
1793
1502
|
}));
|
|
1794
1503
|
|
|
1795
|
-
return function sendEvaluation(
|
|
1796
|
-
return
|
|
1504
|
+
return function sendEvaluation(_x7) {
|
|
1505
|
+
return _ref13.apply(this, arguments);
|
|
1797
1506
|
};
|
|
1798
1507
|
}();
|
|
1799
1508
|
|
|
1800
1509
|
var validateAll = /*#__PURE__*/function () {
|
|
1801
|
-
var
|
|
1802
|
-
var _product$id_order2, evaluationArray, conceptArray, dataGeneral,
|
|
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;
|
|
1803
1512
|
|
|
1804
|
-
return _regenerator.default.wrap(function
|
|
1513
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
1805
1514
|
while (1) {
|
|
1806
|
-
switch (
|
|
1515
|
+
switch (_context13.prev = _context13.next) {
|
|
1807
1516
|
case 0:
|
|
1808
|
-
|
|
1517
|
+
_context13.prev = 0;
|
|
1809
1518
|
setLoading(true);
|
|
1810
1519
|
evaluationArray = [];
|
|
1811
1520
|
conceptArray = ["description", "datasheet", "images"];
|
|
@@ -1815,7 +1524,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1815
1524
|
result: result,
|
|
1816
1525
|
isAproved: result === "A"
|
|
1817
1526
|
};
|
|
1818
|
-
messages = [];
|
|
1819
1527
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1820
1528
|
var service = ret.service,
|
|
1821
1529
|
id_retailer = ret.id_retailer;
|
|
@@ -1830,32 +1538,23 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1830
1538
|
Authorization: token
|
|
1831
1539
|
}
|
|
1832
1540
|
}));
|
|
1833
|
-
|
|
1834
|
-
if (product["".concat(ret.service, "_status")] !== "NS") {
|
|
1835
|
-
var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
|
|
1836
|
-
|
|
1837
|
-
messages.push(createComment([{
|
|
1838
|
-
type: "status",
|
|
1839
|
-
value: _message2
|
|
1840
|
-
}], ret.id_retailer));
|
|
1841
|
-
}
|
|
1842
1541
|
});
|
|
1843
|
-
|
|
1542
|
+
_context13.next = 8;
|
|
1844
1543
|
return Promise.all(evaluationArray);
|
|
1845
1544
|
|
|
1846
|
-
case
|
|
1545
|
+
case 8:
|
|
1546
|
+
evalResponse = _context13.sent;
|
|
1847
1547
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1848
1548
|
productTemp = product;
|
|
1849
|
-
|
|
1850
|
-
productTemp.
|
|
1851
|
-
productTemp.
|
|
1852
|
-
productTemp.
|
|
1853
|
-
productTemp.images_status = productTemp.images_status === "NA" ? "NA" : status;
|
|
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);
|
|
1854
1553
|
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1855
1554
|
Object.keys(retailerStatusCopy).forEach(function (key) {
|
|
1856
1555
|
conceptArray.forEach(function (concept) {
|
|
1857
1556
|
if (retailerStatusCopy[key][concept]) {
|
|
1858
|
-
retailerStatusCopy[key][concept] =
|
|
1557
|
+
retailerStatusCopy[key][concept] = "".concat(result).concat(userType);
|
|
1859
1558
|
}
|
|
1860
1559
|
});
|
|
1861
1560
|
});
|
|
@@ -1873,41 +1572,37 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1873
1572
|
idCategory: productTemp.article.id_category,
|
|
1874
1573
|
product: productTemp
|
|
1875
1574
|
}));
|
|
1876
|
-
|
|
1877
|
-
return Promise.all(messages);
|
|
1878
|
-
|
|
1879
|
-
case 26:
|
|
1880
|
-
_context19.next = 28;
|
|
1575
|
+
_context13.next = 25;
|
|
1881
1576
|
return loadData();
|
|
1882
1577
|
|
|
1883
|
-
case
|
|
1884
|
-
|
|
1578
|
+
case 25:
|
|
1579
|
+
_context13.next = 30;
|
|
1885
1580
|
break;
|
|
1886
1581
|
|
|
1887
|
-
case
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
console.log(
|
|
1582
|
+
case 27:
|
|
1583
|
+
_context13.prev = 27;
|
|
1584
|
+
_context13.t0 = _context13["catch"](0);
|
|
1585
|
+
console.log(_context13.t0);
|
|
1891
1586
|
|
|
1892
|
-
case
|
|
1587
|
+
case 30:
|
|
1893
1588
|
case "end":
|
|
1894
|
-
return
|
|
1589
|
+
return _context13.stop();
|
|
1895
1590
|
}
|
|
1896
1591
|
}
|
|
1897
|
-
},
|
|
1592
|
+
}, _callee13, null, [[0, 27]]);
|
|
1898
1593
|
}));
|
|
1899
1594
|
|
|
1900
|
-
return function validateAll(
|
|
1901
|
-
return
|
|
1595
|
+
return function validateAll(_x8) {
|
|
1596
|
+
return _ref14.apply(this, arguments);
|
|
1902
1597
|
};
|
|
1903
1598
|
}();
|
|
1904
1599
|
|
|
1905
1600
|
var evaluationToRetailer = /*#__PURE__*/function () {
|
|
1906
|
-
var
|
|
1601
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
|
|
1907
1602
|
var data, prod, statusComplete;
|
|
1908
|
-
return _regenerator.default.wrap(function
|
|
1603
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
1909
1604
|
while (1) {
|
|
1910
|
-
switch (
|
|
1605
|
+
switch (_context14.prev = _context14.next) {
|
|
1911
1606
|
case 0:
|
|
1912
1607
|
data = {
|
|
1913
1608
|
articleId: product.id_article,
|
|
@@ -1915,7 +1610,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1915
1610
|
versionId: product.version,
|
|
1916
1611
|
status: result
|
|
1917
1612
|
};
|
|
1918
|
-
|
|
1613
|
+
_context14.next = 3;
|
|
1919
1614
|
return _axios.default.put("".concat(process.env.REACT_APP_RETAILER_REQUEST), data, {
|
|
1920
1615
|
headers: {
|
|
1921
1616
|
Authorization: token
|
|
@@ -1932,20 +1627,20 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1932
1627
|
prod.product.services_status = "[\"".concat(statusComplete, "\",\"").concat(statusComplete, "\",\"").concat(statusComplete, "\"]");
|
|
1933
1628
|
sessionStorage.setItem("productEdit", JSON.stringify(prod));
|
|
1934
1629
|
setProduct(prod);
|
|
1935
|
-
|
|
1936
|
-
|
|
1630
|
+
setShowGenericModal && setShowGenericModal(false);
|
|
1631
|
+
_context14.next = 15;
|
|
1937
1632
|
return loadData();
|
|
1938
1633
|
|
|
1939
1634
|
case 15:
|
|
1940
1635
|
case "end":
|
|
1941
|
-
return
|
|
1636
|
+
return _context14.stop();
|
|
1942
1637
|
}
|
|
1943
1638
|
}
|
|
1944
|
-
},
|
|
1639
|
+
}, _callee14);
|
|
1945
1640
|
}));
|
|
1946
1641
|
|
|
1947
|
-
return function evaluationToRetailer(
|
|
1948
|
-
return
|
|
1642
|
+
return function evaluationToRetailer(_x9) {
|
|
1643
|
+
return _ref15.apply(this, arguments);
|
|
1949
1644
|
};
|
|
1950
1645
|
}();
|
|
1951
1646
|
|
|
@@ -2003,7 +1698,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2003
1698
|
}
|
|
2004
1699
|
});
|
|
2005
1700
|
});
|
|
2006
|
-
|
|
1701
|
+
setShowGenericModal(true);
|
|
2007
1702
|
} else if (user.is_retailer) {
|
|
2008
1703
|
if (product.id_order || product.orderId) {
|
|
2009
1704
|
sendEvaluation("A");
|
|
@@ -2018,7 +1713,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2018
1713
|
}
|
|
2019
1714
|
});
|
|
2020
1715
|
});
|
|
2021
|
-
|
|
1716
|
+
setShowGenericModal(true);
|
|
2022
1717
|
}
|
|
2023
1718
|
} else {
|
|
2024
1719
|
sendEvaluation("A");
|
|
@@ -2028,7 +1723,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2028
1723
|
return;
|
|
2029
1724
|
} else if (user.is_retailer) {
|
|
2030
1725
|
if (product.id_order || product.orderId) {
|
|
2031
|
-
|
|
1726
|
+
setValidatedAll(true);
|
|
1727
|
+
setModalViewError(true);
|
|
2032
1728
|
} else {
|
|
2033
1729
|
setDataGenericModal(function (prev) {
|
|
2034
1730
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2040,10 +1736,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2040
1736
|
}
|
|
2041
1737
|
});
|
|
2042
1738
|
});
|
|
2043
|
-
|
|
1739
|
+
setShowGenericModal(true);
|
|
2044
1740
|
}
|
|
2045
1741
|
} else {
|
|
2046
|
-
|
|
1742
|
+
setValidatedAll(true);
|
|
1743
|
+
setModalViewError(true);
|
|
2047
1744
|
}
|
|
2048
1745
|
}
|
|
2049
1746
|
};
|
|
@@ -2053,7 +1750,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2053
1750
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2054
1751
|
setHeaderTop: setHeaderTop,
|
|
2055
1752
|
withChat: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.withChat,
|
|
2056
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.chatType,
|
|
2057
1753
|
productSelected: productSelected,
|
|
2058
1754
|
token: token,
|
|
2059
1755
|
activeRetailer: activeRetailer
|
|
@@ -2105,7 +1801,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2105
1801
|
}
|
|
2106
1802
|
});
|
|
2107
1803
|
});
|
|
2108
|
-
|
|
1804
|
+
setShowGenericModal(true);
|
|
2109
1805
|
} else if (user.is_retailer) {
|
|
2110
1806
|
if (product.id_order || product.orderId) {
|
|
2111
1807
|
validateAll("A");
|
|
@@ -2120,7 +1816,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2120
1816
|
}
|
|
2121
1817
|
});
|
|
2122
1818
|
});
|
|
2123
|
-
|
|
1819
|
+
setShowGenericModal(true);
|
|
2124
1820
|
}
|
|
2125
1821
|
} else {
|
|
2126
1822
|
validateAll("A");
|
|
@@ -2132,7 +1828,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2132
1828
|
} else if (user.is_retailer) {
|
|
2133
1829
|
if (product.id_order || product.orderId) {
|
|
2134
1830
|
setValidatedAll(true);
|
|
2135
|
-
|
|
1831
|
+
setModalViewError(true);
|
|
2136
1832
|
} else {
|
|
2137
1833
|
setDataGenericModal(function (prev) {
|
|
2138
1834
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2144,18 +1840,18 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2144
1840
|
}
|
|
2145
1841
|
});
|
|
2146
1842
|
});
|
|
2147
|
-
|
|
1843
|
+
setShowGenericModal(true);
|
|
2148
1844
|
}
|
|
2149
1845
|
} else {
|
|
2150
|
-
setShowRejectModal(true);
|
|
2151
1846
|
setValidatedAll(true);
|
|
1847
|
+
setModalViewError(true);
|
|
2152
1848
|
}
|
|
2153
1849
|
},
|
|
2154
1850
|
approve: function approve() {
|
|
2155
1851
|
return sendToEvaluation("A");
|
|
2156
1852
|
},
|
|
2157
1853
|
reject: function reject() {
|
|
2158
|
-
|
|
1854
|
+
return sendToEvaluation("R");
|
|
2159
1855
|
}
|
|
2160
1856
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2161
1857
|
tabsSections: tabsSections,
|
|
@@ -2263,20 +1959,20 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2263
1959
|
reviewed: crossComment
|
|
2264
1960
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2265
1961
|
buttonType: "circular-button accept-button",
|
|
2266
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2267
|
-
return _regenerator.default.wrap(function
|
|
1962
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1963
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
2268
1964
|
while (1) {
|
|
2269
|
-
switch (
|
|
1965
|
+
switch (_context15.prev = _context15.next) {
|
|
2270
1966
|
case 0:
|
|
2271
1967
|
setCrossComment(true);
|
|
2272
1968
|
commentRevised();
|
|
2273
1969
|
|
|
2274
1970
|
case 2:
|
|
2275
1971
|
case "end":
|
|
2276
|
-
return
|
|
1972
|
+
return _context15.stop();
|
|
2277
1973
|
}
|
|
2278
1974
|
}
|
|
2279
|
-
},
|
|
1975
|
+
}, _callee15);
|
|
2280
1976
|
}))
|
|
2281
1977
|
})]
|
|
2282
1978
|
})
|
|
@@ -2330,9 +2026,64 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2330
2026
|
onClick: function onClick() {
|
|
2331
2027
|
return setMessage("");
|
|
2332
2028
|
}
|
|
2333
|
-
}),
|
|
2334
|
-
close:
|
|
2335
|
-
|
|
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, {
|
|
2336
2087
|
modalId: "version-selector",
|
|
2337
2088
|
articleId: product.id_article,
|
|
2338
2089
|
setVersion: setVersion,
|
|
@@ -2340,53 +2091,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2340
2091
|
currentVersion: version,
|
|
2341
2092
|
setShowVersionSelector: setShowVersionSelector,
|
|
2342
2093
|
jwt: token
|
|
2343
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2344
|
-
title: "Agregar mensaje de rechazo",
|
|
2345
|
-
show: showRejectModal,
|
|
2346
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2347
|
-
label: "Caja de Comentario",
|
|
2348
|
-
inputType: "textarea",
|
|
2349
|
-
inputId: "modal-message-box",
|
|
2350
|
-
index: 0,
|
|
2351
|
-
color: "white"
|
|
2352
|
-
}),
|
|
2353
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2354
|
-
type: "white",
|
|
2355
|
-
label: "Cancelar",
|
|
2356
|
-
size: 12,
|
|
2357
|
-
onClick: function onClick() {
|
|
2358
|
-
setShowRejectModal(false);
|
|
2359
|
-
}
|
|
2360
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2361
|
-
type: "pink",
|
|
2362
|
-
label: "Aceptar",
|
|
2363
|
-
size: 12,
|
|
2364
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
2365
|
-
var body, messages;
|
|
2366
|
-
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
2367
|
-
while (1) {
|
|
2368
|
-
switch (_context22.prev = _context22.next) {
|
|
2369
|
-
case 0:
|
|
2370
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2371
|
-
messages = [{
|
|
2372
|
-
type: "message",
|
|
2373
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2374
|
-
}];
|
|
2375
|
-
_context22.next = 4;
|
|
2376
|
-
return createComment(messages, activeRetailer.id);
|
|
2377
|
-
|
|
2378
|
-
case 4:
|
|
2379
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2380
|
-
setShowRejectModal(false);
|
|
2381
|
-
|
|
2382
|
-
case 6:
|
|
2383
|
-
case "end":
|
|
2384
|
-
return _context22.stop();
|
|
2385
|
-
}
|
|
2386
|
-
}
|
|
2387
|
-
}, _callee22);
|
|
2388
|
-
}))
|
|
2389
|
-
}, "btn-Aceptar")]
|
|
2390
2094
|
})]
|
|
2391
2095
|
});
|
|
2392
2096
|
};
|