contentoh-components-library 21.3.19 → 21.3.21

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 (197) hide show
  1. package/.env.development +5 -0
  2. package/.env.production +2 -2
  3. package/dist/assets/images/customSelect/starIcon.svg +14 -0
  4. package/dist/assets/images/defaultImages/Spinner.gif +0 -0
  5. package/dist/assets/images/defaultImages/notFound.svg +124 -0
  6. package/dist/assets/images/generalButton/closeIcon.svg +2 -2
  7. package/dist/assets/sounds/newMessage.mp3 +0 -0
  8. package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +72 -0
  9. package/dist/components/atoms/ButtonFileChooser/index.js +110 -0
  10. package/dist/components/atoms/ButtonFileChooser/styles.js +20 -0
  11. package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +66 -0
  12. package/dist/components/atoms/ButtonV2/index.js +110 -0
  13. package/dist/components/atoms/ButtonV2/styles.js +53 -0
  14. package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +50 -0
  15. package/dist/components/atoms/CustomIcon/index.js +40 -0
  16. package/dist/components/atoms/CustomIcon/styles.js +33 -0
  17. package/dist/components/atoms/IconFile/IconFile.stories.js +48 -0
  18. package/dist/components/atoms/IconFile/index.js +249 -0
  19. package/dist/components/atoms/IconFile/styles.js +23 -0
  20. package/dist/components/atoms/Image/Image.stories.js +73 -0
  21. package/dist/components/atoms/Image/index.js +76 -0
  22. package/dist/components/atoms/Image/styles.js +43 -0
  23. package/dist/components/atoms/ImageLink/ImageLink.stories.js +63 -0
  24. package/dist/components/atoms/ImageLink/index.js +77 -0
  25. package/dist/components/atoms/ImageLink/styles.js +40 -0
  26. package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +70 -0
  27. package/dist/components/atoms/ImagePreview/index.js +208 -0
  28. package/dist/components/atoms/ImagePreview/styles.js +44 -0
  29. package/dist/components/atoms/InputText/InputText.stories.js +60 -0
  30. package/dist/components/atoms/InputText/index.js +66 -0
  31. package/dist/components/atoms/InputText/styles.js +32 -0
  32. package/dist/components/atoms/NotFound/NotFound.stories.js +36 -0
  33. package/dist/components/atoms/NotFound/index.js +75 -0
  34. package/dist/components/atoms/NotFound/styles.js +20 -0
  35. package/dist/components/atoms/ProgressBar/index.js +36 -6
  36. package/dist/components/atoms/ProgressBar/styles.js +11 -3
  37. package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +45 -0
  38. package/dist/components/atoms/SelectItemV2/index.js +57 -0
  39. package/dist/components/atoms/SelectItemV2/styles.js +30 -0
  40. package/dist/components/atoms/Tooltip/Tooltip.stories.js +66 -0
  41. package/dist/components/atoms/Tooltip/index.js +72 -0
  42. package/dist/components/atoms/Tooltip/styles.js +20 -0
  43. package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +66 -0
  44. package/dist/components/molecules/ButtonDownloadFile/index.js +179 -0
  45. package/dist/components/molecules/ButtonDownloadFile/styles.js +23 -0
  46. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
  47. package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
  48. package/dist/components/molecules/Dropdown/Dropdown.stories.js +98 -0
  49. package/dist/components/molecules/Dropdown/index.js +150 -0
  50. package/dist/components/molecules/Dropdown/styles.js +26 -0
  51. package/dist/components/molecules/HeaderTop/index.js +23 -6
  52. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  53. package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +82 -0
  54. package/dist/components/molecules/ImageTooltip/index.js +85 -0
  55. package/dist/components/molecules/ImageTooltip/styles.js +33 -0
  56. package/dist/components/molecules/ProductNameHeader/index.js +6 -4
  57. package/dist/components/molecules/SelectV2/SelectV2.stories.js +120 -0
  58. package/dist/components/molecules/SelectV2/index.js +306 -0
  59. package/dist/components/molecules/SelectV2/styles.js +42 -0
  60. package/dist/components/molecules/SelectV2/test.js +94 -0
  61. package/dist/components/molecules/SelectV2/test.stories.js +27 -0
  62. package/dist/components/organisms/Chat/Chat.stories.js +160 -0
  63. package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +83 -0
  64. package/dist/components/organisms/Chat/ChatLists/index.js +160 -0
  65. package/dist/components/organisms/Chat/ChatLists/styles.js +29 -0
  66. package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +176 -0
  67. package/dist/components/organisms/Chat/ContainerItems/index.js +537 -0
  68. package/dist/components/organisms/Chat/ContainerItems/styles.js +20 -0
  69. package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +142 -0
  70. package/dist/components/organisms/Chat/ContentChat/index.js +1466 -0
  71. package/dist/components/organisms/Chat/ContentChat/styles.js +20 -0
  72. package/dist/components/organisms/Chat/Footer/Footer.stories.js +43 -0
  73. package/dist/components/organisms/Chat/Footer/index.js +976 -0
  74. package/dist/components/organisms/Chat/Footer/styles.js +32 -0
  75. package/dist/components/organisms/Chat/Header/Header.stories.js +96 -0
  76. package/dist/components/organisms/Chat/Header/index.js +83 -0
  77. package/dist/components/organisms/Chat/Header/styles.js +20 -0
  78. package/dist/components/organisms/Chat/index.js +253 -0
  79. package/dist/components/organisms/Chat/styles.js +29 -0
  80. package/dist/components/organisms/FullProductNameHeader/index.js +1 -0
  81. package/dist/components/organisms/Modal/Modal.stories.js +66 -0
  82. package/dist/components/organisms/Modal/index.js +95 -0
  83. package/dist/components/organisms/Modal/styles.js +20 -0
  84. package/dist/components/organisms/RangeCalendar/RangeCalendar.stories.js +33 -0
  85. package/dist/components/organisms/RangeCalendar/index.js +149 -0
  86. package/dist/components/organisms/RangeCalendar/styles.js +27 -0
  87. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +65 -50
  88. package/dist/components/pages/ProviderProductEdition/index.js +15 -11
  89. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +36 -44
  90. package/dist/components/pages/RetailerProductEdition/index.js +13 -12
  91. package/dist/global-files/data.js +18 -23
  92. package/dist/global-files/fonts.css +6 -0
  93. package/dist/global-files/handle_http.js +381 -0
  94. package/dist/global-files/handle_userTech.js +20 -0
  95. package/dist/global-files/utils.js +514 -0
  96. package/dist/global-files/variables.js +2 -0
  97. package/dist/index.js +267 -46
  98. package/package.json +13 -1
  99. package/src/assets/images/customSelect/starIcon.svg +14 -0
  100. package/src/assets/images/defaultImages/Spinner.gif +0 -0
  101. package/src/assets/images/defaultImages/notFound.svg +124 -0
  102. package/src/assets/images/generalButton/closeIcon.svg +2 -2
  103. package/src/assets/sounds/newMessage.mp3 +0 -0
  104. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
  105. package/src/components/atoms/ButtonFileChooser/index.js +68 -0
  106. package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
  107. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +53 -0
  108. package/src/components/atoms/ButtonV2/index.js +85 -0
  109. package/src/components/atoms/ButtonV2/styles.js +217 -0
  110. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
  111. package/src/components/atoms/CustomIcon/index.js +41 -0
  112. package/src/components/atoms/CustomIcon/styles.js +85 -0
  113. package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
  114. package/src/components/atoms/IconFile/index.js +119 -0
  115. package/src/components/atoms/IconFile/styles.js +67 -0
  116. package/src/components/atoms/Image/Image.stories.js +51 -0
  117. package/src/components/atoms/Image/index.js +55 -0
  118. package/src/components/atoms/Image/styles.js +34 -0
  119. package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
  120. package/src/components/atoms/ImageLink/index.js +57 -0
  121. package/src/components/atoms/ImageLink/styles.js +30 -0
  122. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
  123. package/src/components/atoms/ImagePreview/index.js +178 -0
  124. package/src/components/atoms/ImagePreview/styles.js +77 -0
  125. package/src/components/atoms/InputText/InputText.stories.js +39 -0
  126. package/src/components/atoms/InputText/index.js +61 -0
  127. package/src/components/atoms/InputText/styles.js +89 -0
  128. package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
  129. package/src/components/atoms/NotFound/index.js +52 -0
  130. package/src/components/atoms/NotFound/styles.js +55 -0
  131. package/src/components/atoms/ProgressBar/index.js +40 -5
  132. package/src/components/atoms/ProgressBar/styles.js +24 -0
  133. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
  134. package/src/components/atoms/SelectItemV2/index.js +61 -0
  135. package/src/components/atoms/SelectItemV2/styles.js +90 -0
  136. package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
  137. package/src/components/atoms/Tooltip/index.js +59 -0
  138. package/src/components/atoms/Tooltip/styles.js +42 -0
  139. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
  140. package/src/components/molecules/ButtonDownloadFile/index.js +109 -0
  141. package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
  142. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
  143. package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
  144. package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -0
  145. package/src/components/molecules/Dropdown/index.js +150 -0
  146. package/src/components/molecules/Dropdown/styles.js +75 -0
  147. package/src/components/molecules/HeaderTop/index.js +29 -8
  148. package/src/components/molecules/HeaderTop/styles.js +4 -0
  149. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -0
  150. package/src/components/molecules/ImageTooltip/index.js +63 -0
  151. package/src/components/molecules/ImageTooltip/styles.js +18 -0
  152. package/src/components/molecules/ProductNameHeader/index.js +7 -2
  153. package/src/components/molecules/SelectV2/SelectV2.stories.js +115 -0
  154. package/src/components/molecules/SelectV2/index.js +357 -0
  155. package/src/components/molecules/SelectV2/styles.js +105 -0
  156. package/src/components/molecules/SelectV2/test.js +60 -0
  157. package/src/components/molecules/SelectV2/test.stories.js +10 -0
  158. package/src/components/organisms/Chat/Chat.stories.js +147 -0
  159. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
  160. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  161. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  162. package/src/components/organisms/Chat/ChatLists/index.js +141 -0
  163. package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
  164. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
  165. package/src/components/organisms/Chat/ContainerItems/index.js +512 -0
  166. package/src/components/organisms/Chat/ContainerItems/styles.js +328 -0
  167. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
  168. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  169. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  170. package/src/components/organisms/Chat/ContentChat/index.js +919 -0
  171. package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
  172. package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
  173. package/src/components/organisms/Chat/Footer/index.js +661 -0
  174. package/src/components/organisms/Chat/Footer/styles.js +286 -0
  175. package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
  176. package/src/components/organisms/Chat/Header/index.js +93 -0
  177. package/src/components/organisms/Chat/Header/styles.js +49 -0
  178. package/src/components/organisms/Chat/index.js +235 -0
  179. package/src/components/organisms/Chat/styles.js +42 -0
  180. package/src/components/organisms/FullProductNameHeader/index.js +1 -0
  181. package/src/components/organisms/Modal/Modal.stories.js +55 -0
  182. package/src/components/organisms/Modal/index.js +97 -0
  183. package/src/components/organisms/Modal/styles.js +103 -0
  184. package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +16 -0
  185. package/src/components/organisms/RangeCalendar/index.js +121 -0
  186. package/src/components/organisms/RangeCalendar/styles.js +883 -0
  187. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +67 -49
  188. package/src/components/pages/ProviderProductEdition/index.js +16 -9
  189. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +36 -46
  190. package/src/components/pages/RetailerProductEdition/index.js +14 -10
  191. package/src/global-files/data.js +18 -23
  192. package/src/global-files/fonts.css +6 -0
  193. package/src/global-files/handle_http.js +225 -0
  194. package/src/global-files/handle_userTech.js +7 -0
  195. package/src/global-files/utils.js +330 -0
  196. package/src/global-files/variables.js +2 -0
  197. 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.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImE2YzRkM2Q2LTI0YTQtNDFkNC1hZDBmLWQwODc0MzhhYjViNiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI0MmE2OWE4My02OGY0LTRmZjktOGU4Zi1jYzgxODQ5MDU5NGYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2OTkyODUxMSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2OTkzMjExMSwiaWF0IjoxNjY5OTI4NTExLCJlbWFpbCI6ImV0Y0Bjb250ZW50b2guY29tIn0.Mv1hFVjkF2y__7XP0bXzU2Yq8YMc0go9OgB7all5F4HvfK62I0l9rNRqddlaLjDSCmjvyYI-M8WFwHtdlOL1-liazZr8hhu7_9SciapRzkuuHlWwu0g3EEK54NuHR3-YYRax85hKyN9YoV1MY_fTzT9WUVXWoqf4UPj2SH79g_A0l0lm18ODzzdhXFSpubuI8-Ml7MbXUh8klzl7T55S16sj8zPONpesrA01WsG1PWGqfRZI2g37edj_en2_fIcfi49tQjbSjnQOVOPnkO5TPiyoMtZdS53Rx75iSI8-fP-Z7kD-5TI_KK6vK35PHoG1B-N3EzDUjXek4MowNswnGA",
34
+ token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJmMzY2YTdjYi02YjA0LTRiMzAtOTJmYy1iMzY0MmY3ZjEzNmEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY3MTc0MzE0OSwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjcxNzQ2NzQ5LCJpYXQiOjE2NzE3NDMxNDksImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.J8kTv1sEotxoicaRclaK1r0tjVbwHPDxIzdDfxYo9J4XwBYYfS180__KYYE0Dh1AfUK_K0mrk2_78_rhTNxCQT85W7XS3ZEcxIOUekqoxaKFl8LSVN_eWz3SlsGG0yRflhJGt6d4gBVByXZbdNiyp1rkjgMln6fhwlRUnuGRbG1WKQvdAPli3qfH8mLzgoTz-6HWs1Jf2Ujheavf3ipGMNtj-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) {
@@ -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
+ }
@@ -0,0 +1,381 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.fetchPUT = exports.fetchPOST = exports.fetchGET = exports.fetchDELETE = void 0;
9
+
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
13
+
14
+ var _axios = _interopRequireDefault(require("axios"));
15
+
16
+ //============================================================
17
+
18
+ /**
19
+ * funcion que realiza un axios GET
20
+ *
21
+ * Si <body> es undefined significa que hubo error
22
+
23
+ * @returns { Promise<{
24
+ * body: {} | undefined ,
25
+ * message: string,
26
+ * errorDetail: string
27
+ * }> }
28
+ *
29
+ */
30
+ //============================================================
31
+ var fetchGET = function fetchGET() {
32
+ var endpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
33
+ var paramsQuery = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34
+ var paramsHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
35
+ return new Promise( /*#__PURE__*/function () {
36
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response) {
37
+ var URL, keysParamsQuery, respHTTPjson, body, _body$message, _body$errorDetail;
38
+
39
+ return _regenerator.default.wrap(function _callee$(_context) {
40
+ while (1) {
41
+ switch (_context.prev = _context.next) {
42
+ case 0:
43
+ _context.prev = 0;
44
+ URL = endpoint;
45
+ keysParamsQuery = Object.keys(paramsQuery); // agregar cada param query a la URL
46
+
47
+ keysParamsQuery.forEach(function (key, index) {
48
+ if (index == 0) {
49
+ URL += "?".concat(key, "=").concat(paramsQuery[key]);
50
+ } else {
51
+ URL += "&".concat(key, "=").concat(paramsQuery[key]);
52
+ }
53
+ });
54
+ _context.next = 6;
55
+ return _axios.default.get(URL, {
56
+ headers: paramsHeaders
57
+ });
58
+
59
+ case 6:
60
+ respHTTPjson = _context.sent;
61
+
62
+ if (!(respHTTPjson.status !== 200)) {
63
+ _context.next = 9;
64
+ break;
65
+ }
66
+
67
+ return _context.abrupt("return", response({
68
+ message: "No fue posible llevar a cabo la operación",
69
+ errorDetail: respHTTPjson.statusText
70
+ }));
71
+
72
+ case 9:
73
+ // obtener body backend
74
+ body = JSON.parse(respHTTPjson.data.body); // verificar si existe error desde el backend
75
+
76
+ if (!(respHTTPjson.data.statusCode !== 200)) {
77
+ _context.next = 12;
78
+ break;
79
+ }
80
+
81
+ return _context.abrupt("return", response({
82
+ message: (_body$message = body.message) !== null && _body$message !== void 0 ? _body$message : "",
83
+ errorDetail: (_body$errorDetail = body.errorDetail) !== null && _body$errorDetail !== void 0 ? _body$errorDetail : ""
84
+ }));
85
+
86
+ case 12:
87
+ return _context.abrupt("return", response({
88
+ body: body
89
+ }));
90
+
91
+ case 15:
92
+ _context.prev = 15;
93
+ _context.t0 = _context["catch"](0);
94
+ return _context.abrupt("return", response({
95
+ message: "Error al obtener los datos",
96
+ errorDetail: _context.t0.message
97
+ }));
98
+
99
+ case 18:
100
+ case "end":
101
+ return _context.stop();
102
+ }
103
+ }
104
+ }, _callee, null, [[0, 15]]);
105
+ }));
106
+
107
+ return function (_x) {
108
+ return _ref.apply(this, arguments);
109
+ };
110
+ }());
111
+ }; //============================================================
112
+
113
+ /**
114
+ * funcion que realiza un axios POST
115
+ *
116
+ * Si <body> es undefined significa que hubo error
117
+
118
+ * @returns { Promise<{
119
+ * body: {} | undefined ,
120
+ * message: string,
121
+ * errorDetail: string
122
+ * }> }
123
+ *
124
+ */
125
+ //============================================================
126
+
127
+
128
+ exports.fetchGET = fetchGET;
129
+
130
+ var fetchPOST = function fetchPOST() {
131
+ var endpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
132
+ var paramsBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
133
+ var paramsHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
134
+ return new Promise( /*#__PURE__*/function () {
135
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(response) {
136
+ var respHTTPjson, body, _body$message2, _body$errorDetail2;
137
+
138
+ return _regenerator.default.wrap(function _callee2$(_context2) {
139
+ while (1) {
140
+ switch (_context2.prev = _context2.next) {
141
+ case 0:
142
+ _context2.prev = 0;
143
+ _context2.next = 3;
144
+ return _axios.default.post(endpoint, paramsBody, {
145
+ headers: paramsHeaders
146
+ });
147
+
148
+ case 3:
149
+ respHTTPjson = _context2.sent;
150
+
151
+ if (!(respHTTPjson.status !== 200)) {
152
+ _context2.next = 6;
153
+ break;
154
+ }
155
+
156
+ return _context2.abrupt("return", response({
157
+ message: "No fue posible llevar a cabo la operación",
158
+ errorDetail: respHTTPjson.statusText
159
+ }));
160
+
161
+ case 6:
162
+ // obtener body backend
163
+ body = JSON.parse(respHTTPjson.data.body); // verificar si existe error desde el backend
164
+
165
+ if (!(respHTTPjson.data.statusCode !== 200)) {
166
+ _context2.next = 9;
167
+ break;
168
+ }
169
+
170
+ return _context2.abrupt("return", response({
171
+ message: (_body$message2 = body.message) !== null && _body$message2 !== void 0 ? _body$message2 : "",
172
+ errorDetail: (_body$errorDetail2 = body.errorDetail) !== null && _body$errorDetail2 !== void 0 ? _body$errorDetail2 : ""
173
+ }));
174
+
175
+ case 9:
176
+ return _context2.abrupt("return", response({
177
+ body: body
178
+ }));
179
+
180
+ case 12:
181
+ _context2.prev = 12;
182
+ _context2.t0 = _context2["catch"](0);
183
+ return _context2.abrupt("return", response({
184
+ message: "Error al guardar los datos",
185
+ errorDetail: _context2.t0.message
186
+ }));
187
+
188
+ case 15:
189
+ case "end":
190
+ return _context2.stop();
191
+ }
192
+ }
193
+ }, _callee2, null, [[0, 12]]);
194
+ }));
195
+
196
+ return function (_x2) {
197
+ return _ref2.apply(this, arguments);
198
+ };
199
+ }());
200
+ }; //============================================================
201
+
202
+ /**
203
+ * funcion que realiza un axios GET
204
+ *
205
+ * Si <body> es undefined significa que hubo error
206
+
207
+ * @returns { Promise<{
208
+ * body: {} | undefined ,
209
+ * message: string,
210
+ * errorDetail: string
211
+ * }> }
212
+ *
213
+ */
214
+ //============================================================
215
+
216
+
217
+ exports.fetchPOST = fetchPOST;
218
+
219
+ var fetchPUT = function fetchPUT() {
220
+ var endpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
221
+ var paramsBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
222
+ var paramsHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
223
+ return new Promise( /*#__PURE__*/function () {
224
+ var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(response) {
225
+ var respHTTPjson, body, _body$message3, _body$errorDetail3;
226
+
227
+ return _regenerator.default.wrap(function _callee3$(_context3) {
228
+ while (1) {
229
+ switch (_context3.prev = _context3.next) {
230
+ case 0:
231
+ _context3.prev = 0;
232
+ _context3.next = 3;
233
+ return _axios.default.put(endpoint, paramsBody, {
234
+ headers: paramsHeaders
235
+ });
236
+
237
+ case 3:
238
+ respHTTPjson = _context3.sent;
239
+
240
+ if (!(respHTTPjson.status !== 200)) {
241
+ _context3.next = 6;
242
+ break;
243
+ }
244
+
245
+ return _context3.abrupt("return", response({
246
+ message: "No fue posible llevar a cabo la operación",
247
+ errorDetail: respHTTPjson.statusText
248
+ }));
249
+
250
+ case 6:
251
+ // obtener body backend
252
+ body = JSON.parse(respHTTPjson.data.body); // verificar si existe error desde el backend
253
+
254
+ if (!(respHTTPjson.data.statusCode !== 200)) {
255
+ _context3.next = 9;
256
+ break;
257
+ }
258
+
259
+ return _context3.abrupt("return", response({
260
+ message: (_body$message3 = body.message) !== null && _body$message3 !== void 0 ? _body$message3 : "",
261
+ errorDetail: (_body$errorDetail3 = body.errorDetail) !== null && _body$errorDetail3 !== void 0 ? _body$errorDetail3 : ""
262
+ }));
263
+
264
+ case 9:
265
+ return _context3.abrupt("return", response({
266
+ body: body
267
+ }));
268
+
269
+ case 12:
270
+ _context3.prev = 12;
271
+ _context3.t0 = _context3["catch"](0);
272
+ return _context3.abrupt("return", response({
273
+ message: "Error al actualizar los datos",
274
+ errorDetail: _context3.t0.message
275
+ }));
276
+
277
+ case 15:
278
+ case "end":
279
+ return _context3.stop();
280
+ }
281
+ }
282
+ }, _callee3, null, [[0, 12]]);
283
+ }));
284
+
285
+ return function (_x3) {
286
+ return _ref3.apply(this, arguments);
287
+ };
288
+ }());
289
+ }; //============================================================
290
+
291
+ /**
292
+ * funcion que realiza un axios GET
293
+ *
294
+ * Si <body> es undefined significa que hubo error
295
+
296
+ * @returns { Promise<{
297
+ * body: {} | undefined ,
298
+ * message: string,
299
+ * errorDetail: string
300
+ * }> }
301
+ *
302
+ */
303
+ //============================================================
304
+
305
+
306
+ exports.fetchPUT = fetchPUT;
307
+
308
+ var fetchDELETE = function fetchDELETE() {
309
+ var endpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
310
+ var paramsBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
311
+ var paramsHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
312
+ return new Promise( /*#__PURE__*/function () {
313
+ var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(response) {
314
+ var respHTTPjson, body, _body$message4, _body$errorDetail4;
315
+
316
+ return _regenerator.default.wrap(function _callee4$(_context4) {
317
+ while (1) {
318
+ switch (_context4.prev = _context4.next) {
319
+ case 0:
320
+ _context4.prev = 0;
321
+ _context4.next = 3;
322
+ return _axios.default.delete(endpoint, {
323
+ data: paramsBody,
324
+ headers: paramsHeaders
325
+ });
326
+
327
+ case 3:
328
+ respHTTPjson = _context4.sent;
329
+
330
+ if (!(respHTTPjson.status !== 200)) {
331
+ _context4.next = 6;
332
+ break;
333
+ }
334
+
335
+ return _context4.abrupt("return", response({
336
+ message: "No fue posible llevar a cabo la operación",
337
+ errorDetail: respHTTPjson.statusText
338
+ }));
339
+
340
+ case 6:
341
+ // obtener body backend
342
+ body = JSON.parse(respHTTPjson.data.body); // verificar si existe error desde el backend
343
+
344
+ if (!(respHTTPjson.data.statusCode !== 200)) {
345
+ _context4.next = 9;
346
+ break;
347
+ }
348
+
349
+ return _context4.abrupt("return", response({
350
+ message: (_body$message4 = body.message) !== null && _body$message4 !== void 0 ? _body$message4 : "",
351
+ errorDetail: (_body$errorDetail4 = body.errorDetail) !== null && _body$errorDetail4 !== void 0 ? _body$errorDetail4 : ""
352
+ }));
353
+
354
+ case 9:
355
+ return _context4.abrupt("return", response({
356
+ body: body
357
+ }));
358
+
359
+ case 12:
360
+ _context4.prev = 12;
361
+ _context4.t0 = _context4["catch"](0);
362
+ return _context4.abrupt("return", response({
363
+ message: "Error al actualizar los datos",
364
+ errorDetail: _context4.t0.message
365
+ }));
366
+
367
+ case 15:
368
+ case "end":
369
+ return _context4.stop();
370
+ }
371
+ }
372
+ }, _callee4, null, [[0, 12]]);
373
+ }));
374
+
375
+ return function (_x4) {
376
+ return _ref4.apply(this, arguments);
377
+ };
378
+ }());
379
+ };
380
+
381
+ exports.fetchDELETE = fetchDELETE;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isUserTech = exports.isUserAdminTech = void 0;
7
+
8
+ var isUserTech = function isUserTech() {
9
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
10
+ return ["AS", "ADMIN-AS", "ADMIN"].includes(value);
11
+ };
12
+
13
+ exports.isUserTech = isUserTech;
14
+
15
+ var isUserAdminTech = function isUserAdminTech() {
16
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
17
+ return ["ADMIN-AS", "ADMIN"].includes(value);
18
+ };
19
+
20
+ exports.isUserAdminTech = isUserAdminTech;