contentoh-components-library 21.3.15 → 21.3.17

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 (119) hide show
  1. package/.env.development +5 -0
  2. package/dist/assets/images/generalButton/closeIcon.svg +2 -2
  3. package/dist/components/atoms/ProgressBar/index.js +36 -6
  4. package/dist/components/atoms/ProgressBar/styles.js +11 -3
  5. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
  6. package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
  7. package/dist/components/molecules/HeaderTop/index.js +23 -6
  8. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  9. package/dist/components/molecules/ProductNameHeader/index.js +6 -4
  10. package/dist/components/organisms/FullProductNameHeader/index.js +1 -0
  11. package/dist/components/organisms/RangeCalendar/index.js +4 -3
  12. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +65 -50
  13. package/dist/components/pages/ProviderProductEdition/index.js +15 -11
  14. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +36 -44
  15. package/dist/components/pages/RetailerProductEdition/index.js +53 -44
  16. package/dist/global-files/data.js +18 -23
  17. package/dist/global-files/fonts.css +6 -0
  18. package/dist/global-files/utils.js +22 -2
  19. package/dist/global-files/variables.js +2 -0
  20. package/dist/index.js +267 -46
  21. package/package.json +12 -1
  22. package/src/assets/images/customSelect/starIcon.svg +14 -0
  23. package/src/assets/images/defaultImages/Spinner.gif +0 -0
  24. package/src/assets/images/defaultImages/notFound.svg +124 -0
  25. package/src/assets/images/generalButton/closeIcon.svg +2 -2
  26. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
  27. package/src/components/atoms/ButtonFileChooser/index.js +68 -0
  28. package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
  29. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +53 -0
  30. package/src/components/atoms/ButtonV2/index.js +85 -0
  31. package/src/components/atoms/ButtonV2/styles.js +217 -0
  32. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
  33. package/src/components/atoms/CustomIcon/index.js +41 -0
  34. package/src/components/atoms/CustomIcon/styles.js +85 -0
  35. package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
  36. package/src/components/atoms/IconFile/index.js +119 -0
  37. package/src/components/atoms/IconFile/styles.js +67 -0
  38. package/src/components/atoms/Image/Image.stories.js +51 -0
  39. package/src/components/atoms/Image/index.js +55 -0
  40. package/src/components/atoms/Image/styles.js +34 -0
  41. package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
  42. package/src/components/atoms/ImageLink/index.js +57 -0
  43. package/src/components/atoms/ImageLink/styles.js +30 -0
  44. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
  45. package/src/components/atoms/ImagePreview/index.js +178 -0
  46. package/src/components/atoms/ImagePreview/styles.js +77 -0
  47. package/src/components/atoms/InputText/InputText.stories.js +39 -0
  48. package/src/components/atoms/InputText/index.js +61 -0
  49. package/src/components/atoms/InputText/styles.js +89 -0
  50. package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
  51. package/src/components/atoms/NotFound/index.js +52 -0
  52. package/src/components/atoms/NotFound/styles.js +55 -0
  53. package/src/components/atoms/ProgressBar/index.js +40 -5
  54. package/src/components/atoms/ProgressBar/styles.js +24 -0
  55. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
  56. package/src/components/atoms/SelectItemV2/index.js +61 -0
  57. package/src/components/atoms/SelectItemV2/styles.js +90 -0
  58. package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
  59. package/src/components/atoms/Tooltip/index.js +59 -0
  60. package/src/components/atoms/Tooltip/styles.js +42 -0
  61. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
  62. package/src/components/molecules/ButtonDownloadFile/index.js +109 -0
  63. package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
  64. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
  65. package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
  66. package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -0
  67. package/src/components/molecules/Dropdown/index.js +150 -0
  68. package/src/components/molecules/Dropdown/styles.js +75 -0
  69. package/src/components/molecules/HeaderTop/index.js +29 -8
  70. package/src/components/molecules/HeaderTop/styles.js +4 -0
  71. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -0
  72. package/src/components/molecules/ImageTooltip/index.js +63 -0
  73. package/src/components/molecules/ImageTooltip/styles.js +18 -0
  74. package/src/components/molecules/ProductNameHeader/index.js +7 -2
  75. package/src/components/molecules/SelectV2/SelectV2.stories.js +115 -0
  76. package/src/components/molecules/SelectV2/index.js +357 -0
  77. package/src/components/molecules/SelectV2/styles.js +105 -0
  78. package/src/components/molecules/SelectV2/test.js +61 -0
  79. package/src/components/molecules/SelectV2/test.stories.js +10 -0
  80. package/src/components/organisms/Chat/Chat.stories.js +147 -0
  81. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
  82. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  83. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  84. package/src/components/organisms/Chat/ChatLists/index.js +141 -0
  85. package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
  86. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
  87. package/src/components/organisms/Chat/ContainerItems/index.js +512 -0
  88. package/src/components/organisms/Chat/ContainerItems/styles.js +328 -0
  89. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
  90. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  91. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  92. package/src/components/organisms/Chat/ContentChat/index.js +897 -0
  93. package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
  94. package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
  95. package/src/components/organisms/Chat/Footer/index.js +661 -0
  96. package/src/components/organisms/Chat/Footer/styles.js +286 -0
  97. package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
  98. package/src/components/organisms/Chat/Header/index.js +94 -0
  99. package/src/components/organisms/Chat/Header/styles.js +49 -0
  100. package/src/components/organisms/Chat/index.js +235 -0
  101. package/src/components/organisms/Chat/styles.js +42 -0
  102. package/src/components/organisms/FullProductNameHeader/index.js +1 -0
  103. package/src/components/organisms/Modal/Modal.stories.js +55 -0
  104. package/src/components/organisms/Modal/index.js +97 -0
  105. package/src/components/organisms/Modal/styles.js +103 -0
  106. package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +16 -0
  107. package/src/components/organisms/RangeCalendar/index.js +121 -0
  108. package/src/components/organisms/RangeCalendar/styles.js +883 -0
  109. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +67 -49
  110. package/src/components/pages/ProviderProductEdition/index.js +16 -9
  111. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +36 -46
  112. package/src/components/pages/RetailerProductEdition/index.js +20 -14
  113. package/src/global-files/data.js +18 -23
  114. package/src/global-files/fonts.css +6 -0
  115. package/src/global-files/handle_http.js +225 -0
  116. package/src/global-files/handle_userTech.js +7 -0
  117. package/src/global-files/utils.js +330 -0
  118. package/src/global-files/variables.js +2 -0
  119. package/src/index.js +17 -0
@@ -28,53 +28,48 @@ exports.RetailerProductEditionDefault = RetailerProductEditionDefault;
28
28
  RetailerProductEditionDefault.args = {
29
29
  tabsSections: {
30
30
  Descripción: true,
31
- "Ficha técnica": false,
32
- Imágenes: false
31
+ "Ficha técnica": true,
32
+ Imágenes: true
33
33
  },
34
- token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3V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jf2Ujheavf3ipGMNtj-OSUdQsh04Ov7jehDWdnPNn2s2DAl4eubgjdXrwIiBPCRkbuFeYZZJpzj1wy__a0nCM7bzly5uTZ2aWujgEJvf9bJb-Y4gkS8TxyJaggJ01ZsMki36aEpIt8J1tJag",
35
35
  productSelected: {
36
36
  services: {
37
37
  datasheets: 1,
38
38
  descriptions: 1,
39
39
  images: 1
40
40
  },
41
- orderId: 123,
42
- status: "PA",
43
- datasheet_status: "PA",
41
+ orderId: 194,
42
+ status: "AC",
43
+ datasheet_status: "AC",
44
44
  prio: "none",
45
45
  version: 3,
46
- description_status: "PA",
47
- images_status: "PA",
46
+ description_status: "AC",
47
+ images_status: "AC",
48
48
  statusByRetailer: {
49
- 4: {
50
- datasheet: "PA",
51
- description: "PA",
52
- images: "PA"
49
+ 40: {
50
+ description: "AC",
51
+ images: "AC",
52
+ datasheet: "AC"
53
53
  },
54
- 5: {
55
- datasheet: "PA",
56
- description: "PA",
57
- images: "PA"
58
- },
59
- 6: {
60
- datasheet: "PA",
61
- description: "PA",
62
- images: "PA"
54
+ 43: {
55
+ datasheet: "AC",
56
+ description: "AC",
57
+ images: "AC"
63
58
  }
64
59
  },
65
60
  article: {
66
- id_article: 127,
67
- id_category: "700",
68
- name: "prueba prod flujo",
69
- upc: "34234353324",
70
- timestamp: "2022-11-23T23:12:30.000Z",
61
+ id_article: 354,
62
+ id_category: "684",
63
+ name: "Enjuague Bucal ",
64
+ upc: "22342342",
65
+ timestamp: "2023-01-03T16:19:49.000Z",
71
66
  id_user: 28,
72
67
  status: "NULL",
73
68
  active: 1,
74
69
  company_id: 1,
75
70
  company_name: "GRUPO BRAHMA",
76
71
  country: "México",
77
- id_order: 123,
72
+ id_order: 194,
78
73
  id_datasheet_especialist: 54,
79
74
  id_datasheet_facilitator: 52,
80
75
  id_description_especialist: 54,
@@ -83,40 +78,37 @@ RetailerProductEditionDefault.args = {
83
78
  id_images_facilitator: 53,
84
79
  id_auditor: 37,
85
80
  id_recepcionist: null,
86
- category: "Salud y Belleza|Cuidado Facial|Cremas, Mascarillas y Tratamientos",
81
+ category: "Salud y Belleza|Cuidado Bucal|Pastas Dentales y Aseo Bucal",
87
82
  missingAttributes: 0,
88
83
  missingDescriptions: 0,
89
84
  missingImages: 0
90
85
  },
91
86
  retailers: [{
92
- id: 4,
93
- name: "Walmart Super y Superama"
94
- }, {
95
- id: 5,
96
- name: "Chedraui"
87
+ id: 40,
88
+ name: "Nadro"
97
89
  }, {
98
- id: 6,
99
- name: "HEB"
90
+ id: 43,
91
+ name: "City Club"
100
92
  }],
101
93
  country: "México",
102
- upc: "34234353324"
94
+ upc: "22342342"
103
95
  },
104
96
  location: {
105
97
  product: {
106
- articleId: 109485,
98
+ articleId: 354,
107
99
  versionId: 3
108
100
  }
109
101
  },
110
102
  user: {
111
- id_user: 51,
112
- name: "ADMIN PRUEBA",
113
- last_name: "",
114
- email: "etc@contentoh.com",
103
+ id_user: 65,
104
+ name: "Oscar Alberto",
105
+ last_name: "Arenas",
106
+ email: "oarenas@contentoh.com",
115
107
  position: "",
116
108
  telephone: "",
117
109
  country: "",
118
110
  id_company: 2,
119
- id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
111
+ id_cognito: "73cc8d40-c841-422a-a2f2-e69d7fe26ebf",
120
112
  birth_Date: null,
121
113
  about_me: "",
122
114
  zip_code: "",
@@ -127,7 +119,7 @@ RetailerProductEditionDefault.args = {
127
119
  active: 1,
128
120
  is_retailer: 0,
129
121
  email_notify: 1,
130
- is_user_tech: null,
122
+ is_user_tech: "AS",
131
123
  membership: {
132
124
  id: 2,
133
125
  start_date: "2021-11-05T02:35:12.000Z",
@@ -139,6 +131,6 @@ RetailerProductEditionDefault.args = {
139
131
  products_limit: "3",
140
132
  type: "PyMES"
141
133
  },
142
- src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1669928511679"
134
+ src: "https://content-management-profile.s3.amazonaws.com/id-65/65.png?1675063399869"
143
135
  }
144
136
  };
@@ -318,7 +318,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
318
318
  })),
319
319
  _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
320
320
  percentages = _useState24[0],
321
- setPercentages = _useState24[1];
321
+ setPercentages = _useState24[1]; // const [percentages, setPercentages] = useState([{ retailers: {} }]);
322
+
322
323
 
323
324
  var _useState25 = (0, _react.useState)(0),
324
325
  _useState26 = (0, _slicedToArray2.default)(_useState25, 2),
@@ -462,8 +463,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
462
463
  _services = _context.sent;
463
464
  //Converts the data inside the datasheets object to array
464
465
  setServices(_services);
465
- getServices(); // setActiveRetailer(product?.retailers[0]);
466
-
466
+ getServices();
467
467
  setImages({
468
468
  action: "init",
469
469
  init: _services[2]
@@ -472,7 +472,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
472
472
  (0, _data.getPercentage)({
473
473
  data: [product]
474
474
  }).then(function (res) {
475
- return setPercentages(res);
475
+ return setPercentages(res[0]);
476
476
  });
477
477
  setLoading(false);
478
478
  _context.next = 15;
@@ -681,16 +681,17 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
681
681
  loadAssignations(product);
682
682
  }, [userGroups]);
683
683
  (0, _react.useEffect)(function () {
684
- var _product$retailers2, _product$retailers$;
684
+ var _Object$keys, _percentages$product$, _retailers$;
685
685
 
686
- product === null || product === void 0 ? void 0 : (_product$retailers2 = product.retailers) === null || _product$retailers2 === void 0 ? void 0 : _product$retailers2.forEach(function (retailer) {
687
- var _percentages$filter$;
686
+ var retailers = (product === null || product === void 0 ? void 0 : product.retailersAvailable) || (product === null || product === void 0 ? void 0 : product.retailers);
688
687
 
689
- retailer["percentage"] = percentages === null || percentages === void 0 ? void 0 : (_percentages$filter$ = percentages.filter(function (percent) {
690
- return (retailer === null || retailer === void 0 ? void 0 : retailer.id) === (percent === null || percent === void 0 ? void 0 : percent.id_retailer);
691
- })[0]) === null || _percentages$filter$ === void 0 ? void 0 : _percentages$filter$.percentage;
692
- });
693
- setActivePercentage(product === null || product === void 0 ? void 0 : (_product$retailers$ = product.retailers[0]) === null || _product$retailers$ === void 0 ? void 0 : _product$retailers$.percentage);
688
+ if (((_Object$keys = Object.keys((_percentages$product$ = percentages[product.article.id_article]) !== null && _percentages$product$ !== void 0 ? _percentages$product$ : {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) {
689
+ retailers === null || retailers === void 0 ? void 0 : retailers.forEach(function (retailer, index) {
690
+ retailer["percentage"] = Number(percentages[product.article.id_article][retailer.id].percentageRequired);
691
+ });
692
+ }
693
+
694
+ setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
694
695
  }, [percentages]);
695
696
  (0, _react.useEffect)(function () {
696
697
  if (services.length > 0) {
@@ -759,14 +760,18 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
759
760
 
760
761
  var saveDescriptions = /*#__PURE__*/function () {
761
762
  var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
762
- var _product$article9, productTemp, articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
763
+ var dataClean, _product$article9, productTemp, articleId, dataObject, res, _JSON$parse2, newStatus, newArticleStatus;
763
764
 
764
765
  return _regenerator.default.wrap(function _callee5$(_context5) {
765
766
  while (1) {
766
767
  switch (_context5.prev = _context5.next) {
767
768
  case 0:
768
- if (!updatedDescriptions) {
769
- _context5.next = 24;
769
+ dataClean = updatedDescriptions.filter(function (f) {
770
+ return f.value !== '';
771
+ });
772
+
773
+ if (!(dataClean.length > 0)) {
774
+ _context5.next = 25;
770
775
  break;
771
776
  }
772
777
 
@@ -775,22 +780,22 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
775
780
  articleId = product === null || product === void 0 ? void 0 : (_product$article9 = product.article) === null || _product$article9 === void 0 ? void 0 : _product$article9.id_article;
776
781
  dataObject = {
777
782
  articleId: articleId,
778
- articleData: updatedDescriptions
783
+ articleData: dataClean
779
784
  };
780
785
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
781
- _context5.prev = 6;
782
- _context5.next = 9;
786
+ _context5.prev = 7;
787
+ _context5.next = 10;
783
788
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
784
789
  headers: {
785
790
  Authorization: token
786
791
  }
787
792
  });
788
793
 
789
- case 9:
794
+ case 10:
790
795
  res = _context5.sent;
791
796
 
792
797
  if (!(res.data.statusCode === 200)) {
793
- _context5.next = 19;
798
+ _context5.next = 20;
794
799
  break;
795
800
  }
796
801
 
@@ -800,24 +805,24 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
800
805
  setProduct(productTemp);
801
806
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
802
807
  setMessage("Descripciones guardadas con éxito");
803
- _context5.next = 19;
808
+ _context5.next = 20;
804
809
  return loadData();
805
810
 
806
- case 19:
807
- _context5.next = 24;
811
+ case 20:
812
+ _context5.next = 25;
808
813
  break;
809
814
 
810
- case 21:
811
- _context5.prev = 21;
812
- _context5.t0 = _context5["catch"](6);
815
+ case 22:
816
+ _context5.prev = 22;
817
+ _context5.t0 = _context5["catch"](7);
813
818
  console.log(_context5.t0);
814
819
 
815
- case 24:
820
+ case 25:
816
821
  case "end":
817
822
  return _context5.stop();
818
823
  }
819
824
  }
820
- }, _callee5, null, [[6, 21]]);
825
+ }, _callee5, null, [[7, 22]]);
821
826
  }));
822
827
 
823
828
  return function saveDescriptions() {
@@ -827,14 +832,18 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
827
832
 
828
833
  var saveDatasheets = /*#__PURE__*/function () {
829
834
  var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
830
- var _product$article10, productTemp, articleId, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
835
+ var dataClean, _product$article10, productTemp, articleId, dataObject, res, _JSON$parse3, newStatus, newArticleStatus;
831
836
 
832
837
  return _regenerator.default.wrap(function _callee6$(_context6) {
833
838
  while (1) {
834
839
  switch (_context6.prev = _context6.next) {
835
840
  case 0:
836
- if (!(updatedDatasheets.length > 0)) {
837
- _context6.next = 24;
841
+ dataClean = updatedDatasheets.filter(function (f) {
842
+ return f.value !== '';
843
+ });
844
+
845
+ if (!(dataClean.length > 0)) {
846
+ _context6.next = 25;
838
847
  break;
839
848
  }
840
849
 
@@ -843,22 +852,22 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
843
852
  articleId = product === null || product === void 0 ? void 0 : (_product$article10 = product.article) === null || _product$article10 === void 0 ? void 0 : _product$article10.id_article;
844
853
  dataObject = {
845
854
  articleId: articleId,
846
- articleData: updatedDatasheets
855
+ articleData: dataClean
847
856
  };
848
857
  if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
849
- _context6.prev = 6;
850
- _context6.next = 9;
858
+ _context6.prev = 7;
859
+ _context6.next = 10;
851
860
  return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
852
861
  headers: {
853
862
  Authorization: token
854
863
  }
855
864
  });
856
865
 
857
- case 9:
866
+ case 10:
858
867
  res = _context6.sent;
859
868
 
860
869
  if (!(res.data.statusCode === 200)) {
861
- _context6.next = 19;
870
+ _context6.next = 20;
862
871
  break;
863
872
  }
864
873
 
@@ -868,24 +877,24 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
868
877
  setProduct(productTemp);
869
878
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
870
879
  setMessage("Fichas técnicas guardadas");
871
- _context6.next = 19;
880
+ _context6.next = 20;
872
881
  return loadData();
873
882
 
874
- case 19:
875
- _context6.next = 24;
883
+ case 20:
884
+ _context6.next = 25;
876
885
  break;
877
886
 
878
- case 21:
879
- _context6.prev = 21;
880
- _context6.t0 = _context6["catch"](6);
887
+ case 22:
888
+ _context6.prev = 22;
889
+ _context6.t0 = _context6["catch"](7);
881
890
  console.log(_context6.t0);
882
891
 
883
- case 24:
892
+ case 25:
884
893
  case "end":
885
894
  return _context6.stop();
886
895
  }
887
896
  }
888
- }, _callee6, null, [[6, 21]]);
897
+ }, _callee6, null, [[7, 22]]);
889
898
  }));
890
899
 
891
900
  return function saveDatasheets() {
@@ -122,35 +122,30 @@ var getPercentage = /*#__PURE__*/function () {
122
122
 
123
123
  func = /*#__PURE__*/function () {
124
124
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
125
- var dataToSend, retailers;
125
+ var dataToSend, arrayRetailers, retailers;
126
126
  return _regenerator.default.wrap(function _callee2$(_context2) {
127
127
  while (1) {
128
128
  switch (_context2.prev = _context2.next) {
129
129
  case 0:
130
130
  dataToSend = [];
131
+ arrayRetailers = [];
131
132
  retailers = params.data[0].retailers || params.data[0].retailersAvailable;
132
- params.data.forEach(function (product) {
133
+ params.data.forEach(function (product, i) {
134
+ dataToSend.push(product.article ? {
135
+ id_article: product.article.id_article,
136
+ id_category: product.article.id_category,
137
+ version: product.version
138
+ } : {
139
+ id_article: product.id_article,
140
+ id_category: product.id_category,
141
+ version: product.version
142
+ });
133
143
  retailers.forEach(function (retailer) {
134
- dataToSend.push(product.article ? {
135
- id_article: product.article.id_article,
136
- id_category: product.article.id_category,
137
- id_retailer: retailer.id,
138
- version: product.version,
139
- upc: product.article.upc,
140
- name: product.article.name,
141
- retailerName: retailer.name
142
- } : {
143
- id_article: product.id_article,
144
- id_category: product.id_category,
145
- id_retailer: retailer.id,
146
- version: product.version,
147
- upc: product.upc,
148
- name: product.name,
149
- retailerName: retailer.name
150
- });
144
+ arrayRetailers.push(retailer.id);
151
145
  });
146
+ dataToSend[i].id_retailer_array = arrayRetailers;
152
147
  });
153
- _context2.next = 5;
148
+ _context2.next = 6;
154
149
  return _axios.default.post(process.env.REACT_APP_VALID_EXPORT_ENDPOINT, {
155
150
  data: dataToSend
156
151
  }, {
@@ -158,15 +153,15 @@ var getPercentage = /*#__PURE__*/function () {
158
153
  Authorization: sessionStorage.getItem("jwt")
159
154
  }
160
155
  }).then(function (response) {
161
- return response.data;
156
+ return [response.data];
162
157
  }).catch(function (err) {
163
158
  return console.log(err, "Errror");
164
159
  });
165
160
 
166
- case 5:
161
+ case 6:
167
162
  return _context2.abrupt("return", _context2.sent);
168
163
 
169
- case 6:
164
+ case 7:
170
165
  case "end":
171
166
  return _context2.stop();
172
167
  }
@@ -61,3 +61,9 @@
61
61
  src: url("../assets/fonts/roboto/Roboto-Regular.ttf");
62
62
  font-weight: 400;
63
63
  }
64
+
65
+ .prueba {
66
+ color: #9e3e26;
67
+ color: #b42983;
68
+ color: #e7e7e7;
69
+ }
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.isValidNaturalNumber = exports.isStringEmpty = exports.isObject = exports.isArrayEmpty = exports.getTime = exports.getResizeImgHeight = exports.getImageURL = exports.getImageSize = exports.getFullDate = exports.getFileName = exports.getFileExtension = exports.getDataBuffer = exports.getDataBase64 = exports.getCustomDate = exports.getBase64 = exports.encodeUriJson = exports.decodeJSON = void 0;
8
+ exports.isValidNaturalNumber = exports.isStringEmpty = exports.isObject = exports.isArrayEmpty = exports.getTime = exports.getResizeImgHeight = exports.getImageURL = exports.getImageSize = exports.getFullDate = exports.getFormatedDate = exports.getFileName = exports.getFileExtension = exports.getDataBuffer = exports.getDataBase64 = exports.getCustomDate = exports.getBase64 = exports.encodeUriJson = exports.decodeJSON = void 0;
9
9
 
10
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
11
 
@@ -342,6 +342,26 @@ var getFullDate = function getFullDate() {
342
342
  /*------------------------
343
343
  Obtener una fecha a partir de
344
344
  un objeto Date() en formato:
345
+ 'aaaa-MM-dd'
346
+ ejemplo: '2022-12-25'
347
+ --------------------------*/
348
+
349
+
350
+ exports.getFullDate = getFullDate;
351
+
352
+ var getFormatedDate = function getFormatedDate() {
353
+ var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
354
+ var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "/";
355
+ if (isNaN(date)) return undefined;
356
+ var dateString = "";
357
+ dateString += date.getFullYear() + separator;
358
+ dateString += date.getMonth() + 1 + separator;
359
+ dateString += date.getDate();
360
+ return dateString;
361
+ };
362
+ /*------------------------
363
+ Obtener una fecha a partir de
364
+ un objeto Date() en formato:
345
365
  'dd de MMMM del aaaa'
346
366
  ejemplo: '12 de octubre del 2022'
347
367
  => si es la fecha del dia actual:
@@ -353,7 +373,7 @@ devolvera '12 de octubre'
353
373
  --------------------------*/
354
374
 
355
375
 
356
- exports.getFullDate = getFullDate;
376
+ exports.getFormatedDate = getFormatedDate;
357
377
 
358
378
  var getCustomDate = function getCustomDate() {
359
379
  var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
@@ -32,6 +32,8 @@ var FontFamily = {
32
32
  Raleway_700: "Raleway-700",
33
33
  Raleway_800: "Raleway-800",
34
34
  Raleway_900: "Raleway-900",
35
+ RobotoMedium: "RobotoMedium",
36
+ RobotoRegular: "RobotoRegular",
35
37
  Roboto: "Roboto"
36
38
  };
37
39
  exports.FontFamily = FontFamily;