contentoh-components-library 21.4.60 → 21.4.62
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/molecules/BoxAttribute/styles.js +1 -1
- package/dist/components/molecules/BoxButtons/index.js +1 -0
- package/dist/components/molecules/TagAndInput/index.js +64 -3
- package/dist/components/organisms/InputGroup/index.js +153 -48
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +82 -146
- package/dist/components/pages/ProviderProductEdition/index.js +231 -203
- package/dist/components/pages/RetailerProductEdition/index.js +5 -5
- package/dist/global-files/data.js +8 -4
- package/package.json +1 -1
- package/src/assets/images/Icons/info.svg +8 -0
- package/src/components/atoms/TabSection/styles.js +23 -0
- package/src/components/molecules/BoxAttribute/BoxAttribute.stories.js +16 -0
- package/src/components/molecules/BoxAttribute/index.js +71 -0
- package/src/components/molecules/BoxAttribute/styles.js +38 -0
- package/src/components/molecules/BoxButtons/BoxButtons.stories.js +15 -0
- package/src/components/molecules/BoxButtons/index.js +28 -0
- package/src/components/molecules/BoxButtons/styles.js +43 -0
- package/src/components/molecules/TagAndInput/index.js +52 -8
- package/src/components/organisms/Box/Box.stories.js +17 -0
- package/src/components/organisms/Box/index.js +103 -0
- package/src/components/organisms/Box/styles.js +48 -0
- package/src/components/organisms/BoxOnboarding/BoxOnboarding.stories.js +17 -0
- package/src/components/organisms/BoxOnboarding/index.js +60 -0
- package/src/components/organisms/BoxOnboarding/styles.js +44 -0
- package/src/components/organisms/InputGroup/index.js +233 -87
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +86 -175
- package/src/components/pages/ProviderProductEdition/index.js +97 -73
- package/src/components/pages/ProviderProductEdition/out.json +0 -0
- package/src/components/pages/RetailerProductEdition/index.js +7 -5
- package/src/global-files/data.js +11 -2
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
- package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -90
- package/dist/components/atoms/ImageCarousel/index.js +0 -120
- package/dist/components/atoms/ImageCarousel/styles.js +0 -18
- package/dist/components/atoms/PercentTag/PercentTag.stories.js +0 -31
- package/dist/components/atoms/PercentTag/index.js +0 -23
- package/dist/components/atoms/PercentTag/styles.js +0 -22
- package/dist/components/atoms/RatingStars/RatingStars.stories.js +0 -30
- package/dist/components/atoms/RatingStars/index.js +0 -53
- package/dist/components/atoms/RatingStars/styles.js +0 -18
- package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -48
- package/dist/components/atoms/RetailerCatalog/index.js +0 -69
- package/dist/components/atoms/RetailerCatalog/styles.js +0 -20
- package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +0 -33
- package/dist/components/atoms/RetailerOption/index.js +0 -62
- package/dist/components/atoms/RetailerOption/styles.js +0 -20
- package/dist/components/atoms/RetailersList/RetailersList.stories.js +0 -45
- package/dist/components/atoms/RetailersList/index.js +0 -46
- package/dist/components/atoms/RetailersList/styles.js +0 -18
- package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +0 -73
- package/dist/components/atoms/UserCatalog/index.js +0 -101
- package/dist/components/atoms/UserCatalog/styles.js +0 -18
- package/dist/components/atoms/UserOption/UserOption.stories.js +0 -40
- package/dist/components/atoms/UserOption/index.js +0 -130
- package/dist/components/atoms/UserOption/styles.js +0 -20
- package/dist/components/atoms/UserSelector/UserSelector.stories.js +0 -40
- package/dist/components/atoms/UserSelector/index.js +0 -98
- package/dist/components/atoms/UserSelector/styles.js +0 -32
- package/dist/components/molecules/GridItem/GridItem.stories.js +0 -123
- package/dist/components/molecules/GridItem/index.js +0 -152
- package/dist/components/molecules/GridItem/styles.js +0 -20
- package/dist/components/molecules/HeaderItem/ColumnItem.js +0 -23
- package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +0 -70
- package/dist/components/molecules/HeaderItem/index.js +0 -42
- package/dist/components/molecules/HeaderItem/styles.js +0 -30
- package/dist/components/molecules/RowItem/ColumnItem.js +0 -23
- package/dist/components/molecules/RowItem/RowItem.stories.js +0 -5242
- package/dist/components/molecules/RowItem/index.js +0 -58
- package/dist/components/molecules/RowItem/styles.js +0 -30
- package/dist/components/organisms/GridProducts/GridProducts.stories.js +0 -5097
- package/dist/components/organisms/GridProducts/index.js +0 -63
- package/dist/components/organisms/GridProducts/styles.js +0 -18
- package/dist/components/organisms/GridProducts/utils.js +0 -149
|
@@ -264,6 +264,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
264
264
|
showModal = _useState14[0],
|
|
265
265
|
setShowModal = _useState14[1];
|
|
266
266
|
|
|
267
|
+
var _useState15 = (0, _react.useState)(),
|
|
268
|
+
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
269
|
+
boxData = _useState16[0],
|
|
270
|
+
setBoxData = _useState16[1];
|
|
271
|
+
|
|
267
272
|
var _useDropzone = (0, _reactDropzone.useDropzone)({
|
|
268
273
|
accept: "image/*",
|
|
269
274
|
noKeyboard: true,
|
|
@@ -326,141 +331,141 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
326
331
|
getRootProps = _useDropzone.getRootProps,
|
|
327
332
|
getInputProps = _useDropzone.getInputProps;
|
|
328
333
|
|
|
329
|
-
var _useState15 = (0, _react.useState)([]),
|
|
330
|
-
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
331
|
-
updatedDatasheets = _useState16[0],
|
|
332
|
-
setUpdatedDatasheets = _useState16[1];
|
|
333
|
-
|
|
334
334
|
var _useState17 = (0, _react.useState)([]),
|
|
335
335
|
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
336
|
-
|
|
337
|
-
|
|
336
|
+
updatedDatasheets = _useState18[0],
|
|
337
|
+
setUpdatedDatasheets = _useState18[1];
|
|
338
338
|
|
|
339
|
-
var _useState19 = (0, _react.useState)(
|
|
339
|
+
var _useState19 = (0, _react.useState)([]),
|
|
340
340
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
341
|
-
|
|
342
|
-
|
|
341
|
+
updatedDescriptions = _useState20[0],
|
|
342
|
+
setUpdatedDescriptions = _useState20[1];
|
|
343
343
|
|
|
344
|
-
var _useState21 = (0, _react.useState)(),
|
|
344
|
+
var _useState21 = (0, _react.useState)(false),
|
|
345
345
|
_useState22 = (0, _slicedToArray2.default)(_useState21, 2),
|
|
346
|
-
|
|
347
|
-
|
|
346
|
+
imagesUploaded = _useState22[0],
|
|
347
|
+
setImagesUploaded = _useState22[1];
|
|
348
|
+
|
|
349
|
+
var _useState23 = (0, _react.useState)(),
|
|
350
|
+
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
351
|
+
dataImages = _useState24[0],
|
|
352
|
+
setDataImages = _useState24[1];
|
|
348
353
|
|
|
349
|
-
var
|
|
354
|
+
var _useState25 = (0, _react.useState)(product !== null && product !== void 0 && product.retailers ? new Array(product === null || product === void 0 ? void 0 : (_product$retailers = product.retailers) === null || _product$retailers === void 0 ? void 0 : _product$retailers.length).fill({
|
|
350
355
|
percentage: 0
|
|
351
356
|
}) : new Array(product === null || product === void 0 ? void 0 : (_product$retailersAva = product.retailersAvailable) === null || _product$retailersAva === void 0 ? void 0 : _product$retailersAva.length).fill({
|
|
352
357
|
percentage: 0
|
|
353
358
|
})),
|
|
354
|
-
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
355
|
-
percentages = _useState24[0],
|
|
356
|
-
setPercentages = _useState24[1];
|
|
357
|
-
|
|
358
|
-
var _useState25 = (0, _react.useState)(0),
|
|
359
359
|
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
360
|
-
|
|
361
|
-
|
|
360
|
+
percentages = _useState26[0],
|
|
361
|
+
setPercentages = _useState26[1];
|
|
362
362
|
|
|
363
|
-
var _useState27 = (0, _react.useState)(
|
|
363
|
+
var _useState27 = (0, _react.useState)(0),
|
|
364
364
|
_useState28 = (0, _slicedToArray2.default)(_useState27, 2),
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
activePercentage = _useState28[0],
|
|
366
|
+
setActivePercentage = _useState28[1];
|
|
367
367
|
|
|
368
|
-
var _useState29 = (0, _react.useState)(
|
|
368
|
+
var _useState29 = (0, _react.useState)({}),
|
|
369
369
|
_useState30 = (0, _slicedToArray2.default)(_useState29, 2),
|
|
370
|
-
|
|
371
|
-
|
|
370
|
+
activeRetailer = _useState30[0],
|
|
371
|
+
setActiveRetailer = _useState30[1];
|
|
372
372
|
|
|
373
373
|
var _useState31 = (0, _react.useState)([]),
|
|
374
374
|
_useState32 = (0, _slicedToArray2.default)(_useState31, 2),
|
|
375
|
-
|
|
376
|
-
|
|
375
|
+
services = _useState32[0],
|
|
376
|
+
setServices = _useState32[1];
|
|
377
377
|
|
|
378
|
-
var _useState33 = (0, _react.useState)(
|
|
378
|
+
var _useState33 = (0, _react.useState)([]),
|
|
379
379
|
_useState34 = (0, _slicedToArray2.default)(_useState33, 2),
|
|
380
|
-
|
|
381
|
-
|
|
380
|
+
servicesData = _useState34[0],
|
|
381
|
+
setServicesData = _useState34[1];
|
|
382
382
|
|
|
383
|
-
var _useState35 = (0, _react.useState)(
|
|
383
|
+
var _useState35 = (0, _react.useState)(""),
|
|
384
384
|
_useState36 = (0, _slicedToArray2.default)(_useState35, 2),
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
message = _useState36[0],
|
|
386
|
+
setMessage = _useState36[1];
|
|
387
387
|
|
|
388
|
-
var _useState37 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("
|
|
388
|
+
var _useState37 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
|
|
389
389
|
_useState38 = (0, _slicedToArray2.default)(_useState37, 2),
|
|
390
|
-
|
|
391
|
-
|
|
390
|
+
product = _useState38[0],
|
|
391
|
+
setProduct = _useState38[1];
|
|
392
392
|
|
|
393
|
-
var _useState39 = (0, _react.useState)(
|
|
393
|
+
var _useState39 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productEdit")) ? JSON.parse(sessionStorage.getItem("productEdit")) : productToEdit),
|
|
394
394
|
_useState40 = (0, _slicedToArray2.default)(_useState39, 2),
|
|
395
|
-
|
|
396
|
-
|
|
395
|
+
productEdit = _useState40[0],
|
|
396
|
+
setProductEdit = _useState40[1];
|
|
397
397
|
|
|
398
|
-
var _useState41 = (0, _react.useState)(
|
|
399
|
-
_useState42 = (0, _slicedToArray2.default)(_useState41,
|
|
400
|
-
|
|
398
|
+
var _useState41 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
|
|
399
|
+
_useState42 = (0, _slicedToArray2.default)(_useState41, 2),
|
|
400
|
+
version = _useState42[0],
|
|
401
|
+
setVersion = _useState42[1];
|
|
401
402
|
|
|
402
|
-
var _useState43 = (0, _react.useState)(
|
|
403
|
-
_useState44 = (0, _slicedToArray2.default)(_useState43,
|
|
404
|
-
|
|
405
|
-
setComment = _useState44[1];
|
|
403
|
+
var _useState43 = (0, _react.useState)({}),
|
|
404
|
+
_useState44 = (0, _slicedToArray2.default)(_useState43, 1),
|
|
405
|
+
comments = _useState44[0];
|
|
406
406
|
|
|
407
|
-
var _useState45 = (0, _react.useState)(
|
|
407
|
+
var _useState45 = (0, _react.useState)(""),
|
|
408
408
|
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
comment = _useState46[0],
|
|
410
|
+
setComment = _useState46[1];
|
|
411
411
|
|
|
412
|
-
var _useState47 = (0, _react.useState)(
|
|
412
|
+
var _useState47 = (0, _react.useState)(false),
|
|
413
413
|
_useState48 = (0, _slicedToArray2.default)(_useState47, 2),
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
crossComment = _useState48[0],
|
|
415
|
+
setCrossComment = _useState48[1];
|
|
416
416
|
|
|
417
|
-
var _useState49 = (0, _react.useState)(
|
|
417
|
+
var _useState49 = (0, _react.useState)([]),
|
|
418
418
|
_useState50 = (0, _slicedToArray2.default)(_useState49, 2),
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
userGroups = _useState50[0],
|
|
420
|
+
setUserGroups = _useState50[1];
|
|
421
421
|
|
|
422
|
-
var _useState51 = (0, _react.useState)(
|
|
422
|
+
var _useState51 = (0, _react.useState)({}),
|
|
423
423
|
_useState52 = (0, _slicedToArray2.default)(_useState51, 2),
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
assig = _useState52[0],
|
|
425
|
+
setAssig = _useState52[1];
|
|
426
426
|
|
|
427
427
|
var _useState53 = (0, _react.useState)([]),
|
|
428
428
|
_useState54 = (0, _slicedToArray2.default)(_useState53, 2),
|
|
429
|
-
|
|
430
|
-
|
|
429
|
+
selectedImages = _useState54[0],
|
|
430
|
+
setSelectedImages = _useState54[1];
|
|
431
431
|
|
|
432
|
-
var _useState55 = (0, _react.useState)(
|
|
432
|
+
var _useState55 = (0, _react.useState)([]),
|
|
433
433
|
_useState56 = (0, _slicedToArray2.default)(_useState55, 2),
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
434
|
+
componentsArray = _useState56[0],
|
|
435
|
+
setComponentsArray = _useState56[1];
|
|
438
436
|
|
|
439
|
-
var _useState57 = (0, _react.useState)(
|
|
437
|
+
var _useState57 = (0, _react.useState)(false),
|
|
440
438
|
_useState58 = (0, _slicedToArray2.default)(_useState57, 2),
|
|
441
|
-
|
|
442
|
-
|
|
439
|
+
checkAll = _useState58[0],
|
|
440
|
+
setCheckAll = _useState58[1];
|
|
443
441
|
|
|
444
|
-
var
|
|
442
|
+
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
443
|
+
|
|
444
|
+
var _useState59 = (0, _react.useState)(true),
|
|
445
445
|
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
446
|
-
|
|
447
|
-
|
|
446
|
+
loading = _useState60[0],
|
|
447
|
+
setLoading = _useState60[1];
|
|
448
448
|
|
|
449
|
-
var _useState61 = (0, _react.useState)(
|
|
449
|
+
var _useState61 = (0, _react.useState)(false),
|
|
450
|
+
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
451
|
+
validatedAll = _useState62[0],
|
|
452
|
+
setValidatedAll = _useState62[1];
|
|
453
|
+
|
|
454
|
+
var _useState63 = (0, _react.useState)({
|
|
450
455
|
"Ficha técnica": null,
|
|
451
456
|
Descripción: null,
|
|
452
457
|
Imágenes: null
|
|
453
458
|
}),
|
|
454
|
-
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
455
|
-
origin = _useState62[0],
|
|
456
|
-
setOrigin = _useState62[1];
|
|
457
|
-
|
|
458
|
-
var _useState63 = (0, _react.useState)(false),
|
|
459
459
|
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
460
|
-
|
|
461
|
-
|
|
460
|
+
origin = _useState64[0],
|
|
461
|
+
setOrigin = _useState64[1];
|
|
462
|
+
|
|
463
|
+
var _useState65 = (0, _react.useState)(false),
|
|
464
|
+
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
465
|
+
inCart = _useState66[0],
|
|
466
|
+
setInCart = _useState66[1];
|
|
462
467
|
|
|
463
|
-
var
|
|
468
|
+
var _useState67 = (0, _react.useState)({
|
|
464
469
|
message: "¿Estás seguro de continuar?",
|
|
465
470
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
466
471
|
button1: {
|
|
@@ -475,34 +480,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
475
480
|
},
|
|
476
481
|
img: _defaultProfileImage.default
|
|
477
482
|
}),
|
|
478
|
-
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
479
|
-
dataGenericModal = _useState66[0],
|
|
480
|
-
setDataGenericModal = _useState66[1];
|
|
481
|
-
|
|
482
|
-
var _useState67 = (0, _react.useState)(null),
|
|
483
483
|
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
dataGenericModal = _useState68[0],
|
|
485
|
+
setDataGenericModal = _useState68[1];
|
|
486
486
|
|
|
487
|
-
var _useState69 = (0, _react.useState)(
|
|
487
|
+
var _useState69 = (0, _react.useState)(null),
|
|
488
488
|
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
socketType = _useState70[0],
|
|
490
|
+
setSocketType = _useState70[1];
|
|
491
491
|
|
|
492
|
-
var _useState71 = (0, _react.useState)(
|
|
492
|
+
var _useState71 = (0, _react.useState)(loading),
|
|
493
493
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
494
|
-
|
|
495
|
-
|
|
494
|
+
saving = _useState72[0],
|
|
495
|
+
setSaving = _useState72[1];
|
|
496
|
+
|
|
497
|
+
var _useState73 = (0, _react.useState)(product.statusByRetailer),
|
|
498
|
+
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
499
|
+
retailerStatus = _useState74[0],
|
|
500
|
+
setRetailerStatus = _useState74[1];
|
|
496
501
|
|
|
497
502
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
498
503
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
499
504
|
showVersionSelector = _useCloseModal2[0],
|
|
500
505
|
setShowVersionSelector = _useCloseModal2[1];
|
|
501
506
|
|
|
502
|
-
var
|
|
503
|
-
|
|
504
|
-
globalModal =
|
|
505
|
-
setGlobalModal =
|
|
507
|
+
var _useState75 = (0, _react.useState)(),
|
|
508
|
+
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
509
|
+
globalModal = _useState76[0],
|
|
510
|
+
setGlobalModal = _useState76[1];
|
|
506
511
|
|
|
507
512
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
508
513
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -899,7 +904,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
899
904
|
switch (_context8.prev = _context8.next) {
|
|
900
905
|
case 0:
|
|
901
906
|
_context8.next = 2;
|
|
902
|
-
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);
|
|
907
|
+
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, token);
|
|
903
908
|
|
|
904
909
|
case 2:
|
|
905
910
|
services = _context8.sent;
|
|
@@ -1224,53 +1229,74 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1224
1229
|
|
|
1225
1230
|
var saveDatasheets = /*#__PURE__*/function () {
|
|
1226
1231
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1227
|
-
var dataObject, res;
|
|
1232
|
+
var parseBoxData, dataObject, res;
|
|
1228
1233
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1229
1234
|
while (1) {
|
|
1230
1235
|
switch (_context12.prev = _context12.next) {
|
|
1231
1236
|
case 0:
|
|
1232
|
-
|
|
1233
|
-
|
|
1237
|
+
parseBoxData = [];
|
|
1238
|
+
Object.entries(boxData).forEach(function (_ref11, index) {
|
|
1239
|
+
var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
|
|
1240
|
+
box = _ref12[1];
|
|
1241
|
+
|
|
1242
|
+
var value = box.value;
|
|
1243
|
+
var attributesIds = Object.keys(value);
|
|
1244
|
+
attributesIds.forEach(function (attributeId) {
|
|
1245
|
+
var boxId = index + 1;
|
|
1246
|
+
var valueOfAtribute = value[attributeId];
|
|
1247
|
+
parseBoxData.push({
|
|
1248
|
+
attributeId: attributeId,
|
|
1249
|
+
value: valueOfAtribute,
|
|
1250
|
+
boxId: boxId
|
|
1251
|
+
});
|
|
1252
|
+
});
|
|
1253
|
+
});
|
|
1254
|
+
dataObject = (0, _objectSpread3.default)({
|
|
1234
1255
|
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1235
1256
|
articleData: updatedDatasheets
|
|
1236
|
-
}
|
|
1257
|
+
}, parseBoxData.length > 0 && {
|
|
1258
|
+
boxData: parseBoxData
|
|
1259
|
+
});
|
|
1237
1260
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
1238
|
-
_context12.prev =
|
|
1239
|
-
_context12.next =
|
|
1261
|
+
_context12.prev = 4;
|
|
1262
|
+
_context12.next = 7;
|
|
1240
1263
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
|
|
1241
1264
|
headers: {
|
|
1242
1265
|
Authorization: token
|
|
1243
1266
|
}
|
|
1244
1267
|
});
|
|
1245
1268
|
|
|
1246
|
-
case
|
|
1269
|
+
case 7:
|
|
1247
1270
|
res = _context12.sent;
|
|
1248
1271
|
|
|
1249
1272
|
if (!(res.data.statusCode === 200)) {
|
|
1250
|
-
_context12.next =
|
|
1273
|
+
_context12.next = 13;
|
|
1251
1274
|
break;
|
|
1252
1275
|
}
|
|
1253
1276
|
|
|
1254
1277
|
setUpdatedDatasheets([]);
|
|
1255
1278
|
setMessage("Fichas técnicas guardadas");
|
|
1256
|
-
_context12.next =
|
|
1279
|
+
_context12.next = 13;
|
|
1257
1280
|
return loadData();
|
|
1258
1281
|
|
|
1259
|
-
case
|
|
1260
|
-
_context12.next =
|
|
1282
|
+
case 13:
|
|
1283
|
+
_context12.next = 18;
|
|
1261
1284
|
break;
|
|
1262
1285
|
|
|
1263
|
-
case
|
|
1264
|
-
_context12.prev =
|
|
1265
|
-
_context12.t0 = _context12["catch"](
|
|
1286
|
+
case 15:
|
|
1287
|
+
_context12.prev = 15;
|
|
1288
|
+
_context12.t0 = _context12["catch"](4);
|
|
1266
1289
|
console.log(_context12.t0);
|
|
1267
1290
|
|
|
1268
|
-
case
|
|
1291
|
+
case 18:
|
|
1292
|
+
console.log(dataObject);
|
|
1293
|
+
|
|
1294
|
+
case 19:
|
|
1269
1295
|
case "end":
|
|
1270
1296
|
return _context12.stop();
|
|
1271
1297
|
}
|
|
1272
1298
|
}
|
|
1273
|
-
}, _callee12, null, [[
|
|
1299
|
+
}, _callee12, null, [[4, 15]]);
|
|
1274
1300
|
}));
|
|
1275
1301
|
|
|
1276
1302
|
return function saveDatasheets() {
|
|
@@ -1469,7 +1495,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1469
1495
|
};
|
|
1470
1496
|
|
|
1471
1497
|
var createComment = /*#__PURE__*/function () {
|
|
1472
|
-
var
|
|
1498
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
|
|
1473
1499
|
var concept, data;
|
|
1474
1500
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1475
1501
|
while (1) {
|
|
@@ -1516,7 +1542,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1516
1542
|
}));
|
|
1517
1543
|
|
|
1518
1544
|
return function createComment(_x4, _x5, _x6) {
|
|
1519
|
-
return
|
|
1545
|
+
return _ref15.apply(this, arguments);
|
|
1520
1546
|
};
|
|
1521
1547
|
}();
|
|
1522
1548
|
|
|
@@ -1525,7 +1551,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1525
1551
|
}, [activeTab]);
|
|
1526
1552
|
|
|
1527
1553
|
var commentRevised = /*#__PURE__*/function () {
|
|
1528
|
-
var
|
|
1554
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
1529
1555
|
var data;
|
|
1530
1556
|
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
1531
1557
|
while (1) {
|
|
@@ -1553,12 +1579,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1553
1579
|
}));
|
|
1554
1580
|
|
|
1555
1581
|
return function commentRevised() {
|
|
1556
|
-
return
|
|
1582
|
+
return _ref16.apply(this, arguments);
|
|
1557
1583
|
};
|
|
1558
1584
|
}();
|
|
1559
1585
|
|
|
1560
1586
|
var setAssignation = /*#__PURE__*/function () {
|
|
1561
|
-
var
|
|
1587
|
+
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(assignationType, assignationId) {
|
|
1562
1588
|
var concept, productTemp, data;
|
|
1563
1589
|
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
1564
1590
|
while (1) {
|
|
@@ -1615,7 +1641,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1615
1641
|
}));
|
|
1616
1642
|
|
|
1617
1643
|
return function setAssignation(_x7, _x8) {
|
|
1618
|
-
return
|
|
1644
|
+
return _ref17.apply(this, arguments);
|
|
1619
1645
|
};
|
|
1620
1646
|
}();
|
|
1621
1647
|
|
|
@@ -1699,10 +1725,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1699
1725
|
};
|
|
1700
1726
|
|
|
1701
1727
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
1702
|
-
var
|
|
1728
|
+
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1703
1729
|
var _productTemp$id_order2;
|
|
1704
1730
|
|
|
1705
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res,
|
|
1731
|
+
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1706
1732
|
|
|
1707
1733
|
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1708
1734
|
while (1) {
|
|
@@ -1723,24 +1749,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1723
1749
|
};
|
|
1724
1750
|
retailerId = activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id;
|
|
1725
1751
|
_context18.prev = 9;
|
|
1726
|
-
body = {
|
|
1727
|
-
orderArticleRetailers: [{
|
|
1728
|
-
orderId: orderId,
|
|
1729
|
-
articleId: articleId,
|
|
1730
|
-
retailersIds: [activeRetailer.id]
|
|
1731
|
-
}],
|
|
1732
|
-
isAproved: false,
|
|
1733
|
-
service: concept
|
|
1734
|
-
};
|
|
1735
1752
|
|
|
1736
1753
|
if (!result) {
|
|
1737
|
-
_context18.next =
|
|
1754
|
+
_context18.next = 27;
|
|
1738
1755
|
break;
|
|
1739
1756
|
}
|
|
1740
1757
|
|
|
1741
|
-
|
|
1758
|
+
data.result = result;
|
|
1759
|
+
data.retailerId = retailerId;
|
|
1742
1760
|
_context18.next = 15;
|
|
1743
|
-
return _axios.default.
|
|
1761
|
+
return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1744
1762
|
headers: {
|
|
1745
1763
|
Authorization: token
|
|
1746
1764
|
}
|
|
@@ -1748,42 +1766,43 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1748
1766
|
|
|
1749
1767
|
case 15:
|
|
1750
1768
|
res = _context18.sent;
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
orderStatus = statusObject["generalStatus"];
|
|
1755
|
-
serviceStatus = newStatuses["".concat(getConcept(activeTab), "Status")];
|
|
1769
|
+
newStatuses = JSON.parse(res.data.body);
|
|
1770
|
+
orderStatus = newStatuses.newOrderStatus;
|
|
1771
|
+
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(getConcept(activeTab), "Status")];
|
|
1756
1772
|
newProductEdit = productEdit;
|
|
1757
1773
|
newProductEdit.product[sectionStatusKey] = serviceStatus;
|
|
1758
1774
|
setProductEdit(newProductEdit);
|
|
1759
|
-
showSurveyByProvider = !user.is_retailer && orderStatus === "AP";
|
|
1760
|
-
showSurveyByRetailer = user.is_retailer && orderStatus === "ACA";
|
|
1775
|
+
showSurveyByProvider = !user.is_retailer && orderStatus[orderId] === "AP";
|
|
1776
|
+
showSurveyByRetailer = user.is_retailer && orderStatus[orderId] === "ACA";
|
|
1761
1777
|
showSurvey && showSurvey(showSurveyByProvider || showSurveyByRetailer);
|
|
1762
|
-
_context18.next =
|
|
1778
|
+
_context18.next = 30;
|
|
1763
1779
|
break;
|
|
1764
1780
|
|
|
1765
|
-
case
|
|
1766
|
-
_context18.next =
|
|
1767
|
-
return _axios.default.
|
|
1781
|
+
case 27:
|
|
1782
|
+
_context18.next = 29;
|
|
1783
|
+
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1768
1784
|
headers: {
|
|
1769
1785
|
Authorization: token
|
|
1770
1786
|
}
|
|
1771
1787
|
});
|
|
1772
1788
|
|
|
1773
|
-
case
|
|
1789
|
+
case 29:
|
|
1774
1790
|
res = _context18.sent;
|
|
1775
1791
|
|
|
1776
|
-
case
|
|
1792
|
+
case 30:
|
|
1777
1793
|
if (res.data.statusCode === 200) {
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
productTemp.status = _statusObject["generalStatus"];
|
|
1794
|
+
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1795
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1781
1796
|
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1782
|
-
retailerStatusCopy[activeRetailer.id][concept] =
|
|
1797
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1783
1798
|
setRetailerStatus(retailerStatusCopy);
|
|
1784
1799
|
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1785
|
-
|
|
1786
|
-
|
|
1800
|
+
|
|
1801
|
+
if (newServiceStatus) {
|
|
1802
|
+
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1803
|
+
productTemp["".concat(concept, "_status")] = status;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1787
1806
|
setProduct(productTemp);
|
|
1788
1807
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1789
1808
|
setOrigin(function (prev) {
|
|
@@ -1791,33 +1810,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1791
1810
|
});
|
|
1792
1811
|
}
|
|
1793
1812
|
|
|
1794
|
-
_context18.next =
|
|
1813
|
+
_context18.next = 36;
|
|
1795
1814
|
break;
|
|
1796
1815
|
|
|
1797
|
-
case
|
|
1798
|
-
_context18.prev =
|
|
1816
|
+
case 33:
|
|
1817
|
+
_context18.prev = 33;
|
|
1799
1818
|
_context18.t0 = _context18["catch"](9);
|
|
1800
1819
|
console.log(_context18.t0);
|
|
1801
1820
|
|
|
1802
|
-
case
|
|
1821
|
+
case 36:
|
|
1803
1822
|
loadData();
|
|
1804
1823
|
|
|
1805
|
-
case
|
|
1824
|
+
case 37:
|
|
1806
1825
|
case "end":
|
|
1807
1826
|
return _context18.stop();
|
|
1808
1827
|
}
|
|
1809
1828
|
}
|
|
1810
|
-
}, _callee18, null, [[9,
|
|
1829
|
+
}, _callee18, null, [[9, 33]]);
|
|
1811
1830
|
}));
|
|
1812
1831
|
|
|
1813
1832
|
return function sendEvaluation(_x9) {
|
|
1814
|
-
return
|
|
1833
|
+
return _ref18.apply(this, arguments);
|
|
1815
1834
|
};
|
|
1816
1835
|
}();
|
|
1817
1836
|
|
|
1818
1837
|
var validateAll = /*#__PURE__*/function () {
|
|
1819
|
-
var
|
|
1820
|
-
var _product$id_order2, evaluationArray, conceptArray,
|
|
1838
|
+
var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1839
|
+
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1821
1840
|
|
|
1822
1841
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1823
1842
|
while (1) {
|
|
@@ -1827,35 +1846,35 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1827
1846
|
setLoading(true);
|
|
1828
1847
|
evaluationArray = [];
|
|
1829
1848
|
conceptArray = ["description", "datasheet", "images"];
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
body = {
|
|
1836
|
-
orderArticleRetailers: [{
|
|
1837
|
-
orderId: (_product$id_order2 = product.id_order) !== null && _product$id_order2 !== void 0 ? _product$id_order2 : product.orderId,
|
|
1838
|
-
articleId: product.article.id_article,
|
|
1839
|
-
retailersIds: retailersIds
|
|
1840
|
-
}],
|
|
1841
|
-
isAproved: isAproved
|
|
1849
|
+
dataGeneral = {
|
|
1850
|
+
articleId: product.id_article,
|
|
1851
|
+
orderId: (_product$id_order2 = product.id_order) !== null && _product$id_order2 !== void 0 ? _product$id_order2 : product.orderId,
|
|
1852
|
+
result: result,
|
|
1853
|
+
isAproved: result === "A"
|
|
1842
1854
|
};
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1855
|
+
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1856
|
+
var service = ret.service,
|
|
1857
|
+
id_retailer = ret.id_retailer;
|
|
1858
|
+
var data = {};
|
|
1859
|
+
data = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, dataGeneral), {}, {
|
|
1860
|
+
concept: service,
|
|
1861
|
+
retailerId: id_retailer,
|
|
1862
|
+
evalStatus: retailerStatus[id_retailer][service]
|
|
1863
|
+
});
|
|
1864
|
+
evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1846
1865
|
headers: {
|
|
1847
1866
|
Authorization: token
|
|
1848
1867
|
}
|
|
1849
1868
|
}));
|
|
1850
1869
|
});
|
|
1851
|
-
_context19.next =
|
|
1870
|
+
_context19.next = 8;
|
|
1852
1871
|
return Promise.all(evaluationArray);
|
|
1853
1872
|
|
|
1854
|
-
case
|
|
1873
|
+
case 8:
|
|
1855
1874
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1856
1875
|
productTemp = product;
|
|
1857
1876
|
status = "".concat(result).concat(userType);
|
|
1858
|
-
productTemp.
|
|
1877
|
+
productTemp.article_status = status;
|
|
1859
1878
|
productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : status;
|
|
1860
1879
|
productTemp.description_status = productTemp.description_status === "NA" ? "NA" : status;
|
|
1861
1880
|
productTemp.images_status = productTemp.images_status === "NA" ? "NA" : status;
|
|
@@ -1881,33 +1900,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1881
1900
|
idCategory: productTemp.article.id_category,
|
|
1882
1901
|
product: productTemp
|
|
1883
1902
|
}));
|
|
1884
|
-
_context19.next =
|
|
1903
|
+
_context19.next = 25;
|
|
1885
1904
|
return loadData();
|
|
1886
1905
|
|
|
1887
|
-
case
|
|
1888
|
-
_context19.next =
|
|
1906
|
+
case 25:
|
|
1907
|
+
_context19.next = 30;
|
|
1889
1908
|
break;
|
|
1890
1909
|
|
|
1891
|
-
case
|
|
1892
|
-
_context19.prev =
|
|
1910
|
+
case 27:
|
|
1911
|
+
_context19.prev = 27;
|
|
1893
1912
|
_context19.t0 = _context19["catch"](0);
|
|
1894
1913
|
console.log(_context19.t0);
|
|
1895
1914
|
|
|
1896
|
-
case
|
|
1915
|
+
case 30:
|
|
1897
1916
|
case "end":
|
|
1898
1917
|
return _context19.stop();
|
|
1899
1918
|
}
|
|
1900
1919
|
}
|
|
1901
|
-
}, _callee19, null, [[0,
|
|
1920
|
+
}, _callee19, null, [[0, 27]]);
|
|
1902
1921
|
}));
|
|
1903
1922
|
|
|
1904
1923
|
return function validateAll(_x10) {
|
|
1905
|
-
return
|
|
1924
|
+
return _ref19.apply(this, arguments);
|
|
1906
1925
|
};
|
|
1907
1926
|
}();
|
|
1908
1927
|
|
|
1909
1928
|
var evaluationToRetailer = /*#__PURE__*/function () {
|
|
1910
|
-
var
|
|
1929
|
+
var _ref20 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(result) {
|
|
1911
1930
|
var data, prod, statusComplete;
|
|
1912
1931
|
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
1913
1932
|
while (1) {
|
|
@@ -1949,7 +1968,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1949
1968
|
}));
|
|
1950
1969
|
|
|
1951
1970
|
return function evaluationToRetailer(_x11) {
|
|
1952
|
-
return
|
|
1971
|
+
return _ref20.apply(this, arguments);
|
|
1953
1972
|
};
|
|
1954
1973
|
}();
|
|
1955
1974
|
|
|
@@ -2213,17 +2232,26 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2213
2232
|
setSelectedImages: setSelectedImages,
|
|
2214
2233
|
checkAll: checkAll,
|
|
2215
2234
|
setCheckAll: setCheckAll
|
|
2216
|
-
}), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : product.datasheet_status) !== "NS" ? (
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2235
|
+
}), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : product.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2236
|
+
children: (_datasheets$ = datasheets[0]) === null || _datasheets$ === void 0 ? void 0 : (_datasheets$$data = _datasheets$.data) === null || _datasheets$$data === void 0 ? void 0 : _datasheets$$data.map(function (dataGroup, index) {
|
|
2237
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
2238
|
+
articleId: product.id_article,
|
|
2239
|
+
version: version,
|
|
2240
|
+
activeSection: activeTab,
|
|
2241
|
+
inputGroup: dataGroup,
|
|
2242
|
+
dataInputs: datasheets[1],
|
|
2243
|
+
updatedDatasheets: updatedDatasheets,
|
|
2244
|
+
setUpdatedDatasheets: setUpdatedDatasheets,
|
|
2245
|
+
isShowbox: true,
|
|
2246
|
+
activeRetailer: services[0][activeRetailer.id],
|
|
2247
|
+
groupData: services[0][activeRetailer.id].data,
|
|
2248
|
+
setUpdatedBoxData: function setUpdatedBoxData(e) {
|
|
2249
|
+
setBoxData(e);
|
|
2250
|
+
},
|
|
2251
|
+
index: index //enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
|
|
2252
|
+
|
|
2253
|
+
}, index + "-" + activeRetailer.name);
|
|
2254
|
+
})
|
|
2227
2255
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2228
2256
|
text: "No cuentas con este servicio",
|
|
2229
2257
|
headerType: "input-name-header"
|