contentoh-components-library 21.6.34 → 21.6.35
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/index.js +325 -192
- package/dist/components/pages/RetailerProductEdition/styles.js +2 -2
- package/dist/components/pages/RetailerProductEdition/utils.js +8 -3
- package/package.json +1 -1
- package/src/components/pages/RetailerProductEdition/index.js +123 -19
- package/src/components/pages/RetailerProductEdition/styles.js +11 -0
- package/src/components/pages/RetailerProductEdition/utils.js +10 -3
- package/.claude/launch.json +0 -15
- package/dist/ai/prompts/attribute.prompt.js +0 -28
- package/dist/ai/prompts/description.prompt.js +0 -33
- package/dist/ai/schemas/attribute.schema.js +0 -35
- package/dist/ai/schemas/description.schema.js +0 -27
|
@@ -160,75 +160,75 @@ function regenerateVideoThumbnails(_x) {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
function _regenerateVideoThumbnails() {
|
|
163
|
-
_regenerateVideoThumbnails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
164
|
-
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) {
|
|
165
165
|
while (1) {
|
|
166
|
-
switch (
|
|
166
|
+
switch (_context18.prev = _context18.next) {
|
|
167
167
|
case 0:
|
|
168
168
|
if (Array.isArray(values)) {
|
|
169
|
-
|
|
169
|
+
_context18.next = 2;
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
return
|
|
173
|
+
return _context18.abrupt("return", values);
|
|
174
174
|
|
|
175
175
|
case 2:
|
|
176
|
-
return
|
|
177
|
-
var
|
|
176
|
+
return _context18.abrupt("return", Promise.all(values.map( /*#__PURE__*/function () {
|
|
177
|
+
var _ref21 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(value) {
|
|
178
178
|
var base64, videoSrc, thumbnail;
|
|
179
|
-
return _regenerator.default.wrap(function
|
|
179
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
180
180
|
while (1) {
|
|
181
|
-
switch (
|
|
181
|
+
switch (_context17.prev = _context17.next) {
|
|
182
182
|
case 0:
|
|
183
183
|
if (!((value === null || value === void 0 ? void 0 : value.ext) !== "mp4" || !(value !== null && value !== void 0 && value.srcDB))) {
|
|
184
|
-
|
|
184
|
+
_context17.next = 2;
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
return
|
|
188
|
+
return _context17.abrupt("return", value);
|
|
189
189
|
|
|
190
190
|
case 2:
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
_context17.prev = 2;
|
|
192
|
+
_context17.next = 5;
|
|
193
193
|
return convertirVideoABase64("https://" + process.env.REACT_APP_IMAGES_BUCKET + ".s3.amazonaws.com/" + value.srcDB);
|
|
194
194
|
|
|
195
195
|
case 5:
|
|
196
|
-
base64 =
|
|
196
|
+
base64 = _context17.sent;
|
|
197
197
|
videoSrc = "data:video/mp4;base64," + base64.split(",")[1];
|
|
198
|
-
|
|
198
|
+
_context17.next = 9;
|
|
199
199
|
return (0, _generateThumnail.default)(videoSrc, 2);
|
|
200
200
|
|
|
201
201
|
case 9:
|
|
202
|
-
thumbnail =
|
|
203
|
-
return
|
|
202
|
+
thumbnail = _context17.sent;
|
|
203
|
+
return _context17.abrupt("return", (0, _objectSpread5.default)((0, _objectSpread5.default)({}, value), {}, {
|
|
204
204
|
src: thumbnail
|
|
205
205
|
}));
|
|
206
206
|
|
|
207
207
|
case 13:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
console.error("Error al generar thumbnail del video:",
|
|
211
|
-
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);
|
|
212
212
|
|
|
213
213
|
case 17:
|
|
214
214
|
case "end":
|
|
215
|
-
return
|
|
215
|
+
return _context17.stop();
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
},
|
|
218
|
+
}, _callee17, null, [[2, 13]]);
|
|
219
219
|
}));
|
|
220
220
|
|
|
221
|
-
return function (
|
|
222
|
-
return
|
|
221
|
+
return function (_x10) {
|
|
222
|
+
return _ref21.apply(this, arguments);
|
|
223
223
|
};
|
|
224
224
|
}())));
|
|
225
225
|
|
|
226
226
|
case 3:
|
|
227
227
|
case "end":
|
|
228
|
-
return
|
|
228
|
+
return _context18.stop();
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
},
|
|
231
|
+
}, _callee18);
|
|
232
232
|
}));
|
|
233
233
|
return _regenerateVideoThumbnails.apply(this, arguments);
|
|
234
234
|
}
|
|
@@ -330,38 +330,50 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
330
330
|
|
|
331
331
|
var _useState27 = (0, _react.useState)(null),
|
|
332
332
|
_useState28 = (0, _slicedToArray2.default)(_useState27, 2),
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
loadingVariant = _useState28[0],
|
|
334
|
+
setLoadingVariant = _useState28[1]; // Por qué un salto no se pudo hacer. Vive aparte de `family.error` porque no
|
|
335
|
+
// es un fallo al leer la familia, sino al abrir uno de sus miembros.
|
|
335
336
|
|
|
336
|
-
|
|
337
|
+
|
|
338
|
+
var _useState29 = (0, _react.useState)(null),
|
|
337
339
|
_useState30 = (0, _slicedToArray2.default)(_useState29, 2),
|
|
338
|
-
|
|
339
|
-
|
|
340
|
+
avisoFamilia = _useState30[0],
|
|
341
|
+
setAvisoFamilia = _useState30[1];
|
|
340
342
|
|
|
341
|
-
var _useState31 = (0, _react.useState)(
|
|
343
|
+
var _useState31 = (0, _react.useState)(null),
|
|
342
344
|
_useState32 = (0, _slicedToArray2.default)(_useState31, 2),
|
|
343
|
-
|
|
344
|
-
|
|
345
|
+
pendingPropagation = _useState32[0],
|
|
346
|
+
setPendingPropagation = _useState32[1];
|
|
345
347
|
|
|
346
|
-
var _useState33 = (0, _react.useState)(
|
|
348
|
+
var _useState33 = (0, _react.useState)(false),
|
|
347
349
|
_useState34 = (0, _slicedToArray2.default)(_useState33, 2),
|
|
348
|
-
|
|
349
|
-
|
|
350
|
+
preparandoPropagacion = _useState34[0],
|
|
351
|
+
setPreparandoPropagacion = _useState34[1];
|
|
350
352
|
|
|
351
353
|
var _useState35 = (0, _react.useState)([]),
|
|
352
354
|
_useState36 = (0, _slicedToArray2.default)(_useState35, 2),
|
|
353
|
-
|
|
354
|
-
|
|
355
|
+
auditServices = _useState36[0],
|
|
356
|
+
setAuditServices = _useState36[1];
|
|
355
357
|
|
|
356
|
-
var _useState37 = (0, _react.useState)(
|
|
358
|
+
var _useState37 = (0, _react.useState)([]),
|
|
357
359
|
_useState38 = (0, _slicedToArray2.default)(_useState37, 2),
|
|
358
|
-
|
|
359
|
-
|
|
360
|
+
auditDatasheets = _useState38[0],
|
|
361
|
+
setAuditDatasheets = _useState38[1];
|
|
360
362
|
|
|
361
|
-
var _useState39 = (0, _react.useState)(
|
|
363
|
+
var _useState39 = (0, _react.useState)([]),
|
|
362
364
|
_useState40 = (0, _slicedToArray2.default)(_useState39, 2),
|
|
363
|
-
|
|
364
|
-
|
|
365
|
+
auditDescriptions = _useState40[0],
|
|
366
|
+
setAuditDescriptions = _useState40[1];
|
|
367
|
+
|
|
368
|
+
var _useState41 = (0, _react.useState)(false),
|
|
369
|
+
_useState42 = (0, _slicedToArray2.default)(_useState41, 2),
|
|
370
|
+
showModal = _useState42[0],
|
|
371
|
+
setShowModal = _useState42[1];
|
|
372
|
+
|
|
373
|
+
var _useState43 = (0, _react.useState)(false),
|
|
374
|
+
_useState44 = (0, _slicedToArray2.default)(_useState43, 2),
|
|
375
|
+
compare = _useState44[0],
|
|
376
|
+
setCompare = _useState44[1];
|
|
365
377
|
|
|
366
378
|
var _useDropzone = (0, _reactDropzone.useDropzone)({
|
|
367
379
|
accept: "image/*, video/mp4",
|
|
@@ -497,10 +509,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
497
509
|
isDragActive = _useDropzone.isDragActive,
|
|
498
510
|
open = _useDropzone.open;
|
|
499
511
|
|
|
500
|
-
var
|
|
501
|
-
|
|
502
|
-
openChangeStatusModal =
|
|
503
|
-
setOpenChangeStatusModal =
|
|
512
|
+
var _useState45 = (0, _react.useState)(false),
|
|
513
|
+
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
514
|
+
openChangeStatusModal = _useState46[0],
|
|
515
|
+
setOpenChangeStatusModal = _useState46[1];
|
|
504
516
|
|
|
505
517
|
var thumbs = function thumbs() {
|
|
506
518
|
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;
|
|
@@ -1220,24 +1232,109 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1220
1232
|
}).length;
|
|
1221
1233
|
var esHijoDeOtro = family !== null && family !== void 0 && family.error ? !!((_state$product11 = state.product) !== null && _state$product11 !== void 0 && _state$product11.parentArticleId) : !!(family !== null && family !== void 0 && family.parent);
|
|
1222
1234
|
/*
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
de
|
|
1235
|
+
Abre otro producto de la familia.
|
|
1236
|
+
Cambiar la URL no basta: esta pantalla no lee el producto de la ruta sino de
|
|
1237
|
+
sessionStorage —el router hace JSON.parse(sessionStorage.productSelected) y
|
|
1238
|
+
se lo pasa como prop—, así que navegar sin precargar dejaría la URL nueva
|
|
1239
|
+
mostrando el producto anterior. Por eso primero se trae el destino y se
|
|
1240
|
+
escriben las tres llaves que el listado escribe al hacer clic en una fila
|
|
1241
|
+
(productSelected, version, productEdit), y solo entonces se navega.
|
|
1242
|
+
Se pide a /ordered-services y no a read-articles-v2, que es lo que usa la
|
|
1243
|
+
aplicación de clientes: aquel filtra por la compañía del usuario y el equipo
|
|
1244
|
+
interno es de ContentOh trabajando productos de sus clientes, así que ahí no
|
|
1245
|
+
devolvería nada. /ordered-services es el mismo endpoint del listado de esta
|
|
1246
|
+
aplicación, así que el objeto llega con la forma exacta que normalizeProduct
|
|
1247
|
+
espera —con `article` anidado, `statusByRetailer` y `categoryRetailer`—.
|
|
1248
|
+
Un producto de la familia puede no estar en ninguna orden de trabajo: la
|
|
1249
|
+
relación padre/hijo vive en `article` y no exige haber pasado por ContentOh.
|
|
1250
|
+
En ese caso no hay nada que abrir aquí, y se dice en vez de navegar a una
|
|
1251
|
+
pantalla que mostraría el producto equivocado.
|
|
1233
1252
|
*/
|
|
1234
1253
|
|
|
1254
|
+
var openFamilyMember = /*#__PURE__*/function () {
|
|
1255
|
+
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(articleId) {
|
|
1256
|
+
var _readPayload, res, _ref10, data, encontrado;
|
|
1257
|
+
|
|
1258
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1259
|
+
while (1) {
|
|
1260
|
+
switch (_context6.prev = _context6.next) {
|
|
1261
|
+
case 0:
|
|
1262
|
+
setLoadingVariant(articleId);
|
|
1263
|
+
setAvisoFamilia(null);
|
|
1264
|
+
_context6.prev = 2;
|
|
1265
|
+
_context6.next = 5;
|
|
1266
|
+
return _axios.default.get("".concat(process.env.REACT_APP_ORDERED_SERVICES_ENDPOINT), {
|
|
1267
|
+
params: {
|
|
1268
|
+
filterByIdArticle: articleId,
|
|
1269
|
+
includeFilters: false
|
|
1270
|
+
},
|
|
1271
|
+
headers: {
|
|
1272
|
+
Authorization: token
|
|
1273
|
+
}
|
|
1274
|
+
});
|
|
1275
|
+
|
|
1276
|
+
case 5:
|
|
1277
|
+
res = _context6.sent;
|
|
1278
|
+
// read-order-services responde { total, data: [...] }. La vista trae una
|
|
1279
|
+
// fila por orden, así que puede haber varias del mismo artículo; llegan
|
|
1280
|
+
// ordenadas por order_id DESC y la primera es la orden más reciente.
|
|
1281
|
+
_ref10 = (_readPayload = (0, _api.readPayload)(res)) !== null && _readPayload !== void 0 ? _readPayload : {}, data = _ref10.data;
|
|
1282
|
+
encontrado = (data !== null && data !== void 0 ? data : []).find(function (item) {
|
|
1283
|
+
var _item$article;
|
|
1284
|
+
|
|
1285
|
+
return Number(item === null || item === void 0 ? void 0 : (_item$article = item.article) === null || _item$article === void 0 ? void 0 : _item$article.id_article) === Number(articleId);
|
|
1286
|
+
});
|
|
1287
|
+
|
|
1288
|
+
if (encontrado) {
|
|
1289
|
+
_context6.next = 11;
|
|
1290
|
+
break;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
setAvisoFamilia("Ese producto no está en ninguna orden de trabajo, así que no se puede abrir desde aquí.");
|
|
1294
|
+
return _context6.abrupt("return");
|
|
1295
|
+
|
|
1296
|
+
case 11:
|
|
1297
|
+
sessionStorage.setItem("productSelected", JSON.stringify(encontrado));
|
|
1298
|
+
sessionStorage.setItem("version", JSON.stringify(encontrado.version));
|
|
1299
|
+
sessionStorage.setItem("productEdit", JSON.stringify({
|
|
1300
|
+
ArticleId: encontrado.article.id_article,
|
|
1301
|
+
categoryId: encontrado.article.id_article,
|
|
1302
|
+
product: [encontrado]
|
|
1303
|
+
}));
|
|
1304
|
+
window.location.assign("/EditProducts");
|
|
1305
|
+
_context6.next = 21;
|
|
1306
|
+
break;
|
|
1307
|
+
|
|
1308
|
+
case 17:
|
|
1309
|
+
_context6.prev = 17;
|
|
1310
|
+
_context6.t0 = _context6["catch"](2);
|
|
1311
|
+
console.error("openFamilyMember: ", _context6.t0);
|
|
1312
|
+
setAvisoFamilia("No se pudo abrir ese producto. Intenta de nuevo.");
|
|
1313
|
+
|
|
1314
|
+
case 21:
|
|
1315
|
+
_context6.prev = 21;
|
|
1316
|
+
setLoadingVariant(null);
|
|
1317
|
+
return _context6.finish(21);
|
|
1318
|
+
|
|
1319
|
+
case 24:
|
|
1320
|
+
case "end":
|
|
1321
|
+
return _context6.stop();
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
}, _callee6, null, [[2, 17, 21, 24]]);
|
|
1325
|
+
}));
|
|
1326
|
+
|
|
1327
|
+
return function openFamilyMember(_x3) {
|
|
1328
|
+
return _ref9.apply(this, arguments);
|
|
1329
|
+
};
|
|
1330
|
+
}();
|
|
1235
1331
|
/*
|
|
1236
1332
|
Refresca tras ligar, sin recargar la página: el producto sale de
|
|
1237
1333
|
sessionStorage, así que un F5 devolvería el mismo objeto y el contador
|
|
1238
1334
|
seguiría igual.
|
|
1239
1335
|
*/
|
|
1240
1336
|
|
|
1337
|
+
|
|
1241
1338
|
var handleOnLinkedVariants = function handleOnLinkedVariants(result) {
|
|
1242
1339
|
var _state$product$varian, _state$product12, _result$linked, _result$parentArticle;
|
|
1243
1340
|
|
|
@@ -1252,10 +1349,33 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1252
1349
|
type: "SET_PRODUCT",
|
|
1253
1350
|
payload: updatedProduct
|
|
1254
1351
|
});
|
|
1352
|
+
/*
|
|
1353
|
+
En sessionStorage se PARCHEA lo guardado; no se reemplaza.
|
|
1354
|
+
Lo que hay ahí es el producto tal como lo devuelve el listado de esta
|
|
1355
|
+
aplicación: con `article` anidado, `statusByRetailer`, `categoryRetailer`
|
|
1356
|
+
y los servicios. `updatedProduct` es la versión aplanada que usa esta
|
|
1357
|
+
pantalla, y escribirla encima tiraba todo eso: al siguiente F5 la ficha se
|
|
1358
|
+
reconstruía desde un objeto mutilado —sin relaciones de cadena, sin
|
|
1359
|
+
estatus por cadena— aunque en pantalla se viera bien hasta entonces.
|
|
1360
|
+
De ligar solo cambian dos cosas, y son las dos que se copian aquí.
|
|
1361
|
+
*/
|
|
1255
1362
|
|
|
1256
1363
|
try {
|
|
1257
|
-
|
|
1364
|
+
var _sessionStorage$getIt;
|
|
1365
|
+
|
|
1366
|
+
var guardado = JSON.parse((_sessionStorage$getIt = sessionStorage.getItem("productSelected")) !== null && _sessionStorage$getIt !== void 0 ? _sessionStorage$getIt : "null");
|
|
1367
|
+
|
|
1368
|
+
if (guardado) {
|
|
1369
|
+
var _updatedProduct$paren;
|
|
1370
|
+
|
|
1371
|
+
sessionStorage.setItem("productSelected", JSON.stringify((0, _objectSpread5.default)((0, _objectSpread5.default)({}, guardado), {}, {
|
|
1372
|
+
variantsCount: updatedProduct.variantsCount,
|
|
1373
|
+
parentArticleId: (_updatedProduct$paren = updatedProduct.parentArticleId) !== null && _updatedProduct$paren !== void 0 ? _updatedProduct$paren : null
|
|
1374
|
+
})));
|
|
1375
|
+
}
|
|
1258
1376
|
} catch (error) {
|
|
1377
|
+
// Un sessionStorage inaccesible no debe tumbar la pantalla: el estado en
|
|
1378
|
+
// memoria ya quedó bien y es lo que el usuario está viendo.
|
|
1259
1379
|
console.error("linkVariants/sessionStorage: ", error);
|
|
1260
1380
|
}
|
|
1261
1381
|
/*
|
|
@@ -1294,31 +1414,31 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1294
1414
|
|
|
1295
1415
|
|
|
1296
1416
|
var handleOnRestoreInheritance = /*#__PURE__*/function () {
|
|
1297
|
-
var
|
|
1417
|
+
var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(attributeId) {
|
|
1298
1418
|
var _state$product13;
|
|
1299
1419
|
|
|
1300
1420
|
var kind,
|
|
1301
1421
|
esDescripcion,
|
|
1302
1422
|
res,
|
|
1303
1423
|
data,
|
|
1304
|
-
|
|
1305
|
-
return _regenerator.default.wrap(function
|
|
1424
|
+
_args7 = arguments;
|
|
1425
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
1306
1426
|
while (1) {
|
|
1307
|
-
switch (
|
|
1427
|
+
switch (_context7.prev = _context7.next) {
|
|
1308
1428
|
case 0:
|
|
1309
|
-
kind =
|
|
1429
|
+
kind = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : "attribute";
|
|
1310
1430
|
|
|
1311
1431
|
if (!(!attributeId || !((_state$product13 = state.product) !== null && _state$product13 !== void 0 && _state$product13.id_article))) {
|
|
1312
|
-
|
|
1432
|
+
_context7.next = 3;
|
|
1313
1433
|
break;
|
|
1314
1434
|
}
|
|
1315
1435
|
|
|
1316
|
-
return
|
|
1436
|
+
return _context7.abrupt("return");
|
|
1317
1437
|
|
|
1318
1438
|
case 3:
|
|
1319
1439
|
esDescripcion = kind === "description";
|
|
1320
|
-
|
|
1321
|
-
|
|
1440
|
+
_context7.prev = 4;
|
|
1441
|
+
_context7.next = 7;
|
|
1322
1442
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/restore"), (0, _objectSpread5.default)({
|
|
1323
1443
|
articleId: state.product.id_article
|
|
1324
1444
|
}, esDescripcion ? {
|
|
@@ -1332,11 +1452,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1332
1452
|
});
|
|
1333
1453
|
|
|
1334
1454
|
case 7:
|
|
1335
|
-
res =
|
|
1455
|
+
res = _context7.sent;
|
|
1336
1456
|
data = (0, _api.readPayload)(res);
|
|
1337
1457
|
|
|
1338
1458
|
if (!esDescripcion) {
|
|
1339
|
-
|
|
1459
|
+
_context7.next = 12;
|
|
1340
1460
|
break;
|
|
1341
1461
|
}
|
|
1342
1462
|
|
|
@@ -1350,7 +1470,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1350
1470
|
};
|
|
1351
1471
|
})
|
|
1352
1472
|
});
|
|
1353
|
-
return
|
|
1473
|
+
return _context7.abrupt("return");
|
|
1354
1474
|
|
|
1355
1475
|
case 12:
|
|
1356
1476
|
dispatch({
|
|
@@ -1363,24 +1483,24 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1363
1483
|
};
|
|
1364
1484
|
})
|
|
1365
1485
|
});
|
|
1366
|
-
|
|
1486
|
+
_context7.next = 18;
|
|
1367
1487
|
break;
|
|
1368
1488
|
|
|
1369
1489
|
case 15:
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
console.error("restoreInheritance: ",
|
|
1490
|
+
_context7.prev = 15;
|
|
1491
|
+
_context7.t0 = _context7["catch"](4);
|
|
1492
|
+
console.error("restoreInheritance: ", _context7.t0);
|
|
1373
1493
|
|
|
1374
1494
|
case 18:
|
|
1375
1495
|
case "end":
|
|
1376
|
-
return
|
|
1496
|
+
return _context7.stop();
|
|
1377
1497
|
}
|
|
1378
1498
|
}
|
|
1379
|
-
},
|
|
1499
|
+
}, _callee7, null, [[4, 15]]);
|
|
1380
1500
|
}));
|
|
1381
1501
|
|
|
1382
|
-
return function handleOnRestoreInheritance(
|
|
1383
|
-
return
|
|
1502
|
+
return function handleOnRestoreInheritance(_x4) {
|
|
1503
|
+
return _ref11.apply(this, arguments);
|
|
1384
1504
|
};
|
|
1385
1505
|
}();
|
|
1386
1506
|
/*
|
|
@@ -1407,30 +1527,30 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1407
1527
|
};
|
|
1408
1528
|
|
|
1409
1529
|
var handleOnClickSave = /*#__PURE__*/function () {
|
|
1410
|
-
var
|
|
1530
|
+
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1411
1531
|
var esPadre, cambios;
|
|
1412
|
-
return _regenerator.default.wrap(function
|
|
1532
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
1413
1533
|
while (1) {
|
|
1414
|
-
switch (
|
|
1534
|
+
switch (_context8.prev = _context8.next) {
|
|
1415
1535
|
case 0:
|
|
1416
1536
|
if (!(state.saving || preparandoPropagacion)) {
|
|
1417
|
-
|
|
1537
|
+
_context8.next = 2;
|
|
1418
1538
|
break;
|
|
1419
1539
|
}
|
|
1420
1540
|
|
|
1421
|
-
return
|
|
1541
|
+
return _context8.abrupt("return");
|
|
1422
1542
|
|
|
1423
1543
|
case 2:
|
|
1424
|
-
|
|
1425
|
-
|
|
1544
|
+
_context8.t0 = state.active_tab;
|
|
1545
|
+
_context8.next = _context8.t0 === "Descripción" ? 5 : _context8.t0 === "Ficha técnica" ? 8 : _context8.t0 === "Imágenes" ? 17 : 20;
|
|
1426
1546
|
break;
|
|
1427
1547
|
|
|
1428
1548
|
case 5:
|
|
1429
|
-
|
|
1549
|
+
_context8.next = 7;
|
|
1430
1550
|
return saveDescriptions(token);
|
|
1431
1551
|
|
|
1432
1552
|
case 7:
|
|
1433
|
-
return
|
|
1553
|
+
return _context8.abrupt("break", 21);
|
|
1434
1554
|
|
|
1435
1555
|
case 8:
|
|
1436
1556
|
// Guardar un padre con hijos abre la decisión de propagar. Sin este
|
|
@@ -1440,7 +1560,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1440
1560
|
cambios = cambiosDeFichaTecnica();
|
|
1441
1561
|
|
|
1442
1562
|
if (!(esPadre && cambios.length > 0)) {
|
|
1443
|
-
|
|
1563
|
+
_context8.next = 14;
|
|
1444
1564
|
break;
|
|
1445
1565
|
}
|
|
1446
1566
|
|
|
@@ -1452,39 +1572,39 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1452
1572
|
}).finally(function () {
|
|
1453
1573
|
return setPreparandoPropagacion(false);
|
|
1454
1574
|
});
|
|
1455
|
-
return
|
|
1575
|
+
return _context8.abrupt("return");
|
|
1456
1576
|
|
|
1457
1577
|
case 14:
|
|
1458
|
-
|
|
1578
|
+
_context8.next = 16;
|
|
1459
1579
|
return saveDatasheets(token);
|
|
1460
1580
|
|
|
1461
1581
|
case 16:
|
|
1462
|
-
return
|
|
1582
|
+
return _context8.abrupt("break", 21);
|
|
1463
1583
|
|
|
1464
1584
|
case 17:
|
|
1465
|
-
|
|
1585
|
+
_context8.next = 19;
|
|
1466
1586
|
return updateImages(token);
|
|
1467
1587
|
|
|
1468
1588
|
case 19:
|
|
1469
|
-
return
|
|
1589
|
+
return _context8.abrupt("break", 21);
|
|
1470
1590
|
|
|
1471
1591
|
case 20:
|
|
1472
|
-
return
|
|
1592
|
+
return _context8.abrupt("break", 21);
|
|
1473
1593
|
|
|
1474
1594
|
case 21:
|
|
1475
|
-
|
|
1595
|
+
_context8.next = 23;
|
|
1476
1596
|
return loadData(false);
|
|
1477
1597
|
|
|
1478
1598
|
case 23:
|
|
1479
1599
|
case "end":
|
|
1480
|
-
return
|
|
1600
|
+
return _context8.stop();
|
|
1481
1601
|
}
|
|
1482
1602
|
}
|
|
1483
|
-
},
|
|
1603
|
+
}, _callee8);
|
|
1484
1604
|
}));
|
|
1485
1605
|
|
|
1486
1606
|
return function handleOnClickSave() {
|
|
1487
|
-
return
|
|
1607
|
+
return _ref12.apply(this, arguments);
|
|
1488
1608
|
};
|
|
1489
1609
|
}();
|
|
1490
1610
|
|
|
@@ -1552,24 +1672,24 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1552
1672
|
};
|
|
1553
1673
|
|
|
1554
1674
|
var handleOnApproveSingleService = /*#__PURE__*/function () {
|
|
1555
|
-
var
|
|
1556
|
-
return _regenerator.default.wrap(function
|
|
1675
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
1676
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1557
1677
|
while (1) {
|
|
1558
|
-
switch (
|
|
1678
|
+
switch (_context9.prev = _context9.next) {
|
|
1559
1679
|
case 0:
|
|
1560
|
-
|
|
1680
|
+
_context9.next = 2;
|
|
1561
1681
|
return sendSingleEvaluation("A");
|
|
1562
1682
|
|
|
1563
1683
|
case 2:
|
|
1564
1684
|
case "end":
|
|
1565
|
-
return
|
|
1685
|
+
return _context9.stop();
|
|
1566
1686
|
}
|
|
1567
1687
|
}
|
|
1568
|
-
},
|
|
1688
|
+
}, _callee9);
|
|
1569
1689
|
}));
|
|
1570
1690
|
|
|
1571
1691
|
return function handleOnApproveSingleService() {
|
|
1572
|
-
return
|
|
1692
|
+
return _ref13.apply(this, arguments);
|
|
1573
1693
|
};
|
|
1574
1694
|
}();
|
|
1575
1695
|
|
|
@@ -1578,21 +1698,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1578
1698
|
};
|
|
1579
1699
|
|
|
1580
1700
|
var sendSingleEvaluation = /*#__PURE__*/function () {
|
|
1581
|
-
var
|
|
1701
|
+
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(result) {
|
|
1582
1702
|
var _state$product$id_ord, _state$active_retaile4;
|
|
1583
1703
|
|
|
1584
1704
|
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;
|
|
1585
1705
|
|
|
1586
|
-
return _regenerator.default.wrap(function
|
|
1706
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
1587
1707
|
while (1) {
|
|
1588
|
-
switch (
|
|
1708
|
+
switch (_context10.prev = _context10.next) {
|
|
1589
1709
|
case 0:
|
|
1590
1710
|
if (!state.saving) {
|
|
1591
|
-
|
|
1711
|
+
_context10.next = 2;
|
|
1592
1712
|
break;
|
|
1593
1713
|
}
|
|
1594
1714
|
|
|
1595
|
-
return
|
|
1715
|
+
return _context10.abrupt("return");
|
|
1596
1716
|
|
|
1597
1717
|
case 2:
|
|
1598
1718
|
dispatch({
|
|
@@ -1613,16 +1733,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1613
1733
|
retailerId: retailerId
|
|
1614
1734
|
};
|
|
1615
1735
|
activeTab = state.active_tab;
|
|
1616
|
-
|
|
1736
|
+
_context10.prev = 11;
|
|
1617
1737
|
|
|
1618
1738
|
if (!result) {
|
|
1619
|
-
|
|
1739
|
+
_context10.next = 28;
|
|
1620
1740
|
break;
|
|
1621
1741
|
}
|
|
1622
1742
|
|
|
1623
1743
|
data.result = result;
|
|
1624
1744
|
data.retailerId = retailerId;
|
|
1625
|
-
|
|
1745
|
+
_context10.next = 17;
|
|
1626
1746
|
return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1627
1747
|
headers: {
|
|
1628
1748
|
Authorization: token
|
|
@@ -1630,7 +1750,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1630
1750
|
});
|
|
1631
1751
|
|
|
1632
1752
|
case 17:
|
|
1633
|
-
res =
|
|
1753
|
+
res = _context10.sent;
|
|
1634
1754
|
newStatuses = JSON.parse(res.data.body);
|
|
1635
1755
|
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1636
1756
|
articleStatus = newStatuses.newArticleStatus[articleId];
|
|
@@ -1661,7 +1781,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1661
1781
|
image: _genericModalCheck.default
|
|
1662
1782
|
}
|
|
1663
1783
|
});
|
|
1664
|
-
|
|
1784
|
+
_context10.next = 33;
|
|
1665
1785
|
break;
|
|
1666
1786
|
|
|
1667
1787
|
case 28:
|
|
@@ -1677,7 +1797,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1677
1797
|
icon = _genericModalCheck.default;
|
|
1678
1798
|
}
|
|
1679
1799
|
|
|
1680
|
-
|
|
1800
|
+
_context10.next = 32;
|
|
1681
1801
|
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1682
1802
|
headers: {
|
|
1683
1803
|
Authorization: token
|
|
@@ -1685,7 +1805,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1685
1805
|
});
|
|
1686
1806
|
|
|
1687
1807
|
case 32:
|
|
1688
|
-
res =
|
|
1808
|
+
res = _context10.sent;
|
|
1689
1809
|
|
|
1690
1810
|
case 33:
|
|
1691
1811
|
if (res.data.statusCode === 200) {
|
|
@@ -1770,13 +1890,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1770
1890
|
});
|
|
1771
1891
|
}
|
|
1772
1892
|
|
|
1773
|
-
|
|
1893
|
+
_context10.next = 40;
|
|
1774
1894
|
break;
|
|
1775
1895
|
|
|
1776
1896
|
case 36:
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
console.error("Error sending evaluation:",
|
|
1897
|
+
_context10.prev = 36;
|
|
1898
|
+
_context10.t0 = _context10["catch"](11);
|
|
1899
|
+
console.error("Error sending evaluation:", _context10.t0);
|
|
1780
1900
|
dispatch({
|
|
1781
1901
|
type: "SET_MODAL",
|
|
1782
1902
|
payload: {
|
|
@@ -1788,45 +1908,45 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1788
1908
|
});
|
|
1789
1909
|
|
|
1790
1910
|
case 40:
|
|
1791
|
-
|
|
1911
|
+
_context10.prev = 40;
|
|
1792
1912
|
dispatch({
|
|
1793
1913
|
type: "SET_SAVING",
|
|
1794
1914
|
payload: false
|
|
1795
1915
|
});
|
|
1796
|
-
return
|
|
1916
|
+
return _context10.finish(40);
|
|
1797
1917
|
|
|
1798
1918
|
case 43:
|
|
1799
1919
|
case "end":
|
|
1800
|
-
return
|
|
1920
|
+
return _context10.stop();
|
|
1801
1921
|
}
|
|
1802
1922
|
}
|
|
1803
|
-
},
|
|
1923
|
+
}, _callee10, null, [[11, 36, 40, 43]]);
|
|
1804
1924
|
}));
|
|
1805
1925
|
|
|
1806
|
-
return function sendSingleEvaluation(
|
|
1807
|
-
return
|
|
1926
|
+
return function sendSingleEvaluation(_x5) {
|
|
1927
|
+
return _ref14.apply(this, arguments);
|
|
1808
1928
|
};
|
|
1809
1929
|
}();
|
|
1810
1930
|
|
|
1811
1931
|
var handleOnApproveAllServices = /*#__PURE__*/function () {
|
|
1812
|
-
var
|
|
1813
|
-
return _regenerator.default.wrap(function
|
|
1932
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
1933
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1814
1934
|
while (1) {
|
|
1815
|
-
switch (
|
|
1935
|
+
switch (_context11.prev = _context11.next) {
|
|
1816
1936
|
case 0:
|
|
1817
|
-
|
|
1937
|
+
_context11.next = 2;
|
|
1818
1938
|
return sendBulkEvaluation("A");
|
|
1819
1939
|
|
|
1820
1940
|
case 2:
|
|
1821
1941
|
case "end":
|
|
1822
|
-
return
|
|
1942
|
+
return _context11.stop();
|
|
1823
1943
|
}
|
|
1824
1944
|
}
|
|
1825
|
-
},
|
|
1945
|
+
}, _callee11);
|
|
1826
1946
|
}));
|
|
1827
1947
|
|
|
1828
1948
|
return function handleOnApproveAllServices() {
|
|
1829
|
-
return
|
|
1949
|
+
return _ref15.apply(this, arguments);
|
|
1830
1950
|
};
|
|
1831
1951
|
}();
|
|
1832
1952
|
|
|
@@ -1836,18 +1956,18 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1836
1956
|
};
|
|
1837
1957
|
|
|
1838
1958
|
var sendBulkEvaluation = /*#__PURE__*/function () {
|
|
1839
|
-
var
|
|
1959
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(result) {
|
|
1840
1960
|
var _state$services_data3, evaluationArray, conceptArray, status, updatedStatusByRetailer, updatedProduct, updatedServicesData;
|
|
1841
1961
|
|
|
1842
|
-
return _regenerator.default.wrap(function
|
|
1962
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1843
1963
|
while (1) {
|
|
1844
|
-
switch (
|
|
1964
|
+
switch (_context12.prev = _context12.next) {
|
|
1845
1965
|
case 0:
|
|
1846
1966
|
dispatch({
|
|
1847
1967
|
type: "SET_SAVING",
|
|
1848
1968
|
payload: true
|
|
1849
1969
|
});
|
|
1850
|
-
|
|
1970
|
+
_context12.prev = 1;
|
|
1851
1971
|
evaluationArray = [];
|
|
1852
1972
|
conceptArray = (0, _utils.getConceptsByRole)(user.id_role);
|
|
1853
1973
|
(_state$services_data3 = state.services_data) === null || _state$services_data3 === void 0 ? void 0 : _state$services_data3.forEach(function (ret, idx) {
|
|
@@ -1872,7 +1992,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1872
1992
|
}));
|
|
1873
1993
|
}
|
|
1874
1994
|
});
|
|
1875
|
-
|
|
1995
|
+
_context12.next = 7;
|
|
1876
1996
|
return Promise.all(evaluationArray);
|
|
1877
1997
|
|
|
1878
1998
|
case 7:
|
|
@@ -1927,41 +2047,41 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1927
2047
|
image: _genericModalCheck.default
|
|
1928
2048
|
}
|
|
1929
2049
|
});
|
|
1930
|
-
|
|
2050
|
+
_context12.next = 19;
|
|
1931
2051
|
break;
|
|
1932
2052
|
|
|
1933
2053
|
case 16:
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
console.error("Error in bulk evaluation:",
|
|
2054
|
+
_context12.prev = 16;
|
|
2055
|
+
_context12.t0 = _context12["catch"](1);
|
|
2056
|
+
console.error("Error in bulk evaluation:", _context12.t0);
|
|
1937
2057
|
|
|
1938
2058
|
case 19:
|
|
1939
|
-
|
|
2059
|
+
_context12.prev = 19;
|
|
1940
2060
|
dispatch({
|
|
1941
2061
|
type: "SET_SAVING",
|
|
1942
2062
|
payload: false
|
|
1943
2063
|
});
|
|
1944
|
-
return
|
|
2064
|
+
return _context12.finish(19);
|
|
1945
2065
|
|
|
1946
2066
|
case 22:
|
|
1947
2067
|
case "end":
|
|
1948
|
-
return
|
|
2068
|
+
return _context12.stop();
|
|
1949
2069
|
}
|
|
1950
2070
|
}
|
|
1951
|
-
},
|
|
2071
|
+
}, _callee12, null, [[1, 16, 19, 22]]);
|
|
1952
2072
|
}));
|
|
1953
2073
|
|
|
1954
|
-
return function sendBulkEvaluation(
|
|
1955
|
-
return
|
|
2074
|
+
return function sendBulkEvaluation(_x6) {
|
|
2075
|
+
return _ref16.apply(this, arguments);
|
|
1956
2076
|
};
|
|
1957
2077
|
}();
|
|
1958
2078
|
|
|
1959
2079
|
var handleOnChangeAssignations = /*#__PURE__*/function () {
|
|
1960
|
-
var
|
|
2080
|
+
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(assignationType, assignationId) {
|
|
1961
2081
|
var concept, data, updatedProduct;
|
|
1962
|
-
return _regenerator.default.wrap(function
|
|
2082
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
1963
2083
|
while (1) {
|
|
1964
|
-
switch (
|
|
2084
|
+
switch (_context13.prev = _context13.next) {
|
|
1965
2085
|
case 0:
|
|
1966
2086
|
concept = (0, _utils.getConceptByTab)(state.active_tab);
|
|
1967
2087
|
data = {
|
|
@@ -1972,7 +2092,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1972
2092
|
concept: concept,
|
|
1973
2093
|
userId: assignationId
|
|
1974
2094
|
};
|
|
1975
|
-
|
|
2095
|
+
_context13.next = 4;
|
|
1976
2096
|
return (0, _axios.default)({
|
|
1977
2097
|
method: "post",
|
|
1978
2098
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
@@ -1991,14 +2111,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1991
2111
|
|
|
1992
2112
|
case 6:
|
|
1993
2113
|
case "end":
|
|
1994
|
-
return
|
|
2114
|
+
return _context13.stop();
|
|
1995
2115
|
}
|
|
1996
2116
|
}
|
|
1997
|
-
},
|
|
2117
|
+
}, _callee13);
|
|
1998
2118
|
}));
|
|
1999
2119
|
|
|
2000
|
-
return function handleOnChangeAssignations(
|
|
2001
|
-
return
|
|
2120
|
+
return function handleOnChangeAssignations(_x7, _x8) {
|
|
2121
|
+
return _ref17.apply(this, arguments);
|
|
2002
2122
|
};
|
|
2003
2123
|
}();
|
|
2004
2124
|
|
|
@@ -2033,16 +2153,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2033
2153
|
};
|
|
2034
2154
|
|
|
2035
2155
|
var handleOnSubmitComment = /*#__PURE__*/function () {
|
|
2036
|
-
var
|
|
2156
|
+
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
|
|
2037
2157
|
var commentText;
|
|
2038
|
-
return _regenerator.default.wrap(function
|
|
2158
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
2039
2159
|
while (1) {
|
|
2040
|
-
switch (
|
|
2160
|
+
switch (_context14.prev = _context14.next) {
|
|
2041
2161
|
case 0:
|
|
2042
2162
|
e.preventDefault();
|
|
2043
2163
|
commentText = document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML;
|
|
2044
|
-
|
|
2045
|
-
|
|
2164
|
+
_context14.prev = 2;
|
|
2165
|
+
_context14.next = 5;
|
|
2046
2166
|
return createComment(commentText, token);
|
|
2047
2167
|
|
|
2048
2168
|
case 5:
|
|
@@ -2055,13 +2175,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2055
2175
|
image: _genericModalCheck.default
|
|
2056
2176
|
}
|
|
2057
2177
|
});
|
|
2058
|
-
|
|
2178
|
+
_context14.next = 12;
|
|
2059
2179
|
break;
|
|
2060
2180
|
|
|
2061
2181
|
case 8:
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
console.error("Error saving comment:",
|
|
2182
|
+
_context14.prev = 8;
|
|
2183
|
+
_context14.t0 = _context14["catch"](2);
|
|
2184
|
+
console.error("Error saving comment:", _context14.t0);
|
|
2065
2185
|
dispatch({
|
|
2066
2186
|
type: "SET_MODAL",
|
|
2067
2187
|
payload: {
|
|
@@ -2074,14 +2194,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2074
2194
|
|
|
2075
2195
|
case 12:
|
|
2076
2196
|
case "end":
|
|
2077
|
-
return
|
|
2197
|
+
return _context14.stop();
|
|
2078
2198
|
}
|
|
2079
2199
|
}
|
|
2080
|
-
},
|
|
2200
|
+
}, _callee14, null, [[2, 8]]);
|
|
2081
2201
|
}));
|
|
2082
2202
|
|
|
2083
|
-
return function handleOnSubmitComment(
|
|
2084
|
-
return
|
|
2203
|
+
return function handleOnSubmitComment(_x9) {
|
|
2204
|
+
return _ref18.apply(this, arguments);
|
|
2085
2205
|
};
|
|
2086
2206
|
}();
|
|
2087
2207
|
|
|
@@ -2445,21 +2565,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2445
2565
|
type: "pink",
|
|
2446
2566
|
label: "Aceptar",
|
|
2447
2567
|
size: 12,
|
|
2448
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2568
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
2449
2569
|
var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
|
|
2450
|
-
return _regenerator.default.wrap(function
|
|
2570
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
2451
2571
|
while (1) {
|
|
2452
|
-
switch (
|
|
2572
|
+
switch (_context15.prev = _context15.next) {
|
|
2453
2573
|
case 0:
|
|
2454
2574
|
elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
|
|
2455
2575
|
|
|
2456
2576
|
if (!(!elements || elements.length === 0)) {
|
|
2457
|
-
|
|
2577
|
+
_context15.next = 4;
|
|
2458
2578
|
break;
|
|
2459
2579
|
}
|
|
2460
2580
|
|
|
2461
2581
|
console.error("Elemento no encontrado");
|
|
2462
|
-
return
|
|
2582
|
+
return _context15.abrupt("return");
|
|
2463
2583
|
|
|
2464
2584
|
case 4:
|
|
2465
2585
|
isMessageEmpty = Array.from(elements).every(function (el) {
|
|
@@ -2468,7 +2588,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2468
2588
|
});
|
|
2469
2589
|
|
|
2470
2590
|
if (!isMessageEmpty) {
|
|
2471
|
-
|
|
2591
|
+
_context15.next = 10;
|
|
2472
2592
|
break;
|
|
2473
2593
|
}
|
|
2474
2594
|
|
|
@@ -2483,13 +2603,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2483
2603
|
container.appendChild(alert);
|
|
2484
2604
|
}
|
|
2485
2605
|
|
|
2486
|
-
return
|
|
2606
|
+
return _context15.abrupt("return");
|
|
2487
2607
|
|
|
2488
2608
|
case 10:
|
|
2489
2609
|
fullMessage = Array.from(elements).map(function (element) {
|
|
2490
2610
|
return element.innerHTML;
|
|
2491
2611
|
}).join("").replace(/<br\s*\/?>/gi, "\n");
|
|
2492
|
-
|
|
2612
|
+
_context15.next = 13;
|
|
2493
2613
|
return createComment(fullMessage, token);
|
|
2494
2614
|
|
|
2495
2615
|
case 13:
|
|
@@ -2498,10 +2618,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2498
2618
|
|
|
2499
2619
|
case 15:
|
|
2500
2620
|
case "end":
|
|
2501
|
-
return
|
|
2621
|
+
return _context15.stop();
|
|
2502
2622
|
}
|
|
2503
2623
|
}
|
|
2504
|
-
},
|
|
2624
|
+
}, _callee15);
|
|
2505
2625
|
}))
|
|
2506
2626
|
}, "btn-Aceptar")]
|
|
2507
2627
|
}), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
|
|
@@ -2643,11 +2763,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2643
2763
|
}), (family === null || family === void 0 ? void 0 : family.error) && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
2644
2764
|
className: "loading",
|
|
2645
2765
|
children: "No se pudo cargar la familia de este producto."
|
|
2646
|
-
}), (family === null || family === void 0 ? void 0 : family.parent) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("
|
|
2766
|
+
}), (family === null || family === void 0 ? void 0 : family.parent) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2767
|
+
type: "button",
|
|
2647
2768
|
className: "family-row parent",
|
|
2769
|
+
disabled: loadingVariant !== null,
|
|
2770
|
+
onClick: function onClick() {
|
|
2771
|
+
return openFamilyMember(family.parent.articleId);
|
|
2772
|
+
},
|
|
2648
2773
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2649
2774
|
className: "role",
|
|
2650
|
-
children: "Producto padre"
|
|
2775
|
+
children: loadingVariant === family.parent.articleId ? "Abriendo…" : "Producto padre"
|
|
2651
2776
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2652
2777
|
className: "name",
|
|
2653
2778
|
children: family.parent.name
|
|
@@ -2656,11 +2781,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2656
2781
|
children: family.parent.upc
|
|
2657
2782
|
})]
|
|
2658
2783
|
}), family === null || family === void 0 ? void 0 : (_family$variants3 = family.variants) === null || _family$variants3 === void 0 ? void 0 : _family$variants3.map(function (variant) {
|
|
2659
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("
|
|
2784
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2785
|
+
type: "button",
|
|
2660
2786
|
className: "family-row".concat(variant.isCurrent ? " current" : ""),
|
|
2787
|
+
disabled: variant.isCurrent || loadingVariant !== null,
|
|
2788
|
+
onClick: function onClick() {
|
|
2789
|
+
return openFamilyMember(variant.articleId);
|
|
2790
|
+
},
|
|
2661
2791
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2662
2792
|
className: "role",
|
|
2663
|
-
children: variant.isCurrent ? "Estás aquí" : "Hijo"
|
|
2793
|
+
children: loadingVariant === variant.articleId ? "Abriendo…" : variant.isCurrent ? "Estás aquí" : "Hijo"
|
|
2664
2794
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
2665
2795
|
className: "name",
|
|
2666
2796
|
children: variant.name
|
|
@@ -2672,6 +2802,9 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2672
2802
|
}), family && !family.error && !((_family$variants4 = family.variants) !== null && _family$variants4 !== void 0 && _family$variants4.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
2673
2803
|
className: "loading",
|
|
2674
2804
|
children: "Este producto no tiene hijos."
|
|
2805
|
+
}), avisoFamilia && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
2806
|
+
className: "loading",
|
|
2807
|
+
children: avisoFamilia
|
|
2675
2808
|
})]
|
|
2676
2809
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullProductNameHeader.FullProductNameHeader // states
|
|
2677
2810
|
, {
|
|
@@ -2862,20 +2995,20 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2862
2995
|
reviewed: crossComment
|
|
2863
2996
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2864
2997
|
buttonType: "circular-button accept-button",
|
|
2865
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2866
|
-
return _regenerator.default.wrap(function
|
|
2998
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2999
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2867
3000
|
while (1) {
|
|
2868
|
-
switch (
|
|
3001
|
+
switch (_context16.prev = _context16.next) {
|
|
2869
3002
|
case 0:
|
|
2870
3003
|
setCrossComment(true);
|
|
2871
3004
|
commentRevised();
|
|
2872
3005
|
|
|
2873
3006
|
case 2:
|
|
2874
3007
|
case "end":
|
|
2875
|
-
return
|
|
3008
|
+
return _context16.stop();
|
|
2876
3009
|
}
|
|
2877
3010
|
}
|
|
2878
|
-
},
|
|
3011
|
+
}, _callee16);
|
|
2879
3012
|
}))
|
|
2880
3013
|
})]
|
|
2881
3014
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|