contentoh-components-library 21.2.69 → 21.2.71

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.
Files changed (34) hide show
  1. package/dist/assets/images/chatPopup/Spinner.gif +0 -0
  2. package/dist/assets/images/chatPopup/close.svg +3 -0
  3. package/dist/assets/images/chatPopup/defaultImage.png +0 -0
  4. package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
  5. package/dist/assets/images/chatPopup/doc.svg +1 -0
  6. package/dist/assets/images/chatPopup/document.svg +1 -0
  7. package/dist/assets/images/chatPopup/iconChat.svg +19 -0
  8. package/dist/assets/images/chatPopup/iconPlus.svg +3 -0
  9. package/dist/assets/images/chatPopup/pdf.svg +75 -0
  10. package/dist/assets/images/chatPopup/remove.svg +4 -0
  11. package/dist/assets/images/chatPopup/send.svg +3 -0
  12. package/dist/assets/images/chatPopup/svgIcon.svg +109 -0
  13. package/dist/assets/images/chatPopup/upload_file.svg +3 -0
  14. package/dist/assets/images/chatPopup/xls.svg +53 -0
  15. package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +28 -0
  16. package/dist/components/atoms/ChatPopUp/index.js +841 -0
  17. package/dist/components/atoms/ChatPopUp/styles.js +27 -0
  18. package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +182 -0
  19. package/dist/components/atoms/CustomSelectItem/index.js +7 -3
  20. package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
  21. package/dist/components/atoms/StatusTag/index.js +58 -0
  22. package/dist/components/atoms/StatusTag/styles.js +20 -0
  23. package/dist/components/atoms/Tooltip/Tooltip.stories.js +36 -0
  24. package/dist/components/atoms/Tooltip/index.js +55 -0
  25. package/dist/components/atoms/Tooltip/styles.js +18 -0
  26. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
  27. package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
  28. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  29. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +158 -69
  30. package/dist/components/pages/RetailerProductEdition/index.js +46 -40
  31. package/package.json +1 -1
  32. package/src/components/atoms/CustomSelectItem/index.js +7 -2
  33. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +343 -69
  34. package/src/components/pages/RetailerProductEdition/index.js +68 -56
@@ -770,62 +770,65 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
770
770
 
771
771
  var saveDescriptions = /*#__PURE__*/function () {
772
772
  var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
773
- var _product$article9;
774
-
775
- var productTemp, articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
773
+ var _product$article9, productTemp, _articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
776
774
 
777
775
  return _regenerator.default.wrap(function _callee5$(_context5) {
778
776
  while (1) {
779
777
  switch (_context5.prev = _context5.next) {
780
778
  case 0:
779
+ if (!updatedDescriptions) {
780
+ _context5.next = 24;
781
+ break;
782
+ }
783
+
781
784
  setLoading(true);
782
785
  productTemp = product;
783
- articleId = product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article;
786
+ _articleId = product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article;
784
787
  dataObject = {
785
- articleId: articleId,
788
+ articleId: _articleId,
786
789
  articleData: updatedDescriptions
787
790
  };
788
791
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
789
- _context5.prev = 5;
790
- _context5.next = 8;
792
+ _context5.prev = 6;
793
+ _context5.next = 9;
791
794
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
792
795
  headers: {
793
796
  Authorization: token
794
797
  }
795
798
  });
796
799
 
797
- case 8:
800
+ case 9:
798
801
  res = _context5.sent;
799
802
 
800
803
  if (!(res.data.statusCode === 200)) {
801
- _context5.next = 18;
804
+ _context5.next = 19;
802
805
  break;
803
806
  }
804
807
 
805
808
  _JSON$parse2 = JSON.parse(res.data.body), newStatus = _JSON$parse2.newStatus, newArticleStatus = _JSON$parse2.newArticleStatus;
806
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
809
+ if (newArticleStatus) productTemp.status = newArticleStatus[_articleId];
807
810
  if (newStatus) productTemp.description_status = newStatus;
808
811
  setProduct(productTemp);
809
812
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
810
813
  setMessage("Descripciones guardadas con éxito");
811
- _context5.next = 18;
814
+ _context5.next = 19;
812
815
  return loadData();
813
816
 
814
- case 18:
815
- _context5.next = 23;
817
+ case 19:
818
+ _context5.next = 24;
816
819
  break;
817
820
 
818
- case 20:
819
- _context5.prev = 20;
820
- _context5.t0 = _context5["catch"](5);
821
+ case 21:
822
+ _context5.prev = 21;
823
+ _context5.t0 = _context5["catch"](6);
821
824
  console.log(_context5.t0);
822
825
 
823
- case 23:
826
+ case 24:
824
827
  case "end":
825
828
  return _context5.stop();
826
829
  }
827
830
  }
828
- }, _callee5, null, [[5, 20]]);
831
+ }, _callee5, null, [[6, 21]]);
829
832
  }));
830
833
 
831
834
  return function saveDescriptions() {
@@ -835,62 +838,65 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
835
838
 
836
839
  var saveDatasheets = /*#__PURE__*/function () {
837
840
  var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
838
- var _product$article10;
839
-
840
- var productTemp, articleId, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
841
+ var _product$article10, productTemp, _articleId2, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
841
842
 
842
843
  return _regenerator.default.wrap(function _callee6$(_context6) {
843
844
  while (1) {
844
845
  switch (_context6.prev = _context6.next) {
845
846
  case 0:
847
+ if (!(updatedDatasheets.length > 0)) {
848
+ _context6.next = 24;
849
+ break;
850
+ }
851
+
846
852
  setLoading(true);
847
853
  productTemp = product;
848
- articleId = product === null || product === void 0 ? void 0 : (_product$article10 = product.article) === null || _product$article10 === void 0 ? void 0 : _product$article10.id_article;
854
+ _articleId2 = product === null || product === void 0 ? void 0 : (_product$article10 = product.article) === null || _product$article10 === void 0 ? void 0 : _product$article10.id_article;
849
855
  dataObject = {
850
- articleId: articleId,
856
+ articleId: _articleId2,
851
857
  articleData: updatedDatasheets
852
858
  };
853
859
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
854
- _context6.prev = 5;
855
- _context6.next = 8;
860
+ _context6.prev = 6;
861
+ _context6.next = 9;
856
862
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
857
863
  headers: {
858
864
  Authorization: token
859
865
  }
860
866
  });
861
867
 
862
- case 8:
868
+ case 9:
863
869
  res = _context6.sent;
864
870
 
865
871
  if (!(res.data.statusCode === 200)) {
866
- _context6.next = 18;
872
+ _context6.next = 19;
867
873
  break;
868
874
  }
869
875
 
870
876
  _JSON$parse3 = JSON.parse(res.data.body), newStatus = _JSON$parse3.newStatus, newArticleStatus = _JSON$parse3.newArticleStatus;
871
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
877
+ if (newArticleStatus) productTemp.status = newArticleStatus[_articleId2];
872
878
  if (newStatus) productTemp.datasheet_status = newStatus;
873
879
  setProduct(productTemp);
874
880
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
875
881
  setMessage("Fichas técnicas guardadas");
876
- _context6.next = 18;
882
+ _context6.next = 19;
877
883
  return loadData();
878
884
 
879
- case 18:
880
- _context6.next = 23;
885
+ case 19:
886
+ _context6.next = 24;
881
887
  break;
882
888
 
883
- case 20:
884
- _context6.prev = 20;
885
- _context6.t0 = _context6["catch"](5);
889
+ case 21:
890
+ _context6.prev = 21;
891
+ _context6.t0 = _context6["catch"](6);
886
892
  console.log(_context6.t0);
887
893
 
888
- case 23:
894
+ case 24:
889
895
  case "end":
890
896
  return _context6.stop();
891
897
  }
892
898
  }
893
- }, _callee6, null, [[5, 20]]);
899
+ }, _callee6, null, [[6, 21]]);
894
900
  }));
895
901
 
896
902
  return function saveDatasheets() {
@@ -1219,7 +1225,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1219
1225
 
1220
1226
  var sendToFacilitator = /*#__PURE__*/function () {
1221
1227
  var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
1222
- var concept, productTemp, evalStatus, _articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
1228
+ var concept, productTemp, evalStatus, _articleId3, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
1223
1229
 
1224
1230
  return _regenerator.default.wrap(function _callee9$(_context9) {
1225
1231
  while (1) {
@@ -1230,10 +1236,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1230
1236
  concept = getConcept(activeTab);
1231
1237
  productTemp = (0, _objectSpread2.default)({}, product);
1232
1238
  evalStatus = retailerStatus;
1233
- _articleId = product.article.id_article;
1239
+ _articleId3 = product.article.id_article;
1234
1240
  orderId = product.orderId;
1235
1241
  data = {
1236
- articleId: _articleId,
1242
+ articleId: _articleId3,
1237
1243
  orderId: orderId,
1238
1244
  concept: concept,
1239
1245
  evalStatus: evalStatus,
@@ -1287,7 +1293,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1287
1293
  }
1288
1294
 
1289
1295
  _JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
1290
- if (newOrderStatus) productTemp.status = newArticleStatus[_articleId];
1296
+ if (newOrderStatus) productTemp.status = newArticleStatus[_articleId3];
1291
1297
  productTemp["".concat(concept, "_status")] = newStatus;
1292
1298
  _context9.next = 27;
1293
1299
  return loadData();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.69",
3
+ "version": "21.2.71",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -11,6 +11,7 @@ export const CustomSelectItem = ({
11
11
  setParameterArray,
12
12
  className,
13
13
  route = "",
14
+ id = "",
14
15
  }) => {
15
16
  const [showSubOptions, setShowSubOptions] = useState(false);
16
17
  const filterRoute = route;
@@ -108,8 +109,11 @@ export const CustomSelectItem = ({
108
109
  <Container mainDivClass={className}>
109
110
  <div className={className}>
110
111
  <CheckBox
111
- id={"main-item-" + option.name}
112
+ id={
113
+ "main-item-" + (id ? id + "-" : "") + option.id + "-" + option.name
114
+ }
112
115
  label={option.name}
116
+ checked={activeFilters[option.name]}
113
117
  defaultChecked={activeFilters[option.name]}
114
118
  onChange={(e) => onChangeChk(e, option)}
115
119
  />
@@ -126,8 +130,9 @@ export const CustomSelectItem = ({
126
130
  <div className="sub-options">
127
131
  {option.subOptions.map((subOption, index) => (
128
132
  <CustomSelectItem
129
- key={index + "-" + subOption.name}
133
+ key={index + (id ? id + "-" : "") + subOption.name}
130
134
  option={subOption}
135
+ id={id}
131
136
  className={"sub-option"}
132
137
  route={`${filterRoute}|${subOption.name}`}
133
138
  activeFilters={activeFilters[option.name]}