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.
- package/dist/components/atoms/GeneralButton/styles.js +1 -1
- package/dist/components/atoms/GeneralInput/index.js +54 -249
- package/dist/components/atoms/GeneralInput/styles.js +3 -7
- package/dist/components/atoms/InputFormatter/index.js +68 -223
- package/dist/components/atoms/InputFormatter/styles.js +4 -20
- package/dist/components/molecules/StatusAsignationInfo/index.js +1 -11
- package/dist/components/molecules/TabsMenu/index.js +1 -13
- package/dist/components/molecules/TagAndInput/index.js +24 -364
- package/dist/components/molecules/TagAndInput/styles.js +2 -2
- package/dist/components/organisms/FullProductNameHeader/index.js +22 -6
- package/dist/components/organisms/InputGroup/index.js +18 -22
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +337 -150
- package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +15 -15
- package/dist/components/pages/ProviderProductEdition/index.js +377 -413
- package/dist/components/pages/ProviderProductEdition/utils.js +0 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +211 -125
- package/dist/components/pages/RetailerProductEdition/index.js +2236 -1738
- package/dist/components/pages/RetailerProductEdition/styles.js +2 -4
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -251
- package/package.json +2 -4
- package/src/components/atoms/GeneralButton/styles.js +0 -4
- package/src/components/atoms/GeneralInput/index.js +60 -241
- package/src/components/atoms/GeneralInput/styles.js +0 -81
- package/src/components/atoms/InputFormatter/index.js +51 -200
- package/src/components/atoms/InputFormatter/styles.js +0 -284
- package/src/components/molecules/StatusAsignationInfo/index.js +1 -9
- package/src/components/molecules/TabsMenu/index.js +0 -12
- package/src/components/molecules/TagAndInput/index.js +21 -294
- package/src/components/molecules/TagAndInput/styles.js +17 -59
- package/src/components/organisms/FullProductNameHeader/index.js +28 -4
- package/src/components/organisms/FullTabsMenu/index.js +1 -1
- package/src/components/organisms/InputGroup/index.js +4 -12
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +202 -174
- package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +14 -14
- package/src/components/pages/ProviderProductEdition/index.js +418 -486
- package/src/components/pages/ProviderProductEdition/utils.js +2 -2
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +243 -136
- package/src/components/pages/RetailerProductEdition/index.js +1717 -1563
- package/src/components/pages/RetailerProductEdition/styles.js +2 -67
- package/src/components/pages/RetailerProductEdition/utils.js +0 -240
- package/src/ai/utils/compare-strings.js +0 -45
- package/src/assets/images/Icons/arrow.png +0 -0
- package/src/assets/images/Icons/cancel.png +0 -0
- package/src/assets/images/Icons/ia-icon.png +0 -0
- package/src/assets/images/Icons/loading.svg +0 -5
- package/src/assets/images/Icons/reload.png +0 -0
- package/src/components/atoms/RetailerSelector/RetailerSelector.stories.js +0 -10
- package/src/components/atoms/RetailerSelector/index.js +0 -3
- package/src/components/atoms/RetailerSelector/styles.js +0 -0
- package/src/components/organisms/ChangeStatusModal/index.jsx +0 -488
- package/src/components/organisms/ChangeStatusModal/styles.js +0 -333
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +0 -575
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +0 -62
- package/src/components/pages/RetailerProductEdition/context/reducers/active-state.js +0 -344
- package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +0 -155
- package/src/components/pages/RetailerProductEdition/context/reducers/product.js +0 -114
- package/src/components/pages/RetailerProductEdition/context/reducers/system.js +0 -60
- package/src/components/pages/RetailerProductEdition/index_old.js +0 -1979
- package/src/components/pages/RetailerProductEdition/stories/Auditor.stories.js +0 -101
- package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -115
- package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +0 -174
- package/src/contexts/AiProductEdition.jsx +0 -347
- 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,
|
|
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)(
|
|
113
|
+
var _useState = (0, _react.useState)(null),
|
|
116
114
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
123
|
-
|
|
120
|
+
showModal = _useState4[0],
|
|
121
|
+
setShowModal = _useState4[1];
|
|
124
122
|
|
|
125
|
-
var _useState5 = (0, _react.useState)(
|
|
123
|
+
var _useState5 = (0, _react.useState)(false),
|
|
126
124
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
133
|
-
|
|
130
|
+
headerTop = _useState8[0],
|
|
131
|
+
setHeaderTop = _useState8[1];
|
|
134
132
|
|
|
135
|
-
var _useState9 = (0, _react.useState)(
|
|
133
|
+
var _useState9 = (0, _react.useState)({}),
|
|
136
134
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
143
|
-
|
|
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
|
|
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
|
-
|
|
151
|
-
origin =
|
|
152
|
-
setOrigin =
|
|
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 ?
|
|
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
|
|
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 =
|
|
368
|
+
_context2.next = 24;
|
|
378
369
|
break;
|
|
379
370
|
|
|
380
|
-
case
|
|
381
|
-
_context2.prev =
|
|
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
|
|
390
|
-
_context2.prev =
|
|
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(
|
|
386
|
+
return _context2.finish(24);
|
|
396
387
|
|
|
397
|
-
case
|
|
388
|
+
case 27:
|
|
398
389
|
case "end":
|
|
399
390
|
return _context2.stop();
|
|
400
391
|
}
|
|
401
392
|
}
|
|
402
|
-
}, _callee2, null, [[1,
|
|
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
|
-
}, [
|
|
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$
|
|
463
|
-
|
|
464
|
-
if (!((_state$product8 = state.product) !== null && _state$product8 !== void 0 && _state$product8.statusByRetailer)) return false;
|
|
453
|
+
var _state$product2;
|
|
465
454
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
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
|
-
|
|
484
|
-
|
|
485
|
-
|
|
465
|
+
if (isRetailerUser) {
|
|
466
|
+
return currentStatus === "AP";
|
|
467
|
+
} // No retailer
|
|
486
468
|
|
|
487
469
|
|
|
488
|
-
|
|
489
|
-
|
|
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
|
|
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] || "
|
|
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$
|
|
563
|
+
var _state$product3, _state$product3$servi;
|
|
586
564
|
|
|
587
|
-
if (((_state$
|
|
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$
|
|
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$
|
|
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 =
|
|
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,
|
|
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
|
-
|
|
857
|
-
|
|
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
|
|
884
|
-
_context3.next =
|
|
851
|
+
case 21:
|
|
852
|
+
_context3.next = 27;
|
|
885
853
|
break;
|
|
886
854
|
|
|
887
|
-
case
|
|
888
|
-
_context3.prev =
|
|
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
|
|
902
|
-
_context3.prev =
|
|
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(
|
|
875
|
+
return _context3.finish(27);
|
|
908
876
|
|
|
909
|
-
case
|
|
877
|
+
case 30:
|
|
910
878
|
case "end":
|
|
911
879
|
return _context3.stop();
|
|
912
880
|
}
|
|
913
881
|
}
|
|
914
|
-
}, _callee3, null, [[8,
|
|
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$
|
|
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$
|
|
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.
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
},
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
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
|
-
|
|
1330
|
-
type: "SET_MODAL",
|
|
1331
|
-
payload: {
|
|
1332
|
-
show: false,
|
|
1333
|
-
title: "",
|
|
1334
|
-
message: "",
|
|
1335
|
-
image: null
|
|
1336
|
-
}
|
|
1337
|
-
});
|
|
1318
|
+
setShowRejectModal(false);
|
|
1338
1319
|
}
|
|
1339
|
-
}),
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
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
|
-
|
|
1373
|
-
|
|
1337
|
+
console.error("Elemento no encontrado");
|
|
1338
|
+
return _context6.abrupt("return");
|
|
1374
1339
|
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
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
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1346
|
+
if (!isMessageEmpty) {
|
|
1347
|
+
_context6.next = 10;
|
|
1348
|
+
break;
|
|
1349
|
+
}
|
|
1385
1350
|
|
|
1386
|
-
|
|
1387
|
-
|
|
1351
|
+
container = document.querySelector(".container-customComponent");
|
|
1352
|
+
existingAlert = container.querySelector(".alert-error");
|
|
1388
1353
|
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
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
|
-
|
|
1362
|
+
return _context6.abrupt("return");
|
|
1398
1363
|
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
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
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1371
|
+
case 13:
|
|
1372
|
+
rejectAll ? handleOnEvaluateAll("R") : handleOnSendEvaluation("R");
|
|
1373
|
+
setShowRejectModal(false);
|
|
1409
1374
|
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
}
|
|
1375
|
+
case 15:
|
|
1376
|
+
case "end":
|
|
1377
|
+
return _context6.stop();
|
|
1414
1378
|
}
|
|
1415
|
-
}
|
|
1416
|
-
})
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
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
|
-
|
|
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.
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
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: "
|
|
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.
|
|
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
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
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:
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
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
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1560
|
+
color: "#007bff",
|
|
1561
|
+
cursor: "pointer",
|
|
1562
|
+
textDecoration: "underline"
|
|
1591
1563
|
},
|
|
1592
|
-
children:
|
|
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
|
-
})
|
|
1605
|
-
|
|
1606
|
-
|
|
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
|
|