contentoh-components-library 18.0.0 → 20.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/.env.development +3 -18
  2. package/.env.production +1 -16
  3. package/CHANGELOG.md +1 -35
  4. package/dist/assets/images/carouselImagesLogin/login2.svg +117 -0
  5. package/dist/assets/images/carouselImagesLogin/login3.svg +147 -0
  6. package/dist/assets/images/carouselImagesLogin/loginImage.svg +301 -0
  7. package/dist/components/atoms/ActivedFilter/ActivedFilter.stories.js +1 -7
  8. package/dist/components/atoms/ActivedFilter/index.js +4 -12
  9. package/dist/components/atoms/AsignationOption/AsignationOptions.stories.js +1 -7
  10. package/dist/components/atoms/AsignationOption/index.js +21 -33
  11. package/dist/components/atoms/AsignationOption/styles.js +1 -1
  12. package/dist/components/atoms/AtomList/AtomList.stories.js +1 -7
  13. package/dist/components/atoms/AtomList/index.js +9 -14
  14. package/dist/components/atoms/Avatar/AsignationImage.stories.js +1 -7
  15. package/dist/components/atoms/Avatar/index.js +8 -11
  16. package/dist/components/atoms/Card/Card.stories.js +1 -7
  17. package/dist/components/atoms/Card/index.js +4 -8
  18. package/dist/components/atoms/CheckBox/CheckBox.stories.js +1 -7
  19. package/dist/components/atoms/CheckBox/index.js +13 -19
  20. package/dist/components/atoms/CustomerTypeImage/CustomerTypeImage.stories.js +1 -7
  21. package/dist/components/atoms/CustomerTypeImage/index.js +6 -8
  22. package/dist/components/atoms/DropDownButton/DropDownButton.stories.js +1 -7
  23. package/dist/components/atoms/DropDownButton/index.js +6 -9
  24. package/dist/components/atoms/EditField/EditField.stories.js +1 -7
  25. package/dist/components/atoms/EditField/index.js +10 -17
  26. package/dist/components/atoms/FeatureTag/FeatureTag.stories.js +1 -7
  27. package/dist/components/atoms/FeatureTag/index.js +5 -11
  28. package/dist/components/atoms/GeneralButton/GeneralButton.stories.js +1 -7
  29. package/dist/components/atoms/GeneralButton/index.js +6 -13
  30. package/dist/components/atoms/GeneralButton/styles.js +2 -4
  31. package/dist/components/atoms/GeneralInput/GeneralInput.stories.js +1 -7
  32. package/dist/components/atoms/GeneralInput/index.js +35 -59
  33. package/dist/components/atoms/GeneralInput/styles.js +1 -4
  34. package/dist/components/atoms/GeneralTextBox/GeneralTextBox.stories.js +1 -7
  35. package/dist/components/atoms/GeneralTextBox/index.js +7 -12
  36. package/dist/components/atoms/GenericModal/GenericModal.stories.js +59 -46
  37. package/dist/components/atoms/GenericModal/index.js +8 -15
  38. package/dist/components/atoms/GenericModal/styles.js +1 -1
  39. package/dist/components/atoms/GradientPanel/GradientPanel.stories.js +80 -85
  40. package/dist/components/atoms/GradientPanel/index.js +7 -11
  41. package/dist/components/atoms/GradientPanel/styles.js +2 -2
  42. package/dist/components/atoms/Graphic/Graphic.stories.js +1 -7
  43. package/dist/components/atoms/Graphic/index.js +5 -9
  44. package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +36 -0
  45. package/dist/components/atoms/ListCommercialRetailers/index.js +64 -0
  46. package/dist/components/atoms/ListCommercialRetailers/styles.js +20 -0
  47. package/dist/components/atoms/LoadImageMenu/LoadImageMenu.stories.js +1 -7
  48. package/dist/components/atoms/LoadImageMenu/index.js +22 -33
  49. package/dist/components/atoms/LogoImage/LogoImage.stories.js +1 -7
  50. package/dist/components/atoms/LogoImage/index.js +6 -8
  51. package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +37 -0
  52. package/dist/components/atoms/MenuCommercialRetailers/index.js +25 -0
  53. package/dist/components/{molecules/RetailerSelector → atoms/MenuCommercialRetailers}/styles.js +1 -1
  54. package/dist/components/atoms/MenuNotification/MenuNotification.stories.js +1 -7
  55. package/dist/components/atoms/MenuNotification/index.js +15 -21
  56. package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +28 -0
  57. package/dist/components/atoms/MenuProductImage/index.js +88 -0
  58. package/dist/components/atoms/MenuProductImage/styles.js +20 -0
  59. package/dist/components/atoms/MenuProfile/MenuProfile.stories.js +1 -7
  60. package/dist/components/atoms/MenuProfile/index.js +15 -25
  61. package/dist/components/atoms/Notification/Notification.stories.js +1 -5
  62. package/dist/components/atoms/Notification/index.js +9 -15
  63. package/dist/components/atoms/PriorityFlag/PriorityFlag.stories.js +1 -7
  64. package/dist/components/atoms/PriorityFlag/index.js +5 -9
  65. package/dist/components/atoms/ProductImage/ProductImage.stories.js +1 -7
  66. package/dist/components/atoms/ProductImage/index.js +8 -11
  67. package/dist/components/atoms/ProductImage/styles.js +1 -1
  68. package/dist/components/atoms/ProductPercentCard/Percent.stories.js +1 -7
  69. package/dist/components/atoms/ProductPercentCard/index.js +14 -21
  70. package/dist/components/atoms/ProgressBar/ProgressBar.stories.js +1 -7
  71. package/dist/components/atoms/ProgressBar/index.js +4 -9
  72. package/dist/components/atoms/ProgressBar/styles.js +5 -3
  73. package/dist/components/atoms/ScreenHeader/ScreenHeader.stories.js +1 -7
  74. package/dist/components/atoms/ScreenHeader/index.js +3 -9
  75. package/dist/components/atoms/SideMenuButton/SideMenuButton.stories.js +1 -5
  76. package/dist/components/atoms/SideMenuButton/index.js +4 -10
  77. package/dist/components/atoms/StatusTag/StatusTag.stories.js +1 -7
  78. package/dist/components/atoms/StatusTag/index.js +3 -8
  79. package/dist/components/atoms/StatusTag/styles.js +1 -1
  80. package/dist/components/atoms/TabSection/TabSection.stories.js +1 -7
  81. package/dist/components/atoms/TabSection/index.js +3 -8
  82. package/dist/components/atoms/ValidationPanel/ValidationPanel.stories.js +1 -7
  83. package/dist/components/atoms/ValidationPanel/index.js +28 -41
  84. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +22 -0
  85. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +49 -0
  86. package/dist/components/atoms/{Commentary → VerticalSideMenuMainPage}/styles.js +1 -6
  87. package/dist/components/molecules/AddProvidersAndProducts/AddProvidersAndProducts.stories.js +1 -5
  88. package/dist/components/molecules/AddProvidersAndProducts/index.js +12 -18
  89. package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +25 -0
  90. package/dist/components/molecules/ApproveRejetPanel/index.js +49 -0
  91. package/dist/components/molecules/ApproveRejetPanel/styles.js +18 -0
  92. package/dist/components/molecules/AssignedWork/AssignedWork.stories.js +1 -5
  93. package/dist/components/molecules/AssignedWork/index.js +30 -36
  94. package/dist/components/molecules/AvatarAndValidation/AvatarAndValidation.stories.js +1 -7
  95. package/dist/components/molecules/AvatarAndValidation/index.js +17 -32
  96. package/dist/components/molecules/AvatarAndValidation/styles.js +1 -1
  97. package/dist/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +33 -0
  98. package/dist/components/molecules/CarouselImagesLogin/index.js +90 -0
  99. package/dist/components/molecules/CarouselImagesLogin/styles.js +21 -0
  100. package/dist/components/molecules/EditionActiveImage/EditionActiveImage.stories.js +1 -7
  101. package/dist/components/molecules/EditionActiveImage/index.js +10 -14
  102. package/dist/components/molecules/FeaturesBar/FeaturesBar.stories.js +1 -7
  103. package/dist/components/molecules/FeaturesBar/index.js +9 -11
  104. package/dist/components/molecules/GalleryElement/GalleryElement.stories.js +1 -7
  105. package/dist/components/molecules/GalleryElement/index.js +32 -99
  106. package/dist/components/molecules/GalleryElement/styles.js +1 -1
  107. package/dist/components/molecules/GalleryHeader/GalleryHeader.stories.js +1 -7
  108. package/dist/components/molecules/GalleryHeader/index.js +6 -46
  109. package/dist/components/molecules/GalleryHeader/styles.js +1 -1
  110. package/dist/components/molecules/HeaderTop/HeaderTop.stories.js +1 -7
  111. package/dist/components/molecules/HeaderTop/index.js +7 -10
  112. package/dist/components/molecules/ImageSelector/ImageSelector.stories.js +1 -7
  113. package/dist/components/molecules/ImageSelector/index.js +14 -14
  114. package/dist/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +22 -0
  115. package/dist/components/molecules/LoginPasswordStrength/index.js +109 -0
  116. package/dist/components/molecules/LoginPasswordStrength/styles.js +78 -0
  117. package/dist/components/molecules/ParentComponent/ParentComponent.stories.js +2 -10
  118. package/dist/components/molecules/ParentComponent/index.js +5 -9
  119. package/dist/components/molecules/PayMethod/PayMethod.stories.js +1 -7
  120. package/dist/components/molecules/PayMethod/index.js +33 -38
  121. package/dist/components/molecules/PlanSelection/PlanSelection.stories.js +1 -7
  122. package/dist/components/molecules/PlanSelection/index.js +11 -14
  123. package/dist/components/molecules/ProductNameHeader/ProductNameHeader.stories.js +1 -7
  124. package/dist/components/molecules/ProductNameHeader/index.js +15 -18
  125. package/dist/components/molecules/ProductNotification/ProductNotification.stories.js +1 -7
  126. package/dist/components/molecules/ProductNotification/index.js +9 -12
  127. package/dist/components/molecules/ProfileHeader/ProfileHeader.stories.js +1 -5
  128. package/dist/components/molecules/ProfileHeader/index.js +15 -21
  129. package/dist/components/molecules/SidebarNotification/SidebarNotification.stories.js +1 -5
  130. package/dist/components/molecules/SidebarNotification/index.js +37 -43
  131. package/dist/components/molecules/StatusAsignationInfo/StatusAsignationInfo.stories.js +1 -7
  132. package/dist/components/molecules/StatusAsignationInfo/index.js +76 -113
  133. package/dist/components/molecules/StatusAsignationInfo/styles.js +1 -1
  134. package/dist/components/molecules/TableHeader/TableHeader.stories.js +1 -7
  135. package/dist/components/molecules/TableHeader/index.js +10 -21
  136. package/dist/components/molecules/TableRow/TableRow.stories.js +1 -7
  137. package/dist/components/molecules/TableRow/index.js +7 -11
  138. package/dist/components/molecules/TabsMenu/TabsMenu.stories.js +1 -7
  139. package/dist/components/molecules/TabsMenu/index.js +10 -13
  140. package/dist/components/molecules/TagAndInput/TagAndInput.stories.js +1 -7
  141. package/dist/components/molecules/TagAndInput/index.js +12 -36
  142. package/dist/components/organisms/FullProductNameHeader/FullProductNameHeader.stories.js +1 -7
  143. package/dist/components/organisms/FullProductNameHeader/index.js +16 -45
  144. package/dist/components/organisms/FullTabsMenu/FullTabsMenu.stories.js +1 -7
  145. package/dist/components/organisms/FullTabsMenu/index.js +13 -30
  146. package/dist/components/organisms/Fullplan/FullPlan.stories.js +1 -7
  147. package/dist/components/organisms/Fullplan/index.js +15 -23
  148. package/dist/components/organisms/ImageDataTable/ImageDataTable.stories.js +1 -7
  149. package/dist/components/organisms/ImageDataTable/index.js +18 -96
  150. package/dist/components/organisms/ImagePreviewer/ImagePreviewer.stories.js +1 -7
  151. package/dist/components/organisms/ImagePreviewer/index.js +8 -12
  152. package/dist/components/organisms/ImagesGroup/index.js +1 -5
  153. package/dist/components/organisms/InputGroup/InputGroup.stories.js +1 -7
  154. package/dist/components/organisms/InputGroup/index.js +26 -47
  155. package/dist/components/organisms/InputGroup/styles.js +1 -1
  156. package/dist/components/organisms/ProductImageModal/ProductImageModal.stories.js +1 -7
  157. package/dist/components/organisms/ProductImageModal/index.js +41 -55
  158. package/dist/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +34 -0
  159. package/dist/components/pages/ChangePasswordLogin/index.js +128 -0
  160. package/dist/components/pages/ChangePasswordLogin/styles.js +18 -0
  161. package/dist/components/pages/CustomerLogin/CustomerLogin.stories.js +47 -52
  162. package/dist/components/pages/CustomerLogin/index.js +12 -18
  163. package/dist/components/pages/CustomerPayMethod/CustomerPayMethod.stories.js +28 -36
  164. package/dist/components/pages/CustomerPayMethod/index.js +12 -18
  165. package/dist/components/pages/CustomerType/CustomerType.stories.js +22 -21
  166. package/dist/components/pages/CustomerType/index.js +12 -18
  167. package/dist/components/pages/EmailResetPassword/EmailResetPassword.stories.js +33 -0
  168. package/dist/components/pages/EmailResetPassword/index.js +120 -0
  169. package/dist/components/pages/EmailResetPassword/styles.js +20 -0
  170. package/dist/components/pages/OnboardPlan/OnboardPlan.stories.js +9 -12
  171. package/dist/components/pages/OnboardPlan/index.js +12 -18
  172. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +33 -0
  173. package/dist/components/pages/RegistrationLoginFirstStep/index.js +218 -0
  174. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  175. package/dist/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +34 -0
  176. package/dist/components/pages/RegistrationLoginSecondStep/index.js +165 -0
  177. package/dist/components/pages/RegistrationLoginSecondStep/styles.js +20 -0
  178. package/dist/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +33 -0
  179. package/dist/components/pages/RegistrationLoginThirdStep/index.js +164 -0
  180. package/dist/components/pages/RegistrationLoginThirdStep/styles.js +20 -0
  181. package/dist/components/pages/RetailerPlan/RetailerPlan.stories.js +10 -13
  182. package/dist/components/pages/RetailerPlan/index.js +12 -18
  183. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +311 -98
  184. package/dist/components/pages/RetailerProductEdition/index.js +80 -1516
  185. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  186. package/dist/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +33 -0
  187. package/dist/components/pages/VerificationCodeResetPassword/index.js +110 -0
  188. package/dist/components/pages/VerificationCodeResetPassword/styles.js +20 -0
  189. package/dist/components/pages/VerificationCodeResetPassword/utils.js +69 -0
  190. package/dist/global-files/data.js +53 -190
  191. package/dist/global-files/global-styles.css +0 -1
  192. package/dist/global-files/variables.js +0 -1
  193. package/package.json +7 -20
  194. package/src/assets/images/carouselImagesLogin/login2.svg +117 -0
  195. package/src/assets/images/carouselImagesLogin/login3.svg +147 -0
  196. package/src/assets/images/carouselImagesLogin/loginImage.svg +301 -0
  197. package/src/components/atoms/AsignationOption/index.js +5 -7
  198. package/src/components/atoms/AsignationOption/styles.js +1 -9
  199. package/src/components/atoms/CheckBox/index.js +2 -8
  200. package/src/components/atoms/GeneralButton/index.js +2 -9
  201. package/src/components/atoms/GeneralButton/styles.js +0 -23
  202. package/src/components/atoms/GeneralInput/index.js +30 -56
  203. package/src/components/atoms/GeneralInput/styles.js +1 -2
  204. package/src/components/atoms/GenericModal/index.js +2 -2
  205. package/src/components/atoms/GenericModal/styles.js +0 -3
  206. package/src/components/atoms/GradientPanel/styles.js +7 -1
  207. package/src/components/atoms/PriorityFlag/index.js +1 -1
  208. package/src/components/atoms/ProductImage/styles.js +1 -1
  209. package/src/components/atoms/ProgressBar/index.js +2 -2
  210. package/src/components/atoms/ProgressBar/styles.js +3 -53
  211. package/src/components/atoms/StatusTag/styles.js +1 -9
  212. package/src/components/atoms/ValidationPanel/index.js +3 -3
  213. package/src/components/molecules/AvatarAndValidation/index.js +6 -24
  214. package/src/components/molecules/AvatarAndValidation/styles.js +1 -1
  215. package/src/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +17 -0
  216. package/src/components/molecules/CarouselImagesLogin/index.js +68 -0
  217. package/src/components/molecules/CarouselImagesLogin/styles.js +60 -0
  218. package/src/components/molecules/FeaturesBar/index.js +7 -10
  219. package/src/components/molecules/GalleryElement/index.js +36 -75
  220. package/src/components/molecules/GalleryElement/styles.js +11 -38
  221. package/src/components/molecules/GalleryHeader/index.js +8 -14
  222. package/src/components/molecules/GalleryHeader/styles.js +0 -16
  223. package/src/components/molecules/ImageSelector/index.js +3 -2
  224. package/src/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +8 -0
  225. package/src/components/molecules/LoginPasswordStrength/index.js +89 -0
  226. package/src/components/molecules/LoginPasswordStrength/styles.js +87 -0
  227. package/src/components/molecules/ProductNameHeader/index.js +2 -1
  228. package/src/components/molecules/StatusAsignationInfo/index.js +38 -62
  229. package/src/components/molecules/StatusAsignationInfo/styles.js +2 -12
  230. package/src/components/molecules/TableHeader/index.js +3 -16
  231. package/src/components/molecules/TagAndInput/index.js +0 -22
  232. package/src/components/organisms/FullProductNameHeader/index.js +7 -28
  233. package/src/components/organisms/FullTabsMenu/index.js +4 -16
  234. package/src/components/organisms/ImageDataTable/index.js +11 -78
  235. package/src/components/organisms/InputGroup/index.js +5 -23
  236. package/src/components/organisms/InputGroup/styles.js +0 -3
  237. package/src/components/organisms/ProductImageModal/index.js +12 -22
  238. package/src/components/organisms/ProductImageModal/styles.js +0 -3
  239. package/src/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +18 -0
  240. package/src/components/pages/ChangePasswordLogin/index.js +78 -0
  241. package/src/components/pages/ChangePasswordLogin/styles.js +20 -0
  242. package/src/components/pages/EmailResetPassword/EmailResetPassword.stories.js +17 -0
  243. package/src/components/pages/EmailResetPassword/index.js +77 -0
  244. package/src/components/pages/EmailResetPassword/styles.js +27 -0
  245. package/src/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +17 -0
  246. package/src/components/pages/RegistrationLoginFirstStep/index.js +160 -0
  247. package/src/components/pages/RegistrationLoginFirstStep/styles.js +85 -0
  248. package/src/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +18 -0
  249. package/src/components/pages/RegistrationLoginSecondStep/index.js +111 -0
  250. package/src/components/pages/RegistrationLoginSecondStep/styles.js +64 -0
  251. package/src/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +17 -0
  252. package/src/components/pages/RegistrationLoginThirdStep/index.js +106 -0
  253. package/src/components/pages/RegistrationLoginThirdStep/styles.js +48 -0
  254. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +315 -96
  255. package/src/components/pages/RetailerProductEdition/index.js +39 -1090
  256. package/src/components/pages/RetailerProductEdition/styles.js +4 -67
  257. package/src/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +17 -0
  258. package/src/components/pages/VerificationCodeResetPassword/index.js +92 -0
  259. package/src/components/pages/VerificationCodeResetPassword/styles.js +54 -0
  260. package/src/components/pages/VerificationCodeResetPassword/utils.js +56 -0
  261. package/src/global-files/data.js +57 -138
  262. package/src/global-files/global-styles.css +0 -1
  263. package/src/global-files/variables.js +0 -1
  264. package/src/index.js +6 -0
  265. package/dist/assets/images/generalButton/downloadIcon.svg +0 -3
  266. package/dist/assets/images/modalsSVGs/attributesSent.svg +0 -208
  267. package/dist/assets/images/modalsSVGs/descriptionSent.svg +0 -237
  268. package/dist/assets/images/modalsSVGs/providerSent.svg +0 -445
  269. package/dist/assets/images/modalsSVGs/uploadingImages.svg +0 -148
  270. package/dist/components/atoms/Commentary/Commentary.stories.js +0 -1
  271. package/dist/components/atoms/Commentary/index.js +0 -23
  272. package/dist/components/atoms/Input/index.js +0 -26
  273. package/dist/components/atoms/Input/style.js +0 -26
  274. package/dist/components/atoms/InputFormatter/Wysiwyg.stories.js +0 -30
  275. package/dist/components/atoms/InputFormatter/index.js +0 -119
  276. package/dist/components/atoms/InputFormatter/styles.js +0 -33
  277. package/dist/components/atoms/LabelToInput/index.js +0 -54
  278. package/dist/components/atoms/LabelToInput/style.js +0 -22
  279. package/dist/components/atoms/Percent/Percent.stories.js +0 -39
  280. package/dist/components/atoms/Percent/index.js +0 -39
  281. package/dist/components/atoms/Percent/styles.js +0 -20
  282. package/dist/components/atoms/Select/index.js +0 -37
  283. package/dist/components/atoms/Select/style.js +0 -32
  284. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +0 -48
  285. package/dist/components/molecules/RetailerSelector/index.js +0 -74
  286. package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +0 -31
  287. package/dist/components/molecules/TextAndGradient/index.js +0 -36
  288. package/dist/components/molecules/TextAndGradient/styles.js +0 -18
  289. package/src/assets/images/generalButton/downloadIcon.svg +0 -3
  290. package/src/assets/images/modalsSVGs/attributesSent.svg +0 -208
  291. package/src/assets/images/modalsSVGs/descriptionSent.svg +0 -237
  292. package/src/assets/images/modalsSVGs/providerSent.svg +0 -445
  293. package/src/assets/images/modalsSVGs/uploadingImages.svg +0 -148
  294. package/src/components/atoms/Commentary/Commentary.stories.js +0 -0
  295. package/src/components/atoms/Commentary/index.js +0 -9
  296. package/src/components/atoms/Commentary/styles.js +0 -16
  297. package/src/components/atoms/Input/index.js +0 -15
  298. package/src/components/atoms/Input/style.js +0 -31
  299. package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +0 -12
  300. package/src/components/atoms/InputFormatter/index.js +0 -76
  301. package/src/components/atoms/InputFormatter/styles.js +0 -34
  302. package/src/components/atoms/LabelToInput/index.js +0 -27
  303. package/src/components/atoms/LabelToInput/style.js +0 -38
  304. package/src/components/atoms/Select/index.js +0 -33
  305. package/src/components/atoms/Select/style.js +0 -77
  306. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +0 -35
  307. package/src/components/molecules/RetailerSelector/index.js +0 -63
  308. package/src/components/molecules/RetailerSelector/styles.js +0 -18
@@ -9,16 +9,10 @@ exports.RetailerProductEdition = void 0;
9
9
 
10
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
11
 
12
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
13
-
14
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
15
13
 
16
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
17
15
 
18
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
19
-
20
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
21
-
22
16
  var _styles = require("./styles");
23
17
 
24
18
  var _HeaderTop = require("../../molecules/HeaderTop");
@@ -37,96 +31,17 @@ var _react = require("react");
37
31
 
38
32
  var _GalleryElement = require("../../molecules/GalleryElement");
39
33
 
40
- var _fileSaver = require("file-saver");
41
-
42
- var _data2 = require("../../../global-files/data");
34
+ var _data = require("../../../global-files/data");
43
35
 
44
36
  var _GalleryHeader = require("../../molecules/GalleryHeader");
45
37
 
46
38
  var _ProductImageModal = require("../../organisms/ProductImageModal");
47
39
 
48
- var _reactDropzone = require("react-dropzone");
49
-
50
- var _axios = _interopRequireDefault(require("axios"));
51
-
52
- var _uuid = require("uuid");
53
-
54
- var _awsSdk = _interopRequireDefault(require("aws-sdk"));
55
-
56
- var _attributesSent = _interopRequireDefault(require("../../../assets/images/modalsSVGs/attributesSent.svg"));
57
-
58
- var _descriptionSent = _interopRequireDefault(require("../../../assets/images/modalsSVGs/descriptionSent.svg"));
59
-
60
- var _uploadingImages = _interopRequireDefault(require("../../../assets/images/modalsSVGs/uploadingImages.svg"));
61
-
62
- var _index = require("../../molecules/TagAndInput/index");
63
-
64
- var _GeneralButton = require("../../atoms/GeneralButton");
65
-
66
- var _Commentary = require("../../atoms/Commentary");
67
-
68
- var _GenericModal = require("../../atoms/GenericModal");
69
-
70
- var _ScreenHeader = require("../../atoms/ScreenHeader");
71
-
72
- var _jsxRuntime = require("react/jsx-runtime");
73
-
74
- var reducerImages = function reducerImages(state, action) {
75
- var values = state.values,
76
- attrForImgs = state.attrForImgs;
77
-
78
- switch (action.action) {
79
- case "init":
80
- return action.init;
81
-
82
- case "addImg":
83
- values = [].concat((0, _toConsumableArray2.default)(values), [action.img]);
84
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
85
- values: values
86
- });
87
-
88
- case "changeImageInfo":
89
- values[action.index][action.attribute] = action.value;
90
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
91
- values: values
92
- });
93
-
94
- case "changeAttrValue":
95
- attrForImgs[action.retailer][action.index].value = action.value;
96
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
97
- attrForImgs: attrForImgs,
98
- values: values
99
- });
100
-
101
- default:
102
- return state;
103
- }
104
- };
105
-
106
- var S3_BUCKET = process.env.REACT_APP_IMAGES_BUCKET;
107
- var REGION = "us-east-1";
108
-
109
- _awsSdk.default.config.update({
110
- accessKeyId: process.env.REACT_APP_KEY_UPLOAD_TO_S3,
111
- secretAccessKey: process.env.REACT_APP_ACCESS_KEY_UPLOAD_TO_S3
112
- });
113
-
114
- var myBucket = new _awsSdk.default.S3({
115
- params: {
116
- Bucket: S3_BUCKET
117
- },
118
- region: REGION
119
- });
120
-
121
40
  var RetailerProductEdition = function RetailerProductEdition(_ref) {
122
- var _productSelected$reta, _servicesData$filter$, _servicesData$filter$2, _product$services, _datasheets$, _datasheets$$data, _product$services2, _product$article4, _product$services3;
41
+ var _datasheets$, _datasheets$$data, _images$values;
123
42
 
124
- var tabsSections = _ref.tabsSections,
125
- _ref$productSelected = _ref.productSelected,
126
- productSelected = _ref$productSelected === void 0 ? {} : _ref$productSelected,
127
- _ref$user = _ref.user,
128
- user = _ref$user === void 0 ? {} : _ref$user,
129
- token = _ref.token;
43
+ var productData = _ref.productData,
44
+ tabsSections = _ref.tabsSections;
130
45
 
131
46
  var _useState = (0, _react.useState)("Descripción"),
132
47
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -138,7 +53,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
138
53
  activeImage = _useState4[0],
139
54
  setActiveImage = _useState4[1];
140
55
 
141
- var _useState5 = (0, _react.useState)(false),
56
+ var _useState5 = (0, _react.useState)(true),
142
57
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
143
58
  imageLayout = _useState6[0],
144
59
  setImageLayout = _useState6[1];
@@ -153,1469 +68,118 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
153
68
  descriptions = _useState10[0],
154
69
  setDescriptions = _useState10[1];
155
70
 
156
- var _useState11 = (0, _react.useState)([]),
71
+ var _useState11 = (0, _react.useState)({}),
157
72
  _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
158
73
  datasheets = _useState12[0],
159
74
  setDatasheets = _useState12[1];
160
75
 
161
- var _useReducer = (0, _react.useReducer)(reducerImages, {}),
162
- _useReducer2 = (0, _slicedToArray2.default)(_useReducer, 2),
163
- images = _useReducer2[0],
164
- setImages = _useReducer2[1];
165
-
166
- var _useState13 = (0, _react.useState)(false),
76
+ var _useState13 = (0, _react.useState)({}),
167
77
  _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
168
- showModal = _useState14[0],
169
- setShowModal = _useState14[1];
170
-
171
- var _useDropzone = (0, _reactDropzone.useDropzone)({
172
- accept: "image/*",
173
- noKeyboard: true,
174
- multiple: true,
175
- noClick: true,
176
- onDrop: function onDrop(acceptedFiles) {
177
- var newImages = [];
178
- acceptedFiles.map(function (file) {
179
- var reader = new FileReader();
180
- reader.fileName = file.name;
78
+ images = _useState14[0],
79
+ setImages = _useState14[1];
181
80
 
182
- reader.onload = /*#__PURE__*/function () {
183
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
184
- var ext, img, width, height, newImg;
185
- return _regenerator.default.wrap(function _callee$(_context) {
186
- while (1) {
187
- switch (_context.prev = _context.next) {
188
- case 0:
189
- ext = e.srcElement.fileName.split(".");
190
- img = new Image();
191
- img.src = e.target.result;
192
- width = img.width;
193
- height = img.height;
194
- newImg = {
195
- action: "addImg",
196
- img: {
197
- src: e.target.result,
198
- name: e.target.fileName,
199
- ext: ext[ext.length - 1],
200
- width: width,
201
- height: width
202
- }
203
- };
204
- setImages(newImg);
205
-
206
- case 7:
207
- case "end":
208
- return _context.stop();
209
- }
210
- }
211
- }, _callee);
212
- }));
213
-
214
- return function (_x) {
215
- return _ref2.apply(this, arguments);
216
- };
217
- }();
218
-
219
- reader.onerror = function (error) {
220
- console.log("dropzoneError: ", error);
221
- };
222
-
223
- reader.readAsDataURL(file);
224
- return file;
225
- });
226
- }
227
- }),
228
- getRootProps = _useDropzone.getRootProps,
229
- getInputProps = _useDropzone.getInputProps;
230
-
231
- var _useState15 = (0, _react.useState)([]),
81
+ var _useState15 = (0, _react.useState)(false),
232
82
  _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
233
- updatedDatasheets = _useState16[0],
234
- setUpdatedDatasheets = _useState16[1];
235
-
236
- var _useState17 = (0, _react.useState)([]),
237
- _useState18 = (0, _slicedToArray2.default)(_useState17, 2),
238
- updatedDescriptions = _useState18[0],
239
- setUpdatedDescriptions = _useState18[1];
240
-
241
- var _useState19 = (0, _react.useState)(false),
242
- _useState20 = (0, _slicedToArray2.default)(_useState19, 2),
243
- imagesUploaded = _useState20[0],
244
- setImagesUploaded = _useState20[1];
245
-
246
- var _useState21 = (0, _react.useState)(),
247
- _useState22 = (0, _slicedToArray2.default)(_useState21, 2),
248
- dataImages = _useState22[0],
249
- setDataImages = _useState22[1];
250
-
251
- var _useState23 = (0, _react.useState)(new Array(productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$reta = productSelected.retailers) === null || _productSelected$reta === void 0 ? void 0 : _productSelected$reta.length).fill({
252
- percentage: 0
253
- })),
254
- _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
255
- percentages = _useState24[0],
256
- setPercentages = _useState24[1];
257
-
258
- var _useState25 = (0, _react.useState)(0),
259
- _useState26 = (0, _slicedToArray2.default)(_useState25, 2),
260
- activePercentage = _useState26[0],
261
- setActivePercentage = _useState26[1];
262
-
263
- var _useState27 = (0, _react.useState)({}),
264
- _useState28 = (0, _slicedToArray2.default)(_useState27, 2),
265
- activeRetailer = _useState28[0],
266
- setActiveRetailer = _useState28[1];
267
-
268
- var _useState29 = (0, _react.useState)([]),
269
- _useState30 = (0, _slicedToArray2.default)(_useState29, 2),
270
- services = _useState30[0],
271
- setServices = _useState30[1];
272
-
273
- var _useState31 = (0, _react.useState)([]),
274
- _useState32 = (0, _slicedToArray2.default)(_useState31, 2),
275
- servicesData = _useState32[0],
276
- setServicesData = _useState32[1];
277
-
278
- var _useState33 = (0, _react.useState)(""),
279
- _useState34 = (0, _slicedToArray2.default)(_useState33, 2),
280
- message = _useState34[0],
281
- setMessage = _useState34[1];
282
-
283
- var _useState35 = (0, _react.useState)({}),
284
- _useState36 = (0, _slicedToArray2.default)(_useState35, 2),
285
- product = _useState36[0],
286
- setProduct = _useState36[1];
287
-
288
- var _useState37 = (0, _react.useState)(null),
289
- _useState38 = (0, _slicedToArray2.default)(_useState37, 2),
290
- icon = _useState38[0],
291
- setIcon = _useState38[1];
292
-
293
- var _useState39 = (0, _react.useState)(productSelected === null || productSelected === void 0 ? void 0 : productSelected.version),
294
- _useState40 = (0, _slicedToArray2.default)(_useState39, 2),
295
- version = _useState40[0],
296
- setVersion = _useState40[1];
297
-
298
- var _useState41 = (0, _react.useState)({}),
299
- _useState42 = (0, _slicedToArray2.default)(_useState41, 2),
300
- comments = _useState42[0],
301
- setComments = _useState42[1];
302
-
303
- var _useState43 = (0, _react.useState)(""),
304
- _useState44 = (0, _slicedToArray2.default)(_useState43, 2),
305
- comment = _useState44[0],
306
- setComment = _useState44[1];
307
-
308
- var _useState45 = (0, _react.useState)(0),
309
- _useState46 = (0, _slicedToArray2.default)(_useState45, 2),
310
- requiredNull = _useState46[0],
311
- setRequiredNull = _useState46[1];
312
-
313
- var _useState47 = (0, _react.useState)(false),
314
- _useState48 = (0, _slicedToArray2.default)(_useState47, 2),
315
- crossComment = _useState48[0],
316
- setCrossComment = _useState48[1];
317
-
318
- var _useState49 = (0, _react.useState)([]),
319
- _useState50 = (0, _slicedToArray2.default)(_useState49, 2),
320
- userGroups = _useState50[0],
321
- setUserGroups = _useState50[1];
322
-
323
- var _useState51 = (0, _react.useState)({}),
324
- _useState52 = (0, _slicedToArray2.default)(_useState51, 2),
325
- assig = _useState52[0],
326
- setAssig = _useState52[1];
327
-
328
- var _useState53 = (0, _react.useState)([]),
329
- _useState54 = (0, _slicedToArray2.default)(_useState53, 2),
330
- selectedImages = _useState54[0],
331
- setSelectedImages = _useState54[1];
332
-
333
- var _useState55 = (0, _react.useState)([]),
334
- _useState56 = (0, _slicedToArray2.default)(_useState55, 2),
335
- componentsArray = _useState56[0],
336
- setComponentsArray = _useState56[1];
337
-
338
- var _useState57 = (0, _react.useState)(false),
339
- _useState58 = (0, _slicedToArray2.default)(_useState57, 2),
340
- checkAll = _useState58[0],
341
- setCheckAll = _useState58[1];
342
-
343
- var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
344
- (0, _react.useEffect)(function () {
345
- checkAll && setSelectedImages(images.values);
346
- }, [checkAll]);
83
+ showModal = _useState16[0],
84
+ setShowModal = _useState16[1];
347
85
 
348
86
  var loadData = /*#__PURE__*/function () {
349
- var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
350
- var _productSelected$arti, _productSelected$arti2, _services$, _services$$values;
87
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
88
+ var _services$;
351
89
 
352
90
  var services;
353
- return _regenerator.default.wrap(function _callee2$(_context2) {
91
+ return _regenerator.default.wrap(function _callee$(_context) {
354
92
  while (1) {
355
- switch (_context2.prev = _context2.next) {
93
+ switch (_context.prev = _context.next) {
356
94
  case 0:
357
- _context2.next = 2;
358
- return (0, _data2.getRetailerServices)(productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$arti = productSelected.article) === null || _productSelected$arti === void 0 ? void 0 : _productSelected$arti.id_article, parseInt(productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$arti2 = productSelected.article) === null || _productSelected$arti2 === void 0 ? void 0 : _productSelected$arti2.id_category), productSelected === null || productSelected === void 0 ? void 0 : productSelected.version);
95
+ _context.next = 2;
96
+ return (0, _data.getRetailerServices)();
359
97
 
360
98
  case 2:
361
- services = _context2.sent;
99
+ services = _context.sent;
362
100
  //Converts the data inside the datasheets object to array
363
- setServices(services);
364
- setActiveRetailer(productSelected === null || productSelected === void 0 ? void 0 : productSelected.retailers[0]);
365
- setImages({
366
- action: "init",
367
- init: services[2]
368
- });
369
- if (((_services$ = services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
370
- setProduct(productSelected);
101
+ Object.values(services[0])[0].data = Object.values(Object.values(services[0])[0].data);
102
+ setDatasheets(Object.values(services[0]));
103
+ setDescriptions(services[1]);
104
+ setImages(services[2]);
105
+ setActiveImage((0, _data.getImage)((_services$ = services[2]) === null || _services$ === void 0 ? void 0 : _services$.values[0], 340, 295));
371
106
 
372
107
  case 8:
373
108
  case "end":
374
- return _context2.stop();
109
+ return _context.stop();
375
110
  }
376
111
  }
377
- }, _callee2);
112
+ }, _callee);
378
113
  }));
379
114
 
380
115
  return function loadData() {
381
- return _ref3.apply(this, arguments);
382
- };
383
- }();
384
-
385
- var getServices = /*#__PURE__*/function () {
386
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(tab) {
387
- var _selected$article, _selected$article2, _servicesResponse$dat;
388
-
389
- var serviceActive, selected, servicesResponse, parsedResponse;
390
- return _regenerator.default.wrap(function _callee3$(_context3) {
391
- while (1) {
392
- switch (_context3.prev = _context3.next) {
393
- case 0:
394
- serviceActive = "";
395
- _context3.t0 = tab;
396
- _context3.next = _context3.t0 === "Ficha técnica" ? 4 : _context3.t0 === "Imágenes" ? 6 : 8;
397
- break;
398
-
399
- case 4:
400
- serviceActive = "datasheet";
401
- return _context3.abrupt("break", 10);
402
-
403
- case 6:
404
- serviceActive = "images";
405
- return _context3.abrupt("break", 10);
406
-
407
- case 8:
408
- serviceActive = "description";
409
- return _context3.abrupt("break", 10);
410
-
411
- case 10:
412
- selected = productSelected;
413
- _context3.next = 13;
414
- return _axios.default.get("".concat(process.env.REACT_APP_SERVICES_ENDPOINT, "?articleId=").concat(selected === null || selected === void 0 ? void 0 : (_selected$article = selected.article) === null || _selected$article === void 0 ? void 0 : _selected$article.id_article, "&orderId=").concat(selected === null || selected === void 0 ? void 0 : (_selected$article2 = selected.article) === null || _selected$article2 === void 0 ? void 0 : _selected$article2.id_order, "&end=true"));
415
-
416
- case 13:
417
- servicesResponse = _context3.sent;
418
- parsedResponse = JSON.parse(servicesResponse === null || servicesResponse === void 0 ? void 0 : (_servicesResponse$dat = servicesResponse.data) === null || _servicesResponse$dat === void 0 ? void 0 : _servicesResponse$dat.body).data;
419
- setServicesData(parsedResponse);
420
-
421
- case 16:
422
- case "end":
423
- return _context3.stop();
424
- }
425
- }
426
- }, _callee3);
427
- }));
428
-
429
- return function getServices(_x2) {
430
- return _ref4.apply(this, arguments);
431
- };
432
- }();
433
-
434
- var translateConcept = function translateConcept(concept) {
435
- var translation = "";
436
-
437
- if (concept === "datasheet") {
438
- translation = "Ficha técnica";
439
- } else if (concept === "description") {
440
- translation = "Descripción";
441
- } else if (concept === "images") {
442
- translation = "Imágenes";
443
- }
444
-
445
- return translation;
446
- };
447
-
448
- var getComments = /*#__PURE__*/function () {
449
- var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
450
- var _productSelected$arti3, _productSelected$arti4, _productSelected$arti5;
451
-
452
- var tab,
453
- commentsResponse,
454
- comments,
455
- _args4 = arguments;
456
- return _regenerator.default.wrap(function _callee4$(_context4) {
457
- while (1) {
458
- switch (_context4.prev = _context4.next) {
459
- case 0:
460
- tab = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : "Descripción";
461
- _context4.next = 3;
462
- return Promise.all([_axios.default.get("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT, "?articleId=").concat(productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$arti3 = productSelected.article) === null || _productSelected$arti3 === void 0 ? void 0 : _productSelected$arti3.id_article, "&concept=description&orderIdColab=").concat(productSelected === null || productSelected === void 0 ? void 0 : productSelected.orderId, "&version=").concat(version)), _axios.default.get("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT, "?articleId=").concat(productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$arti4 = productSelected.article) === null || _productSelected$arti4 === void 0 ? void 0 : _productSelected$arti4.id_article, "&concept=datasheet&orderIdColab=").concat(productSelected === null || productSelected === void 0 ? void 0 : productSelected.orderId, "&version=").concat(version)), _axios.default.get("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT, "?articleId=").concat(productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$arti5 = productSelected.article) === null || _productSelected$arti5 === void 0 ? void 0 : _productSelected$arti5.id_article, "&concept=images&orderIdColab=").concat(productSelected === null || productSelected === void 0 ? void 0 : productSelected.orderId, "&version=").concat(version))]);
463
-
464
- case 3:
465
- commentsResponse = _context4.sent;
466
- comments = {};
467
- commentsResponse.forEach(function (comment) {
468
- var _comment$data, _JSON$parse, _JSON$parse$data$, _comment$data2, _comment$data3;
469
-
470
- return JSON.parse(comment === null || comment === void 0 ? void 0 : (_comment$data = comment.data) === null || _comment$data === void 0 ? void 0 : _comment$data.body).data[0] && (comments[translateConcept((_JSON$parse = JSON.parse(comment === null || comment === void 0 ? void 0 : (_comment$data2 = comment.data) === null || _comment$data2 === void 0 ? void 0 : _comment$data2.body)) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$data$ = _JSON$parse.data[0]) === null || _JSON$parse$data$ === void 0 ? void 0 : _JSON$parse$data$.concept)] = JSON.parse(comment === null || comment === void 0 ? void 0 : (_comment$data3 = comment.data) === null || _comment$data3 === void 0 ? void 0 : _comment$data3.body).data[0]);
471
- });
472
- setComment(comments[tab]);
473
- setComments(comments);
474
-
475
- case 8:
476
- case "end":
477
- return _context4.stop();
478
- }
479
- }
480
- }, _callee4);
481
- }));
482
-
483
- return function getComments() {
484
- return _ref5.apply(this, arguments);
116
+ return _ref2.apply(this, arguments);
485
117
  };
486
118
  }();
487
119
 
488
- (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
489
- return _regenerator.default.wrap(function _callee5$(_context5) {
120
+ (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
121
+ return _regenerator.default.wrap(function _callee2$(_context2) {
490
122
  while (1) {
491
- switch (_context5.prev = _context5.next) {
123
+ switch (_context2.prev = _context2.next) {
492
124
  case 0:
493
125
  loadData();
494
- (0, _data2.getPercentage)({
495
- data: [productSelected]
496
- }).then(function (res) {
497
- return setPercentages(res);
498
- });
499
- getServices();
500
- getComments();
501
- _context5.t0 = setUserGroups;
502
- _context5.next = 7;
503
- return (0, _data2.fetchUsers)(token);
504
-
505
- case 7:
506
- _context5.t1 = _context5.sent;
507
- (0, _context5.t0)(_context5.t1);
508
-
509
- case 9:
510
- case "end":
511
- return _context5.stop();
512
- }
513
- }
514
- }, _callee5);
515
- })), []);
516
-
517
- var loadAssignations = function loadAssignations(currentProduct) {
518
- var _currentProduct$artic, _currentProduct$artic2, _currentProduct$artic3, _currentProduct$artic4, _currentProduct$artic5, _currentProduct$artic6;
519
-
520
- setAssig({
521
- Descripción: {
522
- assignations: [{
523
- collaboratorType: "especialist",
524
- id: currentProduct === null || currentProduct === void 0 ? void 0 : (_currentProduct$artic = currentProduct.article) === null || _currentProduct$artic === void 0 ? void 0 : _currentProduct$artic.id_description_especialist
525
- }, {
526
- collaboratorType: "facilitator",
527
- id: currentProduct === null || currentProduct === void 0 ? void 0 : (_currentProduct$artic2 = currentProduct.article) === null || _currentProduct$artic2 === void 0 ? void 0 : _currentProduct$artic2.id_description_facilitator
528
- }],
529
- collaborators: {
530
- especialist: userGroups[0] || [],
531
- facilitator: userGroups[2] || []
532
- }
533
- },
534
- "Ficha técnica": {
535
- assignations: [{
536
- collaboratorType: "especialist",
537
- id: currentProduct === null || currentProduct === void 0 ? void 0 : (_currentProduct$artic3 = currentProduct.article) === null || _currentProduct$artic3 === void 0 ? void 0 : _currentProduct$artic3.id_datasheet_especialist
538
- }, {
539
- collaboratorType: "facilitator",
540
- id: currentProduct === null || currentProduct === void 0 ? void 0 : (_currentProduct$artic4 = currentProduct.article) === null || _currentProduct$artic4 === void 0 ? void 0 : _currentProduct$artic4.id_datasheet_facilitator
541
- }],
542
- collaborators: {
543
- especialist: userGroups[0] || [],
544
- facilitator: userGroups[2] || []
545
- }
546
- },
547
- Imágenes: {
548
- assignations: [{
549
- collaboratorType: "especialist",
550
- id: currentProduct === null || currentProduct === void 0 ? void 0 : (_currentProduct$artic5 = currentProduct.article) === null || _currentProduct$artic5 === void 0 ? void 0 : _currentProduct$artic5.id_images_especialist
551
- }, {
552
- collaboratorType: "facilitator",
553
- id: currentProduct === null || currentProduct === void 0 ? void 0 : (_currentProduct$artic6 = currentProduct.article) === null || _currentProduct$artic6 === void 0 ? void 0 : _currentProduct$artic6.id_images_facilitator
554
- }],
555
- collaborators: {
556
- especialist: userGroups[1] || [],
557
- facilitator: userGroups[3] || []
558
- }
559
- }
560
- });
561
- };
562
-
563
- (0, _react.useEffect)(function () {
564
- loadAssignations(productSelected);
565
- }, [userGroups]);
566
- (0, _react.useEffect)(function () {
567
- var _productSelected$reta2, _productSelected$reta3;
568
-
569
- productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$reta2 = productSelected.retailers) === null || _productSelected$reta2 === void 0 ? void 0 : _productSelected$reta2.forEach(function (retailer) {
570
- var _percentages$filter$;
571
-
572
- retailer["percentage"] = percentages === null || percentages === void 0 ? void 0 : (_percentages$filter$ = percentages.filter(function (percent) {
573
- return (retailer === null || retailer === void 0 ? void 0 : retailer.id) === (percent === null || percent === void 0 ? void 0 : percent.id_retailer);
574
- })[0]) === null || _percentages$filter$ === void 0 ? void 0 : _percentages$filter$.percentage;
575
- });
576
- setActivePercentage(productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$reta3 = productSelected.retailers[0]) === null || _productSelected$reta3 === void 0 ? void 0 : _productSelected$reta3.percentage);
577
- }, [percentages]);
578
- (0, _react.useEffect)(function () {
579
- var required = {};
580
-
581
- if (services.length > 0) {
582
- var _services$2, _services$3;
583
-
584
- services[0][activeRetailer.id].data = Object.values(services[0][activeRetailer.id].data);
585
- setActivePercentage(Math.round(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.percentage, 0));
586
- var datagroups = services[0][activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id];
587
- var inputs = (_services$2 = services[0]) === null || _services$2 === void 0 ? void 0 : _services$2.inputs;
588
-
589
- var _descriptions = (_services$3 = services[1]) === null || _services$3 === void 0 ? void 0 : _services$3.filter(function (service) {
590
- return (service === null || service === void 0 ? void 0 : service.id) === (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id);
591
- });
592
-
593
- setRequiredNull(required);
594
- setDatasheets([datagroups, inputs]);
595
- setDescriptions(_descriptions);
596
- }
597
- }, [activeRetailer]);
598
-
599
- var thumbs = function thumbs() {
600
- var _images$inputs, _images$imageType, _images$imagePackagin, _images$values;
601
-
602
- var imageInputs = images === null || images === void 0 ? void 0 : (_images$inputs = images.inputs) === null || _images$inputs === void 0 ? void 0 : _images$inputs.map(function (e) {
603
- return {
604
- value: e === null || e === void 0 ? void 0 : e.id,
605
- name: e === null || e === void 0 ? void 0 : e.name
606
- };
607
- });
608
- var imageType = images === null || images === void 0 ? void 0 : (_images$imageType = images.imageType) === null || _images$imageType === void 0 ? void 0 : _images$imageType.map(function (e) {
609
- return {
610
- value: e === null || e === void 0 ? void 0 : e.id,
611
- name: e === null || e === void 0 ? void 0 : e.name
612
- };
613
- });
614
- var imagePackagingType = images === null || images === void 0 ? void 0 : (_images$imagePackagin = images.imagePackagingType) === null || _images$imagePackagin === void 0 ? void 0 : _images$imagePackagin.map(function (e) {
615
- return {
616
- value: e === null || e === void 0 ? void 0 : e.id,
617
- name: e === null || e === void 0 ? void 0 : e.name
618
- };
619
- });
620
- return images === null || images === void 0 ? void 0 : (_images$values = images.values) === null || _images$values === void 0 ? void 0 : _images$values.map(function (image, index) {
621
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryElement.GalleryElement, {
622
- setCheckAll: setCheckAll,
623
- image: image,
624
- gridLayout: imageLayout,
625
- id: "gallery-element-" + index,
626
- index: index,
627
- imageType: imageType,
628
- imagePackagingType: imagePackagingType,
629
- imageInputs: imageInputs,
630
- changeImage: setImages,
631
- selectedImages: selectedImages,
632
- setSelectedImages: setSelectedImages
633
- }, index);
634
- });
635
- };
636
-
637
- var saveDescriptions = /*#__PURE__*/function () {
638
- var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
639
- var _productSelected$arti6;
640
-
641
- var dataObject;
642
- return _regenerator.default.wrap(function _callee6$(_context6) {
643
- while (1) {
644
- switch (_context6.prev = _context6.next) {
645
- case 0:
646
- dataObject = {
647
- articleId: productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$arti6 = productSelected.article) === null || _productSelected$arti6 === void 0 ? void 0 : _productSelected$arti6.id_article,
648
- articleData: updatedDescriptions
649
- };
650
- _context6.prev = 1;
651
- _context6.next = 4;
652
- return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
653
- headers: {
654
- Authorization: token
655
- }
656
- });
657
-
658
- case 4:
659
- _context6.next = 9;
660
- break;
661
-
662
- case 6:
663
- _context6.prev = 6;
664
- _context6.t0 = _context6["catch"](1);
665
- console.log(_context6.t0);
666
-
667
- case 9:
668
- case "end":
669
- return _context6.stop();
670
- }
671
- }
672
- }, _callee6, null, [[1, 6]]);
673
- }));
674
-
675
- return function saveDescriptions() {
676
- return _ref7.apply(this, arguments);
677
- };
678
- }();
679
-
680
- var saveDatasheets = /*#__PURE__*/function () {
681
- var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
682
- var _productSelected$arti7;
683
-
684
- var dataObject;
685
- return _regenerator.default.wrap(function _callee7$(_context7) {
686
- while (1) {
687
- switch (_context7.prev = _context7.next) {
688
- case 0:
689
- dataObject = {
690
- articleId: productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$arti7 = productSelected.article) === null || _productSelected$arti7 === void 0 ? void 0 : _productSelected$arti7.id_article,
691
- articleData: updatedDatasheets
692
- };
693
- _context7.prev = 1;
694
- _context7.next = 4;
695
- return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
696
- headers: {
697
- Authorization: token
698
- }
699
- });
700
-
701
- case 4:
702
- _context7.next = 9;
703
- break;
704
-
705
- case 6:
706
- _context7.prev = 6;
707
- _context7.t0 = _context7["catch"](1);
708
- console.log(_context7.t0);
709
-
710
- case 9:
711
- case "end":
712
- return _context7.stop();
713
- }
714
- }
715
- }, _callee7, null, [[1, 6]]);
716
- }));
717
-
718
- return function saveDatasheets() {
719
- return _ref8.apply(this, arguments);
720
- };
721
- }();
722
-
723
- var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
724
- var _images$values2, _product$article, _data$articleData, _data$articleData2, _data$updateImages;
725
-
726
- var imagesList, imagesListTemp, duplicated, attrForImgs, data, valid, _data$updateImages2, _data$articleData3, _data$articleData4, _data$articleData5, promiseArray;
727
-
728
- return _regenerator.default.wrap(function _callee8$(_context8) {
729
- while (1) {
730
- switch (_context8.prev = _context8.next) {
731
- case 0:
732
- imagesList = images === null || images === void 0 ? void 0 : (_images$values2 = images.values) === null || _images$values2 === void 0 ? void 0 : _images$values2.slice();
733
- imagesListTemp = imagesList === null || imagesList === void 0 ? void 0 : imagesList.reduce(function (acc, image) {
734
- acc[image === null || image === void 0 ? void 0 : image.image_id] = ++acc[image === null || image === void 0 ? void 0 : image.image_id] || 0;
735
- return acc;
736
- }, {});
737
- duplicated = imagesList === null || imagesList === void 0 ? void 0 : imagesList.filter(function (image) {
738
- return imagesListTemp[image === null || image === void 0 ? void 0 : image.image_id];
739
- });
740
- attrForImgs = Object.values(images === null || images === void 0 ? void 0 : images.attrForImgs);
741
- attrForImgs.pop();
742
- data = {
743
- articleId: product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article,
744
- attrReqImgs: attrForImgs === null || attrForImgs === void 0 ? void 0 : attrForImgs.map(function (e) {
745
- var _e$, _e$2;
746
-
747
- return {
748
- attrId: (_e$ = e[0]) === null || _e$ === void 0 ? void 0 : _e$.id,
749
- value: (_e$2 = e[0]) === null || _e$2 === void 0 ? void 0 : _e$2.value
750
- };
751
- }),
752
- articleData: imagesList === null || imagesList === void 0 ? void 0 : imagesList.filter(function (e) {
753
- return !e.id;
754
- }),
755
- updateImages: imagesList === null || imagesList === void 0 ? void 0 : imagesList.filter(function (e) {
756
- return e.id;
757
- })
758
- };
759
- valid = (data === null || data === void 0 ? void 0 : (_data$articleData = data.articleData) === null || _data$articleData === void 0 ? void 0 : _data$articleData.length) === 0 ? true : data === null || data === void 0 ? void 0 : (_data$articleData2 = data.articleData) === null || _data$articleData2 === void 0 ? void 0 : _data$articleData2.every(function (e, i) {
760
- if (e !== null && e !== void 0 && e.image_id && e !== null && e !== void 0 && e.packing_type && e !== null && e !== void 0 && e.image_type) {
761
- return true;
762
- }
763
-
764
- return false;
765
- });
766
-
767
- if (valid && (data === null || data === void 0 ? void 0 : (_data$updateImages = data.updateImages) === null || _data$updateImages === void 0 ? void 0 : _data$updateImages.length) > 0 && (duplicated === null || duplicated === void 0 ? void 0 : duplicated.length) === 0) {
768
- valid = data === null || data === void 0 ? void 0 : (_data$updateImages2 = data.updateImages) === null || _data$updateImages2 === void 0 ? void 0 : _data$updateImages2.every(function (e, i) {
769
- if (e !== null && e !== void 0 && e.image_id && e !== null && e !== void 0 && e.packing_type && e !== null && e !== void 0 && e.image_type) {
770
- return true;
771
- }
772
-
773
- return false;
774
- });
775
- }
776
-
777
- if (!(valid && (duplicated === null || duplicated === void 0 ? void 0 : duplicated.length) === 0)) {
778
- _context8.next = 29;
779
- break;
780
- }
781
-
782
- _context8.prev = 9;
783
- data === null || data === void 0 ? void 0 : (_data$articleData3 = data.articleData) === null || _data$articleData3 === void 0 ? void 0 : _data$articleData3.forEach(function (e) {
784
- e.uuid = (0, _uuid.v4)();
785
- });
786
- setDataImages(data);
787
-
788
- if (!((data === null || data === void 0 ? void 0 : (_data$articleData4 = data.articleData) === null || _data$articleData4 === void 0 ? void 0 : _data$articleData4.length) > 0)) {
789
- _context8.next = 21;
790
- break;
791
- }
792
-
793
- setImagesUploaded(false);
794
- promiseArray = [];
795
- data === null || data === void 0 ? void 0 : (_data$articleData5 = data.articleData) === null || _data$articleData5 === void 0 ? void 0 : _data$articleData5.forEach(function (e) {
796
- var file = Buffer.from(e.src.replace(/^data:image\/\w+;base64,/, ""), "base64");
797
- var params = {
798
- ACL: "public-read",
799
- Body: file,
800
- Bucket: S3_BUCKET,
801
- Key: "id-".concat(data.articleId, "/").concat(version, "/").concat(e === null || e === void 0 ? void 0 : e.image_id, "-").concat(e === null || e === void 0 ? void 0 : e.uuid, ".").concat(e === null || e === void 0 ? void 0 : e.ext)
802
- };
803
- promiseArray.push(myBucket.putObject(params).promise());
804
- });
805
- _context8.next = 18;
806
- return Promise.all(promiseArray);
807
-
808
- case 18:
809
- setImagesUploaded(true);
810
- _context8.next = 22;
811
- break;
812
-
813
- case 21:
814
- setImagesUploaded(true);
815
-
816
- case 22:
817
- _context8.next = 27;
818
- break;
819
-
820
- case 24:
821
- _context8.prev = 24;
822
- _context8.t0 = _context8["catch"](9);
823
- console.log(_context8.t0); // setMainLoading(false);
824
-
825
- case 27:
826
- _context8.next = 30;
827
- break;
828
-
829
- case 29:
830
- // setMainLoading(false);
831
- setMessage("Completa los campos que solicita cada una de la imágenes o hay imágenes con el mismo tipo de toma.<br>Recuerda hay campos obligatorios y no podras avanzar si no estan completos.");
832
-
833
- case 30:
834
- case "end":
835
- return _context8.stop();
836
- }
837
- }
838
- }, _callee8, null, [[9, 24]]);
839
- })), [images, imagesUploaded]);
840
- (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
841
- return _regenerator.default.wrap(function _callee9$(_context9) {
842
- while (1) {
843
- switch (_context9.prev = _context9.next) {
844
- case 0:
845
- if (!imagesUploaded) {
846
- _context9.next = 11;
847
- break;
848
- }
849
-
850
- dataImages.articleData = dataImages === null || dataImages === void 0 ? void 0 : dataImages.articleData.map(function (e) {
851
- delete e.src;
852
- e.imageID = e.image_id;
853
- e.packingType = e.packing_type;
854
- e.imageType = e.image_type;
855
- return e;
856
- });
857
- _context9.prev = 2;
858
- _context9.next = 5;
859
- return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?image=true&version=").concat(version), dataImages, {
860
- headers: {
861
- Authorization: token
862
- }
863
- });
864
-
865
- case 5:
866
- setMessage("Imágenes guardadas con éxito");
867
- _context9.next = 11;
868
- break;
869
-
870
- case 8:
871
- _context9.prev = 8;
872
- _context9.t0 = _context9["catch"](2);
873
- console.log(_context9.t0);
874
-
875
- case 11:
876
- case "end":
877
- return _context9.stop();
878
- }
879
- }
880
- }, _callee9, null, [[2, 8]]);
881
- })), [dataImages, imagesUploaded]);
882
-
883
- var approveRejectButtons = function approveRejectButtons(action) {
884
- var concept = "";
885
-
886
- switch (activeTab) {
887
- case "Descripción":
888
- concept = "description";
889
- break;
890
-
891
- case "Ficha técnica":
892
- concept = "datasheet";
893
- break;
894
-
895
- case "Imágenes":
896
- concept = "images";
897
- break;
898
-
899
- default:
900
- break;
901
- }
902
-
903
- concept = action ? action : concept;
904
- return productSelected["".concat(concept, "_status")] === "QF" && ((user === null || user === void 0 ? void 0 : user.id_role) === 1 || (user === null || user === void 0 ? void 0 : user.id_role) === 4 || (user === null || user === void 0 ? void 0 : user.id_role) === 5) || productSelected["".concat(concept, "_status")] === "AF" && ((user === null || user === void 0 ? void 0 : user.id_role) === 1 || (user === null || user === void 0 ? void 0 : user.id_role) === 6) || productSelected["".concat(concept, "_status")] === "RP" && ((user === null || user === void 0 ? void 0 : user.id_role) === 1 || (user === null || user === void 0 ? void 0 : user.id_role) === 6);
905
- };
906
-
907
- var getSectionIcon = function getSectionIcon() {
908
- switch (activeTab) {
909
- case "Ficha técnica":
910
- setIcon(_attributesSent.default);
911
- break;
912
-
913
- case "Descripción":
914
- setIcon(_descriptionSent.default);
915
- break;
916
-
917
- case "Imágenes0,,":
918
- setIcon(_uploadingImages.default);
919
- break;
920
-
921
- default:
922
- break;
923
- }
924
- };
925
-
926
- var updateCompaniesList = function updateCompaniesList(status, result, retailerId, concept) {
927
- var serv = servicesData.slice();
928
- var item = serv === null || serv === void 0 ? void 0 : serv.find(function (item) {
929
- return item.id_retailer === retailerId && item.service === concept;
930
- });
931
- var index = serv.indexOf(item);
932
-
933
- if (status === "IN_PROGRESS" || status === "QF" || status === "RF" || status === "RA") {
934
- if (result === "A") {
935
- if (activeTab === "Imágenes") {
936
- serv.map(function (item) {
937
- item.status = "AF";
938
- });
939
- } else {
940
- serv[index].status = "AF";
941
- }
942
- } else if (result === "R") {
943
- if (activeTab === "Imágenes") {
944
- serv.map(function (item) {
945
- item.status = "RF";
946
- });
947
- } else {
948
- serv[index].status = "RF";
949
- }
950
- } else {
951
- if (status === "IN_PROGRESS" || status === "ASSIGNED") {
952
- serv.map(function (item) {
953
- item.status = "QF";
954
- });
955
- } else {
956
- serv.map(function (item) {
957
- if (item.status === "RF" || item.status === "RA") {
958
- item.status = "QF";
959
- }
960
-
961
- return item;
962
- });
963
- }
964
- }
965
- } else if (status === "AF" || status === "RP") {
966
- if (result === "A") {
967
- if (activeTab === "Imágenes") {
968
- serv.map(function (item) {
969
- item.status = "AA";
970
- });
971
- } else {
972
- serv[index].status = "AA";
973
- }
974
- } else {
975
- if (activeTab === "Imágenes") {
976
- serv.map(function (item) {
977
- item.status = "RA";
978
- });
979
- } else {
980
- serv[index].status = "RA";
981
- }
982
- }
983
- }
984
-
985
- setServicesData(serv);
986
- };
987
-
988
- var sendToFacilitator = /*#__PURE__*/function () {
989
- var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(result) {
990
- var concept, evalStatus, productTemp, specialistDone, data;
991
- return _regenerator.default.wrap(function _callee10$(_context10) {
992
- while (1) {
993
- switch (_context10.prev = _context10.next) {
994
- case 0:
995
- concept = "";
996
- _context10.t0 = activeTab;
997
- _context10.next = _context10.t0 === "Descripción" ? 4 : _context10.t0 === "Ficha técnica" ? 6 : _context10.t0 === "Imágenes" ? 8 : 10;
998
- break;
999
-
1000
- case 4:
1001
- concept = "description";
1002
- return _context10.abrupt("break", 11);
1003
-
1004
- case 6:
1005
- concept = "datasheet";
1006
- return _context10.abrupt("break", 11);
1007
-
1008
- case 8:
1009
- concept = "images";
1010
- return _context10.abrupt("break", 11);
1011
-
1012
- case 10:
1013
- return _context10.abrupt("break", 11);
1014
-
1015
- case 11:
1016
- evalStatus = "";
1017
- productTemp = (0, _objectSpread2.default)({}, productSelected);
1018
- evalStatus = productSelected["".concat(concept, "_status")];
1019
- specialistDone = evalStatus === "RF" || evalStatus === "RA" || evalStatus === "IN_PROGRESS";
1020
-
1021
- if (specialistDone) {
1022
- setMessage("".concat(activeTab, " enviada a facilitador"));
1023
- getSectionIcon();
1024
- productTemp["".concat(concept, "_status")] = "QF";
1025
- } else if (evalStatus === "QF") {
1026
- setMessage("Evaluación enviada");
1027
- getSectionIcon();
1028
- productTemp["".concat(concept, "_status")] = "AF";
1029
- } else if (evalStatus === "AF") {
1030
- setMessage("Evaluación enviada");
1031
- getSectionIcon();
1032
- productTemp["".concat(concept, "_status")] = "AA";
1033
- } else if (evalStatus === "RP") {
1034
- setMessage("Evaluación enviada");
1035
- getSectionIcon();
1036
- productTemp["".concat(concept, "_status")] = "AA";
1037
- }
1038
-
1039
- data = {};
1040
-
1041
- if (!result) {
1042
- _context10.next = 24;
1043
- break;
1044
- }
1045
-
1046
- updateCompaniesList(evalStatus, result, activeRetailer.id, concept);
1047
- data = {
1048
- articleId: productSelected.article.id_article,
1049
- orderId: productSelected.orderId,
1050
- concept: concept,
1051
- result: result,
1052
- evalStatus: evalStatus,
1053
- retailerId: activeRetailer.id
1054
- };
1055
- _context10.next = 22;
1056
- return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1057
- headers: {
1058
- Authorization: token
1059
- }
1060
- });
1061
-
1062
- case 22:
1063
- _context10.next = 37;
1064
- break;
1065
-
1066
- case 24:
1067
- if (specialistDone) {
1068
- updateCompaniesList(evalStatus, result, activeRetailer.id);
1069
- }
1070
-
1071
- data = {
1072
- articleId: productSelected.article.id_article,
1073
- orderId: productSelected.orderId,
1074
- concept: concept,
1075
- evalStatus: evalStatus,
1076
- retailerId: activeRetailer.id
1077
- };
1078
- _context10.t1 = user.id_role;
1079
- _context10.next = _context10.t1 === 7 ? 29 : _context10.t1 === 8 ? 29 : _context10.t1 === 4 ? 31 : _context10.t1 === 5 ? 31 : 33;
1080
- break;
1081
-
1082
- case 29:
1083
- data.especialist = true;
1084
- return _context10.abrupt("break", 34);
1085
-
1086
- case 31:
1087
- data.facilitator = true;
1088
- return _context10.abrupt("break", 34);
1089
-
1090
- case 33:
1091
- return _context10.abrupt("break", 34);
1092
-
1093
- case 34:
1094
- _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
1095
- headers: {
1096
- Authorization: token
1097
- }
1098
- });
1099
-
1100
- setProduct(productTemp);
1101
- setModalSent(true);
1102
-
1103
- case 37:
1104
- case "end":
1105
- return _context10.stop();
1106
- }
1107
- }
1108
- }, _callee10);
1109
- }));
1110
-
1111
- return function sendToFacilitator(_x3) {
1112
- return _ref11.apply(this, arguments);
1113
- };
1114
- }();
1115
-
1116
- var userAssigned = function userAssigned(tab, rol) {
1117
- var concept = "";
1118
-
1119
- switch (tab) {
1120
- case "Ficha técnica":
1121
- concept = "datasheet";
1122
- break;
1123
-
1124
- case "Imágenes":
1125
- concept = "images";
1126
- break;
1127
-
1128
- default:
1129
- concept = "description";
1130
- break;
1131
- }
1132
-
1133
- var allowedRoles = [1, 4, 5, 6, 7, 8];
1134
- var validUser = allowedRoles.indexOf(user === null || user === void 0 ? void 0 : user.id_role) !== -1;
1135
- return productSelected.article["id_".concat(concept, "_").concat(rol)] === user.id_user && validUser;
1136
- };
1137
-
1138
- var auditorAssigned = function auditorAssigned() {
1139
- return (productSelected === null || productSelected === void 0 ? void 0 : productSelected.article["id_auditor"]) === user.id_user;
1140
- };
1141
-
1142
- function specialistValid(tab) {
1143
- var concept = "";
1144
-
1145
- switch (tab) {
1146
- case "Ficha técnica":
1147
- concept = "datasheet";
1148
- break;
1149
-
1150
- case "Imágenes":
1151
- concept = "images";
1152
- break;
1153
-
1154
- default:
1155
- concept = "description";
1156
- break;
1157
- }
1158
-
1159
- return product["".concat(concept, "_status")] === "IN_PROGRESS" || product["".concat(concept, "_status")] === "RF" || product["".concat(concept, "_status")] === "RA";
1160
- }
1161
-
1162
- function versionMatch() {
1163
- return (productSelected === null || productSelected === void 0 ? void 0 : productSelected.version) === version;
1164
- }
1165
-
1166
- var createComment = /*#__PURE__*/function () {
1167
- var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e, body, tab) {
1168
- var _product$article2;
1169
-
1170
- var concept, data;
1171
- return _regenerator.default.wrap(function _callee11$(_context11) {
1172
- while (1) {
1173
- switch (_context11.prev = _context11.next) {
1174
- case 0:
1175
- concept = "";
1176
- _context11.t0 = activeTab;
1177
- _context11.next = _context11.t0 === "Ficha técnica" ? 4 : _context11.t0 === "Imágenes" ? 6 : 8;
1178
- break;
1179
-
1180
- case 4:
1181
- concept = "datasheet";
1182
- return _context11.abrupt("break", 10);
1183
-
1184
- case 6:
1185
- concept = "images";
1186
- return _context11.abrupt("break", 10);
1187
-
1188
- case 8:
1189
- concept = "description";
1190
- return _context11.abrupt("break", 10);
1191
-
1192
- case 10:
1193
- data = {
1194
- articleId: product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.id_article,
1195
- orderId: product === null || product === void 0 ? void 0 : product.orderId,
1196
- message: body,
1197
- concept: concept,
1198
- version: version
1199
- };
1200
- _context11.next = 13;
1201
- return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1202
- headers: {
1203
- Authorization: token
1204
- }
1205
- });
1206
-
1207
- case 13:
1208
- _context11.next = 15;
1209
- return getComments(tab);
1210
-
1211
- case 15:
1212
- case "end":
1213
- return _context11.stop();
1214
- }
1215
- }
1216
- }, _callee11);
1217
- }));
1218
-
1219
- return function createComment(_x4, _x5, _x6) {
1220
- return _ref12.apply(this, arguments);
1221
- };
1222
- }();
1223
-
1224
- (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
1225
- return _regenerator.default.wrap(function _callee12$(_context12) {
1226
- while (1) {
1227
- switch (_context12.prev = _context12.next) {
1228
- case 0:
1229
- setComment(comments[activeTab]);
1230
126
 
1231
127
  case 1:
1232
128
  case "end":
1233
- return _context12.stop();
129
+ return _context2.stop();
1234
130
  }
1235
131
  }
1236
- }, _callee12);
1237
- })), [activeTab]);
1238
-
1239
- var commentRevised = /*#__PURE__*/function () {
1240
- var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
1241
- var data;
1242
- return _regenerator.default.wrap(function _callee13$(_context13) {
1243
- while (1) {
1244
- switch (_context13.prev = _context13.next) {
1245
- case 0:
1246
- data = {
1247
- commentId: comment.id
1248
- };
1249
- _context13.next = 3;
1250
- return _axios.default.put("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1251
- headers: {
1252
- Authorization: sessionStorage.getItem("jwt")
1253
- }
1254
- });
1255
-
1256
- case 3:
1257
- setCrossComment(false);
1258
- _context13.next = 6;
1259
- return getComments();
1260
-
1261
- case 6:
1262
- case "end":
1263
- return _context13.stop();
1264
- }
1265
- }
1266
- }, _callee13);
1267
- }));
1268
-
1269
- return function commentRevised() {
1270
- return _ref14.apply(this, arguments);
1271
- };
1272
- }();
1273
-
1274
- var setAssignation = /*#__PURE__*/function () {
1275
- var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
1276
- var _product$article3;
1277
-
1278
- var concept, productTemp, data;
1279
- return _regenerator.default.wrap(function _callee14$(_context14) {
1280
- while (1) {
1281
- switch (_context14.prev = _context14.next) {
1282
- case 0:
1283
- concept = "";
1284
- _context14.t0 = activeTab;
1285
- _context14.next = _context14.t0 === "Ficha técnica" ? 4 : _context14.t0 === "Imágenes" ? 6 : 8;
1286
- break;
1287
-
1288
- case 4:
1289
- concept = "datasheet";
1290
- return _context14.abrupt("break", 10);
1291
-
1292
- case 6:
1293
- concept = "images";
1294
- return _context14.abrupt("break", 10);
1295
-
1296
- case 8:
1297
- concept = "description";
1298
- return _context14.abrupt("break", 10);
1299
-
1300
- case 10:
1301
- productTemp = productSelected;
1302
- productTemp.article["id_".concat(concept, "_").concat(assignationType)] = assignationId;
1303
- data = (0, _defineProperty2.default)({
1304
- articleList: [{
1305
- orderId: product.orderId,
1306
- articleId: product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_article
1307
- }],
1308
- concept: concept
1309
- }, "".concat(assignationType, "Id"), assignationId);
1310
- (0, _axios.default)({
1311
- method: "post",
1312
- url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
1313
- data: data,
1314
- headers: {
1315
- Authorization: token
1316
- }
1317
- });
1318
- loadAssignations(productTemp);
1319
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1320
-
1321
- case 16:
1322
- case "end":
1323
- return _context14.stop();
1324
- }
1325
- }
1326
- }, _callee14);
1327
- }));
1328
-
1329
- return function setAssignation(_x7, _x8) {
1330
- return _ref15.apply(this, arguments);
1331
- };
1332
- }();
1333
-
1334
- var evaluationComplete = function evaluationComplete(tab) {
1335
- var concept = "";
1336
-
1337
- switch (tab) {
1338
- case "Ficha técnica":
1339
- concept = "datasheet";
1340
- break;
1341
-
1342
- case "Imágenes":
1343
- concept = "images";
1344
- break;
1345
-
1346
- default:
1347
- concept = "description";
1348
- break;
1349
- }
1350
-
1351
- var serv = servicesData.filter(function (item) {
1352
- return item.service === concept;
132
+ }, _callee2);
133
+ })), []);
134
+ return /*#__PURE__*/React.createElement(_styles.Container, {
135
+ headerTop: headerTop
136
+ }, /*#__PURE__*/React.createElement(_HeaderTop.HeaderTop, {
137
+ setHeaderTop: setHeaderTop
138
+ }), /*#__PURE__*/React.createElement("div", {
139
+ className: "data-container"
140
+ }, /*#__PURE__*/React.createElement("div", {
141
+ className: "image-data-panel"
142
+ }, /*#__PURE__*/React.createElement(_ImagePreviewer.ImagePreviewer, {
143
+ activeImage: activeImage,
144
+ imagesArray: images,
145
+ setActiveImage: setActiveImage,
146
+ setShowModal: setShowModal
147
+ }), /*#__PURE__*/React.createElement(_ImageDataTable.ImageDataTable, {
148
+ imageData: activeImage === null || activeImage === void 0 ? void 0 : activeImage.data,
149
+ activeImage: activeImage
150
+ })), /*#__PURE__*/React.createElement("div", {
151
+ className: "product-information"
152
+ }, /*#__PURE__*/React.createElement(_FullProductNameHeader.FullProductNameHeader, {
153
+ headerData: productData.headerData
154
+ }), /*#__PURE__*/React.createElement(_FullTabsMenu.FullTabsMenu, {
155
+ tabsSections: tabsSections,
156
+ status: productData.status,
157
+ profileImage: productData.asigned,
158
+ setActiveTab: setActiveTab,
159
+ setImageLayout: setImageLayout
160
+ }), /*#__PURE__*/React.createElement("div", {
161
+ className: "services-information-container " + (imageLayout && activeTab === "Imágenes" && "image-services")
162
+ }, !imageLayout && /*#__PURE__*/React.createElement(_GalleryHeader.GalleryHeader, null), activeTab === "Ficha técnica" && ((_datasheets$ = datasheets[0]) === null || _datasheets$ === void 0 ? void 0 : (_datasheets$$data = _datasheets$.data) === null || _datasheets$$data === void 0 ? void 0 : _datasheets$$data.map(function (dataGroup, index) {
163
+ return /*#__PURE__*/React.createElement(_InputGroup.InputGroup, {
164
+ key: index,
165
+ activeSection: activeTab,
166
+ inputGroup: dataGroup,
167
+ dataInputs: datasheets[1]
1353
168
  });
1354
- var approved = "";
1355
- var rejected = "";
1356
-
1357
- if (product.status === "IN_PROGRESS" || product.status === "QF" || product.status === "RF") {
1358
- approved = "AF";
1359
- rejected = "RF";
1360
-
1361
- if (product.status === "QF") {
1362
- return serv.filter(function (item) {
1363
- return item.status === approved || item.status === rejected || item.status === "AA" || item.status === "AP";
1364
- }).length === serv.length;
1365
- }
1366
- } else if (product.status === "AF" || product.status === "RA" || product.status === "RP") {
1367
- approved = "AA";
1368
- rejected = "RA";
1369
-
1370
- if (product.status === "RP" || product.status === "AF") {
1371
- return serv.filter(function (item) {
1372
- return item.status === approved || item.status === rejected || item.status === "AP";
1373
- }).length === serv.length;
1374
- }
1375
- } else if (product.status === "RC") {
1376
- approved = "AP";
1377
- rejected = "RA";
1378
- return serv.filter(function (item) {
1379
- return item.status === approved || item.status === rejected;
1380
- }).length === serv.length;
1381
- }
1382
-
1383
- return serv.filter(function (item) {
1384
- return item.status === approved || item.status === rejected;
1385
- }).length === serv.length;
1386
- };
1387
-
1388
- var downloadImages = function downloadImages() {
1389
- selectedImages.forEach(function (e) {
1390
- if (e.id) {
1391
- (0, _fileSaver.saveAs)("https://".concat(process.env.REACT_APP_IMAGES_BUCKET, ".s3.amazonaws.com/").concat(e.srcDB), "".concat(product.article.upc, "_").concat(e.name, ".").concat(e.ext));
1392
- }
169
+ })), activeTab === "Descripción" && /*#__PURE__*/React.createElement(_InputGroup.InputGroup, {
170
+ activeSection: activeTab,
171
+ inputGroup: descriptions[0]
172
+ }), activeTab === "Imágenes" && (images === null || images === void 0 ? void 0 : (_images$values = images.values) === null || _images$values === void 0 ? void 0 : _images$values.map(function (image, index) {
173
+ return /*#__PURE__*/React.createElement(_GalleryElement.GalleryElement, {
174
+ key: index,
175
+ image: (0, _data.getImage)(image, 179, 179),
176
+ gridLayout: imageLayout,
177
+ id: "gallery-element-" + index
1393
178
  });
1394
- };
1395
-
1396
- var deleteImages = function deleteImages() {
1397
- var data = {
1398
- articleId: product.article.id_article,
1399
- deleteImages: selectedImages
1400
- };
1401
-
1402
- try {
1403
- _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?image=true&version=").concat(version), data, {
1404
- headers: {
1405
- Authorization: token
1406
- }
1407
- });
1408
- } catch (err) {
1409
- console.log(err);
1410
- }
1411
-
1412
- setMessage("");
1413
- };
1414
-
1415
- var askToDeleteImages = function askToDeleteImages() {
1416
- if (selectedImages.length > 0) {
1417
- setMessage("¿Está seguro de eliminar las imágenes seleccionadas?");
1418
- setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1419
- text: "",
1420
- Paragraph: "¿Está seguro de eliminar las imágenes seleccionadas?",
1421
- headerType: "header-and-paragraph"
1422
- }, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1423
- buttonType: "general-white-button",
1424
- label: "Cancelar",
1425
- onClick: function onClick() {
1426
- return setMessage("");
1427
- }
1428
- }, "2"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1429
- buttonType: "general-button-default",
1430
- label: "Aceptar",
1431
- onClick: function onClick() {
1432
- return deleteImages();
1433
- }
1434
- }, "3")]);
1435
- }
1436
- };
1437
-
1438
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
1439
- headerTop: headerTop,
1440
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
1441
- setHeaderTop: setHeaderTop
1442
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1443
- className: "data-container",
1444
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1445
- className: "image-data-panel",
1446
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagePreviewer.ImagePreviewer, {
1447
- activeImage: images !== null && images !== void 0 && images.values ? images === null || images === void 0 ? void 0 : images.values[activeImage] : {},
1448
- imagesArray: images,
1449
- setActiveImage: setActiveImage,
1450
- setShowModal: setShowModal
1451
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageDataTable.ImageDataTable, {
1452
- lists: images,
1453
- activeImage: images !== null && images !== void 0 && images.values ? images === null || images === void 0 ? void 0 : images.values[activeImage] : {},
1454
- retailerSelected: activeRetailer.id,
1455
- setImages: setImages,
1456
- assignationsImages: assig["Imágenes"],
1457
- imagesStatus: productSelected === null || productSelected === void 0 ? void 0 : productSelected.images_status,
1458
- setAssignation: setAssignation,
1459
- isRetailer: isRetailer,
1460
- onClickSave: function onClickSave() {
1461
- return updateImages();
1462
- }
1463
- })]
1464
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1465
- className: "product-information",
1466
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FullProductNameHeader.FullProductNameHeader, {
1467
- headerData: product,
1468
- percent: activePercentage,
1469
- activeRetailer: activeRetailer,
1470
- setActiveRetailer: setActiveRetailer,
1471
- approveRejectButtons: approveRejectButtons,
1472
- sendToFacilitator: sendToFacilitator,
1473
- auditorAssigned: auditorAssigned,
1474
- userAssigned: userAssigned(activeTab, "facilitator")
1475
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
1476
- tabsSections: tabsSections,
1477
- status: {
1478
- Descripción: (_servicesData$filter$ = servicesData.filter(function (service) {
1479
- return service.id_retailer === (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id) && service.service === "description";
1480
- })[0]) === null || _servicesData$filter$ === void 0 ? void 0 : _servicesData$filter$.status,
1481
- "Ficha técnica": (_servicesData$filter$2 = servicesData.filter(function (service) {
1482
- return service.id_retailer === (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id) && service.service === "datasheet";
1483
- })[0]) === null || _servicesData$filter$2 === void 0 ? void 0 : _servicesData$filter$2.status,
1484
- Imágenes: product === null || product === void 0 ? void 0 : product.images_status
1485
- },
1486
- activeTab: activeTab,
1487
- setActiveTab: setActiveTab,
1488
- setImageLayout: setImageLayout,
1489
- downloadImages: downloadImages,
1490
- askToDeleteImages: askToDeleteImages,
1491
- assig: assig[activeTab],
1492
- setAssignation: setAssignation,
1493
- isRetailer: isRetailer,
1494
- onClickSave: function onClickSave() {
1495
- switch (activeTab) {
1496
- case "Descripción":
1497
- saveDescriptions();
1498
- break;
1499
-
1500
- case "Ficha técnica":
1501
- saveDatasheets();
1502
- break;
1503
-
1504
- case "Imágenes":
1505
- updateImages();
1506
- break;
1507
-
1508
- default:
1509
- break;
1510
- }
1511
- }
1512
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1513
- className: "services-information-container " + (imageLayout && activeTab === "Imágenes" ? "image-services" : ""),
1514
- children: [!imageLayout && activeTab === "Imágenes" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
1515
- setSelectedImages: setSelectedImages,
1516
- checkAll: checkAll,
1517
- setCheckAll: setCheckAll
1518
- }), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : (_product$services = product.services) === null || _product$services === void 0 ? void 0 : _product$services.datasheets) === 1 ? (_datasheets$ = datasheets[0]) === null || _datasheets$ === void 0 ? void 0 : (_datasheets$$data = _datasheets$.data) === null || _datasheets$$data === void 0 ? void 0 : _datasheets$$data.map(function (dataGroup, index) {
1519
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1520
- articleId: productSelected.article.id_article,
1521
- version: version,
1522
- activeSection: activeTab,
1523
- inputGroup: dataGroup,
1524
- dataInputs: datasheets[1],
1525
- updatedDatasheets: updatedDatasheets,
1526
- setUpdatedDatasheets: setUpdatedDatasheets
1527
- }, index + "-" + activeRetailer.name);
1528
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1529
- children: "no tienes este servicio"
1530
- })), activeTab === "Descripción" && ((product === null || product === void 0 ? void 0 : (_product$services2 = product.services) === null || _product$services2 === void 0 ? void 0 : _product$services2.descriptions) === 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1531
- activeSection: activeTab,
1532
- inputGroup: descriptions[0],
1533
- updatedDescriptions: updatedDescriptions,
1534
- setUpdatedDescriptions: setUpdatedDescriptions,
1535
- articleId: product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article,
1536
- version: version,
1537
- dinamicHeight: true
1538
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1539
- children: "no tienes este servicio"
1540
- })), activeTab === "Imágenes" && ((product === null || product === void 0 ? void 0 : (_product$services3 = product.services) === null || _product$services3 === void 0 ? void 0 : _product$services3.images) === 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("section", {
1541
- className: "container",
1542
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({}, getRootProps({
1543
- className: "dropzone"
1544
- })), {}, {
1545
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread2.default)({}, getInputProps())), /*#__PURE__*/(0, _jsxRuntime.jsx)("aside", {
1546
- children: thumbs()
1547
- })]
1548
- }))
1549
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1550
- children: "no tienes este servicio"
1551
- }))]
1552
- }), (userAssigned(activeTab, "especialist" || "facilitator") || auditorAssigned()) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1553
- className: "commentary-box",
1554
- children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1555
- className: "commentary",
1556
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
1557
- label: "Caja de Comentario",
1558
- inputType: "textarea",
1559
- inputCols: 80,
1560
- inputRows: 4,
1561
- inputId: "commentary-box",
1562
- index: 0
1563
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1564
- className: "buttons-box",
1565
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1566
- buttonType: "general-transparent-button",
1567
- label: "Enviar comentario",
1568
- onClick: function onClick(e) {
1569
- return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
1570
- }
1571
- })
1572
- })]
1573
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1574
- className: "feedback-box",
1575
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
1576
- comment: comment.message,
1577
- reviewed: crossComment
1578
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1579
- buttonType: "circular-button accept-button",
1580
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
1581
- return _regenerator.default.wrap(function _callee15$(_context15) {
1582
- while (1) {
1583
- switch (_context15.prev = _context15.next) {
1584
- case 0:
1585
- setCrossComment(true);
1586
- commentRevised();
1587
-
1588
- case 2:
1589
- case "end":
1590
- return _context15.stop();
1591
- }
1592
- }
1593
- }, _callee15);
1594
- }))
1595
- })]
1596
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1597
- buttonType: !requiredNull[activeTab] === 0 || !approveRejectButtons() || !evaluationComplete(activeTab) ? "general-button-disabled" : "general-green-button",
1598
- label: "Enviar evaluación",
1599
- onClick: function onClick() {
1600
- return sendToFacilitator();
1601
- }
1602
- })]
1603
- })]
1604
- })]
1605
- }), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
1606
- images: images,
1607
- setShowModal: setShowModal,
1608
- sendToFacilitator: sendToFacilitator,
1609
- approveRejectButtons: approveRejectButtons
1610
- }), message.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
1611
- componentsArray: componentsArray.length > 0 ? componentsArray : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1612
- text: message
1613
- }),
1614
- onClick: function onClick() {
1615
- return setMessage("");
1616
- }
1617
- })]
1618
- });
179
+ }))))), showModal && /*#__PURE__*/React.createElement(_ProductImageModal.ProductImageModal, {
180
+ images: images,
181
+ setShowModal: setShowModal
182
+ }));
1619
183
  };
1620
184
 
1621
185
  exports.RetailerProductEdition = RetailerProductEdition;