contentoh-components-library 21.4.7 → 21.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/.env.development +1 -5
  2. package/.env.production +1 -3
  3. package/dist/assets/fonts/roboto/LICENSE.txt +202 -0
  4. package/dist/components/atoms/Avatar/index.js +2 -3
  5. package/dist/components/atoms/Card/index.js +5 -46
  6. package/dist/components/atoms/Card/styles.js +1 -3
  7. package/dist/components/atoms/CheckBox/index.js +2 -7
  8. package/dist/components/atoms/CheckBox/styles.js +1 -1
  9. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  10. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  11. package/dist/components/molecules/HeaderTop/index.js +11 -68
  12. package/dist/components/molecules/TagAndInput/index.js +1 -1
  13. package/dist/components/organisms/Chat/Chat.stories.js +8 -27
  14. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  15. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  16. package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
  17. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  18. package/dist/components/organisms/Chat/index.js +4 -49
  19. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  20. package/dist/components/organisms/Modal/styles.js +1 -1
  21. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +29 -169
  22. package/dist/components/pages/ProviderProductEdition/index.js +203 -213
  23. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  24. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +60 -85
  25. package/dist/components/pages/RetailerProductEdition/index.js +303 -315
  26. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  27. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  28. package/dist/index.js +52 -234
  29. package/package.json +1 -4
  30. package/src/components/atoms/Avatar/index.js +2 -8
  31. package/src/components/atoms/Card/index.js +2 -35
  32. package/src/components/atoms/Card/styles.js +5 -41
  33. package/src/components/atoms/CheckBox/index.js +1 -4
  34. package/src/components/atoms/CheckBox/styles.js +0 -2
  35. package/src/components/atoms/InputFormatter/styles.js +1 -2
  36. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  37. package/src/components/molecules/HeaderTop/index.js +6 -52
  38. package/src/components/molecules/TagAndInput/index.js +8 -10
  39. package/src/components/organisms/Chat/Chat.stories.js +7 -27
  40. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  41. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
  42. package/src/components/organisms/Chat/ContentChat/index.js +12 -88
  43. package/src/components/organisms/Chat/Footer/index.js +0 -11
  44. package/src/components/organisms/Chat/index.js +4 -46
  45. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  46. package/src/components/organisms/Modal/styles.js +1 -4
  47. package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
  48. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +34 -188
  49. package/src/components/pages/ProviderProductEdition/index.js +132 -132
  50. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  51. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -72
  52. package/src/components/pages/RetailerProductEdition/index.js +138 -122
  53. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  54. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  55. package/src/index.js +0 -15
  56. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
  57. package/src/components/atoms/ImageCarousel/index.js +0 -103
  58. package/src/components/atoms/ImageCarousel/styles.js +0 -79
  59. package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
  60. package/src/components/atoms/PercentTag/index.js +0 -9
  61. package/src/components/atoms/PercentTag/styles.js +0 -69
  62. package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
  63. package/src/components/atoms/RatingStars/index.js +0 -31
  64. package/src/components/atoms/RatingStars/styles.js +0 -28
  65. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
  66. package/src/components/atoms/RetailerCatalog/index.js +0 -49
  67. package/src/components/atoms/RetailerCatalog/styles.js +0 -30
  68. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
  69. package/src/components/atoms/RetailerOption/index.js +0 -53
  70. package/src/components/atoms/RetailerOption/styles.js +0 -41
  71. package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
  72. package/src/components/atoms/RetailersList/index.js +0 -20
  73. package/src/components/atoms/RetailersList/styles.js +0 -19
  74. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
  75. package/src/components/atoms/UserCatalog/index.js +0 -96
  76. package/src/components/atoms/UserCatalog/styles.js +0 -24
  77. package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
  78. package/src/components/atoms/UserOption/index.js +0 -95
  79. package/src/components/atoms/UserOption/styles.js +0 -61
  80. package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
  81. package/src/components/atoms/UserSelector/index.js +0 -86
  82. package/src/components/atoms/UserSelector/styles.js +0 -55
  83. package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
  84. package/src/components/molecules/GridItem/index.js +0 -97
  85. package/src/components/molecules/GridItem/styles.js +0 -104
  86. package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
  87. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
  88. package/src/components/molecules/HeaderItem/index.js +0 -26
  89. package/src/components/molecules/HeaderItem/styles.js +0 -27
  90. package/src/components/molecules/RowItem/ColumnItem.js +0 -9
  91. package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
  92. package/src/components/molecules/RowItem/index.js +0 -45
  93. package/src/components/molecules/RowItem/styles.js +0 -40
  94. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
  95. package/src/components/molecules/StripeCardForm/index.js +0 -42
  96. package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
  97. package/src/components/molecules/StripeCardForm/styles.js +0 -73
  98. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
  99. package/src/components/molecules/StripeCardSelector/index.js +0 -44
  100. package/src/components/molecules/StripeCardSelector/styles.js +0 -4
  101. package/src/components/molecules/StripeCardSelector/utils.js +0 -17
  102. package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
  103. package/src/components/organisms/GridProducts/index.js +0 -50
  104. package/src/components/organisms/GridProducts/styles.js +0 -14
  105. package/src/components/organisms/GridProducts/utils.js +0 -111
  106. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  107. package/src/components/organisms/SideModal/index.js +0 -50
  108. package/src/components/organisms/SideModal/styles.js +0 -30
@@ -37,7 +37,7 @@ var _GalleryElement = require("../../molecules/GalleryElement");
37
37
 
38
38
  var _fileSaver = require("file-saver");
39
39
 
40
- var _data2 = require("../../../global-files/data");
40
+ var _data = require("../../../global-files/data");
41
41
 
42
42
  var _GalleryHeader = require("../../molecules/GalleryHeader");
43
43
 
@@ -61,6 +61,8 @@ var _index = require("../../molecules/TagAndInput/index");
61
61
 
62
62
  var _GeneralButton = require("../../atoms/GeneralButton");
63
63
 
64
+ var _Commentary = require("../../atoms/Commentary");
65
+
64
66
  var _GenericModal = require("../../atoms/GenericModal");
65
67
 
66
68
  var _ScreenHeader = require("../../atoms/ScreenHeader");
@@ -69,16 +71,14 @@ var _Loading = require("../../atoms/Loading");
69
71
 
70
72
  var _genericModalCheck = _interopRequireDefault(require("../../../assets/images/genericModal/genericModalCheck.svg"));
71
73
 
74
+ var _errorModal = _interopRequireDefault(require("../../../assets/images/genericModal/errorModal.svg"));
75
+
72
76
  var _VersionSelector = require("../../organisms/VersionSelector");
73
77
 
74
78
  var _customHooks = require("../../../global-files/customHooks");
75
79
 
76
80
  var _utils = require("./utils");
77
81
 
78
- var _Modal = require("../../organisms/Modal");
79
-
80
- var _ButtonV = require("../../atoms/ButtonV2");
81
-
82
82
  var _jsxRuntime = require("react/jsx-runtime");
83
83
 
84
84
  var reducerImages = function reducerImages(state, action) {
@@ -202,7 +202,7 @@ var myBucket = new _awsSdk.default.S3({
202
202
  });
203
203
 
204
204
  var RetailerProductEdition = function RetailerProductEdition(_ref) {
205
- var _product$retailers, _location$state, _location$state2, _product$services2, _datasheets$, _datasheets$$data, _product$article17;
205
+ var _product$retailers, _location$state, _product$services2, _datasheets$, _datasheets$$data, _product$article18, _comment$message;
206
206
 
207
207
  var tabsSections = _ref.tabsSections,
208
208
  _ref$productSelected = _ref.productSelected,
@@ -252,11 +252,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
252
252
  showModal = _useState14[0],
253
253
  setShowModal = _useState14[1];
254
254
 
255
- var _useState15 = (0, _react.useState)(false),
256
- _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
257
- showRejectModal = _useState16[0],
258
- setShowRejectModal = _useState16[1];
259
-
260
255
  var _useDropzone = (0, _reactDropzone.useDropzone)({
261
256
  accept: "image/*",
262
257
  noKeyboard: true,
@@ -301,149 +296,149 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
301
296
  getRootProps = _useDropzone.getRootProps,
302
297
  getInputProps = _useDropzone.getInputProps;
303
298
 
299
+ var _useState15 = (0, _react.useState)([]),
300
+ _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
301
+ updatedDatasheets = _useState16[0],
302
+ setUpdatedDatasheets = _useState16[1];
303
+
304
304
  var _useState17 = (0, _react.useState)([]),
305
305
  _useState18 = (0, _slicedToArray2.default)(_useState17, 2),
306
- updatedDatasheets = _useState18[0],
307
- setUpdatedDatasheets = _useState18[1];
306
+ updatedDescriptions = _useState18[0],
307
+ setUpdatedDescriptions = _useState18[1];
308
308
 
309
- var _useState19 = (0, _react.useState)([]),
309
+ var _useState19 = (0, _react.useState)(false),
310
310
  _useState20 = (0, _slicedToArray2.default)(_useState19, 2),
311
- updatedDescriptions = _useState20[0],
312
- setUpdatedDescriptions = _useState20[1];
311
+ imagesUploaded = _useState20[0],
312
+ setImagesUploaded = _useState20[1];
313
313
 
314
- var _useState21 = (0, _react.useState)(false),
314
+ var _useState21 = (0, _react.useState)(),
315
315
  _useState22 = (0, _slicedToArray2.default)(_useState21, 2),
316
- imagesUploaded = _useState22[0],
317
- setImagesUploaded = _useState22[1];
318
-
319
- var _useState23 = (0, _react.useState)(),
320
- _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
321
- dataImages = _useState24[0],
322
- setDataImages = _useState24[1];
316
+ dataImages = _useState22[0],
317
+ setDataImages = _useState22[1];
323
318
 
324
- var _useState25 = (0, _react.useState)(new Array(product === null || product === void 0 ? void 0 : (_product$retailers = product.retailers) === null || _product$retailers === void 0 ? void 0 : _product$retailers.length).fill({
319
+ var _useState23 = (0, _react.useState)(new Array(product === null || product === void 0 ? void 0 : (_product$retailers = product.retailers) === null || _product$retailers === void 0 ? void 0 : _product$retailers.length).fill({
325
320
  percentage: 0
326
321
  })),
327
- _useState26 = (0, _slicedToArray2.default)(_useState25, 2),
328
- percentages = _useState26[0],
329
- setPercentages = _useState26[1]; // const [percentages, setPercentages] = useState([{ retailers: {} }]);
322
+ _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
323
+ percentages = _useState24[0],
324
+ setPercentages = _useState24[1]; // const [percentages, setPercentages] = useState([{ retailers: {} }]);
330
325
 
331
326
 
332
- var _useState27 = (0, _react.useState)(0),
327
+ var _useState25 = (0, _react.useState)(0),
328
+ _useState26 = (0, _slicedToArray2.default)(_useState25, 2),
329
+ activePercentage = _useState26[0],
330
+ setActivePercentage = _useState26[1];
331
+
332
+ var _useState27 = (0, _react.useState)({}),
333
333
  _useState28 = (0, _slicedToArray2.default)(_useState27, 2),
334
- activePercentage = _useState28[0],
335
- setActivePercentage = _useState28[1];
334
+ activeRetailer = _useState28[0],
335
+ setActiveRetailer = _useState28[1];
336
336
 
337
- var _useState29 = (0, _react.useState)({}),
337
+ var _useState29 = (0, _react.useState)([]),
338
338
  _useState30 = (0, _slicedToArray2.default)(_useState29, 2),
339
- activeRetailer = _useState30[0],
340
- setActiveRetailer = _useState30[1];
339
+ services = _useState30[0],
340
+ setServices = _useState30[1];
341
341
 
342
342
  var _useState31 = (0, _react.useState)([]),
343
343
  _useState32 = (0, _slicedToArray2.default)(_useState31, 2),
344
- services = _useState32[0],
345
- setServices = _useState32[1];
344
+ servicesData = _useState32[0],
345
+ setServicesData = _useState32[1];
346
346
 
347
- var _useState33 = (0, _react.useState)([]),
347
+ var _useState33 = (0, _react.useState)(""),
348
348
  _useState34 = (0, _slicedToArray2.default)(_useState33, 2),
349
- servicesData = _useState34[0],
350
- setServicesData = _useState34[1];
349
+ message = _useState34[0],
350
+ setMessage = _useState34[1];
351
351
 
352
- var _useState35 = (0, _react.useState)(""),
352
+ var _useState35 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
353
353
  _useState36 = (0, _slicedToArray2.default)(_useState35, 2),
354
- message = _useState36[0],
355
- setMessage = _useState36[1];
354
+ product = _useState36[0],
355
+ setProduct = _useState36[1];
356
356
 
357
- var _useState37 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
357
+ var _useState37 = (0, _react.useState)(null),
358
358
  _useState38 = (0, _slicedToArray2.default)(_useState37, 2),
359
- product = _useState38[0],
360
- setProduct = _useState38[1];
359
+ icon = _useState38[0],
360
+ setIcon = _useState38[1];
361
361
 
362
- var _useState39 = (0, _react.useState)(null),
362
+ var _useState39 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
363
363
  _useState40 = (0, _slicedToArray2.default)(_useState39, 2),
364
- icon = _useState40[0],
365
- setIcon = _useState40[1];
364
+ version = _useState40[0],
365
+ setVersion = _useState40[1];
366
366
 
367
- var _useState41 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
367
+ var _useState41 = (0, _react.useState)({}),
368
368
  _useState42 = (0, _slicedToArray2.default)(_useState41, 2),
369
- version = _useState42[0],
370
- setVersion = _useState42[1];
369
+ comments = _useState42[0],
370
+ setComments = _useState42[1];
371
371
 
372
- var _useState43 = (0, _react.useState)({}),
372
+ var _useState43 = (0, _react.useState)(""),
373
373
  _useState44 = (0, _slicedToArray2.default)(_useState43, 2),
374
- comments = _useState44[0],
375
- setComments = _useState44[1];
376
-
377
- var _useState45 = (0, _react.useState)(""),
378
- _useState46 = (0, _slicedToArray2.default)(_useState45, 2),
379
- comment = _useState46[0],
380
- setComment = _useState46[1];
374
+ comment = _useState44[0],
375
+ setComment = _useState44[1];
381
376
 
382
- var _useState47 = (0, _react.useState)({
377
+ var _useState45 = (0, _react.useState)({
383
378
  "Ficha técnica": 0,
384
379
  Descripción: 0,
385
380
  Imágenes: 0
386
381
  }),
382
+ _useState46 = (0, _slicedToArray2.default)(_useState45, 2),
383
+ requiredNull = _useState46[0],
384
+ setRequiredNull = _useState46[1];
385
+
386
+ var _useState47 = (0, _react.useState)(false),
387
387
  _useState48 = (0, _slicedToArray2.default)(_useState47, 2),
388
- requiredNull = _useState48[0],
389
- setRequiredNull = _useState48[1];
388
+ crossComment = _useState48[0],
389
+ setCrossComment = _useState48[1];
390
390
 
391
- var _useState49 = (0, _react.useState)(false),
391
+ var _useState49 = (0, _react.useState)([]),
392
392
  _useState50 = (0, _slicedToArray2.default)(_useState49, 2),
393
- crossComment = _useState50[0],
394
- setCrossComment = _useState50[1];
393
+ userGroups = _useState50[0],
394
+ setUserGroups = _useState50[1];
395
395
 
396
- var _useState51 = (0, _react.useState)([]),
396
+ var _useState51 = (0, _react.useState)({}),
397
397
  _useState52 = (0, _slicedToArray2.default)(_useState51, 2),
398
- userGroups = _useState52[0],
399
- setUserGroups = _useState52[1];
398
+ assig = _useState52[0],
399
+ setAssig = _useState52[1];
400
400
 
401
- var _useState53 = (0, _react.useState)({}),
401
+ var _useState53 = (0, _react.useState)([]),
402
402
  _useState54 = (0, _slicedToArray2.default)(_useState53, 2),
403
- assig = _useState54[0],
404
- setAssig = _useState54[1];
403
+ selectedImages = _useState54[0],
404
+ setSelectedImages = _useState54[1];
405
405
 
406
406
  var _useState55 = (0, _react.useState)([]),
407
407
  _useState56 = (0, _slicedToArray2.default)(_useState55, 2),
408
- selectedImages = _useState56[0],
409
- setSelectedImages = _useState56[1];
408
+ componentsArray = _useState56[0],
409
+ setComponentsArray = _useState56[1];
410
410
 
411
- var _useState57 = (0, _react.useState)([]),
411
+ var _useState57 = (0, _react.useState)(false),
412
412
  _useState58 = (0, _slicedToArray2.default)(_useState57, 2),
413
- componentsArray = _useState58[0],
414
- setComponentsArray = _useState58[1];
415
-
416
- var _useState59 = (0, _react.useState)(false),
417
- _useState60 = (0, _slicedToArray2.default)(_useState59, 2),
418
- checkAll = _useState60[0],
419
- setCheckAll = _useState60[1];
413
+ checkAll = _useState58[0],
414
+ setCheckAll = _useState58[1];
420
415
 
421
416
  var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
422
417
 
423
- var _useState61 = (0, _react.useState)(true),
418
+ var _useState59 = (0, _react.useState)(true),
419
+ _useState60 = (0, _slicedToArray2.default)(_useState59, 2),
420
+ loading = _useState60[0],
421
+ setLoading = _useState60[1];
422
+
423
+ var _useState61 = (0, _react.useState)("-"),
424
424
  _useState62 = (0, _slicedToArray2.default)(_useState61, 2),
425
- loading = _useState62[0],
426
- setLoading = _useState62[1];
425
+ retailerStatus = _useState62[0],
426
+ setRetailerStatus = _useState62[1];
427
427
 
428
- var _useState63 = (0, _react.useState)("-"),
428
+ var _useState63 = (0, _react.useState)([]),
429
429
  _useState64 = (0, _slicedToArray2.default)(_useState63, 2),
430
- retailerStatus = _useState64[0],
431
- setRetailerStatus = _useState64[1];
430
+ statusArray = _useState64[0],
431
+ setStatusArray = _useState64[1];
432
432
 
433
- var _useState65 = (0, _react.useState)([]),
433
+ var _useState65 = (0, _react.useState)(null),
434
434
  _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
435
- statusArray = _useState66[0],
436
- setStatusArray = _useState66[1];
435
+ socketType = _useState66[0],
436
+ setSocketType = _useState66[1];
437
437
 
438
- var _useState67 = (0, _react.useState)(null),
438
+ var _useState67 = (0, _react.useState)(loading),
439
439
  _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
440
- socketType = _useState68[0],
441
- setSocketType = _useState68[1];
442
-
443
- var _useState69 = (0, _react.useState)(loading),
444
- _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
445
- saving = _useState70[0],
446
- setSaving = _useState70[1];
440
+ saving = _useState68[0],
441
+ setSaving = _useState68[1];
447
442
 
448
443
  var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
449
444
  _useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
@@ -452,55 +447,35 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
452
447
 
453
448
  var shotThd = [58, 59, 60, 61].includes(activeRetailer.id);
454
449
 
455
- var _useState71 = (0, _react.useState)(null),
450
+ var _useState69 = (0, _react.useState)(null),
451
+ _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
452
+ auditableVersion = _useState70[0],
453
+ setAuditableVersion = _useState70[1];
454
+
455
+ var _useState71 = (0, _react.useState)([]),
456
456
  _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
457
- auditableVersion = _useState72[0],
458
- setAuditableVersion = _useState72[1];
457
+ auditServices = _useState72[0],
458
+ setAuditServices = _useState72[1];
459
459
 
460
460
  var _useState73 = (0, _react.useState)([]),
461
461
  _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
462
- auditServices = _useState74[0],
463
- setAuditServices = _useState74[1];
462
+ auditDatasheets = _useState74[0],
463
+ setAuditDatasheets = _useState74[1];
464
464
 
465
465
  var _useState75 = (0, _react.useState)([]),
466
466
  _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
467
- auditDatasheets = _useState76[0],
468
- setAuditDatasheets = _useState76[1];
467
+ auditDescriptions = _useState76[0],
468
+ setAuditDescriptions = _useState76[1];
469
469
 
470
470
  var _useState77 = (0, _react.useState)([]),
471
471
  _useState78 = (0, _slicedToArray2.default)(_useState77, 2),
472
- auditDescriptions = _useState78[0],
473
- setAuditDescriptions = _useState78[1];
472
+ auditImages = _useState78[0],
473
+ setAuditImages = _useState78[1];
474
474
 
475
- var _useState79 = (0, _react.useState)([]),
475
+ var _useState79 = (0, _react.useState)(false),
476
476
  _useState80 = (0, _slicedToArray2.default)(_useState79, 2),
477
- auditImages = _useState80[0],
478
- setAuditImages = _useState80[1];
479
-
480
- var _useState81 = (0, _react.useState)(false),
481
- _useState82 = (0, _slicedToArray2.default)(_useState81, 2),
482
- compare = _useState82[0],
483
- setCompare = _useState82[1];
484
-
485
- var _useState83 = (0, _react.useState)(false),
486
- _useState84 = (0, _slicedToArray2.default)(_useState83, 2),
487
- valRejAll = _useState84[0],
488
- setValRejAll = _useState84[1];
489
-
490
- var _useState85 = (0, _react.useState)([]),
491
- _useState86 = (0, _slicedToArray2.default)(_useState85, 2),
492
- desc = _useState86[0],
493
- setDesc = _useState86[1];
494
-
495
- var _useState87 = (0, _react.useState)([]),
496
- _useState88 = (0, _slicedToArray2.default)(_useState87, 2),
497
- fich = _useState88[0],
498
- setFich = _useState88[1];
499
-
500
- var _useState89 = (0, _react.useState)([]),
501
- _useState90 = (0, _slicedToArray2.default)(_useState89, 2),
502
- imag = _useState90[0],
503
- setImag = _useState90[1];
477
+ compare = _useState80[0],
478
+ setCompare = _useState80[1];
504
479
 
505
480
  (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
506
481
  var _ref3, id_article;
@@ -541,7 +516,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
541
516
  }
542
517
 
543
518
  _context2.next = 3;
544
- return (0, _data2.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article, product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category), auditableVersion.version);
519
+ return (0, _data.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article, product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category), auditableVersion.version);
545
520
 
546
521
  case 3:
547
522
  _auditServices = _context2.sent;
@@ -581,7 +556,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
581
556
  case 0:
582
557
  _context3.prev = 0;
583
558
  _context3.next = 3;
584
- return (0, _data2.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article, product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article6 = product.article) === null || _product$article6 === void 0 ? void 0 : _product$article6.id_category), version);
559
+ return (0, _data.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article, product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article6 = product.article) === null || _product$article6 === void 0 ? void 0 : _product$article6.id_category), version);
585
560
 
586
561
  case 3:
587
562
  _services = _context3.sent;
@@ -598,7 +573,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
598
573
  init: _services[2]
599
574
  });
600
575
  if (((_services$ = _services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
601
- (0, _data2.getPercentage)({
576
+ (0, _data.getPercentage)({
602
577
  data: [product]
603
578
  }).then(function (res) {
604
579
  return setPercentages(res[0]);
@@ -723,7 +698,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
723
698
  getComments();
724
699
  _context6.t0 = setUserGroups;
725
700
  _context6.next = 6;
726
- return (0, _data2.fetchUsers)(token);
701
+ return (0, _data.fetchUsers)(token);
727
702
 
728
703
  case 6:
729
704
  _context6.t1 = _context6.sent;
@@ -891,7 +866,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
891
866
  });
892
867
 
893
868
  if (!(dataClean.length > 0)) {
894
- _context7.next = 25;
869
+ _context7.next = 26;
895
870
  break;
896
871
  }
897
872
 
@@ -915,7 +890,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
915
890
  res = _context7.sent;
916
891
 
917
892
  if (!(res.data.statusCode === 200)) {
918
- _context7.next = 20;
893
+ _context7.next = 21;
919
894
  break;
920
895
  }
921
896
 
@@ -924,25 +899,26 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
924
899
  if (newStatus) productTemp.description_status = newStatus;
925
900
  setProduct(productTemp);
926
901
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
902
+ setUpdatedDescriptions([]);
927
903
  setMessage("Descripciones guardadas con éxito");
928
- _context7.next = 20;
904
+ _context7.next = 21;
929
905
  return loadData();
930
906
 
931
- case 20:
932
- _context7.next = 25;
907
+ case 21:
908
+ _context7.next = 26;
933
909
  break;
934
910
 
935
- case 22:
936
- _context7.prev = 22;
911
+ case 23:
912
+ _context7.prev = 23;
937
913
  _context7.t0 = _context7["catch"](7);
938
914
  console.log(_context7.t0);
939
915
 
940
- case 25:
916
+ case 26:
941
917
  case "end":
942
918
  return _context7.stop();
943
919
  }
944
920
  }
945
- }, _callee7, null, [[7, 22]]);
921
+ }, _callee7, null, [[7, 23]]);
946
922
  }));
947
923
 
948
924
  return function saveDescriptions() {
@@ -963,7 +939,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
963
939
  });
964
940
 
965
941
  if (!(dataClean.length > 0)) {
966
- _context8.next = 25;
942
+ _context8.next = 26;
967
943
  break;
968
944
  }
969
945
 
@@ -987,7 +963,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
987
963
  res = _context8.sent;
988
964
 
989
965
  if (!(res.data.statusCode === 200)) {
990
- _context8.next = 20;
966
+ _context8.next = 21;
991
967
  break;
992
968
  }
993
969
 
@@ -996,25 +972,26 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
996
972
  if (newStatus) productTemp.datasheet_status = newStatus;
997
973
  setProduct(productTemp);
998
974
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
975
+ setUpdatedDatasheets([]);
999
976
  setMessage("Fichas técnicas guardadas");
1000
- _context8.next = 20;
977
+ _context8.next = 21;
1001
978
  return loadData();
1002
979
 
1003
- case 20:
1004
- _context8.next = 25;
980
+ case 21:
981
+ _context8.next = 26;
1005
982
  break;
1006
983
 
1007
- case 22:
1008
- _context8.prev = 22;
984
+ case 23:
985
+ _context8.prev = 23;
1009
986
  _context8.t0 = _context8["catch"](7);
1010
987
  console.log(_context8.t0);
1011
988
 
1012
- case 25:
989
+ case 26:
1013
990
  case "end":
1014
991
  return _context8.stop();
1015
992
  }
1016
993
  }
1017
- }, _callee8, null, [[7, 22]]);
994
+ }, _callee8, null, [[7, 23]]);
1018
995
  }));
1019
996
 
1020
997
  return function saveDatasheets() {
@@ -1038,7 +1015,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1038
1015
  };
1039
1016
  });
1040
1017
  setSocketType(imageInputs);
1041
- console.log(images);
1042
1018
  }, [images]);
1043
1019
  var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
1044
1020
  var _images$values3, _images$attrForImgs, _product$article14, _data$articleData, _data$articleData2, _data$updateImages;
@@ -1166,7 +1142,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1166
1142
  switch (_context10.prev = _context10.next) {
1167
1143
  case 0:
1168
1144
  if (!imagesUploaded) {
1169
- _context10.next = 22;
1145
+ _context10.next = 23;
1170
1146
  break;
1171
1147
  }
1172
1148
 
@@ -1190,7 +1166,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1190
1166
  res = _context10.sent;
1191
1167
 
1192
1168
  if (!(res.data.statusCode === 200)) {
1193
- _context10.next = 17;
1169
+ _context10.next = 18;
1194
1170
  break;
1195
1171
  }
1196
1172
 
@@ -1200,26 +1176,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1200
1176
  if (newStatus) productTemp.images_status = newStatus;
1201
1177
  setProduct(productTemp);
1202
1178
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1179
+ setImages({});
1203
1180
  setMessage("Imágenes guardadas con éxito");
1204
1181
  sessionStorage.removeItem("imagesList");
1205
- _context10.next = 17;
1182
+ _context10.next = 18;
1206
1183
  return loadData();
1207
1184
 
1208
- case 17:
1209
- _context10.next = 22;
1185
+ case 18:
1186
+ _context10.next = 23;
1210
1187
  break;
1211
1188
 
1212
- case 19:
1213
- _context10.prev = 19;
1189
+ case 20:
1190
+ _context10.prev = 20;
1214
1191
  _context10.t0 = _context10["catch"](2);
1215
1192
  console.log(_context10.t0);
1216
1193
 
1217
- case 22:
1194
+ case 23:
1218
1195
  case "end":
1219
1196
  return _context10.stop();
1220
1197
  }
1221
1198
  }
1222
- }, _callee10, null, [[2, 19]]);
1199
+ }, _callee10, null, [[2, 20]]);
1223
1200
  })), [dataImages, imagesUploaded]);
1224
1201
 
1225
1202
  var evaluationFinished = function evaluationFinished(userId, tab, statusArray) {
@@ -1344,7 +1321,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1344
1321
 
1345
1322
  var sendToFacilitator = /*#__PURE__*/function () {
1346
1323
  var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
1347
- var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus, messageToChat, _data;
1324
+ var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
1348
1325
 
1349
1326
  return _regenerator.default.wrap(function _callee11$(_context11) {
1350
1327
  while (1) {
@@ -1407,59 +1384,39 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1407
1384
 
1408
1385
  case 21:
1409
1386
  if (!(res.data.statusCode === 200)) {
1410
- _context11.next = 34;
1387
+ _context11.next = 30;
1411
1388
  break;
1412
1389
  }
1413
1390
 
1414
1391
  _JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
1415
- messageToChat = (0, _utils.createMessage)(product.retailers, activeRetailer.id, evalStatus, newStatus, activeTab);
1416
- _data = {
1417
- paramsBody: {
1418
- id: product.article.id_article,
1419
- version: version,
1420
- items: [{
1421
- type: "status",
1422
- value: messageToChat
1423
- }],
1424
- retailerId: activeRetailer.id,
1425
- status: product.status
1426
- },
1427
- paramsHeader: {
1428
- Authorization: token
1429
- }
1430
- };
1431
- _context11.next = 27;
1432
- return (0, _utils.sendMessage)(_data);
1433
-
1434
- case 27:
1435
1392
  if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
1436
1393
  productTemp["".concat(concept, "_status")] = newStatus;
1437
- _context11.next = 31;
1394
+ _context11.next = 27;
1438
1395
  return loadData();
1439
1396
 
1440
- case 31:
1397
+ case 27:
1441
1398
  if (_message) setMessage(_message);
1442
1399
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1443
1400
  setProduct(productTemp);
1444
1401
 
1445
- case 34:
1446
- _context11.next = 39;
1402
+ case 30:
1403
+ _context11.next = 35;
1447
1404
  break;
1448
1405
 
1449
- case 36:
1450
- _context11.prev = 36;
1406
+ case 32:
1407
+ _context11.prev = 32;
1451
1408
  _context11.t0 = _context11["catch"](1);
1452
1409
  console.log(_context11.t0);
1453
1410
 
1454
- case 39:
1411
+ case 35:
1455
1412
  setLoading(false);
1456
1413
 
1457
- case 40:
1414
+ case 36:
1458
1415
  case "end":
1459
1416
  return _context11.stop();
1460
1417
  }
1461
1418
  }
1462
- }, _callee11, null, [[1, 36]]);
1419
+ }, _callee11, null, [[1, 32]]);
1463
1420
  }));
1464
1421
 
1465
1422
  return function sendToFacilitator(_x) {
@@ -1494,33 +1451,55 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1494
1451
  };
1495
1452
 
1496
1453
  var createComment = /*#__PURE__*/function () {
1497
- var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
1498
- var messages,
1499
- retailerId,
1500
- data,
1501
- _args12 = arguments;
1454
+ var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(e, body, tab) {
1455
+ var _product$article16;
1456
+
1457
+ var concept, data;
1502
1458
  return _regenerator.default.wrap(function _callee12$(_context12) {
1503
1459
  while (1) {
1504
1460
  switch (_context12.prev = _context12.next) {
1505
1461
  case 0:
1506
- messages = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : [];
1507
- retailerId = _args12.length > 1 ? _args12[1] : undefined;
1462
+ concept = "";
1463
+ _context12.t0 = activeTab;
1464
+ _context12.next = _context12.t0 === "Ficha técnica" ? 4 : _context12.t0 === "Imágenes" ? 6 : 8;
1465
+ break;
1466
+
1467
+ case 4:
1468
+ concept = "datasheet";
1469
+ return _context12.abrupt("break", 10);
1470
+
1471
+ case 6:
1472
+ concept = "images";
1473
+ return _context12.abrupt("break", 10);
1474
+
1475
+ case 8:
1476
+ concept = "description";
1477
+ return _context12.abrupt("break", 10);
1478
+
1479
+ case 10:
1508
1480
  data = {
1509
- paramsBody: {
1510
- id: product.article.id_article,
1511
- version: version,
1512
- items: messages,
1513
- retailerId: retailerId,
1514
- status: product.status
1515
- },
1516
- paramsHeader: {
1481
+ articleId: product === null || product === void 0 ? void 0 : (_product$article16 = product.article) === null || _product$article16 === void 0 ? void 0 : _product$article16.id_article,
1482
+ orderId: product === null || product === void 0 ? void 0 : product.orderId,
1483
+ message: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, ""),
1484
+ concept: concept,
1485
+ version: version
1486
+ };
1487
+ _context12.next = 13;
1488
+ return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1489
+ headers: {
1517
1490
  Authorization: token
1518
1491
  }
1519
- };
1492
+ });
1493
+
1494
+ case 13:
1495
+ _context12.next = 15;
1496
+ return getComments(tab);
1497
+
1498
+ case 15:
1520
1499
  setMessage("");
1521
- return _context12.abrupt("return", (0, _utils.sendMessage)(data));
1500
+ setComponentsArray([]);
1522
1501
 
1523
- case 5:
1502
+ case 17:
1524
1503
  case "end":
1525
1504
  return _context12.stop();
1526
1505
  }
@@ -1528,7 +1507,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1528
1507
  }, _callee12);
1529
1508
  }));
1530
1509
 
1531
- return function createComment() {
1510
+ return function createComment(_x2, _x3, _x4) {
1532
1511
  return _ref15.apply(this, arguments);
1533
1512
  };
1534
1513
  }();
@@ -1643,7 +1622,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1643
1622
 
1644
1623
  var setAssignation = /*#__PURE__*/function () {
1645
1624
  var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
1646
- var _product$article16;
1625
+ var _product$article17;
1647
1626
 
1648
1627
  var concept, productTemp, data;
1649
1628
  return _regenerator.default.wrap(function _callee14$(_context14) {
@@ -1673,7 +1652,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1673
1652
  data = {
1674
1653
  articleList: [{
1675
1654
  orderId: product.orderId,
1676
- articleId: product === null || product === void 0 ? void 0 : (_product$article16 = product.article) === null || _product$article16 === void 0 ? void 0 : _product$article16.id_article
1655
+ articleId: product === null || product === void 0 ? void 0 : (_product$article17 = product.article) === null || _product$article17 === void 0 ? void 0 : _product$article17.id_article
1677
1656
  }],
1678
1657
  concept: concept,
1679
1658
  userId: assignationId
@@ -1700,7 +1679,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1700
1679
  }, _callee14);
1701
1680
  }));
1702
1681
 
1703
- return function setAssignation(_x2, _x3) {
1682
+ return function setAssignation(_x5, _x6) {
1704
1683
  return _ref17.apply(this, arguments);
1705
1684
  };
1706
1685
  }();
@@ -1802,7 +1781,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1802
1781
  };
1803
1782
 
1804
1783
  (0, _react.useEffect)(function () {
1805
- console.log(servicesData, "servicesData");
1806
1784
  var status = getRetailerStatus(servicesData, activeTab);
1807
1785
  setRetailerStatus(status);
1808
1786
  }, [activeTab, servicesData, activeRetailer]);
@@ -1815,7 +1793,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1815
1793
 
1816
1794
  var validateAll = /*#__PURE__*/function () {
1817
1795
  var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(result) {
1818
- var evaluationArray, conceptArray, messages, productTemp, messagesResponse;
1796
+ var evaluationArray, conceptArray, productTemp;
1819
1797
  return _regenerator.default.wrap(function _callee15$(_context15) {
1820
1798
  while (1) {
1821
1799
  switch (_context15.prev = _context15.next) {
@@ -1841,7 +1819,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1841
1819
  return _context15.abrupt("break", 13);
1842
1820
 
1843
1821
  case 13:
1844
- messages = [];
1845
1822
  servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1846
1823
  if (conceptArray.includes(ret.service)) {
1847
1824
  var _product$id_order;
@@ -1854,16 +1831,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1854
1831
  evalStatus: ret.status,
1855
1832
  retailerId: ret.id_retailer
1856
1833
  };
1857
-
1858
- if (product["".concat(ret.service, "_status")] !== "NS") {
1859
- var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
1860
-
1861
- messages.push(createComment([{
1862
- type: "status",
1863
- value: _message2
1864
- }], ret.id_retailer));
1865
- }
1866
-
1867
1834
  evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1868
1835
  headers: {
1869
1836
  Authorization: token
@@ -1871,43 +1838,38 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1871
1838
  }));
1872
1839
  }
1873
1840
  });
1874
- _context15.next = 17;
1841
+ _context15.next = 16;
1875
1842
  return Promise.all(evaluationArray);
1876
1843
 
1877
- case 17:
1844
+ case 16:
1878
1845
  productTemp = product;
1879
1846
  productTemp.status = "".concat(result, "A");
1880
- productTemp.datasheet_status = productTemp.datasheet_status === "NS" ? "NS" : "".concat(result, "A");
1881
- productTemp.description_status = productTemp.description_status === "NS" ? "NS" : "".concat(result, "A");
1882
- productTemp.images_status = productTemp.images_status === "NS" ? "NS" : "".concat(result, "A");
1847
+ productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "A");
1848
+ productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result, "A");
1849
+ productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "A");
1883
1850
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1884
1851
  setProduct(productTemp);
1885
- _context15.next = 26;
1886
- return Promise.all(messages);
1887
-
1888
- case 26:
1889
- messagesResponse = _context15.sent;
1890
- _context15.next = 29;
1852
+ _context15.next = 25;
1891
1853
  return loadData();
1892
1854
 
1893
- case 29:
1894
- _context15.next = 34;
1855
+ case 25:
1856
+ _context15.next = 30;
1895
1857
  break;
1896
1858
 
1897
- case 31:
1898
- _context15.prev = 31;
1859
+ case 27:
1860
+ _context15.prev = 27;
1899
1861
  _context15.t1 = _context15["catch"](0);
1900
1862
  console.log(_context15.t1);
1901
1863
 
1902
- case 34:
1864
+ case 30:
1903
1865
  case "end":
1904
1866
  return _context15.stop();
1905
1867
  }
1906
1868
  }
1907
- }, _callee15, null, [[0, 31]]);
1869
+ }, _callee15, null, [[0, 27]]);
1908
1870
  }));
1909
1871
 
1910
- return function validateAll(_x4) {
1872
+ return function validateAll(_x7) {
1911
1873
  return _ref18.apply(this, arguments);
1912
1874
  };
1913
1875
  }();
@@ -1920,10 +1882,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1920
1882
  setCompare: setCompare,
1921
1883
  isAuditor: [1, 6].includes(user.id_role),
1922
1884
  withChat: location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.withChat,
1923
- chatType: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.chatType,
1924
- productSelected: product,
1925
- token: token,
1926
- activeRetailer: activeRetailer
1885
+ productSelected: productSelected,
1886
+ token: token
1927
1887
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1928
1888
  className: "data-container",
1929
1889
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -1965,7 +1925,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1965
1925
  sendToFacilitator("A");
1966
1926
  },
1967
1927
  reject: function reject() {
1968
- setShowRejectModal(true);
1928
+ sendToFacilitator("R");
1929
+ setMessage("Rechazado");
1930
+ setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
1931
+ src: _errorModal.default
1932
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1933
+ text: "Agrega tu comentarios para enviar el rechazo",
1934
+ headerType: "input-name-header",
1935
+ color: "white"
1936
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
1937
+ label: "Caja de Comentario",
1938
+ inputType: "textarea",
1939
+ inputId: "modal-commentary-box",
1940
+ index: 0,
1941
+ color: "white"
1942
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1943
+ buttonType: "general-default-button",
1944
+ label: "Enviar comentario",
1945
+ onClick: function onClick(e) {
1946
+ return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
1947
+ }
1948
+ })]);
1969
1949
  },
1970
1950
  showApproveRejectAll: approveRejectAllButtons() && (auditorAssigned() || userAssigned()),
1971
1951
  showValidationButtons: approveRejectButtons() && (auditorAssigned() || userAssigned()),
@@ -1973,8 +1953,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1973
1953
  return validateAll("A");
1974
1954
  },
1975
1955
  rejectAll: function rejectAll() {
1976
- setShowRejectModal(true);
1977
- setValRejAll(true);
1956
+ validateAll("R");
1957
+ setMessage("Rechazado");
1958
+ setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
1959
+ src: _errorModal.default
1960
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1961
+ text: "Agrega tu comentarios para enviar el rechazo",
1962
+ headerType: "input-name-header",
1963
+ color: "white"
1964
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
1965
+ label: "Caja de Comentario",
1966
+ inputType: "textarea",
1967
+ inputId: "modal-commentary-box",
1968
+ index: 0,
1969
+ color: "white"
1970
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1971
+ buttonType: "general-default-button",
1972
+ label: "Enviar comentario",
1973
+ onClick: function onClick(e) {
1974
+ return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
1975
+ }
1976
+ })]);
1978
1977
  }
1979
1978
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
1980
1979
  tabsSections: tabsSections,
@@ -1989,12 +1988,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1989
1988
  isRetailer: isRetailer,
1990
1989
  showSaveButton: auditorAssigned() || userAssigned(),
1991
1990
  version: version,
1992
- desc: desc,
1993
- setDesc: setDesc,
1994
- fich: fich,
1995
- setFich: setFich,
1996
- imag: imag,
1997
- setImag: setImag,
1998
1991
  updatedDescriptions: updatedDescriptions,
1999
1992
  setUpdatedDescriptions: setUpdatedDescriptions,
2000
1993
  updatedDatasheets: updatedDatasheets,
@@ -2052,7 +2045,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
2052
2045
  auditInputGroup: auditDescriptions[0],
2053
2046
  updatedDescriptions: updatedDescriptions,
2054
2047
  setUpdatedDescriptions: setUpdatedDescriptions,
2055
- articleId: product === null || product === void 0 ? void 0 : (_product$article17 = product.article) === null || _product$article17 === void 0 ? void 0 : _product$article17.id_article,
2048
+ articleId: product === null || product === void 0 ? void 0 : (_product$article18 = product.article) === null || _product$article18 === void 0 ? void 0 : _product$article18.id_article,
2056
2049
  version: version,
2057
2050
  dinamicHeight: true,
2058
2051
  compare: compare
@@ -2073,15 +2066,57 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
2073
2066
  headerType: "input-name-header"
2074
2067
  }))]
2075
2068
  })
2076
- }), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2069
+ }), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2077
2070
  className: "commentary-box",
2078
- children: [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2071
+ children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2072
+ className: "commentary",
2073
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
2074
+ label: "Caja de Comentario",
2075
+ inputType: "textarea",
2076
+ inputCols: 80,
2077
+ inputRows: 4,
2078
+ inputId: "commentary-box",
2079
+ index: 0
2080
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2081
+ className: "buttons-box",
2082
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2083
+ buttonType: "general-transparent-button",
2084
+ label: "Enviar comentario",
2085
+ onClick: function onClick(e) {
2086
+ return createComment(e, document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
2087
+ }
2088
+ })
2089
+ })]
2090
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2091
+ className: "feedback-box",
2092
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
2093
+ comment: comment === null || comment === void 0 ? void 0 : (_comment$message = comment.message) === null || _comment$message === void 0 ? void 0 : _comment$message.replace(/<.*?\/?>/gm, ""),
2094
+ reviewed: crossComment
2095
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2096
+ buttonType: "circular-button accept-button",
2097
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
2098
+ return _regenerator.default.wrap(function _callee16$(_context16) {
2099
+ while (1) {
2100
+ switch (_context16.prev = _context16.next) {
2101
+ case 0:
2102
+ setCrossComment(true);
2103
+ commentRevised();
2104
+
2105
+ case 2:
2106
+ case "end":
2107
+ return _context16.stop();
2108
+ }
2109
+ }
2110
+ }, _callee16);
2111
+ }))
2112
+ })]
2113
+ }), [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2079
2114
  buttonType: evaluationFinished(user.id_role, activeTab, statusArray) && requiredNull[activeTab] === 0 ? "general-green-button" : "general-button-disabled",
2080
2115
  label: "Enviar evaluación",
2081
2116
  onClick: function onClick() {
2082
2117
  return sendToFacilitator();
2083
2118
  }
2084
- })
2119
+ })]
2085
2120
  })]
2086
2121
  })]
2087
2122
  }), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
@@ -2110,53 +2145,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
2110
2145
  currentVersion: version,
2111
2146
  setShowVersionSelector: setShowVersionSelector,
2112
2147
  jwt: token
2113
- }), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
2114
- title: "Agregar mensaje de rechazo para ".concat(activeTab === null || activeTab === void 0 ? void 0 : activeTab.toLowerCase()),
2115
- show: showRejectModal,
2116
- customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
2117
- inputType: "textarea",
2118
- inputId: "modal-message-box",
2119
- index: 0,
2120
- color: "white"
2121
- }),
2122
- buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
2123
- type: "white",
2124
- label: "Cancelar",
2125
- size: 12,
2126
- onClick: function onClick() {
2127
- setShowRejectModal(false);
2128
- }
2129
- }, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
2130
- type: "pink",
2131
- label: "Aceptar",
2132
- size: 12,
2133
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
2134
- var body, messages;
2135
- return _regenerator.default.wrap(function _callee16$(_context16) {
2136
- while (1) {
2137
- switch (_context16.prev = _context16.next) {
2138
- case 0:
2139
- body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
2140
- messages = [{
2141
- type: "message",
2142
- value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
2143
- }];
2144
- _context16.next = 4;
2145
- return createComment(messages, activeRetailer.id);
2146
-
2147
- case 4:
2148
- valRejAll ? validateAll("R") : sendToFacilitator("R");
2149
- setMessage("Rechazado");
2150
- setShowRejectModal(false);
2151
-
2152
- case 7:
2153
- case "end":
2154
- return _context16.stop();
2155
- }
2156
- }
2157
- }, _callee16);
2158
- }))
2159
- }, "btn-Aceptar")]
2160
2148
  })]
2161
2149
  });
2162
2150
  };