contentoh-components-library 21.6.31 → 21.6.32

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.
@@ -160,81 +160,81 @@ function regenerateVideoThumbnails(_x) {
160
160
  }
161
161
 
162
162
  function _regenerateVideoThumbnails() {
163
- _regenerateVideoThumbnails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(values) {
164
- return _regenerator.default.wrap(function _callee18$(_context18) {
163
+ _regenerateVideoThumbnails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(values) {
164
+ return _regenerator.default.wrap(function _callee17$(_context17) {
165
165
  while (1) {
166
- switch (_context18.prev = _context18.next) {
166
+ switch (_context17.prev = _context17.next) {
167
167
  case 0:
168
168
  if (Array.isArray(values)) {
169
- _context18.next = 2;
169
+ _context17.next = 2;
170
170
  break;
171
171
  }
172
172
 
173
- return _context18.abrupt("return", values);
173
+ return _context17.abrupt("return", values);
174
174
 
175
175
  case 2:
176
- return _context18.abrupt("return", Promise.all(values.map( /*#__PURE__*/function () {
177
- var _ref20 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(value) {
176
+ return _context17.abrupt("return", Promise.all(values.map( /*#__PURE__*/function () {
177
+ var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16(value) {
178
178
  var base64, videoSrc, thumbnail;
179
- return _regenerator.default.wrap(function _callee17$(_context17) {
179
+ return _regenerator.default.wrap(function _callee16$(_context16) {
180
180
  while (1) {
181
- switch (_context17.prev = _context17.next) {
181
+ switch (_context16.prev = _context16.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
- _context17.next = 2;
184
+ _context16.next = 2;
185
185
  break;
186
186
  }
187
187
 
188
- return _context17.abrupt("return", value);
188
+ return _context16.abrupt("return", value);
189
189
 
190
190
  case 2:
191
- _context17.prev = 2;
192
- _context17.next = 5;
191
+ _context16.prev = 2;
192
+ _context16.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 = _context17.sent;
196
+ base64 = _context16.sent;
197
197
  videoSrc = "data:video/mp4;base64," + base64.split(",")[1];
198
- _context17.next = 9;
198
+ _context16.next = 9;
199
199
  return (0, _generateThumnail.default)(videoSrc, 2);
200
200
 
201
201
  case 9:
202
- thumbnail = _context17.sent;
203
- return _context17.abrupt("return", (0, _objectSpread5.default)((0, _objectSpread5.default)({}, value), {}, {
202
+ thumbnail = _context16.sent;
203
+ return _context16.abrupt("return", (0, _objectSpread5.default)((0, _objectSpread5.default)({}, value), {}, {
204
204
  src: thumbnail
205
205
  }));
206
206
 
207
207
  case 13:
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);
208
+ _context16.prev = 13;
209
+ _context16.t0 = _context16["catch"](2);
210
+ console.error("Error al generar thumbnail del video:", _context16.t0);
211
+ return _context16.abrupt("return", value);
212
212
 
213
213
  case 17:
214
214
  case "end":
215
- return _context17.stop();
215
+ return _context16.stop();
216
216
  }
217
217
  }
218
- }, _callee17, null, [[2, 13]]);
218
+ }, _callee16, null, [[2, 13]]);
219
219
  }));
220
220
 
221
- return function (_x10) {
222
- return _ref20.apply(this, arguments);
221
+ return function (_x9) {
222
+ return _ref19.apply(this, arguments);
223
223
  };
224
224
  }())));
225
225
 
226
226
  case 3:
227
227
  case "end":
228
- return _context18.stop();
228
+ return _context17.stop();
229
229
  }
230
230
  }
231
- }, _callee18);
231
+ }, _callee17);
232
232
  }));
233
233
  return _regenerateVideoThumbnails.apply(this, arguments);
234
234
  }
235
235
 
236
236
  var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
237
- var _state$errors, _family$variants, _state$product12, _state$product13, _state$product14, _state$active_retaile5, _location$state, _location$state2, _state$active_retaile6, _state$active_retaile7, _state$images_values$2, _state$images_values10, _state$images_values11, _state$product15, _state$active_retaile8, _state$product16, _state$product17, _state$product18, _family$variants2, _family$variants3, _state$active_percent, _state$active_percent2, _state$active_percent3, _state$active_retaile9, _state$active_retaile10, _state$active_retaile11, _state$product19, _state$product20, _state$product21, _state$datasheets_inp, _state$datasheets_inp2, _state$product22, _state$images_values12, _state$comment;
237
+ var _state$product10, _family$variants, _state$product11, _state$errors, _family$variants2, _state$product14, _state$product15, _state$product16, _state$active_retaile5, _location$state, _location$state2, _state$active_retaile6, _state$active_retaile7, _state$images_values$2, _state$images_values10, _state$images_values11, _state$product17, _state$active_retaile8, _family$variants3, _family$variants4, _state$active_percent, _state$active_percent2, _state$active_percent3, _state$active_retaile9, _state$active_retaile10, _state$active_retaile11, _state$product18, _state$product19, _state$product20, _state$datasheets_inp, _state$datasheets_inp2, _state$product21, _state$images_values12, _state$comment;
238
238
 
239
239
  var tabsSections = _ref.tabsSections,
240
240
  _ref$productSelected = _ref.productSelected,
@@ -330,43 +330,38 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
330
330
 
331
331
  var _useState27 = (0, _react.useState)(null),
332
332
  _useState28 = (0, _slicedToArray2.default)(_useState27, 2),
333
- loadingVariant = _useState28[0],
334
- setLoadingVariant = _useState28[1];
333
+ pendingPropagation = _useState28[0],
334
+ setPendingPropagation = _useState28[1];
335
335
 
336
- var _useState29 = (0, _react.useState)(null),
336
+ var _useState29 = (0, _react.useState)(false),
337
337
  _useState30 = (0, _slicedToArray2.default)(_useState29, 2),
338
- pendingPropagation = _useState30[0],
339
- setPendingPropagation = _useState30[1];
338
+ preparandoPropagacion = _useState30[0],
339
+ setPreparandoPropagacion = _useState30[1];
340
340
 
341
- var _useState31 = (0, _react.useState)(false),
341
+ var _useState31 = (0, _react.useState)([]),
342
342
  _useState32 = (0, _slicedToArray2.default)(_useState31, 2),
343
- preparandoPropagacion = _useState32[0],
344
- setPreparandoPropagacion = _useState32[1];
343
+ auditServices = _useState32[0],
344
+ setAuditServices = _useState32[1];
345
345
 
346
346
  var _useState33 = (0, _react.useState)([]),
347
347
  _useState34 = (0, _slicedToArray2.default)(_useState33, 2),
348
- auditServices = _useState34[0],
349
- setAuditServices = _useState34[1];
348
+ auditDatasheets = _useState34[0],
349
+ setAuditDatasheets = _useState34[1];
350
350
 
351
351
  var _useState35 = (0, _react.useState)([]),
352
352
  _useState36 = (0, _slicedToArray2.default)(_useState35, 2),
353
- auditDatasheets = _useState36[0],
354
- setAuditDatasheets = _useState36[1];
353
+ auditDescriptions = _useState36[0],
354
+ setAuditDescriptions = _useState36[1];
355
355
 
356
- var _useState37 = (0, _react.useState)([]),
356
+ var _useState37 = (0, _react.useState)(false),
357
357
  _useState38 = (0, _slicedToArray2.default)(_useState37, 2),
358
- auditDescriptions = _useState38[0],
359
- setAuditDescriptions = _useState38[1];
358
+ showModal = _useState38[0],
359
+ setShowModal = _useState38[1];
360
360
 
361
361
  var _useState39 = (0, _react.useState)(false),
362
362
  _useState40 = (0, _slicedToArray2.default)(_useState39, 2),
363
- showModal = _useState40[0],
364
- setShowModal = _useState40[1];
365
-
366
- var _useState41 = (0, _react.useState)(false),
367
- _useState42 = (0, _slicedToArray2.default)(_useState41, 2),
368
- compare = _useState42[0],
369
- setCompare = _useState42[1];
363
+ compare = _useState40[0],
364
+ setCompare = _useState40[1];
370
365
 
371
366
  var _useDropzone = (0, _reactDropzone.useDropzone)({
372
367
  accept: "image/*, video/mp4",
@@ -502,10 +497,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
502
497
  isDragActive = _useDropzone.isDragActive,
503
498
  open = _useDropzone.open;
504
499
 
505
- var _useState43 = (0, _react.useState)(false),
506
- _useState44 = (0, _slicedToArray2.default)(_useState43, 2),
507
- openChangeStatusModal = _useState44[0],
508
- setOpenChangeStatusModal = _useState44[1];
500
+ var _useState41 = (0, _react.useState)(false),
501
+ _useState42 = (0, _slicedToArray2.default)(_useState41, 2),
502
+ openChangeStatusModal = _useState42[0],
503
+ setOpenChangeStatusModal = _useState42[1];
509
504
 
510
505
  var thumbs = function thumbs() {
511
506
  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;
@@ -1141,22 +1136,28 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1141
1136
 
1142
1137
  var loadFamily = /*#__PURE__*/function () {
1143
1138
  var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
1144
- var _state$product8, res, data;
1139
+ var forzar,
1140
+ _state$product8,
1141
+ res,
1142
+ data,
1143
+ _args5 = arguments;
1145
1144
 
1146
1145
  return _regenerator.default.wrap(function _callee5$(_context5) {
1147
1146
  while (1) {
1148
1147
  switch (_context5.prev = _context5.next) {
1149
1148
  case 0:
1150
- if (!family) {
1151
- _context5.next = 2;
1149
+ forzar = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : false;
1150
+
1151
+ if (!(family && !forzar)) {
1152
+ _context5.next = 3;
1152
1153
  break;
1153
1154
  }
1154
1155
 
1155
1156
  return _context5.abrupt("return", family);
1156
1157
 
1157
- case 2:
1158
- _context5.prev = 2;
1159
- _context5.next = 5;
1158
+ case 3:
1159
+ _context5.prev = 3;
1160
+ _context5.next = 6;
1160
1161
  return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/family"), {
1161
1162
  articleId: (_state$product8 = state.product) === null || _state$product8 === void 0 ? void 0 : _state$product8.id_article
1162
1163
  }, {
@@ -1165,15 +1166,15 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1165
1166
  }
1166
1167
  });
1167
1168
 
1168
- case 5:
1169
+ case 6:
1169
1170
  res = _context5.sent;
1170
1171
  data = (0, _api.readPayload)(res);
1171
1172
  setFamily(data);
1172
1173
  return _context5.abrupt("return", data);
1173
1174
 
1174
- case 11:
1175
- _context5.prev = 11;
1176
- _context5.t0 = _context5["catch"](2);
1175
+ case 12:
1176
+ _context5.prev = 12;
1177
+ _context5.t0 = _context5["catch"](3);
1177
1178
  console.error("loadFamily: ", _context5.t0);
1178
1179
  setFamily({
1179
1180
  variants: [],
@@ -1182,12 +1183,12 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1182
1183
  });
1183
1184
  return _context5.abrupt("return", null);
1184
1185
 
1185
- case 16:
1186
+ case 17:
1186
1187
  case "end":
1187
1188
  return _context5.stop();
1188
1189
  }
1189
1190
  }
1190
- }, _callee5, null, [[2, 11]]);
1191
+ }, _callee5, null, [[3, 12]]);
1191
1192
  }));
1192
1193
 
1193
1194
  return function loadFamily() {
@@ -1195,89 +1196,53 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1195
1196
  };
1196
1197
  }();
1197
1198
  /*
1198
- Abre otra variante. Esta pantalla lee el producto de sessionStorage, no de la
1199
- URL, así que hay que dejarlo ahí antes de navegar; si no, cambia la dirección
1200
- y sigue mostrando el producto anterior.
1201
- Se pide por ID y no por UPC: hay 12,024 UPC repetidos entre artículos activos
1202
- y 5,579 de esos casos caen dentro de la misma compañía.
1199
+ En Creators el parentesco se pregunta, no viene con el producto.
1200
+ Su listado sale del endpoint de reportes, que no trae `variantsCount` ni
1201
+ `parentArticleId`: esas columnas se agregaron a las vistas pero DynamoDB no
1202
+ las tiene hasta que se corra el recorrido de datos. Y aunque las tuviera,
1203
+ dependería de lo actualizado que esté ese recorrido.
1204
+ Preguntar a `family` cuesta una llamada por ficha y da el dato de la base, no
1205
+ de una copia. Además aplica el alcance del perfil (§5.1): al equipo interno le
1206
+ devuelve los productos solicitados a ContentOh, que es justo lo que puede
1207
+ tocar.
1203
1208
  */
1204
1209
 
1205
1210
 
1206
- var openVariant = /*#__PURE__*/function () {
1207
- var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(articleId) {
1208
- var res, _readPayload, data, encontrado;
1209
-
1210
- return _regenerator.default.wrap(function _callee6$(_context6) {
1211
- while (1) {
1212
- switch (_context6.prev = _context6.next) {
1213
- case 0:
1214
- setLoadingVariant(articleId);
1215
- _context6.prev = 1;
1216
- _context6.next = 4;
1217
- return _axios.default.get("".concat(process.env.REACT_APP_NEW_ARTICLES_ENDPOINT), {
1218
- params: {
1219
- listType: "general",
1220
- filterByArticleId: articleId
1221
- },
1222
- headers: {
1223
- Authorization: token
1224
- }
1225
- });
1226
-
1227
- case 4:
1228
- res = _context6.sent;
1229
- _readPayload = (0, _api.readPayload)(res), data = _readPayload.data;
1230
- encontrado = (data !== null && data !== void 0 ? data : []).find(function (item) {
1231
- return Number(item.id_article) === Number(articleId);
1232
- });
1233
-
1234
- if (encontrado) {
1235
- sessionStorage.setItem("productSelected", JSON.stringify((0, _objectSpread5.default)((0, _objectSpread5.default)({}, encontrado), {}, {
1236
- article: {
1237
- id_article: encontrado.id_article
1238
- }
1239
- })));
1240
- }
1241
-
1242
- _context6.next = 13;
1243
- break;
1244
-
1245
- case 10:
1246
- _context6.prev = 10;
1247
- _context6.t0 = _context6["catch"](1);
1248
- // Se navega igual: dejar el clic sin efecto parecería que no responde.
1249
- console.error("openVariant: ", _context6.t0);
1211
+ (0, _react.useEffect)(function () {
1212
+ var _state$product9;
1250
1213
 
1251
- case 13:
1252
- _context6.prev = 13;
1253
- setLoadingVariant(null);
1254
- window.location.assign("/EditProducts");
1255
- return _context6.finish(13);
1214
+ if (!((_state$product9 = state.product) !== null && _state$product9 !== void 0 && _state$product9.id_article)) return;
1215
+ loadFamily(true); // eslint-disable-next-line react-hooks/exhaustive-deps
1216
+ }, [(_state$product10 = state.product) === null || _state$product10 === void 0 ? void 0 : _state$product10.id_article]); // El conteo sale de la familia recién consultada, no del producto.
1256
1217
 
1257
- case 17:
1258
- case "end":
1259
- return _context6.stop();
1260
- }
1261
- }
1262
- }, _callee6, null, [[1, 10, 13, 17]]);
1263
- }));
1218
+ var variantesDelProducto = family !== null && family !== void 0 && family.error ? 0 : ((_family$variants = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants !== void 0 ? _family$variants : []).filter(function (v) {
1219
+ return !v.isCurrent;
1220
+ }).length;
1221
+ var esVarianteDeOtro = 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
+ /*
1223
+ En Creators la lista de familia es INFORMATIVA: no se salta a otra variante.
1224
+ Saltar exige precargar el producto destino, y el endpoint que hace eso en la
1225
+ aplicación de clientes —read-articles-v2— filtra por la compañía del usuario:
1226
+ `AND a.company_id = <la del usuario>`. El equipo interno pertenece a ContentOh
1227
+ y trabaja productos de sus clientes, así que ahí no devuelve nada.
1228
+ Navegar sin precargar sería peor que no ofrecerlo: esta pantalla lee el
1229
+ producto de sessionStorage, así que cambiaría la URL y seguiría mostrando el
1230
+ producto anterior, dando a entender que se cambió de variante cuando no.
1231
+ Para habilitarlo hace falta una forma de traer un producto por id sin filtro
1232
+ de compañía, respetando el alcance del perfil interno (§5.1 del contrato).
1233
+ */
1264
1234
 
1265
- return function openVariant(_x3) {
1266
- return _ref9.apply(this, arguments);
1267
- };
1268
- }();
1269
1235
  /*
1270
1236
  Refresca tras ligar, sin recargar: el producto sale de sessionStorage, así que
1271
1237
  un refresh devolvería el mismo objeto y el contador seguiría igual.
1272
1238
  */
1273
1239
 
1274
-
1275
1240
  var handleOnLinkedVariants = function handleOnLinkedVariants(result) {
1276
- var _state$product$varian, _state$product9, _result$linked, _result$parentArticle;
1241
+ var _state$product$varian, _state$product12, _result$linked, _result$parentArticle;
1277
1242
 
1278
1243
  if (!result) return;
1279
1244
  var updatedProduct = result.mode === "children" ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
1280
- variantsCount: ((_state$product$varian = (_state$product9 = state.product) === null || _state$product9 === void 0 ? void 0 : _state$product9.variantsCount) !== null && _state$product$varian !== void 0 ? _state$product$varian : 0) + ((_result$linked = result.linked) !== null && _result$linked !== void 0 ? _result$linked : []).length
1245
+ variantsCount: ((_state$product$varian = (_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.variantsCount) !== null && _state$product$varian !== void 0 ? _state$product$varian : 0) + ((_result$linked = result.linked) !== null && _result$linked !== void 0 ? _result$linked : []).length
1281
1246
  }) : (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
1282
1247
  parentArticleId: (_result$parentArticle = result.parentArticleId) !== null && _result$parentArticle !== void 0 ? _result$parentArticle : null,
1283
1248
  variantsCount: 0
@@ -1301,24 +1266,24 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1301
1266
 
1302
1267
 
1303
1268
  var handleOnRestoreInheritance = /*#__PURE__*/function () {
1304
- var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(attributeId) {
1305
- var _state$product10;
1269
+ var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(attributeId) {
1270
+ var _state$product13;
1306
1271
 
1307
1272
  var res, data;
1308
- return _regenerator.default.wrap(function _callee7$(_context7) {
1273
+ return _regenerator.default.wrap(function _callee6$(_context6) {
1309
1274
  while (1) {
1310
- switch (_context7.prev = _context7.next) {
1275
+ switch (_context6.prev = _context6.next) {
1311
1276
  case 0:
1312
- if (!(!attributeId || !((_state$product10 = state.product) !== null && _state$product10 !== void 0 && _state$product10.id_article))) {
1313
- _context7.next = 2;
1277
+ if (!(!attributeId || !((_state$product13 = state.product) !== null && _state$product13 !== void 0 && _state$product13.id_article))) {
1278
+ _context6.next = 2;
1314
1279
  break;
1315
1280
  }
1316
1281
 
1317
- return _context7.abrupt("return");
1282
+ return _context6.abrupt("return");
1318
1283
 
1319
1284
  case 2:
1320
- _context7.prev = 2;
1321
- _context7.next = 5;
1285
+ _context6.prev = 2;
1286
+ _context6.next = 5;
1322
1287
  return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/restore"), {
1323
1288
  articleId: state.product.id_article,
1324
1289
  attributes: [Number(attributeId)]
@@ -1329,7 +1294,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1329
1294
  });
1330
1295
 
1331
1296
  case 5:
1332
- res = _context7.sent;
1297
+ res = _context6.sent;
1333
1298
  data = (0, _api.readPayload)(res);
1334
1299
  dispatch({
1335
1300
  type: "UPDATE_DATASHEETS_INPUTS",
@@ -1341,24 +1306,24 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1341
1306
  };
1342
1307
  })
1343
1308
  });
1344
- _context7.next = 13;
1309
+ _context6.next = 13;
1345
1310
  break;
1346
1311
 
1347
1312
  case 10:
1348
- _context7.prev = 10;
1349
- _context7.t0 = _context7["catch"](2);
1350
- console.error("restoreInheritance: ", _context7.t0);
1313
+ _context6.prev = 10;
1314
+ _context6.t0 = _context6["catch"](2);
1315
+ console.error("restoreInheritance: ", _context6.t0);
1351
1316
 
1352
1317
  case 13:
1353
1318
  case "end":
1354
- return _context7.stop();
1319
+ return _context6.stop();
1355
1320
  }
1356
1321
  }
1357
- }, _callee7, null, [[2, 10]]);
1322
+ }, _callee6, null, [[2, 10]]);
1358
1323
  }));
1359
1324
 
1360
- return function handleOnRestoreInheritance(_x4) {
1361
- return _ref10.apply(this, arguments);
1325
+ return function handleOnRestoreInheritance(_x3) {
1326
+ return _ref9.apply(this, arguments);
1362
1327
  };
1363
1328
  }();
1364
1329
  /*
@@ -1385,41 +1350,40 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1385
1350
  };
1386
1351
 
1387
1352
  var handleOnClickSave = /*#__PURE__*/function () {
1388
- var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
1389
- var _state$product11, esPadre, cambios;
1390
-
1391
- return _regenerator.default.wrap(function _callee8$(_context8) {
1353
+ var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
1354
+ var esPadre, cambios;
1355
+ return _regenerator.default.wrap(function _callee7$(_context7) {
1392
1356
  while (1) {
1393
- switch (_context8.prev = _context8.next) {
1357
+ switch (_context7.prev = _context7.next) {
1394
1358
  case 0:
1395
1359
  if (!(state.saving || preparandoPropagacion)) {
1396
- _context8.next = 2;
1360
+ _context7.next = 2;
1397
1361
  break;
1398
1362
  }
1399
1363
 
1400
- return _context8.abrupt("return");
1364
+ return _context7.abrupt("return");
1401
1365
 
1402
1366
  case 2:
1403
- _context8.t0 = state.active_tab;
1404
- _context8.next = _context8.t0 === "Descripción" ? 5 : _context8.t0 === "Ficha técnica" ? 8 : _context8.t0 === "Imágenes" ? 17 : 20;
1367
+ _context7.t0 = state.active_tab;
1368
+ _context7.next = _context7.t0 === "Descripción" ? 5 : _context7.t0 === "Ficha técnica" ? 8 : _context7.t0 === "Imágenes" ? 17 : 20;
1405
1369
  break;
1406
1370
 
1407
1371
  case 5:
1408
- _context8.next = 7;
1372
+ _context7.next = 7;
1409
1373
  return saveDescriptions(token);
1410
1374
 
1411
1375
  case 7:
1412
- return _context8.abrupt("break", 21);
1376
+ return _context7.abrupt("break", 21);
1413
1377
 
1414
1378
  case 8:
1415
1379
  // Guardar un padre con variantes abre la decisión de propagar. Sin este
1416
1380
  // paso el cambio se queda solo en el padre y las variantes se van
1417
1381
  // separando de él sin que nadie lo note.
1418
- esPadre = ((_state$product11 = state.product) === null || _state$product11 === void 0 ? void 0 : _state$product11.variantsCount) > 0;
1382
+ esPadre = variantesDelProducto > 0;
1419
1383
  cambios = cambiosDeFichaTecnica();
1420
1384
 
1421
1385
  if (!(esPadre && cambios.length > 0)) {
1422
- _context8.next = 14;
1386
+ _context7.next = 14;
1423
1387
  break;
1424
1388
  }
1425
1389
 
@@ -1431,39 +1395,39 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1431
1395
  }).finally(function () {
1432
1396
  return setPreparandoPropagacion(false);
1433
1397
  });
1434
- return _context8.abrupt("return");
1398
+ return _context7.abrupt("return");
1435
1399
 
1436
1400
  case 14:
1437
- _context8.next = 16;
1401
+ _context7.next = 16;
1438
1402
  return saveDatasheets(token);
1439
1403
 
1440
1404
  case 16:
1441
- return _context8.abrupt("break", 21);
1405
+ return _context7.abrupt("break", 21);
1442
1406
 
1443
1407
  case 17:
1444
- _context8.next = 19;
1408
+ _context7.next = 19;
1445
1409
  return updateImages(token);
1446
1410
 
1447
1411
  case 19:
1448
- return _context8.abrupt("break", 21);
1412
+ return _context7.abrupt("break", 21);
1449
1413
 
1450
1414
  case 20:
1451
- return _context8.abrupt("break", 21);
1415
+ return _context7.abrupt("break", 21);
1452
1416
 
1453
1417
  case 21:
1454
- _context8.next = 23;
1418
+ _context7.next = 23;
1455
1419
  return loadData(false);
1456
1420
 
1457
1421
  case 23:
1458
1422
  case "end":
1459
- return _context8.stop();
1423
+ return _context7.stop();
1460
1424
  }
1461
1425
  }
1462
- }, _callee8);
1426
+ }, _callee7);
1463
1427
  }));
1464
1428
 
1465
1429
  return function handleOnClickSave() {
1466
- return _ref11.apply(this, arguments);
1430
+ return _ref10.apply(this, arguments);
1467
1431
  };
1468
1432
  }();
1469
1433
 
@@ -1531,24 +1495,24 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1531
1495
  };
1532
1496
 
1533
1497
  var handleOnApproveSingleService = /*#__PURE__*/function () {
1534
- var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
1535
- return _regenerator.default.wrap(function _callee9$(_context9) {
1498
+ var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
1499
+ return _regenerator.default.wrap(function _callee8$(_context8) {
1536
1500
  while (1) {
1537
- switch (_context9.prev = _context9.next) {
1501
+ switch (_context8.prev = _context8.next) {
1538
1502
  case 0:
1539
- _context9.next = 2;
1503
+ _context8.next = 2;
1540
1504
  return sendSingleEvaluation("A");
1541
1505
 
1542
1506
  case 2:
1543
1507
  case "end":
1544
- return _context9.stop();
1508
+ return _context8.stop();
1545
1509
  }
1546
1510
  }
1547
- }, _callee9);
1511
+ }, _callee8);
1548
1512
  }));
1549
1513
 
1550
1514
  return function handleOnApproveSingleService() {
1551
- return _ref12.apply(this, arguments);
1515
+ return _ref11.apply(this, arguments);
1552
1516
  };
1553
1517
  }();
1554
1518
 
@@ -1557,21 +1521,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1557
1521
  };
1558
1522
 
1559
1523
  var sendSingleEvaluation = /*#__PURE__*/function () {
1560
- var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(result) {
1524
+ var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
1561
1525
  var _state$product$id_ord, _state$active_retaile4;
1562
1526
 
1563
1527
  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;
1564
1528
 
1565
- return _regenerator.default.wrap(function _callee10$(_context10) {
1529
+ return _regenerator.default.wrap(function _callee9$(_context9) {
1566
1530
  while (1) {
1567
- switch (_context10.prev = _context10.next) {
1531
+ switch (_context9.prev = _context9.next) {
1568
1532
  case 0:
1569
1533
  if (!state.saving) {
1570
- _context10.next = 2;
1534
+ _context9.next = 2;
1571
1535
  break;
1572
1536
  }
1573
1537
 
1574
- return _context10.abrupt("return");
1538
+ return _context9.abrupt("return");
1575
1539
 
1576
1540
  case 2:
1577
1541
  dispatch({
@@ -1592,16 +1556,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1592
1556
  retailerId: retailerId
1593
1557
  };
1594
1558
  activeTab = state.active_tab;
1595
- _context10.prev = 11;
1559
+ _context9.prev = 11;
1596
1560
 
1597
1561
  if (!result) {
1598
- _context10.next = 28;
1562
+ _context9.next = 28;
1599
1563
  break;
1600
1564
  }
1601
1565
 
1602
1566
  data.result = result;
1603
1567
  data.retailerId = retailerId;
1604
- _context10.next = 17;
1568
+ _context9.next = 17;
1605
1569
  return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1606
1570
  headers: {
1607
1571
  Authorization: token
@@ -1609,7 +1573,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1609
1573
  });
1610
1574
 
1611
1575
  case 17:
1612
- res = _context10.sent;
1576
+ res = _context9.sent;
1613
1577
  newStatuses = JSON.parse(res.data.body);
1614
1578
  serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")];
1615
1579
  articleStatus = newStatuses.newArticleStatus[articleId];
@@ -1640,7 +1604,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1640
1604
  image: _genericModalCheck.default
1641
1605
  }
1642
1606
  });
1643
- _context10.next = 33;
1607
+ _context9.next = 33;
1644
1608
  break;
1645
1609
 
1646
1610
  case 28:
@@ -1656,7 +1620,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1656
1620
  icon = _genericModalCheck.default;
1657
1621
  }
1658
1622
 
1659
- _context10.next = 32;
1623
+ _context9.next = 32;
1660
1624
  return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1661
1625
  headers: {
1662
1626
  Authorization: token
@@ -1664,7 +1628,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1664
1628
  });
1665
1629
 
1666
1630
  case 32:
1667
- res = _context10.sent;
1631
+ res = _context9.sent;
1668
1632
 
1669
1633
  case 33:
1670
1634
  if (res.data.statusCode === 200) {
@@ -1749,13 +1713,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1749
1713
  });
1750
1714
  }
1751
1715
 
1752
- _context10.next = 40;
1716
+ _context9.next = 40;
1753
1717
  break;
1754
1718
 
1755
1719
  case 36:
1756
- _context10.prev = 36;
1757
- _context10.t0 = _context10["catch"](11);
1758
- console.error("Error sending evaluation:", _context10.t0);
1720
+ _context9.prev = 36;
1721
+ _context9.t0 = _context9["catch"](11);
1722
+ console.error("Error sending evaluation:", _context9.t0);
1759
1723
  dispatch({
1760
1724
  type: "SET_MODAL",
1761
1725
  payload: {
@@ -1767,45 +1731,45 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1767
1731
  });
1768
1732
 
1769
1733
  case 40:
1770
- _context10.prev = 40;
1734
+ _context9.prev = 40;
1771
1735
  dispatch({
1772
1736
  type: "SET_SAVING",
1773
1737
  payload: false
1774
1738
  });
1775
- return _context10.finish(40);
1739
+ return _context9.finish(40);
1776
1740
 
1777
1741
  case 43:
1778
1742
  case "end":
1779
- return _context10.stop();
1743
+ return _context9.stop();
1780
1744
  }
1781
1745
  }
1782
- }, _callee10, null, [[11, 36, 40, 43]]);
1746
+ }, _callee9, null, [[11, 36, 40, 43]]);
1783
1747
  }));
1784
1748
 
1785
- return function sendSingleEvaluation(_x5) {
1786
- return _ref13.apply(this, arguments);
1749
+ return function sendSingleEvaluation(_x4) {
1750
+ return _ref12.apply(this, arguments);
1787
1751
  };
1788
1752
  }();
1789
1753
 
1790
1754
  var handleOnApproveAllServices = /*#__PURE__*/function () {
1791
- var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
1792
- return _regenerator.default.wrap(function _callee11$(_context11) {
1755
+ var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
1756
+ return _regenerator.default.wrap(function _callee10$(_context10) {
1793
1757
  while (1) {
1794
- switch (_context11.prev = _context11.next) {
1758
+ switch (_context10.prev = _context10.next) {
1795
1759
  case 0:
1796
- _context11.next = 2;
1760
+ _context10.next = 2;
1797
1761
  return sendBulkEvaluation("A");
1798
1762
 
1799
1763
  case 2:
1800
1764
  case "end":
1801
- return _context11.stop();
1765
+ return _context10.stop();
1802
1766
  }
1803
1767
  }
1804
- }, _callee11);
1768
+ }, _callee10);
1805
1769
  }));
1806
1770
 
1807
1771
  return function handleOnApproveAllServices() {
1808
- return _ref14.apply(this, arguments);
1772
+ return _ref13.apply(this, arguments);
1809
1773
  };
1810
1774
  }();
1811
1775
 
@@ -1815,18 +1779,18 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1815
1779
  };
1816
1780
 
1817
1781
  var sendBulkEvaluation = /*#__PURE__*/function () {
1818
- var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(result) {
1782
+ var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
1819
1783
  var _state$services_data3, evaluationArray, conceptArray, status, updatedStatusByRetailer, updatedProduct, updatedServicesData;
1820
1784
 
1821
- return _regenerator.default.wrap(function _callee12$(_context12) {
1785
+ return _regenerator.default.wrap(function _callee11$(_context11) {
1822
1786
  while (1) {
1823
- switch (_context12.prev = _context12.next) {
1787
+ switch (_context11.prev = _context11.next) {
1824
1788
  case 0:
1825
1789
  dispatch({
1826
1790
  type: "SET_SAVING",
1827
1791
  payload: true
1828
1792
  });
1829
- _context12.prev = 1;
1793
+ _context11.prev = 1;
1830
1794
  evaluationArray = [];
1831
1795
  conceptArray = (0, _utils.getConceptsByRole)(user.id_role);
1832
1796
  (_state$services_data3 = state.services_data) === null || _state$services_data3 === void 0 ? void 0 : _state$services_data3.forEach(function (ret, idx) {
@@ -1851,7 +1815,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1851
1815
  }));
1852
1816
  }
1853
1817
  });
1854
- _context12.next = 7;
1818
+ _context11.next = 7;
1855
1819
  return Promise.all(evaluationArray);
1856
1820
 
1857
1821
  case 7:
@@ -1906,41 +1870,41 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1906
1870
  image: _genericModalCheck.default
1907
1871
  }
1908
1872
  });
1909
- _context12.next = 19;
1873
+ _context11.next = 19;
1910
1874
  break;
1911
1875
 
1912
1876
  case 16:
1913
- _context12.prev = 16;
1914
- _context12.t0 = _context12["catch"](1);
1915
- console.error("Error in bulk evaluation:", _context12.t0);
1877
+ _context11.prev = 16;
1878
+ _context11.t0 = _context11["catch"](1);
1879
+ console.error("Error in bulk evaluation:", _context11.t0);
1916
1880
 
1917
1881
  case 19:
1918
- _context12.prev = 19;
1882
+ _context11.prev = 19;
1919
1883
  dispatch({
1920
1884
  type: "SET_SAVING",
1921
1885
  payload: false
1922
1886
  });
1923
- return _context12.finish(19);
1887
+ return _context11.finish(19);
1924
1888
 
1925
1889
  case 22:
1926
1890
  case "end":
1927
- return _context12.stop();
1891
+ return _context11.stop();
1928
1892
  }
1929
1893
  }
1930
- }, _callee12, null, [[1, 16, 19, 22]]);
1894
+ }, _callee11, null, [[1, 16, 19, 22]]);
1931
1895
  }));
1932
1896
 
1933
- return function sendBulkEvaluation(_x6) {
1934
- return _ref15.apply(this, arguments);
1897
+ return function sendBulkEvaluation(_x5) {
1898
+ return _ref14.apply(this, arguments);
1935
1899
  };
1936
1900
  }();
1937
1901
 
1938
1902
  var handleOnChangeAssignations = /*#__PURE__*/function () {
1939
- var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(assignationType, assignationId) {
1903
+ var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(assignationType, assignationId) {
1940
1904
  var concept, data, updatedProduct;
1941
- return _regenerator.default.wrap(function _callee13$(_context13) {
1905
+ return _regenerator.default.wrap(function _callee12$(_context12) {
1942
1906
  while (1) {
1943
- switch (_context13.prev = _context13.next) {
1907
+ switch (_context12.prev = _context12.next) {
1944
1908
  case 0:
1945
1909
  concept = (0, _utils.getConceptByTab)(state.active_tab);
1946
1910
  data = {
@@ -1951,7 +1915,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1951
1915
  concept: concept,
1952
1916
  userId: assignationId
1953
1917
  };
1954
- _context13.next = 4;
1918
+ _context12.next = 4;
1955
1919
  return (0, _axios.default)({
1956
1920
  method: "post",
1957
1921
  url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
@@ -1970,14 +1934,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
1970
1934
 
1971
1935
  case 6:
1972
1936
  case "end":
1973
- return _context13.stop();
1937
+ return _context12.stop();
1974
1938
  }
1975
1939
  }
1976
- }, _callee13);
1940
+ }, _callee12);
1977
1941
  }));
1978
1942
 
1979
- return function handleOnChangeAssignations(_x7, _x8) {
1980
- return _ref16.apply(this, arguments);
1943
+ return function handleOnChangeAssignations(_x6, _x7) {
1944
+ return _ref15.apply(this, arguments);
1981
1945
  };
1982
1946
  }();
1983
1947
 
@@ -2012,16 +1976,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2012
1976
  };
2013
1977
 
2014
1978
  var handleOnSubmitComment = /*#__PURE__*/function () {
2015
- var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
1979
+ var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(e) {
2016
1980
  var commentText;
2017
- return _regenerator.default.wrap(function _callee14$(_context14) {
1981
+ return _regenerator.default.wrap(function _callee13$(_context13) {
2018
1982
  while (1) {
2019
- switch (_context14.prev = _context14.next) {
1983
+ switch (_context13.prev = _context13.next) {
2020
1984
  case 0:
2021
1985
  e.preventDefault();
2022
1986
  commentText = document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML;
2023
- _context14.prev = 2;
2024
- _context14.next = 5;
1987
+ _context13.prev = 2;
1988
+ _context13.next = 5;
2025
1989
  return createComment(commentText, token);
2026
1990
 
2027
1991
  case 5:
@@ -2034,13 +1998,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2034
1998
  image: _genericModalCheck.default
2035
1999
  }
2036
2000
  });
2037
- _context14.next = 12;
2001
+ _context13.next = 12;
2038
2002
  break;
2039
2003
 
2040
2004
  case 8:
2041
- _context14.prev = 8;
2042
- _context14.t0 = _context14["catch"](2);
2043
- console.error("Error saving comment:", _context14.t0);
2005
+ _context13.prev = 8;
2006
+ _context13.t0 = _context13["catch"](2);
2007
+ console.error("Error saving comment:", _context13.t0);
2044
2008
  dispatch({
2045
2009
  type: "SET_MODAL",
2046
2010
  payload: {
@@ -2053,14 +2017,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2053
2017
 
2054
2018
  case 12:
2055
2019
  case "end":
2056
- return _context14.stop();
2020
+ return _context13.stop();
2057
2021
  }
2058
2022
  }
2059
- }, _callee14, null, [[2, 8]]);
2023
+ }, _callee13, null, [[2, 8]]);
2060
2024
  }));
2061
2025
 
2062
- return function handleOnSubmitComment(_x9) {
2063
- return _ref17.apply(this, arguments);
2026
+ return function handleOnSubmitComment(_x8) {
2027
+ return _ref16.apply(this, arguments);
2064
2028
  };
2065
2029
  }();
2066
2030
 
@@ -2383,7 +2347,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2383
2347
  headerTop: headerTop,
2384
2348
  children: [pendingPropagation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PropagateChangesModal.PropagateChangesModal, {
2385
2349
  changedAttributes: pendingPropagation.cambios,
2386
- variants: ((_family$variants = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants !== void 0 ? _family$variants : []).filter(function (v) {
2350
+ variants: ((_family$variants2 = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants2 !== void 0 ? _family$variants2 : []).filter(function (v) {
2387
2351
  return !v.isCurrent;
2388
2352
  }),
2389
2353
  saving: state.saving,
@@ -2395,9 +2359,9 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2395
2359
  saveDatasheets(token, propagation !== null && propagation !== void 0 ? propagation : undefined);
2396
2360
  }
2397
2361
  }), showLinkVariants && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkVariantsModal.LinkVariantsModal, {
2398
- articleId: (_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.id_article,
2399
- articleName: (_state$product13 = state.product) === null || _state$product13 === void 0 ? void 0 : _state$product13.name,
2400
- articleUpc: (_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.upc,
2362
+ articleId: (_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.id_article,
2363
+ articleName: (_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.name,
2364
+ articleUpc: (_state$product16 = state.product) === null || _state$product16 === void 0 ? void 0 : _state$product16.upc,
2401
2365
  activeRetailerId: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
2402
2366
  token: token,
2403
2367
  onClose: function onClose() {
@@ -2424,21 +2388,21 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2424
2388
  type: "pink",
2425
2389
  label: "Aceptar",
2426
2390
  size: 12,
2427
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
2391
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
2428
2392
  var elements, isMessageEmpty, container, existingAlert, alert, fullMessage;
2429
- return _regenerator.default.wrap(function _callee15$(_context15) {
2393
+ return _regenerator.default.wrap(function _callee14$(_context14) {
2430
2394
  while (1) {
2431
- switch (_context15.prev = _context15.next) {
2395
+ switch (_context14.prev = _context14.next) {
2432
2396
  case 0:
2433
2397
  elements = document.querySelectorAll("#modal-message-box .ql-container .ql-editor > p");
2434
2398
 
2435
2399
  if (!(!elements || elements.length === 0)) {
2436
- _context15.next = 4;
2400
+ _context14.next = 4;
2437
2401
  break;
2438
2402
  }
2439
2403
 
2440
2404
  console.error("Elemento no encontrado");
2441
- return _context15.abrupt("return");
2405
+ return _context14.abrupt("return");
2442
2406
 
2443
2407
  case 4:
2444
2408
  isMessageEmpty = Array.from(elements).every(function (el) {
@@ -2447,7 +2411,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2447
2411
  });
2448
2412
 
2449
2413
  if (!isMessageEmpty) {
2450
- _context15.next = 10;
2414
+ _context14.next = 10;
2451
2415
  break;
2452
2416
  }
2453
2417
 
@@ -2462,13 +2426,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2462
2426
  container.appendChild(alert);
2463
2427
  }
2464
2428
 
2465
- return _context15.abrupt("return");
2429
+ return _context14.abrupt("return");
2466
2430
 
2467
2431
  case 10:
2468
2432
  fullMessage = Array.from(elements).map(function (element) {
2469
2433
  return element.innerHTML;
2470
2434
  }).join("").replace(/<br\s*\/?>/gi, "\n");
2471
- _context15.next = 13;
2435
+ _context14.next = 13;
2472
2436
  return createComment(fullMessage, token);
2473
2437
 
2474
2438
  case 13:
@@ -2477,10 +2441,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2477
2441
 
2478
2442
  case 15:
2479
2443
  case "end":
2480
- return _context15.stop();
2444
+ return _context14.stop();
2481
2445
  }
2482
2446
  }
2483
- }, _callee15);
2447
+ }, _callee14);
2484
2448
  }))
2485
2449
  }, "btn-Aceptar")]
2486
2450
  }), state.modal.show && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
@@ -2558,7 +2522,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2558
2522
  lists: state.images_values || [],
2559
2523
  activeImage: (_state$images_values10 = state.images_values) !== null && _state$images_values10 !== void 0 && _state$images_values10.values ? (_state$images_values11 = state.images_values) === null || _state$images_values11 === void 0 ? void 0 : _state$images_values11.values[state.current_image] : {},
2560
2524
  assignationsImages: state.collaborator_assignations["Imágenes"],
2561
- imagesStatus: ((_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.images_status) || "-",
2525
+ imagesStatus: ((_state$product17 = state.product) === null || _state$product17 === void 0 ? void 0 : _state$product17.images_status) || "-",
2562
2526
  retailerSelected: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.id_retailer,
2563
2527
  isRetailer: isRetailer,
2564
2528
  version: state.product.version,
@@ -2573,7 +2537,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2573
2537
  })]
2574
2538
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2575
2539
  className: "product-information",
2576
- children: [!((_state$product16 = state.product) !== null && _state$product16 !== void 0 && _state$product16.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2540
+ children: [!esVarianteDeOtro && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2577
2541
  className: "variants-actions",
2578
2542
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
2579
2543
  type: "button",
@@ -2582,7 +2546,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2582
2546
  return setShowLinkVariants(true);
2583
2547
  },
2584
2548
  children: "Ligar productos"
2585
- }), ((_state$product17 = state.product) === null || _state$product17 === void 0 ? void 0 : _state$product17.variantsCount) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
2549
+ }), variantesDelProducto > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
2586
2550
  type: "button",
2587
2551
  className: "variants-count",
2588
2552
  "aria-expanded": showFamily,
@@ -2592,12 +2556,12 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2592
2556
  });
2593
2557
  loadFamily();
2594
2558
  },
2595
- children: [state.product.variantsCount, " variante", state.product.variantsCount === 1 ? "" : "s", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
2559
+ children: [variantesDelProducto, " variante", variantesDelProducto === 1 ? "" : "s", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
2596
2560
  "aria-hidden": "true",
2597
2561
  children: showFamily ? " ▴" : " ▾"
2598
2562
  })]
2599
2563
  })]
2600
- }), ((_state$product18 = state.product) === null || _state$product18 === void 0 ? void 0 : _state$product18.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2564
+ }), esVarianteDeOtro && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2601
2565
  className: "variants-actions",
2602
2566
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
2603
2567
  type: "button",
@@ -2622,16 +2586,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2622
2586
  }), (family === null || family === void 0 ? void 0 : family.error) && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
2623
2587
  className: "loading",
2624
2588
  children: "No se pudo cargar la familia de este producto."
2625
- }), (family === null || family === void 0 ? void 0 : family.parent) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
2626
- type: "button",
2589
+ }), (family === null || family === void 0 ? void 0 : family.parent) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2627
2590
  className: "family-row parent",
2628
- disabled: loadingVariant !== null,
2629
- onClick: function onClick() {
2630
- return openVariant(family.parent.articleId);
2631
- },
2632
2591
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
2633
2592
  className: "role",
2634
- children: loadingVariant === family.parent.articleId ? "Abriendo…" : "Producto padre"
2593
+ children: "Producto padre"
2635
2594
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
2636
2595
  className: "name",
2637
2596
  children: family.parent.name
@@ -2639,17 +2598,12 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2639
2598
  className: "upc",
2640
2599
  children: family.parent.upc
2641
2600
  })]
2642
- }), family === null || family === void 0 ? void 0 : (_family$variants2 = family.variants) === null || _family$variants2 === void 0 ? void 0 : _family$variants2.map(function (variant) {
2643
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
2644
- type: "button",
2601
+ }), family === null || family === void 0 ? void 0 : (_family$variants3 = family.variants) === null || _family$variants3 === void 0 ? void 0 : _family$variants3.map(function (variant) {
2602
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2645
2603
  className: "family-row".concat(variant.isCurrent ? " current" : ""),
2646
- disabled: variant.isCurrent || loadingVariant !== null,
2647
- onClick: function onClick() {
2648
- return openVariant(variant.articleId);
2649
- },
2650
2604
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
2651
2605
  className: "role",
2652
- children: loadingVariant === variant.articleId ? "Abriendo…" : variant.isCurrent ? "Estás aquí" : "Variante"
2606
+ children: variant.isCurrent ? "Estás aquí" : "Variante"
2653
2607
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
2654
2608
  className: "name",
2655
2609
  children: variant.name
@@ -2658,7 +2612,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2658
2612
  children: variant.upc
2659
2613
  })]
2660
2614
  }, variant.articleId);
2661
- }), family && !family.error && !((_family$variants3 = family.variants) !== null && _family$variants3 !== void 0 && _family$variants3.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
2615
+ }), family && !family.error && !((_family$variants4 = family.variants) !== null && _family$variants4 !== void 0 && _family$variants4.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
2662
2616
  className: "loading",
2663
2617
  children: "Este producto no tiene variantes."
2664
2618
  })]
@@ -2720,11 +2674,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2720
2674
  className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
2721
2675
  id: "services-information-container",
2722
2676
  children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
2723
- children: [state.active_tab === "Descripción" && (((_state$product19 = state.product) === null || _state$product19 === void 0 ? void 0 : _state$product19.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
2677
+ children: [state.active_tab === "Descripción" && (((_state$product18 = state.product) === null || _state$product18 === void 0 ? void 0 : _state$product18.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
2724
2678
  activeSection: state.active_tab,
2725
2679
  inputGroup: state.descriptions_inputs[0],
2726
2680
  updatedDescriptions: state.updated_descriptions_inputs,
2727
- articleId: (_state$product20 = state.product) === null || _state$product20 === void 0 ? void 0 : _state$product20.id_article,
2681
+ articleId: (_state$product19 = state.product) === null || _state$product19 === void 0 ? void 0 : _state$product19.id_article,
2728
2682
  version: state.product.version,
2729
2683
  auditInputGroup: auditDescriptions[0],
2730
2684
  setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
@@ -2733,7 +2687,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2733
2687
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
2734
2688
  text: "No cuentas con este servicio",
2735
2689
  headerType: "input-name-header"
2736
- })), state.active_tab === "Ficha técnica" && (((_state$product21 = state.product) === null || _state$product21 === void 0 ? void 0 : _state$product21.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
2690
+ })), state.active_tab === "Ficha técnica" && (((_state$product20 = state.product) === null || _state$product20 === void 0 ? void 0 : _state$product20.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
2737
2691
  children: (_state$datasheets_inp = state.datasheets_inputs[0]) === null || _state$datasheets_inp === void 0 ? void 0 : (_state$datasheets_inp2 = _state$datasheets_inp.data) === null || _state$datasheets_inp2 === void 0 ? void 0 : _state$datasheets_inp2.map(function (dataGroup, index) {
2738
2692
  var _state$services2, _state$services2$data;
2739
2693
 
@@ -2754,7 +2708,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2754
2708
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
2755
2709
  text: "No cuentas con este servicio",
2756
2710
  headerType: "input-name-header"
2757
- })), state.active_tab === "Imágenes" && (((_state$product22 = state.product) === null || _state$product22 === void 0 ? void 0 : _state$product22.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
2711
+ })), state.active_tab === "Imágenes" && (((_state$product21 = state.product) === null || _state$product21 === void 0 ? void 0 : _state$product21.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
2758
2712
  children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
2759
2713
  checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
2760
2714
  ,
@@ -2846,20 +2800,20 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
2846
2800
  reviewed: crossComment
2847
2801
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2848
2802
  buttonType: "circular-button accept-button",
2849
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
2850
- return _regenerator.default.wrap(function _callee16$(_context16) {
2803
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
2804
+ return _regenerator.default.wrap(function _callee15$(_context15) {
2851
2805
  while (1) {
2852
- switch (_context16.prev = _context16.next) {
2806
+ switch (_context15.prev = _context15.next) {
2853
2807
  case 0:
2854
2808
  setCrossComment(true);
2855
2809
  commentRevised();
2856
2810
 
2857
2811
  case 2:
2858
2812
  case "end":
2859
- return _context16.stop();
2813
+ return _context15.stop();
2860
2814
  }
2861
2815
  }
2862
- }, _callee16);
2816
+ }, _callee15);
2863
2817
  }))
2864
2818
  })]
2865
2819
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {