contentoh-components-library 21.6.51 → 21.6.53
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/organisms/PropagateChangesModal/index.js +6 -1
- package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +10 -8
- package/dist/components/pages/ProviderProductEdition/index.js +154 -62
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +11 -9
- package/dist/components/pages/RetailerProductEdition/index.js +160 -54
- package/package.json +1 -1
- package/src/components/organisms/PropagateChangesModal/index.js +10 -3
- package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +2 -1
- package/src/components/pages/ProviderProductEdition/index.js +75 -3
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +2 -1
- package/src/components/pages/RetailerProductEdition/index.js +79 -3
|
@@ -49,6 +49,8 @@ var UMBRAL_SEGUNDO_PLANO = 20;
|
|
|
49
49
|
var PropagateChangesModal = function PropagateChangesModal(_ref) {
|
|
50
50
|
var _ref$changedAttribute = _ref.changedAttributes,
|
|
51
51
|
cambiosRecibidos = _ref$changedAttribute === void 0 ? [] : _ref$changedAttribute,
|
|
52
|
+
_ref$kind = _ref.kind,
|
|
53
|
+
kind = _ref$kind === void 0 ? "datasheet" : _ref$kind,
|
|
52
54
|
_ref$variants = _ref.variants,
|
|
53
55
|
variants = _ref$variants === void 0 ? [] : _ref$variants,
|
|
54
56
|
_ref$groupMembers = _ref.groupMembers,
|
|
@@ -68,6 +70,9 @@ var PropagateChangesModal = function PropagateChangesModal(_ref) {
|
|
|
68
70
|
repetirlo aquí que confiar en que ningún llamador futuro lo olvide.
|
|
69
71
|
*/
|
|
70
72
|
var changedAttributes = (0, _nonPropagable.soloPropagables)(cambiosRecibidos);
|
|
73
|
+
var esDescripcion = kind === "description";
|
|
74
|
+
var sustantivo = esDescripcion ? "descripción" : "atributo";
|
|
75
|
+
var plural = esDescripcion ? "descripciones" : "atributos";
|
|
71
76
|
|
|
72
77
|
var _useState = (0, _react.useState)([]),
|
|
73
78
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -200,7 +205,7 @@ var PropagateChangesModal = function PropagateChangesModal(_ref) {
|
|
|
200
205
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("h2", {
|
|
201
206
|
children: [[variants.length ? "".concat(variants.length, " hijo").concat(variants.length === 1 ? "" : "s") : null, groupMembers.length ? "".concat(groupMembers.length, " variante").concat(groupMembers.length === 1 ? "" : "s") : null].filter(Boolean).join(" y "), " pueden recibir este cambio"]
|
|
202
207
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
203
|
-
children: ["Cambiaste ", changedAttributes.length, "
|
|
208
|
+
children: ["Cambiaste ", changedAttributes.length, " ", changedAttributes.length === 1 ? sustantivo : plural, ". Elige cu\xE1les se copian y a qui\xE9nes; el resto se guarda solo en este producto."]
|
|
204
209
|
})]
|
|
205
210
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Body, {
|
|
206
211
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
|
package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js
CHANGED
|
@@ -83,7 +83,7 @@ var ProviderProductEditionProvider = function ProviderProductEditionProvider(_re
|
|
|
83
83
|
dispatch = _useReducer2[1];
|
|
84
84
|
|
|
85
85
|
var saveDescriptions = /*#__PURE__*/function () {
|
|
86
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(token) {
|
|
86
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(token, propagation) {
|
|
87
87
|
var _state$product, _state$product2;
|
|
88
88
|
|
|
89
89
|
var dataObject, _state$product3, res;
|
|
@@ -104,10 +104,12 @@ var ProviderProductEditionProvider = function ProviderProductEditionProvider(_re
|
|
|
104
104
|
type: "SET_SAVING",
|
|
105
105
|
payload: true
|
|
106
106
|
});
|
|
107
|
-
dataObject = {
|
|
107
|
+
dataObject = (0, _objectSpread2.default)({
|
|
108
108
|
articleId: (_state$product = state.product) === null || _state$product === void 0 ? void 0 : _state$product.id_article,
|
|
109
109
|
articleData: state.updated_descriptions_inputs
|
|
110
|
-
}
|
|
110
|
+
}, propagation ? {
|
|
111
|
+
propagation: propagation
|
|
112
|
+
} : {}); // Marcar todos los items como aprobados
|
|
111
113
|
|
|
112
114
|
dataObject.articleData = dataObject.articleData.map(function (item) {
|
|
113
115
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
@@ -180,7 +182,7 @@ var ProviderProductEditionProvider = function ProviderProductEditionProvider(_re
|
|
|
180
182
|
}, _callee, null, [[6, 13, 17, 20]]);
|
|
181
183
|
}));
|
|
182
184
|
|
|
183
|
-
return function saveDescriptions(_x) {
|
|
185
|
+
return function saveDescriptions(_x, _x2) {
|
|
184
186
|
return _ref2.apply(this, arguments);
|
|
185
187
|
};
|
|
186
188
|
}();
|
|
@@ -301,7 +303,7 @@ var ProviderProductEditionProvider = function ProviderProductEditionProvider(_re
|
|
|
301
303
|
}, _callee2, null, [[6, 13, 17, 20]]);
|
|
302
304
|
}));
|
|
303
305
|
|
|
304
|
-
return function saveDatasheets(
|
|
306
|
+
return function saveDatasheets(_x3, _x4) {
|
|
305
307
|
return _ref3.apply(this, arguments);
|
|
306
308
|
};
|
|
307
309
|
}();
|
|
@@ -467,7 +469,7 @@ var ProviderProductEditionProvider = function ProviderProductEditionProvider(_re
|
|
|
467
469
|
}, _callee3, null, [[10, 20, 25, 28]]);
|
|
468
470
|
}));
|
|
469
471
|
|
|
470
|
-
return function updateImages(
|
|
472
|
+
return function updateImages(_x5) {
|
|
471
473
|
return _ref4.apply(this, arguments);
|
|
472
474
|
};
|
|
473
475
|
}();
|
|
@@ -579,7 +581,7 @@ var ProviderProductEditionProvider = function ProviderProductEditionProvider(_re
|
|
|
579
581
|
}, _callee4, null, [[4, 10]]);
|
|
580
582
|
}));
|
|
581
583
|
|
|
582
|
-
return function deleteImages(
|
|
584
|
+
return function deleteImages(_x6) {
|
|
583
585
|
return _ref5.apply(this, arguments);
|
|
584
586
|
};
|
|
585
587
|
}();
|
|
@@ -616,7 +618,7 @@ var ProviderProductEditionProvider = function ProviderProductEditionProvider(_re
|
|
|
616
618
|
}, _callee5);
|
|
617
619
|
}));
|
|
618
620
|
|
|
619
|
-
return function createComment(
|
|
621
|
+
return function createComment(_x7, _x8) {
|
|
620
622
|
return _ref6.apply(this, arguments);
|
|
621
623
|
};
|
|
622
624
|
}();
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.ProviderProductEdition = void 0;
|
|
9
9
|
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
|
+
|
|
10
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
13
|
|
|
12
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
@@ -95,8 +97,10 @@ var _AiProductEdition = require("../../../contexts/AiProductEdition");
|
|
|
95
97
|
|
|
96
98
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
97
99
|
|
|
100
|
+
var _excluded = ["attributes"];
|
|
101
|
+
|
|
98
102
|
var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
99
|
-
var _state$product, _location$state4, _state$product3, _state$product4, _state$product5, _state$product6, _state$product7, _state$product8, _state$
|
|
103
|
+
var _state$product, _location$state4, _state$product3, _state$product4, _state$product5, _state$product6, _state$product7, _state$product8, _state$product19, _pendingPropagation$k, _state$product24, _family$variants2, _variantGroup$members3, _variantGroup$group, _state$product25, _state$product26, _state$product27, _state$active_retaile5, _state$product28, _state$product29, _state$product30, _variantGroup$group2, _location$state5, _location$state6, _state$active_retaile6, _state$active_retaile7, _state$images_values$2, _state$images_values10, _state$images_values11, _state$active_retaile8, _state$product31, _state$product32, _state$product33, _state$product34, _family$variants3, _family$variants4, _family$variants5, _variantGroup$members4, _variantGroup$members5, _state$active_percent, _state$active_percent2, _state$active_retaile9, _state$active_retaile10, _state$active_retaile11, _state$product40, _state$descriptions_i, _state$services3, _state$services3$data, _state$product41, _state$product42, _state$datasheets_inp, _state$datasheets_inp2, _state$datasheets_inp3, _state$product43, _state$images_values12;
|
|
100
104
|
|
|
101
105
|
var tabsSections = _ref.tabsSections,
|
|
102
106
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -890,6 +894,45 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
890
894
|
|
|
891
895
|
return (0, _nonPropagable.soloPropagables)(cambios);
|
|
892
896
|
};
|
|
897
|
+
/*
|
|
898
|
+
Lo que se acaba de editar en la pestaña de descripciones.
|
|
899
|
+
Va aparte de `cambiosDeFichaTecnica` porque son tablas distintas y el
|
|
900
|
+
endpoint recibe una lista o la otra. Aquí NO se filtran UPC ni SKU: esos son
|
|
901
|
+
atributos de ficha técnica y no aparecen en esta pestaña.
|
|
902
|
+
*/
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
var cambiosDeDescripciones = function cambiosDeDescripciones() {
|
|
906
|
+
var _state$active_retaile3, _state$services$descr, _state$services2, _state$services2$desc, _state$updated_descri;
|
|
907
|
+
|
|
908
|
+
var retailerId = (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer;
|
|
909
|
+
var inputs = (_state$services$descr = (_state$services2 = state.services) === null || _state$services2 === void 0 ? void 0 : (_state$services2$desc = _state$services2.descriptions) === null || _state$services2$desc === void 0 ? void 0 : _state$services2$desc.inputs) !== null && _state$services$descr !== void 0 ? _state$services$descr : {};
|
|
910
|
+
return ((_state$updated_descri = state.updated_descriptions_inputs) !== null && _state$updated_descri !== void 0 ? _state$updated_descri : []).map(function (item) {
|
|
911
|
+
var _input$name2;
|
|
912
|
+
|
|
913
|
+
var input = inputs["".concat(item.attributeId, "_").concat(retailerId)];
|
|
914
|
+
return {
|
|
915
|
+
id: Number(item.attributeId),
|
|
916
|
+
name: (_input$name2 = input === null || input === void 0 ? void 0 : input.name) !== null && _input$name2 !== void 0 ? _input$name2 : "Descripci\xF3n ".concat(item.attributeId),
|
|
917
|
+
value: item.value
|
|
918
|
+
};
|
|
919
|
+
});
|
|
920
|
+
};
|
|
921
|
+
/*
|
|
922
|
+
Destinos posibles para lo que se guarde en este producto: sus hijos y sus
|
|
923
|
+
compañeras de grupo. Un hijo no propaga a nadie.
|
|
924
|
+
*/
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
var destinosPosibles = function destinosPosibles() {
|
|
928
|
+
var _state$product11, _variantGroup$members, _state$product$varian, _state$product12;
|
|
929
|
+
|
|
930
|
+
if ((_state$product11 = state.product) !== null && _state$product11 !== void 0 && _state$product11.parentArticleId) return 0;
|
|
931
|
+
var companeras = ((_variantGroup$members = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.members) !== null && _variantGroup$members !== void 0 ? _variantGroup$members : []).filter(function (m) {
|
|
932
|
+
return !m.isCurrent;
|
|
933
|
+
});
|
|
934
|
+
return ((_state$product$varian = (_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.variantsCount) !== null && _state$product$varian !== void 0 ? _state$product$varian : 0) + companeras.length;
|
|
935
|
+
};
|
|
893
936
|
|
|
894
937
|
var handleOnClickSave = function handleOnClickSave() {
|
|
895
938
|
// `preparandoPropagacion` cubre la ventana entre el clic y la apertura del
|
|
@@ -898,12 +941,35 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
898
941
|
|
|
899
942
|
switch (state.active_tab) {
|
|
900
943
|
case "Descripción":
|
|
901
|
-
|
|
902
|
-
|
|
944
|
+
{
|
|
945
|
+
/*
|
|
946
|
+
Guardar una descripción en un padre también abre la decisión de
|
|
947
|
+
propagar. Sin esto, el hijo heredaba la descripción al ligarse y se
|
|
948
|
+
quedaba con la versión vieja en cuanto el padre la corregía, sin que
|
|
949
|
+
nadie lo notara.
|
|
950
|
+
*/
|
|
951
|
+
var cambiosDesc = cambiosDeDescripciones();
|
|
952
|
+
|
|
953
|
+
if (destinosPosibles() > 0 && cambiosDesc.length > 0) {
|
|
954
|
+
setPreparandoPropagacion(true);
|
|
955
|
+
loadFamily().then(function () {
|
|
956
|
+
return setPendingPropagation({
|
|
957
|
+
cambios: cambiosDesc,
|
|
958
|
+
kind: "description"
|
|
959
|
+
});
|
|
960
|
+
}).finally(function () {
|
|
961
|
+
return setPreparandoPropagacion(false);
|
|
962
|
+
});
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
saveDescriptions(token);
|
|
967
|
+
break;
|
|
968
|
+
}
|
|
903
969
|
|
|
904
970
|
case "Ficha técnica":
|
|
905
971
|
{
|
|
906
|
-
var _variantGroup$
|
|
972
|
+
var _variantGroup$members2, _state$product13, _state$product14;
|
|
907
973
|
|
|
908
974
|
// Guardar un padre con hijos abre la decisión de propagar. Sin este
|
|
909
975
|
// paso el cambio se queda solo en el padre y los hijos se van
|
|
@@ -914,7 +980,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
914
980
|
producto puede no tener hijos y aun así pertenecer a un grupo de
|
|
915
981
|
variantes, y ese cambio también se le puede copiar a sus compañeras.
|
|
916
982
|
*/
|
|
917
|
-
var companeras = ((_variantGroup$
|
|
983
|
+
var companeras = ((_variantGroup$members2 = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.members) !== null && _variantGroup$members2 !== void 0 ? _variantGroup$members2 : []).filter(function (m) {
|
|
918
984
|
return !m.isCurrent;
|
|
919
985
|
});
|
|
920
986
|
/*
|
|
@@ -930,8 +996,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
930
996
|
él no queda ningún destino posible.
|
|
931
997
|
*/
|
|
932
998
|
|
|
933
|
-
var esHijo = !!((_state$
|
|
934
|
-
var hayDestinos = !esHijo && (((_state$
|
|
999
|
+
var esHijo = !!((_state$product13 = state.product) !== null && _state$product13 !== void 0 && _state$product13.parentArticleId);
|
|
1000
|
+
var hayDestinos = !esHijo && (((_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.variantsCount) > 0 || companeras.length > 0);
|
|
935
1001
|
var cambios = cambiosDeFichaTecnica();
|
|
936
1002
|
|
|
937
1003
|
if (hayDestinos && cambios.length > 0) {
|
|
@@ -941,7 +1007,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
941
1007
|
setPreparandoPropagacion(true);
|
|
942
1008
|
loadFamily().then(function () {
|
|
943
1009
|
return setPendingPropagation({
|
|
944
|
-
cambios: cambios
|
|
1010
|
+
cambios: cambios,
|
|
1011
|
+
kind: "datasheet"
|
|
945
1012
|
});
|
|
946
1013
|
}).finally(function () {
|
|
947
1014
|
return setPreparandoPropagacion(false);
|
|
@@ -998,7 +1065,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
998
1065
|
var loadFamily = /*#__PURE__*/function () {
|
|
999
1066
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
1000
1067
|
var forzar,
|
|
1001
|
-
_state$
|
|
1068
|
+
_state$product15,
|
|
1002
1069
|
res,
|
|
1003
1070
|
_args3 = arguments;
|
|
1004
1071
|
|
|
@@ -1019,7 +1086,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1019
1086
|
_context3.prev = 3;
|
|
1020
1087
|
_context3.next = 6;
|
|
1021
1088
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/family"), {
|
|
1022
|
-
articleId: (_state$
|
|
1089
|
+
articleId: (_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.id_article
|
|
1023
1090
|
}, {
|
|
1024
1091
|
headers: {
|
|
1025
1092
|
Authorization: token
|
|
@@ -1198,14 +1265,14 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1198
1265
|
|
|
1199
1266
|
|
|
1200
1267
|
var handleOnUnlinked = function handleOnUnlinked(result) {
|
|
1201
|
-
var _state$product$
|
|
1268
|
+
var _state$product$varian2, _state$product16, _updatedProduct$varia;
|
|
1202
1269
|
|
|
1203
1270
|
if (!result) return;
|
|
1204
1271
|
var updatedProduct = result.mode === "self" ? (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1205
1272
|
parentArticleId: null,
|
|
1206
1273
|
variantsCount: 0
|
|
1207
1274
|
}) : (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1208
|
-
variantsCount: Math.max(((_state$product$
|
|
1275
|
+
variantsCount: Math.max(((_state$product$varian2 = (_state$product16 = state.product) === null || _state$product16 === void 0 ? void 0 : _state$product16.variantsCount) !== null && _state$product$varian2 !== void 0 ? _state$product$varian2 : 1) - 1, 0)
|
|
1209
1276
|
});
|
|
1210
1277
|
dispatch({
|
|
1211
1278
|
type: "SET_PRODUCT",
|
|
@@ -1255,7 +1322,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1255
1322
|
var loadVariantGroup = /*#__PURE__*/function () {
|
|
1256
1323
|
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
1257
1324
|
var forzar,
|
|
1258
|
-
_state$
|
|
1325
|
+
_state$product17,
|
|
1259
1326
|
res,
|
|
1260
1327
|
data,
|
|
1261
1328
|
_args5 = arguments;
|
|
@@ -1277,7 +1344,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1277
1344
|
_context5.prev = 3;
|
|
1278
1345
|
_context5.next = 6;
|
|
1279
1346
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/group"), {
|
|
1280
|
-
articleId: (_state$
|
|
1347
|
+
articleId: (_state$product17 = state.product) === null || _state$product17 === void 0 ? void 0 : _state$product17.id_article
|
|
1281
1348
|
}, {
|
|
1282
1349
|
headers: {
|
|
1283
1350
|
Authorization: token
|
|
@@ -1315,16 +1382,16 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1315
1382
|
}();
|
|
1316
1383
|
|
|
1317
1384
|
(0, _react.useEffect)(function () {
|
|
1318
|
-
var _state$
|
|
1385
|
+
var _state$product18;
|
|
1319
1386
|
|
|
1320
|
-
if (!((_state$
|
|
1387
|
+
if (!((_state$product18 = state.product) !== null && _state$product18 !== void 0 && _state$product18.id_article)) return;
|
|
1321
1388
|
loadVariantGroup(true); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1322
|
-
}, [(_state$
|
|
1389
|
+
}, [(_state$product19 = state.product) === null || _state$product19 === void 0 ? void 0 : _state$product19.id_article]); // Saca el producto del grupo. Los demás miembros siguen agrupados entre ellos;
|
|
1323
1390
|
// si era el último, el grupo deja de existir, porque no vive en ninguna tabla.
|
|
1324
1391
|
|
|
1325
1392
|
var handleOnLeaveGroup = /*#__PURE__*/function () {
|
|
1326
1393
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1327
|
-
var _state$
|
|
1394
|
+
var _state$product20, res;
|
|
1328
1395
|
|
|
1329
1396
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1330
1397
|
while (1) {
|
|
@@ -1333,7 +1400,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1333
1400
|
_context6.prev = 0;
|
|
1334
1401
|
_context6.next = 3;
|
|
1335
1402
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/leave"), {
|
|
1336
|
-
articleId: (_state$
|
|
1403
|
+
articleId: (_state$product20 = state.product) === null || _state$product20 === void 0 ? void 0 : _state$product20.id_article
|
|
1337
1404
|
}, {
|
|
1338
1405
|
headers: {
|
|
1339
1406
|
Authorization: token
|
|
@@ -1471,11 +1538,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1471
1538
|
|
|
1472
1539
|
|
|
1473
1540
|
var handleOnLinkedVariants = function handleOnLinkedVariants(result) {
|
|
1474
|
-
var _state$product$
|
|
1541
|
+
var _state$product$varian3, _state$product21, _result$linked, _result$parentArticle;
|
|
1475
1542
|
|
|
1476
1543
|
if (!result) return;
|
|
1477
1544
|
var updatedProduct = result.mode === "children" ? (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1478
|
-
variantsCount: ((_state$product$
|
|
1545
|
+
variantsCount: ((_state$product$varian3 = (_state$product21 = state.product) === null || _state$product21 === void 0 ? void 0 : _state$product21.variantsCount) !== null && _state$product$varian3 !== void 0 ? _state$product$varian3 : 0) + ((_result$linked = result.linked) !== null && _result$linked !== void 0 ? _result$linked : []).length
|
|
1479
1546
|
}) : (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1480
1547
|
parentArticleId: (_result$parentArticle = result.parentArticleId) !== null && _result$parentArticle !== void 0 ? _result$parentArticle : null,
|
|
1481
1548
|
variantsCount: 0
|
|
@@ -1534,7 +1601,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1534
1601
|
|
|
1535
1602
|
var handleOnRestoreInheritance = /*#__PURE__*/function () {
|
|
1536
1603
|
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(attributeId) {
|
|
1537
|
-
var _state$
|
|
1604
|
+
var _state$product22;
|
|
1538
1605
|
|
|
1539
1606
|
var kind,
|
|
1540
1607
|
esDescripcion,
|
|
@@ -1547,7 +1614,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1547
1614
|
case 0:
|
|
1548
1615
|
kind = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : "attribute";
|
|
1549
1616
|
|
|
1550
|
-
if (!(!attributeId || !((_state$
|
|
1617
|
+
if (!(!attributeId || !((_state$product22 = state.product) !== null && _state$product22 !== void 0 && _state$product22.id_article))) {
|
|
1551
1618
|
_context8.next = 3;
|
|
1552
1619
|
break;
|
|
1553
1620
|
}
|
|
@@ -1657,7 +1724,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1657
1724
|
|
|
1658
1725
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
1659
1726
|
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
|
|
1660
|
-
var _state$product$id_ord, _state$
|
|
1727
|
+
var _state$product$id_ord, _state$active_retaile4, _state$product$status, _state$product$status2, _state$product23;
|
|
1661
1728
|
|
|
1662
1729
|
var concept, articleId, orderId, retailerId, evalStatus, data, _newStatuses$newStatu, _state$services_data, res, newStatuses, serviceStatus, updatedStatusByRetailer, updatedProduct, updatedServicesData;
|
|
1663
1730
|
|
|
@@ -1672,8 +1739,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1672
1739
|
concept = (0, _utils.getConceptByTab)(state.active_tab);
|
|
1673
1740
|
articleId = state.product.id_article;
|
|
1674
1741
|
orderId = (_state$product$id_ord = state.product.id_order) !== null && _state$product$id_ord !== void 0 ? _state$product$id_ord : state.product.orderId;
|
|
1675
|
-
retailerId = (_state$
|
|
1676
|
-
evalStatus = ((_state$product$status = state.product.statusByRetailer) === null || _state$product$status === void 0 ? void 0 : (_state$product$status2 = _state$product$status[retailerId]) === null || _state$product$status2 === void 0 ? void 0 : _state$product$status2[concept]) || state.product["".concat(concept, "_status")] || ((_state$
|
|
1742
|
+
retailerId = (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.id_retailer;
|
|
1743
|
+
evalStatus = ((_state$product$status = state.product.statusByRetailer) === null || _state$product$status === void 0 ? void 0 : (_state$product$status2 = _state$product$status[retailerId]) === null || _state$product$status2 === void 0 ? void 0 : _state$product$status2[concept]) || state.product["".concat(concept, "_status")] || ((_state$product23 = state.product) === null || _state$product23 === void 0 ? void 0 : _state$product23.version_status);
|
|
1677
1744
|
data = {
|
|
1678
1745
|
articleId: articleId,
|
|
1679
1746
|
orderId: orderId,
|
|
@@ -2157,10 +2224,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2157
2224
|
jwt: token
|
|
2158
2225
|
}), pendingPropagation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PropagateChangesModal.PropagateChangesModal, {
|
|
2159
2226
|
changedAttributes: pendingPropagation.cambios,
|
|
2160
|
-
|
|
2227
|
+
kind: (_pendingPropagation$k = pendingPropagation.kind) !== null && _pendingPropagation$k !== void 0 ? _pendingPropagation$k : "datasheet",
|
|
2228
|
+
variants: (_state$product24 = state.product) !== null && _state$product24 !== void 0 && _state$product24.parentArticleId ? [] : ((_family$variants2 = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants2 !== void 0 ? _family$variants2 : []).filter(function (v) {
|
|
2161
2229
|
return !v.isCurrent;
|
|
2162
2230
|
}),
|
|
2163
|
-
groupMembers: ((_variantGroup$
|
|
2231
|
+
groupMembers: ((_variantGroup$members3 = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.members) !== null && _variantGroup$members3 !== void 0 ? _variantGroup$members3 : []).filter(function (m) {
|
|
2164
2232
|
return !m.isCurrent;
|
|
2165
2233
|
}),
|
|
2166
2234
|
groupCode: (_variantGroup$group = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) !== null && _variantGroup$group !== void 0 ? _variantGroup$group : null,
|
|
@@ -2169,23 +2237,47 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2169
2237
|
return setPendingPropagation(null);
|
|
2170
2238
|
},
|
|
2171
2239
|
onConfirm: function onConfirm(propagation) {
|
|
2240
|
+
var esDescripcion = pendingPropagation.kind === "description";
|
|
2172
2241
|
setPendingPropagation(null);
|
|
2173
|
-
|
|
2242
|
+
|
|
2243
|
+
if (!propagation) {
|
|
2244
|
+
// Guardar sin propagar: el producto se guarda solo.
|
|
2245
|
+
if (esDescripcion) saveDescriptions(token);else saveDatasheets(token);
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
/*
|
|
2249
|
+
El diálogo habla de «atributos» porque es el mismo componente
|
|
2250
|
+
para las dos pestañas. Al guardar hay que ponerlo en la lista
|
|
2251
|
+
que corresponde: el servidor recibe `attributes` o
|
|
2252
|
+
`descriptions`, nunca una por la otra.
|
|
2253
|
+
*/
|
|
2254
|
+
|
|
2255
|
+
|
|
2256
|
+
var attributes = propagation.attributes,
|
|
2257
|
+
destinos = (0, _objectWithoutProperties2.default)(propagation, _excluded);
|
|
2258
|
+
|
|
2259
|
+
if (esDescripcion) {
|
|
2260
|
+
saveDescriptions(token, (0, _objectSpread4.default)((0, _objectSpread4.default)({}, destinos), {}, {
|
|
2261
|
+
descriptions: attributes
|
|
2262
|
+
}));
|
|
2263
|
+
} else {
|
|
2264
|
+
saveDatasheets(token, propagation);
|
|
2265
|
+
}
|
|
2174
2266
|
}
|
|
2175
2267
|
}), showLinkVariants && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkVariantsModal.LinkVariantsModal, {
|
|
2176
|
-
articleId: (_state$
|
|
2177
|
-
articleName: (_state$
|
|
2178
|
-
articleUpc: (_state$
|
|
2179
|
-
activeRetailerId: (_state$
|
|
2268
|
+
articleId: (_state$product25 = state.product) === null || _state$product25 === void 0 ? void 0 : _state$product25.id_article,
|
|
2269
|
+
articleName: (_state$product26 = state.product) === null || _state$product26 === void 0 ? void 0 : _state$product26.name,
|
|
2270
|
+
articleUpc: (_state$product27 = state.product) === null || _state$product27 === void 0 ? void 0 : _state$product27.upc,
|
|
2271
|
+
activeRetailerId: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
|
|
2180
2272
|
token: token,
|
|
2181
2273
|
onClose: function onClose() {
|
|
2182
2274
|
return setShowLinkVariants(false);
|
|
2183
2275
|
},
|
|
2184
2276
|
onLinked: handleOnLinkedVariants
|
|
2185
2277
|
}), showGroupModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VariantGroupModal.VariantGroupModal, {
|
|
2186
|
-
articleId: (_state$
|
|
2187
|
-
articleName: (_state$
|
|
2188
|
-
articleUpc: (_state$
|
|
2278
|
+
articleId: (_state$product28 = state.product) === null || _state$product28 === void 0 ? void 0 : _state$product28.id_article,
|
|
2279
|
+
articleName: (_state$product29 = state.product) === null || _state$product29 === void 0 ? void 0 : _state$product29.name,
|
|
2280
|
+
articleUpc: (_state$product30 = state.product) === null || _state$product30 === void 0 ? void 0 : _state$product30.upc,
|
|
2189
2281
|
currentGroup: (_variantGroup$group2 = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) !== null && _variantGroup$group2 !== void 0 ? _variantGroup$group2 : null,
|
|
2190
2282
|
token: token,
|
|
2191
2283
|
onClose: function onClose() {
|
|
@@ -2327,8 +2419,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2327
2419
|
productSelected: state.product,
|
|
2328
2420
|
token: token,
|
|
2329
2421
|
activeRetailer: {
|
|
2330
|
-
id: (_state$
|
|
2331
|
-
name: (_state$
|
|
2422
|
+
id: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
|
|
2423
|
+
name: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.retailer
|
|
2332
2424
|
}
|
|
2333
2425
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2334
2426
|
className: "data-container",
|
|
@@ -2343,8 +2435,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2343
2435
|
lists: state.images_values || [],
|
|
2344
2436
|
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] : {},
|
|
2345
2437
|
assignationsImages: assig,
|
|
2346
|
-
retailerSelected: (_state$
|
|
2347
|
-
imagesStatus: ((_state$
|
|
2438
|
+
retailerSelected: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.id_retailer,
|
|
2439
|
+
imagesStatus: ((_state$product31 = state.product) === null || _state$product31 === void 0 ? void 0 : _state$product31.images_status) || "-",
|
|
2348
2440
|
isRetailer: isRetailer,
|
|
2349
2441
|
setShowVersionSelector: setShowVersionSelector,
|
|
2350
2442
|
version: state.product.version,
|
|
@@ -2357,7 +2449,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2357
2449
|
className: "product-information",
|
|
2358
2450
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2359
2451
|
className: "product-information",
|
|
2360
|
-
children: [!((_state$
|
|
2452
|
+
children: [!((_state$product32 = state.product) !== null && _state$product32 !== void 0 && _state$product32.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2361
2453
|
className: "variants-actions",
|
|
2362
2454
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
2363
2455
|
type: "button",
|
|
@@ -2366,7 +2458,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2366
2458
|
return setShowLinkVariants(true);
|
|
2367
2459
|
},
|
|
2368
2460
|
children: "Ligar productos"
|
|
2369
|
-
}), ((_state$
|
|
2461
|
+
}), ((_state$product33 = state.product) === null || _state$product33 === void 0 ? void 0 : _state$product33.variantsCount) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2370
2462
|
type: "button",
|
|
2371
2463
|
className: "variants-count",
|
|
2372
2464
|
"aria-expanded": showFamily,
|
|
@@ -2381,7 +2473,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2381
2473
|
children: showFamily ? " ▴" : " ▾"
|
|
2382
2474
|
})]
|
|
2383
2475
|
})]
|
|
2384
|
-
}), ((_state$
|
|
2476
|
+
}), ((_state$product34 = state.product) === null || _state$product34 === void 0 ? void 0 : _state$product34.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2385
2477
|
className: "variants-actions",
|
|
2386
2478
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2387
2479
|
type: "button",
|
|
@@ -2430,13 +2522,13 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2430
2522
|
className: "desvincular",
|
|
2431
2523
|
title: "Dejar de ser hijo de este producto",
|
|
2432
2524
|
onClick: function onClick() {
|
|
2433
|
-
var _state$
|
|
2525
|
+
var _state$product35, _state$product36, _state$product37;
|
|
2434
2526
|
|
|
2435
2527
|
return setPorDesvincular({
|
|
2436
2528
|
mode: "self",
|
|
2437
|
-
childArticleId: (_state$
|
|
2438
|
-
childName: (_state$
|
|
2439
|
-
childUpc: (_state$
|
|
2529
|
+
childArticleId: (_state$product35 = state.product) === null || _state$product35 === void 0 ? void 0 : _state$product35.id_article,
|
|
2530
|
+
childName: (_state$product36 = state.product) === null || _state$product36 === void 0 ? void 0 : _state$product36.name,
|
|
2531
|
+
childUpc: (_state$product37 = state.product) === null || _state$product37 === void 0 ? void 0 : _state$product37.upc,
|
|
2440
2532
|
parentName: family.parent.name,
|
|
2441
2533
|
parentUpc: family.parent.upc
|
|
2442
2534
|
});
|
|
@@ -2468,15 +2560,15 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2468
2560
|
className: "desvincular",
|
|
2469
2561
|
title: "Desvincular este hijo",
|
|
2470
2562
|
onClick: function onClick() {
|
|
2471
|
-
var _state$
|
|
2563
|
+
var _state$product38, _state$product39;
|
|
2472
2564
|
|
|
2473
2565
|
return setPorDesvincular({
|
|
2474
2566
|
mode: "child",
|
|
2475
2567
|
childArticleId: variant.articleId,
|
|
2476
2568
|
childName: variant.name,
|
|
2477
2569
|
childUpc: variant.upc,
|
|
2478
|
-
parentName: (_state$
|
|
2479
|
-
parentUpc: (_state$
|
|
2570
|
+
parentName: (_state$product38 = state.product) === null || _state$product38 === void 0 ? void 0 : _state$product38.name,
|
|
2571
|
+
parentUpc: (_state$product39 = state.product) === null || _state$product39 === void 0 ? void 0 : _state$product39.upc
|
|
2480
2572
|
});
|
|
2481
2573
|
},
|
|
2482
2574
|
children: "Desvincular"
|
|
@@ -2517,7 +2609,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2517
2609
|
})]
|
|
2518
2610
|
}), puedeAgruparse && showGroup && (variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2519
2611
|
className: "variants-family",
|
|
2520
|
-
children: [((_variantGroup$
|
|
2612
|
+
children: [((_variantGroup$members4 = variantGroup.members) !== null && _variantGroup$members4 !== void 0 ? _variantGroup$members4 : []).filter(function (miembro) {
|
|
2521
2613
|
return !miembro.isCurrent;
|
|
2522
2614
|
}).map(function (miembro) {
|
|
2523
2615
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -2541,7 +2633,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2541
2633
|
})]
|
|
2542
2634
|
})
|
|
2543
2635
|
}, miembro.articleId);
|
|
2544
|
-
}), ((_variantGroup$
|
|
2636
|
+
}), ((_variantGroup$members5 = variantGroup.members) !== null && _variantGroup$members5 !== void 0 ? _variantGroup$members5 : []).filter(function (m) {
|
|
2545
2637
|
return !m.isCurrent;
|
|
2546
2638
|
}).length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
2547
2639
|
className: "loading",
|
|
@@ -2557,9 +2649,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2557
2649
|
headerData: state.product,
|
|
2558
2650
|
percent: (_state$active_percent = state.active_percentage) === null || _state$active_percent === void 0 ? void 0 : (_state$active_percent2 = _state$active_percent.percentagesGeneral) === null || _state$active_percent2 === void 0 ? void 0 : _state$active_percent2.required,
|
|
2559
2651
|
activeRetailer: {
|
|
2560
|
-
id: (_state$
|
|
2561
|
-
name: (_state$
|
|
2562
|
-
image: (_state$
|
|
2652
|
+
id: (_state$active_retaile9 = state.active_retailer) === null || _state$active_retaile9 === void 0 ? void 0 : _state$active_retaile9.id_retailer,
|
|
2653
|
+
name: (_state$active_retaile10 = state.active_retailer) === null || _state$active_retaile10 === void 0 ? void 0 : _state$active_retaile10.retailer,
|
|
2654
|
+
image: (_state$active_retaile11 = state.active_retailer) === null || _state$active_retaile11 === void 0 ? void 0 : _state$active_retaile11.image
|
|
2563
2655
|
},
|
|
2564
2656
|
showValidationButtons: canShowValidationButtons(),
|
|
2565
2657
|
showApproveRejectAll: canShowValidationButtons(),
|
|
@@ -2603,7 +2695,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2603
2695
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2604
2696
|
className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
|
|
2605
2697
|
children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
2606
|
-
children: [state.active_tab === "Descripción" && (((_state$
|
|
2698
|
+
children: [state.active_tab === "Descripción" && (((_state$product40 = state.product) === null || _state$product40 === void 0 ? void 0 : _state$product40.description_status) !== "NS" ? (_state$descriptions_i = state.descriptions_inputs) !== null && _state$descriptions_i !== void 0 && _state$descriptions_i[0] ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
2607
2699
|
activeSection: state.active_tab,
|
|
2608
2700
|
inputGroup: state.descriptions_inputs[0],
|
|
2609
2701
|
updatedDescriptions: state.updated_descriptions_inputs
|
|
@@ -2612,9 +2704,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2612
2704
|
la ficha técnica para no depender de que la
|
|
2613
2705
|
llamada de descripciones traiga el bloque. */
|
|
2614
2706
|
,
|
|
2615
|
-
variant: (_state$
|
|
2707
|
+
variant: (_state$services3 = state.services) === null || _state$services3 === void 0 ? void 0 : (_state$services3$data = _state$services3.datasheets) === null || _state$services3$data === void 0 ? void 0 : _state$services3$data.variant,
|
|
2616
2708
|
onRestoreInheritance: handleOnRestoreInheritance,
|
|
2617
|
-
articleId: (_state$
|
|
2709
|
+
articleId: (_state$product41 = state.product) === null || _state$product41 === void 0 ? void 0 : _state$product41.id_article,
|
|
2618
2710
|
version: state.product.version,
|
|
2619
2711
|
isShowbox: false,
|
|
2620
2712
|
dinamicHeight: true,
|
|
@@ -2626,9 +2718,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2626
2718
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2627
2719
|
text: "No cuentas con este servicio",
|
|
2628
2720
|
headerType: "input-name-header"
|
|
2629
|
-
})), state.active_tab === "Ficha técnica" && (((_state$
|
|
2721
|
+
})), state.active_tab === "Ficha técnica" && (((_state$product42 = state.product) === null || _state$product42 === void 0 ? void 0 : _state$product42.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
2630
2722
|
children: ((_state$datasheets_inp = state.datasheets_inputs) === null || _state$datasheets_inp === void 0 ? void 0 : (_state$datasheets_inp2 = _state$datasheets_inp[0]) === null || _state$datasheets_inp2 === void 0 ? void 0 : (_state$datasheets_inp3 = _state$datasheets_inp2.data) === null || _state$datasheets_inp3 === void 0 ? void 0 : _state$datasheets_inp3.length) > 0 ? state.datasheets_inputs[0].data.map(function (dataGroup, index) {
|
|
2631
|
-
var _state$datasheets_inp4, _state$
|
|
2723
|
+
var _state$datasheets_inp4, _state$services4, _state$services4$data, _state$services$datas3;
|
|
2632
2724
|
|
|
2633
2725
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
2634
2726
|
index: index,
|
|
@@ -2637,7 +2729,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2637
2729
|
activeSection: state.active_tab,
|
|
2638
2730
|
inputGroup: dataGroup,
|
|
2639
2731
|
dataInputs: (_state$datasheets_inp4 = state.datasheets_inputs[1]) !== null && _state$datasheets_inp4 !== void 0 ? _state$datasheets_inp4 : [],
|
|
2640
|
-
variant: (_state$
|
|
2732
|
+
variant: (_state$services4 = state.services) === null || _state$services4 === void 0 ? void 0 : (_state$services4$data = _state$services4.datasheets) === null || _state$services4$data === void 0 ? void 0 : _state$services4$data.variant,
|
|
2641
2733
|
onRestoreInheritance: handleOnRestoreInheritance,
|
|
2642
2734
|
activeRetailer: state.services.datasheets[state.active_retailer.id_retailer],
|
|
2643
2735
|
groupData: (_state$services$datas3 = state.services.datasheets[state.active_retailer.id_retailer]) === null || _state$services$datas3 === void 0 ? void 0 : _state$services$datas3.data,
|
|
@@ -2656,7 +2748,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2656
2748
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2657
2749
|
text: "No cuentas con este servicio",
|
|
2658
2750
|
headerType: "input-name-header"
|
|
2659
|
-
})), state.active_tab === "Imágenes" && (((_state$
|
|
2751
|
+
})), state.active_tab === "Imágenes" && (((_state$product43 = state.product) === null || _state$product43 === void 0 ? void 0 : _state$product43.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
2660
2752
|
children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
|
|
2661
2753
|
checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
|
|
2662
2754
|
,
|