contentoh-components-library 21.4.133 → 21.4.134

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 (388) hide show
  1. package/dist/assets/images/Icons/save-white-gray.svg +1 -1
  2. package/dist/assets/images/Icons/save-white.svg +1 -1
  3. package/dist/components/atoms/Avatar/index.js +2 -3
  4. package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +1 -1
  5. package/dist/components/atoms/ButtonV2/index.js +1 -1
  6. package/dist/components/atoms/ButtonV2/styles.js +1 -1
  7. package/dist/components/atoms/CheckBox/CheckBox.stories.js +1 -8
  8. package/dist/components/atoms/CheckBox/index.js +0 -8
  9. package/dist/components/atoms/CheckBox/styles.js +1 -8
  10. package/dist/components/atoms/GeneralButton/styles.js +2 -6
  11. package/dist/components/atoms/GeneralInput/index.js +2 -5
  12. package/dist/components/atoms/GeneralInput/style.js +29 -0
  13. package/dist/components/atoms/GeneralInput/styles.js +1 -1
  14. package/dist/components/atoms/InputFormatter/index.js +3 -4
  15. package/dist/components/atoms/InputFormatter/styles.js +3 -3
  16. package/dist/components/atoms/SliderToolTip/styles.js +1 -1
  17. package/dist/components/atoms/TabSection/styles.js +1 -1
  18. package/dist/components/molecules/BoxAttribute/index.js +3 -3
  19. package/dist/components/molecules/BoxAttribute/styles.js +1 -1
  20. package/dist/components/molecules/BoxButtons/index.js +1 -0
  21. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  22. package/dist/components/molecules/GalleryElement/index.js +2 -82
  23. package/dist/components/molecules/GalleryHeader/index.js +0 -3
  24. package/dist/components/molecules/HeaderTop/index.js +11 -68
  25. package/dist/components/molecules/ProductNameHeader/index.js +3 -17
  26. package/dist/components/molecules/SignInLogin/index.js +28 -36
  27. package/dist/components/molecules/StatusAsignationInfo/FinancedCompanies.js +1 -1
  28. package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +2 -1
  29. package/dist/components/molecules/TagAndInput/index.js +0 -4
  30. package/dist/components/organisms/Chat/Chat.stories.js +8 -27
  31. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  32. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  33. package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
  34. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  35. package/dist/components/organisms/Chat/index.js +4 -49
  36. package/dist/components/organisms/Chat/styles.js +1 -1
  37. package/dist/components/organisms/DashboardMetric/index.js +6 -12
  38. package/dist/components/organisms/FullProductNameHeader/index.js +4 -14
  39. package/dist/components/organisms/InputGroup/index.js +73 -192
  40. package/dist/components/organisms/InputGroup/styles.js +1 -1
  41. package/dist/components/organisms/Modal/Modal.stories.js +1 -2
  42. package/dist/components/organisms/Modal/index.js +2 -7
  43. package/dist/components/organisms/Modal/styles.js +1 -1
  44. package/dist/components/organisms/Table/index.js +2 -16
  45. package/dist/components/organisms/Table/styles.js +11 -17
  46. package/dist/components/pages/Dashboard/Dashboard.stories.js +36 -33
  47. package/dist/components/pages/Dashboard/index.js +9 -37
  48. package/dist/components/pages/MultipleEdition/MultipleEdition.stories.js +2 -2
  49. package/dist/components/pages/MultipleEdition/index.js +3 -5
  50. package/dist/components/pages/MultipleEdition/styles.js +2 -2
  51. package/dist/components/pages/MultipleEdition/utils.js +5 -44
  52. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +60 -60
  53. package/dist/components/pages/ProviderProductEdition/index.js +217 -249
  54. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  55. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +0 -4
  56. package/dist/components/pages/RetailerProductEdition/index.js +406 -354
  57. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  58. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  59. package/dist/global-files/data.js +3 -11
  60. package/dist/global-files/variables.js +1 -7
  61. package/dist/index.js +58 -214
  62. package/package.json +1 -4
  63. package/src/components/atoms/Avatar/index.js +2 -8
  64. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -1
  65. package/src/components/atoms/ButtonV2/index.js +0 -1
  66. package/src/components/atoms/ButtonV2/styles.js +0 -16
  67. package/src/components/atoms/CheckBox/CheckBox.stories.js +0 -5
  68. package/src/components/atoms/CheckBox/index.js +1 -5
  69. package/src/components/atoms/CheckBox/styles.js +3 -9
  70. package/src/components/atoms/GeneralButton/styles.js +0 -46
  71. package/src/components/atoms/GeneralInput/index.js +0 -3
  72. package/src/components/atoms/GeneralInput/styles.js +1 -19
  73. package/src/components/atoms/InputFormatter/index.js +1 -2
  74. package/src/components/atoms/InputFormatter/styles.js +4 -9
  75. package/src/components/atoms/SliderToolTip/styles.js +1 -1
  76. package/src/components/atoms/TabSection/index.js +1 -1
  77. package/src/components/atoms/TabSection/styles.js +3 -0
  78. package/src/components/molecules/BoxAttribute/index.js +25 -32
  79. package/src/components/molecules/BoxAttribute/styles.js +1 -1
  80. package/src/components/molecules/BoxButtons/index.js +22 -23
  81. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  82. package/src/components/molecules/GalleryElement/index.js +1 -76
  83. package/src/components/molecules/GalleryHeader/index.js +0 -1
  84. package/src/components/molecules/HeaderTop/index.js +6 -52
  85. package/src/components/molecules/ProductNameHeader/index.js +1 -19
  86. package/src/components/molecules/SignInLogin/index.js +11 -11
  87. package/src/components/molecules/StatusAsignationInfo/FinancedCompanies.js +63 -501
  88. package/src/components/molecules/StatusAsignationInfo/index.js +1 -1
  89. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +2 -1
  90. package/src/components/molecules/TagAndInput/index.js +6 -8
  91. package/src/components/organisms/Chat/Chat.stories.js +7 -27
  92. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  93. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -14
  94. package/src/components/organisms/Chat/ContentChat/index.js +12 -88
  95. package/src/components/organisms/Chat/Footer/index.js +0 -11
  96. package/src/components/organisms/Chat/index.js +4 -46
  97. package/src/components/organisms/Chat/styles.js +0 -4
  98. package/src/components/organisms/DashboardMetric/index.js +3 -6
  99. package/src/components/organisms/FullProductNameHeader/index.js +1 -13
  100. package/src/components/organisms/InputGroup/index.js +144 -292
  101. package/src/components/organisms/InputGroup/styles.js +0 -31
  102. package/src/components/organisms/Modal/Modal.stories.js +1 -2
  103. package/src/components/organisms/Modal/index.js +2 -9
  104. package/src/components/organisms/Modal/styles.js +1 -8
  105. package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
  106. package/src/components/pages/Dashboard/Dashboard.stories.js +38 -33
  107. package/src/components/pages/Dashboard/index.js +7 -36
  108. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +60 -56
  109. package/src/components/pages/ProviderProductEdition/index.js +136 -148
  110. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  111. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +0 -4
  112. package/src/components/pages/RetailerProductEdition/index.js +277 -153
  113. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  114. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  115. package/src/global-files/data.js +10 -6
  116. package/src/global-files/variables.js +0 -6
  117. package/src/index.js +0 -12
  118. package/src/assets/images/Icons/addv2.svg +0 -8
  119. package/src/assets/images/Icons/beenhere.svg +0 -9
  120. package/src/assets/images/Icons/checkv2.svg +0 -8
  121. package/src/assets/images/Icons/close-magenta.svg +0 -9
  122. package/src/assets/images/Icons/close.svg +0 -8
  123. package/src/assets/images/Icons/closeCircle.svg +0 -8
  124. package/src/assets/images/Icons/delete-forever-red.svg +0 -9
  125. package/src/assets/images/Icons/delete-forever-white.svg +0 -10
  126. package/src/assets/images/Icons/edit.svg +0 -8
  127. package/src/assets/images/Icons/fullscreen.svg +0 -3
  128. package/src/assets/images/Icons/infoNR.svg +0 -8
  129. package/src/assets/images/Icons/options.svg +0 -3
  130. package/src/assets/images/Icons/save-white-gray.svg +0 -9
  131. package/src/assets/images/Icons/save-white.svg +0 -9
  132. package/src/assets/images/Icons/save.svg +0 -8
  133. package/src/assets/images/Icons/search.svg +0 -3
  134. package/src/assets/images/Icons/settings.svg +0 -8
  135. package/src/assets/images/Icons/trash.svg +0 -8
  136. package/src/assets/images/Icons/undo.svg +0 -8
  137. package/src/assets/images/Icons/upload-file-white.svg +0 -4
  138. package/src/assets/images/Icons/upload-file.svg +0 -10
  139. package/src/assets/images/Icons/upload_file.svg +0 -10
  140. package/src/assets/images/Icons/warningv2.svg +0 -3
  141. package/src/assets/images/checkBox/checkrosa.svg +0 -3
  142. package/src/assets/images/checkBox/checkverde.svg +0 -3
  143. package/src/assets/images/flagsv2/highPriority.svg +0 -3
  144. package/src/assets/images/flagsv2/lowPriority.svg +0 -3
  145. package/src/assets/images/flagsv2/mediumPriority.svg +0 -3
  146. package/src/assets/images/flagsv2/noPriority.svg +0 -3
  147. package/src/assets/images/generalButton/closeIconWhite.svg +0 -4
  148. package/src/assets/images/generalButton/closeIconv2.svg +0 -4
  149. package/src/assets/images/generalButton/saveIconpink.svg +0 -3
  150. package/src/components/atoms/CharsMissing/Wysiwyg.stories.js +0 -12
  151. package/src/components/atoms/CharsMissing/index.js +0 -60
  152. package/src/components/atoms/CharsMissing/styles.js +0 -44
  153. package/src/components/atoms/CustomChip/CustomChip.stories.js +0 -16
  154. package/src/components/atoms/CustomChip/index.js +0 -34
  155. package/src/components/atoms/CustomChip/styles.js +0 -6
  156. package/src/components/atoms/FeatureTagv2/FeatureTagv2.stories.js +0 -16
  157. package/src/components/atoms/FeatureTagv2/index.js +0 -10
  158. package/src/components/atoms/FeatureTagv2/styles.js +0 -56
  159. package/src/components/atoms/GeneralInputv2/GeneralInputv2.stories.js +0 -33
  160. package/src/components/atoms/GeneralInputv2/index.js +0 -155
  161. package/src/components/atoms/GeneralInputv2/styles.js +0 -67
  162. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
  163. package/src/components/atoms/ImageCarousel/index.js +0 -103
  164. package/src/components/atoms/ImageCarousel/styles.js +0 -79
  165. package/src/components/atoms/InputFormatterv2/Wysiwyg.stories.js +0 -12
  166. package/src/components/atoms/InputFormatterv2/index.js +0 -148
  167. package/src/components/atoms/InputFormatterv2/styles.js +0 -39
  168. package/src/components/atoms/InputImages/InputImages.stories.js +0 -19
  169. package/src/components/atoms/InputImages/index.js +0 -25
  170. package/src/components/atoms/InputImages/styles.js +0 -17
  171. package/src/components/atoms/Multiselect/Multiselect.stories.js +0 -364
  172. package/src/components/atoms/Multiselect/index.js +0 -351
  173. package/src/components/atoms/Multiselect/styles.js +0 -33
  174. package/src/components/atoms/NumberMandatory/NumberMandatory.stories.js +0 -19
  175. package/src/components/atoms/NumberMandatory/index.js +0 -16
  176. package/src/components/atoms/NumberMandatory/styles.js +0 -11
  177. package/src/components/atoms/ObservationFlag/ObservationFlag.stories.js +0 -20
  178. package/src/components/atoms/ObservationFlag/index.js +0 -167
  179. package/src/components/atoms/ObservationFlag/styles.js +0 -104
  180. package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
  181. package/src/components/atoms/PercentTag/index.js +0 -9
  182. package/src/components/atoms/PercentTag/styles.js +0 -69
  183. package/src/components/atoms/PriorityFlagv2/PriorityFlagv2.stories.js +0 -20
  184. package/src/components/atoms/PriorityFlagv2/index.js +0 -20
  185. package/src/components/atoms/PriorityFlagv2/styles.js +0 -6
  186. package/src/components/atoms/ProductImagev2/ProductImagev2.stories.js +0 -28
  187. package/src/components/atoms/ProductImagev2/index.js +0 -16
  188. package/src/components/atoms/ProductImagev2/styles.js +0 -62
  189. package/src/components/atoms/Progress/Progress.stories.js +0 -25
  190. package/src/components/atoms/Progress/index.js +0 -74
  191. package/src/components/atoms/Progress/styles.js +0 -98
  192. package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
  193. package/src/components/atoms/RatingStars/index.js +0 -31
  194. package/src/components/atoms/RatingStars/styles.js +0 -28
  195. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
  196. package/src/components/atoms/RetailerCatalog/index.js +0 -49
  197. package/src/components/atoms/RetailerCatalog/styles.js +0 -30
  198. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
  199. package/src/components/atoms/RetailerOption/index.js +0 -53
  200. package/src/components/atoms/RetailerOption/styles.js +0 -41
  201. package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
  202. package/src/components/atoms/RetailersList/index.js +0 -20
  203. package/src/components/atoms/RetailersList/styles.js +0 -19
  204. package/src/components/atoms/ScreenHeaderv2/ScreenHeaderv2.stories.js +0 -53
  205. package/src/components/atoms/ScreenHeaderv2/index.js +0 -134
  206. package/src/components/atoms/ScreenHeaderv2/styles.js +0 -103
  207. package/src/components/atoms/Selectv2/VersionSelect.js +0 -27
  208. package/src/components/atoms/Selectv2/index.js +0 -35
  209. package/src/components/atoms/Selectv2/style.js +0 -93
  210. package/src/components/atoms/TabSectionv2/TabSection.stories.js +0 -25
  211. package/src/components/atoms/TabSectionv2/index.js +0 -9
  212. package/src/components/atoms/TabSectionv2/styles.js +0 -20
  213. package/src/components/atoms/TooltipLight/Tooltip.stories.js +0 -20
  214. package/src/components/atoms/TooltipLight/index.js +0 -46
  215. package/src/components/atoms/TooltipLight/styles.js +0 -65
  216. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
  217. package/src/components/atoms/UserCatalog/index.js +0 -100
  218. package/src/components/atoms/UserCatalog/styles.js +0 -24
  219. package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
  220. package/src/components/atoms/UserOption/index.js +0 -95
  221. package/src/components/atoms/UserOption/styles.js +0 -61
  222. package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
  223. package/src/components/atoms/UserSelector/index.js +0 -86
  224. package/src/components/atoms/UserSelector/styles.js +0 -55
  225. package/src/components/atoms/WordsMissing/Wysiwyg.stories.js +0 -12
  226. package/src/components/atoms/WordsMissing/index.js +0 -60
  227. package/src/components/atoms/WordsMissing/styles.js +0 -10
  228. package/src/components/molecules/AddGroup/AddGroup.stories.js +0 -15
  229. package/src/components/molecules/AddGroup/index.js +0 -84
  230. package/src/components/molecules/AddGroup/styles.js +0 -141
  231. package/src/components/molecules/AsignationInfo/AsignationInfo.stories.js +0 -17
  232. package/src/components/molecules/AsignationInfo/index.js +0 -108
  233. package/src/components/molecules/AsignationInfo/styles.js +0 -86
  234. package/src/components/molecules/EditionActiveImagev2/EditionActiveImagev2.stories.js +0 -12
  235. package/src/components/molecules/EditionActiveImagev2/index.js +0 -15
  236. package/src/components/molecules/EditionActiveImagev2/styles.js +0 -7
  237. package/src/components/molecules/EditionTabs/EditionTabs.stories.js +0 -12
  238. package/src/components/molecules/EditionTabs/index.js +0 -33
  239. package/src/components/molecules/EditionTabs/styles.js +0 -24
  240. package/src/components/molecules/FeaturesBarv2/FeaturesBarv2.stories.js +0 -20
  241. package/src/components/molecules/FeaturesBarv2/index.js +0 -32
  242. package/src/components/molecules/FeaturesBarv2/styles.js +0 -17
  243. package/src/components/molecules/GalleryElementv2/GalleryElementv2.stories.js +0 -30
  244. package/src/components/molecules/GalleryElementv2/index.js +0 -142
  245. package/src/components/molecules/GalleryElementv2/styles.js +0 -119
  246. package/src/components/molecules/GalleryHeaderv2/GalleryHeaderv2.stories.js +0 -10
  247. package/src/components/molecules/GalleryHeaderv2/index.js +0 -25
  248. package/src/components/molecules/GalleryHeaderv2/styles.js +0 -47
  249. package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
  250. package/src/components/molecules/GridItem/index.js +0 -128
  251. package/src/components/molecules/GridItem/styles.js +0 -129
  252. package/src/components/molecules/GroupSelect/GroupSelect.stories.js +0 -35
  253. package/src/components/molecules/GroupSelect/SelectItem.js +0 -105
  254. package/src/components/molecules/GroupSelect/index.js +0 -190
  255. package/src/components/molecules/GroupSelect/styles.js +0 -124
  256. package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
  257. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
  258. package/src/components/molecules/HeaderItem/index.js +0 -26
  259. package/src/components/molecules/HeaderItem/styles.js +0 -27
  260. package/src/components/molecules/HeaderTopv2/HeaderTopv2.stories.js +0 -10
  261. package/src/components/molecules/HeaderTopv2/index.js +0 -100
  262. package/src/components/molecules/HeaderTopv2/styles.js +0 -33
  263. package/src/components/molecules/ImageSelectorv2/ImageSelectorv2.stories.js +0 -46
  264. package/src/components/molecules/ImageSelectorv2/index.js +0 -22
  265. package/src/components/molecules/ImageSelectorv2/styles.js +0 -15
  266. package/src/components/molecules/Phase/Phase.stories.js +0 -107
  267. package/src/components/molecules/Phase/index.js +0 -391
  268. package/src/components/molecules/Phase/styles.js +0 -97
  269. package/src/components/molecules/ProductNameHeaderv2/ProductNameHeaderv2.stories.js +0 -37
  270. package/src/components/molecules/ProductNameHeaderv2/index.js +0 -12
  271. package/src/components/molecules/ProductNameHeaderv2/styles.js +0 -10
  272. package/src/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +0 -37
  273. package/src/components/molecules/ProductSkuStatus/index.js +0 -26
  274. package/src/components/molecules/ProductSkuStatus/styles.js +0 -7
  275. package/src/components/molecules/RetailerSelectorv2/RetailerSelectorv2.stories.js +0 -35
  276. package/src/components/molecules/RetailerSelectorv2/index.js +0 -80
  277. package/src/components/molecules/RetailerSelectorv2/styles.js +0 -21
  278. package/src/components/molecules/RowItem/ColumnItem.js +0 -9
  279. package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
  280. package/src/components/molecules/RowItem/index.js +0 -45
  281. package/src/components/molecules/RowItem/styles.js +0 -40
  282. package/src/components/molecules/ServiceDataValidator/ServiceDataValidator.stories.js +0 -90
  283. package/src/components/molecules/ServiceDataValidator/index.js +0 -49
  284. package/src/components/molecules/ServiceDataValidator/styles.js +0 -36
  285. package/src/components/molecules/StatusRetailer/StatusAsignationInfo.stories.js +0 -17
  286. package/src/components/molecules/StatusRetailer/index.js +0 -55
  287. package/src/components/molecules/StatusRetailer/styles.js +0 -85
  288. package/src/components/molecules/TabsMenuv2/TabsMenuv2.stories.js +0 -19
  289. package/src/components/molecules/TabsMenuv2/index.js +0 -112
  290. package/src/components/molecules/TabsMenuv2/styles.js +0 -19
  291. package/src/components/molecules/TagAndInputv2/TagAndInputv2.stories.js +0 -24
  292. package/src/components/molecules/TagAndInputv2/index.js +0 -86
  293. package/src/components/molecules/TagAndInputv2/styles.js +0 -35
  294. package/src/components/molecules/Validation/Validation.stories.js +0 -12
  295. package/src/components/molecules/Validation/index.js +0 -77
  296. package/src/components/molecules/Validation/styles.js +0 -19
  297. package/src/components/molecules/VersionItemv2/VersionItemv2.stories.js +0 -14
  298. package/src/components/molecules/VersionItemv2/index.js +0 -59
  299. package/src/components/molecules/VersionItemv2/styles.js +0 -47
  300. package/src/components/organisms/BarButtons/BarButtons.stories.js +0 -13
  301. package/src/components/organisms/BarButtons/index.js +0 -150
  302. package/src/components/organisms/BarButtons/styles.js +0 -54
  303. package/src/components/organisms/Chatv2/ChatLists/ChatLists.stories.js +0 -65
  304. package/src/components/organisms/Chatv2/ChatLists/Rotoplas.jpeg +0 -0
  305. package/src/components/organisms/Chatv2/ChatLists/THD.png +0 -0
  306. package/src/components/organisms/Chatv2/ChatLists/index.js +0 -141
  307. package/src/components/organisms/Chatv2/ChatLists/styles.js +0 -162
  308. package/src/components/organisms/Chatv2/Chatv2.stories.js +0 -184
  309. package/src/components/organisms/Chatv2/ContainerItems/ContainerItems.stories.js +0 -142
  310. package/src/components/organisms/Chatv2/ContainerItems/index.js +0 -538
  311. package/src/components/organisms/Chatv2/ContainerItems/styles.js +0 -360
  312. package/src/components/organisms/Chatv2/ContentChat/ContentChat.stories.js +0 -102
  313. package/src/components/organisms/Chatv2/ContentChat/Rotoplas.jpeg +0 -0
  314. package/src/components/organisms/Chatv2/ContentChat/THD.png +0 -0
  315. package/src/components/organisms/Chatv2/ContentChat/index.js +0 -1016
  316. package/src/components/organisms/Chatv2/ContentChat/styles.js +0 -44
  317. package/src/components/organisms/Chatv2/Footer/Footer.stories.js +0 -22
  318. package/src/components/organisms/Chatv2/Footer/index.js +0 -668
  319. package/src/components/organisms/Chatv2/Footer/styles.js +0 -290
  320. package/src/components/organisms/Chatv2/Header/Header.stories.js +0 -66
  321. package/src/components/organisms/Chatv2/Header/index.js +0 -93
  322. package/src/components/organisms/Chatv2/Header/styles.js +0 -49
  323. package/src/components/organisms/Chatv2/index.js +0 -281
  324. package/src/components/organisms/Chatv2/styles.js +0 -85
  325. package/src/components/organisms/CompleteServices/CompleteServices.stories.js +0 -91
  326. package/src/components/organisms/CompleteServices/index.js +0 -82
  327. package/src/components/organisms/CompleteServices/styles.js +0 -35
  328. package/src/components/organisms/DragAndDropPhases/DragAndDropPhases.stories.js +0 -13
  329. package/src/components/organisms/DragAndDropPhases/index.js +0 -336
  330. package/src/components/organisms/DragAndDropPhases/styles.js +0 -107
  331. package/src/components/organisms/DragPrueba/DragPrueba.stories.js +0 -12
  332. package/src/components/organisms/DragPrueba/index.js +0 -57
  333. package/src/components/organisms/DragPrueba/styles.js +0 -8
  334. package/src/components/organisms/EditGroup/EditGroup.stories.js +0 -20
  335. package/src/components/organisms/EditGroup/index.js +0 -321
  336. package/src/components/organisms/EditGroup/styles.js +0 -207
  337. package/src/components/organisms/FullProductNamev2/FullProductNamev2.stories.js +0 -28
  338. package/src/components/organisms/FullProductNamev2/index.js +0 -101
  339. package/src/components/organisms/FullProductNamev2/styles.js +0 -49
  340. package/src/components/organisms/FullTabsMenuv2/FullTabsMenuv2.stories.js +0 -22
  341. package/src/components/organisms/FullTabsMenuv2/index.js +0 -142
  342. package/src/components/organisms/FullTabsMenuv2/styles.js +0 -47
  343. package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -6428
  344. package/src/components/organisms/GridProducts/index.js +0 -50
  345. package/src/components/organisms/GridProducts/styles.js +0 -14
  346. package/src/components/organisms/GridProducts/utils.js +0 -111
  347. package/src/components/organisms/ImageDataTablev2/ImageDataTablev2.stories.js +0 -24
  348. package/src/components/organisms/ImageDataTablev2/index.js +0 -124
  349. package/src/components/organisms/ImageDataTablev2/styles.js +0 -18
  350. package/src/components/organisms/ImagePreviewerv2/ImagePreviewerv2.stories.js +0 -38
  351. package/src/components/organisms/ImagePreviewerv2/index.js +0 -22
  352. package/src/components/organisms/ImagePreviewerv2/styles.js +0 -7
  353. package/src/components/organisms/ImageUploader/ImageUploader.stories.js +0 -15
  354. package/src/components/organisms/ImageUploader/index.js +0 -62
  355. package/src/components/organisms/ImageUploader/styles.js +0 -29
  356. package/src/components/organisms/ImageVisor/ImageVisor.stories.js +0 -15
  357. package/src/components/organisms/ImageVisor/index.js +0 -143
  358. package/src/components/organisms/ImageVisor/styles.js +0 -106
  359. package/src/components/organisms/InputGroupv2/InputGroupv2.stories.js +0 -31
  360. package/src/components/organisms/InputGroupv2/index.js +0 -296
  361. package/src/components/organisms/InputGroupv2/styles.js +0 -90
  362. package/src/components/organisms/MandatoryBar/MandatoryBar.stories.js +0 -18
  363. package/src/components/organisms/MandatoryBar/index.js +0 -31
  364. package/src/components/organisms/MandatoryBar/styles.js +0 -12
  365. package/src/components/organisms/ProductImageModalv2/ProductImageModalv2.stories.js +0 -90
  366. package/src/components/organisms/ProductImageModalv2/index.js +0 -105
  367. package/src/components/organisms/ProductImageModalv2/styles.js +0 -71
  368. package/src/components/organisms/RenameImagesBar/RenameImagesBar.stories.js +0 -18
  369. package/src/components/organisms/RenameImagesBar/index.js +0 -30
  370. package/src/components/organisms/RenameImagesBar/styles.js +0 -12
  371. package/src/components/organisms/Table/Table.stories.js +0 -609
  372. package/src/components/organisms/Table/index.js +0 -84
  373. package/src/components/organisms/Table/styles.js +0 -114
  374. package/src/components/organisms/VersionSelectorv2/VersionSelectorv2.stories.js +0 -15
  375. package/src/components/organisms/VersionSelectorv2/index.js +0 -105
  376. package/src/components/organisms/VersionSelectorv2/styles.js +0 -45
  377. package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +0 -17
  378. package/src/components/pages/MultipleEdition/components/ImageUploader.js +0 -62
  379. package/src/components/pages/MultipleEdition/components/ImageUploaderStyles.js +0 -29
  380. package/src/components/pages/MultipleEdition/components/ImageVisor.js +0 -143
  381. package/src/components/pages/MultipleEdition/components/styles.js +0 -106
  382. package/src/components/pages/MultipleEdition/index.js +0 -248
  383. package/src/components/pages/MultipleEdition/saveData.js +0 -91
  384. package/src/components/pages/MultipleEdition/styles.js +0 -195
  385. package/src/components/pages/MultipleEdition/utils.js +0 -1035
  386. package/src/components/pages/ProductEditionv2/ProductEditionv2.stories.js +0 -213
  387. package/src/components/pages/ProductEditionv2/index.js +0 -1758
  388. package/src/components/pages/ProductEditionv2/styles.js +0 -154
@@ -1,1035 +0,0 @@
1
- import axios from "axios";
2
- import { ImageVisor } from "../../organisms/ImageVisor";
3
- import { ButtonV2 } from "../../atoms/ButtonV2";
4
- import { deleteImage } from "./saveData";
5
- import { Container, Input, InputBase, TextField } from "@mui/material";
6
- import { ValidationPanel } from "../../atoms/ValidationPanel";
7
- import { TagAndInput } from "../../molecules/TagAndInput";
8
- import acceptIcon from "../../../assets/images/generalButton/acceptIcon.svg";
9
- import rejectIcon from "../../../assets/images/generalButton/rejectIcon.svg";
10
- import infoIcon from "../../../assets/images/Icons/info.svg";
11
- import saveWhite from "../../../assets/images/Icons/save-white.svg";
12
- import saveWhiteGray from "../../../assets/images/Icons/save-white-gray.svg";
13
- import { DockSharp } from "@mui/icons-material";
14
- import React, { useState } from 'react';
15
-
16
- // variables
17
- export const optionsSelect = [
18
- {
19
- label: "item 1",
20
- value: 1,
21
- },
22
- {
23
- label: "item 2",
24
- value: 2,
25
- },
26
- {
27
- label: "item 3",
28
- value: 3,
29
- },
30
- {
31
- label: "item 4",
32
- value: 4,
33
- },
34
- ];
35
-
36
- export const columnsBase = [
37
- {
38
- Header: "UPC",
39
- accessor: "upc",
40
- width: "100px",
41
- fixedToLeft: 0,
42
- style: {
43
- textAlign: "left",
44
- },
45
- },
46
- {
47
- Header: "Nombre",
48
- accessor: "name",
49
- width: "100px",
50
- fixedToLeft: 100,
51
- },
52
- {
53
- Header: "Categoría",
54
- accessor: "category",
55
- width: "100px",
56
- fixedToLeft: 200,
57
- },
58
- {
59
- Header: "Est.",
60
- accessor: "status",
61
- width: "30px",
62
- fixedToLeft: 300,
63
- },
64
- {
65
- Header: "Ver.",
66
- accessor: "version",
67
- width: "30px",
68
- fixedToLeft: 330,
69
- style: {
70
- borderRight: "1px solid #f0f0f0",
71
- },
72
- },
73
- ];
74
-
75
- // data
76
- async function getData(service, articles, versions, token) {
77
- const encodedArticles = encodeURIComponent(articles.join(","));
78
- const encodedVersion = encodeURIComponent(versions.join(","));
79
- const params = `?articles=${encodedArticles}&versions=${encodedVersion}`;
80
- const res = await axios.get(
81
- `${process.env.REACT_APP_BASE_MULTIPLE_EDITION_ENDPOINT}/${service}${params}`,
82
- {
83
- headers: {
84
- Authorization: token,
85
- },
86
- }
87
- );
88
- return JSON.parse(res.data.body);
89
- }
90
-
91
- // functions
92
- export function dataReducer(state, action) {
93
- if (action.type === "init") {
94
- return action.payload;
95
- }
96
- if (action.type === "updateImage") {
97
- const { articleId, imageId } = action.payload;
98
- const newImageData = state.images.data.slice();
99
- const articleIndex = newImageData.findIndex((f) => f.id === articleId);
100
- const id = newImageData[articleIndex]?.images[imageId]?.value?.id;
101
- newImageData[articleIndex].images[imageId].value = {
102
- ...action.payload,
103
- id,
104
- };
105
- return {
106
- ...state,
107
- images: {
108
- ...state.images,
109
- data: newImageData,
110
- },
111
- };
112
- }
113
- if (action.type === "deleteImage") {
114
- const { articleId, imageId, token } = action.payload;
115
- const newImageData = state.images.data.slice();
116
- const articleIndex = newImageData.findIndex((f) => f.id === articleId);
117
- const id = newImageData[articleIndex]?.images[imageId]?.value?.id;
118
- delete newImageData[articleIndex]?.images[imageId]?.value;
119
- console.log(newImageData[articleIndex]);
120
- const data = {
121
- articleId,
122
- deleteImages: [
123
- {
124
- id,
125
- },
126
- ],
127
- };
128
- deleteImage(data, newImageData[articleIndex].version, token);
129
- return {
130
- ...state,
131
- images: {
132
- ...state.images,
133
- data: newImageData,
134
- },
135
- };
136
- }
137
- return state;
138
- }
139
-
140
- export async function initData(setDataServices, articles, versions, token) {
141
- const [description, datasheet, images] = await Promise.all([
142
- getData("description", articles, versions, token),
143
- getData("datasheet", articles, versions, token),
144
- getData("images", articles, versions, token),
145
- ]);
146
- const { data: dataDescription, attributes: rulesDescription } = description;
147
- const { data: dataDatasheet, attributes: rulesDatasheet } = datasheet;
148
- const { data: dataImage, typesShot: rulesImage } = images;
149
- const payload = {
150
- description: {
151
- data: Object.values(dataDescription),
152
- rules: rulesDescription,
153
- },
154
- datasheet: {
155
- data: Object.values(dataDatasheet),
156
- rules: rulesDatasheet,
157
- },
158
- images: {
159
- data: Object.values(dataImage),
160
- rules: rulesImage.reduce(
161
- (prev, curr) =>
162
- (prev = {
163
- ...prev,
164
- [curr.id]: curr.name,
165
- }),
166
- {}
167
- ),
168
- },
169
- };
170
- setDataServices({
171
- type: "init",
172
- payload,
173
- });
174
- }
175
-
176
- export function setDataColumns(
177
- section,
178
- dataService,
179
- token,
180
- setModalFromTable,
181
- setDataServices,
182
- setModal,
183
- setShowValidationPanel,
184
- setAttributeSelected,
185
- setShowRejectModal,
186
- setAttributesReviewed,
187
- setMessage,
188
- showValidationPanel,
189
- attributeSelected,
190
- attributesReviewed,
191
- descriptionsReviewed,
192
- imagesReviewed
193
- ) {
194
- const { data, rules } = dataService;
195
- const columns = [...columnsBase];
196
- const values = [];
197
-
198
- const styleRetailer = {
199
- borderRight: "1px solid #f0f0f0",
200
- borderLeft: "1px solid #f0f0f0",
201
- };
202
- const styleSaveButtonCol = {
203
- borderRight: "1px solid #f0f0f0",
204
- //borderLeft: "1px solid #f0f0f0",
205
- };
206
- const styleData = {
207
- textAlign: "center",
208
- display: "flex",
209
- justifyContent: "center",
210
- };
211
-
212
- const retailersAdded = {
213
- id: [],
214
- attr: [],
215
- };
216
- data.forEach((item) => {
217
- const currentData = {};
218
- ["upc", "name", "accessor", "category", "status", "version"].forEach(
219
- (key) => {
220
- currentData[key] = <p className="content"> {item[key]} </p>;
221
- }
222
- );
223
- if (item.status)
224
- currentData["status"] = (
225
- <StatusTag statusType={item.status} ovalForm={true} />
226
- );
227
- if (section === "images") {
228
- const { images } = item;
229
- item.retailer.forEach((ret) => {
230
- if (!retailersAdded.id.includes(ret.id)) {
231
- retailersAdded.id.push(ret.id);
232
- columns.push({
233
- Header: "Cadena",
234
- accessor: `retailer${ret.id}`,
235
- width: "100px"
236
- });
237
- columns.push({
238
- Header: "",
239
- accessor: `retailer${ret.id}-save`,
240
- width: "60px",
241
- style: styleSaveButtonCol,
242
- });
243
- }
244
- currentData[`retailer${ret.id}`] = <p> {ret.name} </p>;
245
- ret.images.forEach((imgId) => {
246
- if (!retailersAdded.attr.includes(`img${imgId}`)) {
247
- retailersAdded.attr.push(`img${imgId}`);
248
- columns.push({
249
- Header: rules[imgId],
250
- accessor: `img${imgId}`,
251
- width: "170px",
252
- style: styleData,
253
- });
254
- }
255
- });
256
- var saveAvailable = imagesReviewed
257
- .filter((e) => e.articleId === item.id)
258
- .every((e) => e.isReviewed === true);
259
- if (
260
- imagesReviewed.filter((e) => e.articleId === item.id).length == 0
261
- ) {
262
- saveAvailable = false;
263
- }
264
- currentData[`retailer${ret.id}-save`] = (
265
- <button
266
- onClick={() => {
267
- var articlesImagesUpdateBody = [];
268
- var articleImages = imagesReviewed.filter(
269
- (e) => e.articleId === item.id && e.versionId === item.version
270
- );
271
- articleImages.forEach((articleImage) => {
272
- articlesImagesUpdateBody.push({
273
- articleId: articleImage.articleId,
274
- versionId: articleImage.versionId,
275
- attributeId: articleImage.imageId,
276
- value: articleImage.srcdb,
277
- isApproved: articleImage.isApproved,
278
- comment: articleImage.comment,
279
- });
280
- });
281
- updateArticleData(
282
- item.version,
283
- item.id,
284
- articlesImagesUpdateBody,
285
- token,
286
- setMessage,
287
- section
288
- );
289
- }}
290
- className="validation-option"
291
- disabled={!saveAvailable}
292
- >
293
- {saveAvailable && <img src={saveWhite} alt="guardar" />}{" "}
294
- {!saveAvailable && <img src={saveWhiteGray} alt="guardar" />}{" "}
295
- </button>
296
- );
297
-
298
- Object.values(images).forEach(({ value, isApproved, imageId, comment}) => {
299
- const props = {
300
- name: rules[imageId],
301
- value: value,
302
- setModalFromTable,
303
- articleId: item.id,
304
- setDataServices,
305
- imageId,
306
- setModal,
307
- token,
308
- };
309
- if (
310
- !imagesReviewed.find(
311
- (e) =>
312
- e.articleId == item.id &&
313
- e.imageId == imageId &&
314
- e.versionId == item.version
315
- )
316
- )
317
- imagesReviewed.push({
318
- articleId: item.id,
319
- imageId: imageId,
320
- versionId: item.version,
321
- isApproved: isApproved? isApproved: false,
322
- isReviewed: isApproved!=null? true: false,
323
- comment: "",
324
- srcdb: value? value.src: ""
325
- });
326
- var index = imagesReviewed.findIndex(
327
- (e) =>
328
- e.articleId === item.id &&
329
- e.imageId=== imageId &&
330
- e.versionId === item.version
331
- );
332
- currentData[`img${imageId}`] =
333
- <>
334
- <button
335
- onClick={() => {
336
- setShowValidationPanel(true);
337
- setAttributeSelected({
338
- articleId: item.id,
339
- attributeId: imageId,
340
- versionId: item.version,
341
- });
342
- }}
343
- className="validation-button"
344
- >
345
- {imagesReviewed[index].isReviewed &&
346
- imagesReviewed[index].isApproved && (
347
- <img
348
- id={
349
- "button_" +
350
- item.id +
351
- "_" +
352
- imageId +
353
- "_" +
354
- item.version
355
- }
356
- src={acceptIcon}
357
- alt="accept button"
358
- />
359
- )}{" "}
360
- {imagesReviewed[index].isReviewed &&
361
- !imagesReviewed[index].isApproved && (
362
- <img
363
- id={
364
- "button_" +
365
- item.id +
366
- "_" +
367
- imageId +
368
- "_" +
369
- item.version
370
- }
371
- src={rejectIcon}
372
- alt="reject button"
373
- />
374
- )}{" "}
375
- {
376
- !imagesReviewed[index].isReviewed && (
377
- <img
378
- id={
379
- "button_" +
380
- item.id +
381
- "_" +
382
- imageId +
383
- "_" +
384
- item.version
385
- }
386
- src={rejectIcon}
387
- alt="reject button"
388
- />
389
- )}
390
- </button>{" "}
391
- {showValidationPanel &&
392
- attributeSelected.articleId === item.id &&
393
- attributeSelected.attributeId === imageId &&
394
- attributeSelected.versionId === item.version && (
395
- <div className="buttons-container" style={{left: "70px"}}>
396
- <button
397
- onClick={() => {
398
- imagesReviewed[index].isApproved = true;
399
- imagesReviewed[index].isReviewed = true;
400
- //document.getElementById(item.id+'_'+des.attributeId+'_'+item.version).style.borderColor="#71DE56";
401
- setShowValidationPanel(false);
402
- }}
403
- className="validation-option"
404
- >
405
- <img src={acceptIcon} alt="accept button" />
406
- <p> Validar </p>{" "}
407
- </button>{" "}
408
- <button
409
- onClick={() => {
410
- setShowValidationPanel(false);
411
- setShowRejectModal(true);
412
- }}
413
- className="validation-option"
414
- >
415
- <img src={rejectIcon} alt="reject button" />
416
- <p> Rechazar </p>{" "}
417
- </button>{" "}
418
- </div>
419
- )}{" "}
420
- {comment && <div class="tooltip">
421
- <ImageVisor {...props}/>
422
- <span class="tooltiptext"><p><b>Comentarios del rechazo</b></p><p>{des.comment}</p></span>
423
- </div>}
424
- {!comment && <div>
425
- <ImageVisor {...props} />
426
- </div>}
427
- </>;
428
- });
429
- });
430
- }
431
- if (section === "datasheet") {
432
- item.retailer.forEach((ret) => {
433
- if (!retailersAdded.id.includes(ret.id)) {
434
- retailersAdded.id.push(ret.id);
435
- columns.push({
436
- Header: "Cadena",
437
- accessor: `retailer${ret.id}`,
438
- width: "100px",
439
- });
440
- columns.push({
441
- Header: "",
442
- accessor: `retailer${ret.id}-save`,
443
- width: "60px",
444
- style: styleSaveButtonCol,
445
- });
446
- }
447
- currentData[`retailer${ret.id}`] = <p> {ret.name} </p>;
448
- var saveAvailable = attributesReviewed
449
- .filter((e) => e.articleId === item.id)
450
- .every((e) => e.isReviewed === true);
451
- if (
452
- attributesReviewed.filter((e) => e.articleId === item.id).length == 0
453
- ) {
454
- saveAvailable = false;
455
- }
456
- currentData[`retailer${ret.id}-save`] = (
457
- <button
458
- onClick={() => {
459
- var articlesAtributesUpdateBody = [];
460
- var articleAttributes = attributesReviewed.filter(
461
- (e) => e.articleId === item.id && e.versionId === item.version
462
- );
463
- articleAttributes.forEach((articleAttribute) => {
464
- const value = document.getElementById(
465
- articleAttribute.articleId +
466
- "_" +
467
- articleAttribute.attributeId +
468
- "_" +
469
- articleAttribute.versionId
470
- ).value;
471
- articlesAtributesUpdateBody.push({
472
- articleId: articleAttribute.articleId,
473
- versionId: articleAttribute.versionId,
474
- attributeId: articleAttribute.attributeId,
475
- value: value ? value : "",
476
- isApproved: articleAttribute.isApproved,
477
- comment: articleAttribute.comment,
478
- });
479
- });
480
- updateArticleData(
481
- item.version,
482
- item.id,
483
- articlesAtributesUpdateBody,
484
- token,
485
- setMessage,
486
- section
487
- );
488
- }}
489
- className="validation-option"
490
- disabled={!saveAvailable}
491
- >
492
- {saveAvailable && <img src={saveWhite} alt="guardar" />}{" "}
493
- {!saveAvailable && <img src={saveWhiteGray} alt="guardar" />}{" "}
494
- </button>
495
- );
496
- ret.attributes.forEach((attributeId) => {
497
- if (!retailersAdded.attr.includes(`${attributeId + "-" + ret.id}`)) {
498
- retailersAdded.attr.push(`${attributeId + "-" + ret.id}`);
499
- columns.push({
500
- Header: rules[attributeId].name,
501
- accessor: `${attributeId + "-" + ret.id}`,
502
- width: "200px",
503
- style: styleData,
504
- description:rules[attributeId].description,
505
- });
506
- }
507
- });
508
-
509
- const inputTypeValue = (type) => {
510
- switch (type) {
511
- case "Booleano":
512
- return "checkbox";
513
- case "Numérico":
514
- return "number";
515
- default:
516
- return "text";
517
- }
518
- };
519
- Object.values(item.attributes).forEach((des) => {
520
- const props = {
521
- inputId:
522
- item.id +
523
- "_" +
524
- rules[des.attributeId].attributeId +
525
- "_" +
526
- item.version,
527
- name:
528
- item.id +
529
- "-" +
530
- rules[des.attributeId].attributeId +
531
- "-" +
532
- item.version,
533
- value: des.value,
534
- inputType:inputTypeValue(des.type),
535
- };
536
-
537
-
538
- let inputComponent;
539
- if (des.option_list.length>0) {
540
- inputComponent = (
541
- <select id={item.id + "_" + rules[des.attributeId].attributeId + "_" + item.version}
542
- name={item.id + "-" + rules[des.attributeId].attributeId + "-" + item.version}
543
- className="select-edition-multiple"
544
- >
545
- {des.option_list.map((option, index) => (
546
- <option key={index} value={option}>
547
- {option}
548
- </option>
549
- ))}
550
- </select>
551
- );
552
-
553
- } else {
554
- inputComponent = <TagAndInput {...props} />;
555
- }
556
-
557
- if (
558
- !attributesReviewed.find(
559
- (e) =>
560
- e.articleId == item.id &&
561
- e.attributeId == des.attributeId &&
562
- e.versionId == item.version
563
- )
564
- )
565
- attributesReviewed.push({
566
- articleId: item.id,
567
- attributeId: des.attributeId,
568
- versionId: item.version,
569
- isApproved: des.isApproved ? des.isApproved : false,
570
- isReviewed: des.isApproved != null ? true : false,
571
- comment: "",
572
- });
573
- var index = attributesReviewed.findIndex(
574
- (e) =>
575
- e.articleId === item.id &&
576
- e.attributeId === des.attributeId &&
577
- e.versionId === item.version
578
- );
579
- currentData[`${des.attributeId + "-" + ret.id}`] = (
580
- <>
581
- <button
582
- onClick={() => {
583
- setShowValidationPanel(true);
584
- setAttributeSelected({
585
- articleId: item.id,
586
- attributeId: des.attributeId,
587
- versionId: item.version,
588
- });
589
- }}
590
- className="validation-button"
591
- >
592
- {attributesReviewed[index].isReviewed &&
593
- attributesReviewed[index].isApproved && (
594
- <img
595
- id={
596
- "button_" +
597
- item.id +
598
- "_" +
599
- des.attributeId +
600
- "_" +
601
- item.version
602
- }
603
- src={acceptIcon}
604
- alt="accept button"
605
- />
606
- )}{" "}
607
- {attributesReviewed[index].isReviewed &&
608
- !attributesReviewed[index].isApproved && (
609
- <img
610
- id={
611
- "button_" +
612
- item.id +
613
- "_" +
614
- des.attributeId +
615
- "_" +
616
- item.version
617
- }
618
- src={rejectIcon}
619
- alt="reject button"
620
- />
621
- )}{" "}
622
- {typeof des.isApproved === "undefined" &&
623
- !attributesReviewed[index].isReviewed && (
624
- <img
625
- id={
626
- "button_" +
627
- item.id +
628
- "_" +
629
- des.attributeId +
630
- "_" +
631
- item.version
632
- }
633
- src={rejectIcon}
634
- alt="reject button"
635
- />
636
- )}
637
- </button>{" "}
638
- {showValidationPanel &&
639
- attributeSelected.articleId === item.id &&
640
- attributeSelected.attributeId === des.attributeId &&
641
- attributeSelected.versionId === item.version && (
642
- <div className="buttons-container" style={{left: "35px"}}>
643
- <button
644
- onClick={() => {
645
- attributesReviewed[index].isApproved = true;
646
- attributesReviewed[index].isReviewed = true;
647
- //document.getElementById(item.id+'_'+des.attributeId+'_'+item.version).style.borderColor="#71DE56";
648
- setShowValidationPanel(false);
649
- }}
650
- className="validation-option"
651
- >
652
- <img src={acceptIcon} alt="accept button" />
653
- <p> Validar </p>{" "}
654
- </button>{" "}
655
- <button
656
- onClick={() => {
657
- setShowValidationPanel(false);
658
- setShowRejectModal(true);
659
- }}
660
- className="validation-option"
661
- >
662
- <img src={rejectIcon} alt="reject button" />
663
- <p> Rechazar </p>{" "}
664
- </button>{" "}
665
- </div>
666
- )}{" "}
667
- {des.comment && <div class="tooltip">
668
- {inputComponent}
669
- <span class="tooltiptext"><p><b>Comentarios del rechazo</b></p><p>{des.comment}</p></span>
670
- </div>}
671
- {!des.comment && <div>
672
- {inputComponent}
673
- </div>}
674
- </>
675
- );
676
- });
677
- });
678
- }
679
- if (section === "description") {
680
- item.retailer.forEach((ret) => {
681
- if (!retailersAdded.id.includes(ret.id)) {
682
- retailersAdded.id.push(ret.id);
683
- columns.push({
684
- Header: "Cadena",
685
- accessor: `retailer${ret.id}`,
686
- width: "100px"
687
- });
688
- columns.push({
689
- Header: "",
690
- accessor: `retailer${ret.id}-save`,
691
- width: "60px",
692
- style: styleSaveButtonCol,
693
- });
694
- }
695
- var saveAvailable = descriptionsReviewed
696
- .filter((e) => e.articleId === item.id)
697
- .every((e) => e.isReviewed === true);
698
- if (
699
- descriptionsReviewed.filter((e) => e.articleId === item.id).length == 0
700
- ) {
701
- saveAvailable = false;
702
- }
703
- currentData[`retailer${ret.id}`] = <p> {ret.name} </p>;
704
- ret.descriptions.forEach((descriptionId) => {
705
- if (!retailersAdded.attr.includes(`${descriptionId}`)) {
706
- retailersAdded.attr.push(`${descriptionId}`);
707
- columns.push({
708
- Header: rules[ret.id][descriptionId].name,
709
- accessor: `${descriptionId}`,
710
- width: "250px",
711
- style: styleData,
712
- description:rules[ret.id][descriptionId].description
713
- });
714
- }
715
- });
716
-
717
- currentData[`retailer${ret.id}-save`] = (
718
- <button
719
- onClick={() => {
720
- var articlesDescriptionsUpdateBody = [];
721
- var articleDescriptions = descriptionsReviewed.filter(
722
- (e) => e.articleId === item.id && e.versionId === item.version
723
- );
724
- articleDescriptions.forEach((articleDescription) => {
725
- const value = document.getElementById(
726
- articleDescription.articleId +
727
- "_" +
728
- articleDescription.attributeId +
729
- "_" +
730
- articleDescription.versionId
731
- ).value;
732
- articlesDescriptionsUpdateBody.push({
733
- articleId: articleDescription.articleId,
734
- versionId: articleDescription.versionId,
735
- attributeId: articleDescription.attributeId,
736
- value: value ? value : "",
737
- isApproved: articleDescription.isApproved,
738
- comment: articleDescription.comment,
739
- });
740
- });
741
- updateArticleData(
742
- item.version,
743
- item.id,
744
- articlesDescriptionsUpdateBody,
745
- token,
746
- setMessage,
747
- section
748
- );
749
- }}
750
- className="validation-option"
751
- disabled={!saveAvailable}
752
- >
753
- {saveAvailable && <img src={saveWhite} alt="guardar" />}{" "}
754
- {!saveAvailable && <img src={saveWhiteGray} alt="guardar" />}{" "}
755
- </button>
756
- );
757
- Object.values(item.descriptions).forEach((des) => {
758
- const props = {
759
- name: rules[des.attributeId],
760
- id: item.id + "_" + des.attributeId + "_" + item.version,
761
- cols: 30,
762
- rows: 2,
763
- defaultValue: des.value
764
- };
765
- if (
766
- !descriptionsReviewed.find(
767
- (e) =>
768
- e.articleId == item.id &&
769
- e.attributeId == des.attributeId &&
770
- e.versionId == item.version
771
- )
772
- )
773
- descriptionsReviewed.push({
774
- articleId: item.id,
775
- attributeId: des.attributeId,
776
- versionId: item.version,
777
- isApproved: des.isApproved ? des.isApproved : false,
778
- isReviewed: des.isApproved != null ? true : false,
779
- comment: "",
780
- });
781
- var index = descriptionsReviewed.findIndex(
782
- (e) =>
783
- e.articleId === item.id &&
784
- e.attributeId === des.attributeId &&
785
- e.versionId === item.version
786
- );
787
- currentData[`${des.attributeId}`] = (
788
- <>
789
- <button
790
- onClick={() => {
791
- setShowValidationPanel(true);
792
- setAttributeSelected({
793
- articleId: item.id,
794
- attributeId: des.attributeId,
795
- versionId: item.version,
796
- });
797
- }}
798
- className="validation-button"
799
- >
800
- {descriptionsReviewed[index].isReviewed &&
801
- descriptionsReviewed[index].isApproved && (
802
- <img
803
- id={
804
- "button_" +
805
- item.id +
806
- "_" +
807
- des.attributeId +
808
- "_" +
809
- item.version
810
- }
811
- src={acceptIcon}
812
- alt="accept button"
813
- />
814
- )}{" "}
815
- {descriptionsReviewed[index].isReviewed &&
816
- !descriptionsReviewed[index].isApproved && (
817
- <img
818
- id={
819
- "button_" +
820
- item.id +
821
- "_" +
822
- des.attributeId +
823
- "_" +
824
- item.version
825
- }
826
- src={rejectIcon}
827
- alt="reject button"
828
- />
829
- )}{" "}
830
- {typeof des.isApproved === "undefined" &&
831
- !descriptionsReviewed[index].isReviewed && (
832
- <img
833
- id={
834
- "button_" +
835
- item.id +
836
- "_" +
837
- des.attributeId +
838
- "_" +
839
- item.version
840
- }
841
- src={rejectIcon}
842
- alt="reject button"
843
- />
844
- )}
845
- </button>{" "}
846
- {showValidationPanel &&
847
- attributeSelected.articleId === item.id &&
848
- attributeSelected.attributeId === des.attributeId &&
849
- attributeSelected.versionId === item.version && (
850
- <div className="buttons-container" style={{left: "35px"}}>
851
- <button
852
- onClick={() => {
853
- descriptionsReviewed[index].isApproved = true;
854
- descriptionsReviewed[index].isReviewed = true;
855
- setShowValidationPanel(false);
856
- }}
857
- className="validation-option"
858
- >
859
- <img src={acceptIcon} alt="accept button" />
860
- <p> Validar </p>{" "}
861
- </button>{" "}
862
- <button
863
- onClick={() => {
864
- setShowValidationPanel(false);
865
- setShowRejectModal(true);
866
- }}
867
- className="validation-option"
868
- >
869
- <img src={rejectIcon} alt="reject button" />
870
- <p> Rechazar </p>{" "}
871
- </button>{" "}
872
- </div>
873
- )}{" "}
874
- {des.comment && <div class="tooltip">
875
- <textarea {...props}></textarea>
876
- <span class="tooltiptext"><p><b>Comentarios del rechazo</b></p><p>{des.comment}</p></span>
877
- </div>}
878
- {!des.comment && <div>
879
- <textarea {...props}></textarea>
880
- </div>}
881
- </>
882
- );
883
- });
884
- });
885
- }
886
- values.push(currentData);
887
- });
888
- return [columns, values];
889
- }
890
-
891
- export function modalReducer(state, action) {
892
- if (action.type === "close") {
893
- return {
894
- show: false,
895
- };
896
- }
897
- const { setModal, setDataServices } = action?.functions;
898
- const buttons = [
899
- <ButtonV2
900
- key="btn-Cancelar"
901
- type="white"
902
- label="Cancelar"
903
- onClick={() =>
904
- setModal({
905
- type: "close",
906
- })
907
- }
908
- />,
909
- ];
910
- if (action.type === "saved successfully") {
911
- buttons[0] = (
912
- <ButtonV2
913
- key="btn-Aceptar"
914
- type="pink"
915
- label="Aceptar"
916
- onClick={async () =>
917
- setModal({
918
- type: "close",
919
- })
920
- }
921
- />
922
- );
923
- return {
924
- show: true,
925
- title: "Servicio guardado con éxito",
926
- message: `El servicio de ${action.payload?.service} se ha guardado con éxito.`,
927
- icon: "success",
928
- buttons,
929
- };
930
- }
931
- if (action.type === "delete") {
932
- buttons.push(
933
- <ButtonV2
934
- key="btn-Aceptar"
935
- type="pink"
936
- label="Aceptar"
937
- onClick={async () => {
938
- setDataServices({
939
- type: "deleteImage",
940
- payload: action.payload,
941
- });
942
- setModal({
943
- type: "close",
944
- });
945
- }}
946
- />
947
- );
948
- return {
949
- show: true,
950
- title: "Eliminar imagen",
951
- message: "¿Está seguro de eliminar la imagen seleccionada?",
952
- icon: "warning",
953
- buttons,
954
- };
955
- }
956
- return state;
957
- }
958
-
959
- async function updateArticleData(
960
- version,
961
- articleId,
962
- attributes,
963
- token,
964
- setMessage,
965
- section
966
- ) {
967
- var body={} ;
968
- var params=""
969
- if(section!="images"){
970
- body = {
971
- articleId: articleId,
972
- articleData: attributes,
973
- };
974
- params = `?${section}=true&version=${version}`;
975
- }
976
- else{
977
- body = {
978
- articleId: articleId,
979
- onboardingImagesData: attributes,
980
- };
981
- params = `?image=true&version=${version}`;
982
-
983
- }
984
- try {
985
- const res = await axios.put(
986
- `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}` + params,
987
- body,
988
- {
989
- headers: {
990
- Authorization: token,
991
- },
992
- }
993
- );
994
- if (res.data.statusCode === 200 && section=="description") {
995
- setMessage("Descripciones de los productos guardados con éxito");
996
- }
997
- if (res.data.statusCode === 200 && section=="datasheet") {
998
- setMessage("Atributos de los productos guardados con éxito");
999
- }
1000
- if (res.data.statusCode === 200 && section=="images") {
1001
- setMessage("Imágenes de los productos guardados con éxito");
1002
- }
1003
- } catch (error) {
1004
- console.log(error);
1005
- }
1006
- }
1007
-
1008
- /**
1009
- * Componentes para guardar y validación multiple
1010
- * <img
1011
- src={saveWhite}
1012
- alt="Guardar"
1013
- onClick={() => {
1014
- const params = {
1015
- section, data: dataServices[section], token, callbackToInitData, setModal,
1016
- };
1017
- saveData(params);
1018
- }}
1019
- />
1020
-
1021
- <SelectV2
1022
- items={optionsSelect}
1023
- triggerType="click"
1024
- selectButton={{
1025
- type: "whiteS3",
1026
- label: "Validación masiva",
1027
- size: 12,
1028
- }}
1029
- typeSelectItems="labelOnly"
1030
- borderType="oval"
1031
- onChange={(selectedItems) => {
1032
- console.log(selectedItems);
1033
- }}
1034
- />
1035
- */