contentoh-components-library 21.5.98 → 21.5.99

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 (63) hide show
  1. package/dist/components/atoms/GeneralButton/styles.js +1 -1
  2. package/dist/components/atoms/GeneralInput/index.js +54 -249
  3. package/dist/components/atoms/GeneralInput/styles.js +3 -7
  4. package/dist/components/atoms/InputFormatter/index.js +68 -223
  5. package/dist/components/atoms/InputFormatter/styles.js +4 -20
  6. package/dist/components/molecules/StatusAsignationInfo/index.js +1 -11
  7. package/dist/components/molecules/TabsMenu/index.js +1 -13
  8. package/dist/components/molecules/TagAndInput/index.js +24 -364
  9. package/dist/components/molecules/TagAndInput/styles.js +2 -2
  10. package/dist/components/organisms/FullProductNameHeader/index.js +22 -6
  11. package/dist/components/organisms/InputGroup/index.js +18 -22
  12. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +337 -150
  13. package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +15 -15
  14. package/dist/components/pages/ProviderProductEdition/index.js +377 -413
  15. package/dist/components/pages/ProviderProductEdition/utils.js +0 -1
  16. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +211 -125
  17. package/dist/components/pages/RetailerProductEdition/index.js +2236 -1738
  18. package/dist/components/pages/RetailerProductEdition/styles.js +2 -4
  19. package/dist/components/pages/RetailerProductEdition/utils.js +2 -251
  20. package/package.json +2 -4
  21. package/src/components/atoms/GeneralButton/styles.js +0 -4
  22. package/src/components/atoms/GeneralInput/index.js +60 -241
  23. package/src/components/atoms/GeneralInput/styles.js +0 -81
  24. package/src/components/atoms/InputFormatter/index.js +51 -200
  25. package/src/components/atoms/InputFormatter/styles.js +0 -284
  26. package/src/components/molecules/StatusAsignationInfo/index.js +1 -9
  27. package/src/components/molecules/TabsMenu/index.js +0 -12
  28. package/src/components/molecules/TagAndInput/index.js +21 -294
  29. package/src/components/molecules/TagAndInput/styles.js +17 -59
  30. package/src/components/organisms/FullProductNameHeader/index.js +28 -4
  31. package/src/components/organisms/FullTabsMenu/index.js +1 -1
  32. package/src/components/organisms/InputGroup/index.js +4 -12
  33. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +202 -174
  34. package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +14 -14
  35. package/src/components/pages/ProviderProductEdition/index.js +418 -486
  36. package/src/components/pages/ProviderProductEdition/utils.js +2 -2
  37. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +243 -136
  38. package/src/components/pages/RetailerProductEdition/index.js +1717 -1563
  39. package/src/components/pages/RetailerProductEdition/styles.js +2 -67
  40. package/src/components/pages/RetailerProductEdition/utils.js +0 -240
  41. package/src/ai/utils/compare-strings.js +0 -45
  42. package/src/assets/images/Icons/arrow.png +0 -0
  43. package/src/assets/images/Icons/cancel.png +0 -0
  44. package/src/assets/images/Icons/ia-icon.png +0 -0
  45. package/src/assets/images/Icons/loading.svg +0 -5
  46. package/src/assets/images/Icons/reload.png +0 -0
  47. package/src/components/atoms/RetailerSelector/RetailerSelector.stories.js +0 -10
  48. package/src/components/atoms/RetailerSelector/index.js +0 -3
  49. package/src/components/atoms/RetailerSelector/styles.js +0 -0
  50. package/src/components/organisms/ChangeStatusModal/index.jsx +0 -488
  51. package/src/components/organisms/ChangeStatusModal/styles.js +0 -333
  52. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +0 -575
  53. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +0 -62
  54. package/src/components/pages/RetailerProductEdition/context/reducers/active-state.js +0 -344
  55. package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +0 -155
  56. package/src/components/pages/RetailerProductEdition/context/reducers/product.js +0 -114
  57. package/src/components/pages/RetailerProductEdition/context/reducers/system.js +0 -60
  58. package/src/components/pages/RetailerProductEdition/index_old.js +0 -1979
  59. package/src/components/pages/RetailerProductEdition/stories/Auditor.stories.js +0 -101
  60. package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -115
  61. package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +0 -174
  62. package/src/contexts/AiProductEdition.jsx +0 -347
  63. package/src/global-files/statusDictionary.js +0 -103
@@ -77,12 +77,10 @@ var _genericModalWarning = _interopRequireDefault(require("../../../assets/image
77
77
 
78
78
  var _styles = require("./styles");
79
79
 
80
- var _AiProductEdition = require("../../../contexts/AiProductEdition");
81
-
82
80
  var _jsxRuntime = require("react/jsx-runtime");
83
81
 
84
82
  var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
85
- var _location$state4, _state$product2, _state$product3, _state$product4, _state$product5, _state$product6, _state$product7, _location$state5, _location$state6, _state$active_retaile3, _state$active_retaile4, _state$images_values$2, _state$images_values10, _state$images_values11, _state$active_retaile5, _state$product11, _state$active_retaile6, _state$active_retaile7, _state$active_retaile8, _state$product12, _state$product13, _state$product14, _state$datasheets_inp, _state$datasheets_inp2, _state$product15, _state$images_values12;
83
+ var _location$state4, _location$state5, _location$state6, _state$active_retaile3, _state$active_retaile4, _state$images_values$2, _state$images_values10, _state$images_values11, _state$active_retaile5, _state$product5, _state$active_retaile6, _state$active_retaile7, _state$active_retaile8, _state$product6, _state$product7, _state$product8, _state$datasheets_inp, _state$product9, _state$images_values12;
86
84
 
87
85
  var tabsSections = _ref.tabsSections,
88
86
  _ref$productSelected = _ref.productSelected,
@@ -112,44 +110,49 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
112
110
 
113
111
  var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
114
112
 
115
- var _useState = (0, _react.useState)(false),
113
+ var _useState = (0, _react.useState)(null),
116
114
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
117
- showModal = _useState2[0],
118
- setShowModal = _useState2[1];
115
+ boxData = _useState2[0],
116
+ setBoxData = _useState2[1];
119
117
 
120
118
  var _useState3 = (0, _react.useState)(false),
121
119
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
122
- showRejectModal = _useState4[0],
123
- setShowRejectModal = _useState4[1];
120
+ showModal = _useState4[0],
121
+ setShowModal = _useState4[1];
124
122
 
125
- var _useState5 = (0, _react.useState)(0),
123
+ var _useState5 = (0, _react.useState)(false),
126
124
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
127
- headerTop = _useState6[0],
128
- setHeaderTop = _useState6[1];
125
+ showRejectModal = _useState6[0],
126
+ setShowRejectModal = _useState6[1];
129
127
 
130
- var _useState7 = (0, _react.useState)({}),
128
+ var _useState7 = (0, _react.useState)(0),
131
129
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
132
- assig = _useState8[0],
133
- setAssig = _useState8[1];
130
+ headerTop = _useState8[0],
131
+ setHeaderTop = _useState8[1];
134
132
 
135
- var _useState9 = (0, _react.useState)(false),
133
+ var _useState9 = (0, _react.useState)({}),
136
134
  _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
137
- imageLayout = _useState10[0],
138
- setImageLayout = _useState10[1];
135
+ assig = _useState10[0],
136
+ setAssig = _useState10[1];
139
137
 
140
138
  var _useState11 = (0, _react.useState)(false),
141
139
  _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
142
- rejectAll = _useState12[0],
143
- setRejectAll = _useState12[1];
140
+ imageLayout = _useState12[0],
141
+ setImageLayout = _useState12[1];
142
+
143
+ var _useState13 = (0, _react.useState)(false),
144
+ _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
145
+ rejectAll = _useState14[0],
146
+ setRejectAll = _useState14[1];
144
147
 
145
- var _useState13 = (0, _react.useState)({
148
+ var _useState15 = (0, _react.useState)({
146
149
  "Ficha técnica": null,
147
150
  Descripción: null,
148
151
  Imágenes: null
149
152
  }),
150
- _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
151
- origin = _useState14[0],
152
- setOrigin = _useState14[1];
153
+ _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
154
+ origin = _useState16[0],
155
+ setOrigin = _useState16[1];
153
156
 
154
157
  var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
155
158
  _useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
@@ -237,8 +240,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
237
240
  (0, _react.useEffect)(function () {
238
241
  var setProductData = function setProductData() {
239
242
  try {
240
- var product = productSelected ? productSelected : JSON.parse(sessionStorage.getItem("productSelected"));
243
+ var product = JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected;
241
244
  var productNormalized = (0, _utils.normalizeProduct)(product);
245
+ console.log({
246
+ productNormalized: productNormalized
247
+ });
242
248
  dispatch({
243
249
  type: "SET_PRODUCT",
244
250
  payload: productNormalized
@@ -283,7 +289,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
283
289
 
284
290
  var fetchData = /*#__PURE__*/function () {
285
291
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
286
- var _JSON$parse$0$relatio, _JSON$parse, _JSON$parse$, _percentageRes$, _services$2$inputsByR, _services$2$values, data, headers, _yield$Promise$all, _yield$Promise$all2, services, percentageRes, servicesDataRes, percentages, orderMap, orderedValues, updatedStatusByRetailer;
292
+ var _JSON$parse$0$relatio, _JSON$parse, _JSON$parse$, _percentageRes$, _services$2$inputsByR, _services$2$values, data, headers, _yield$Promise$all, _yield$Promise$all2, services, percentageRes, servicesDataRes, percentages, orderMap, orderedValues;
287
293
 
288
294
  return _regenerator.default.wrap(function _callee2$(_context2) {
289
295
  while (1) {
@@ -333,21 +339,6 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
333
339
  var orderA = (_orderMap$a$image_id = orderMap[a.image_id]) !== null && _orderMap$a$image_id !== void 0 ? _orderMap$a$image_id : Number.MAX_SAFE_INTEGER;
334
340
  var orderB = (_orderMap$b$image_id = orderMap[b.image_id]) !== null && _orderMap$b$image_id !== void 0 ? _orderMap$b$image_id : Number.MAX_SAFE_INTEGER;
335
341
  return orderA - orderB;
336
- }); //Cuando carguemos la información de los servicios, las actualizamos en el estado del producto
337
-
338
- updatedStatusByRetailer = servicesDataRes.reduce(function (acc, current, idx) {
339
- var id_retailer = current.id_retailer,
340
- service = current.service,
341
- status = current.status;
342
- if (!acc[id_retailer]) acc[id_retailer] = {};
343
- acc[id_retailer][service] = status;
344
- return acc;
345
- }, {});
346
- dispatch({
347
- type: "SET_PRODUCT",
348
- payload: (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
349
- statusByRetailer: updatedStatusByRetailer
350
- })
351
342
  });
352
343
  dispatch({
353
344
  type: "SET_SERVICES",
@@ -374,11 +365,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
374
365
  return rId === id_retailer;
375
366
  })
376
367
  });
377
- _context2.next = 26;
368
+ _context2.next = 24;
378
369
  break;
379
370
 
380
- case 22:
381
- _context2.prev = 22;
371
+ case 20:
372
+ _context2.prev = 20;
382
373
  _context2.t0 = _context2["catch"](1);
383
374
  console.error("Error fetching data:", _context2.t0);
384
375
  dispatch({
@@ -386,20 +377,20 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
386
377
  payload: _context2.t0
387
378
  });
388
379
 
389
- case 26:
390
- _context2.prev = 26;
380
+ case 24:
381
+ _context2.prev = 24;
391
382
  dispatch({
392
383
  type: "SET_LOADING",
393
384
  payload: false
394
385
  });
395
- return _context2.finish(26);
386
+ return _context2.finish(24);
396
387
 
397
- case 29:
388
+ case 27:
398
389
  case "end":
399
390
  return _context2.stop();
400
391
  }
401
392
  }
402
- }, _callee2, null, [[1, 22, 26, 29]]);
393
+ }, _callee2, null, [[1, 20, 24, 27]]);
403
394
  }));
404
395
 
405
396
  return function fetchData() {
@@ -408,7 +399,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
408
399
  }();
409
400
 
410
401
  fetchData();
411
- }, [(_state$product2 = state.product) === null || _state$product2 === void 0 ? void 0 : _state$product2.datasheet_status, (_state$product3 = state.product) === null || _state$product3 === void 0 ? void 0 : _state$product3.description_status, (_state$product4 = state.product) === null || _state$product4 === void 0 ? void 0 : _state$product4.images_status, (_state$product5 = state.product) === null || _state$product5 === void 0 ? void 0 : _state$product5.status, (_state$product6 = state.product) === null || _state$product6 === void 0 ? void 0 : _state$product6.percentages, (_state$product7 = state.product) === null || _state$product7 === void 0 ? void 0 : _state$product7.version, state.active_retailer, token]); // Actualizador de campos del ui para que coincidan con el retailer activo
402
+ }, [state.product, state.active_retailer, token]); // Actualizador de campos del ui para que coincidan con el retailer activo
412
403
 
413
404
  (0, _react.useEffect)(function () {
414
405
  if (!state.active_retailer) return;
@@ -459,38 +450,25 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
459
450
  }, [state.services]); // Helper functions
460
451
 
461
452
  var canShowValidationButtons = function canShowValidationButtons() {
462
- var _state$product8;
463
-
464
- if (!((_state$product8 = state.product) !== null && _state$product8 !== void 0 && _state$product8.statusByRetailer)) return false;
453
+ var _state$product2;
465
454
 
466
- try {
467
- var currentService = (0, _utils.getConceptByTab)(state.active_tab); // const currentStatus = state.product[`${currentService}_status`];
468
-
469
- var currentRetailer = state.active_retailer.id_retailer; //Información del servicio de la cadena seleccionada
470
-
471
- var _state$services_data$ = state.services_data.find(function (service) {
472
- return service.service === currentService && service.id_retailer === currentRetailer;
473
- }),
474
- currentStatus = _state$services_data$.status;
475
-
476
- var originTab = origin[state.active_tab];
477
- var isRetailerUser = (user === null || user === void 0 ? void 0 : user.is_retailer) === 1;
478
- var validStatuses = ["AA", "AP", "R", "CA", "RCA"];
479
- if (!validStatuses.includes(currentStatus)) return false;
480
- var validOrigins = ["RequestWithContentoh", "RequestWithoutContentoh", "Contentoh"];
481
- if (!validOrigins.includes(originTab)) return false; // Retailer: solo AP
455
+ if (!((_state$product2 = state.product) !== null && _state$product2 !== void 0 && _state$product2.statusByRetailer)) return false;
456
+ var currentService = (0, _utils.getConceptByTab)(state.active_tab);
457
+ var currentStatus = state.product["".concat(currentService, "_status")];
458
+ var originTab = origin[state.active_tab];
459
+ var isRetailerUser = (user === null || user === void 0 ? void 0 : user.is_retailer) === 1;
460
+ var validStatuses = ["AA", "AP", "R", "CA", "RCA"];
461
+ if (!validStatuses.includes(currentStatus)) return false;
462
+ var validOrigins = ["RequestWithContentoh", "RequestWithoutContentoh", "Contentoh"];
463
+ if (!validOrigins.includes(originTab)) return false; // Retailer: solo AP
482
464
 
483
- if (isRetailerUser) {
484
- return currentStatus === "AP";
485
- } // No retailer
465
+ if (isRetailerUser) {
466
+ return currentStatus === "AP";
467
+ } // No retailer
486
468
 
487
469
 
488
- var hasNoOrder = !state.product.id_order && !state.product.orderId;
489
- var condition = originTab === "RequestWithoutContentoh" && (["R", "CA"].includes(currentStatus) || currentStatus === "RCA" && hasNoOrder) || ["RequestWithContentoh", "Contentoh"].includes(originTab) && currentStatus === "AA";
490
- return condition;
491
- } catch (error) {
492
- return false;
493
- }
470
+ var hasNoOrder = !state.product.id_order && !state.product.orderId;
471
+ return originTab === "RequestWithoutContentoh" && (["R", "CA"].includes(currentStatus) || currentStatus === "RCA" && hasNoOrder) || ["RequestWithContentoh", "Contentoh"].includes(originTab) && currentStatus === "AA";
494
472
  };
495
473
 
496
474
  var canShowSaveButton = function canShowSaveButton(version_status) {
@@ -508,10 +486,10 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
508
486
 
509
487
  var getStatusByCurrentServiceAndRetailer = function getStatusByCurrentServiceAndRetailer() {
510
488
  var statusByRetailer = state.product.statusByRetailer;
511
- if (!statusByRetailer || Object.keys(statusByRetailer).length === 0) return "-";
489
+ if (!statusByRetailer) return "-";
512
490
  var currentService = (0, _utils.getConceptByTab)(state.active_tab);
513
491
  var currentRetailer = state.active_retailer.id_retailer;
514
- var currentStatus = statusByRetailer[currentRetailer][currentService] || "N/S";
492
+ var currentStatus = statusByRetailer[currentRetailer][currentService] || "ERR";
515
493
  return currentStatus;
516
494
  };
517
495
 
@@ -582,9 +560,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
582
560
  };
583
561
 
584
562
  var handleOnClickSaveImages = function handleOnClickSaveImages() {
585
- var _state$product9, _state$product9$servi;
563
+ var _state$product3, _state$product3$servi;
586
564
 
587
- if (((_state$product9 = state.product) === null || _state$product9 === void 0 ? void 0 : (_state$product9$servi = _state$product9.services) === null || _state$product9$servi === void 0 ? void 0 : _state$product9$servi.images) === 1) {
565
+ if (((_state$product3 = state.product) === null || _state$product3 === void 0 ? void 0 : (_state$product3$servi = _state$product3.services) === null || _state$product3$servi === void 0 ? void 0 : _state$product3$servi.images) === 1) {
588
566
  updateImages();
589
567
  }
590
568
  };
@@ -805,10 +783,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
805
783
 
806
784
  var sendEvaluation = /*#__PURE__*/function () {
807
785
  var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(result) {
808
- var _state$product$id_ord, _state$product10, _state$active_retaile2;
809
-
810
- var concept, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, _newStatuses$newStatu, _state$services_data, res, newStatuses, serviceStatus, updatedProduct, updatedServicesData;
786
+ var _state$product$id_ord, _state$product4, _state$active_retaile2;
811
787
 
788
+ var concept, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, serviceStatus, updatedProduct;
812
789
  return _regenerator.default.wrap(function _callee3$(_context3) {
813
790
  while (1) {
814
791
  switch (_context3.prev = _context3.next) {
@@ -821,7 +798,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
821
798
  articleId = state.product.id_article;
822
799
  orderId = (_state$product$id_ord = state.product.id_order) !== null && _state$product$id_ord !== void 0 ? _state$product$id_ord : state.product.orderId;
823
800
  sectionStatusKey = "".concat(concept, "_status");
824
- evalStatus = state.product[sectionStatusKey] || ((_state$product10 = state.product) === null || _state$product10 === void 0 ? void 0 : _state$product10.version_status);
801
+ evalStatus = state.product[sectionStatusKey] || ((_state$product4 = state.product) === null || _state$product4 === void 0 ? void 0 : _state$product4.version_status);
825
802
  data = {
826
803
  articleId: articleId,
827
804
  orderId: orderId,
@@ -832,7 +809,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
832
809
  _context3.prev = 8;
833
810
 
834
811
  if (!result) {
835
- _context3.next = 22;
812
+ _context3.next = 21;
836
813
  break;
837
814
  }
838
815
 
@@ -851,20 +828,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
851
828
  serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")]; // Actualizar el producto con los nuevos estados
852
829
 
853
830
  updatedProduct = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
854
- statusByRetailer: (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product.statusByRetailer), {}, (0, _defineProperty2.default)({}, retailerId, (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product.statusByRetailer[retailerId]), {}, (0, _defineProperty2.default)({}, concept, (_newStatuses$newStatu = newStatuses === null || newStatuses === void 0 ? void 0 : newStatuses.newStatus) !== null && _newStatuses$newStatu !== void 0 ? _newStatuses$newStatu : serviceStatus))))
831
+ statusByRetailer: (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product.statusByRetailer), {}, (0, _defineProperty2.default)({}, retailerId, (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product.statusByRetailer[retailerId]), {}, (0, _defineProperty2.default)({}, concept, serviceStatus))))
855
832
  });
856
- updatedServicesData = (_state$services_data = state.services_data) === null || _state$services_data === void 0 ? void 0 : _state$services_data.map(function (service) {
857
- var _newStatuses$newStatu2;
858
-
859
- return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, service), {}, {
860
- status: (service === null || service === void 0 ? void 0 : service.id_retailer) === retailerId && (service === null || service === void 0 ? void 0 : service.service) === concept ? (_newStatuses$newStatu2 = newStatuses === null || newStatuses === void 0 ? void 0 : newStatuses.newStatus) !== null && _newStatuses$newStatu2 !== void 0 ? _newStatuses$newStatu2 : serviceStatus : service === null || service === void 0 ? void 0 : service.status
861
- });
833
+ console.log({
834
+ updatedProduct: updatedProduct
862
835
  });
863
- dispatch({
864
- type: "SET_SERVICES_DATA",
865
- payload: updatedServicesData
866
- }); // console.log({ updatedProduct });
867
-
868
836
  dispatch({
869
837
  type: "SET_PRODUCT",
870
838
  payload: updatedProduct
@@ -880,12 +848,12 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
880
848
  }
881
849
  });
882
850
 
883
- case 22:
884
- _context3.next = 28;
851
+ case 21:
852
+ _context3.next = 27;
885
853
  break;
886
854
 
887
- case 24:
888
- _context3.prev = 24;
855
+ case 23:
856
+ _context3.prev = 23;
889
857
  _context3.t0 = _context3["catch"](8);
890
858
  console.error("Error sending evaluation:", _context3.t0);
891
859
  dispatch({
@@ -898,20 +866,20 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
898
866
  }
899
867
  });
900
868
 
901
- case 28:
902
- _context3.prev = 28;
869
+ case 27:
870
+ _context3.prev = 27;
903
871
  dispatch({
904
872
  type: "SET_SAVING",
905
873
  payload: false
906
874
  });
907
- return _context3.finish(28);
875
+ return _context3.finish(27);
908
876
 
909
- case 31:
877
+ case 30:
910
878
  case "end":
911
879
  return _context3.stop();
912
880
  }
913
881
  }
914
- }, _callee3, null, [[8, 24, 28, 31]]);
882
+ }, _callee3, null, [[8, 23, 27, 30]]);
915
883
  }));
916
884
 
917
885
  return function sendEvaluation(_x2) {
@@ -1133,7 +1101,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1133
1101
 
1134
1102
  var handleOnEvaluateAll = /*#__PURE__*/function () {
1135
1103
  var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(result) {
1136
- var _state$product$id_ord2, _state$services_data2, evaluationArray, conceptArray, dataGeneral, userType, status, updatedStatusByRetailer, updatedProduct;
1104
+ var _state$product$id_ord2, _state$services_data, evaluationArray, conceptArray, dataGeneral, userType, status, updatedStatusByRetailer, updatedProduct;
1137
1105
 
1138
1106
  return _regenerator.default.wrap(function _callee5$(_context5) {
1139
1107
  while (1) {
@@ -1153,7 +1121,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1153
1121
  isAproved: result === "A"
1154
1122
  }; // Crear todas las evaluaciones para cada servicio y retailer
1155
1123
 
1156
- (_state$services_data2 = state.services_data) === null || _state$services_data2 === void 0 ? void 0 : _state$services_data2.forEach(function (ret) {
1124
+ (_state$services_data = state.services_data) === null || _state$services_data === void 0 ? void 0 : _state$services_data.forEach(function (ret) {
1157
1125
  var service = ret.service,
1158
1126
  id_retailer = ret.id_retailer;
1159
1127
  var data = {};
@@ -1283,334 +1251,330 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1283
1251
  };
1284
1252
 
1285
1253
  if (state.loading || !state.services || !state.product) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {});
1286
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AiProductEdition.AiProductEditionProvider, {
1287
- isCreatorsEdition: false,
1288
- state: state,
1289
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
1290
- headerTop: headerTop,
1291
- children: [showVersionSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelector.VersionSelector, {
1292
- modalId: "version-selector",
1293
- articleId: state.product.id_article,
1294
- setVersion: handleOnChangeProductVersion,
1295
- companyName: company.company_name,
1296
- currentVersion: state.product.version,
1297
- setShowVersionSelector: setShowVersionSelector,
1298
- jwt: token
1299
- }), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
1300
- images: state.images_values,
1301
- setShowModal: setShowModal,
1302
- approveRejectButtons: canShowValidationButtons(),
1303
- sendToFacilitator: handleOnSendEvaluation
1304
- }), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
1305
- componentsArray: [state.modal.image && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
1306
- src: state.modal.image,
1307
- alt: "modal icon"
1308
- }, "1"), state.modal.title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1309
- headerType: "retailer-name-header",
1310
- text: state.modal.title,
1311
- color: "white"
1312
- }, "2"), state.modal.message && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1313
- headerType: "retailer-name-header",
1314
- text: state.modal.message,
1315
- color: "white"
1316
- }, "3"), state.modal.buttons && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1317
- style: {
1318
- marginTop: "16px"
1319
- },
1320
- children: state.modal.buttons.map(function (button, index) {
1321
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1322
- buttonType: button.buttonType,
1323
- label: button.text,
1324
- onClick: button.action
1325
- }, index);
1326
- })
1327
- }, "4")].filter(Boolean),
1254
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
1255
+ headerTop: headerTop,
1256
+ children: [showVersionSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelector.VersionSelector, {
1257
+ modalId: "version-selector",
1258
+ articleId: state.product.id_article,
1259
+ setVersion: handleOnChangeProductVersion,
1260
+ companyName: company.company_name,
1261
+ currentVersion: state.product.version,
1262
+ setShowVersionSelector: setShowVersionSelector,
1263
+ jwt: token
1264
+ }), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
1265
+ images: state.images_values,
1266
+ setShowModal: setShowModal,
1267
+ approveRejectButtons: canShowValidationButtons(),
1268
+ sendToFacilitator: handleOnSendEvaluation
1269
+ }), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
1270
+ componentsArray: [state.modal.image && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
1271
+ src: state.modal.image,
1272
+ alt: "modal icon"
1273
+ }, "1"), state.modal.title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1274
+ headerType: "retailer-name-header",
1275
+ text: state.modal.title,
1276
+ color: "white"
1277
+ }, "2"), state.modal.message && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1278
+ headerType: "retailer-name-header",
1279
+ text: state.modal.message,
1280
+ color: "white"
1281
+ }, "3"), state.modal.buttons && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1282
+ style: {
1283
+ marginTop: "16px"
1284
+ },
1285
+ children: state.modal.buttons.map(function (button, index) {
1286
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1287
+ buttonType: button.buttonType,
1288
+ label: button.text,
1289
+ onClick: button.action
1290
+ }, index);
1291
+ })
1292
+ }, "4")].filter(Boolean),
1293
+ onClick: function onClick() {
1294
+ return dispatch({
1295
+ type: "SET_MODAL",
1296
+ payload: {
1297
+ show: false,
1298
+ title: "",
1299
+ message: "",
1300
+ image: null
1301
+ }
1302
+ });
1303
+ }
1304
+ }), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
1305
+ title: rejectAll ? "Agregar mensaje para rechazar todo" : "Agregar mensaje de rechazo",
1306
+ show: showRejectModal,
1307
+ customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
1308
+ inputType: "textarea",
1309
+ inputId: "modal-message-box",
1310
+ index: 0,
1311
+ color: "white"
1312
+ }),
1313
+ buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
1314
+ type: "white",
1315
+ label: "Cancelar",
1316
+ size: 12,
1328
1317
  onClick: function onClick() {
1329
- return dispatch({
1330
- type: "SET_MODAL",
1331
- payload: {
1332
- show: false,
1333
- title: "",
1334
- message: "",
1335
- image: null
1336
- }
1337
- });
1318
+ setShowRejectModal(false);
1338
1319
  }
1339
- }), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
1340
- title: rejectAll ? "Agregar mensaje para rechazar todo" : "Agregar mensaje de rechazo",
1341
- show: showRejectModal,
1342
- customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
1343
- inputType: "textarea",
1344
- inputId: "modal-message-box",
1345
- index: 0,
1346
- color: "white"
1347
- }),
1348
- buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
1349
- type: "white",
1350
- label: "Cancelar",
1351
- size: 12,
1352
- onClick: function onClick() {
1353
- setShowRejectModal(false);
1354
- }
1355
- }, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
1356
- type: "pink",
1357
- label: "Aceptar",
1358
- size: 12,
1359
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
1360
- var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
1361
- return _regenerator.default.wrap(function _callee6$(_context6) {
1362
- while (1) {
1363
- switch (_context6.prev = _context6.next) {
1364
- case 0:
1365
- elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
1366
-
1367
- if (!(!elements || elements.length === 0)) {
1368
- _context6.next = 4;
1369
- break;
1370
- }
1320
+ }, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
1321
+ type: "pink",
1322
+ label: "Aceptar",
1323
+ size: 12,
1324
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
1325
+ var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
1326
+ return _regenerator.default.wrap(function _callee6$(_context6) {
1327
+ while (1) {
1328
+ switch (_context6.prev = _context6.next) {
1329
+ case 0:
1330
+ elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
1331
+
1332
+ if (!(!elements || elements.length === 0)) {
1333
+ _context6.next = 4;
1334
+ break;
1335
+ }
1371
1336
 
1372
- console.error("Elemento no encontrado");
1373
- return _context6.abrupt("return");
1337
+ console.error("Elemento no encontrado");
1338
+ return _context6.abrupt("return");
1374
1339
 
1375
- case 4:
1376
- isMessageEmpty = Array.from(elements).every(function (el) {
1377
- var body = el.innerHTML;
1378
- return !body || body.replace(/<.*?\/?>/gm, "").trim() === "";
1379
- });
1340
+ case 4:
1341
+ isMessageEmpty = Array.from(elements).every(function (el) {
1342
+ var body = el.innerHTML;
1343
+ return !body || body.replace(/<.*?\/?>/gm, "").trim() === "";
1344
+ });
1380
1345
 
1381
- if (!isMessageEmpty) {
1382
- _context6.next = 10;
1383
- break;
1384
- }
1346
+ if (!isMessageEmpty) {
1347
+ _context6.next = 10;
1348
+ break;
1349
+ }
1385
1350
 
1386
- container = document.querySelector(".container-customComponent");
1387
- existingAlert = container.querySelector(".alert-error");
1351
+ container = document.querySelector(".container-customComponent");
1352
+ existingAlert = container.querySelector(".alert-error");
1388
1353
 
1389
- if (!existingAlert) {
1390
- alert = document.createElement("div");
1391
- alert.className = "alert-error";
1392
- alert.style.cssText = "\n color: #d32f2f;\n background-color: #ffebee;\n border: 1px solid #ef5350;\n border-radius: 4px;\n padding: 12px 16px;\n margin-top: 10px;\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 8px;\n font-family: 'Roboto', sans-serif;\n text-align: center;\n ";
1393
- alert.innerHTML = "<span>El mensaje no puede estar vac\xEDo.</span>";
1394
- container.appendChild(alert);
1395
- }
1354
+ if (!existingAlert) {
1355
+ alert = document.createElement("div");
1356
+ alert.className = "alert-error";
1357
+ alert.style.cssText = "\n color: #d32f2f;\n background-color: #ffebee;\n border: 1px solid #ef5350;\n border-radius: 4px;\n padding: 12px 16px;\n margin-top: 10px;\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 8px;\n font-family: 'Roboto', sans-serif;\n text-align: center;\n ";
1358
+ alert.innerHTML = "<span>El mensaje no puede estar vac\xEDo.</span>";
1359
+ container.appendChild(alert);
1360
+ }
1396
1361
 
1397
- return _context6.abrupt("return");
1362
+ return _context6.abrupt("return");
1398
1363
 
1399
- case 10:
1400
- fullMessage = Array.from(elements).map(function (element) {
1401
- return element.innerHTML;
1402
- }).join("").replace(/<br\s*\/?>/gi, "\n");
1403
- _context6.next = 13;
1404
- return createComment(fullMessage, token);
1364
+ case 10:
1365
+ fullMessage = Array.from(elements).map(function (element) {
1366
+ return element.innerHTML;
1367
+ }).join("").replace(/<br\s*\/?>/gi, "\n");
1368
+ _context6.next = 13;
1369
+ return createComment(fullMessage);
1405
1370
 
1406
- case 13:
1407
- rejectAll ? handleOnEvaluateAll("R") : handleOnSendEvaluation("R");
1408
- setShowRejectModal(false);
1371
+ case 13:
1372
+ rejectAll ? handleOnEvaluateAll("R") : handleOnSendEvaluation("R");
1373
+ setShowRejectModal(false);
1409
1374
 
1410
- case 15:
1411
- case "end":
1412
- return _context6.stop();
1413
- }
1375
+ case 15:
1376
+ case "end":
1377
+ return _context6.stop();
1414
1378
  }
1415
- }, _callee6);
1416
- }))
1417
- }, "btn-Aceptar")]
1418
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
1419
- setHeaderTop: setHeaderTop,
1420
- withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
1421
- chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
1422
- productSelected: state.product,
1423
- token: token,
1424
- activeRetailer: {
1425
- id: (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer,
1426
- name: (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.retailer
1427
- }
1428
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1429
- className: "data-container",
1430
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1431
- className: "image-data-panel",
1432
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagePreviewer.ImagePreviewer, {
1433
- activeImage: (_state$images_values$2 = state.images_values.values[state.current_image]) !== null && _state$images_values$2 !== void 0 ? _state$images_values$2 : {},
1434
- imagesArray: state.images_values || [],
1435
- setActiveImage: handleOnChangeCurrentImage,
1436
- setShowModal: handleOnShowModalGalery
1437
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageDataTable.ImageDataTable, {
1438
- lists: state.images_values || [],
1439
- activeImage: (_state$images_values10 = state.images_values) !== null && _state$images_values10 !== void 0 && _state$images_values10.values ? (_state$images_values11 = state.images_values) === null || _state$images_values11 === void 0 ? void 0 : _state$images_values11.values[state.current_image] : {},
1440
- assignationsImages: assig,
1441
- retailerSelected: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
1442
- imagesStatus: ((_state$product11 = state.product) === null || _state$product11 === void 0 ? void 0 : _state$product11.images_status) || "-",
1443
- isRetailer: isRetailer,
1444
- setShowVersionSelector: setShowVersionSelector,
1445
- version: state.product.version,
1446
- setImages: handleOnChangeCurrentImage,
1447
- onClickSave: handleOnClickSaveImages,
1448
- setAssignation: handleOnChangeAssignations // No se usa?
1379
+ }
1380
+ }, _callee6);
1381
+ }))
1382
+ }, "btn-Aceptar")]
1383
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
1384
+ setHeaderTop: setHeaderTop,
1385
+ withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
1386
+ chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
1387
+ productSelected: state.product,
1388
+ token: token,
1389
+ activeRetailer: {
1390
+ id: (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer,
1391
+ name: (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.retailer
1392
+ }
1393
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1394
+ className: "data-container",
1395
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1396
+ className: "image-data-panel",
1397
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagePreviewer.ImagePreviewer, {
1398
+ activeImage: (_state$images_values$2 = state.images_values.values[state.current_image]) !== null && _state$images_values$2 !== void 0 ? _state$images_values$2 : {},
1399
+ imagesArray: state.images_values || [],
1400
+ setActiveImage: handleOnChangeCurrentImage,
1401
+ setShowModal: handleOnShowModalGalery
1402
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageDataTable.ImageDataTable, {
1403
+ lists: state.images_values || [],
1404
+ activeImage: (_state$images_values10 = state.images_values) !== null && _state$images_values10 !== void 0 && _state$images_values10.values ? (_state$images_values11 = state.images_values) === null || _state$images_values11 === void 0 ? void 0 : _state$images_values11.values[state.current_image] : {},
1405
+ assignationsImages: assig,
1406
+ retailerSelected: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
1407
+ imagesStatus: ((_state$product5 = state.product) === null || _state$product5 === void 0 ? void 0 : _state$product5.images_status) || "-",
1408
+ isRetailer: isRetailer,
1409
+ setShowVersionSelector: setShowVersionSelector,
1410
+ version: state.product.version,
1411
+ setImages: handleOnChangeCurrentImage,
1412
+ onClickSave: handleOnClickSaveImages,
1413
+ setAssignation: handleOnChangeAssignations // No se usa?
1449
1414
 
1450
- })]
1451
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1415
+ })]
1416
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1417
+ className: "product-information",
1418
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1452
1419
  className: "product-information",
1453
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1454
- className: "product-information",
1455
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FullProductNameHeader.FullProductNameHeader, {
1456
- headerData: state.product,
1457
- percent: state.active_percentage.percentagesGeneral.required,
1458
- activeRetailer: {
1459
- id: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
1460
- name: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.retailer,
1461
- image: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.image
1462
- },
1463
- showValidationButtons: canShowValidationButtons(),
1464
- showApproveRejectAll: canShowValidationButtons(),
1465
- servicesData: state.services_data ? state.services_data : null,
1466
- approveAll: handleOnApproveAll,
1467
- rejectAll: handleOnRejectAll,
1468
- approve: function approve() {
1469
- return handleOnSendEvaluation("A");
1470
- },
1471
- reject: handleOnReject,
1472
- setActiveRetailer: handleOnChangeActiveRetailer
1473
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
1474
- tabsSections: tabsSections,
1475
- status: getStatusByCurrentServiceAndRetailer(),
1476
- activeTab: state.active_tab,
1477
- user: user,
1478
- isRetailer: isRetailer,
1479
- assig: assig,
1480
- version: state.product.version,
1481
- updatedDescriptions: state.updated_descriptions_inputs,
1482
- updatedDatasheets: state.updated_datasheets_inputs,
1483
- updatedImages: state.updated_images_values,
1484
- images: state.services.images // actions
1485
- ,
1486
- downloadImages: handleOnDownloadImages,
1487
- askToDeleteImages: handleOnAskToDeleteImages,
1488
- showSaveButton: canShowSaveButton(state.product.version_status),
1489
- onClickSave: handleOnClickSave // setters
1490
- ,
1491
- setActiveTab: handleOnChangeActiveTab,
1492
- setImageLayout: handleOnSetImageLayout,
1493
- setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
1494
- setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
1495
- setAssignation: handleOnSetAssignation // No se usa?
1496
- ,
1497
- setImages: handleOnSetImages // No se usa?
1498
- // setSelectedImages={handleOnSetSelectedImages} // Se pasa hasta TabsMenu, pero no se usa
1499
- ,
1500
- setShowVersionSelector: setShowVersionSelector
1501
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1502
- className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
1503
- children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1504
- children: [state.active_tab === "Descripción" && (((_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1505
- activeSection: state.active_tab,
1506
- inputGroup: state.descriptions_inputs[0],
1507
- updatedDescriptions: state.updated_descriptions_inputs,
1508
- articleId: (_state$product13 = state.product) === null || _state$product13 === void 0 ? void 0 : _state$product13.id_article,
1509
- version: state.product.version,
1510
- isShowbox: false,
1511
- dinamicHeight: true,
1512
- setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
1513
- updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
1514
-
1515
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1516
- text: "No cuentas con este servicio",
1517
- headerType: "input-name-header"
1518
- })), state.active_tab === "Ficha técnica" && (((_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
1519
- children: (_state$datasheets_inp = state.datasheets_inputs[0]) === null || _state$datasheets_inp === void 0 ? void 0 : (_state$datasheets_inp2 = _state$datasheets_inp.data) === null || _state$datasheets_inp2 === void 0 ? void 0 : _state$datasheets_inp2.map(function (dataGroup, index) {
1520
- var _state$datasheets_inp3;
1521
-
1522
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1523
- index: index,
1524
- articleId: state.product.id_article,
1525
- version: state.version,
1526
- activeSection: state.active_tab,
1527
- inputGroup: dataGroup,
1528
- dataInputs: (_state$datasheets_inp3 = state.datasheets_inputs[1]) !== null && _state$datasheets_inp3 !== void 0 ? _state$datasheets_inp3 : [],
1529
- activeRetailer: state.services.datasheets[state.active_retailer.id_retailer],
1530
- groupData: state.services.datasheets[state.active_retailer.id_retailer].data,
1531
- updatedDatasheets: state.updated_datasheets_inputs,
1532
- setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
1533
- isShowbox: true,
1534
- setUpdatedBoxData: function setUpdatedBoxData(e) {
1535
- setBoxData(e);
1536
- },
1537
- updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
1538
-
1539
- }, index + "-" + state.active_retailer.retailer);
1540
- })
1541
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1542
- text: "No cuentas con este servicio",
1543
- headerType: "input-name-header"
1544
- })), state.active_tab === "Imágenes" && (((_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1545
- children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
1546
- checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
1547
- ,
1548
- setCheckAll: handleOnSetCheckAll // Toggler de true o false para el checkbox "Seleccionar todo"
1549
- ,
1550
- setSelectedImages: handleOnSetSelectedImages
1551
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("section", {
1552
- className: "container",
1420
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FullProductNameHeader.FullProductNameHeader, {
1421
+ headerData: state.product,
1422
+ percent: state.active_percentage.percentagesGeneral.required,
1423
+ activeRetailer: {
1424
+ id: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
1425
+ name: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.retailer,
1426
+ image: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.image
1427
+ },
1428
+ showValidationButtons: canShowValidationButtons(),
1429
+ showApproveRejectAll: canShowValidationButtons(),
1430
+ servicesData: state.services_data ? state.services_data : null,
1431
+ approveAll: handleOnApproveAll,
1432
+ rejectAll: handleOnRejectAll,
1433
+ approve: function approve() {
1434
+ return handleOnSendEvaluation("A");
1435
+ },
1436
+ reject: handleOnReject,
1437
+ setActiveRetailer: handleOnChangeActiveRetailer
1438
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
1439
+ tabsSections: tabsSections,
1440
+ status: getStatusByCurrentServiceAndRetailer(),
1441
+ activeTab: state.active_tab,
1442
+ user: user,
1443
+ isRetailer: isRetailer,
1444
+ assig: assig,
1445
+ version: state.product.version,
1446
+ updatedDescriptions: state.updated_descriptions_inputs,
1447
+ updatedDatasheets: state.updated_datasheets_inputs,
1448
+ updatedImages: state.updated_images_values,
1449
+ images: state.services.images // actions
1450
+ ,
1451
+ downloadImages: handleOnDownloadImages,
1452
+ askToDeleteImages: handleOnAskToDeleteImages,
1453
+ showSaveButton: canShowSaveButton(state.product.version_status),
1454
+ onClickSave: handleOnClickSave // setters
1455
+ ,
1456
+ setActiveTab: handleOnChangeActiveTab,
1457
+ setImageLayout: handleOnSetImageLayout,
1458
+ setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
1459
+ setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
1460
+ setAssignation: handleOnSetAssignation // No se usa?
1461
+ ,
1462
+ setImages: handleOnSetImages // No se usa?
1463
+ // setSelectedImages={handleOnSetSelectedImages} // Se pasa hasta TabsMenu, pero no se usa
1464
+ ,
1465
+ setShowVersionSelector: setShowVersionSelector
1466
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1467
+ className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
1468
+ children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1469
+ children: [state.active_tab === "Descripción" && (((_state$product6 = state.product) === null || _state$product6 === void 0 ? void 0 : _state$product6.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1470
+ activeSection: state.active_tab,
1471
+ inputGroup: state.descriptions_inputs[0],
1472
+ updatedDescriptions: state.updated_descriptions_inputs,
1473
+ articleId: (_state$product7 = state.product) === null || _state$product7 === void 0 ? void 0 : _state$product7.id_article,
1474
+ version: state.product.version,
1475
+ isShowbox: false,
1476
+ dinamicHeight: true,
1477
+ setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
1478
+ updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
1479
+
1480
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1481
+ text: "No cuentas con este servicio",
1482
+ headerType: "input-name-header"
1483
+ })), state.active_tab === "Ficha técnica" && (((_state$product8 = state.product) === null || _state$product8 === void 0 ? void 0 : _state$product8.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
1484
+ children: (_state$datasheets_inp = state.datasheets_inputs[0].data) === null || _state$datasheets_inp === void 0 ? void 0 : _state$datasheets_inp.map(function (dataGroup, index) {
1485
+ var _state$datasheets_inp2;
1486
+
1487
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1488
+ index: index,
1489
+ articleId: state.product.id_article,
1490
+ version: state.version,
1491
+ activeSection: state.active_tab,
1492
+ inputGroup: dataGroup,
1493
+ dataInputs: (_state$datasheets_inp2 = state.datasheets_inputs[1]) !== null && _state$datasheets_inp2 !== void 0 ? _state$datasheets_inp2 : [],
1494
+ activeRetailer: state.services.datasheets[state.active_retailer.id_retailer],
1495
+ groupData: state.services.datasheets[state.active_retailer.id_retailer].data,
1496
+ updatedDatasheets: state.updated_datasheets_inputs,
1497
+ setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
1498
+ isShowbox: true,
1499
+ setUpdatedBoxData: function setUpdatedBoxData(e) {
1500
+ setBoxData(e);
1501
+ },
1502
+ updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
1503
+
1504
+ }, index + "-" + state.active_retailer.retailer);
1505
+ })
1506
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1507
+ text: "No cuentas con este servicio",
1508
+ headerType: "input-name-header"
1509
+ })), state.active_tab === "Imágenes" && (((_state$product9 = state.product) === null || _state$product9 === void 0 ? void 0 : _state$product9.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1510
+ children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
1511
+ checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
1512
+ ,
1513
+ setCheckAll: handleOnSetCheckAll // Toggler de true o false para el checkbox "Seleccionar todo"
1514
+ ,
1515
+ setSelectedImages: handleOnSetSelectedImages
1516
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("section", {
1517
+ className: "container",
1518
+ style: {
1519
+ position: "relative"
1520
+ },
1521
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread4.default)((0, _objectSpread4.default)({}, getRootProps({
1522
+ className: "dropzone ".concat(isDragActive ? "drag-active" : "")
1523
+ })), {}, {
1524
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread4.default)({}, getInputProps())), isDragActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1525
+ className: "drag-overlay",
1526
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1527
+ children: "Suelta las im\xE1genes aqu\xED"
1528
+ })
1529
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("aside", {
1530
+ children: thumbs()
1531
+ })]
1532
+ })), ((_state$images_values12 = state.images_values) === null || _state$images_values12 === void 0 ? void 0 : _state$images_values12.values.length) === 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1553
1533
  style: {
1554
- position: "relative"
1534
+ position: "absolute",
1535
+ top: "50%",
1536
+ left: "50%",
1537
+ transform: "translate(-50%, -50%)",
1538
+ textAlign: "center",
1539
+ padding: "40px",
1540
+ width: "80%",
1541
+ maxWidth: "500px",
1542
+ fontFamily: "Arial, sans-serif"
1555
1543
  },
1556
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread4.default)((0, _objectSpread4.default)({}, getRootProps({
1557
- className: "dropzone ".concat(isDragActive ? "drag-active" : "")
1558
- })), {}, {
1559
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread4.default)({}, getInputProps())), isDragActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1560
- className: "drag-overlay",
1561
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1562
- children: "Suelta las im\xE1genes aqu\xED"
1563
- })
1564
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("aside", {
1565
- children: thumbs()
1566
- })]
1567
- })), ((_state$images_values12 = state.images_values) === null || _state$images_values12 === void 0 ? void 0 : _state$images_values12.values.length) === 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1544
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1568
1545
  style: {
1569
- position: "absolute",
1570
- top: "50%",
1571
- left: "50%",
1572
- transform: "translate(-50%, -50%)",
1573
- textAlign: "center",
1574
- padding: "40px",
1575
- width: "80%",
1576
- maxWidth: "500px",
1577
- fontFamily: "Arial, sans-serif"
1546
+ fontSize: "18px",
1547
+ color: "#666",
1548
+ marginBottom: "16px"
1578
1549
  },
1579
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1580
- style: {
1581
- fontSize: "18px",
1582
- color: "#666",
1583
- marginBottom: "16px"
1584
- },
1585
- children: "Este producto no tiene im\xE1genes"
1586
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
1550
+ children: "Este producto no tiene im\xE1genes"
1551
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
1552
+ style: {
1553
+ fontSize: "14px",
1554
+ color: "#999",
1555
+ marginBottom: "20px"
1556
+ },
1557
+ children: ["Arrastra las im\xE1genes aqu\xED o", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1558
+ onClick: open,
1587
1559
  style: {
1588
- fontSize: "14px",
1589
- color: "#999",
1590
- marginBottom: "20px"
1560
+ color: "#007bff",
1561
+ cursor: "pointer",
1562
+ textDecoration: "underline"
1591
1563
  },
1592
- children: ["Arrastra las im\xE1genes aqu\xED o", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1593
- onClick: open,
1594
- style: {
1595
- color: "#007bff",
1596
- cursor: "pointer",
1597
- textDecoration: "underline"
1598
- },
1599
- children: "haz clic para abrir el explorador de archivos"
1600
- })]
1564
+ children: "haz clic para abrir el explorador de archivos"
1601
1565
  })]
1602
1566
  })]
1603
1567
  })]
1604
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1605
- text: "No cuentas con este servicio",
1606
- headerType: "input-name-header"
1607
- }))]
1608
- })
1609
- })]
1610
- })
1611
- })]
1568
+ })]
1569
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1570
+ text: "No cuentas con este servicio",
1571
+ headerType: "input-name-header"
1572
+ }))]
1573
+ })
1574
+ })]
1575
+ })
1612
1576
  })]
1613
- })
1577
+ })]
1614
1578
  });
1615
1579
  };
1616
1580