contentoh-components-library 21.6.30 → 21.6.31
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/pages/RetailerProductEdition/context/provider-product-edition.context.js +44 -26
- package/dist/components/pages/RetailerProductEdition/index.js +600 -172
- package/dist/components/pages/RetailerProductEdition/styles.js +5 -2
- package/dist/components/pages/RetailerProductEdition/utils.js +8 -0
- package/package.json +1 -1
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +22 -2
- package/src/components/pages/RetailerProductEdition/index.js +291 -2
- package/src/components/pages/RetailerProductEdition/styles.js +96 -0
- package/src/components/pages/RetailerProductEdition/utils.js +8 -0
|
@@ -73,6 +73,12 @@ var _VersionSelector = require("../../organisms/VersionSelector");
|
|
|
73
73
|
|
|
74
74
|
var _Modal = require("../../organisms/Modal");
|
|
75
75
|
|
|
76
|
+
var _LinkVariantsModal = require("../../organisms/LinkVariantsModal");
|
|
77
|
+
|
|
78
|
+
var _PropagateChangesModal = require("../../organisms/PropagateChangesModal");
|
|
79
|
+
|
|
80
|
+
var _api = require("../../organisms/LinkVariantsModal/api");
|
|
81
|
+
|
|
76
82
|
var _genericModalCheck = _interopRequireDefault(require("../../../assets/images/genericModal/genericModalCheck.svg"));
|
|
77
83
|
|
|
78
84
|
var _errorModal = _interopRequireDefault(require("../../../assets/images/genericModal/errorModal.svg"));
|
|
@@ -154,81 +160,81 @@ function regenerateVideoThumbnails(_x) {
|
|
|
154
160
|
}
|
|
155
161
|
|
|
156
162
|
function _regenerateVideoThumbnails() {
|
|
157
|
-
_regenerateVideoThumbnails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
158
|
-
return _regenerator.default.wrap(function
|
|
163
|
+
_regenerateVideoThumbnails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(values) {
|
|
164
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
159
165
|
while (1) {
|
|
160
|
-
switch (
|
|
166
|
+
switch (_context18.prev = _context18.next) {
|
|
161
167
|
case 0:
|
|
162
168
|
if (Array.isArray(values)) {
|
|
163
|
-
|
|
169
|
+
_context18.next = 2;
|
|
164
170
|
break;
|
|
165
171
|
}
|
|
166
172
|
|
|
167
|
-
return
|
|
173
|
+
return _context18.abrupt("return", values);
|
|
168
174
|
|
|
169
175
|
case 2:
|
|
170
|
-
return
|
|
171
|
-
var
|
|
176
|
+
return _context18.abrupt("return", Promise.all(values.map( /*#__PURE__*/function () {
|
|
177
|
+
var _ref20 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(value) {
|
|
172
178
|
var base64, videoSrc, thumbnail;
|
|
173
|
-
return _regenerator.default.wrap(function
|
|
179
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
174
180
|
while (1) {
|
|
175
|
-
switch (
|
|
181
|
+
switch (_context17.prev = _context17.next) {
|
|
176
182
|
case 0:
|
|
177
183
|
if (!((value === null || value === void 0 ? void 0 : value.ext) !== "mp4" || !(value !== null && value !== void 0 && value.srcDB))) {
|
|
178
|
-
|
|
184
|
+
_context17.next = 2;
|
|
179
185
|
break;
|
|
180
186
|
}
|
|
181
187
|
|
|
182
|
-
return
|
|
188
|
+
return _context17.abrupt("return", value);
|
|
183
189
|
|
|
184
190
|
case 2:
|
|
185
|
-
|
|
186
|
-
|
|
191
|
+
_context17.prev = 2;
|
|
192
|
+
_context17.next = 5;
|
|
187
193
|
return convertirVideoABase64("https://" + process.env.REACT_APP_IMAGES_BUCKET + ".s3.amazonaws.com/" + value.srcDB);
|
|
188
194
|
|
|
189
195
|
case 5:
|
|
190
|
-
base64 =
|
|
196
|
+
base64 = _context17.sent;
|
|
191
197
|
videoSrc = "data:video/mp4;base64," + base64.split(",")[1];
|
|
192
|
-
|
|
198
|
+
_context17.next = 9;
|
|
193
199
|
return (0, _generateThumnail.default)(videoSrc, 2);
|
|
194
200
|
|
|
195
201
|
case 9:
|
|
196
|
-
thumbnail =
|
|
197
|
-
return
|
|
202
|
+
thumbnail = _context17.sent;
|
|
203
|
+
return _context17.abrupt("return", (0, _objectSpread5.default)((0, _objectSpread5.default)({}, value), {}, {
|
|
198
204
|
src: thumbnail
|
|
199
205
|
}));
|
|
200
206
|
|
|
201
207
|
case 13:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
console.error("Error al generar thumbnail del video:",
|
|
205
|
-
return
|
|
208
|
+
_context17.prev = 13;
|
|
209
|
+
_context17.t0 = _context17["catch"](2);
|
|
210
|
+
console.error("Error al generar thumbnail del video:", _context17.t0);
|
|
211
|
+
return _context17.abrupt("return", value);
|
|
206
212
|
|
|
207
213
|
case 17:
|
|
208
214
|
case "end":
|
|
209
|
-
return
|
|
215
|
+
return _context17.stop();
|
|
210
216
|
}
|
|
211
217
|
}
|
|
212
|
-
},
|
|
218
|
+
}, _callee17, null, [[2, 13]]);
|
|
213
219
|
}));
|
|
214
220
|
|
|
215
|
-
return function (
|
|
216
|
-
return
|
|
221
|
+
return function (_x10) {
|
|
222
|
+
return _ref20.apply(this, arguments);
|
|
217
223
|
};
|
|
218
224
|
}())));
|
|
219
225
|
|
|
220
226
|
case 3:
|
|
221
227
|
case "end":
|
|
222
|
-
return
|
|
228
|
+
return _context18.stop();
|
|
223
229
|
}
|
|
224
230
|
}
|
|
225
|
-
},
|
|
231
|
+
}, _callee18);
|
|
226
232
|
}));
|
|
227
233
|
return _regenerateVideoThumbnails.apply(this, arguments);
|
|
228
234
|
}
|
|
229
235
|
|
|
230
236
|
var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
231
|
-
var _state$errors, _location$state, _location$state2, _state$
|
|
237
|
+
var _state$errors, _family$variants, _state$product12, _state$product13, _state$product14, _state$active_retaile5, _location$state, _location$state2, _state$active_retaile6, _state$active_retaile7, _state$images_values$2, _state$images_values10, _state$images_values11, _state$product15, _state$active_retaile8, _state$product16, _state$product17, _state$product18, _family$variants2, _family$variants3, _state$active_percent, _state$active_percent2, _state$active_percent3, _state$active_retaile9, _state$active_retaile10, _state$active_retaile11, _state$product19, _state$product20, _state$product21, _state$datasheets_inp, _state$datasheets_inp2, _state$product22, _state$images_values12, _state$comment;
|
|
232
238
|
|
|
233
239
|
var tabsSections = _ref.tabsSections,
|
|
234
240
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -304,32 +310,63 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
304
310
|
var _useState19 = (0, _react.useState)(false),
|
|
305
311
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
306
312
|
rejectAll = _useState20[0],
|
|
307
|
-
setRejectAll = _useState20[1];
|
|
313
|
+
setRejectAll = _useState20[1]; // Variantes: mismo comportamiento que la ficha de la aplicación de clientes.
|
|
314
|
+
|
|
308
315
|
|
|
309
|
-
var _useState21 = (0, _react.useState)(
|
|
316
|
+
var _useState21 = (0, _react.useState)(false),
|
|
310
317
|
_useState22 = (0, _slicedToArray2.default)(_useState21, 2),
|
|
311
|
-
|
|
312
|
-
|
|
318
|
+
showLinkVariants = _useState22[0],
|
|
319
|
+
setShowLinkVariants = _useState22[1];
|
|
313
320
|
|
|
314
|
-
var _useState23 = (0, _react.useState)(
|
|
321
|
+
var _useState23 = (0, _react.useState)(null),
|
|
315
322
|
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
316
|
-
|
|
317
|
-
|
|
323
|
+
family = _useState24[0],
|
|
324
|
+
setFamily = _useState24[1];
|
|
318
325
|
|
|
319
|
-
var _useState25 = (0, _react.useState)(
|
|
326
|
+
var _useState25 = (0, _react.useState)(false),
|
|
320
327
|
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
321
|
-
|
|
322
|
-
|
|
328
|
+
showFamily = _useState26[0],
|
|
329
|
+
setShowFamily = _useState26[1];
|
|
323
330
|
|
|
324
|
-
var _useState27 = (0, _react.useState)(
|
|
331
|
+
var _useState27 = (0, _react.useState)(null),
|
|
325
332
|
_useState28 = (0, _slicedToArray2.default)(_useState27, 2),
|
|
326
|
-
|
|
327
|
-
|
|
333
|
+
loadingVariant = _useState28[0],
|
|
334
|
+
setLoadingVariant = _useState28[1];
|
|
328
335
|
|
|
329
|
-
var _useState29 = (0, _react.useState)(
|
|
336
|
+
var _useState29 = (0, _react.useState)(null),
|
|
330
337
|
_useState30 = (0, _slicedToArray2.default)(_useState29, 2),
|
|
331
|
-
|
|
332
|
-
|
|
338
|
+
pendingPropagation = _useState30[0],
|
|
339
|
+
setPendingPropagation = _useState30[1];
|
|
340
|
+
|
|
341
|
+
var _useState31 = (0, _react.useState)(false),
|
|
342
|
+
_useState32 = (0, _slicedToArray2.default)(_useState31, 2),
|
|
343
|
+
preparandoPropagacion = _useState32[0],
|
|
344
|
+
setPreparandoPropagacion = _useState32[1];
|
|
345
|
+
|
|
346
|
+
var _useState33 = (0, _react.useState)([]),
|
|
347
|
+
_useState34 = (0, _slicedToArray2.default)(_useState33, 2),
|
|
348
|
+
auditServices = _useState34[0],
|
|
349
|
+
setAuditServices = _useState34[1];
|
|
350
|
+
|
|
351
|
+
var _useState35 = (0, _react.useState)([]),
|
|
352
|
+
_useState36 = (0, _slicedToArray2.default)(_useState35, 2),
|
|
353
|
+
auditDatasheets = _useState36[0],
|
|
354
|
+
setAuditDatasheets = _useState36[1];
|
|
355
|
+
|
|
356
|
+
var _useState37 = (0, _react.useState)([]),
|
|
357
|
+
_useState38 = (0, _slicedToArray2.default)(_useState37, 2),
|
|
358
|
+
auditDescriptions = _useState38[0],
|
|
359
|
+
setAuditDescriptions = _useState38[1];
|
|
360
|
+
|
|
361
|
+
var _useState39 = (0, _react.useState)(false),
|
|
362
|
+
_useState40 = (0, _slicedToArray2.default)(_useState39, 2),
|
|
363
|
+
showModal = _useState40[0],
|
|
364
|
+
setShowModal = _useState40[1];
|
|
365
|
+
|
|
366
|
+
var _useState41 = (0, _react.useState)(false),
|
|
367
|
+
_useState42 = (0, _slicedToArray2.default)(_useState41, 2),
|
|
368
|
+
compare = _useState42[0],
|
|
369
|
+
setCompare = _useState42[1];
|
|
333
370
|
|
|
334
371
|
var _useDropzone = (0, _reactDropzone.useDropzone)({
|
|
335
372
|
accept: "image/*, video/mp4",
|
|
@@ -465,10 +502,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
465
502
|
isDragActive = _useDropzone.isDragActive,
|
|
466
503
|
open = _useDropzone.open;
|
|
467
504
|
|
|
468
|
-
var
|
|
469
|
-
|
|
470
|
-
openChangeStatusModal =
|
|
471
|
-
setOpenChangeStatusModal =
|
|
505
|
+
var _useState43 = (0, _react.useState)(false),
|
|
506
|
+
_useState44 = (0, _slicedToArray2.default)(_useState43, 2),
|
|
507
|
+
openChangeStatusModal = _useState44[0],
|
|
508
|
+
setOpenChangeStatusModal = _useState44[1];
|
|
472
509
|
|
|
473
510
|
var thumbs = function thumbs() {
|
|
474
511
|
var _state$images_values, _state$images_values$, _state$images_values4, _state$images_values5, _state$images_values6, _state$images_values7, _state$images_values8, _state$images_values9;
|
|
@@ -1095,63 +1132,338 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1095
1132
|
saveImageAttrs(token);
|
|
1096
1133
|
}
|
|
1097
1134
|
};
|
|
1135
|
+
/*
|
|
1136
|
+
Trae la familia: las variantes del producto, o sus hermanas si el abierto es
|
|
1137
|
+
una de ellas. Se pide al abrir la sección y no al montar la pantalla: la
|
|
1138
|
+
mayoría de los productos no son familia.
|
|
1139
|
+
*/
|
|
1098
1140
|
|
|
1099
|
-
|
|
1141
|
+
|
|
1142
|
+
var loadFamily = /*#__PURE__*/function () {
|
|
1100
1143
|
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
1144
|
+
var _state$product8, res, data;
|
|
1145
|
+
|
|
1101
1146
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
1102
1147
|
while (1) {
|
|
1103
1148
|
switch (_context5.prev = _context5.next) {
|
|
1104
1149
|
case 0:
|
|
1105
|
-
if (!
|
|
1150
|
+
if (!family) {
|
|
1106
1151
|
_context5.next = 2;
|
|
1107
1152
|
break;
|
|
1108
1153
|
}
|
|
1109
1154
|
|
|
1110
|
-
return _context5.abrupt("return");
|
|
1155
|
+
return _context5.abrupt("return", family);
|
|
1156
|
+
|
|
1157
|
+
case 2:
|
|
1158
|
+
_context5.prev = 2;
|
|
1159
|
+
_context5.next = 5;
|
|
1160
|
+
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/family"), {
|
|
1161
|
+
articleId: (_state$product8 = state.product) === null || _state$product8 === void 0 ? void 0 : _state$product8.id_article
|
|
1162
|
+
}, {
|
|
1163
|
+
headers: {
|
|
1164
|
+
Authorization: token
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
|
|
1168
|
+
case 5:
|
|
1169
|
+
res = _context5.sent;
|
|
1170
|
+
data = (0, _api.readPayload)(res);
|
|
1171
|
+
setFamily(data);
|
|
1172
|
+
return _context5.abrupt("return", data);
|
|
1173
|
+
|
|
1174
|
+
case 11:
|
|
1175
|
+
_context5.prev = 11;
|
|
1176
|
+
_context5.t0 = _context5["catch"](2);
|
|
1177
|
+
console.error("loadFamily: ", _context5.t0);
|
|
1178
|
+
setFamily({
|
|
1179
|
+
variants: [],
|
|
1180
|
+
parent: null,
|
|
1181
|
+
error: true
|
|
1182
|
+
});
|
|
1183
|
+
return _context5.abrupt("return", null);
|
|
1184
|
+
|
|
1185
|
+
case 16:
|
|
1186
|
+
case "end":
|
|
1187
|
+
return _context5.stop();
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
}, _callee5, null, [[2, 11]]);
|
|
1191
|
+
}));
|
|
1192
|
+
|
|
1193
|
+
return function loadFamily() {
|
|
1194
|
+
return _ref8.apply(this, arguments);
|
|
1195
|
+
};
|
|
1196
|
+
}();
|
|
1197
|
+
/*
|
|
1198
|
+
Abre otra variante. Esta pantalla lee el producto de sessionStorage, no de la
|
|
1199
|
+
URL, así que hay que dejarlo ahí antes de navegar; si no, cambia la dirección
|
|
1200
|
+
y sigue mostrando el producto anterior.
|
|
1201
|
+
Se pide por ID y no por UPC: hay 12,024 UPC repetidos entre artículos activos
|
|
1202
|
+
y 5,579 de esos casos caen dentro de la misma compañía.
|
|
1203
|
+
*/
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
var openVariant = /*#__PURE__*/function () {
|
|
1207
|
+
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(articleId) {
|
|
1208
|
+
var res, _readPayload, data, encontrado;
|
|
1209
|
+
|
|
1210
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1211
|
+
while (1) {
|
|
1212
|
+
switch (_context6.prev = _context6.next) {
|
|
1213
|
+
case 0:
|
|
1214
|
+
setLoadingVariant(articleId);
|
|
1215
|
+
_context6.prev = 1;
|
|
1216
|
+
_context6.next = 4;
|
|
1217
|
+
return _axios.default.get("".concat(process.env.REACT_APP_NEW_ARTICLES_ENDPOINT), {
|
|
1218
|
+
params: {
|
|
1219
|
+
listType: "general",
|
|
1220
|
+
filterByArticleId: articleId
|
|
1221
|
+
},
|
|
1222
|
+
headers: {
|
|
1223
|
+
Authorization: token
|
|
1224
|
+
}
|
|
1225
|
+
});
|
|
1226
|
+
|
|
1227
|
+
case 4:
|
|
1228
|
+
res = _context6.sent;
|
|
1229
|
+
_readPayload = (0, _api.readPayload)(res), data = _readPayload.data;
|
|
1230
|
+
encontrado = (data !== null && data !== void 0 ? data : []).find(function (item) {
|
|
1231
|
+
return Number(item.id_article) === Number(articleId);
|
|
1232
|
+
});
|
|
1233
|
+
|
|
1234
|
+
if (encontrado) {
|
|
1235
|
+
sessionStorage.setItem("productSelected", JSON.stringify((0, _objectSpread5.default)((0, _objectSpread5.default)({}, encontrado), {}, {
|
|
1236
|
+
article: {
|
|
1237
|
+
id_article: encontrado.id_article
|
|
1238
|
+
}
|
|
1239
|
+
})));
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
_context6.next = 13;
|
|
1243
|
+
break;
|
|
1244
|
+
|
|
1245
|
+
case 10:
|
|
1246
|
+
_context6.prev = 10;
|
|
1247
|
+
_context6.t0 = _context6["catch"](1);
|
|
1248
|
+
// Se navega igual: dejar el clic sin efecto parecería que no responde.
|
|
1249
|
+
console.error("openVariant: ", _context6.t0);
|
|
1250
|
+
|
|
1251
|
+
case 13:
|
|
1252
|
+
_context6.prev = 13;
|
|
1253
|
+
setLoadingVariant(null);
|
|
1254
|
+
window.location.assign("/EditProducts");
|
|
1255
|
+
return _context6.finish(13);
|
|
1256
|
+
|
|
1257
|
+
case 17:
|
|
1258
|
+
case "end":
|
|
1259
|
+
return _context6.stop();
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
}, _callee6, null, [[1, 10, 13, 17]]);
|
|
1263
|
+
}));
|
|
1264
|
+
|
|
1265
|
+
return function openVariant(_x3) {
|
|
1266
|
+
return _ref9.apply(this, arguments);
|
|
1267
|
+
};
|
|
1268
|
+
}();
|
|
1269
|
+
/*
|
|
1270
|
+
Refresca tras ligar, sin recargar: el producto sale de sessionStorage, así que
|
|
1271
|
+
un refresh devolvería el mismo objeto y el contador seguiría igual.
|
|
1272
|
+
*/
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
var handleOnLinkedVariants = function handleOnLinkedVariants(result) {
|
|
1276
|
+
var _state$product$varian, _state$product9, _result$linked, _result$parentArticle;
|
|
1277
|
+
|
|
1278
|
+
if (!result) return;
|
|
1279
|
+
var updatedProduct = result.mode === "children" ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1280
|
+
variantsCount: ((_state$product$varian = (_state$product9 = state.product) === null || _state$product9 === void 0 ? void 0 : _state$product9.variantsCount) !== null && _state$product$varian !== void 0 ? _state$product$varian : 0) + ((_result$linked = result.linked) !== null && _result$linked !== void 0 ? _result$linked : []).length
|
|
1281
|
+
}) : (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1282
|
+
parentArticleId: (_result$parentArticle = result.parentArticleId) !== null && _result$parentArticle !== void 0 ? _result$parentArticle : null,
|
|
1283
|
+
variantsCount: 0
|
|
1284
|
+
});
|
|
1285
|
+
dispatch({
|
|
1286
|
+
type: "SET_PRODUCT",
|
|
1287
|
+
payload: updatedProduct
|
|
1288
|
+
});
|
|
1289
|
+
setFamily(null);
|
|
1290
|
+
|
|
1291
|
+
try {
|
|
1292
|
+
sessionStorage.setItem("productSelected", JSON.stringify(updatedProduct));
|
|
1293
|
+
} catch (error) {
|
|
1294
|
+
console.error("linkVariants/sessionStorage: ", error);
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
/*
|
|
1298
|
+
Acción "Volver a heredar" de los chips. Repinta en sitio con lo que devuelve
|
|
1299
|
+
el endpoint: recargar la ficha se llevaría lo que haya sin guardar.
|
|
1300
|
+
*/
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
var handleOnRestoreInheritance = /*#__PURE__*/function () {
|
|
1304
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(attributeId) {
|
|
1305
|
+
var _state$product10;
|
|
1306
|
+
|
|
1307
|
+
var res, data;
|
|
1308
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
1309
|
+
while (1) {
|
|
1310
|
+
switch (_context7.prev = _context7.next) {
|
|
1311
|
+
case 0:
|
|
1312
|
+
if (!(!attributeId || !((_state$product10 = state.product) !== null && _state$product10 !== void 0 && _state$product10.id_article))) {
|
|
1313
|
+
_context7.next = 2;
|
|
1314
|
+
break;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
return _context7.abrupt("return");
|
|
1318
|
+
|
|
1319
|
+
case 2:
|
|
1320
|
+
_context7.prev = 2;
|
|
1321
|
+
_context7.next = 5;
|
|
1322
|
+
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/restore"), {
|
|
1323
|
+
articleId: state.product.id_article,
|
|
1324
|
+
attributes: [Number(attributeId)]
|
|
1325
|
+
}, {
|
|
1326
|
+
headers: {
|
|
1327
|
+
Authorization: token
|
|
1328
|
+
}
|
|
1329
|
+
});
|
|
1330
|
+
|
|
1331
|
+
case 5:
|
|
1332
|
+
res = _context7.sent;
|
|
1333
|
+
data = (0, _api.readPayload)(res);
|
|
1334
|
+
dispatch({
|
|
1335
|
+
type: "UPDATE_DATASHEETS_INPUTS",
|
|
1336
|
+
payload: (data.values || []).map(function (item) {
|
|
1337
|
+
return {
|
|
1338
|
+
attributeId: item.id,
|
|
1339
|
+
value: item.value,
|
|
1340
|
+
isOverridden: 0
|
|
1341
|
+
};
|
|
1342
|
+
})
|
|
1343
|
+
});
|
|
1344
|
+
_context7.next = 13;
|
|
1345
|
+
break;
|
|
1346
|
+
|
|
1347
|
+
case 10:
|
|
1348
|
+
_context7.prev = 10;
|
|
1349
|
+
_context7.t0 = _context7["catch"](2);
|
|
1350
|
+
console.error("restoreInheritance: ", _context7.t0);
|
|
1351
|
+
|
|
1352
|
+
case 13:
|
|
1353
|
+
case "end":
|
|
1354
|
+
return _context7.stop();
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}, _callee7, null, [[2, 10]]);
|
|
1358
|
+
}));
|
|
1359
|
+
|
|
1360
|
+
return function handleOnRestoreInheritance(_x4) {
|
|
1361
|
+
return _ref10.apply(this, arguments);
|
|
1362
|
+
};
|
|
1363
|
+
}();
|
|
1364
|
+
/*
|
|
1365
|
+
Los atributos recién tocados, con el nombre que ve el usuario:
|
|
1366
|
+
`updated_datasheets_inputs` solo trae { attributeId, value }.
|
|
1367
|
+
*/
|
|
1368
|
+
|
|
1369
|
+
|
|
1370
|
+
var cambiosDeFichaTecnica = function cambiosDeFichaTecnica() {
|
|
1371
|
+
var _state$active_retaile3, _state$services$datas, _state$services, _state$services$datas2, _state$updated_datash;
|
|
1372
|
+
|
|
1373
|
+
var retailerId = (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer;
|
|
1374
|
+
var inputs = (_state$services$datas = (_state$services = state.services) === null || _state$services === void 0 ? void 0 : (_state$services$datas2 = _state$services.datasheets) === null || _state$services$datas2 === void 0 ? void 0 : _state$services$datas2.inputs) !== null && _state$services$datas !== void 0 ? _state$services$datas : {};
|
|
1375
|
+
return ((_state$updated_datash = state.updated_datasheets_inputs) !== null && _state$updated_datash !== void 0 ? _state$updated_datash : []).map(function (item) {
|
|
1376
|
+
var _input$name;
|
|
1377
|
+
|
|
1378
|
+
var input = inputs["".concat(item.attributeId, "_").concat(retailerId)];
|
|
1379
|
+
return {
|
|
1380
|
+
id: Number(item.attributeId),
|
|
1381
|
+
name: (_input$name = input === null || input === void 0 ? void 0 : input.name) !== null && _input$name !== void 0 ? _input$name : "Atributo ".concat(item.attributeId),
|
|
1382
|
+
value: item.value
|
|
1383
|
+
};
|
|
1384
|
+
});
|
|
1385
|
+
};
|
|
1386
|
+
|
|
1387
|
+
var handleOnClickSave = /*#__PURE__*/function () {
|
|
1388
|
+
var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1389
|
+
var _state$product11, esPadre, cambios;
|
|
1390
|
+
|
|
1391
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
1392
|
+
while (1) {
|
|
1393
|
+
switch (_context8.prev = _context8.next) {
|
|
1394
|
+
case 0:
|
|
1395
|
+
if (!(state.saving || preparandoPropagacion)) {
|
|
1396
|
+
_context8.next = 2;
|
|
1397
|
+
break;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
return _context8.abrupt("return");
|
|
1111
1401
|
|
|
1112
1402
|
case 2:
|
|
1113
|
-
|
|
1114
|
-
|
|
1403
|
+
_context8.t0 = state.active_tab;
|
|
1404
|
+
_context8.next = _context8.t0 === "Descripción" ? 5 : _context8.t0 === "Ficha técnica" ? 8 : _context8.t0 === "Imágenes" ? 17 : 20;
|
|
1115
1405
|
break;
|
|
1116
1406
|
|
|
1117
1407
|
case 5:
|
|
1118
|
-
|
|
1408
|
+
_context8.next = 7;
|
|
1119
1409
|
return saveDescriptions(token);
|
|
1120
1410
|
|
|
1121
1411
|
case 7:
|
|
1122
|
-
return
|
|
1412
|
+
return _context8.abrupt("break", 21);
|
|
1123
1413
|
|
|
1124
1414
|
case 8:
|
|
1125
|
-
|
|
1415
|
+
// Guardar un padre con variantes abre la decisión de propagar. Sin este
|
|
1416
|
+
// paso el cambio se queda solo en el padre y las variantes se van
|
|
1417
|
+
// separando de él sin que nadie lo note.
|
|
1418
|
+
esPadre = ((_state$product11 = state.product) === null || _state$product11 === void 0 ? void 0 : _state$product11.variantsCount) > 0;
|
|
1419
|
+
cambios = cambiosDeFichaTecnica();
|
|
1420
|
+
|
|
1421
|
+
if (!(esPadre && cambios.length > 0)) {
|
|
1422
|
+
_context8.next = 14;
|
|
1423
|
+
break;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
setPreparandoPropagacion(true);
|
|
1427
|
+
loadFamily().then(function () {
|
|
1428
|
+
return setPendingPropagation({
|
|
1429
|
+
cambios: cambios
|
|
1430
|
+
});
|
|
1431
|
+
}).finally(function () {
|
|
1432
|
+
return setPreparandoPropagacion(false);
|
|
1433
|
+
});
|
|
1434
|
+
return _context8.abrupt("return");
|
|
1435
|
+
|
|
1436
|
+
case 14:
|
|
1437
|
+
_context8.next = 16;
|
|
1126
1438
|
return saveDatasheets(token);
|
|
1127
1439
|
|
|
1128
|
-
case
|
|
1129
|
-
return
|
|
1440
|
+
case 16:
|
|
1441
|
+
return _context8.abrupt("break", 21);
|
|
1130
1442
|
|
|
1131
|
-
case
|
|
1132
|
-
|
|
1443
|
+
case 17:
|
|
1444
|
+
_context8.next = 19;
|
|
1133
1445
|
return updateImages(token);
|
|
1134
1446
|
|
|
1135
|
-
case
|
|
1136
|
-
return
|
|
1447
|
+
case 19:
|
|
1448
|
+
return _context8.abrupt("break", 21);
|
|
1137
1449
|
|
|
1138
|
-
case
|
|
1139
|
-
return
|
|
1450
|
+
case 20:
|
|
1451
|
+
return _context8.abrupt("break", 21);
|
|
1140
1452
|
|
|
1141
|
-
case
|
|
1142
|
-
|
|
1453
|
+
case 21:
|
|
1454
|
+
_context8.next = 23;
|
|
1143
1455
|
return loadData(false);
|
|
1144
1456
|
|
|
1145
|
-
case
|
|
1457
|
+
case 23:
|
|
1146
1458
|
case "end":
|
|
1147
|
-
return
|
|
1459
|
+
return _context8.stop();
|
|
1148
1460
|
}
|
|
1149
1461
|
}
|
|
1150
|
-
},
|
|
1462
|
+
}, _callee8);
|
|
1151
1463
|
}));
|
|
1152
1464
|
|
|
1153
1465
|
return function handleOnClickSave() {
|
|
1154
|
-
return
|
|
1466
|
+
return _ref11.apply(this, arguments);
|
|
1155
1467
|
};
|
|
1156
1468
|
}();
|
|
1157
1469
|
|
|
@@ -1219,24 +1531,24 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1219
1531
|
};
|
|
1220
1532
|
|
|
1221
1533
|
var handleOnApproveSingleService = /*#__PURE__*/function () {
|
|
1222
|
-
var
|
|
1223
|
-
return _regenerator.default.wrap(function
|
|
1534
|
+
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
1535
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1224
1536
|
while (1) {
|
|
1225
|
-
switch (
|
|
1537
|
+
switch (_context9.prev = _context9.next) {
|
|
1226
1538
|
case 0:
|
|
1227
|
-
|
|
1539
|
+
_context9.next = 2;
|
|
1228
1540
|
return sendSingleEvaluation("A");
|
|
1229
1541
|
|
|
1230
1542
|
case 2:
|
|
1231
1543
|
case "end":
|
|
1232
|
-
return
|
|
1544
|
+
return _context9.stop();
|
|
1233
1545
|
}
|
|
1234
1546
|
}
|
|
1235
|
-
},
|
|
1547
|
+
}, _callee9);
|
|
1236
1548
|
}));
|
|
1237
1549
|
|
|
1238
1550
|
return function handleOnApproveSingleService() {
|
|
1239
|
-
return
|
|
1551
|
+
return _ref12.apply(this, arguments);
|
|
1240
1552
|
};
|
|
1241
1553
|
}();
|
|
1242
1554
|
|
|
@@ -1245,21 +1557,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1245
1557
|
};
|
|
1246
1558
|
|
|
1247
1559
|
var sendSingleEvaluation = /*#__PURE__*/function () {
|
|
1248
|
-
var
|
|
1249
|
-
var _state$product$id_ord, _state$
|
|
1560
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(result) {
|
|
1561
|
+
var _state$product$id_ord, _state$active_retaile4;
|
|
1250
1562
|
|
|
1251
1563
|
var concept, articleId, orderId, sectionStatusKey, evalStatus, retailerId, data, res, message, icon, activeTab, newStatuses, serviceStatus, articleStatus, updatedStatusByRetailer, updatedProduct, specialistDone, _objectSpread2, _state$services_data2, _JSON$parse2, newStatus, newOrderStatus, newArticleStatus, _articleStatus, updatedStatusByRetailerForSend, _updatedProduct, updatedServicesData, sessionProduct, _objectSpread3, productInSession, updatedProductInSession;
|
|
1252
1564
|
|
|
1253
|
-
return _regenerator.default.wrap(function
|
|
1565
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
1254
1566
|
while (1) {
|
|
1255
|
-
switch (
|
|
1567
|
+
switch (_context10.prev = _context10.next) {
|
|
1256
1568
|
case 0:
|
|
1257
1569
|
if (!state.saving) {
|
|
1258
|
-
|
|
1570
|
+
_context10.next = 2;
|
|
1259
1571
|
break;
|
|
1260
1572
|
}
|
|
1261
1573
|
|
|
1262
|
-
return
|
|
1574
|
+
return _context10.abrupt("return");
|
|
1263
1575
|
|
|
1264
1576
|
case 2:
|
|
1265
1577
|
dispatch({
|
|
@@ -1271,7 +1583,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1271
1583
|
orderId = (_state$product$id_ord = state.product.id_order) !== null && _state$product$id_ord !== void 0 ? _state$product$id_ord : state.product.orderId;
|
|
1272
1584
|
sectionStatusKey = "".concat(concept, "_status");
|
|
1273
1585
|
evalStatus = state.product[sectionStatusKey];
|
|
1274
|
-
retailerId = (_state$
|
|
1586
|
+
retailerId = (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.id_retailer;
|
|
1275
1587
|
data = {
|
|
1276
1588
|
articleId: articleId,
|
|
1277
1589
|
orderId: orderId,
|
|
@@ -1280,16 +1592,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1280
1592
|
retailerId: retailerId
|
|
1281
1593
|
};
|
|
1282
1594
|
activeTab = state.active_tab;
|
|
1283
|
-
|
|
1595
|
+
_context10.prev = 11;
|
|
1284
1596
|
|
|
1285
1597
|
if (!result) {
|
|
1286
|
-
|
|
1598
|
+
_context10.next = 28;
|
|
1287
1599
|
break;
|
|
1288
1600
|
}
|
|
1289
1601
|
|
|
1290
1602
|
data.result = result;
|
|
1291
1603
|
data.retailerId = retailerId;
|
|
1292
|
-
|
|
1604
|
+
_context10.next = 17;
|
|
1293
1605
|
return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1294
1606
|
headers: {
|
|
1295
1607
|
Authorization: token
|
|
@@ -1297,7 +1609,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1297
1609
|
});
|
|
1298
1610
|
|
|
1299
1611
|
case 17:
|
|
1300
|
-
res =
|
|
1612
|
+
res = _context10.sent;
|
|
1301
1613
|
newStatuses = JSON.parse(res.data.body);
|
|
1302
1614
|
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1303
1615
|
articleStatus = newStatuses.newArticleStatus[articleId];
|
|
@@ -1328,7 +1640,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1328
1640
|
image: _genericModalCheck.default
|
|
1329
1641
|
}
|
|
1330
1642
|
});
|
|
1331
|
-
|
|
1643
|
+
_context10.next = 33;
|
|
1332
1644
|
break;
|
|
1333
1645
|
|
|
1334
1646
|
case 28:
|
|
@@ -1344,7 +1656,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1344
1656
|
icon = _genericModalCheck.default;
|
|
1345
1657
|
}
|
|
1346
1658
|
|
|
1347
|
-
|
|
1659
|
+
_context10.next = 32;
|
|
1348
1660
|
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1349
1661
|
headers: {
|
|
1350
1662
|
Authorization: token
|
|
@@ -1352,7 +1664,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1352
1664
|
});
|
|
1353
1665
|
|
|
1354
1666
|
case 32:
|
|
1355
|
-
res =
|
|
1667
|
+
res = _context10.sent;
|
|
1356
1668
|
|
|
1357
1669
|
case 33:
|
|
1358
1670
|
if (res.data.statusCode === 200) {
|
|
@@ -1437,13 +1749,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1437
1749
|
});
|
|
1438
1750
|
}
|
|
1439
1751
|
|
|
1440
|
-
|
|
1752
|
+
_context10.next = 40;
|
|
1441
1753
|
break;
|
|
1442
1754
|
|
|
1443
1755
|
case 36:
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
console.error("Error sending evaluation:",
|
|
1756
|
+
_context10.prev = 36;
|
|
1757
|
+
_context10.t0 = _context10["catch"](11);
|
|
1758
|
+
console.error("Error sending evaluation:", _context10.t0);
|
|
1447
1759
|
dispatch({
|
|
1448
1760
|
type: "SET_MODAL",
|
|
1449
1761
|
payload: {
|
|
@@ -1455,45 +1767,45 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1455
1767
|
});
|
|
1456
1768
|
|
|
1457
1769
|
case 40:
|
|
1458
|
-
|
|
1770
|
+
_context10.prev = 40;
|
|
1459
1771
|
dispatch({
|
|
1460
1772
|
type: "SET_SAVING",
|
|
1461
1773
|
payload: false
|
|
1462
1774
|
});
|
|
1463
|
-
return
|
|
1775
|
+
return _context10.finish(40);
|
|
1464
1776
|
|
|
1465
1777
|
case 43:
|
|
1466
1778
|
case "end":
|
|
1467
|
-
return
|
|
1779
|
+
return _context10.stop();
|
|
1468
1780
|
}
|
|
1469
1781
|
}
|
|
1470
|
-
},
|
|
1782
|
+
}, _callee10, null, [[11, 36, 40, 43]]);
|
|
1471
1783
|
}));
|
|
1472
1784
|
|
|
1473
|
-
return function sendSingleEvaluation(
|
|
1474
|
-
return
|
|
1785
|
+
return function sendSingleEvaluation(_x5) {
|
|
1786
|
+
return _ref13.apply(this, arguments);
|
|
1475
1787
|
};
|
|
1476
1788
|
}();
|
|
1477
1789
|
|
|
1478
1790
|
var handleOnApproveAllServices = /*#__PURE__*/function () {
|
|
1479
|
-
var
|
|
1480
|
-
return _regenerator.default.wrap(function
|
|
1791
|
+
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
1792
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1481
1793
|
while (1) {
|
|
1482
|
-
switch (
|
|
1794
|
+
switch (_context11.prev = _context11.next) {
|
|
1483
1795
|
case 0:
|
|
1484
|
-
|
|
1796
|
+
_context11.next = 2;
|
|
1485
1797
|
return sendBulkEvaluation("A");
|
|
1486
1798
|
|
|
1487
1799
|
case 2:
|
|
1488
1800
|
case "end":
|
|
1489
|
-
return
|
|
1801
|
+
return _context11.stop();
|
|
1490
1802
|
}
|
|
1491
1803
|
}
|
|
1492
|
-
},
|
|
1804
|
+
}, _callee11);
|
|
1493
1805
|
}));
|
|
1494
1806
|
|
|
1495
1807
|
return function handleOnApproveAllServices() {
|
|
1496
|
-
return
|
|
1808
|
+
return _ref14.apply(this, arguments);
|
|
1497
1809
|
};
|
|
1498
1810
|
}();
|
|
1499
1811
|
|
|
@@ -1503,18 +1815,18 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1503
1815
|
};
|
|
1504
1816
|
|
|
1505
1817
|
var sendBulkEvaluation = /*#__PURE__*/function () {
|
|
1506
|
-
var
|
|
1818
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(result) {
|
|
1507
1819
|
var _state$services_data3, evaluationArray, conceptArray, status, updatedStatusByRetailer, updatedProduct, updatedServicesData;
|
|
1508
1820
|
|
|
1509
|
-
return _regenerator.default.wrap(function
|
|
1821
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1510
1822
|
while (1) {
|
|
1511
|
-
switch (
|
|
1823
|
+
switch (_context12.prev = _context12.next) {
|
|
1512
1824
|
case 0:
|
|
1513
1825
|
dispatch({
|
|
1514
1826
|
type: "SET_SAVING",
|
|
1515
1827
|
payload: true
|
|
1516
1828
|
});
|
|
1517
|
-
|
|
1829
|
+
_context12.prev = 1;
|
|
1518
1830
|
evaluationArray = [];
|
|
1519
1831
|
conceptArray = (0, _utils.getConceptsByRole)(user.id_role);
|
|
1520
1832
|
(_state$services_data3 = state.services_data) === null || _state$services_data3 === void 0 ? void 0 : _state$services_data3.forEach(function (ret, idx) {
|
|
@@ -1539,7 +1851,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1539
1851
|
}));
|
|
1540
1852
|
}
|
|
1541
1853
|
});
|
|
1542
|
-
|
|
1854
|
+
_context12.next = 7;
|
|
1543
1855
|
return Promise.all(evaluationArray);
|
|
1544
1856
|
|
|
1545
1857
|
case 7:
|
|
@@ -1594,41 +1906,41 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1594
1906
|
image: _genericModalCheck.default
|
|
1595
1907
|
}
|
|
1596
1908
|
});
|
|
1597
|
-
|
|
1909
|
+
_context12.next = 19;
|
|
1598
1910
|
break;
|
|
1599
1911
|
|
|
1600
1912
|
case 16:
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
console.error("Error in bulk evaluation:",
|
|
1913
|
+
_context12.prev = 16;
|
|
1914
|
+
_context12.t0 = _context12["catch"](1);
|
|
1915
|
+
console.error("Error in bulk evaluation:", _context12.t0);
|
|
1604
1916
|
|
|
1605
1917
|
case 19:
|
|
1606
|
-
|
|
1918
|
+
_context12.prev = 19;
|
|
1607
1919
|
dispatch({
|
|
1608
1920
|
type: "SET_SAVING",
|
|
1609
1921
|
payload: false
|
|
1610
1922
|
});
|
|
1611
|
-
return
|
|
1923
|
+
return _context12.finish(19);
|
|
1612
1924
|
|
|
1613
1925
|
case 22:
|
|
1614
1926
|
case "end":
|
|
1615
|
-
return
|
|
1927
|
+
return _context12.stop();
|
|
1616
1928
|
}
|
|
1617
1929
|
}
|
|
1618
|
-
},
|
|
1930
|
+
}, _callee12, null, [[1, 16, 19, 22]]);
|
|
1619
1931
|
}));
|
|
1620
1932
|
|
|
1621
|
-
return function sendBulkEvaluation(
|
|
1622
|
-
return
|
|
1933
|
+
return function sendBulkEvaluation(_x6) {
|
|
1934
|
+
return _ref15.apply(this, arguments);
|
|
1623
1935
|
};
|
|
1624
1936
|
}();
|
|
1625
1937
|
|
|
1626
1938
|
var handleOnChangeAssignations = /*#__PURE__*/function () {
|
|
1627
|
-
var
|
|
1939
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(assignationType, assignationId) {
|
|
1628
1940
|
var concept, data, updatedProduct;
|
|
1629
|
-
return _regenerator.default.wrap(function
|
|
1941
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
1630
1942
|
while (1) {
|
|
1631
|
-
switch (
|
|
1943
|
+
switch (_context13.prev = _context13.next) {
|
|
1632
1944
|
case 0:
|
|
1633
1945
|
concept = (0, _utils.getConceptByTab)(state.active_tab);
|
|
1634
1946
|
data = {
|
|
@@ -1639,7 +1951,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1639
1951
|
concept: concept,
|
|
1640
1952
|
userId: assignationId
|
|
1641
1953
|
};
|
|
1642
|
-
|
|
1954
|
+
_context13.next = 4;
|
|
1643
1955
|
return (0, _axios.default)({
|
|
1644
1956
|
method: "post",
|
|
1645
1957
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
@@ -1658,14 +1970,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1658
1970
|
|
|
1659
1971
|
case 6:
|
|
1660
1972
|
case "end":
|
|
1661
|
-
return
|
|
1973
|
+
return _context13.stop();
|
|
1662
1974
|
}
|
|
1663
1975
|
}
|
|
1664
|
-
},
|
|
1976
|
+
}, _callee13);
|
|
1665
1977
|
}));
|
|
1666
1978
|
|
|
1667
|
-
return function handleOnChangeAssignations(
|
|
1668
|
-
return
|
|
1979
|
+
return function handleOnChangeAssignations(_x7, _x8) {
|
|
1980
|
+
return _ref16.apply(this, arguments);
|
|
1669
1981
|
};
|
|
1670
1982
|
}();
|
|
1671
1983
|
|
|
@@ -1700,16 +2012,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1700
2012
|
};
|
|
1701
2013
|
|
|
1702
2014
|
var handleOnSubmitComment = /*#__PURE__*/function () {
|
|
1703
|
-
var
|
|
2015
|
+
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
|
|
1704
2016
|
var commentText;
|
|
1705
|
-
return _regenerator.default.wrap(function
|
|
2017
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
1706
2018
|
while (1) {
|
|
1707
|
-
switch (
|
|
2019
|
+
switch (_context14.prev = _context14.next) {
|
|
1708
2020
|
case 0:
|
|
1709
2021
|
e.preventDefault();
|
|
1710
2022
|
commentText = document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML;
|
|
1711
|
-
|
|
1712
|
-
|
|
2023
|
+
_context14.prev = 2;
|
|
2024
|
+
_context14.next = 5;
|
|
1713
2025
|
return createComment(commentText, token);
|
|
1714
2026
|
|
|
1715
2027
|
case 5:
|
|
@@ -1722,13 +2034,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1722
2034
|
image: _genericModalCheck.default
|
|
1723
2035
|
}
|
|
1724
2036
|
});
|
|
1725
|
-
|
|
2037
|
+
_context14.next = 12;
|
|
1726
2038
|
break;
|
|
1727
2039
|
|
|
1728
2040
|
case 8:
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
console.error("Error saving comment:",
|
|
2041
|
+
_context14.prev = 8;
|
|
2042
|
+
_context14.t0 = _context14["catch"](2);
|
|
2043
|
+
console.error("Error saving comment:", _context14.t0);
|
|
1732
2044
|
dispatch({
|
|
1733
2045
|
type: "SET_MODAL",
|
|
1734
2046
|
payload: {
|
|
@@ -1741,14 +2053,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1741
2053
|
|
|
1742
2054
|
case 12:
|
|
1743
2055
|
case "end":
|
|
1744
|
-
return
|
|
2056
|
+
return _context14.stop();
|
|
1745
2057
|
}
|
|
1746
2058
|
}
|
|
1747
|
-
},
|
|
2059
|
+
}, _callee14, null, [[2, 8]]);
|
|
1748
2060
|
}));
|
|
1749
2061
|
|
|
1750
|
-
return function handleOnSubmitComment(
|
|
1751
|
-
return
|
|
2062
|
+
return function handleOnSubmitComment(_x9) {
|
|
2063
|
+
return _ref17.apply(this, arguments);
|
|
1752
2064
|
};
|
|
1753
2065
|
}();
|
|
1754
2066
|
|
|
@@ -2069,7 +2381,30 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2069
2381
|
state: state,
|
|
2070
2382
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
2071
2383
|
headerTop: headerTop,
|
|
2072
|
-
children: [
|
|
2384
|
+
children: [pendingPropagation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PropagateChangesModal.PropagateChangesModal, {
|
|
2385
|
+
changedAttributes: pendingPropagation.cambios,
|
|
2386
|
+
variants: ((_family$variants = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants !== void 0 ? _family$variants : []).filter(function (v) {
|
|
2387
|
+
return !v.isCurrent;
|
|
2388
|
+
}),
|
|
2389
|
+
saving: state.saving,
|
|
2390
|
+
onCancel: function onCancel() {
|
|
2391
|
+
return setPendingPropagation(null);
|
|
2392
|
+
},
|
|
2393
|
+
onConfirm: function onConfirm(propagation) {
|
|
2394
|
+
setPendingPropagation(null);
|
|
2395
|
+
saveDatasheets(token, propagation !== null && propagation !== void 0 ? propagation : undefined);
|
|
2396
|
+
}
|
|
2397
|
+
}), showLinkVariants && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkVariantsModal.LinkVariantsModal, {
|
|
2398
|
+
articleId: (_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.id_article,
|
|
2399
|
+
articleName: (_state$product13 = state.product) === null || _state$product13 === void 0 ? void 0 : _state$product13.name,
|
|
2400
|
+
articleUpc: (_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.upc,
|
|
2401
|
+
activeRetailerId: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
|
|
2402
|
+
token: token,
|
|
2403
|
+
onClose: function onClose() {
|
|
2404
|
+
return setShowLinkVariants(false);
|
|
2405
|
+
},
|
|
2406
|
+
onLinked: handleOnLinkedVariants
|
|
2407
|
+
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2073
2408
|
title: rejectAll ? "Agregar mensaje para rechazar todo" : "Agregar mensaje de rechazo",
|
|
2074
2409
|
show: showRejectModal,
|
|
2075
2410
|
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
@@ -2089,21 +2424,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2089
2424
|
type: "pink",
|
|
2090
2425
|
label: "Aceptar",
|
|
2091
2426
|
size: 12,
|
|
2092
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2427
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
2093
2428
|
var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
|
|
2094
|
-
return _regenerator.default.wrap(function
|
|
2429
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
2095
2430
|
while (1) {
|
|
2096
|
-
switch (
|
|
2431
|
+
switch (_context15.prev = _context15.next) {
|
|
2097
2432
|
case 0:
|
|
2098
2433
|
elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
|
|
2099
2434
|
|
|
2100
2435
|
if (!(!elements || elements.length === 0)) {
|
|
2101
|
-
|
|
2436
|
+
_context15.next = 4;
|
|
2102
2437
|
break;
|
|
2103
2438
|
}
|
|
2104
2439
|
|
|
2105
2440
|
console.error("Elemento no encontrado");
|
|
2106
|
-
return
|
|
2441
|
+
return _context15.abrupt("return");
|
|
2107
2442
|
|
|
2108
2443
|
case 4:
|
|
2109
2444
|
isMessageEmpty = Array.from(elements).every(function (el) {
|
|
@@ -2112,7 +2447,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2112
2447
|
});
|
|
2113
2448
|
|
|
2114
2449
|
if (!isMessageEmpty) {
|
|
2115
|
-
|
|
2450
|
+
_context15.next = 10;
|
|
2116
2451
|
break;
|
|
2117
2452
|
}
|
|
2118
2453
|
|
|
@@ -2127,13 +2462,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2127
2462
|
container.appendChild(alert);
|
|
2128
2463
|
}
|
|
2129
2464
|
|
|
2130
|
-
return
|
|
2465
|
+
return _context15.abrupt("return");
|
|
2131
2466
|
|
|
2132
2467
|
case 10:
|
|
2133
2468
|
fullMessage = Array.from(elements).map(function (element) {
|
|
2134
2469
|
return element.innerHTML;
|
|
2135
2470
|
}).join("").replace(/<br\s*\/?>/gi, "\n");
|
|
2136
|
-
|
|
2471
|
+
_context15.next = 13;
|
|
2137
2472
|
return createComment(fullMessage, token);
|
|
2138
2473
|
|
|
2139
2474
|
case 13:
|
|
@@ -2142,10 +2477,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2142
2477
|
|
|
2143
2478
|
case 15:
|
|
2144
2479
|
case "end":
|
|
2145
|
-
return
|
|
2480
|
+
return _context15.stop();
|
|
2146
2481
|
}
|
|
2147
2482
|
}
|
|
2148
|
-
},
|
|
2483
|
+
}, _callee15);
|
|
2149
2484
|
}))
|
|
2150
2485
|
}, "btn-Aceptar")]
|
|
2151
2486
|
}), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
|
|
@@ -2206,8 +2541,8 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2206
2541
|
productSelected: state.product,
|
|
2207
2542
|
token: token,
|
|
2208
2543
|
activeRetailer: {
|
|
2209
|
-
id: (_state$
|
|
2210
|
-
name: (_state$
|
|
2544
|
+
id: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
|
|
2545
|
+
name: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.retailer
|
|
2211
2546
|
}
|
|
2212
2547
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2213
2548
|
className: "data-container",
|
|
@@ -2223,8 +2558,8 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2223
2558
|
lists: state.images_values || [],
|
|
2224
2559
|
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] : {},
|
|
2225
2560
|
assignationsImages: state.collaborator_assignations["Imágenes"],
|
|
2226
|
-
imagesStatus: ((_state$
|
|
2227
|
-
retailerSelected: (_state$
|
|
2561
|
+
imagesStatus: ((_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.images_status) || "-",
|
|
2562
|
+
retailerSelected: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.id_retailer,
|
|
2228
2563
|
isRetailer: isRetailer,
|
|
2229
2564
|
version: state.product.version,
|
|
2230
2565
|
shotThd: shotThd,
|
|
@@ -2238,15 +2573,104 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2238
2573
|
})]
|
|
2239
2574
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2240
2575
|
className: "product-information",
|
|
2241
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
2576
|
+
children: [!((_state$product16 = state.product) !== null && _state$product16 !== void 0 && _state$product16.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2577
|
+
className: "variants-actions",
|
|
2578
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
2579
|
+
type: "button",
|
|
2580
|
+
className: "link-variants",
|
|
2581
|
+
onClick: function onClick() {
|
|
2582
|
+
return setShowLinkVariants(true);
|
|
2583
|
+
},
|
|
2584
|
+
children: "Ligar productos"
|
|
2585
|
+
}), ((_state$product17 = state.product) === null || _state$product17 === void 0 ? void 0 : _state$product17.variantsCount) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2586
|
+
type: "button",
|
|
2587
|
+
className: "variants-count",
|
|
2588
|
+
"aria-expanded": showFamily,
|
|
2589
|
+
onClick: function onClick() {
|
|
2590
|
+
setShowFamily(function (abierto) {
|
|
2591
|
+
return !abierto;
|
|
2592
|
+
});
|
|
2593
|
+
loadFamily();
|
|
2594
|
+
},
|
|
2595
|
+
children: [state.product.variantsCount, " variante", state.product.variantsCount === 1 ? "" : "s", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2596
|
+
"aria-hidden": "true",
|
|
2597
|
+
children: showFamily ? " ▴" : " ▾"
|
|
2598
|
+
})]
|
|
2599
|
+
})]
|
|
2600
|
+
}), ((_state$product18 = state.product) === null || _state$product18 === void 0 ? void 0 : _state$product18.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2601
|
+
className: "variants-actions",
|
|
2602
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2603
|
+
type: "button",
|
|
2604
|
+
className: "variants-count",
|
|
2605
|
+
"aria-expanded": showFamily,
|
|
2606
|
+
onClick: function onClick() {
|
|
2607
|
+
setShowFamily(function (abierto) {
|
|
2608
|
+
return !abierto;
|
|
2609
|
+
});
|
|
2610
|
+
loadFamily();
|
|
2611
|
+
},
|
|
2612
|
+
children: ["Variante de otro producto", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2613
|
+
"aria-hidden": "true",
|
|
2614
|
+
children: showFamily ? " ▴" : " ▾"
|
|
2615
|
+
})]
|
|
2616
|
+
})
|
|
2617
|
+
}), showFamily && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2618
|
+
className: "variants-family",
|
|
2619
|
+
children: [!family && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
2620
|
+
className: "loading",
|
|
2621
|
+
children: "Cargando familia\u2026"
|
|
2622
|
+
}), (family === null || family === void 0 ? void 0 : family.error) && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
2623
|
+
className: "loading",
|
|
2624
|
+
children: "No se pudo cargar la familia de este producto."
|
|
2625
|
+
}), (family === null || family === void 0 ? void 0 : family.parent) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2626
|
+
type: "button",
|
|
2627
|
+
className: "family-row parent",
|
|
2628
|
+
disabled: loadingVariant !== null,
|
|
2629
|
+
onClick: function onClick() {
|
|
2630
|
+
return openVariant(family.parent.articleId);
|
|
2631
|
+
},
|
|
2632
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2633
|
+
className: "role",
|
|
2634
|
+
children: loadingVariant === family.parent.articleId ? "Abriendo…" : "Producto padre"
|
|
2635
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2636
|
+
className: "name",
|
|
2637
|
+
children: family.parent.name
|
|
2638
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2639
|
+
className: "upc",
|
|
2640
|
+
children: family.parent.upc
|
|
2641
|
+
})]
|
|
2642
|
+
}), family === null || family === void 0 ? void 0 : (_family$variants2 = family.variants) === null || _family$variants2 === void 0 ? void 0 : _family$variants2.map(function (variant) {
|
|
2643
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2644
|
+
type: "button",
|
|
2645
|
+
className: "family-row".concat(variant.isCurrent ? " current" : ""),
|
|
2646
|
+
disabled: variant.isCurrent || loadingVariant !== null,
|
|
2647
|
+
onClick: function onClick() {
|
|
2648
|
+
return openVariant(variant.articleId);
|
|
2649
|
+
},
|
|
2650
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2651
|
+
className: "role",
|
|
2652
|
+
children: loadingVariant === variant.articleId ? "Abriendo…" : variant.isCurrent ? "Estás aquí" : "Variante"
|
|
2653
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2654
|
+
className: "name",
|
|
2655
|
+
children: variant.name
|
|
2656
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2657
|
+
className: "upc",
|
|
2658
|
+
children: variant.upc
|
|
2659
|
+
})]
|
|
2660
|
+
}, variant.articleId);
|
|
2661
|
+
}), family && !family.error && !((_family$variants3 = family.variants) !== null && _family$variants3 !== void 0 && _family$variants3.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
2662
|
+
className: "loading",
|
|
2663
|
+
children: "Este producto no tiene variantes."
|
|
2664
|
+
})]
|
|
2665
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullProductNameHeader.FullProductNameHeader // states
|
|
2242
2666
|
, {
|
|
2243
2667
|
headerData: state.product,
|
|
2244
2668
|
productObservation: observation,
|
|
2245
2669
|
percent: (_state$active_percent = (_state$active_percent2 = state.active_percentage) === null || _state$active_percent2 === void 0 ? void 0 : (_state$active_percent3 = _state$active_percent2.percentagesGeneral) === null || _state$active_percent3 === void 0 ? void 0 : _state$active_percent3.required) !== null && _state$active_percent !== void 0 ? _state$active_percent : 0,
|
|
2246
2670
|
activeRetailer: {
|
|
2247
|
-
id: (_state$
|
|
2248
|
-
name: (_state$
|
|
2249
|
-
image: (_state$
|
|
2671
|
+
id: (_state$active_retaile9 = state.active_retailer) === null || _state$active_retaile9 === void 0 ? void 0 : _state$active_retaile9.id_retailer,
|
|
2672
|
+
name: (_state$active_retaile10 = state.active_retailer) === null || _state$active_retaile10 === void 0 ? void 0 : _state$active_retaile10.retailer,
|
|
2673
|
+
image: (_state$active_retaile11 = state.active_retailer) === null || _state$active_retaile11 === void 0 ? void 0 : _state$active_retaile11.image
|
|
2250
2674
|
},
|
|
2251
2675
|
servicesData: state.services_data ? state.services_data : null,
|
|
2252
2676
|
isObservationVisible: isObservationVisible // actions
|
|
@@ -2296,11 +2720,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2296
2720
|
className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
|
|
2297
2721
|
id: "services-information-container",
|
|
2298
2722
|
children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
2299
|
-
children: [state.active_tab === "Descripción" && (((_state$
|
|
2723
|
+
children: [state.active_tab === "Descripción" && (((_state$product19 = state.product) === null || _state$product19 === void 0 ? void 0 : _state$product19.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
2300
2724
|
activeSection: state.active_tab,
|
|
2301
2725
|
inputGroup: state.descriptions_inputs[0],
|
|
2302
2726
|
updatedDescriptions: state.updated_descriptions_inputs,
|
|
2303
|
-
articleId: (_state$
|
|
2727
|
+
articleId: (_state$product20 = state.product) === null || _state$product20 === void 0 ? void 0 : _state$product20.id_article,
|
|
2304
2728
|
version: state.product.version,
|
|
2305
2729
|
auditInputGroup: auditDescriptions[0],
|
|
2306
2730
|
setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
|
|
@@ -2309,14 +2733,18 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2309
2733
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2310
2734
|
text: "No cuentas con este servicio",
|
|
2311
2735
|
headerType: "input-name-header"
|
|
2312
|
-
})), state.active_tab === "Ficha técnica" && (((_state$
|
|
2736
|
+
})), state.active_tab === "Ficha técnica" && (((_state$product21 = state.product) === null || _state$product21 === void 0 ? void 0 : _state$product21.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
2313
2737
|
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) {
|
|
2738
|
+
var _state$services2, _state$services2$data;
|
|
2739
|
+
|
|
2314
2740
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
2315
2741
|
articleId: state.product.id_article,
|
|
2316
2742
|
version: state.version,
|
|
2317
2743
|
activeSection: state.active_tab,
|
|
2318
2744
|
inputGroup: dataGroup,
|
|
2319
2745
|
dataInputs: state.datasheets_inputs[1],
|
|
2746
|
+
variant: (_state$services2 = state.services) === null || _state$services2 === void 0 ? void 0 : (_state$services2$data = _state$services2.datasheets) === null || _state$services2$data === void 0 ? void 0 : _state$services2$data.variant,
|
|
2747
|
+
onRestoreInheritance: handleOnRestoreInheritance,
|
|
2320
2748
|
auditInputs: auditDatasheets[1],
|
|
2321
2749
|
updatedDatasheets: state.updated_datasheets_inputs,
|
|
2322
2750
|
setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
|
|
@@ -2326,7 +2754,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2326
2754
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2327
2755
|
text: "No cuentas con este servicio",
|
|
2328
2756
|
headerType: "input-name-header"
|
|
2329
|
-
})), state.active_tab === "Imágenes" && (((_state$
|
|
2757
|
+
})), state.active_tab === "Imágenes" && (((_state$product22 = state.product) === null || _state$product22 === void 0 ? void 0 : _state$product22.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
2330
2758
|
children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
|
|
2331
2759
|
checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
|
|
2332
2760
|
,
|
|
@@ -2418,20 +2846,20 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2418
2846
|
reviewed: crossComment
|
|
2419
2847
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2420
2848
|
buttonType: "circular-button accept-button",
|
|
2421
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2422
|
-
return _regenerator.default.wrap(function
|
|
2849
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2850
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2423
2851
|
while (1) {
|
|
2424
|
-
switch (
|
|
2852
|
+
switch (_context16.prev = _context16.next) {
|
|
2425
2853
|
case 0:
|
|
2426
2854
|
setCrossComment(true);
|
|
2427
2855
|
commentRevised();
|
|
2428
2856
|
|
|
2429
2857
|
case 2:
|
|
2430
2858
|
case "end":
|
|
2431
|
-
return
|
|
2859
|
+
return _context16.stop();
|
|
2432
2860
|
}
|
|
2433
2861
|
}
|
|
2434
|
-
},
|
|
2862
|
+
}, _callee16);
|
|
2435
2863
|
}))
|
|
2436
2864
|
})]
|
|
2437
2865
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|