contentoh-components-library 21.5.92 → 21.5.94
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 -245
- 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 +12 -13
- package/dist/components/molecules/TagAndInput/index.js +24 -361
- 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 +379 -375
- package/dist/components/pages/ProviderProductEdition/utils.js +0 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +196 -179
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +260 -59
- package/dist/components/pages/RetailerProductEdition/context/reducers/product.js +38 -50
- package/dist/components/pages/RetailerProductEdition/index.js +2234 -1716
- package/dist/components/pages/RetailerProductEdition/styles.js +2 -4
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -251
- package/dist/contexts/AiProductEdition.js +158 -230
- package/package.json +2 -4
- package/src/components/atoms/GeneralButton/styles.js +0 -4
- package/src/components/atoms/GeneralInput/index.js +60 -237
- 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 +11 -12
- package/src/components/molecules/TagAndInput/index.js +21 -286
- 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 +470 -460
- package/src/components/pages/ProviderProductEdition/utils.js +2 -2
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +224 -201
- package/src/components/pages/RetailerProductEdition/index.js +1718 -1547
- package/src/components/pages/RetailerProductEdition/styles.js +2 -67
- package/src/components/pages/RetailerProductEdition/utils.js +0 -240
- package/dist/ai/utils/compare-strings.js +0 -45
- package/dist/components/organisms/ChangeStatusModal/index.js +0 -531
- package/dist/components/organisms/ChangeStatusModal/styles.js +0 -85
- package/dist/global-files/statusDictionary.js +0 -103
- 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 -339
- 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, _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$
|
|
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,
|
|
@@ -239,14 +237,31 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
239
237
|
try {
|
|
240
238
|
var product = JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected;
|
|
241
239
|
var productNormalized = (0, _utils.normalizeProduct)(product);
|
|
240
|
+
console.log({
|
|
241
|
+
productNormalized: productNormalized
|
|
242
|
+
});
|
|
242
243
|
dispatch({
|
|
243
244
|
type: "SET_PRODUCT",
|
|
244
245
|
payload: productNormalized
|
|
245
246
|
});
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
247
|
+
|
|
248
|
+
if (productNormalized.categoryRetailerInOrder.length > 0 && productNormalized.statusByRetailer) {
|
|
249
|
+
dispatch({
|
|
250
|
+
type: "SET_ACTIVE_RETAILER",
|
|
251
|
+
payload: productNormalized.categoryRetailerInOrder[0]
|
|
252
|
+
});
|
|
253
|
+
var firstRetailerStatus = productNormalized.statusByRetailer[productNormalized.categoryRetailerInOrder[0].id_retailer];
|
|
254
|
+
var initialTab = firstRetailerStatus.description ? "Descripción" : firstRetailerStatus.datasheet ? "Ficha técnica" : firstRetailerStatus.images ? "Imágenes" : "Imágenes";
|
|
255
|
+
dispatch({
|
|
256
|
+
type: "SET_ACTIVE_TAB",
|
|
257
|
+
payload: initialTab
|
|
258
|
+
});
|
|
259
|
+
} else {
|
|
260
|
+
dispatch({
|
|
261
|
+
type: "SET_ACTIVE_RETAILER",
|
|
262
|
+
payload: productNormalized.categoryRetailer[0]
|
|
263
|
+
});
|
|
264
|
+
}
|
|
250
265
|
} catch (error) {
|
|
251
266
|
console.log("Error setting product data: ", error);
|
|
252
267
|
}
|
|
@@ -269,7 +284,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
269
284
|
|
|
270
285
|
var fetchData = /*#__PURE__*/function () {
|
|
271
286
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
272
|
-
var _JSON$parse$0$relatio, _JSON$parse, _JSON$parse$, _percentageRes$, data, headers, _yield$Promise$all, _yield$Promise$all2, services, percentageRes, servicesDataRes, percentages, orderMap, orderedValues;
|
|
287
|
+
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;
|
|
273
288
|
|
|
274
289
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
275
290
|
while (1) {
|
|
@@ -309,11 +324,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
309
324
|
percentageRes = _yield$Promise$all2[1];
|
|
310
325
|
servicesDataRes = _yield$Promise$all2[2];
|
|
311
326
|
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 : [];
|
|
312
|
-
orderMap = services[2].inputsByRetailer.flat().reduce(function (acc, item) {
|
|
327
|
+
orderMap = (_services$2$inputsByR = services[2].inputsByRetailer) !== null && _services$2$inputsByR !== void 0 ? _services$2$inputsByR : [].flat().reduce(function (acc, item) {
|
|
313
328
|
acc[item.id_image] = item.order;
|
|
314
329
|
return acc;
|
|
315
330
|
}, {});
|
|
316
|
-
orderedValues = (0, _toConsumableArray2.default)(services[2].values).sort(function (a, b) {
|
|
331
|
+
orderedValues = (0, _toConsumableArray2.default)((_services$2$values = services[2].values) !== null && _services$2$values !== void 0 ? _services$2$values : []).sort(function (a, b) {
|
|
317
332
|
var _orderMap$a$image_id, _orderMap$b$image_id;
|
|
318
333
|
|
|
319
334
|
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;
|
|
@@ -387,34 +402,43 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
387
402
|
|
|
388
403
|
var updateInputsActiveRetailer = function updateInputsActiveRetailer() {
|
|
389
404
|
if (!state.services) return;
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
405
|
+
|
|
406
|
+
if (state.services.datasheets) {
|
|
407
|
+
var retailerDatasheets = state.services.datasheets[state.active_retailer.id_retailer];
|
|
408
|
+
var datasheetsActiveRetailer = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, retailerDatasheets), {}, {
|
|
409
|
+
data: Object.values(retailerDatasheets.data)
|
|
410
|
+
});
|
|
411
|
+
dispatch({
|
|
412
|
+
type: "SET_DATASHEETS_INPUTS",
|
|
413
|
+
payload: [datasheetsActiveRetailer, state.services.datasheets.inputs]
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
if (state.services.descriptions) {
|
|
418
|
+
var descriptionsActiveRetailer = state.services.descriptions.filter(function (item) {
|
|
419
|
+
return item.id === state.active_retailer.id_retailer;
|
|
420
|
+
});
|
|
421
|
+
dispatch({
|
|
422
|
+
type: "SET_DESCRIPTIONS_INPUTS",
|
|
423
|
+
payload: descriptionsActiveRetailer
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
if (state.services.images) {
|
|
428
|
+
var filteredValues = state.services.images.values.filter(function (value) {
|
|
429
|
+
return state.services.images.inputsByRetailer.some(function (retailerInput) {
|
|
430
|
+
return retailerInput.some(function (input) {
|
|
431
|
+
return input.id_retailer === state.active_retailer.id_retailer && input.id_image === value.image_id;
|
|
432
|
+
});
|
|
401
433
|
});
|
|
402
434
|
});
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
payload: descriptionsActiveRetailer
|
|
411
|
-
});
|
|
412
|
-
dispatch({
|
|
413
|
-
type: "SET_IMAGES_VALUES",
|
|
414
|
-
payload: (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.services.images), {}, {
|
|
415
|
-
values: filteredValues
|
|
416
|
-
})
|
|
417
|
-
});
|
|
435
|
+
dispatch({
|
|
436
|
+
type: "SET_IMAGES_VALUES",
|
|
437
|
+
payload: (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.services.images), {}, {
|
|
438
|
+
values: filteredValues
|
|
439
|
+
})
|
|
440
|
+
});
|
|
441
|
+
}
|
|
418
442
|
};
|
|
419
443
|
|
|
420
444
|
updateInputsActiveRetailer();
|
|
@@ -439,13 +463,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
439
463
|
|
|
440
464
|
|
|
441
465
|
var hasNoOrder = !state.product.id_order && !state.product.orderId;
|
|
442
|
-
|
|
443
|
-
originTab: originTab,
|
|
444
|
-
currentStatus: currentStatus,
|
|
445
|
-
hasNoOrder: hasNoOrder
|
|
446
|
-
});
|
|
447
|
-
var condition = originTab === "RequestWithoutContentoh" && (["R", "CA"].includes(currentStatus) || currentStatus === "RCA" && hasNoOrder) || ["RequestWithContentoh", "Contentoh"].includes(originTab) && currentStatus === "AA";
|
|
448
|
-
return condition;
|
|
466
|
+
return originTab === "RequestWithoutContentoh" && (["R", "CA"].includes(currentStatus) || currentStatus === "RCA" && hasNoOrder) || ["RequestWithContentoh", "Contentoh"].includes(originTab) && currentStatus === "AA";
|
|
449
467
|
};
|
|
450
468
|
|
|
451
469
|
var canShowSaveButton = function canShowSaveButton(version_status) {
|
|
@@ -762,8 +780,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
762
780
|
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(result) {
|
|
763
781
|
var _state$product$id_ord, _state$product4, _state$active_retaile2;
|
|
764
782
|
|
|
765
|
-
var concept, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId,
|
|
766
|
-
|
|
783
|
+
var concept, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, serviceStatus, updatedProduct;
|
|
767
784
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
768
785
|
while (1) {
|
|
769
786
|
switch (_context3.prev = _context3.next) {
|
|
@@ -787,7 +804,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
787
804
|
_context3.prev = 8;
|
|
788
805
|
|
|
789
806
|
if (!result) {
|
|
790
|
-
_context3.next =
|
|
807
|
+
_context3.next = 21;
|
|
791
808
|
break;
|
|
792
809
|
}
|
|
793
810
|
|
|
@@ -803,25 +820,14 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
803
820
|
case 14:
|
|
804
821
|
res = _context3.sent;
|
|
805
822
|
newStatuses = JSON.parse(res.data.body);
|
|
806
|
-
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
807
|
-
console.log({
|
|
808
|
-
product: state.product,
|
|
809
|
-
newStatuses: newStatuses,
|
|
810
|
-
serviceStatus: serviceStatus,
|
|
811
|
-
servicesData: state.services_data
|
|
812
|
-
}); // Actualizar el producto con los nuevos estados
|
|
823
|
+
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")]; // Actualizar el producto con los nuevos estados
|
|
813
824
|
|
|
814
825
|
updatedProduct = (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
815
|
-
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,
|
|
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))))
|
|
827
|
+
});
|
|
828
|
+
console.log({
|
|
829
|
+
updatedProduct: updatedProduct
|
|
816
830
|
});
|
|
817
|
-
updatedServicesData = (_state$services_data = state.services_data) === null || _state$services_data === void 0 ? void 0 : _state$services_data.map(function (service) {
|
|
818
|
-
var _newStatuses$newStatu2;
|
|
819
|
-
|
|
820
|
-
return (0, _objectSpread4.default)((0, _objectSpread4.default)({}, service), {}, {
|
|
821
|
-
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
|
|
822
|
-
});
|
|
823
|
-
}); // console.log({ updatedProduct });
|
|
824
|
-
|
|
825
831
|
dispatch({
|
|
826
832
|
type: "SET_PRODUCT",
|
|
827
833
|
payload: updatedProduct
|
|
@@ -837,12 +843,12 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
837
843
|
}
|
|
838
844
|
});
|
|
839
845
|
|
|
840
|
-
case
|
|
841
|
-
_context3.next =
|
|
846
|
+
case 21:
|
|
847
|
+
_context3.next = 27;
|
|
842
848
|
break;
|
|
843
849
|
|
|
844
|
-
case
|
|
845
|
-
_context3.prev =
|
|
850
|
+
case 23:
|
|
851
|
+
_context3.prev = 23;
|
|
846
852
|
_context3.t0 = _context3["catch"](8);
|
|
847
853
|
console.error("Error sending evaluation:", _context3.t0);
|
|
848
854
|
dispatch({
|
|
@@ -855,20 +861,20 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
855
861
|
}
|
|
856
862
|
});
|
|
857
863
|
|
|
858
|
-
case
|
|
859
|
-
_context3.prev =
|
|
864
|
+
case 27:
|
|
865
|
+
_context3.prev = 27;
|
|
860
866
|
dispatch({
|
|
861
867
|
type: "SET_SAVING",
|
|
862
868
|
payload: false
|
|
863
869
|
});
|
|
864
|
-
return _context3.finish(
|
|
870
|
+
return _context3.finish(27);
|
|
865
871
|
|
|
866
|
-
case
|
|
872
|
+
case 30:
|
|
867
873
|
case "end":
|
|
868
874
|
return _context3.stop();
|
|
869
875
|
}
|
|
870
876
|
}
|
|
871
|
-
}, _callee3, null, [[8,
|
|
877
|
+
}, _callee3, null, [[8, 23, 27, 30]]);
|
|
872
878
|
}));
|
|
873
879
|
|
|
874
880
|
return function sendEvaluation(_x2) {
|
|
@@ -1090,7 +1096,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1090
1096
|
|
|
1091
1097
|
var handleOnEvaluateAll = /*#__PURE__*/function () {
|
|
1092
1098
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(result) {
|
|
1093
|
-
var _state$product$id_ord2, _state$
|
|
1099
|
+
var _state$product$id_ord2, _state$services_data, evaluationArray, conceptArray, dataGeneral, userType, status, updatedStatusByRetailer, updatedProduct;
|
|
1094
1100
|
|
|
1095
1101
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
1096
1102
|
while (1) {
|
|
@@ -1110,7 +1116,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1110
1116
|
isAproved: result === "A"
|
|
1111
1117
|
}; // Crear todas las evaluaciones para cada servicio y retailer
|
|
1112
1118
|
|
|
1113
|
-
(_state$
|
|
1119
|
+
(_state$services_data = state.services_data) === null || _state$services_data === void 0 ? void 0 : _state$services_data.forEach(function (ret) {
|
|
1114
1120
|
var service = ret.service,
|
|
1115
1121
|
id_retailer = ret.id_retailer;
|
|
1116
1122
|
var data = {};
|
|
@@ -1240,332 +1246,330 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1240
1246
|
};
|
|
1241
1247
|
|
|
1242
1248
|
if (state.loading || !state.services || !state.product) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {});
|
|
1243
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
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
|
-
|
|
1249
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
1250
|
+
headerTop: headerTop,
|
|
1251
|
+
children: [showVersionSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionSelector.VersionSelector, {
|
|
1252
|
+
modalId: "version-selector",
|
|
1253
|
+
articleId: state.product.id_article,
|
|
1254
|
+
setVersion: handleOnChangeProductVersion,
|
|
1255
|
+
companyName: company.company_name,
|
|
1256
|
+
currentVersion: state.product.version,
|
|
1257
|
+
setShowVersionSelector: setShowVersionSelector,
|
|
1258
|
+
jwt: token
|
|
1259
|
+
}), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
|
|
1260
|
+
images: state.images_values,
|
|
1261
|
+
setShowModal: setShowModal,
|
|
1262
|
+
approveRejectButtons: canShowValidationButtons(),
|
|
1263
|
+
sendToFacilitator: handleOnSendEvaluation
|
|
1264
|
+
}), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
|
|
1265
|
+
componentsArray: [state.modal.image && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1266
|
+
src: state.modal.image,
|
|
1267
|
+
alt: "modal icon"
|
|
1268
|
+
}, "1"), state.modal.title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1269
|
+
headerType: "retailer-name-header",
|
|
1270
|
+
text: state.modal.title,
|
|
1271
|
+
color: "white"
|
|
1272
|
+
}, "2"), state.modal.message && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1273
|
+
headerType: "retailer-name-header",
|
|
1274
|
+
text: state.modal.message,
|
|
1275
|
+
color: "white"
|
|
1276
|
+
}, "3"), state.modal.buttons && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1277
|
+
style: {
|
|
1278
|
+
marginTop: "16px"
|
|
1279
|
+
},
|
|
1280
|
+
children: state.modal.buttons.map(function (button, index) {
|
|
1281
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1282
|
+
buttonType: button.buttonType,
|
|
1283
|
+
label: button.text,
|
|
1284
|
+
onClick: button.action
|
|
1285
|
+
}, index);
|
|
1286
|
+
})
|
|
1287
|
+
}, "4")].filter(Boolean),
|
|
1288
|
+
onClick: function onClick() {
|
|
1289
|
+
return dispatch({
|
|
1290
|
+
type: "SET_MODAL",
|
|
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,
|
|
1285
1312
|
onClick: function onClick() {
|
|
1286
|
-
|
|
1287
|
-
type: "SET_MODAL",
|
|
1288
|
-
payload: {
|
|
1289
|
-
show: false,
|
|
1290
|
-
title: "",
|
|
1291
|
-
message: "",
|
|
1292
|
-
image: null
|
|
1293
|
-
}
|
|
1294
|
-
});
|
|
1313
|
+
setShowRejectModal(false);
|
|
1295
1314
|
}
|
|
1296
|
-
}),
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
1313
|
-
type: "pink",
|
|
1314
|
-
label: "Aceptar",
|
|
1315
|
-
size: 12,
|
|
1316
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1317
|
-
var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
|
|
1318
|
-
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1319
|
-
while (1) {
|
|
1320
|
-
switch (_context6.prev = _context6.next) {
|
|
1321
|
-
case 0:
|
|
1322
|
-
elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
|
|
1323
|
-
|
|
1324
|
-
if (!(!elements || elements.length === 0)) {
|
|
1325
|
-
_context6.next = 4;
|
|
1326
|
-
break;
|
|
1327
|
-
}
|
|
1315
|
+
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
1316
|
+
type: "pink",
|
|
1317
|
+
label: "Aceptar",
|
|
1318
|
+
size: 12,
|
|
1319
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1320
|
+
var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
|
|
1321
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1322
|
+
while (1) {
|
|
1323
|
+
switch (_context6.prev = _context6.next) {
|
|
1324
|
+
case 0:
|
|
1325
|
+
elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
|
|
1326
|
+
|
|
1327
|
+
if (!(!elements || elements.length === 0)) {
|
|
1328
|
+
_context6.next = 4;
|
|
1329
|
+
break;
|
|
1330
|
+
}
|
|
1328
1331
|
|
|
1329
|
-
|
|
1330
|
-
|
|
1332
|
+
console.error("Elemento no encontrado");
|
|
1333
|
+
return _context6.abrupt("return");
|
|
1331
1334
|
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1335
|
+
case 4:
|
|
1336
|
+
isMessageEmpty = Array.from(elements).every(function (el) {
|
|
1337
|
+
var body = el.innerHTML;
|
|
1338
|
+
return !body || body.replace(/<.*?\/?>/gm, "").trim() === "";
|
|
1339
|
+
});
|
|
1337
1340
|
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1341
|
+
if (!isMessageEmpty) {
|
|
1342
|
+
_context6.next = 10;
|
|
1343
|
+
break;
|
|
1344
|
+
}
|
|
1342
1345
|
|
|
1343
|
-
|
|
1344
|
-
|
|
1346
|
+
container = document.querySelector(".container-customComponent");
|
|
1347
|
+
existingAlert = container.querySelector(".alert-error");
|
|
1345
1348
|
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1349
|
+
if (!existingAlert) {
|
|
1350
|
+
alert = document.createElement("div");
|
|
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
|
+
}
|
|
1353
1356
|
|
|
1354
|
-
|
|
1357
|
+
return _context6.abrupt("return");
|
|
1355
1358
|
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1359
|
+
case 10:
|
|
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);
|
|
1362
1365
|
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
+
case 13:
|
|
1367
|
+
rejectAll ? handleOnEvaluateAll("R") : handleOnSendEvaluation("R");
|
|
1368
|
+
setShowRejectModal(false);
|
|
1366
1369
|
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
}
|
|
1370
|
+
case 15:
|
|
1371
|
+
case "end":
|
|
1372
|
+
return _context6.stop();
|
|
1371
1373
|
}
|
|
1372
|
-
}
|
|
1373
|
-
})
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
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?
|
|
1406
1409
|
|
|
1407
|
-
|
|
1408
|
-
|
|
1410
|
+
})]
|
|
1411
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1412
|
+
className: "product-information",
|
|
1413
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1409
1414
|
className: "product-information",
|
|
1410
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
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
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
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
|
-
|
|
1415
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FullProductNameHeader.FullProductNameHeader, {
|
|
1416
|
+
headerData: state.product,
|
|
1417
|
+
percent: state.active_percentage.percentagesGeneral.required,
|
|
1418
|
+
activeRetailer: {
|
|
1419
|
+
id: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
|
|
1420
|
+
name: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.retailer,
|
|
1421
|
+
image: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.image
|
|
1422
|
+
},
|
|
1423
|
+
showValidationButtons: canShowValidationButtons(),
|
|
1424
|
+
showApproveRejectAll: canShowValidationButtons(),
|
|
1425
|
+
servicesData: state.services_data ? state.services_data : null,
|
|
1426
|
+
approveAll: handleOnApproveAll,
|
|
1427
|
+
rejectAll: handleOnRejectAll,
|
|
1428
|
+
approve: function approve() {
|
|
1429
|
+
return handleOnSendEvaluation("A");
|
|
1430
|
+
},
|
|
1431
|
+
reject: handleOnReject,
|
|
1432
|
+
setActiveRetailer: handleOnChangeActiveRetailer
|
|
1433
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1434
|
+
tabsSections: tabsSections,
|
|
1435
|
+
status: getStatusByCurrentServiceAndRetailer(),
|
|
1436
|
+
activeTab: state.active_tab,
|
|
1437
|
+
user: user,
|
|
1438
|
+
isRetailer: isRetailer,
|
|
1439
|
+
assig: assig,
|
|
1440
|
+
version: state.product.version,
|
|
1441
|
+
updatedDescriptions: state.updated_descriptions_inputs,
|
|
1442
|
+
updatedDatasheets: state.updated_datasheets_inputs,
|
|
1443
|
+
updatedImages: state.updated_images_values,
|
|
1444
|
+
images: state.services.images // actions
|
|
1445
|
+
,
|
|
1446
|
+
downloadImages: handleOnDownloadImages,
|
|
1447
|
+
askToDeleteImages: handleOnAskToDeleteImages,
|
|
1448
|
+
showSaveButton: canShowSaveButton(state.product.version_status),
|
|
1449
|
+
onClickSave: handleOnClickSave // setters
|
|
1450
|
+
,
|
|
1451
|
+
setActiveTab: handleOnChangeActiveTab,
|
|
1452
|
+
setImageLayout: handleOnSetImageLayout,
|
|
1453
|
+
setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
|
|
1454
|
+
setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
|
|
1455
|
+
setAssignation: handleOnSetAssignation // No se usa?
|
|
1456
|
+
,
|
|
1457
|
+
setImages: handleOnSetImages // No se usa?
|
|
1458
|
+
// setSelectedImages={handleOnSetSelectedImages} // Se pasa hasta TabsMenu, pero no se usa
|
|
1459
|
+
,
|
|
1460
|
+
setShowVersionSelector: setShowVersionSelector
|
|
1461
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1462
|
+
className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
|
|
1463
|
+
children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
1464
|
+
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, {
|
|
1465
|
+
activeSection: state.active_tab,
|
|
1466
|
+
inputGroup: state.descriptions_inputs[0],
|
|
1467
|
+
updatedDescriptions: state.updated_descriptions_inputs,
|
|
1468
|
+
articleId: (_state$product7 = state.product) === null || _state$product7 === void 0 ? void 0 : _state$product7.id_article,
|
|
1469
|
+
version: state.product.version,
|
|
1470
|
+
isShowbox: false,
|
|
1471
|
+
dinamicHeight: true,
|
|
1472
|
+
setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
|
|
1473
|
+
updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
|
|
1474
|
+
|
|
1475
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1476
|
+
text: "No cuentas con este servicio",
|
|
1477
|
+
headerType: "input-name-header"
|
|
1478
|
+
})), 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, {
|
|
1479
|
+
children: (_state$datasheets_inp = state.datasheets_inputs[0].data) === null || _state$datasheets_inp === void 0 ? void 0 : _state$datasheets_inp.map(function (dataGroup, index) {
|
|
1480
|
+
var _state$datasheets_inp2;
|
|
1481
|
+
|
|
1482
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
1483
|
+
index: index,
|
|
1484
|
+
articleId: state.product.id_article,
|
|
1485
|
+
version: state.version,
|
|
1486
|
+
activeSection: state.active_tab,
|
|
1487
|
+
inputGroup: dataGroup,
|
|
1488
|
+
dataInputs: (_state$datasheets_inp2 = state.datasheets_inputs[1]) !== null && _state$datasheets_inp2 !== void 0 ? _state$datasheets_inp2 : [],
|
|
1489
|
+
activeRetailer: state.services.datasheets[state.active_retailer.id_retailer],
|
|
1490
|
+
groupData: state.services.datasheets[state.active_retailer.id_retailer].data,
|
|
1491
|
+
updatedDatasheets: state.updated_datasheets_inputs,
|
|
1492
|
+
setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
|
|
1493
|
+
isShowbox: true,
|
|
1494
|
+
setUpdatedBoxData: function setUpdatedBoxData(e) {
|
|
1495
|
+
setBoxData(e);
|
|
1496
|
+
},
|
|
1497
|
+
updateApprovedInputs: handleOnUpdateApprovedInputs // No se usa?
|
|
1498
|
+
|
|
1499
|
+
}, index + "-" + state.active_retailer.retailer);
|
|
1500
|
+
})
|
|
1501
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1502
|
+
text: "No cuentas con este servicio",
|
|
1503
|
+
headerType: "input-name-header"
|
|
1504
|
+
})), 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, {
|
|
1505
|
+
children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
|
|
1506
|
+
checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
|
|
1507
|
+
,
|
|
1508
|
+
setCheckAll: handleOnSetCheckAll // Toggler de true o false para el checkbox "Seleccionar todo"
|
|
1509
|
+
,
|
|
1510
|
+
setSelectedImages: handleOnSetSelectedImages
|
|
1511
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("section", {
|
|
1512
|
+
className: "container",
|
|
1513
|
+
style: {
|
|
1514
|
+
position: "relative"
|
|
1515
|
+
},
|
|
1516
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread4.default)((0, _objectSpread4.default)({}, getRootProps({
|
|
1517
|
+
className: "dropzone ".concat(isDragActive ? "drag-active" : "")
|
|
1518
|
+
})), {}, {
|
|
1519
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread4.default)({}, getInputProps())), isDragActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1520
|
+
className: "drag-overlay",
|
|
1521
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
1522
|
+
children: "Suelta las im\xE1genes aqu\xED"
|
|
1523
|
+
})
|
|
1524
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("aside", {
|
|
1525
|
+
children: thumbs()
|
|
1526
|
+
})]
|
|
1527
|
+
})), ((_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", {
|
|
1508
1528
|
style: {
|
|
1509
|
-
position: "
|
|
1529
|
+
position: "absolute",
|
|
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"
|
|
1510
1538
|
},
|
|
1511
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
1512
|
-
className: "dropzone ".concat(isDragActive ? "drag-active" : "")
|
|
1513
|
-
})), {}, {
|
|
1514
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread4.default)({}, getInputProps())), isDragActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1515
|
-
className: "drag-overlay",
|
|
1516
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
1517
|
-
children: "Suelta las im\xE1genes aqu\xED"
|
|
1518
|
-
})
|
|
1519
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("aside", {
|
|
1520
|
-
children: thumbs()
|
|
1521
|
-
})]
|
|
1522
|
-
})), ((_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", {
|
|
1539
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
1523
1540
|
style: {
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
transform: "translate(-50%, -50%)",
|
|
1528
|
-
textAlign: "center",
|
|
1529
|
-
padding: "40px",
|
|
1530
|
-
width: "80%",
|
|
1531
|
-
maxWidth: "500px",
|
|
1532
|
-
fontFamily: "Arial, sans-serif"
|
|
1541
|
+
fontSize: "18px",
|
|
1542
|
+
color: "#666",
|
|
1543
|
+
marginBottom: "16px"
|
|
1533
1544
|
},
|
|
1534
|
-
children:
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1545
|
+
children: "Este producto no tiene im\xE1genes"
|
|
1546
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
1547
|
+
style: {
|
|
1548
|
+
fontSize: "14px",
|
|
1549
|
+
color: "#999",
|
|
1550
|
+
marginBottom: "20px"
|
|
1551
|
+
},
|
|
1552
|
+
children: ["Arrastra las im\xE1genes aqu\xED o", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
1553
|
+
onClick: open,
|
|
1542
1554
|
style: {
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1555
|
+
color: "#007bff",
|
|
1556
|
+
cursor: "pointer",
|
|
1557
|
+
textDecoration: "underline"
|
|
1546
1558
|
},
|
|
1547
|
-
children:
|
|
1548
|
-
onClick: open,
|
|
1549
|
-
style: {
|
|
1550
|
-
color: "#007bff",
|
|
1551
|
-
cursor: "pointer",
|
|
1552
|
-
textDecoration: "underline"
|
|
1553
|
-
},
|
|
1554
|
-
children: "haz clic para abrir el explorador de archivos"
|
|
1555
|
-
})]
|
|
1559
|
+
children: "haz clic para abrir el explorador de archivos"
|
|
1556
1560
|
})]
|
|
1557
1561
|
})]
|
|
1558
1562
|
})]
|
|
1559
|
-
})
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
})
|
|
1564
|
-
})
|
|
1565
|
-
})
|
|
1566
|
-
})
|
|
1563
|
+
})]
|
|
1564
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1565
|
+
text: "No cuentas con este servicio",
|
|
1566
|
+
headerType: "input-name-header"
|
|
1567
|
+
}))]
|
|
1568
|
+
})
|
|
1569
|
+
})]
|
|
1570
|
+
})
|
|
1567
1571
|
})]
|
|
1568
|
-
})
|
|
1572
|
+
})]
|
|
1569
1573
|
});
|
|
1570
1574
|
};
|
|
1571
1575
|
|