contentoh-components-library 21.0.60 → 21.0.63

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 (246) hide show
  1. package/.env.development +18 -5
  2. package/.env.production +16 -3
  3. package/CHANGELOG.md +31 -33
  4. package/dist/assets/images/generalButton/downloadIcon.svg +3 -0
  5. package/dist/assets/images/modalsSVGs/attributesSent.svg +208 -0
  6. package/dist/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  7. package/dist/assets/images/modalsSVGs/providerSent.svg +445 -0
  8. package/dist/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  9. package/dist/components/atoms/AsignationOption/index.js +9 -5
  10. package/dist/components/atoms/AsignationOption/styles.js +1 -1
  11. package/dist/components/{molecules/SignInLogin/SignInLogin.stories.js → atoms/CharCounter/CharCounter.stories.js} +10 -7
  12. package/dist/components/atoms/CharCounter/index.js +22 -0
  13. package/dist/components/{molecules/LogoLoading → atoms/CharCounter}/styles.js +3 -1
  14. package/dist/components/atoms/CheckBox/index.js +4 -2
  15. package/dist/components/atoms/Commentary/Commentary.stories.js +1 -0
  16. package/dist/components/atoms/Commentary/index.js +23 -0
  17. package/dist/components/{organisms/ChangePassword → atoms/Commentary}/styles.js +6 -1
  18. package/dist/components/atoms/GeneralButton/index.js +5 -0
  19. package/dist/components/atoms/GeneralButton/styles.js +4 -2
  20. package/dist/components/atoms/GeneralInput/index.js +72 -25
  21. package/dist/components/atoms/GeneralInput/styles.js +7 -1
  22. package/dist/components/atoms/GenericModal/index.js +4 -2
  23. package/dist/components/atoms/GenericModal/styles.js +1 -1
  24. package/dist/components/atoms/GradientPanel/styles.js +1 -1
  25. package/dist/components/atoms/Input/index.js +26 -0
  26. package/dist/components/atoms/Input/style.js +26 -0
  27. package/dist/components/{organisms/ChangePassword/ChangePassword.stories.js → atoms/InputFormatter/Wysiwyg.stories.js} +9 -7
  28. package/dist/components/atoms/InputFormatter/index.js +184 -0
  29. package/dist/components/atoms/InputFormatter/styles.js +33 -0
  30. package/dist/components/atoms/LabelToInput/index.js +53 -0
  31. package/dist/components/atoms/LabelToInput/style.js +22 -0
  32. package/dist/components/atoms/Loading/index.js +0 -1
  33. package/dist/components/atoms/LogoImage/index.js +0 -1
  34. package/dist/components/atoms/Percent/Percent.stories.js +39 -0
  35. package/dist/components/atoms/Percent/index.js +39 -0
  36. package/dist/components/atoms/Percent/styles.js +20 -0
  37. package/dist/components/atoms/PriorityFlag/index.js +1 -1
  38. package/dist/components/atoms/ProductImage/styles.js +1 -1
  39. package/dist/components/atoms/ProgressBar/index.js +2 -2
  40. package/dist/components/atoms/ProgressBar/styles.js +3 -5
  41. package/dist/components/atoms/ScreenHeader/index.js +1 -1
  42. package/dist/components/atoms/ScreenHeader/styles.js +1 -1
  43. package/dist/components/atoms/Select/index.js +39 -0
  44. package/dist/components/atoms/Select/style.js +32 -0
  45. package/dist/components/atoms/StatusTag/index.js +37 -2
  46. package/dist/components/atoms/StatusTag/styles.js +1 -1
  47. package/dist/components/atoms/ValidationPanel/index.js +4 -3
  48. package/dist/components/molecules/AvatarAndValidation/index.js +17 -7
  49. package/dist/components/molecules/AvatarAndValidation/styles.js +1 -1
  50. package/dist/components/molecules/CarouselImagesLogin/index.js +42 -40
  51. package/dist/components/molecules/FeaturesBar/index.js +1 -1
  52. package/dist/components/molecules/GalleryElement/index.js +80 -21
  53. package/dist/components/molecules/GalleryElement/styles.js +1 -1
  54. package/dist/components/molecules/GalleryHeader/index.js +28 -6
  55. package/dist/components/molecules/GalleryHeader/styles.js +1 -1
  56. package/dist/components/molecules/ImageSelector/index.js +2 -4
  57. package/dist/components/molecules/LoginPasswordStrength/index.js +6 -6
  58. package/dist/components/molecules/LoginPasswordStrength/styles.js +1 -1
  59. package/dist/components/molecules/ProductNameHeader/index.js +1 -2
  60. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +48 -0
  61. package/dist/components/molecules/RetailerSelector/index.js +74 -0
  62. package/dist/components/{atoms/MenuCommercialRetailers → molecules/RetailerSelector}/styles.js +1 -1
  63. package/dist/components/molecules/StatusAsignationInfo/index.js +46 -25
  64. package/dist/components/molecules/StatusAsignationInfo/styles.js +1 -1
  65. package/dist/components/molecules/TableHeader/index.js +12 -5
  66. package/dist/components/molecules/TableHeader/styles.js +1 -1
  67. package/dist/components/molecules/TagAndInput/index.js +24 -2
  68. package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +31 -0
  69. package/dist/components/molecules/TextAndGradient/index.js +36 -0
  70. package/dist/components/molecules/TextAndGradient/styles.js +18 -0
  71. package/dist/components/organisms/FullProductNameHeader/index.js +32 -8
  72. package/dist/components/organisms/FullTabsMenu/index.js +18 -5
  73. package/dist/components/organisms/ImageDataTable/index.js +90 -14
  74. package/dist/components/organisms/InputGroup/index.js +34 -13
  75. package/dist/components/organisms/InputGroup/styles.js +1 -1
  76. package/dist/components/organisms/ProductImageModal/index.js +15 -11
  77. package/dist/components/organisms/ProductImageModal/styles.js +1 -1
  78. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +91 -347
  79. package/dist/components/pages/RetailerProductEdition/index.js +1608 -60
  80. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  81. package/dist/global-files/data.js +212 -53
  82. package/dist/global-files/global-styles.css +1 -0
  83. package/dist/global-files/variables.js +1 -0
  84. package/dist/index.js +30 -277
  85. package/package.json +12 -14
  86. package/src/assets/images/generalButton/downloadIcon.svg +3 -0
  87. package/src/assets/images/modalsSVGs/attributesSent.svg +208 -0
  88. package/src/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  89. package/src/assets/images/modalsSVGs/providerSent.svg +445 -0
  90. package/src/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  91. package/src/components/atoms/AsignationOption/index.js +7 -5
  92. package/src/components/atoms/AsignationOption/styles.js +9 -1
  93. package/src/components/atoms/CharCounter/CharCounter.stories.js +11 -0
  94. package/src/components/atoms/CharCounter/index.js +13 -0
  95. package/src/components/atoms/CharCounter/styles.js +10 -0
  96. package/src/components/atoms/CheckBox/index.js +8 -2
  97. package/src/components/atoms/Commentary/Commentary.stories.js +0 -0
  98. package/src/components/atoms/Commentary/index.js +9 -0
  99. package/src/components/atoms/Commentary/styles.js +16 -0
  100. package/src/components/atoms/GeneralButton/index.js +9 -2
  101. package/src/components/atoms/GeneralButton/styles.js +23 -0
  102. package/src/components/atoms/GeneralInput/index.js +71 -23
  103. package/src/components/atoms/GeneralInput/styles.js +11 -1
  104. package/src/components/atoms/GenericModal/index.js +2 -2
  105. package/src/components/atoms/GenericModal/styles.js +10 -2
  106. package/src/components/atoms/GradientPanel/styles.js +0 -1
  107. package/src/components/atoms/Input/index.js +15 -0
  108. package/src/components/atoms/Input/style.js +31 -0
  109. package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +12 -0
  110. package/src/components/atoms/InputFormatter/index.js +144 -0
  111. package/src/components/atoms/InputFormatter/styles.js +40 -0
  112. package/src/components/atoms/LabelToInput/index.js +26 -0
  113. package/src/components/atoms/LabelToInput/style.js +41 -0
  114. package/src/components/atoms/Loading/index.js +2 -3
  115. package/src/components/atoms/LogoImage/index.js +1 -1
  116. package/src/components/atoms/PriorityFlag/index.js +1 -1
  117. package/src/components/atoms/ProductImage/styles.js +1 -1
  118. package/src/components/atoms/ProgressBar/index.js +2 -2
  119. package/src/components/atoms/ProgressBar/styles.js +54 -3
  120. package/src/components/atoms/ScreenHeader/index.js +7 -3
  121. package/src/components/atoms/ScreenHeader/styles.js +9 -2
  122. package/src/components/atoms/Select/index.js +35 -0
  123. package/src/components/atoms/Select/style.js +76 -0
  124. package/src/components/atoms/StatusTag/index.js +30 -2
  125. package/src/components/atoms/StatusTag/styles.js +15 -3
  126. package/src/components/atoms/ValidationPanel/index.js +3 -3
  127. package/src/components/molecules/AvatarAndValidation/index.js +24 -6
  128. package/src/components/molecules/AvatarAndValidation/styles.js +1 -1
  129. package/src/components/molecules/CarouselImagesLogin/index.js +37 -34
  130. package/src/components/molecules/FeaturesBar/index.js +10 -7
  131. package/src/components/molecules/GalleryElement/index.js +75 -36
  132. package/src/components/molecules/GalleryElement/styles.js +38 -11
  133. package/src/components/molecules/GalleryHeader/index.js +14 -8
  134. package/src/components/molecules/GalleryHeader/styles.js +16 -0
  135. package/src/components/molecules/ImageSelector/index.js +2 -3
  136. package/src/components/molecules/LoginPasswordStrength/index.js +3 -8
  137. package/src/components/molecules/LoginPasswordStrength/styles.js +0 -3
  138. package/src/components/molecules/ProductNameHeader/index.js +1 -2
  139. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +35 -0
  140. package/src/components/molecules/RetailerSelector/index.js +63 -0
  141. package/src/components/molecules/RetailerSelector/styles.js +18 -0
  142. package/src/components/molecules/StatusAsignationInfo/index.js +62 -38
  143. package/src/components/molecules/StatusAsignationInfo/styles.js +12 -2
  144. package/src/components/molecules/TableHeader/index.js +16 -3
  145. package/src/components/molecules/TableHeader/styles.js +5 -0
  146. package/src/components/molecules/TagAndInput/index.js +24 -2
  147. package/src/components/organisms/FullProductNameHeader/index.js +28 -7
  148. package/src/components/organisms/FullTabsMenu/index.js +15 -3
  149. package/src/components/organisms/ImageDataTable/index.js +89 -11
  150. package/src/components/organisms/InputGroup/index.js +46 -11
  151. package/src/components/organisms/InputGroup/styles.js +3 -0
  152. package/src/components/organisms/ProductImageModal/index.js +20 -12
  153. package/src/components/organisms/ProductImageModal/styles.js +3 -0
  154. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +91 -343
  155. package/src/components/pages/RetailerProductEdition/index.js +1238 -48
  156. package/src/components/pages/RetailerProductEdition/styles.js +67 -4
  157. package/src/global-files/data.js +156 -57
  158. package/src/global-files/global-styles.css +1 -0
  159. package/src/global-files/variables.js +1 -0
  160. package/src/index.js +1 -20
  161. package/dist/assets/images/carouselImagesLogin/login2.svg +0 -117
  162. package/dist/assets/images/carouselImagesLogin/login3.svg +0 -147
  163. package/dist/assets/images/carouselImagesLogin/loginImage.svg +0 -301
  164. package/dist/assets/images/sliderToolTip/infoIcon.svg +0 -4
  165. package/dist/assets/images/sliderToolTip/slide1.svg +0 -5
  166. package/dist/assets/images/sliderToolTip/slide2.svg +0 -9
  167. package/dist/assets/images/sliderToolTip/slide3.svg +0 -9
  168. package/dist/assets/images/sliderToolTip/slide4.svg +0 -9
  169. package/dist/assets/images/sliderToolTip/slide5.svg +0 -40
  170. package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +0 -36
  171. package/dist/components/atoms/ListCommercialRetailers/index.js +0 -64
  172. package/dist/components/atoms/ListCommercialRetailers/styles.js +0 -20
  173. package/dist/components/atoms/Loading/Loading.stories.js +0 -28
  174. package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +0 -37
  175. package/dist/components/atoms/MenuCommercialRetailers/index.js +0 -25
  176. package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +0 -28
  177. package/dist/components/atoms/MenuProductImage/index.js +0 -88
  178. package/dist/components/atoms/MenuProductImage/styles.js +0 -20
  179. package/dist/components/atoms/SliderToolTip/SliderToolTip.stories.js +0 -47
  180. package/dist/components/atoms/SliderToolTip/index.js +0 -200
  181. package/dist/components/atoms/SliderToolTip/styles.js +0 -24
  182. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +0 -22
  183. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +0 -49
  184. package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +0 -18
  185. package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +0 -25
  186. package/dist/components/molecules/ApproveRejetPanel/index.js +0 -49
  187. package/dist/components/molecules/ApproveRejetPanel/styles.js +0 -18
  188. package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +0 -28
  189. package/dist/components/molecules/EmailResetPasswordLogin/index.js +0 -153
  190. package/dist/components/molecules/EmailResetPasswordLogin/styles.js +0 -20
  191. package/dist/components/molecules/LogoLoading/Loading.stories.js +0 -28
  192. package/dist/components/molecules/LogoLoading/index.js +0 -22
  193. package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +0 -28
  194. package/dist/components/molecules/RegistrationFirstStep/index.js +0 -308
  195. package/dist/components/molecules/RegistrationFirstStep/styles.js +0 -20
  196. package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +0 -28
  197. package/dist/components/molecules/RegistrationSecondStep/index.js +0 -169
  198. package/dist/components/molecules/RegistrationSecondStep/styles.js +0 -20
  199. package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +0 -28
  200. package/dist/components/molecules/RegistrationThirdStep/index.js +0 -155
  201. package/dist/components/molecules/RegistrationThirdStep/styles.js +0 -20
  202. package/dist/components/molecules/SignInLogin/index.js +0 -295
  203. package/dist/components/molecules/SignInLogin/styles.js +0 -20
  204. package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +0 -28
  205. package/dist/components/molecules/SignInLoginCreationApp/index.js +0 -270
  206. package/dist/components/molecules/SignInLoginCreationApp/styles.js +0 -20
  207. package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +0 -28
  208. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +0 -210
  209. package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +0 -20
  210. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +0 -69
  211. package/dist/components/organisms/ChangePassword/index.js +0 -123
  212. package/src/assets/images/sliderToolTip/infoIcon.svg +0 -4
  213. package/src/assets/images/sliderToolTip/slide1.svg +0 -5
  214. package/src/assets/images/sliderToolTip/slide2.svg +0 -9
  215. package/src/assets/images/sliderToolTip/slide3.svg +0 -9
  216. package/src/assets/images/sliderToolTip/slide4.svg +0 -9
  217. package/src/assets/images/sliderToolTip/slide5.svg +0 -40
  218. package/src/components/atoms/Loading/Loading.stories.js +0 -10
  219. package/src/components/atoms/SliderToolTip/SliderToolTip.stories.js +0 -23
  220. package/src/components/atoms/SliderToolTip/index.js +0 -182
  221. package/src/components/atoms/SliderToolTip/styles.js +0 -168
  222. package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +0 -11
  223. package/src/components/molecules/EmailResetPasswordLogin/index.js +0 -85
  224. package/src/components/molecules/EmailResetPasswordLogin/styles.js +0 -23
  225. package/src/components/molecules/LogoLoading/Loading.stories.js +0 -10
  226. package/src/components/molecules/LogoLoading/index.js +0 -12
  227. package/src/components/molecules/LogoLoading/styles.js +0 -16
  228. package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +0 -11
  229. package/src/components/molecules/RegistrationFirstStep/index.js +0 -227
  230. package/src/components/molecules/RegistrationFirstStep/styles.js +0 -87
  231. package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +0 -11
  232. package/src/components/molecules/RegistrationSecondStep/index.js +0 -130
  233. package/src/components/molecules/RegistrationSecondStep/styles.js +0 -59
  234. package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +0 -11
  235. package/src/components/molecules/RegistrationThirdStep/index.js +0 -130
  236. package/src/components/molecules/RegistrationThirdStep/styles.js +0 -44
  237. package/src/components/molecules/SignInLogin/SignInLogin.stories.js +0 -11
  238. package/src/components/molecules/SignInLogin/index.js +0 -210
  239. package/src/components/molecules/SignInLogin/styles.js +0 -79
  240. package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +0 -11
  241. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +0 -170
  242. package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +0 -51
  243. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +0 -54
  244. package/src/components/organisms/ChangePassword/ChangePassword.stories.js +0 -11
  245. package/src/components/organisms/ChangePassword/index.js +0 -76
  246. package/src/components/organisms/ChangePassword/styles.js +0 -13
@@ -0,0 +1,18 @@
1
+ import styled from "styled-components";
2
+ import { GlobalColors } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ position: relative;
6
+ .retailers-panel {
7
+ background: ${GlobalColors.s2};
8
+ border: 1px solid ${GlobalColors.s3};
9
+ box-sizing: border-box;
10
+ box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.25);
11
+ border-radius: 4px;
12
+ padding: 10px;
13
+ position: absolute;
14
+ top: calc(100% + 10px);
15
+ right: 0;
16
+ z-index: 10;
17
+ }
18
+ `;
@@ -5,20 +5,24 @@ import { StatusTag } from "../../atoms/StatusTag/index";
5
5
  import { Button } from "../../atoms/GeneralButton";
6
6
  import { useEffect, useState } from "react";
7
7
  import { AsignationOption } from "../../atoms/AsignationOption/index";
8
+ import { getProfilePicture } from "../../../global-files/data";
8
9
 
9
10
  export const StatusAsignationInfo = ({
10
11
  status = "-",
11
- src,
12
12
  imagesSection,
13
13
  setImageLayout,
14
- asignationsList,
15
14
  percent = 0,
16
- saveImages,
17
- deleteImages,
15
+ assignationsImages,
16
+ setAssignation,
17
+ isRetailer,
18
+ downloadImages,
19
+ askToDeleteImages,
18
20
  id = "default-id",
21
+ onClickSave,
19
22
  }) => {
20
23
  const [showAsignationPanel, setShowAsignationPanel] = useState(false);
21
- const [layout, setLayout] = useState(true);
24
+ const [layout, setLayout] = useState(false);
25
+ const [assignationType, setAssignationType] = useState("facilitator");
22
26
 
23
27
  const closeAsignations = (e) => {
24
28
  if (!e.target.closest("#default-id") && showAsignationPanel) {
@@ -35,18 +39,22 @@ export const StatusAsignationInfo = ({
35
39
 
36
40
  return (
37
41
  <Container id={id}>
42
+ <Button
43
+ buttonType={"circular-button save-button"}
44
+ onClick={onClickSave}
45
+ />
38
46
  {imagesSection && (
39
47
  <div className="images-buttons">
40
48
  <Button
41
- buttonType={"circular-button save-button"}
49
+ buttonType={"circular-button delete-button"}
42
50
  onClick={() => {
43
- saveImages && saveImages();
51
+ askToDeleteImages && askToDeleteImages();
44
52
  }}
45
53
  />
46
54
  <Button
47
- buttonType={"circular-button delete-button"}
55
+ buttonType={"circular-button download-button"}
48
56
  onClick={() => {
49
- deleteImages && deleteImages();
57
+ downloadImages();
50
58
  }}
51
59
  />
52
60
  <Button
@@ -59,14 +67,20 @@ export const StatusAsignationInfo = ({
59
67
  </div>
60
68
  )}
61
69
  <StatusTag statusType={status} ovalForm={true} />
62
- <Avatar
63
- imageType={"small-image"}
64
- image={src}
65
- altText="user profile image"
66
- onClick={() => {
67
- setShowAsignationPanel(true);
68
- }}
69
- />
70
+ <div className="assignations-container">
71
+ {assignationsImages?.assignations?.map((assignation, index) => (
72
+ <Avatar
73
+ key={index + "-" + assignation.id}
74
+ imageType={"small-image"}
75
+ image={getProfilePicture(assignation.id, 20, 20)}
76
+ altText="user profile image"
77
+ onClick={() => {
78
+ setShowAsignationPanel(true);
79
+ setAssignationType(assignation?.collaboratorType);
80
+ }}
81
+ />
82
+ ))}
83
+ </div>
70
84
  <ScreenHeader
71
85
  text={"Asig."}
72
86
  color={"#969696"}
@@ -86,31 +100,41 @@ export const StatusAsignationInfo = ({
86
100
  </div>
87
101
  </div>
88
102
  <div className="asignations-list">
89
- {asignationsList !== undefined ? (
90
- asignationsList.map((asigantion, index) => (
91
- <AsignationOption
92
- profileImage={asignation.image}
93
- asignationType={asignation.asignationType}
94
- name={asignation.name}
95
- team={asigantion.team}
96
- />
97
- ))
103
+ {assignationsImages?.collaborators !== undefined ? (
104
+ assignationsImages?.collaborators[assignationType]?.map(
105
+ (asignation, index) => (
106
+ <AsignationOption
107
+ key={index + "-" + asignation.name}
108
+ profileImage={getProfilePicture(
109
+ asignation?.id_user,
110
+ 40,
111
+ 40
112
+ )}
113
+ onClick={() => {
114
+ setAssignation(assignationType, asignation?.id_user);
115
+ }}
116
+ name={asignation.name}
117
+ />
118
+ )
119
+ )
98
120
  ) : (
99
121
  <p className="no-asignations">Sin personas para asignar</p>
100
122
  )}
101
123
  </div>
102
- <div className="default-asignations-list">
103
- <AsignationOption
104
- asignationType={"provider"}
105
- name={"Solicitar a"}
106
- team={"Proveedor"}
107
- />
108
- <AsignationOption
109
- asignationType={"team"}
110
- name={"Solicitar a"}
111
- team={"Content-oh!"}
112
- />
113
- </div>
124
+ {isRetailer === 1 && (
125
+ <div className="default-asignations-list">
126
+ <AsignationOption
127
+ asignationType={"provider"}
128
+ name={"Solicitar a"}
129
+ team={"Proveedor"}
130
+ />
131
+ <AsignationOption
132
+ asignationType={"team"}
133
+ name={"Solicitar a"}
134
+ team={"Content-oh!"}
135
+ />
136
+ </div>
137
+ )}
114
138
  </div>
115
139
  )}
116
140
  </Container>
@@ -16,16 +16,22 @@ export const Container = styled.div`
16
16
  }
17
17
  }
18
18
 
19
+ .assignations-container {
20
+ display: flex;
21
+ cursor: pointer;
22
+ }
23
+
19
24
  .asignation-panel {
20
25
  background: ${GlobalColors.s2};
21
26
  border: 1px solid ${GlobalColors.s3};
22
27
  box-sizing: border-box;
23
28
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.25);
24
29
  border-radius: 4px;
25
- padding: 10px;
30
+ padding: 10px 8px;
26
31
  position: absolute;
27
32
  top: calc(100% + 10px);
28
33
  right: 0;
34
+ z-index: 10;
29
35
 
30
36
  .asignation-header {
31
37
  display: flex;
@@ -53,7 +59,6 @@ export const Container = styled.div`
53
59
 
54
60
  .asignations-list {
55
61
  min-height: 40px;
56
- border-bottom: 1px solid ${GlobalColors.s3};
57
62
 
58
63
  .no-asignations {
59
64
  padding: 5px;
@@ -66,7 +71,12 @@ export const Container = styled.div`
66
71
 
67
72
  & + * {
68
73
  margin-top: 10px;
74
+ border-top: 1px solid ${GlobalColors.s3};
69
75
  }
70
76
  }
77
+
78
+ .default-asignations-list {
79
+ padding-top: 10px;
80
+ }
71
81
  }
72
82
  `;
@@ -3,15 +3,28 @@ import { ScreenHeader } from "../../atoms/ScreenHeader";
3
3
  import { StatusAsignationInfo } from "../StatusAsignationInfo";
4
4
  import { GlobalColors } from "../../../global-files/variables";
5
5
 
6
- export const TableHeader = ({ headerInfo, activeImage }) => {
6
+ export const TableHeader = ({
7
+ imagesStatus,
8
+ activeImage,
9
+ assignationsImages,
10
+ setAssignation,
11
+ isRetailer,
12
+ onClickSave,
13
+ }) => {
7
14
  return (
8
15
  <Container>
9
16
  <ScreenHeader
10
- text={activeImage?.imageName}
17
+ text={activeImage?.name || "-"}
11
18
  color={GlobalColors.s5}
12
19
  headerType={"input-name-header"}
13
20
  />
14
- <StatusAsignationInfo status={headerInfo?.status} src={headerInfo?.src} />
21
+ <StatusAsignationInfo
22
+ status={imagesStatus}
23
+ assignationsImages={assignationsImages}
24
+ setAssignation={setAssignation}
25
+ isRetailer={isRetailer}
26
+ onClickSave={onClickSave}
27
+ />
15
28
  </Container>
16
29
  );
17
30
  };
@@ -7,6 +7,11 @@ export const Container = styled.div`
7
7
  padding-bottom: 5px;
8
8
  border-bottom: 1px solid ${GlobalColors.s2};
9
9
 
10
+ .input-name-header {
11
+ overflow: auto;
12
+ max-width: 40%;
13
+ white-space: nowrap;
14
+ }
10
15
  .status-asignation-info {
11
16
  display: flex;
12
17
  align-items: center;
@@ -8,7 +8,18 @@ export const TagAndInput = ({
8
8
  value,
9
9
  inputPlaceHolder,
10
10
  inputId,
11
- required,
11
+ updatedDescriptions,
12
+ setUpdatedDescriptions,
13
+ updatedDatasheets,
14
+ setUpdatedDatasheets,
15
+ articleId,
16
+ version,
17
+ index,
18
+ isRequired,
19
+ dinamicHeight,
20
+ inputCols,
21
+ inputRows,
22
+ maxChar,
12
23
  }) => {
13
24
  return (
14
25
  <Container
@@ -21,8 +32,19 @@ export const TagAndInput = ({
21
32
  inputId={inputId}
22
33
  inputType={inputType}
23
34
  inputValue={value}
35
+ index={index}
36
+ isRequired={isRequired}
24
37
  inputPlaceholder={inputPlaceHolder}
25
- required={required}
38
+ updatedDescriptions={updatedDescriptions}
39
+ setUpdatedDescriptions={setUpdatedDescriptions}
40
+ updatedDatasheets={updatedDatasheets}
41
+ setUpdatedDatasheets={setUpdatedDatasheets}
42
+ articleId={articleId}
43
+ version={version}
44
+ dinamicHeight={dinamicHeight}
45
+ inputCols={inputCols}
46
+ inputRows={inputRows}
47
+ maxChar={maxChar}
26
48
  />
27
49
  </Container>
28
50
  );
@@ -3,22 +3,43 @@ import { ProductNameHeader } from "../../molecules/ProductNameHeader";
3
3
  import { FeaturesBar } from "../../molecules/FeaturesBar";
4
4
  import { AvatarAndValidation } from "../../molecules/AvatarAndValidation";
5
5
 
6
- export const FullProductNameHeader = ({ headerData }) => {
6
+ export const FullProductNameHeader = ({
7
+ headerData,
8
+ percent,
9
+ activeRetailer,
10
+ setActiveRetailer,
11
+ approveRejectButtons,
12
+ sendToFacilitator,
13
+ auditorAssigned,
14
+ userAssigned,
15
+ }) => {
7
16
  return (
8
17
  <Container>
9
18
  <ProductNameHeader
10
- productName={headerData?.name}
19
+ productName={headerData?.article?.name}
11
20
  statusType={headerData?.status}
12
- percent={headerData?.percent}
13
- backgroundColor={headerData?.backgroundColor}
14
- priority={headerData?.priority}
15
- date={headerData?.date}
21
+ percent={percent?.toFixed(0)}
22
+ priority={headerData?.prio}
23
+ date={new Date(headerData?.article?.timestamp).toLocaleDateString()}
16
24
  />
17
25
  <div className="features-bar-container">
18
- <FeaturesBar features={headerData?.features} />
26
+ <FeaturesBar
27
+ features={[
28
+ { feature: "Categoría", value: headerData?.article?.category },
29
+ { feature: "Prov", value: headerData?.article?.company_name },
30
+ { feature: "UPC", value: headerData?.article?.upc },
31
+ ]}
32
+ />
19
33
  <AvatarAndValidation
34
+ retailers={headerData?.retailers}
20
35
  avatarData={headerData?.avatarData}
21
36
  validation={headerData?.validation}
37
+ activeRetailer={activeRetailer}
38
+ setActiveRetailer={setActiveRetailer}
39
+ approveRejectButtons={approveRejectButtons}
40
+ sendToFacilitator={sendToFacilitator}
41
+ auditorAssigned={auditorAssigned}
42
+ userAssigned={userAssigned}
22
43
  />
23
44
  </div>
24
45
  </Container>
@@ -5,10 +5,16 @@ import { useState } from "react";
5
5
 
6
6
  export const FullTabsMenu = ({
7
7
  tabsSections,
8
- status,
9
- profileImage,
8
+ status = "",
9
+ activeTab,
10
10
  setActiveTab,
11
11
  setImageLayout,
12
+ assig,
13
+ setAssignation,
14
+ isRetailer,
15
+ downloadImages,
16
+ askToDeleteImages,
17
+ onClickSave,
12
18
  }) => {
13
19
  const [imagesSection, setImagesSection] = useState(false);
14
20
 
@@ -21,9 +27,15 @@ export const FullTabsMenu = ({
21
27
  />
22
28
  <StatusAsignationInfo
23
29
  status={status}
24
- image={profileImage}
30
+ activeTab={activeTab}
25
31
  setImageLayout={setImageLayout}
26
32
  imagesSection={imagesSection}
33
+ assignationsImages={assig}
34
+ setAssignation={setAssignation}
35
+ isRetailer={isRetailer}
36
+ downloadImages={downloadImages}
37
+ onClickSave={onClickSave}
38
+ askToDeleteImages={askToDeleteImages}
27
39
  />
28
40
  </Container>
29
41
  );
@@ -1,24 +1,102 @@
1
1
  import { Container } from "./styles";
2
2
  import { TableHeader } from "../../molecules/TableHeader";
3
- import { TableRow } from "../../molecules/TableRow";
3
+ import { Container as Row } from "../../molecules/TableRow/styles";
4
+ import { ScreenHeader } from "../../atoms/ScreenHeader";
5
+ import LabelToInput from "../../atoms/LabelToInput";
4
6
 
5
7
  export const ImageDataTable = ({
6
- headerInfo,
7
- imageData,
8
8
  activeImage,
9
9
  darkMode,
10
+ lists,
11
+ retailerSelected,
12
+ setImages,
13
+ assignationsImages,
14
+ imagesStatus,
15
+ setAssignation,
16
+ isRetailer,
17
+ onClickSave,
10
18
  }) => {
11
19
  return (
12
20
  <Container darkMode={darkMode}>
13
- <TableHeader headerInfo={headerInfo} activeImage={activeImage} />
14
- {imageData?.map((attribute, index) => (
15
- <TableRow
16
- key={index}
17
- feature={attribute.feature}
18
- value={attribute.value}
19
- valueType={index < 2}
21
+ <TableHeader
22
+ imagesStatus={imagesStatus}
23
+ activeImage={activeImage}
24
+ assignationsImages={assignationsImages}
25
+ setAssignation={setAssignation}
26
+ isRetailer={isRetailer}
27
+ onClickSave={onClickSave}
28
+ />
29
+ <Row>
30
+ <ScreenHeader headerType={"table-row-text"} text="Tipo de toma" />
31
+ <ScreenHeader
32
+ headerType={"table-row-text gray-table-row"}
33
+ text={
34
+ lists?.inputs?.find((f) => f.id === +activeImage?.image_id)?.name ||
35
+ "-"
36
+ }
20
37
  />
21
- ))}
38
+ </Row>
39
+ <Row>
40
+ <ScreenHeader headerType={"table-row-text"} text="Tipo de empaque" />
41
+ <ScreenHeader
42
+ headerType={"table-row-text gray-table-row"}
43
+ text={
44
+ lists?.imagePackagingType?.find(
45
+ (f) => f.id === +activeImage?.packing_type
46
+ )?.name || "-"
47
+ }
48
+ />
49
+ </Row>
50
+ <Row>
51
+ <ScreenHeader headerType={"table-row-text"} text="Tipo de imagen" />
52
+ <ScreenHeader
53
+ headerType={"table-row-text gray-table-row"}
54
+ text={
55
+ lists?.imageType?.find((f) => f.id === +activeImage?.image_type)
56
+ ?.name || "-"
57
+ }
58
+ />
59
+ </Row>
60
+ <Row>
61
+ <ScreenHeader headerType={"table-row-text"} text="Formato" />
62
+ <ScreenHeader
63
+ headerType={"table-row-text"}
64
+ text={activeImage?.ext || "-"}
65
+ />
66
+ </Row>
67
+ <Row>
68
+ <ScreenHeader headerType={"table-row-text"} text="Tamaño de imagen" />
69
+ <ScreenHeader
70
+ headerType={"table-row-text"}
71
+ text={
72
+ activeImage?.width && activeImage.height
73
+ ? `${activeImage?.width}x${activeImage?.height}px`
74
+ : "-"
75
+ }
76
+ />
77
+ </Row>
78
+ {retailerSelected &&
79
+ lists?.attrForImgs &&
80
+ lists?.attrForImgs[retailerSelected]?.map((attr, index) => (
81
+ <Row key={"row-" + index}>
82
+ <ScreenHeader
83
+ headerType={"table-row-text"}
84
+ text={attr?.name || "-"}
85
+ />
86
+ <LabelToInput
87
+ width="100px"
88
+ defaultValue={attr?.value}
89
+ onChange={(e) => {
90
+ setImages({
91
+ action: "changeAttrValue",
92
+ retailer: retailerSelected,
93
+ index,
94
+ value: e.target.value || "-",
95
+ });
96
+ }}
97
+ />
98
+ </Row>
99
+ ))}
22
100
  </Container>
23
101
  );
24
102
  };
@@ -6,6 +6,13 @@ export const InputGroup = ({
6
6
  inputGroup = {},
7
7
  activeSection,
8
8
  dataInputs = {},
9
+ updatedDescriptions,
10
+ setUpdatedDescriptions,
11
+ updatedDatasheets,
12
+ setUpdatedDatasheets,
13
+ articleId,
14
+ version,
15
+ dinamicHeight,
9
16
  }) => {
10
17
  const inputTypeValue = (type) => {
11
18
  switch (type) {
@@ -17,7 +24,6 @@ export const InputGroup = ({
17
24
  return "text";
18
25
  }
19
26
  };
20
-
21
27
  return (
22
28
  <Container
23
29
  className={
@@ -26,29 +32,58 @@ export const InputGroup = ({
26
32
  : "descriptions-layout"
27
33
  }
28
34
  >
29
- <ScreenHeader
30
- headerType={"retailer-name-header"}
31
- text={inputGroup?.dataGroup}
32
- />
35
+ {inputGroup?.dataGroup && (
36
+ <ScreenHeader
37
+ headerType={"retailer-name-header"}
38
+ text={inputGroup?.dataGroup}
39
+ />
40
+ )}
33
41
  <div className="inputs-container">
34
42
  {inputGroup?.inputs?.map((input, index) =>
35
43
  activeSection === "Ficha técnica" ? (
36
44
  <TagAndInput
37
- key={index}
38
- inputId={"datasheet-" + dataInputs[input]?.id + "-" + index}
45
+ key={
46
+ index +
47
+ "-" +
48
+ dataInputs[input]?.value +
49
+ "-" +
50
+ dataInputs[input]?.id
51
+ }
52
+ inputId={dataInputs[input]?.id}
53
+ version={version}
39
54
  inputType={inputTypeValue(dataInputs[input]?.type)}
40
- label={dataInputs[input]?.name}
55
+ label={
56
+ dataInputs[input]?.name +
57
+ (dataInputs[input]?.required ? "*" : "")
58
+ }
41
59
  value={dataInputs[input]?.value}
42
60
  inputPlaceHolder={input?.placeholder}
61
+ articleId={articleId}
62
+ isRequired={dataInputs[input]?.required}
63
+ updatedDatasheets={updatedDatasheets}
64
+ setUpdatedDatasheets={setUpdatedDatasheets}
65
+ maxChar={
66
+ dataInputs[input]?.max_chars
67
+ ? dataInputs[input]?.max_chars
68
+ : 999
69
+ }
43
70
  />
44
71
  ) : (
45
72
  <TagAndInput
46
- key={index}
47
- inputId={"description-" + input?.id + "-" + index}
73
+ key={index + "-" + input?.value}
74
+ inputId={input.id}
75
+ index={index}
48
76
  inputType={"textarea"}
49
- label={input?.name}
77
+ label={input?.name + (input.required ? "*" : "")}
50
78
  value={input?.value}
79
+ isRequired={input.required}
80
+ maxChar={input.max_chars}
51
81
  inputPlaceHolder={input?.placeholder}
82
+ updatedDescriptions={updatedDescriptions}
83
+ setUpdatedDescriptions={setUpdatedDescriptions}
84
+ articleId={articleId}
85
+ version={version}
86
+ dinamicHeight={dinamicHeight}
52
87
  />
53
88
  )
54
89
  )}
@@ -23,6 +23,9 @@ export const Container = styled.div`
23
23
  flex: 1 1 20%;
24
24
  margin-right: 10px;
25
25
  min-width: 227px;
26
+ display: flex;
27
+ flex-direction: column;
28
+ justify-content: space-between;
26
29
  }
27
30
  }
28
31
  }
@@ -5,17 +5,16 @@ import { ImageSelector } from "../../molecules/ImageSelector";
5
5
  import { useState, useEffect } from "react";
6
6
  import { ValidationPanel } from "../../atoms/ValidationPanel";
7
7
  import { Button } from "../../atoms/GeneralButton";
8
- import { getImage } from "../../../global-files/data";
9
8
 
10
9
  export const ProductImageModal = ({
11
10
  images = [],
12
11
  headerInfo,
13
12
  validation,
14
13
  setShowModal,
14
+ sendToFacilitator,
15
+ approveRejectButtons,
15
16
  }) => {
16
- const [activeImage, setActiveImage] = useState(
17
- getImage(images?.values[0], 710, 710)
18
- );
17
+ const [activeImage, setActiveImage] = useState(0);
19
18
  const [buttonType, setButtonType] = useState(
20
19
  validation ? validation : "null-button"
21
20
  );
@@ -42,18 +41,25 @@ export const ProductImageModal = ({
42
41
  <div className="modal-container">
43
42
  <div className="modal-image-container">
44
43
  <ProductImage
45
- img={activeImage.src}
46
- altText={activeImage?.name}
44
+ img={
45
+ "https://" +
46
+ process.env.REACT_APP_IMAGES_BUCKET +
47
+ ".s3.amazonaws.com/" +
48
+ images?.values[activeImage]?.srcDB
49
+ }
50
+ altText={images?.values[activeImage]?.name}
47
51
  imageType={"expanded-modal-image"}
48
52
  />
49
53
  </div>
50
54
  <div className="modal-data-container">
51
55
  <div className="validation-and-table-container">
52
56
  <div className="validation-panel">
53
- <Button
54
- buttonType={`circular-button ${buttonType}`}
55
- onClick={() => setShowValidationPanel(true)}
56
- />
57
+ {approveRejectButtons("images") && (
58
+ <Button
59
+ buttonType={`circular-button ${buttonType}`}
60
+ onClick={() => setShowValidationPanel(true)}
61
+ />
62
+ )}
57
63
  <Button
58
64
  buttonType={"close-button"}
59
65
  onClick={() => {
@@ -66,14 +72,16 @@ export const ProductImageModal = ({
66
72
  id="validation-panel"
67
73
  setOptionClicked={setButtonType}
68
74
  setShowValidationPanel={setShowValidationPanel}
75
+ sendToFacilitator={sendToFacilitator}
69
76
  />
70
77
  )}
71
78
  </div>
72
79
  <ImageDataTable
73
- imageData={activeImage.data}
80
+ imageData={images?.values[activeImage]?.data}
74
81
  headerInfo={headerInfo}
75
- activeImage={activeImage}
82
+ activeImage={images?.values[activeImage]}
76
83
  darkMode={true}
84
+ lists={images}
77
85
  />
78
86
  </div>
79
87
  <ImageSelector