contentoh-components-library 21.6.40 → 21.6.42
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.
|
@@ -162,75 +162,75 @@ function regenerateVideoThumbnails(_x) {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
function _regenerateVideoThumbnails() {
|
|
165
|
-
_regenerateVideoThumbnails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
166
|
-
return _regenerator.default.wrap(function
|
|
165
|
+
_regenerateVideoThumbnails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(values) {
|
|
166
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
167
167
|
while (1) {
|
|
168
|
-
switch (
|
|
168
|
+
switch (_context19.prev = _context19.next) {
|
|
169
169
|
case 0:
|
|
170
170
|
if (Array.isArray(values)) {
|
|
171
|
-
|
|
171
|
+
_context19.next = 2;
|
|
172
172
|
break;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
return
|
|
175
|
+
return _context19.abrupt("return", values);
|
|
176
176
|
|
|
177
177
|
case 2:
|
|
178
|
-
return
|
|
179
|
-
var
|
|
178
|
+
return _context19.abrupt("return", Promise.all(values.map( /*#__PURE__*/function () {
|
|
179
|
+
var _ref23 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(value) {
|
|
180
180
|
var base64, videoSrc, thumbnail;
|
|
181
|
-
return _regenerator.default.wrap(function
|
|
181
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
182
182
|
while (1) {
|
|
183
|
-
switch (
|
|
183
|
+
switch (_context18.prev = _context18.next) {
|
|
184
184
|
case 0:
|
|
185
185
|
if (!((value === null || value === void 0 ? void 0 : value.ext) !== "mp4" || !(value !== null && value !== void 0 && value.srcDB))) {
|
|
186
|
-
|
|
186
|
+
_context18.next = 2;
|
|
187
187
|
break;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
return
|
|
190
|
+
return _context18.abrupt("return", value);
|
|
191
191
|
|
|
192
192
|
case 2:
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
_context18.prev = 2;
|
|
194
|
+
_context18.next = 5;
|
|
195
195
|
return convertirVideoABase64("https://" + process.env.REACT_APP_IMAGES_BUCKET + ".s3.amazonaws.com/" + value.srcDB);
|
|
196
196
|
|
|
197
197
|
case 5:
|
|
198
|
-
base64 =
|
|
198
|
+
base64 = _context18.sent;
|
|
199
199
|
videoSrc = "data:video/mp4;base64," + base64.split(",")[1];
|
|
200
|
-
|
|
200
|
+
_context18.next = 9;
|
|
201
201
|
return (0, _generateThumnail.default)(videoSrc, 2);
|
|
202
202
|
|
|
203
203
|
case 9:
|
|
204
|
-
thumbnail =
|
|
205
|
-
return
|
|
204
|
+
thumbnail = _context18.sent;
|
|
205
|
+
return _context18.abrupt("return", (0, _objectSpread5.default)((0, _objectSpread5.default)({}, value), {}, {
|
|
206
206
|
src: thumbnail
|
|
207
207
|
}));
|
|
208
208
|
|
|
209
209
|
case 13:
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
console.error("Error al generar thumbnail del video:",
|
|
213
|
-
return
|
|
210
|
+
_context18.prev = 13;
|
|
211
|
+
_context18.t0 = _context18["catch"](2);
|
|
212
|
+
console.error("Error al generar thumbnail del video:", _context18.t0);
|
|
213
|
+
return _context18.abrupt("return", value);
|
|
214
214
|
|
|
215
215
|
case 17:
|
|
216
216
|
case "end":
|
|
217
|
-
return
|
|
217
|
+
return _context18.stop();
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
},
|
|
220
|
+
}, _callee18, null, [[2, 13]]);
|
|
221
221
|
}));
|
|
222
222
|
|
|
223
223
|
return function (_x10) {
|
|
224
|
-
return
|
|
224
|
+
return _ref23.apply(this, arguments);
|
|
225
225
|
};
|
|
226
226
|
}())));
|
|
227
227
|
|
|
228
228
|
case 3:
|
|
229
229
|
case "end":
|
|
230
|
-
return
|
|
230
|
+
return _context19.stop();
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
},
|
|
233
|
+
}, _callee19);
|
|
234
234
|
}));
|
|
235
235
|
return _regenerateVideoThumbnails.apply(this, arguments);
|
|
236
236
|
}
|
|
@@ -252,7 +252,6 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
252
252
|
saveDatasheets = _useProviderProductEd.saveDatasheets,
|
|
253
253
|
saveDescriptions = _useProviderProductEd.saveDescriptions,
|
|
254
254
|
updateImages = _useProviderProductEd.updateImages,
|
|
255
|
-
saveImageAttrs = _useProviderProductEd.saveImageAttrs,
|
|
256
255
|
deleteImages = _useProviderProductEd.deleteImages,
|
|
257
256
|
handleOnDownloadImages = _useProviderProductEd.handleOnDownloadImages,
|
|
258
257
|
createComment = _useProviderProductEd.createComment;
|
|
@@ -1156,13 +1155,38 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1156
1155
|
return currentStatus;
|
|
1157
1156
|
};
|
|
1158
1157
|
|
|
1159
|
-
var handleOnClickSaveImages = function
|
|
1160
|
-
var
|
|
1158
|
+
var handleOnClickSaveImages = /*#__PURE__*/function () {
|
|
1159
|
+
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
1160
|
+
var _state$product7, _state$product7$servi;
|
|
1161
1161
|
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1162
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
1163
|
+
while (1) {
|
|
1164
|
+
switch (_context5.prev = _context5.next) {
|
|
1165
|
+
case 0:
|
|
1166
|
+
if (!(((_state$product7 = state.product) === null || _state$product7 === void 0 ? void 0 : (_state$product7$servi = _state$product7.services) === null || _state$product7$servi === void 0 ? void 0 : _state$product7$servi.images) === 1)) {
|
|
1167
|
+
_context5.next = 5;
|
|
1168
|
+
break;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
_context5.next = 3;
|
|
1172
|
+
return updateImages(token);
|
|
1173
|
+
|
|
1174
|
+
case 3:
|
|
1175
|
+
_context5.next = 5;
|
|
1176
|
+
return loadData(false);
|
|
1177
|
+
|
|
1178
|
+
case 5:
|
|
1179
|
+
case "end":
|
|
1180
|
+
return _context5.stop();
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
}, _callee5);
|
|
1184
|
+
}));
|
|
1185
|
+
|
|
1186
|
+
return function handleOnClickSaveImages() {
|
|
1187
|
+
return _ref9.apply(this, arguments);
|
|
1188
|
+
};
|
|
1189
|
+
}();
|
|
1166
1190
|
/*
|
|
1167
1191
|
Trae la familia: los hijos del producto, o sus hermanos si el abierto es
|
|
1168
1192
|
una de ellas. Se pide al abrir la sección y no al montar la pantalla: la
|
|
@@ -1171,29 +1195,29 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1171
1195
|
|
|
1172
1196
|
|
|
1173
1197
|
var loadFamily = /*#__PURE__*/function () {
|
|
1174
|
-
var
|
|
1198
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1175
1199
|
var forzar,
|
|
1176
1200
|
_state$product8,
|
|
1177
1201
|
res,
|
|
1178
1202
|
data,
|
|
1179
|
-
|
|
1203
|
+
_args6 = arguments;
|
|
1180
1204
|
|
|
1181
|
-
return _regenerator.default.wrap(function
|
|
1205
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1182
1206
|
while (1) {
|
|
1183
|
-
switch (
|
|
1207
|
+
switch (_context6.prev = _context6.next) {
|
|
1184
1208
|
case 0:
|
|
1185
|
-
forzar =
|
|
1209
|
+
forzar = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : false;
|
|
1186
1210
|
|
|
1187
1211
|
if (!(family && !forzar)) {
|
|
1188
|
-
|
|
1212
|
+
_context6.next = 3;
|
|
1189
1213
|
break;
|
|
1190
1214
|
}
|
|
1191
1215
|
|
|
1192
|
-
return
|
|
1216
|
+
return _context6.abrupt("return", family);
|
|
1193
1217
|
|
|
1194
1218
|
case 3:
|
|
1195
|
-
|
|
1196
|
-
|
|
1219
|
+
_context6.prev = 3;
|
|
1220
|
+
_context6.next = 6;
|
|
1197
1221
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/family"), {
|
|
1198
1222
|
articleId: (_state$product8 = state.product) === null || _state$product8 === void 0 ? void 0 : _state$product8.id_article
|
|
1199
1223
|
}, {
|
|
@@ -1203,32 +1227,32 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1203
1227
|
});
|
|
1204
1228
|
|
|
1205
1229
|
case 6:
|
|
1206
|
-
res =
|
|
1230
|
+
res = _context6.sent;
|
|
1207
1231
|
data = (0, _api.readPayload)(res);
|
|
1208
1232
|
setFamily(data);
|
|
1209
|
-
return
|
|
1233
|
+
return _context6.abrupt("return", data);
|
|
1210
1234
|
|
|
1211
1235
|
case 12:
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
console.error("loadFamily: ",
|
|
1236
|
+
_context6.prev = 12;
|
|
1237
|
+
_context6.t0 = _context6["catch"](3);
|
|
1238
|
+
console.error("loadFamily: ", _context6.t0);
|
|
1215
1239
|
setFamily({
|
|
1216
1240
|
variants: [],
|
|
1217
1241
|
parent: null,
|
|
1218
1242
|
error: true
|
|
1219
1243
|
});
|
|
1220
|
-
return
|
|
1244
|
+
return _context6.abrupt("return", null);
|
|
1221
1245
|
|
|
1222
1246
|
case 17:
|
|
1223
1247
|
case "end":
|
|
1224
|
-
return
|
|
1248
|
+
return _context6.stop();
|
|
1225
1249
|
}
|
|
1226
1250
|
}
|
|
1227
|
-
},
|
|
1251
|
+
}, _callee6, null, [[3, 12]]);
|
|
1228
1252
|
}));
|
|
1229
1253
|
|
|
1230
1254
|
return function loadFamily() {
|
|
1231
|
-
return
|
|
1255
|
+
return _ref10.apply(this, arguments);
|
|
1232
1256
|
};
|
|
1233
1257
|
}();
|
|
1234
1258
|
/*
|
|
@@ -1336,17 +1360,17 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1336
1360
|
};
|
|
1337
1361
|
|
|
1338
1362
|
var openFamilyMember = /*#__PURE__*/function () {
|
|
1339
|
-
var
|
|
1340
|
-
var _readPayload, res,
|
|
1363
|
+
var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(articleId) {
|
|
1364
|
+
var _readPayload, res, _ref12, data, encontrado;
|
|
1341
1365
|
|
|
1342
|
-
return _regenerator.default.wrap(function
|
|
1366
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
1343
1367
|
while (1) {
|
|
1344
|
-
switch (
|
|
1368
|
+
switch (_context7.prev = _context7.next) {
|
|
1345
1369
|
case 0:
|
|
1346
1370
|
setLoadingVariant(articleId);
|
|
1347
1371
|
setAvisoFamilia(null);
|
|
1348
|
-
|
|
1349
|
-
|
|
1372
|
+
_context7.prev = 2;
|
|
1373
|
+
_context7.next = 5;
|
|
1350
1374
|
return _axios.default.get("".concat(process.env.REACT_APP_ORDERED_SERVICES_ENDPOINT), {
|
|
1351
1375
|
params: {
|
|
1352
1376
|
filterByIdArticle: articleId,
|
|
@@ -1358,11 +1382,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1358
1382
|
});
|
|
1359
1383
|
|
|
1360
1384
|
case 5:
|
|
1361
|
-
res =
|
|
1385
|
+
res = _context7.sent;
|
|
1362
1386
|
// read-order-services responde { total, data: [...] }. La vista trae una
|
|
1363
1387
|
// fila por orden, así que puede haber varias del mismo artículo; llegan
|
|
1364
1388
|
// ordenadas por order_id DESC y la primera es la orden más reciente.
|
|
1365
|
-
|
|
1389
|
+
_ref12 = (_readPayload = (0, _api.readPayload)(res)) !== null && _readPayload !== void 0 ? _readPayload : {}, data = _ref12.data;
|
|
1366
1390
|
encontrado = (data !== null && data !== void 0 ? data : []).find(function (item) {
|
|
1367
1391
|
var _item$article;
|
|
1368
1392
|
|
|
@@ -1370,12 +1394,12 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1370
1394
|
});
|
|
1371
1395
|
|
|
1372
1396
|
if (encontrado) {
|
|
1373
|
-
|
|
1397
|
+
_context7.next = 11;
|
|
1374
1398
|
break;
|
|
1375
1399
|
}
|
|
1376
1400
|
|
|
1377
1401
|
setAvisoFamilia("Ese producto no está en ninguna orden de trabajo, así que no se puede abrir desde aquí.");
|
|
1378
|
-
return
|
|
1402
|
+
return _context7.abrupt("return");
|
|
1379
1403
|
|
|
1380
1404
|
case 11:
|
|
1381
1405
|
sessionStorage.setItem("productSelected", JSON.stringify(encontrado));
|
|
@@ -1386,30 +1410,30 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1386
1410
|
product: [encontrado]
|
|
1387
1411
|
}));
|
|
1388
1412
|
window.location.assign("/EditProducts");
|
|
1389
|
-
|
|
1413
|
+
_context7.next = 21;
|
|
1390
1414
|
break;
|
|
1391
1415
|
|
|
1392
1416
|
case 17:
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
console.error("openFamilyMember: ",
|
|
1417
|
+
_context7.prev = 17;
|
|
1418
|
+
_context7.t0 = _context7["catch"](2);
|
|
1419
|
+
console.error("openFamilyMember: ", _context7.t0);
|
|
1396
1420
|
setAvisoFamilia("No se pudo abrir ese producto. Intenta de nuevo.");
|
|
1397
1421
|
|
|
1398
1422
|
case 21:
|
|
1399
|
-
|
|
1423
|
+
_context7.prev = 21;
|
|
1400
1424
|
setLoadingVariant(null);
|
|
1401
|
-
return
|
|
1425
|
+
return _context7.finish(21);
|
|
1402
1426
|
|
|
1403
1427
|
case 24:
|
|
1404
1428
|
case "end":
|
|
1405
|
-
return
|
|
1429
|
+
return _context7.stop();
|
|
1406
1430
|
}
|
|
1407
1431
|
}
|
|
1408
|
-
},
|
|
1432
|
+
}, _callee7, null, [[2, 17, 21, 24]]);
|
|
1409
1433
|
}));
|
|
1410
1434
|
|
|
1411
1435
|
return function openFamilyMember(_x3) {
|
|
1412
|
-
return
|
|
1436
|
+
return _ref11.apply(this, arguments);
|
|
1413
1437
|
};
|
|
1414
1438
|
}();
|
|
1415
1439
|
/*
|
|
@@ -1498,31 +1522,31 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1498
1522
|
|
|
1499
1523
|
|
|
1500
1524
|
var handleOnRestoreInheritance = /*#__PURE__*/function () {
|
|
1501
|
-
var
|
|
1525
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(attributeId) {
|
|
1502
1526
|
var _state$product14;
|
|
1503
1527
|
|
|
1504
1528
|
var kind,
|
|
1505
1529
|
esDescripcion,
|
|
1506
1530
|
res,
|
|
1507
1531
|
data,
|
|
1508
|
-
|
|
1509
|
-
return _regenerator.default.wrap(function
|
|
1532
|
+
_args8 = arguments;
|
|
1533
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
1510
1534
|
while (1) {
|
|
1511
|
-
switch (
|
|
1535
|
+
switch (_context8.prev = _context8.next) {
|
|
1512
1536
|
case 0:
|
|
1513
|
-
kind =
|
|
1537
|
+
kind = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : "attribute";
|
|
1514
1538
|
|
|
1515
1539
|
if (!(!attributeId || !((_state$product14 = state.product) !== null && _state$product14 !== void 0 && _state$product14.id_article))) {
|
|
1516
|
-
|
|
1540
|
+
_context8.next = 3;
|
|
1517
1541
|
break;
|
|
1518
1542
|
}
|
|
1519
1543
|
|
|
1520
|
-
return
|
|
1544
|
+
return _context8.abrupt("return");
|
|
1521
1545
|
|
|
1522
1546
|
case 3:
|
|
1523
1547
|
esDescripcion = kind === "description";
|
|
1524
|
-
|
|
1525
|
-
|
|
1548
|
+
_context8.prev = 4;
|
|
1549
|
+
_context8.next = 7;
|
|
1526
1550
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/restore"), (0, _objectSpread5.default)({
|
|
1527
1551
|
articleId: state.product.id_article
|
|
1528
1552
|
}, esDescripcion ? {
|
|
@@ -1536,11 +1560,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1536
1560
|
});
|
|
1537
1561
|
|
|
1538
1562
|
case 7:
|
|
1539
|
-
res =
|
|
1563
|
+
res = _context8.sent;
|
|
1540
1564
|
data = (0, _api.readPayload)(res);
|
|
1541
1565
|
|
|
1542
1566
|
if (!esDescripcion) {
|
|
1543
|
-
|
|
1567
|
+
_context8.next = 12;
|
|
1544
1568
|
break;
|
|
1545
1569
|
}
|
|
1546
1570
|
|
|
@@ -1554,7 +1578,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1554
1578
|
};
|
|
1555
1579
|
})
|
|
1556
1580
|
});
|
|
1557
|
-
return
|
|
1581
|
+
return _context8.abrupt("return");
|
|
1558
1582
|
|
|
1559
1583
|
case 12:
|
|
1560
1584
|
dispatch({
|
|
@@ -1567,24 +1591,24 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1567
1591
|
};
|
|
1568
1592
|
})
|
|
1569
1593
|
});
|
|
1570
|
-
|
|
1594
|
+
_context8.next = 18;
|
|
1571
1595
|
break;
|
|
1572
1596
|
|
|
1573
1597
|
case 15:
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
console.error("restoreInheritance: ",
|
|
1598
|
+
_context8.prev = 15;
|
|
1599
|
+
_context8.t0 = _context8["catch"](4);
|
|
1600
|
+
console.error("restoreInheritance: ", _context8.t0);
|
|
1577
1601
|
|
|
1578
1602
|
case 18:
|
|
1579
1603
|
case "end":
|
|
1580
|
-
return
|
|
1604
|
+
return _context8.stop();
|
|
1581
1605
|
}
|
|
1582
1606
|
}
|
|
1583
|
-
},
|
|
1607
|
+
}, _callee8, null, [[4, 15]]);
|
|
1584
1608
|
}));
|
|
1585
1609
|
|
|
1586
1610
|
return function handleOnRestoreInheritance(_x4) {
|
|
1587
|
-
return
|
|
1611
|
+
return _ref13.apply(this, arguments);
|
|
1588
1612
|
};
|
|
1589
1613
|
}();
|
|
1590
1614
|
/*
|
|
@@ -1611,45 +1635,45 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1611
1635
|
};
|
|
1612
1636
|
|
|
1613
1637
|
var handleOnClickSave = /*#__PURE__*/function () {
|
|
1614
|
-
var
|
|
1638
|
+
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
1615
1639
|
var _familia$variants, cambios, familia, hijos;
|
|
1616
1640
|
|
|
1617
|
-
return _regenerator.default.wrap(function
|
|
1641
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1618
1642
|
while (1) {
|
|
1619
|
-
switch (
|
|
1643
|
+
switch (_context9.prev = _context9.next) {
|
|
1620
1644
|
case 0:
|
|
1621
1645
|
if (!(state.saving || preparandoPropagacion)) {
|
|
1622
|
-
|
|
1646
|
+
_context9.next = 2;
|
|
1623
1647
|
break;
|
|
1624
1648
|
}
|
|
1625
1649
|
|
|
1626
|
-
return
|
|
1650
|
+
return _context9.abrupt("return");
|
|
1627
1651
|
|
|
1628
1652
|
case 2:
|
|
1629
|
-
|
|
1630
|
-
|
|
1653
|
+
_context9.t0 = state.active_tab;
|
|
1654
|
+
_context9.next = _context9.t0 === "Descripción" ? 5 : _context9.t0 === "Ficha técnica" ? 8 : _context9.t0 === "Imágenes" ? 32 : 35;
|
|
1631
1655
|
break;
|
|
1632
1656
|
|
|
1633
1657
|
case 5:
|
|
1634
|
-
|
|
1658
|
+
_context9.next = 7;
|
|
1635
1659
|
return saveDescriptions(token);
|
|
1636
1660
|
|
|
1637
1661
|
case 7:
|
|
1638
|
-
return
|
|
1662
|
+
return _context9.abrupt("break", 36);
|
|
1639
1663
|
|
|
1640
1664
|
case 8:
|
|
1641
1665
|
cambios = cambiosDeFichaTecnica();
|
|
1642
1666
|
|
|
1643
1667
|
if (!(cambios.length === 0)) {
|
|
1644
|
-
|
|
1668
|
+
_context9.next = 13;
|
|
1645
1669
|
break;
|
|
1646
1670
|
}
|
|
1647
1671
|
|
|
1648
|
-
|
|
1672
|
+
_context9.next = 12;
|
|
1649
1673
|
return saveDatasheets(token);
|
|
1650
1674
|
|
|
1651
1675
|
case 12:
|
|
1652
|
-
return
|
|
1676
|
+
return _context9.abrupt("break", 36);
|
|
1653
1677
|
|
|
1654
1678
|
case 13:
|
|
1655
1679
|
/*
|
|
@@ -1668,21 +1692,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1668
1692
|
*/
|
|
1669
1693
|
setPreparandoPropagacion(true);
|
|
1670
1694
|
familia = null;
|
|
1671
|
-
|
|
1672
|
-
|
|
1695
|
+
_context9.prev = 15;
|
|
1696
|
+
_context9.next = 18;
|
|
1673
1697
|
return loadFamily(true);
|
|
1674
1698
|
|
|
1675
1699
|
case 18:
|
|
1676
|
-
familia =
|
|
1700
|
+
familia = _context9.sent;
|
|
1677
1701
|
|
|
1678
1702
|
case 19:
|
|
1679
|
-
|
|
1703
|
+
_context9.prev = 19;
|
|
1680
1704
|
setPreparandoPropagacion(false);
|
|
1681
|
-
return
|
|
1705
|
+
return _context9.finish(19);
|
|
1682
1706
|
|
|
1683
1707
|
case 22:
|
|
1684
1708
|
if (!(!familia || familia.error)) {
|
|
1685
|
-
|
|
1709
|
+
_context9.next = 25;
|
|
1686
1710
|
break;
|
|
1687
1711
|
}
|
|
1688
1712
|
|
|
@@ -1719,7 +1743,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1719
1743
|
}]
|
|
1720
1744
|
}
|
|
1721
1745
|
});
|
|
1722
|
-
return
|
|
1746
|
+
return _context9.abrupt("return");
|
|
1723
1747
|
|
|
1724
1748
|
case 25:
|
|
1725
1749
|
hijos = ((_familia$variants = familia.variants) !== null && _familia$variants !== void 0 ? _familia$variants : []).filter(function (v) {
|
|
@@ -1727,46 +1751,46 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1727
1751
|
});
|
|
1728
1752
|
|
|
1729
1753
|
if (!(hijos.length > 0)) {
|
|
1730
|
-
|
|
1754
|
+
_context9.next = 29;
|
|
1731
1755
|
break;
|
|
1732
1756
|
}
|
|
1733
1757
|
|
|
1734
1758
|
setPendingPropagation({
|
|
1735
1759
|
cambios: cambios
|
|
1736
1760
|
});
|
|
1737
|
-
return
|
|
1761
|
+
return _context9.abrupt("return");
|
|
1738
1762
|
|
|
1739
1763
|
case 29:
|
|
1740
|
-
|
|
1764
|
+
_context9.next = 31;
|
|
1741
1765
|
return saveDatasheets(token);
|
|
1742
1766
|
|
|
1743
1767
|
case 31:
|
|
1744
|
-
return
|
|
1768
|
+
return _context9.abrupt("break", 36);
|
|
1745
1769
|
|
|
1746
1770
|
case 32:
|
|
1747
|
-
|
|
1771
|
+
_context9.next = 34;
|
|
1748
1772
|
return updateImages(token);
|
|
1749
1773
|
|
|
1750
1774
|
case 34:
|
|
1751
|
-
return
|
|
1775
|
+
return _context9.abrupt("break", 36);
|
|
1752
1776
|
|
|
1753
1777
|
case 35:
|
|
1754
|
-
return
|
|
1778
|
+
return _context9.abrupt("break", 36);
|
|
1755
1779
|
|
|
1756
1780
|
case 36:
|
|
1757
|
-
|
|
1781
|
+
_context9.next = 38;
|
|
1758
1782
|
return loadData(false);
|
|
1759
1783
|
|
|
1760
1784
|
case 38:
|
|
1761
1785
|
case "end":
|
|
1762
|
-
return
|
|
1786
|
+
return _context9.stop();
|
|
1763
1787
|
}
|
|
1764
1788
|
}
|
|
1765
|
-
},
|
|
1789
|
+
}, _callee9, null, [[15,, 19, 22]]);
|
|
1766
1790
|
}));
|
|
1767
1791
|
|
|
1768
1792
|
return function handleOnClickSave() {
|
|
1769
|
-
return
|
|
1793
|
+
return _ref14.apply(this, arguments);
|
|
1770
1794
|
};
|
|
1771
1795
|
}();
|
|
1772
1796
|
|
|
@@ -1834,24 +1858,24 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1834
1858
|
};
|
|
1835
1859
|
|
|
1836
1860
|
var handleOnApproveSingleService = /*#__PURE__*/function () {
|
|
1837
|
-
var
|
|
1838
|
-
return _regenerator.default.wrap(function
|
|
1861
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
1862
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
1839
1863
|
while (1) {
|
|
1840
|
-
switch (
|
|
1864
|
+
switch (_context10.prev = _context10.next) {
|
|
1841
1865
|
case 0:
|
|
1842
|
-
|
|
1866
|
+
_context10.next = 2;
|
|
1843
1867
|
return sendSingleEvaluation("A");
|
|
1844
1868
|
|
|
1845
1869
|
case 2:
|
|
1846
1870
|
case "end":
|
|
1847
|
-
return
|
|
1871
|
+
return _context10.stop();
|
|
1848
1872
|
}
|
|
1849
1873
|
}
|
|
1850
|
-
},
|
|
1874
|
+
}, _callee10);
|
|
1851
1875
|
}));
|
|
1852
1876
|
|
|
1853
1877
|
return function handleOnApproveSingleService() {
|
|
1854
|
-
return
|
|
1878
|
+
return _ref15.apply(this, arguments);
|
|
1855
1879
|
};
|
|
1856
1880
|
}();
|
|
1857
1881
|
|
|
@@ -1860,21 +1884,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1860
1884
|
};
|
|
1861
1885
|
|
|
1862
1886
|
var sendSingleEvaluation = /*#__PURE__*/function () {
|
|
1863
|
-
var
|
|
1887
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
|
|
1864
1888
|
var _state$product$id_ord, _state$active_retaile4;
|
|
1865
1889
|
|
|
1866
1890
|
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;
|
|
1867
1891
|
|
|
1868
|
-
return _regenerator.default.wrap(function
|
|
1892
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1869
1893
|
while (1) {
|
|
1870
|
-
switch (
|
|
1894
|
+
switch (_context11.prev = _context11.next) {
|
|
1871
1895
|
case 0:
|
|
1872
1896
|
if (!state.saving) {
|
|
1873
|
-
|
|
1897
|
+
_context11.next = 2;
|
|
1874
1898
|
break;
|
|
1875
1899
|
}
|
|
1876
1900
|
|
|
1877
|
-
return
|
|
1901
|
+
return _context11.abrupt("return");
|
|
1878
1902
|
|
|
1879
1903
|
case 2:
|
|
1880
1904
|
dispatch({
|
|
@@ -1895,16 +1919,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1895
1919
|
retailerId: retailerId
|
|
1896
1920
|
};
|
|
1897
1921
|
activeTab = state.active_tab;
|
|
1898
|
-
|
|
1922
|
+
_context11.prev = 11;
|
|
1899
1923
|
|
|
1900
1924
|
if (!result) {
|
|
1901
|
-
|
|
1925
|
+
_context11.next = 28;
|
|
1902
1926
|
break;
|
|
1903
1927
|
}
|
|
1904
1928
|
|
|
1905
1929
|
data.result = result;
|
|
1906
1930
|
data.retailerId = retailerId;
|
|
1907
|
-
|
|
1931
|
+
_context11.next = 17;
|
|
1908
1932
|
return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1909
1933
|
headers: {
|
|
1910
1934
|
Authorization: token
|
|
@@ -1912,7 +1936,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1912
1936
|
});
|
|
1913
1937
|
|
|
1914
1938
|
case 17:
|
|
1915
|
-
res =
|
|
1939
|
+
res = _context11.sent;
|
|
1916
1940
|
newStatuses = JSON.parse(res.data.body);
|
|
1917
1941
|
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1918
1942
|
articleStatus = newStatuses.newArticleStatus[articleId];
|
|
@@ -1943,7 +1967,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1943
1967
|
image: _genericModalCheck.default
|
|
1944
1968
|
}
|
|
1945
1969
|
});
|
|
1946
|
-
|
|
1970
|
+
_context11.next = 33;
|
|
1947
1971
|
break;
|
|
1948
1972
|
|
|
1949
1973
|
case 28:
|
|
@@ -1959,7 +1983,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1959
1983
|
icon = _genericModalCheck.default;
|
|
1960
1984
|
}
|
|
1961
1985
|
|
|
1962
|
-
|
|
1986
|
+
_context11.next = 32;
|
|
1963
1987
|
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1964
1988
|
headers: {
|
|
1965
1989
|
Authorization: token
|
|
@@ -1967,7 +1991,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1967
1991
|
});
|
|
1968
1992
|
|
|
1969
1993
|
case 32:
|
|
1970
|
-
res =
|
|
1994
|
+
res = _context11.sent;
|
|
1971
1995
|
|
|
1972
1996
|
case 33:
|
|
1973
1997
|
if (res.data.statusCode === 200) {
|
|
@@ -2052,13 +2076,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2052
2076
|
});
|
|
2053
2077
|
}
|
|
2054
2078
|
|
|
2055
|
-
|
|
2079
|
+
_context11.next = 40;
|
|
2056
2080
|
break;
|
|
2057
2081
|
|
|
2058
2082
|
case 36:
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
console.error("Error sending evaluation:",
|
|
2083
|
+
_context11.prev = 36;
|
|
2084
|
+
_context11.t0 = _context11["catch"](11);
|
|
2085
|
+
console.error("Error sending evaluation:", _context11.t0);
|
|
2062
2086
|
dispatch({
|
|
2063
2087
|
type: "SET_MODAL",
|
|
2064
2088
|
payload: {
|
|
@@ -2070,45 +2094,45 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2070
2094
|
});
|
|
2071
2095
|
|
|
2072
2096
|
case 40:
|
|
2073
|
-
|
|
2097
|
+
_context11.prev = 40;
|
|
2074
2098
|
dispatch({
|
|
2075
2099
|
type: "SET_SAVING",
|
|
2076
2100
|
payload: false
|
|
2077
2101
|
});
|
|
2078
|
-
return
|
|
2102
|
+
return _context11.finish(40);
|
|
2079
2103
|
|
|
2080
2104
|
case 43:
|
|
2081
2105
|
case "end":
|
|
2082
|
-
return
|
|
2106
|
+
return _context11.stop();
|
|
2083
2107
|
}
|
|
2084
2108
|
}
|
|
2085
|
-
},
|
|
2109
|
+
}, _callee11, null, [[11, 36, 40, 43]]);
|
|
2086
2110
|
}));
|
|
2087
2111
|
|
|
2088
2112
|
return function sendSingleEvaluation(_x5) {
|
|
2089
|
-
return
|
|
2113
|
+
return _ref16.apply(this, arguments);
|
|
2090
2114
|
};
|
|
2091
2115
|
}();
|
|
2092
2116
|
|
|
2093
2117
|
var handleOnApproveAllServices = /*#__PURE__*/function () {
|
|
2094
|
-
var
|
|
2095
|
-
return _regenerator.default.wrap(function
|
|
2118
|
+
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
2119
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
2096
2120
|
while (1) {
|
|
2097
|
-
switch (
|
|
2121
|
+
switch (_context12.prev = _context12.next) {
|
|
2098
2122
|
case 0:
|
|
2099
|
-
|
|
2123
|
+
_context12.next = 2;
|
|
2100
2124
|
return sendBulkEvaluation("A");
|
|
2101
2125
|
|
|
2102
2126
|
case 2:
|
|
2103
2127
|
case "end":
|
|
2104
|
-
return
|
|
2128
|
+
return _context12.stop();
|
|
2105
2129
|
}
|
|
2106
2130
|
}
|
|
2107
|
-
},
|
|
2131
|
+
}, _callee12);
|
|
2108
2132
|
}));
|
|
2109
2133
|
|
|
2110
2134
|
return function handleOnApproveAllServices() {
|
|
2111
|
-
return
|
|
2135
|
+
return _ref17.apply(this, arguments);
|
|
2112
2136
|
};
|
|
2113
2137
|
}();
|
|
2114
2138
|
|
|
@@ -2118,18 +2142,18 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2118
2142
|
};
|
|
2119
2143
|
|
|
2120
2144
|
var sendBulkEvaluation = /*#__PURE__*/function () {
|
|
2121
|
-
var
|
|
2145
|
+
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
|
|
2122
2146
|
var _state$services_data3, evaluationArray, conceptArray, status, updatedStatusByRetailer, updatedProduct, updatedServicesData;
|
|
2123
2147
|
|
|
2124
|
-
return _regenerator.default.wrap(function
|
|
2148
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
2125
2149
|
while (1) {
|
|
2126
|
-
switch (
|
|
2150
|
+
switch (_context13.prev = _context13.next) {
|
|
2127
2151
|
case 0:
|
|
2128
2152
|
dispatch({
|
|
2129
2153
|
type: "SET_SAVING",
|
|
2130
2154
|
payload: true
|
|
2131
2155
|
});
|
|
2132
|
-
|
|
2156
|
+
_context13.prev = 1;
|
|
2133
2157
|
evaluationArray = [];
|
|
2134
2158
|
conceptArray = (0, _utils.getConceptsByRole)(user.id_role);
|
|
2135
2159
|
(_state$services_data3 = state.services_data) === null || _state$services_data3 === void 0 ? void 0 : _state$services_data3.forEach(function (ret, idx) {
|
|
@@ -2154,7 +2178,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2154
2178
|
}));
|
|
2155
2179
|
}
|
|
2156
2180
|
});
|
|
2157
|
-
|
|
2181
|
+
_context13.next = 7;
|
|
2158
2182
|
return Promise.all(evaluationArray);
|
|
2159
2183
|
|
|
2160
2184
|
case 7:
|
|
@@ -2209,41 +2233,41 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2209
2233
|
image: _genericModalCheck.default
|
|
2210
2234
|
}
|
|
2211
2235
|
});
|
|
2212
|
-
|
|
2236
|
+
_context13.next = 19;
|
|
2213
2237
|
break;
|
|
2214
2238
|
|
|
2215
2239
|
case 16:
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
console.error("Error in bulk evaluation:",
|
|
2240
|
+
_context13.prev = 16;
|
|
2241
|
+
_context13.t0 = _context13["catch"](1);
|
|
2242
|
+
console.error("Error in bulk evaluation:", _context13.t0);
|
|
2219
2243
|
|
|
2220
2244
|
case 19:
|
|
2221
|
-
|
|
2245
|
+
_context13.prev = 19;
|
|
2222
2246
|
dispatch({
|
|
2223
2247
|
type: "SET_SAVING",
|
|
2224
2248
|
payload: false
|
|
2225
2249
|
});
|
|
2226
|
-
return
|
|
2250
|
+
return _context13.finish(19);
|
|
2227
2251
|
|
|
2228
2252
|
case 22:
|
|
2229
2253
|
case "end":
|
|
2230
|
-
return
|
|
2254
|
+
return _context13.stop();
|
|
2231
2255
|
}
|
|
2232
2256
|
}
|
|
2233
|
-
},
|
|
2257
|
+
}, _callee13, null, [[1, 16, 19, 22]]);
|
|
2234
2258
|
}));
|
|
2235
2259
|
|
|
2236
2260
|
return function sendBulkEvaluation(_x6) {
|
|
2237
|
-
return
|
|
2261
|
+
return _ref18.apply(this, arguments);
|
|
2238
2262
|
};
|
|
2239
2263
|
}();
|
|
2240
2264
|
|
|
2241
2265
|
var handleOnChangeAssignations = /*#__PURE__*/function () {
|
|
2242
|
-
var
|
|
2266
|
+
var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
|
|
2243
2267
|
var concept, data, updatedProduct;
|
|
2244
|
-
return _regenerator.default.wrap(function
|
|
2268
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
2245
2269
|
while (1) {
|
|
2246
|
-
switch (
|
|
2270
|
+
switch (_context14.prev = _context14.next) {
|
|
2247
2271
|
case 0:
|
|
2248
2272
|
concept = (0, _utils.getConceptByTab)(state.active_tab);
|
|
2249
2273
|
data = {
|
|
@@ -2254,7 +2278,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2254
2278
|
concept: concept,
|
|
2255
2279
|
userId: assignationId
|
|
2256
2280
|
};
|
|
2257
|
-
|
|
2281
|
+
_context14.next = 4;
|
|
2258
2282
|
return (0, _axios.default)({
|
|
2259
2283
|
method: "post",
|
|
2260
2284
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
@@ -2273,14 +2297,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2273
2297
|
|
|
2274
2298
|
case 6:
|
|
2275
2299
|
case "end":
|
|
2276
|
-
return
|
|
2300
|
+
return _context14.stop();
|
|
2277
2301
|
}
|
|
2278
2302
|
}
|
|
2279
|
-
},
|
|
2303
|
+
}, _callee14);
|
|
2280
2304
|
}));
|
|
2281
2305
|
|
|
2282
2306
|
return function handleOnChangeAssignations(_x7, _x8) {
|
|
2283
|
-
return
|
|
2307
|
+
return _ref19.apply(this, arguments);
|
|
2284
2308
|
};
|
|
2285
2309
|
}();
|
|
2286
2310
|
|
|
@@ -2315,16 +2339,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2315
2339
|
};
|
|
2316
2340
|
|
|
2317
2341
|
var handleOnSubmitComment = /*#__PURE__*/function () {
|
|
2318
|
-
var
|
|
2342
|
+
var _ref20 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e) {
|
|
2319
2343
|
var commentText;
|
|
2320
|
-
return _regenerator.default.wrap(function
|
|
2344
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
2321
2345
|
while (1) {
|
|
2322
|
-
switch (
|
|
2346
|
+
switch (_context15.prev = _context15.next) {
|
|
2323
2347
|
case 0:
|
|
2324
2348
|
e.preventDefault();
|
|
2325
2349
|
commentText = document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML;
|
|
2326
|
-
|
|
2327
|
-
|
|
2350
|
+
_context15.prev = 2;
|
|
2351
|
+
_context15.next = 5;
|
|
2328
2352
|
return createComment(commentText, token);
|
|
2329
2353
|
|
|
2330
2354
|
case 5:
|
|
@@ -2337,13 +2361,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2337
2361
|
image: _genericModalCheck.default
|
|
2338
2362
|
}
|
|
2339
2363
|
});
|
|
2340
|
-
|
|
2364
|
+
_context15.next = 12;
|
|
2341
2365
|
break;
|
|
2342
2366
|
|
|
2343
2367
|
case 8:
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
console.error("Error saving comment:",
|
|
2368
|
+
_context15.prev = 8;
|
|
2369
|
+
_context15.t0 = _context15["catch"](2);
|
|
2370
|
+
console.error("Error saving comment:", _context15.t0);
|
|
2347
2371
|
dispatch({
|
|
2348
2372
|
type: "SET_MODAL",
|
|
2349
2373
|
payload: {
|
|
@@ -2356,14 +2380,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2356
2380
|
|
|
2357
2381
|
case 12:
|
|
2358
2382
|
case "end":
|
|
2359
|
-
return
|
|
2383
|
+
return _context15.stop();
|
|
2360
2384
|
}
|
|
2361
2385
|
}
|
|
2362
|
-
},
|
|
2386
|
+
}, _callee15, null, [[2, 8]]);
|
|
2363
2387
|
}));
|
|
2364
2388
|
|
|
2365
2389
|
return function handleOnSubmitComment(_x9) {
|
|
2366
|
-
return
|
|
2390
|
+
return _ref20.apply(this, arguments);
|
|
2367
2391
|
};
|
|
2368
2392
|
}();
|
|
2369
2393
|
|
|
@@ -2733,21 +2757,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2733
2757
|
type: "pink",
|
|
2734
2758
|
label: "Aceptar",
|
|
2735
2759
|
size: 12,
|
|
2736
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2760
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2737
2761
|
var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
|
|
2738
|
-
return _regenerator.default.wrap(function
|
|
2762
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2739
2763
|
while (1) {
|
|
2740
|
-
switch (
|
|
2764
|
+
switch (_context16.prev = _context16.next) {
|
|
2741
2765
|
case 0:
|
|
2742
2766
|
elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
|
|
2743
2767
|
|
|
2744
2768
|
if (!(!elements || elements.length === 0)) {
|
|
2745
|
-
|
|
2769
|
+
_context16.next = 4;
|
|
2746
2770
|
break;
|
|
2747
2771
|
}
|
|
2748
2772
|
|
|
2749
2773
|
console.error("Elemento no encontrado");
|
|
2750
|
-
return
|
|
2774
|
+
return _context16.abrupt("return");
|
|
2751
2775
|
|
|
2752
2776
|
case 4:
|
|
2753
2777
|
isMessageEmpty = Array.from(elements).every(function (el) {
|
|
@@ -2756,7 +2780,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2756
2780
|
});
|
|
2757
2781
|
|
|
2758
2782
|
if (!isMessageEmpty) {
|
|
2759
|
-
|
|
2783
|
+
_context16.next = 10;
|
|
2760
2784
|
break;
|
|
2761
2785
|
}
|
|
2762
2786
|
|
|
@@ -2771,13 +2795,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2771
2795
|
container.appendChild(alert);
|
|
2772
2796
|
}
|
|
2773
2797
|
|
|
2774
|
-
return
|
|
2798
|
+
return _context16.abrupt("return");
|
|
2775
2799
|
|
|
2776
2800
|
case 10:
|
|
2777
2801
|
fullMessage = Array.from(elements).map(function (element) {
|
|
2778
2802
|
return element.innerHTML;
|
|
2779
2803
|
}).join("").replace(/<br\s*\/?>/gi, "\n");
|
|
2780
|
-
|
|
2804
|
+
_context16.next = 13;
|
|
2781
2805
|
return createComment(fullMessage, token);
|
|
2782
2806
|
|
|
2783
2807
|
case 13:
|
|
@@ -2786,10 +2810,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2786
2810
|
|
|
2787
2811
|
case 15:
|
|
2788
2812
|
case "end":
|
|
2789
|
-
return
|
|
2813
|
+
return _context16.stop();
|
|
2790
2814
|
}
|
|
2791
2815
|
}
|
|
2792
|
-
},
|
|
2816
|
+
}, _callee16);
|
|
2793
2817
|
}))
|
|
2794
2818
|
}, "btn-Aceptar")]
|
|
2795
2819
|
}), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
|
|
@@ -3203,20 +3227,20 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3203
3227
|
reviewed: crossComment
|
|
3204
3228
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
3205
3229
|
buttonType: "circular-button accept-button",
|
|
3206
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
3207
|
-
return _regenerator.default.wrap(function
|
|
3230
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
3231
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
3208
3232
|
while (1) {
|
|
3209
|
-
switch (
|
|
3233
|
+
switch (_context17.prev = _context17.next) {
|
|
3210
3234
|
case 0:
|
|
3211
3235
|
setCrossComment(true);
|
|
3212
3236
|
commentRevised();
|
|
3213
3237
|
|
|
3214
3238
|
case 2:
|
|
3215
3239
|
case "end":
|
|
3216
|
-
return
|
|
3240
|
+
return _context17.stop();
|
|
3217
3241
|
}
|
|
3218
3242
|
}
|
|
3219
|
-
},
|
|
3243
|
+
}, _callee17);
|
|
3220
3244
|
}))
|
|
3221
3245
|
})]
|
|
3222
3246
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
package/package.json
CHANGED
|
@@ -161,7 +161,6 @@ const RetailerProductEditionView = ({
|
|
|
161
161
|
saveDatasheets,
|
|
162
162
|
saveDescriptions,
|
|
163
163
|
updateImages,
|
|
164
|
-
saveImageAttrs,
|
|
165
164
|
deleteImages,
|
|
166
165
|
handleOnDownloadImages,
|
|
167
166
|
createComment,
|
|
@@ -803,9 +802,30 @@ const RetailerProductEditionView = ({
|
|
|
803
802
|
return currentStatus;
|
|
804
803
|
};
|
|
805
804
|
|
|
806
|
-
const handleOnClickSaveImages = () => {
|
|
805
|
+
const handleOnClickSaveImages = async () => {
|
|
807
806
|
if (state.product?.services?.images === 1) {
|
|
808
|
-
|
|
807
|
+
/**
|
|
808
|
+
* `updateImages` y NO `saveImageAttrs`.
|
|
809
|
+
*
|
|
810
|
+
* `saveImageAttrs` manda `articleData: []` fijo, así que las imágenes
|
|
811
|
+
* nuevas nunca llegaban al backend: el archivo se subía a S3 —eso lo hace
|
|
812
|
+
* el front por su cuenta— pero `saveImages` no se ejecutaba y la fila de
|
|
813
|
+
* `rel_article_image` nunca se creaba. Como la pantalla lee de esa tabla,
|
|
814
|
+
* la imagen no aparecía después de guardar.
|
|
815
|
+
*
|
|
816
|
+
* `updateImages` cubre las dos cosas: manda `attrReqImgs` con los
|
|
817
|
+
* atributos requeridos y además `articleData` con las imágenes nuevas y
|
|
818
|
+
* `updateImages` con las existentes. Es la misma función que ya usaba el
|
|
819
|
+
* botón de guardar del menú de pestañas (`handleOnClickSave`), así que
|
|
820
|
+
* ambos caminos quedan consistentes.
|
|
821
|
+
*/
|
|
822
|
+
await updateImages(token);
|
|
823
|
+
// Recargar para que la pantalla refleje lo que quedó guardado, igual que
|
|
824
|
+
// `handleOnClickSave`. Sin esto el estado local se queda con la imagen sin
|
|
825
|
+
// su `id` de base de datos: la vista no muestra lo persistido y, al volver
|
|
826
|
+
// a guardar, el front la manda otra vez como nueva y el backend la omite
|
|
827
|
+
// por duplicada — así que el `src` nunca se actualizaba.
|
|
828
|
+
await loadData(false);
|
|
809
829
|
}
|
|
810
830
|
};
|
|
811
831
|
|