contentoh-components-library 21.0.11 → 21.0.14

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