contentoh-components-library 21.5.94 → 21.5.96
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/ai/utils/compare-strings.js +45 -0
- package/dist/components/atoms/GeneralButton/styles.js +1 -1
- package/dist/components/atoms/GeneralInput/index.js +249 -54
- package/dist/components/atoms/GeneralInput/styles.js +7 -3
- package/dist/components/atoms/InputFormatter/index.js +223 -68
- package/dist/components/atoms/InputFormatter/styles.js +20 -4
- package/dist/components/molecules/StatusAsignationInfo/index.js +11 -1
- package/dist/components/molecules/TabsMenu/index.js +13 -1
- package/dist/components/molecules/TagAndInput/index.js +364 -24
- package/dist/components/molecules/TagAndInput/styles.js +2 -2
- package/dist/components/organisms/ChangeStatusModal/index.js +531 -0
- package/dist/components/organisms/ChangeStatusModal/styles.js +85 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +6 -22
- package/dist/components/organisms/InputGroup/index.js +22 -18
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +150 -337
- package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +15 -15
- package/dist/components/pages/ProviderProductEdition/index.js +395 -361
- package/dist/components/pages/ProviderProductEdition/utils.js +1 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +125 -211
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +59 -260
- package/dist/components/pages/RetailerProductEdition/context/reducers/product.js +50 -38
- package/dist/components/pages/RetailerProductEdition/index.js +1741 -2239
- package/dist/components/pages/RetailerProductEdition/styles.js +4 -2
- package/dist/components/pages/RetailerProductEdition/utils.js +251 -2
- package/dist/contexts/AiProductEdition.js +244 -160
- package/dist/global-files/statusDictionary.js +103 -0
- package/package.json +4 -2
- package/src/ai/utils/compare-strings.js +45 -0
- 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 +5 -0
- package/src/assets/images/Icons/reload.png +0 -0
- package/src/components/atoms/GeneralButton/styles.js +4 -0
- package/src/components/atoms/GeneralInput/index.js +241 -60
- package/src/components/atoms/GeneralInput/styles.js +81 -0
- package/src/components/atoms/InputFormatter/index.js +200 -51
- package/src/components/atoms/InputFormatter/styles.js +284 -0
- package/src/components/atoms/RetailerSelector/RetailerSelector.stories.js +10 -0
- package/src/components/atoms/RetailerSelector/index.js +3 -0
- package/src/components/atoms/RetailerSelector/styles.js +0 -0
- package/src/components/molecules/StatusAsignationInfo/index.js +9 -1
- package/src/components/molecules/TabsMenu/index.js +12 -0
- package/src/components/molecules/TagAndInput/index.js +294 -21
- package/src/components/molecules/TagAndInput/styles.js +59 -17
- package/src/components/organisms/ChangeStatusModal/index.jsx +488 -0
- package/src/components/organisms/ChangeStatusModal/styles.js +333 -0
- package/src/components/organisms/FullProductNameHeader/index.js +4 -28
- package/src/components/organisms/FullTabsMenu/index.js +1 -1
- package/src/components/organisms/InputGroup/index.js +12 -4
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +174 -202
- package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +14 -14
- package/src/components/pages/ProviderProductEdition/index.js +497 -437
- package/src/components/pages/ProviderProductEdition/utils.js +2 -2
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +136 -243
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +575 -0
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +62 -0
- package/src/components/pages/RetailerProductEdition/context/reducers/active-state.js +344 -0
- package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +155 -0
- package/src/components/pages/RetailerProductEdition/context/reducers/product.js +114 -0
- package/src/components/pages/RetailerProductEdition/context/reducers/system.js +60 -0
- package/src/components/pages/RetailerProductEdition/index.js +1563 -1717
- package/src/components/pages/RetailerProductEdition/index_old.js +1979 -0
- package/src/components/pages/RetailerProductEdition/stories/Auditor.stories.js +101 -0
- package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +115 -0
- package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +174 -0
- package/src/components/pages/RetailerProductEdition/styles.js +67 -2
- package/src/components/pages/RetailerProductEdition/utils.js +240 -0
- package/src/contexts/AiProductEdition.jsx +347 -0
- package/src/global-files/statusDictionary.js +103 -0
|
@@ -77,10 +77,12 @@ var _genericModalWarning = _interopRequireDefault(require("../../../assets/image
|
|
|
77
77
|
|
|
78
78
|
var _styles = require("./styles");
|
|
79
79
|
|
|
80
|
+
var _AiProductEdition = require("../../../contexts/AiProductEdition");
|
|
81
|
+
|
|
80
82
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
81
83
|
|
|
82
84
|
var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
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$
|
|
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;
|
|
84
86
|
|
|
85
87
|
var tabsSections = _ref.tabsSections,
|
|
86
88
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -235,33 +237,22 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
235
237
|
(0, _react.useEffect)(function () {
|
|
236
238
|
var setProductData = function setProductData() {
|
|
237
239
|
try {
|
|
238
|
-
var product =
|
|
240
|
+
var product = productSelected ? productSelected : JSON.parse(sessionStorage.getItem("productSelected"));
|
|
239
241
|
var productNormalized = (0, _utils.normalizeProduct)(product);
|
|
240
|
-
console.log({
|
|
241
|
-
productNormalized: productNormalized
|
|
242
|
-
});
|
|
243
242
|
dispatch({
|
|
244
243
|
type: "SET_PRODUCT",
|
|
245
244
|
payload: productNormalized
|
|
246
245
|
});
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
payload: initialTab
|
|
258
|
-
});
|
|
259
|
-
} else {
|
|
260
|
-
dispatch({
|
|
261
|
-
type: "SET_ACTIVE_RETAILER",
|
|
262
|
-
payload: productNormalized.categoryRetailer[0]
|
|
263
|
-
});
|
|
264
|
-
}
|
|
246
|
+
dispatch({
|
|
247
|
+
type: "SET_ACTIVE_RETAILER",
|
|
248
|
+
payload: productNormalized.categoryRetailer[0]
|
|
249
|
+
});
|
|
250
|
+
var firstRetailerStatus = productNormalized.statusByRetailer[productNormalized.categoryRetailerInOrder[0].id_retailer];
|
|
251
|
+
var initialTab = firstRetailerStatus.description ? "Descripción" : firstRetailerStatus.datasheet ? "Ficha técnica" : firstRetailerStatus.images ? "Imágenes" : "Imágenes";
|
|
252
|
+
dispatch({
|
|
253
|
+
type: "SET_ACTIVE_TAB",
|
|
254
|
+
payload: initialTab
|
|
255
|
+
});
|
|
265
256
|
} catch (error) {
|
|
266
257
|
console.log("Error setting product data: ", error);
|
|
267
258
|
}
|
|
@@ -284,7 +275,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
284
275
|
|
|
285
276
|
var fetchData = /*#__PURE__*/function () {
|
|
286
277
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
287
|
-
var _JSON$parse$0$relatio, _JSON$parse, _JSON$parse$, _percentageRes$,
|
|
278
|
+
var _JSON$parse$0$relatio, _JSON$parse, _JSON$parse$, _percentageRes$, data, headers, _yield$Promise$all, _yield$Promise$all2, services, percentageRes, servicesDataRes, percentages, orderMap, orderedValues, updatedStatusByRetailer;
|
|
288
279
|
|
|
289
280
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
290
281
|
while (1) {
|
|
@@ -324,16 +315,31 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
324
315
|
percentageRes = _yield$Promise$all2[1];
|
|
325
316
|
servicesDataRes = _yield$Promise$all2[2];
|
|
326
317
|
percentages = (_JSON$parse$0$relatio = (_JSON$parse = JSON.parse(percentageRes === null || percentageRes === void 0 ? void 0 : (_percentageRes$ = percentageRes[0]) === null || _percentageRes$ === void 0 ? void 0 : _percentageRes$.body)) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$ = _JSON$parse[0]) === null || _JSON$parse$ === void 0 ? void 0 : _JSON$parse$.relations) !== null && _JSON$parse$0$relatio !== void 0 ? _JSON$parse$0$relatio : [];
|
|
327
|
-
orderMap =
|
|
318
|
+
orderMap = services[2].inputsByRetailer.flat().reduce(function (acc, item) {
|
|
328
319
|
acc[item.id_image] = item.order;
|
|
329
320
|
return acc;
|
|
330
321
|
}, {});
|
|
331
|
-
orderedValues = (0, _toConsumableArray2.default)(
|
|
322
|
+
orderedValues = (0, _toConsumableArray2.default)(services[2].values).sort(function (a, b) {
|
|
332
323
|
var _orderMap$a$image_id, _orderMap$b$image_id;
|
|
333
324
|
|
|
334
325
|
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;
|
|
335
326
|
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;
|
|
336
327
|
return orderA - orderB;
|
|
328
|
+
}); //Cuando carguemos la información de los servicios, las actualizamos en el estado del producto
|
|
329
|
+
|
|
330
|
+
updatedStatusByRetailer = servicesDataRes.reduce(function (acc, current, idx) {
|
|
331
|
+
var id_retailer = current.id_retailer,
|
|
332
|
+
service = current.service,
|
|
333
|
+
status = current.status;
|
|
334
|
+
if (!acc[id_retailer]) acc[id_retailer] = {};
|
|
335
|
+
acc[id_retailer][service] = status;
|
|
336
|
+
return acc;
|
|
337
|
+
}, {});
|
|
338
|
+
dispatch({
|
|
339
|
+
type: "SET_PRODUCT",
|
|
340
|
+
payload: (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
341
|
+
statusByRetailer: updatedStatusByRetailer
|
|
342
|
+
})
|
|
337
343
|
});
|
|
338
344
|
dispatch({
|
|
339
345
|
type: "SET_SERVICES",
|
|
@@ -360,11 +366,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
360
366
|
return rId === id_retailer;
|
|
361
367
|
})
|
|
362
368
|
});
|
|
363
|
-
_context2.next =
|
|
369
|
+
_context2.next = 26;
|
|
364
370
|
break;
|
|
365
371
|
|
|
366
|
-
case
|
|
367
|
-
_context2.prev =
|
|
372
|
+
case 22:
|
|
373
|
+
_context2.prev = 22;
|
|
368
374
|
_context2.t0 = _context2["catch"](1);
|
|
369
375
|
console.error("Error fetching data:", _context2.t0);
|
|
370
376
|
dispatch({
|
|
@@ -372,20 +378,20 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
372
378
|
payload: _context2.t0
|
|
373
379
|
});
|
|
374
380
|
|
|
375
|
-
case
|
|
376
|
-
_context2.prev =
|
|
381
|
+
case 26:
|
|
382
|
+
_context2.prev = 26;
|
|
377
383
|
dispatch({
|
|
378
384
|
type: "SET_LOADING",
|
|
379
385
|
payload: false
|
|
380
386
|
});
|
|
381
|
-
return _context2.finish(
|
|
387
|
+
return _context2.finish(26);
|
|
382
388
|
|
|
383
|
-
case
|
|
389
|
+
case 29:
|
|
384
390
|
case "end":
|
|
385
391
|
return _context2.stop();
|
|
386
392
|
}
|
|
387
393
|
}
|
|
388
|
-
}, _callee2, null, [[1,
|
|
394
|
+
}, _callee2, null, [[1, 22, 26, 29]]);
|
|
389
395
|
}));
|
|
390
396
|
|
|
391
397
|
return function fetchData() {
|
|
@@ -394,7 +400,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
394
400
|
}();
|
|
395
401
|
|
|
396
402
|
fetchData();
|
|
397
|
-
}, [state.product, state.active_retailer, token]); // Actualizador de campos del ui para que coincidan con el retailer activo
|
|
403
|
+
}, [(_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
|
|
398
404
|
|
|
399
405
|
(0, _react.useEffect)(function () {
|
|
400
406
|
if (!state.active_retailer) return;
|
|
@@ -445,11 +451,18 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
445
451
|
}, [state.services]); // Helper functions
|
|
446
452
|
|
|
447
453
|
var canShowValidationButtons = function canShowValidationButtons() {
|
|
448
|
-
var _state$
|
|
454
|
+
var _state$product8;
|
|
455
|
+
|
|
456
|
+
if (!((_state$product8 = state.product) !== null && _state$product8 !== void 0 && _state$product8.statusByRetailer)) return false;
|
|
457
|
+
var currentService = (0, _utils.getConceptByTab)(state.active_tab); // const currentStatus = state.product[`${currentService}_status`];
|
|
458
|
+
|
|
459
|
+
var currentRetailer = state.active_retailer.id_retailer; //Información del servicio de la cadena seleccionada
|
|
460
|
+
|
|
461
|
+
var _state$services_data$ = state.services_data.find(function (service) {
|
|
462
|
+
return service.service === currentService && service.id_retailer === currentRetailer;
|
|
463
|
+
}),
|
|
464
|
+
currentStatus = _state$services_data$.status;
|
|
449
465
|
|
|
450
|
-
if (!((_state$product2 = state.product) !== null && _state$product2 !== void 0 && _state$product2.statusByRetailer)) return false;
|
|
451
|
-
var currentService = (0, _utils.getConceptByTab)(state.active_tab);
|
|
452
|
-
var currentStatus = state.product["".concat(currentService, "_status")];
|
|
453
466
|
var originTab = origin[state.active_tab];
|
|
454
467
|
var isRetailerUser = (user === null || user === void 0 ? void 0 : user.is_retailer) === 1;
|
|
455
468
|
var validStatuses = ["AA", "AP", "R", "CA", "RCA"];
|
|
@@ -463,7 +476,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
463
476
|
|
|
464
477
|
|
|
465
478
|
var hasNoOrder = !state.product.id_order && !state.product.orderId;
|
|
466
|
-
|
|
479
|
+
var condition = originTab === "RequestWithoutContentoh" && (["R", "CA"].includes(currentStatus) || currentStatus === "RCA" && hasNoOrder) || ["RequestWithContentoh", "Contentoh"].includes(originTab) && currentStatus === "AA";
|
|
480
|
+
return condition;
|
|
467
481
|
};
|
|
468
482
|
|
|
469
483
|
var canShowSaveButton = function canShowSaveButton(version_status) {
|
|
@@ -555,9 +569,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
555
569
|
};
|
|
556
570
|
|
|
557
571
|
var handleOnClickSaveImages = function handleOnClickSaveImages() {
|
|
558
|
-
var _state$
|
|
572
|
+
var _state$product9, _state$product9$servi;
|
|
559
573
|
|
|
560
|
-
if (((_state$
|
|
574
|
+
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) {
|
|
561
575
|
updateImages();
|
|
562
576
|
}
|
|
563
577
|
};
|
|
@@ -778,9 +792,10 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
778
792
|
|
|
779
793
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
780
794
|
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(result) {
|
|
781
|
-
var _state$product$id_ord, _state$
|
|
795
|
+
var _state$product$id_ord, _state$product10, _state$active_retaile2;
|
|
796
|
+
|
|
797
|
+
var concept, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, _newStatuses$newStatu, _state$services_data, res, newStatuses, serviceStatus, updatedProduct, updatedServicesData;
|
|
782
798
|
|
|
783
|
-
var concept, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, serviceStatus, updatedProduct;
|
|
784
799
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
785
800
|
while (1) {
|
|
786
801
|
switch (_context3.prev = _context3.next) {
|
|
@@ -793,7 +808,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
793
808
|
articleId = state.product.id_article;
|
|
794
809
|
orderId = (_state$product$id_ord = state.product.id_order) !== null && _state$product$id_ord !== void 0 ? _state$product$id_ord : state.product.orderId;
|
|
795
810
|
sectionStatusKey = "".concat(concept, "_status");
|
|
796
|
-
evalStatus = state.product[sectionStatusKey] || ((_state$
|
|
811
|
+
evalStatus = state.product[sectionStatusKey] || ((_state$product10 = state.product) === null || _state$product10 === void 0 ? void 0 : _state$product10.version_status);
|
|
797
812
|
data = {
|
|
798
813
|
articleId: articleId,
|
|
799
814
|
orderId: orderId,
|
|
@@ -804,7 +819,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
804
819
|
_context3.prev = 8;
|
|
805
820
|
|
|
806
821
|
if (!result) {
|
|
807
|
-
_context3.next =
|
|
822
|
+
_context3.next = 23;
|
|
808
823
|
break;
|
|
809
824
|
}
|
|
810
825
|
|
|
@@ -820,14 +835,29 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
820
835
|
case 14:
|
|
821
836
|
res = _context3.sent;
|
|
822
837
|
newStatuses = JSON.parse(res.data.body);
|
|
823
|
-
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
838
|
+
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
839
|
+
console.log({
|
|
840
|
+
product: state.product,
|
|
841
|
+
newStatuses: newStatuses,
|
|
842
|
+
serviceStatus: serviceStatus,
|
|
843
|
+
servicesData: state.services_data
|
|
844
|
+
}); // Actualizar el producto con los nuevos estados
|
|
824
845
|
|
|
825
846
|
updatedProduct = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
826
|
-
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))))
|
|
847
|
+
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))))
|
|
827
848
|
});
|
|
828
|
-
|
|
829
|
-
|
|
849
|
+
updatedServicesData = (_state$services_data = state.services_data) === null || _state$services_data === void 0 ? void 0 : _state$services_data.map(function (service) {
|
|
850
|
+
var _newStatuses$newStatu2;
|
|
851
|
+
|
|
852
|
+
return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, service), {}, {
|
|
853
|
+
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
|
|
854
|
+
});
|
|
830
855
|
});
|
|
856
|
+
dispatch({
|
|
857
|
+
type: "SET_SERVICES_DATA",
|
|
858
|
+
payload: updatedServicesData
|
|
859
|
+
}); // console.log({ updatedProduct });
|
|
860
|
+
|
|
831
861
|
dispatch({
|
|
832
862
|
type: "SET_PRODUCT",
|
|
833
863
|
payload: updatedProduct
|
|
@@ -843,12 +873,12 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
843
873
|
}
|
|
844
874
|
});
|
|
845
875
|
|
|
846
|
-
case
|
|
847
|
-
_context3.next =
|
|
876
|
+
case 23:
|
|
877
|
+
_context3.next = 29;
|
|
848
878
|
break;
|
|
849
879
|
|
|
850
|
-
case
|
|
851
|
-
_context3.prev =
|
|
880
|
+
case 25:
|
|
881
|
+
_context3.prev = 25;
|
|
852
882
|
_context3.t0 = _context3["catch"](8);
|
|
853
883
|
console.error("Error sending evaluation:", _context3.t0);
|
|
854
884
|
dispatch({
|
|
@@ -861,20 +891,20 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
861
891
|
}
|
|
862
892
|
});
|
|
863
893
|
|
|
864
|
-
case
|
|
865
|
-
_context3.prev =
|
|
894
|
+
case 29:
|
|
895
|
+
_context3.prev = 29;
|
|
866
896
|
dispatch({
|
|
867
897
|
type: "SET_SAVING",
|
|
868
898
|
payload: false
|
|
869
899
|
});
|
|
870
|
-
return _context3.finish(
|
|
900
|
+
return _context3.finish(29);
|
|
871
901
|
|
|
872
|
-
case
|
|
902
|
+
case 32:
|
|
873
903
|
case "end":
|
|
874
904
|
return _context3.stop();
|
|
875
905
|
}
|
|
876
906
|
}
|
|
877
|
-
}, _callee3, null, [[8,
|
|
907
|
+
}, _callee3, null, [[8, 25, 29, 32]]);
|
|
878
908
|
}));
|
|
879
909
|
|
|
880
910
|
return function sendEvaluation(_x2) {
|
|
@@ -1096,7 +1126,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1096
1126
|
|
|
1097
1127
|
var handleOnEvaluateAll = /*#__PURE__*/function () {
|
|
1098
1128
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(result) {
|
|
1099
|
-
var _state$product$id_ord2, _state$
|
|
1129
|
+
var _state$product$id_ord2, _state$services_data2, evaluationArray, conceptArray, dataGeneral, userType, status, updatedStatusByRetailer, updatedProduct;
|
|
1100
1130
|
|
|
1101
1131
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
1102
1132
|
while (1) {
|
|
@@ -1116,7 +1146,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1116
1146
|
isAproved: result === "A"
|
|
1117
1147
|
}; // Crear todas las evaluaciones para cada servicio y retailer
|
|
1118
1148
|
|
|
1119
|
-
(_state$
|
|
1149
|
+
(_state$services_data2 = state.services_data) === null || _state$services_data2 === void 0 ? void 0 : _state$services_data2.forEach(function (ret) {
|
|
1120
1150
|
var service = ret.service,
|
|
1121
1151
|
id_retailer = ret.id_retailer;
|
|
1122
1152
|
var data = {};
|
|
@@ -1246,330 +1276,334 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1246
1276
|
};
|
|
1247
1277
|
|
|
1248
1278
|
if (state.loading || !state.services || !state.product) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {});
|
|
1249
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
},
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
payload: {
|
|
1292
|
-
show: false,
|
|
1293
|
-
title: "",
|
|
1294
|
-
message: "",
|
|
1295
|
-
image: null
|
|
1296
|
-
}
|
|
1297
|
-
});
|
|
1298
|
-
}
|
|
1299
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
1300
|
-
title: rejectAll ? "Agregar mensaje para rechazar todo" : "Agregar mensaje de rechazo",
|
|
1301
|
-
show: showRejectModal,
|
|
1302
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1303
|
-
inputType: "textarea",
|
|
1304
|
-
inputId: "modal-message-box",
|
|
1305
|
-
index: 0,
|
|
1306
|
-
color: "white"
|
|
1307
|
-
}),
|
|
1308
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
1309
|
-
type: "white",
|
|
1310
|
-
label: "Cancelar",
|
|
1311
|
-
size: 12,
|
|
1279
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AiProductEdition.AiProductEditionProvider, {
|
|
1280
|
+
isCreatorsEdition: false,
|
|
1281
|
+
state: state,
|
|
1282
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
1283
|
+
headerTop: headerTop,
|
|
1284
|
+
children: [showVersionSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelector.VersionSelector, {
|
|
1285
|
+
modalId: "version-selector",
|
|
1286
|
+
articleId: state.product.id_article,
|
|
1287
|
+
setVersion: handleOnChangeProductVersion,
|
|
1288
|
+
companyName: company.company_name,
|
|
1289
|
+
currentVersion: state.product.version,
|
|
1290
|
+
setShowVersionSelector: setShowVersionSelector,
|
|
1291
|
+
jwt: token
|
|
1292
|
+
}), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
|
|
1293
|
+
images: state.images_values,
|
|
1294
|
+
setShowModal: setShowModal,
|
|
1295
|
+
approveRejectButtons: canShowValidationButtons(),
|
|
1296
|
+
sendToFacilitator: handleOnSendEvaluation
|
|
1297
|
+
}), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
|
|
1298
|
+
componentsArray: [state.modal.image && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1299
|
+
src: state.modal.image,
|
|
1300
|
+
alt: "modal icon"
|
|
1301
|
+
}, "1"), state.modal.title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1302
|
+
headerType: "retailer-name-header",
|
|
1303
|
+
text: state.modal.title,
|
|
1304
|
+
color: "white"
|
|
1305
|
+
}, "2"), state.modal.message && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1306
|
+
headerType: "retailer-name-header",
|
|
1307
|
+
text: state.modal.message,
|
|
1308
|
+
color: "white"
|
|
1309
|
+
}, "3"), state.modal.buttons && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1310
|
+
style: {
|
|
1311
|
+
marginTop: "16px"
|
|
1312
|
+
},
|
|
1313
|
+
children: state.modal.buttons.map(function (button, index) {
|
|
1314
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1315
|
+
buttonType: button.buttonType,
|
|
1316
|
+
label: button.text,
|
|
1317
|
+
onClick: button.action
|
|
1318
|
+
}, index);
|
|
1319
|
+
})
|
|
1320
|
+
}, "4")].filter(Boolean),
|
|
1312
1321
|
onClick: function onClick() {
|
|
1313
|
-
|
|
1322
|
+
return dispatch({
|
|
1323
|
+
type: "SET_MODAL",
|
|
1324
|
+
payload: {
|
|
1325
|
+
show: false,
|
|
1326
|
+
title: "",
|
|
1327
|
+
message: "",
|
|
1328
|
+
image: null
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1314
1331
|
}
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1332
|
+
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
1333
|
+
title: rejectAll ? "Agregar mensaje para rechazar todo" : "Agregar mensaje de rechazo",
|
|
1334
|
+
show: showRejectModal,
|
|
1335
|
+
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1336
|
+
inputType: "textarea",
|
|
1337
|
+
inputId: "modal-message-box",
|
|
1338
|
+
index: 0,
|
|
1339
|
+
color: "white"
|
|
1340
|
+
}),
|
|
1341
|
+
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
1342
|
+
type: "white",
|
|
1343
|
+
label: "Cancelar",
|
|
1344
|
+
size: 12,
|
|
1345
|
+
onClick: function onClick() {
|
|
1346
|
+
setShowRejectModal(false);
|
|
1347
|
+
}
|
|
1348
|
+
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
1349
|
+
type: "pink",
|
|
1350
|
+
label: "Aceptar",
|
|
1351
|
+
size: 12,
|
|
1352
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1353
|
+
var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
|
|
1354
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1355
|
+
while (1) {
|
|
1356
|
+
switch (_context6.prev = _context6.next) {
|
|
1357
|
+
case 0:
|
|
1358
|
+
elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
|
|
1331
1359
|
|
|
1332
|
-
|
|
1333
|
-
|
|
1360
|
+
if (!(!elements || elements.length === 0)) {
|
|
1361
|
+
_context6.next = 4;
|
|
1362
|
+
break;
|
|
1363
|
+
}
|
|
1334
1364
|
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
var body = el.innerHTML;
|
|
1338
|
-
return !body || body.replace(/<.*?\/?>/gm, "").trim() === "";
|
|
1339
|
-
});
|
|
1365
|
+
console.error("Elemento no encontrado");
|
|
1366
|
+
return _context6.abrupt("return");
|
|
1340
1367
|
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1368
|
+
case 4:
|
|
1369
|
+
isMessageEmpty = Array.from(elements).every(function (el) {
|
|
1370
|
+
var body = el.innerHTML;
|
|
1371
|
+
return !body || body.replace(/<.*?\/?>/gm, "").trim() === "";
|
|
1372
|
+
});
|
|
1345
1373
|
|
|
1346
|
-
|
|
1347
|
-
|
|
1374
|
+
if (!isMessageEmpty) {
|
|
1375
|
+
_context6.next = 10;
|
|
1376
|
+
break;
|
|
1377
|
+
}
|
|
1348
1378
|
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
alert.className = "alert-error";
|
|
1352
|
-
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 ";
|
|
1353
|
-
alert.innerHTML = "<span>El mensaje no puede estar vac\xEDo.</span>";
|
|
1354
|
-
container.appendChild(alert);
|
|
1355
|
-
}
|
|
1379
|
+
container = document.querySelector(".container-customComponent");
|
|
1380
|
+
existingAlert = container.querySelector(".alert-error");
|
|
1356
1381
|
|
|
1357
|
-
|
|
1382
|
+
if (!existingAlert) {
|
|
1383
|
+
alert = document.createElement("div");
|
|
1384
|
+
alert.className = "alert-error";
|
|
1385
|
+
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 ";
|
|
1386
|
+
alert.innerHTML = "<span>El mensaje no puede estar vac\xEDo.</span>";
|
|
1387
|
+
container.appendChild(alert);
|
|
1388
|
+
}
|
|
1358
1389
|
|
|
1359
|
-
|
|
1360
|
-
fullMessage = Array.from(elements).map(function (element) {
|
|
1361
|
-
return element.innerHTML;
|
|
1362
|
-
}).join("").replace(/<br\s*\/?>/gi, "\n");
|
|
1363
|
-
_context6.next = 13;
|
|
1364
|
-
return createComment(fullMessage);
|
|
1390
|
+
return _context6.abrupt("return");
|
|
1365
1391
|
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1392
|
+
case 10:
|
|
1393
|
+
fullMessage = Array.from(elements).map(function (element) {
|
|
1394
|
+
return element.innerHTML;
|
|
1395
|
+
}).join("").replace(/<br\s*\/?>/gi, "\n");
|
|
1396
|
+
_context6.next = 13;
|
|
1397
|
+
return createComment(fullMessage, token);
|
|
1369
1398
|
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
}, _callee6);
|
|
1376
|
-
}))
|
|
1377
|
-
}, "btn-Aceptar")]
|
|
1378
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
1379
|
-
setHeaderTop: setHeaderTop,
|
|
1380
|
-
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
1381
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
1382
|
-
productSelected: state.product,
|
|
1383
|
-
token: token,
|
|
1384
|
-
activeRetailer: {
|
|
1385
|
-
id: (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer,
|
|
1386
|
-
name: (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.retailer
|
|
1387
|
-
}
|
|
1388
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1389
|
-
className: "data-container",
|
|
1390
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1391
|
-
className: "image-data-panel",
|
|
1392
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagePreviewer.ImagePreviewer, {
|
|
1393
|
-
activeImage: (_state$images_values$2 = state.images_values.values[state.current_image]) !== null && _state$images_values$2 !== void 0 ? _state$images_values$2 : {},
|
|
1394
|
-
imagesArray: state.images_values || [],
|
|
1395
|
-
setActiveImage: handleOnChangeCurrentImage,
|
|
1396
|
-
setShowModal: handleOnShowModalGalery
|
|
1397
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageDataTable.ImageDataTable, {
|
|
1398
|
-
lists: state.images_values || [],
|
|
1399
|
-
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] : {},
|
|
1400
|
-
assignationsImages: assig,
|
|
1401
|
-
retailerSelected: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
|
|
1402
|
-
imagesStatus: ((_state$product5 = state.product) === null || _state$product5 === void 0 ? void 0 : _state$product5.images_status) || "-",
|
|
1403
|
-
isRetailer: isRetailer,
|
|
1404
|
-
setShowVersionSelector: setShowVersionSelector,
|
|
1405
|
-
version: state.product.version,
|
|
1406
|
-
setImages: handleOnChangeCurrentImage,
|
|
1407
|
-
onClickSave: handleOnClickSaveImages,
|
|
1408
|
-
setAssignation: handleOnChangeAssignations // No se usa?
|
|
1399
|
+
case 13:
|
|
1400
|
+
rejectAll ? handleOnEvaluateAll("R") : handleOnSendEvaluation("R");
|
|
1401
|
+
setShowRejectModal(false);
|
|
1409
1402
|
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1403
|
+
case 15:
|
|
1404
|
+
case "end":
|
|
1405
|
+
return _context6.stop();
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
}, _callee6);
|
|
1409
|
+
}))
|
|
1410
|
+
}, "btn-Aceptar")]
|
|
1411
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
1412
|
+
setHeaderTop: setHeaderTop,
|
|
1413
|
+
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
1414
|
+
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
1415
|
+
productSelected: state.product,
|
|
1416
|
+
token: token,
|
|
1417
|
+
activeRetailer: {
|
|
1418
|
+
id: (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer,
|
|
1419
|
+
name: (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.retailer
|
|
1420
|
+
}
|
|
1421
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1422
|
+
className: "data-container",
|
|
1423
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1424
|
+
className: "image-data-panel",
|
|
1425
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagePreviewer.ImagePreviewer, {
|
|
1426
|
+
activeImage: (_state$images_values$2 = state.images_values.values[state.current_image]) !== null && _state$images_values$2 !== void 0 ? _state$images_values$2 : {},
|
|
1427
|
+
imagesArray: state.images_values || [],
|
|
1428
|
+
setActiveImage: handleOnChangeCurrentImage,
|
|
1429
|
+
setShowModal: handleOnShowModalGalery
|
|
1430
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageDataTable.ImageDataTable, {
|
|
1431
|
+
lists: state.images_values || [],
|
|
1432
|
+
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] : {},
|
|
1433
|
+
assignationsImages: assig,
|
|
1434
|
+
retailerSelected: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
|
|
1435
|
+
imagesStatus: ((_state$product11 = state.product) === null || _state$product11 === void 0 ? void 0 : _state$product11.images_status) || "-",
|
|
1438
1436
|
isRetailer: isRetailer,
|
|
1439
|
-
|
|
1437
|
+
setShowVersionSelector: setShowVersionSelector,
|
|
1440
1438
|
version: state.product.version,
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
,
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
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
|
-
|
|
1439
|
+
setImages: handleOnChangeCurrentImage,
|
|
1440
|
+
onClickSave: handleOnClickSaveImages,
|
|
1441
|
+
setAssignation: handleOnChangeAssignations // No se usa?
|
|
1442
|
+
|
|
1443
|
+
})]
|
|
1444
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1445
|
+
className: "product-information",
|
|
1446
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1447
|
+
className: "product-information",
|
|
1448
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FullProductNameHeader.FullProductNameHeader, {
|
|
1449
|
+
headerData: state.product,
|
|
1450
|
+
percent: state.active_percentage.percentagesGeneral.required,
|
|
1451
|
+
activeRetailer: {
|
|
1452
|
+
id: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
|
|
1453
|
+
name: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.retailer,
|
|
1454
|
+
image: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.image
|
|
1455
|
+
},
|
|
1456
|
+
showValidationButtons: canShowValidationButtons(),
|
|
1457
|
+
showApproveRejectAll: canShowValidationButtons(),
|
|
1458
|
+
servicesData: state.services_data ? state.services_data : null,
|
|
1459
|
+
approveAll: handleOnApproveAll,
|
|
1460
|
+
rejectAll: handleOnRejectAll,
|
|
1461
|
+
approve: function approve() {
|
|
1462
|
+
return handleOnSendEvaluation("A");
|
|
1463
|
+
},
|
|
1464
|
+
reject: handleOnReject,
|
|
1465
|
+
setActiveRetailer: handleOnChangeActiveRetailer
|
|
1466
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1467
|
+
tabsSections: tabsSections,
|
|
1468
|
+
status: getStatusByCurrentServiceAndRetailer(),
|
|
1469
|
+
activeTab: state.active_tab,
|
|
1470
|
+
user: user,
|
|
1471
|
+
isRetailer: isRetailer,
|
|
1472
|
+
assig: assig,
|
|
1473
|
+
version: state.product.version,
|
|
1474
|
+
updatedDescriptions: state.updated_descriptions_inputs,
|
|
1475
|
+
updatedDatasheets: state.updated_datasheets_inputs,
|
|
1476
|
+
updatedImages: state.updated_images_values,
|
|
1477
|
+
images: state.services.images // actions
|
|
1478
|
+
,
|
|
1479
|
+
downloadImages: handleOnDownloadImages,
|
|
1480
|
+
askToDeleteImages: handleOnAskToDeleteImages,
|
|
1481
|
+
showSaveButton: canShowSaveButton(state.product.version_status),
|
|
1482
|
+
onClickSave: handleOnClickSave // setters
|
|
1483
|
+
,
|
|
1484
|
+
setActiveTab: handleOnChangeActiveTab,
|
|
1485
|
+
setImageLayout: handleOnSetImageLayout,
|
|
1486
|
+
setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
|
|
1487
|
+
setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
|
|
1488
|
+
setAssignation: handleOnSetAssignation // No se usa?
|
|
1489
|
+
,
|
|
1490
|
+
setImages: handleOnSetImages // No se usa?
|
|
1491
|
+
// setSelectedImages={handleOnSetSelectedImages} // Se pasa hasta TabsMenu, pero no se usa
|
|
1492
|
+
,
|
|
1493
|
+
setShowVersionSelector: setShowVersionSelector
|
|
1494
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1495
|
+
className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
|
|
1496
|
+
children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
1497
|
+
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, {
|
|
1498
|
+
activeSection: state.active_tab,
|
|
1499
|
+
inputGroup: state.descriptions_inputs[0],
|
|
1500
|
+
updatedDescriptions: state.updated_descriptions_inputs,
|
|
1501
|
+
articleId: (_state$product13 = state.product) === null || _state$product13 === void 0 ? void 0 : _state$product13.id_article,
|
|
1502
|
+
version: state.product.version,
|
|
1503
|
+
isShowbox: false,
|
|
1504
|
+
dinamicHeight: true,
|
|
1505
|
+
setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
|
|
1506
|
+
updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
|
|
1507
|
+
|
|
1508
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1509
|
+
text: "No cuentas con este servicio",
|
|
1510
|
+
headerType: "input-name-header"
|
|
1511
|
+
})), 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, {
|
|
1512
|
+
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) {
|
|
1513
|
+
var _state$datasheets_inp3;
|
|
1514
|
+
|
|
1515
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
1516
|
+
index: index,
|
|
1517
|
+
articleId: state.product.id_article,
|
|
1518
|
+
version: state.version,
|
|
1519
|
+
activeSection: state.active_tab,
|
|
1520
|
+
inputGroup: dataGroup,
|
|
1521
|
+
dataInputs: (_state$datasheets_inp3 = state.datasheets_inputs[1]) !== null && _state$datasheets_inp3 !== void 0 ? _state$datasheets_inp3 : [],
|
|
1522
|
+
activeRetailer: state.services.datasheets[state.active_retailer.id_retailer],
|
|
1523
|
+
groupData: state.services.datasheets[state.active_retailer.id_retailer].data,
|
|
1524
|
+
updatedDatasheets: state.updated_datasheets_inputs,
|
|
1525
|
+
setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
|
|
1526
|
+
isShowbox: true,
|
|
1527
|
+
setUpdatedBoxData: function setUpdatedBoxData(e) {
|
|
1528
|
+
setBoxData(e);
|
|
1529
|
+
},
|
|
1530
|
+
updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
|
|
1531
|
+
|
|
1532
|
+
}, index + "-" + state.active_retailer.retailer);
|
|
1533
|
+
})
|
|
1534
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1535
|
+
text: "No cuentas con este servicio",
|
|
1536
|
+
headerType: "input-name-header"
|
|
1537
|
+
})), 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, {
|
|
1538
|
+
children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
|
|
1539
|
+
checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
|
|
1540
|
+
,
|
|
1541
|
+
setCheckAll: handleOnSetCheckAll // Toggler de true o false para el checkbox "Seleccionar todo"
|
|
1542
|
+
,
|
|
1543
|
+
setSelectedImages: handleOnSetSelectedImages
|
|
1544
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("section", {
|
|
1545
|
+
className: "container",
|
|
1528
1546
|
style: {
|
|
1529
|
-
position: "
|
|
1530
|
-
top: "50%",
|
|
1531
|
-
left: "50%",
|
|
1532
|
-
transform: "translate(-50%, -50%)",
|
|
1533
|
-
textAlign: "center",
|
|
1534
|
-
padding: "40px",
|
|
1535
|
-
width: "80%",
|
|
1536
|
-
maxWidth: "500px",
|
|
1537
|
-
fontFamily: "Arial, sans-serif"
|
|
1547
|
+
position: "relative"
|
|
1538
1548
|
},
|
|
1539
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1549
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread4.default)((0, _objectSpread4.default)({}, getRootProps({
|
|
1550
|
+
className: "dropzone ".concat(isDragActive ? "drag-active" : "")
|
|
1551
|
+
})), {}, {
|
|
1552
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread4.default)({}, getInputProps())), isDragActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1553
|
+
className: "drag-overlay",
|
|
1554
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
1555
|
+
children: "Suelta las im\xE1genes aqu\xED"
|
|
1556
|
+
})
|
|
1557
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("aside", {
|
|
1558
|
+
children: thumbs()
|
|
1559
|
+
})]
|
|
1560
|
+
})), ((_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", {
|
|
1547
1561
|
style: {
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1562
|
+
position: "absolute",
|
|
1563
|
+
top: "50%",
|
|
1564
|
+
left: "50%",
|
|
1565
|
+
transform: "translate(-50%, -50%)",
|
|
1566
|
+
textAlign: "center",
|
|
1567
|
+
padding: "40px",
|
|
1568
|
+
width: "80%",
|
|
1569
|
+
maxWidth: "500px",
|
|
1570
|
+
fontFamily: "Arial, sans-serif"
|
|
1551
1571
|
},
|
|
1552
|
-
children: [
|
|
1553
|
-
|
|
1572
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
1573
|
+
style: {
|
|
1574
|
+
fontSize: "18px",
|
|
1575
|
+
color: "#666",
|
|
1576
|
+
marginBottom: "16px"
|
|
1577
|
+
},
|
|
1578
|
+
children: "Este producto no tiene im\xE1genes"
|
|
1579
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
1554
1580
|
style: {
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1581
|
+
fontSize: "14px",
|
|
1582
|
+
color: "#999",
|
|
1583
|
+
marginBottom: "20px"
|
|
1558
1584
|
},
|
|
1559
|
-
children: "
|
|
1585
|
+
children: ["Arrastra las im\xE1genes aqu\xED o", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1586
|
+
onClick: open,
|
|
1587
|
+
style: {
|
|
1588
|
+
color: "#007bff",
|
|
1589
|
+
cursor: "pointer",
|
|
1590
|
+
textDecoration: "underline"
|
|
1591
|
+
},
|
|
1592
|
+
children: "haz clic para abrir el explorador de archivos"
|
|
1593
|
+
})]
|
|
1560
1594
|
})]
|
|
1561
1595
|
})]
|
|
1562
1596
|
})]
|
|
1563
|
-
})
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
})
|
|
1568
|
-
})
|
|
1569
|
-
})
|
|
1570
|
-
})
|
|
1597
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1598
|
+
text: "No cuentas con este servicio",
|
|
1599
|
+
headerType: "input-name-header"
|
|
1600
|
+
}))]
|
|
1601
|
+
})
|
|
1602
|
+
})]
|
|
1603
|
+
})
|
|
1604
|
+
})]
|
|
1571
1605
|
})]
|
|
1572
|
-
})
|
|
1606
|
+
})
|
|
1573
1607
|
});
|
|
1574
1608
|
};
|
|
1575
1609
|
|