contentoh-components-library 21.6.41 → 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
|
}
|
|
@@ -1155,28 +1155,38 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1155
1155
|
return currentStatus;
|
|
1156
1156
|
};
|
|
1157
1157
|
|
|
1158
|
-
var handleOnClickSaveImages = function
|
|
1159
|
-
var
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
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
|
+
|
|
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
|
+
}();
|
|
1180
1190
|
/*
|
|
1181
1191
|
Trae la familia: los hijos del producto, o sus hermanos si el abierto es
|
|
1182
1192
|
una de ellas. Se pide al abrir la sección y no al montar la pantalla: la
|
|
@@ -1185,29 +1195,29 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1185
1195
|
|
|
1186
1196
|
|
|
1187
1197
|
var loadFamily = /*#__PURE__*/function () {
|
|
1188
|
-
var
|
|
1198
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1189
1199
|
var forzar,
|
|
1190
1200
|
_state$product8,
|
|
1191
1201
|
res,
|
|
1192
1202
|
data,
|
|
1193
|
-
|
|
1203
|
+
_args6 = arguments;
|
|
1194
1204
|
|
|
1195
|
-
return _regenerator.default.wrap(function
|
|
1205
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1196
1206
|
while (1) {
|
|
1197
|
-
switch (
|
|
1207
|
+
switch (_context6.prev = _context6.next) {
|
|
1198
1208
|
case 0:
|
|
1199
|
-
forzar =
|
|
1209
|
+
forzar = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : false;
|
|
1200
1210
|
|
|
1201
1211
|
if (!(family && !forzar)) {
|
|
1202
|
-
|
|
1212
|
+
_context6.next = 3;
|
|
1203
1213
|
break;
|
|
1204
1214
|
}
|
|
1205
1215
|
|
|
1206
|
-
return
|
|
1216
|
+
return _context6.abrupt("return", family);
|
|
1207
1217
|
|
|
1208
1218
|
case 3:
|
|
1209
|
-
|
|
1210
|
-
|
|
1219
|
+
_context6.prev = 3;
|
|
1220
|
+
_context6.next = 6;
|
|
1211
1221
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/family"), {
|
|
1212
1222
|
articleId: (_state$product8 = state.product) === null || _state$product8 === void 0 ? void 0 : _state$product8.id_article
|
|
1213
1223
|
}, {
|
|
@@ -1217,32 +1227,32 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1217
1227
|
});
|
|
1218
1228
|
|
|
1219
1229
|
case 6:
|
|
1220
|
-
res =
|
|
1230
|
+
res = _context6.sent;
|
|
1221
1231
|
data = (0, _api.readPayload)(res);
|
|
1222
1232
|
setFamily(data);
|
|
1223
|
-
return
|
|
1233
|
+
return _context6.abrupt("return", data);
|
|
1224
1234
|
|
|
1225
1235
|
case 12:
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
console.error("loadFamily: ",
|
|
1236
|
+
_context6.prev = 12;
|
|
1237
|
+
_context6.t0 = _context6["catch"](3);
|
|
1238
|
+
console.error("loadFamily: ", _context6.t0);
|
|
1229
1239
|
setFamily({
|
|
1230
1240
|
variants: [],
|
|
1231
1241
|
parent: null,
|
|
1232
1242
|
error: true
|
|
1233
1243
|
});
|
|
1234
|
-
return
|
|
1244
|
+
return _context6.abrupt("return", null);
|
|
1235
1245
|
|
|
1236
1246
|
case 17:
|
|
1237
1247
|
case "end":
|
|
1238
|
-
return
|
|
1248
|
+
return _context6.stop();
|
|
1239
1249
|
}
|
|
1240
1250
|
}
|
|
1241
|
-
},
|
|
1251
|
+
}, _callee6, null, [[3, 12]]);
|
|
1242
1252
|
}));
|
|
1243
1253
|
|
|
1244
1254
|
return function loadFamily() {
|
|
1245
|
-
return
|
|
1255
|
+
return _ref10.apply(this, arguments);
|
|
1246
1256
|
};
|
|
1247
1257
|
}();
|
|
1248
1258
|
/*
|
|
@@ -1350,17 +1360,17 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1350
1360
|
};
|
|
1351
1361
|
|
|
1352
1362
|
var openFamilyMember = /*#__PURE__*/function () {
|
|
1353
|
-
var
|
|
1354
|
-
var _readPayload, res,
|
|
1363
|
+
var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(articleId) {
|
|
1364
|
+
var _readPayload, res, _ref12, data, encontrado;
|
|
1355
1365
|
|
|
1356
|
-
return _regenerator.default.wrap(function
|
|
1366
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
1357
1367
|
while (1) {
|
|
1358
|
-
switch (
|
|
1368
|
+
switch (_context7.prev = _context7.next) {
|
|
1359
1369
|
case 0:
|
|
1360
1370
|
setLoadingVariant(articleId);
|
|
1361
1371
|
setAvisoFamilia(null);
|
|
1362
|
-
|
|
1363
|
-
|
|
1372
|
+
_context7.prev = 2;
|
|
1373
|
+
_context7.next = 5;
|
|
1364
1374
|
return _axios.default.get("".concat(process.env.REACT_APP_ORDERED_SERVICES_ENDPOINT), {
|
|
1365
1375
|
params: {
|
|
1366
1376
|
filterByIdArticle: articleId,
|
|
@@ -1372,11 +1382,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1372
1382
|
});
|
|
1373
1383
|
|
|
1374
1384
|
case 5:
|
|
1375
|
-
res =
|
|
1385
|
+
res = _context7.sent;
|
|
1376
1386
|
// read-order-services responde { total, data: [...] }. La vista trae una
|
|
1377
1387
|
// fila por orden, así que puede haber varias del mismo artículo; llegan
|
|
1378
1388
|
// ordenadas por order_id DESC y la primera es la orden más reciente.
|
|
1379
|
-
|
|
1389
|
+
_ref12 = (_readPayload = (0, _api.readPayload)(res)) !== null && _readPayload !== void 0 ? _readPayload : {}, data = _ref12.data;
|
|
1380
1390
|
encontrado = (data !== null && data !== void 0 ? data : []).find(function (item) {
|
|
1381
1391
|
var _item$article;
|
|
1382
1392
|
|
|
@@ -1384,12 +1394,12 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1384
1394
|
});
|
|
1385
1395
|
|
|
1386
1396
|
if (encontrado) {
|
|
1387
|
-
|
|
1397
|
+
_context7.next = 11;
|
|
1388
1398
|
break;
|
|
1389
1399
|
}
|
|
1390
1400
|
|
|
1391
1401
|
setAvisoFamilia("Ese producto no está en ninguna orden de trabajo, así que no se puede abrir desde aquí.");
|
|
1392
|
-
return
|
|
1402
|
+
return _context7.abrupt("return");
|
|
1393
1403
|
|
|
1394
1404
|
case 11:
|
|
1395
1405
|
sessionStorage.setItem("productSelected", JSON.stringify(encontrado));
|
|
@@ -1400,30 +1410,30 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1400
1410
|
product: [encontrado]
|
|
1401
1411
|
}));
|
|
1402
1412
|
window.location.assign("/EditProducts");
|
|
1403
|
-
|
|
1413
|
+
_context7.next = 21;
|
|
1404
1414
|
break;
|
|
1405
1415
|
|
|
1406
1416
|
case 17:
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
console.error("openFamilyMember: ",
|
|
1417
|
+
_context7.prev = 17;
|
|
1418
|
+
_context7.t0 = _context7["catch"](2);
|
|
1419
|
+
console.error("openFamilyMember: ", _context7.t0);
|
|
1410
1420
|
setAvisoFamilia("No se pudo abrir ese producto. Intenta de nuevo.");
|
|
1411
1421
|
|
|
1412
1422
|
case 21:
|
|
1413
|
-
|
|
1423
|
+
_context7.prev = 21;
|
|
1414
1424
|
setLoadingVariant(null);
|
|
1415
|
-
return
|
|
1425
|
+
return _context7.finish(21);
|
|
1416
1426
|
|
|
1417
1427
|
case 24:
|
|
1418
1428
|
case "end":
|
|
1419
|
-
return
|
|
1429
|
+
return _context7.stop();
|
|
1420
1430
|
}
|
|
1421
1431
|
}
|
|
1422
|
-
},
|
|
1432
|
+
}, _callee7, null, [[2, 17, 21, 24]]);
|
|
1423
1433
|
}));
|
|
1424
1434
|
|
|
1425
1435
|
return function openFamilyMember(_x3) {
|
|
1426
|
-
return
|
|
1436
|
+
return _ref11.apply(this, arguments);
|
|
1427
1437
|
};
|
|
1428
1438
|
}();
|
|
1429
1439
|
/*
|
|
@@ -1512,31 +1522,31 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1512
1522
|
|
|
1513
1523
|
|
|
1514
1524
|
var handleOnRestoreInheritance = /*#__PURE__*/function () {
|
|
1515
|
-
var
|
|
1525
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(attributeId) {
|
|
1516
1526
|
var _state$product14;
|
|
1517
1527
|
|
|
1518
1528
|
var kind,
|
|
1519
1529
|
esDescripcion,
|
|
1520
1530
|
res,
|
|
1521
1531
|
data,
|
|
1522
|
-
|
|
1523
|
-
return _regenerator.default.wrap(function
|
|
1532
|
+
_args8 = arguments;
|
|
1533
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
1524
1534
|
while (1) {
|
|
1525
|
-
switch (
|
|
1535
|
+
switch (_context8.prev = _context8.next) {
|
|
1526
1536
|
case 0:
|
|
1527
|
-
kind =
|
|
1537
|
+
kind = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : "attribute";
|
|
1528
1538
|
|
|
1529
1539
|
if (!(!attributeId || !((_state$product14 = state.product) !== null && _state$product14 !== void 0 && _state$product14.id_article))) {
|
|
1530
|
-
|
|
1540
|
+
_context8.next = 3;
|
|
1531
1541
|
break;
|
|
1532
1542
|
}
|
|
1533
1543
|
|
|
1534
|
-
return
|
|
1544
|
+
return _context8.abrupt("return");
|
|
1535
1545
|
|
|
1536
1546
|
case 3:
|
|
1537
1547
|
esDescripcion = kind === "description";
|
|
1538
|
-
|
|
1539
|
-
|
|
1548
|
+
_context8.prev = 4;
|
|
1549
|
+
_context8.next = 7;
|
|
1540
1550
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/restore"), (0, _objectSpread5.default)({
|
|
1541
1551
|
articleId: state.product.id_article
|
|
1542
1552
|
}, esDescripcion ? {
|
|
@@ -1550,11 +1560,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1550
1560
|
});
|
|
1551
1561
|
|
|
1552
1562
|
case 7:
|
|
1553
|
-
res =
|
|
1563
|
+
res = _context8.sent;
|
|
1554
1564
|
data = (0, _api.readPayload)(res);
|
|
1555
1565
|
|
|
1556
1566
|
if (!esDescripcion) {
|
|
1557
|
-
|
|
1567
|
+
_context8.next = 12;
|
|
1558
1568
|
break;
|
|
1559
1569
|
}
|
|
1560
1570
|
|
|
@@ -1568,7 +1578,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1568
1578
|
};
|
|
1569
1579
|
})
|
|
1570
1580
|
});
|
|
1571
|
-
return
|
|
1581
|
+
return _context8.abrupt("return");
|
|
1572
1582
|
|
|
1573
1583
|
case 12:
|
|
1574
1584
|
dispatch({
|
|
@@ -1581,24 +1591,24 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1581
1591
|
};
|
|
1582
1592
|
})
|
|
1583
1593
|
});
|
|
1584
|
-
|
|
1594
|
+
_context8.next = 18;
|
|
1585
1595
|
break;
|
|
1586
1596
|
|
|
1587
1597
|
case 15:
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
console.error("restoreInheritance: ",
|
|
1598
|
+
_context8.prev = 15;
|
|
1599
|
+
_context8.t0 = _context8["catch"](4);
|
|
1600
|
+
console.error("restoreInheritance: ", _context8.t0);
|
|
1591
1601
|
|
|
1592
1602
|
case 18:
|
|
1593
1603
|
case "end":
|
|
1594
|
-
return
|
|
1604
|
+
return _context8.stop();
|
|
1595
1605
|
}
|
|
1596
1606
|
}
|
|
1597
|
-
},
|
|
1607
|
+
}, _callee8, null, [[4, 15]]);
|
|
1598
1608
|
}));
|
|
1599
1609
|
|
|
1600
1610
|
return function handleOnRestoreInheritance(_x4) {
|
|
1601
|
-
return
|
|
1611
|
+
return _ref13.apply(this, arguments);
|
|
1602
1612
|
};
|
|
1603
1613
|
}();
|
|
1604
1614
|
/*
|
|
@@ -1625,45 +1635,45 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1625
1635
|
};
|
|
1626
1636
|
|
|
1627
1637
|
var handleOnClickSave = /*#__PURE__*/function () {
|
|
1628
|
-
var
|
|
1638
|
+
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
1629
1639
|
var _familia$variants, cambios, familia, hijos;
|
|
1630
1640
|
|
|
1631
|
-
return _regenerator.default.wrap(function
|
|
1641
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1632
1642
|
while (1) {
|
|
1633
|
-
switch (
|
|
1643
|
+
switch (_context9.prev = _context9.next) {
|
|
1634
1644
|
case 0:
|
|
1635
1645
|
if (!(state.saving || preparandoPropagacion)) {
|
|
1636
|
-
|
|
1646
|
+
_context9.next = 2;
|
|
1637
1647
|
break;
|
|
1638
1648
|
}
|
|
1639
1649
|
|
|
1640
|
-
return
|
|
1650
|
+
return _context9.abrupt("return");
|
|
1641
1651
|
|
|
1642
1652
|
case 2:
|
|
1643
|
-
|
|
1644
|
-
|
|
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;
|
|
1645
1655
|
break;
|
|
1646
1656
|
|
|
1647
1657
|
case 5:
|
|
1648
|
-
|
|
1658
|
+
_context9.next = 7;
|
|
1649
1659
|
return saveDescriptions(token);
|
|
1650
1660
|
|
|
1651
1661
|
case 7:
|
|
1652
|
-
return
|
|
1662
|
+
return _context9.abrupt("break", 36);
|
|
1653
1663
|
|
|
1654
1664
|
case 8:
|
|
1655
1665
|
cambios = cambiosDeFichaTecnica();
|
|
1656
1666
|
|
|
1657
1667
|
if (!(cambios.length === 0)) {
|
|
1658
|
-
|
|
1668
|
+
_context9.next = 13;
|
|
1659
1669
|
break;
|
|
1660
1670
|
}
|
|
1661
1671
|
|
|
1662
|
-
|
|
1672
|
+
_context9.next = 12;
|
|
1663
1673
|
return saveDatasheets(token);
|
|
1664
1674
|
|
|
1665
1675
|
case 12:
|
|
1666
|
-
return
|
|
1676
|
+
return _context9.abrupt("break", 36);
|
|
1667
1677
|
|
|
1668
1678
|
case 13:
|
|
1669
1679
|
/*
|
|
@@ -1682,21 +1692,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1682
1692
|
*/
|
|
1683
1693
|
setPreparandoPropagacion(true);
|
|
1684
1694
|
familia = null;
|
|
1685
|
-
|
|
1686
|
-
|
|
1695
|
+
_context9.prev = 15;
|
|
1696
|
+
_context9.next = 18;
|
|
1687
1697
|
return loadFamily(true);
|
|
1688
1698
|
|
|
1689
1699
|
case 18:
|
|
1690
|
-
familia =
|
|
1700
|
+
familia = _context9.sent;
|
|
1691
1701
|
|
|
1692
1702
|
case 19:
|
|
1693
|
-
|
|
1703
|
+
_context9.prev = 19;
|
|
1694
1704
|
setPreparandoPropagacion(false);
|
|
1695
|
-
return
|
|
1705
|
+
return _context9.finish(19);
|
|
1696
1706
|
|
|
1697
1707
|
case 22:
|
|
1698
1708
|
if (!(!familia || familia.error)) {
|
|
1699
|
-
|
|
1709
|
+
_context9.next = 25;
|
|
1700
1710
|
break;
|
|
1701
1711
|
}
|
|
1702
1712
|
|
|
@@ -1733,7 +1743,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1733
1743
|
}]
|
|
1734
1744
|
}
|
|
1735
1745
|
});
|
|
1736
|
-
return
|
|
1746
|
+
return _context9.abrupt("return");
|
|
1737
1747
|
|
|
1738
1748
|
case 25:
|
|
1739
1749
|
hijos = ((_familia$variants = familia.variants) !== null && _familia$variants !== void 0 ? _familia$variants : []).filter(function (v) {
|
|
@@ -1741,46 +1751,46 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1741
1751
|
});
|
|
1742
1752
|
|
|
1743
1753
|
if (!(hijos.length > 0)) {
|
|
1744
|
-
|
|
1754
|
+
_context9.next = 29;
|
|
1745
1755
|
break;
|
|
1746
1756
|
}
|
|
1747
1757
|
|
|
1748
1758
|
setPendingPropagation({
|
|
1749
1759
|
cambios: cambios
|
|
1750
1760
|
});
|
|
1751
|
-
return
|
|
1761
|
+
return _context9.abrupt("return");
|
|
1752
1762
|
|
|
1753
1763
|
case 29:
|
|
1754
|
-
|
|
1764
|
+
_context9.next = 31;
|
|
1755
1765
|
return saveDatasheets(token);
|
|
1756
1766
|
|
|
1757
1767
|
case 31:
|
|
1758
|
-
return
|
|
1768
|
+
return _context9.abrupt("break", 36);
|
|
1759
1769
|
|
|
1760
1770
|
case 32:
|
|
1761
|
-
|
|
1771
|
+
_context9.next = 34;
|
|
1762
1772
|
return updateImages(token);
|
|
1763
1773
|
|
|
1764
1774
|
case 34:
|
|
1765
|
-
return
|
|
1775
|
+
return _context9.abrupt("break", 36);
|
|
1766
1776
|
|
|
1767
1777
|
case 35:
|
|
1768
|
-
return
|
|
1778
|
+
return _context9.abrupt("break", 36);
|
|
1769
1779
|
|
|
1770
1780
|
case 36:
|
|
1771
|
-
|
|
1781
|
+
_context9.next = 38;
|
|
1772
1782
|
return loadData(false);
|
|
1773
1783
|
|
|
1774
1784
|
case 38:
|
|
1775
1785
|
case "end":
|
|
1776
|
-
return
|
|
1786
|
+
return _context9.stop();
|
|
1777
1787
|
}
|
|
1778
1788
|
}
|
|
1779
|
-
},
|
|
1789
|
+
}, _callee9, null, [[15,, 19, 22]]);
|
|
1780
1790
|
}));
|
|
1781
1791
|
|
|
1782
1792
|
return function handleOnClickSave() {
|
|
1783
|
-
return
|
|
1793
|
+
return _ref14.apply(this, arguments);
|
|
1784
1794
|
};
|
|
1785
1795
|
}();
|
|
1786
1796
|
|
|
@@ -1848,24 +1858,24 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1848
1858
|
};
|
|
1849
1859
|
|
|
1850
1860
|
var handleOnApproveSingleService = /*#__PURE__*/function () {
|
|
1851
|
-
var
|
|
1852
|
-
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) {
|
|
1853
1863
|
while (1) {
|
|
1854
|
-
switch (
|
|
1864
|
+
switch (_context10.prev = _context10.next) {
|
|
1855
1865
|
case 0:
|
|
1856
|
-
|
|
1866
|
+
_context10.next = 2;
|
|
1857
1867
|
return sendSingleEvaluation("A");
|
|
1858
1868
|
|
|
1859
1869
|
case 2:
|
|
1860
1870
|
case "end":
|
|
1861
|
-
return
|
|
1871
|
+
return _context10.stop();
|
|
1862
1872
|
}
|
|
1863
1873
|
}
|
|
1864
|
-
},
|
|
1874
|
+
}, _callee10);
|
|
1865
1875
|
}));
|
|
1866
1876
|
|
|
1867
1877
|
return function handleOnApproveSingleService() {
|
|
1868
|
-
return
|
|
1878
|
+
return _ref15.apply(this, arguments);
|
|
1869
1879
|
};
|
|
1870
1880
|
}();
|
|
1871
1881
|
|
|
@@ -1874,21 +1884,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1874
1884
|
};
|
|
1875
1885
|
|
|
1876
1886
|
var sendSingleEvaluation = /*#__PURE__*/function () {
|
|
1877
|
-
var
|
|
1887
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
|
|
1878
1888
|
var _state$product$id_ord, _state$active_retaile4;
|
|
1879
1889
|
|
|
1880
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;
|
|
1881
1891
|
|
|
1882
|
-
return _regenerator.default.wrap(function
|
|
1892
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1883
1893
|
while (1) {
|
|
1884
|
-
switch (
|
|
1894
|
+
switch (_context11.prev = _context11.next) {
|
|
1885
1895
|
case 0:
|
|
1886
1896
|
if (!state.saving) {
|
|
1887
|
-
|
|
1897
|
+
_context11.next = 2;
|
|
1888
1898
|
break;
|
|
1889
1899
|
}
|
|
1890
1900
|
|
|
1891
|
-
return
|
|
1901
|
+
return _context11.abrupt("return");
|
|
1892
1902
|
|
|
1893
1903
|
case 2:
|
|
1894
1904
|
dispatch({
|
|
@@ -1909,16 +1919,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1909
1919
|
retailerId: retailerId
|
|
1910
1920
|
};
|
|
1911
1921
|
activeTab = state.active_tab;
|
|
1912
|
-
|
|
1922
|
+
_context11.prev = 11;
|
|
1913
1923
|
|
|
1914
1924
|
if (!result) {
|
|
1915
|
-
|
|
1925
|
+
_context11.next = 28;
|
|
1916
1926
|
break;
|
|
1917
1927
|
}
|
|
1918
1928
|
|
|
1919
1929
|
data.result = result;
|
|
1920
1930
|
data.retailerId = retailerId;
|
|
1921
|
-
|
|
1931
|
+
_context11.next = 17;
|
|
1922
1932
|
return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1923
1933
|
headers: {
|
|
1924
1934
|
Authorization: token
|
|
@@ -1926,7 +1936,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1926
1936
|
});
|
|
1927
1937
|
|
|
1928
1938
|
case 17:
|
|
1929
|
-
res =
|
|
1939
|
+
res = _context11.sent;
|
|
1930
1940
|
newStatuses = JSON.parse(res.data.body);
|
|
1931
1941
|
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1932
1942
|
articleStatus = newStatuses.newArticleStatus[articleId];
|
|
@@ -1957,7 +1967,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1957
1967
|
image: _genericModalCheck.default
|
|
1958
1968
|
}
|
|
1959
1969
|
});
|
|
1960
|
-
|
|
1970
|
+
_context11.next = 33;
|
|
1961
1971
|
break;
|
|
1962
1972
|
|
|
1963
1973
|
case 28:
|
|
@@ -1973,7 +1983,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1973
1983
|
icon = _genericModalCheck.default;
|
|
1974
1984
|
}
|
|
1975
1985
|
|
|
1976
|
-
|
|
1986
|
+
_context11.next = 32;
|
|
1977
1987
|
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1978
1988
|
headers: {
|
|
1979
1989
|
Authorization: token
|
|
@@ -1981,7 +1991,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1981
1991
|
});
|
|
1982
1992
|
|
|
1983
1993
|
case 32:
|
|
1984
|
-
res =
|
|
1994
|
+
res = _context11.sent;
|
|
1985
1995
|
|
|
1986
1996
|
case 33:
|
|
1987
1997
|
if (res.data.statusCode === 200) {
|
|
@@ -2066,13 +2076,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2066
2076
|
});
|
|
2067
2077
|
}
|
|
2068
2078
|
|
|
2069
|
-
|
|
2079
|
+
_context11.next = 40;
|
|
2070
2080
|
break;
|
|
2071
2081
|
|
|
2072
2082
|
case 36:
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
console.error("Error sending evaluation:",
|
|
2083
|
+
_context11.prev = 36;
|
|
2084
|
+
_context11.t0 = _context11["catch"](11);
|
|
2085
|
+
console.error("Error sending evaluation:", _context11.t0);
|
|
2076
2086
|
dispatch({
|
|
2077
2087
|
type: "SET_MODAL",
|
|
2078
2088
|
payload: {
|
|
@@ -2084,45 +2094,45 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2084
2094
|
});
|
|
2085
2095
|
|
|
2086
2096
|
case 40:
|
|
2087
|
-
|
|
2097
|
+
_context11.prev = 40;
|
|
2088
2098
|
dispatch({
|
|
2089
2099
|
type: "SET_SAVING",
|
|
2090
2100
|
payload: false
|
|
2091
2101
|
});
|
|
2092
|
-
return
|
|
2102
|
+
return _context11.finish(40);
|
|
2093
2103
|
|
|
2094
2104
|
case 43:
|
|
2095
2105
|
case "end":
|
|
2096
|
-
return
|
|
2106
|
+
return _context11.stop();
|
|
2097
2107
|
}
|
|
2098
2108
|
}
|
|
2099
|
-
},
|
|
2109
|
+
}, _callee11, null, [[11, 36, 40, 43]]);
|
|
2100
2110
|
}));
|
|
2101
2111
|
|
|
2102
2112
|
return function sendSingleEvaluation(_x5) {
|
|
2103
|
-
return
|
|
2113
|
+
return _ref16.apply(this, arguments);
|
|
2104
2114
|
};
|
|
2105
2115
|
}();
|
|
2106
2116
|
|
|
2107
2117
|
var handleOnApproveAllServices = /*#__PURE__*/function () {
|
|
2108
|
-
var
|
|
2109
|
-
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) {
|
|
2110
2120
|
while (1) {
|
|
2111
|
-
switch (
|
|
2121
|
+
switch (_context12.prev = _context12.next) {
|
|
2112
2122
|
case 0:
|
|
2113
|
-
|
|
2123
|
+
_context12.next = 2;
|
|
2114
2124
|
return sendBulkEvaluation("A");
|
|
2115
2125
|
|
|
2116
2126
|
case 2:
|
|
2117
2127
|
case "end":
|
|
2118
|
-
return
|
|
2128
|
+
return _context12.stop();
|
|
2119
2129
|
}
|
|
2120
2130
|
}
|
|
2121
|
-
},
|
|
2131
|
+
}, _callee12);
|
|
2122
2132
|
}));
|
|
2123
2133
|
|
|
2124
2134
|
return function handleOnApproveAllServices() {
|
|
2125
|
-
return
|
|
2135
|
+
return _ref17.apply(this, arguments);
|
|
2126
2136
|
};
|
|
2127
2137
|
}();
|
|
2128
2138
|
|
|
@@ -2132,18 +2142,18 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2132
2142
|
};
|
|
2133
2143
|
|
|
2134
2144
|
var sendBulkEvaluation = /*#__PURE__*/function () {
|
|
2135
|
-
var
|
|
2145
|
+
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
|
|
2136
2146
|
var _state$services_data3, evaluationArray, conceptArray, status, updatedStatusByRetailer, updatedProduct, updatedServicesData;
|
|
2137
2147
|
|
|
2138
|
-
return _regenerator.default.wrap(function
|
|
2148
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
2139
2149
|
while (1) {
|
|
2140
|
-
switch (
|
|
2150
|
+
switch (_context13.prev = _context13.next) {
|
|
2141
2151
|
case 0:
|
|
2142
2152
|
dispatch({
|
|
2143
2153
|
type: "SET_SAVING",
|
|
2144
2154
|
payload: true
|
|
2145
2155
|
});
|
|
2146
|
-
|
|
2156
|
+
_context13.prev = 1;
|
|
2147
2157
|
evaluationArray = [];
|
|
2148
2158
|
conceptArray = (0, _utils.getConceptsByRole)(user.id_role);
|
|
2149
2159
|
(_state$services_data3 = state.services_data) === null || _state$services_data3 === void 0 ? void 0 : _state$services_data3.forEach(function (ret, idx) {
|
|
@@ -2168,7 +2178,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2168
2178
|
}));
|
|
2169
2179
|
}
|
|
2170
2180
|
});
|
|
2171
|
-
|
|
2181
|
+
_context13.next = 7;
|
|
2172
2182
|
return Promise.all(evaluationArray);
|
|
2173
2183
|
|
|
2174
2184
|
case 7:
|
|
@@ -2223,41 +2233,41 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2223
2233
|
image: _genericModalCheck.default
|
|
2224
2234
|
}
|
|
2225
2235
|
});
|
|
2226
|
-
|
|
2236
|
+
_context13.next = 19;
|
|
2227
2237
|
break;
|
|
2228
2238
|
|
|
2229
2239
|
case 16:
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
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);
|
|
2233
2243
|
|
|
2234
2244
|
case 19:
|
|
2235
|
-
|
|
2245
|
+
_context13.prev = 19;
|
|
2236
2246
|
dispatch({
|
|
2237
2247
|
type: "SET_SAVING",
|
|
2238
2248
|
payload: false
|
|
2239
2249
|
});
|
|
2240
|
-
return
|
|
2250
|
+
return _context13.finish(19);
|
|
2241
2251
|
|
|
2242
2252
|
case 22:
|
|
2243
2253
|
case "end":
|
|
2244
|
-
return
|
|
2254
|
+
return _context13.stop();
|
|
2245
2255
|
}
|
|
2246
2256
|
}
|
|
2247
|
-
},
|
|
2257
|
+
}, _callee13, null, [[1, 16, 19, 22]]);
|
|
2248
2258
|
}));
|
|
2249
2259
|
|
|
2250
2260
|
return function sendBulkEvaluation(_x6) {
|
|
2251
|
-
return
|
|
2261
|
+
return _ref18.apply(this, arguments);
|
|
2252
2262
|
};
|
|
2253
2263
|
}();
|
|
2254
2264
|
|
|
2255
2265
|
var handleOnChangeAssignations = /*#__PURE__*/function () {
|
|
2256
|
-
var
|
|
2266
|
+
var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
|
|
2257
2267
|
var concept, data, updatedProduct;
|
|
2258
|
-
return _regenerator.default.wrap(function
|
|
2268
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
2259
2269
|
while (1) {
|
|
2260
|
-
switch (
|
|
2270
|
+
switch (_context14.prev = _context14.next) {
|
|
2261
2271
|
case 0:
|
|
2262
2272
|
concept = (0, _utils.getConceptByTab)(state.active_tab);
|
|
2263
2273
|
data = {
|
|
@@ -2268,7 +2278,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2268
2278
|
concept: concept,
|
|
2269
2279
|
userId: assignationId
|
|
2270
2280
|
};
|
|
2271
|
-
|
|
2281
|
+
_context14.next = 4;
|
|
2272
2282
|
return (0, _axios.default)({
|
|
2273
2283
|
method: "post",
|
|
2274
2284
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
@@ -2287,14 +2297,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2287
2297
|
|
|
2288
2298
|
case 6:
|
|
2289
2299
|
case "end":
|
|
2290
|
-
return
|
|
2300
|
+
return _context14.stop();
|
|
2291
2301
|
}
|
|
2292
2302
|
}
|
|
2293
|
-
},
|
|
2303
|
+
}, _callee14);
|
|
2294
2304
|
}));
|
|
2295
2305
|
|
|
2296
2306
|
return function handleOnChangeAssignations(_x7, _x8) {
|
|
2297
|
-
return
|
|
2307
|
+
return _ref19.apply(this, arguments);
|
|
2298
2308
|
};
|
|
2299
2309
|
}();
|
|
2300
2310
|
|
|
@@ -2329,16 +2339,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2329
2339
|
};
|
|
2330
2340
|
|
|
2331
2341
|
var handleOnSubmitComment = /*#__PURE__*/function () {
|
|
2332
|
-
var
|
|
2342
|
+
var _ref20 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e) {
|
|
2333
2343
|
var commentText;
|
|
2334
|
-
return _regenerator.default.wrap(function
|
|
2344
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
2335
2345
|
while (1) {
|
|
2336
|
-
switch (
|
|
2346
|
+
switch (_context15.prev = _context15.next) {
|
|
2337
2347
|
case 0:
|
|
2338
2348
|
e.preventDefault();
|
|
2339
2349
|
commentText = document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML;
|
|
2340
|
-
|
|
2341
|
-
|
|
2350
|
+
_context15.prev = 2;
|
|
2351
|
+
_context15.next = 5;
|
|
2342
2352
|
return createComment(commentText, token);
|
|
2343
2353
|
|
|
2344
2354
|
case 5:
|
|
@@ -2351,13 +2361,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2351
2361
|
image: _genericModalCheck.default
|
|
2352
2362
|
}
|
|
2353
2363
|
});
|
|
2354
|
-
|
|
2364
|
+
_context15.next = 12;
|
|
2355
2365
|
break;
|
|
2356
2366
|
|
|
2357
2367
|
case 8:
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
console.error("Error saving comment:",
|
|
2368
|
+
_context15.prev = 8;
|
|
2369
|
+
_context15.t0 = _context15["catch"](2);
|
|
2370
|
+
console.error("Error saving comment:", _context15.t0);
|
|
2361
2371
|
dispatch({
|
|
2362
2372
|
type: "SET_MODAL",
|
|
2363
2373
|
payload: {
|
|
@@ -2370,14 +2380,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2370
2380
|
|
|
2371
2381
|
case 12:
|
|
2372
2382
|
case "end":
|
|
2373
|
-
return
|
|
2383
|
+
return _context15.stop();
|
|
2374
2384
|
}
|
|
2375
2385
|
}
|
|
2376
|
-
},
|
|
2386
|
+
}, _callee15, null, [[2, 8]]);
|
|
2377
2387
|
}));
|
|
2378
2388
|
|
|
2379
2389
|
return function handleOnSubmitComment(_x9) {
|
|
2380
|
-
return
|
|
2390
|
+
return _ref20.apply(this, arguments);
|
|
2381
2391
|
};
|
|
2382
2392
|
}();
|
|
2383
2393
|
|
|
@@ -2747,21 +2757,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2747
2757
|
type: "pink",
|
|
2748
2758
|
label: "Aceptar",
|
|
2749
2759
|
size: 12,
|
|
2750
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2760
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2751
2761
|
var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
|
|
2752
|
-
return _regenerator.default.wrap(function
|
|
2762
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2753
2763
|
while (1) {
|
|
2754
|
-
switch (
|
|
2764
|
+
switch (_context16.prev = _context16.next) {
|
|
2755
2765
|
case 0:
|
|
2756
2766
|
elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
|
|
2757
2767
|
|
|
2758
2768
|
if (!(!elements || elements.length === 0)) {
|
|
2759
|
-
|
|
2769
|
+
_context16.next = 4;
|
|
2760
2770
|
break;
|
|
2761
2771
|
}
|
|
2762
2772
|
|
|
2763
2773
|
console.error("Elemento no encontrado");
|
|
2764
|
-
return
|
|
2774
|
+
return _context16.abrupt("return");
|
|
2765
2775
|
|
|
2766
2776
|
case 4:
|
|
2767
2777
|
isMessageEmpty = Array.from(elements).every(function (el) {
|
|
@@ -2770,7 +2780,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2770
2780
|
});
|
|
2771
2781
|
|
|
2772
2782
|
if (!isMessageEmpty) {
|
|
2773
|
-
|
|
2783
|
+
_context16.next = 10;
|
|
2774
2784
|
break;
|
|
2775
2785
|
}
|
|
2776
2786
|
|
|
@@ -2785,13 +2795,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2785
2795
|
container.appendChild(alert);
|
|
2786
2796
|
}
|
|
2787
2797
|
|
|
2788
|
-
return
|
|
2798
|
+
return _context16.abrupt("return");
|
|
2789
2799
|
|
|
2790
2800
|
case 10:
|
|
2791
2801
|
fullMessage = Array.from(elements).map(function (element) {
|
|
2792
2802
|
return element.innerHTML;
|
|
2793
2803
|
}).join("").replace(/<br\s*\/?>/gi, "\n");
|
|
2794
|
-
|
|
2804
|
+
_context16.next = 13;
|
|
2795
2805
|
return createComment(fullMessage, token);
|
|
2796
2806
|
|
|
2797
2807
|
case 13:
|
|
@@ -2800,10 +2810,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2800
2810
|
|
|
2801
2811
|
case 15:
|
|
2802
2812
|
case "end":
|
|
2803
|
-
return
|
|
2813
|
+
return _context16.stop();
|
|
2804
2814
|
}
|
|
2805
2815
|
}
|
|
2806
|
-
},
|
|
2816
|
+
}, _callee16);
|
|
2807
2817
|
}))
|
|
2808
2818
|
}, "btn-Aceptar")]
|
|
2809
2819
|
}), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
|
|
@@ -3217,20 +3227,20 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3217
3227
|
reviewed: crossComment
|
|
3218
3228
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
3219
3229
|
buttonType: "circular-button accept-button",
|
|
3220
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
3221
|
-
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) {
|
|
3222
3232
|
while (1) {
|
|
3223
|
-
switch (
|
|
3233
|
+
switch (_context17.prev = _context17.next) {
|
|
3224
3234
|
case 0:
|
|
3225
3235
|
setCrossComment(true);
|
|
3226
3236
|
commentRevised();
|
|
3227
3237
|
|
|
3228
3238
|
case 2:
|
|
3229
3239
|
case "end":
|
|
3230
|
-
return
|
|
3240
|
+
return _context17.stop();
|
|
3231
3241
|
}
|
|
3232
3242
|
}
|
|
3233
|
-
},
|
|
3243
|
+
}, _callee17);
|
|
3234
3244
|
}))
|
|
3235
3245
|
})]
|
|
3236
3246
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
package/package.json
CHANGED
|
@@ -802,7 +802,7 @@ const RetailerProductEditionView = ({
|
|
|
802
802
|
return currentStatus;
|
|
803
803
|
};
|
|
804
804
|
|
|
805
|
-
const handleOnClickSaveImages = () => {
|
|
805
|
+
const handleOnClickSaveImages = async () => {
|
|
806
806
|
if (state.product?.services?.images === 1) {
|
|
807
807
|
/**
|
|
808
808
|
* `updateImages` y NO `saveImageAttrs`.
|
|
@@ -819,7 +819,13 @@ const RetailerProductEditionView = ({
|
|
|
819
819
|
* botón de guardar del menú de pestañas (`handleOnClickSave`), así que
|
|
820
820
|
* ambos caminos quedan consistentes.
|
|
821
821
|
*/
|
|
822
|
-
updateImages(token);
|
|
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);
|
|
823
829
|
}
|
|
824
830
|
};
|
|
825
831
|
|