contentoh-components-library 21.3.13 → 21.3.15

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.
@@ -200,7 +200,7 @@ var myBucket = new _awsSdk.default.S3({
200
200
  });
201
201
 
202
202
  var RetailerProductEdition = function RetailerProductEdition(_ref) {
203
- var _product$retailers, _product$services2, _datasheets$, _datasheets$$data, _product$article14, _comment$message;
203
+ var _product$retailers, _product$services2, _datasheets$, _datasheets$$data, _product$article15, _comment$message;
204
204
 
205
205
  var tabsSections = _ref.tabsSections,
206
206
  _ref$productSelected = _ref.productSelected,
@@ -759,7 +759,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
759
759
 
760
760
  var saveDescriptions = /*#__PURE__*/function () {
761
761
  var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
762
- var _product$article9, productTemp, _articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
762
+ var _product$article9, productTemp, articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
763
763
 
764
764
  return _regenerator.default.wrap(function _callee5$(_context5) {
765
765
  while (1) {
@@ -772,9 +772,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
772
772
 
773
773
  setLoading(true);
774
774
  productTemp = product;
775
- _articleId = product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article;
775
+ articleId = product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article;
776
776
  dataObject = {
777
- articleId: _articleId,
777
+ articleId: articleId,
778
778
  articleData: updatedDescriptions
779
779
  };
780
780
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
@@ -795,7 +795,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
795
795
  }
796
796
 
797
797
  _JSON$parse2 = JSON.parse(res.data.body), newStatus = _JSON$parse2.newStatus, newArticleStatus = _JSON$parse2.newArticleStatus;
798
- if (newArticleStatus) productTemp.status = newArticleStatus[_articleId];
798
+ if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
799
799
  if (newStatus) productTemp.description_status = newStatus;
800
800
  setProduct(productTemp);
801
801
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
@@ -827,7 +827,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
827
827
 
828
828
  var saveDatasheets = /*#__PURE__*/function () {
829
829
  var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
830
- var _product$article10, productTemp, _articleId2, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
830
+ var _product$article10, productTemp, articleId, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
831
831
 
832
832
  return _regenerator.default.wrap(function _callee6$(_context6) {
833
833
  while (1) {
@@ -840,9 +840,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
840
840
 
841
841
  setLoading(true);
842
842
  productTemp = product;
843
- _articleId2 = product === null || product === void 0 ? void 0 : (_product$article10 = product.article) === null || _product$article10 === void 0 ? void 0 : _product$article10.id_article;
843
+ articleId = product === null || product === void 0 ? void 0 : (_product$article10 = product.article) === null || _product$article10 === void 0 ? void 0 : _product$article10.id_article;
844
844
  dataObject = {
845
- articleId: _articleId2,
845
+ articleId: articleId,
846
846
  articleData: updatedDatasheets
847
847
  };
848
848
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
@@ -863,7 +863,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
863
863
  }
864
864
 
865
865
  _JSON$parse3 = JSON.parse(res.data.body), newStatus = _JSON$parse3.newStatus, newArticleStatus = _JSON$parse3.newArticleStatus;
866
- if (newArticleStatus) productTemp.status = newArticleStatus[_articleId2];
866
+ if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
867
867
  if (newStatus) productTemp.datasheet_status = newStatus;
868
868
  setProduct(productTemp);
869
869
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
@@ -911,7 +911,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
911
911
  setSocketType(imageInputs);
912
912
  }, [images]);
913
913
  var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
914
- var _images$values3, _product$article11, _data$articleData, _data$articleData2, _data$updateImages;
914
+ var _images$values3, _images$attrForImgs, _product$article11, _data$articleData, _data$articleData2, _data$updateImages;
915
915
 
916
916
  var imagesList, imagesListTemp, duplicated, attrForImgs, data, valid, _data$updateImages2, _data$articleData3, _data$articleData4, _data$articleData5, promiseArray;
917
917
 
@@ -927,7 +927,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
927
927
  duplicated = imagesList === null || imagesList === void 0 ? void 0 : imagesList.filter(function (image) {
928
928
  return imagesListTemp[image === null || image === void 0 ? void 0 : image.image_id];
929
929
  });
930
- attrForImgs = Object.values(images === null || images === void 0 ? void 0 : images.attrForImgs).pop();
930
+ attrForImgs = Object.values((_images$attrForImgs = images === null || images === void 0 ? void 0 : images.attrForImgs) !== null && _images$attrForImgs !== void 0 ? _images$attrForImgs : {}).pop();
931
931
  data = {
932
932
  articleId: product === null || product === void 0 ? void 0 : (_product$article11 = product.article) === null || _product$article11 === void 0 ? void 0 : _product$article11.id_article,
933
933
  attrReqImgs: attrForImgs === null || attrForImgs === void 0 ? void 0 : attrForImgs.map(function (e) {
@@ -1029,7 +1029,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1029
1029
  }, _callee7, null, [[10, 25]]);
1030
1030
  })), [images, imagesUploaded]);
1031
1031
  (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
1032
- var res, productTemp, _JSON$parse4, newStatus, newArticleStatus;
1032
+ var res, _product$article12, productTemp, _JSON$parse4, newStatus, newArticleStatus;
1033
1033
 
1034
1034
  return _regenerator.default.wrap(function _callee8$(_context8) {
1035
1035
  while (1) {
@@ -1066,7 +1066,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1066
1066
 
1067
1067
  productTemp = product;
1068
1068
  _JSON$parse4 = JSON.parse(res.data.body), newStatus = _JSON$parse4.newStatus, newArticleStatus = _JSON$parse4.newArticleStatus;
1069
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
1069
+ if (newArticleStatus) productTemp.status = newArticleStatus[product === null || product === void 0 ? void 0 : (_product$article12 = product.article) === null || _product$article12 === void 0 ? void 0 : _product$article12.id_article];
1070
1070
  if (newStatus) productTemp.images_status = newStatus;
1071
1071
  setProduct(productTemp);
1072
1072
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
@@ -1214,7 +1214,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1214
1214
 
1215
1215
  var sendToFacilitator = /*#__PURE__*/function () {
1216
1216
  var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
1217
- var concept, productTemp, evalStatus, _articleId3, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
1217
+ var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
1218
1218
 
1219
1219
  return _regenerator.default.wrap(function _callee9$(_context9) {
1220
1220
  while (1) {
@@ -1225,10 +1225,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1225
1225
  concept = getConcept(activeTab);
1226
1226
  productTemp = (0, _objectSpread2.default)({}, product);
1227
1227
  evalStatus = retailerStatus;
1228
- _articleId3 = product.article.id_article;
1228
+ articleId = product.article.id_article;
1229
1229
  orderId = product.orderId;
1230
1230
  data = {
1231
- articleId: _articleId3,
1231
+ articleId: articleId,
1232
1232
  orderId: orderId,
1233
1233
  concept: concept,
1234
1234
  evalStatus: evalStatus,
@@ -1282,7 +1282,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1282
1282
  }
1283
1283
 
1284
1284
  _JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
1285
- if (newOrderStatus) productTemp.status = newArticleStatus[_articleId3];
1285
+ if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
1286
1286
  productTemp["".concat(concept, "_status")] = newStatus;
1287
1287
  _context9.next = 27;
1288
1288
  return loadData();
@@ -1345,7 +1345,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1345
1345
 
1346
1346
  var createComment = /*#__PURE__*/function () {
1347
1347
  var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, body, tab) {
1348
- var _product$article12;
1348
+ var _product$article13;
1349
1349
 
1350
1350
  var concept, data;
1351
1351
  return _regenerator.default.wrap(function _callee10$(_context10) {
@@ -1371,7 +1371,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1371
1371
 
1372
1372
  case 10:
1373
1373
  data = {
1374
- articleId: product === null || product === void 0 ? void 0 : (_product$article12 = product.article) === null || _product$article12 === void 0 ? void 0 : _product$article12.id_article,
1374
+ articleId: product === null || product === void 0 ? void 0 : (_product$article13 = product.article) === null || _product$article13 === void 0 ? void 0 : _product$article13.id_article,
1375
1375
  orderId: product === null || product === void 0 ? void 0 : product.orderId,
1376
1376
  message: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, ""),
1377
1377
  concept: concept,
@@ -1515,7 +1515,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1515
1515
 
1516
1516
  var setAssignation = /*#__PURE__*/function () {
1517
1517
  var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(assignationType, assignationId) {
1518
- var _product$article13;
1518
+ var _product$article14;
1519
1519
 
1520
1520
  var concept, productTemp, data;
1521
1521
  return _regenerator.default.wrap(function _callee12$(_context12) {
@@ -1545,7 +1545,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1545
1545
  data = {
1546
1546
  articleList: [{
1547
1547
  orderId: product.orderId,
1548
- articleId: product === null || product === void 0 ? void 0 : (_product$article13 = product.article) === null || _product$article13 === void 0 ? void 0 : _product$article13.id_article
1548
+ articleId: product === null || product === void 0 ? void 0 : (_product$article14 = product.article) === null || _product$article14 === void 0 ? void 0 : _product$article14.id_article
1549
1549
  }],
1550
1550
  concept: concept,
1551
1551
  userId: assignationId
@@ -1942,7 +1942,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1942
1942
  inputGroup: descriptions[0],
1943
1943
  updatedDescriptions: updatedDescriptions,
1944
1944
  setUpdatedDescriptions: setUpdatedDescriptions,
1945
- articleId: product === null || product === void 0 ? void 0 : (_product$article14 = product.article) === null || _product$article14 === void 0 ? void 0 : _product$article14.id_article,
1945
+ articleId: product === null || product === void 0 ? void 0 : (_product$article15 = product.article) === null || _product$article15 === void 0 ? void 0 : _product$article15.id_article,
1946
1946
  version: version,
1947
1947
  dinamicHeight: true
1948
1948
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.3.13",
3
+ "version": "21.3.15",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -535,7 +535,7 @@ export const RetailerProductEdition = ({
535
535
  return imagesListTemp[image?.image_id];
536
536
  });
537
537
 
538
- const attrForImgs = Object.values(images?.attrForImgs).pop();
538
+ const attrForImgs = Object.values(images?.attrForImgs ?? {}).pop();
539
539
  const data = {
540
540
  articleId: product?.article?.id_article,
541
541
  attrReqImgs: attrForImgs?.map((e) => ({
@@ -628,7 +628,7 @@ export const RetailerProductEdition = ({
628
628
  let productTemp = product;
629
629
  const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
630
630
  if (newArticleStatus)
631
- productTemp.status = newArticleStatus[articleId];
631
+ productTemp.status = newArticleStatus[product?.article?.id_article];
632
632
  if (newStatus) productTemp.images_status = newStatus;
633
633
  setProduct(productTemp);
634
634
  sessionStorage.setItem(