contentoh-components-library 0.1.1 → 6.0.0

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 (185) hide show
  1. package/.env.development +16 -3
  2. package/.env.production +14 -1
  3. package/CHANGELOG.md +40 -0
  4. package/package.json +10 -4
  5. package/src/assets/images/arrow/arrowIcon.svg +3 -0
  6. package/src/assets/images/arrow/polygon.svg +3 -0
  7. package/src/assets/images/card/masterCardIcon.svg +5 -0
  8. package/src/assets/images/componentAssigned/assignedImage1.svg +9 -0
  9. package/src/assets/images/componentAssigned/assignedImage2.svg +9 -0
  10. package/src/assets/images/componentAssigned/clock.svg +4 -0
  11. package/src/assets/images/componentAssigned/flag.svg +3 -0
  12. package/src/assets/images/defaultImages/defaultUpdate.png +0 -0
  13. package/src/assets/images/editField/editField.svg +3 -0
  14. package/src/assets/images/generalButton/deleteIcon.svg +13 -0
  15. package/src/assets/images/generalButton/deleteIconHover.svg +13 -0
  16. package/src/assets/images/generalButton/saveIcon.svg +3 -0
  17. package/src/assets/images/generalButton/saveIconHover.svg +3 -0
  18. package/src/assets/images/generalImage/assigned.svg +14 -0
  19. package/src/assets/images/generalImage/bags.svg +25 -0
  20. package/src/assets/images/generalImage/clock.svg +4 -0
  21. package/src/assets/images/generalImage/flag.svg +3 -0
  22. package/src/assets/images/genericModal/genericModalCheck.svg +3 -0
  23. package/src/assets/images/genericModal/genericModalClose.svg +3 -0
  24. package/src/assets/images/genericModal/genericModalDown.svg +3 -0
  25. package/src/assets/images/genericModal/genericModalUp.svg +3 -0
  26. package/src/assets/images/genericModal/genericModalWarning.svg +12 -0
  27. package/src/assets/images/logo/logoLogin.svg +15 -0
  28. package/src/assets/images/menuNotification/menuNotificationComment.svg +3 -0
  29. package/src/assets/images/menuNotification/menuNotificationProduct.svg +3 -0
  30. package/src/assets/images/menuProfile/logOut.svg +3 -0
  31. package/src/assets/images/menuProfile/myAccount.svg +3 -0
  32. package/src/assets/images/menuProfile/settings.svg +3 -0
  33. package/src/assets/images/modalsSVGs/attributesSent.svg +208 -0
  34. package/src/assets/images/modalsSVGs/descriptionSent.svg +237 -0
  35. package/src/assets/images/modalsSVGs/providerSent.svg +445 -0
  36. package/src/assets/images/modalsSVGs/uploadingImages.svg +148 -0
  37. package/src/assets/images/productNotification/productNotification.svg +3 -0
  38. package/src/assets/images/profileHeader/profilePicture.svg +9 -0
  39. package/src/components/atoms/AsignationOption/index.js +6 -4
  40. package/src/components/atoms/AsignationOption/styles.js +3 -1
  41. package/src/components/atoms/AtomList/index.js +4 -2
  42. package/src/components/atoms/AtomList/styles.js +4 -2
  43. package/src/components/atoms/Avatar/index.js +2 -1
  44. package/src/components/atoms/Card/Card.stories.js +12 -0
  45. package/src/components/atoms/Card/index.js +9 -0
  46. package/src/components/atoms/Card/styles.js +8 -0
  47. package/src/components/atoms/CheckBox/index.js +1 -1
  48. package/src/components/atoms/Commentary/Commentary.stories.js +0 -0
  49. package/src/components/atoms/Commentary/index.js +9 -0
  50. package/src/components/atoms/Commentary/styles.js +15 -0
  51. package/src/components/atoms/CustomerTypeImage/index.js +1 -1
  52. package/src/components/atoms/EditField/EditField.stories.js +13 -0
  53. package/src/components/atoms/EditField/index.js +15 -0
  54. package/src/components/atoms/EditField/styles.js +35 -0
  55. package/src/components/atoms/GeneralButton/GeneralButton.stories.js +3 -0
  56. package/src/components/atoms/GeneralButton/index.js +7 -1
  57. package/src/components/atoms/GeneralButton/styles.js +56 -9
  58. package/src/components/atoms/GeneralInput/index.js +62 -9
  59. package/src/components/atoms/GeneralInput/styles.js +3 -1
  60. package/src/components/atoms/GeneralTextBox/index.js +7 -6
  61. package/src/components/atoms/GeneralTextBox/styles.js +1 -1
  62. package/src/components/atoms/GenericModal/GenericModal.stories.js +140 -0
  63. package/src/components/atoms/GenericModal/index.js +12 -0
  64. package/src/components/atoms/GenericModal/styles.js +126 -0
  65. package/src/components/atoms/GradientPanel/GradientPanel.stories.js +110 -3
  66. package/src/components/atoms/GradientPanel/index.js +4 -2
  67. package/src/components/atoms/GradientPanel/styles.js +111 -8
  68. package/src/components/atoms/Graphic/Graphic.stories.js +21 -0
  69. package/src/components/atoms/Graphic/index.js +18 -0
  70. package/src/components/atoms/Graphic/styles.js +4 -0
  71. package/src/components/atoms/Input/index.js +14 -0
  72. package/src/components/atoms/Input/style.js +27 -0
  73. package/src/components/atoms/LabelToInput/index.js +27 -0
  74. package/src/components/atoms/LabelToInput/style.js +30 -0
  75. package/src/components/atoms/LoadImageMenu/LoadImageMenu.stories.js +17 -0
  76. package/src/components/atoms/LoadImageMenu/index.js +58 -0
  77. package/src/components/atoms/LoadImageMenu/styles.js +72 -0
  78. package/src/components/atoms/LogoImage/LogoImage.stories.js +10 -0
  79. package/src/components/atoms/LogoImage/index.js +10 -0
  80. package/src/components/atoms/LogoImage/styles.js +12 -0
  81. package/src/components/atoms/MenuNotification/MenuNotification.stories.js +17 -0
  82. package/src/components/atoms/MenuNotification/index.js +30 -0
  83. package/src/components/atoms/MenuNotification/styles.js +50 -0
  84. package/src/components/atoms/MenuProfile/MenuProfile.stories.js +13 -0
  85. package/src/components/atoms/MenuProfile/index.js +31 -0
  86. package/src/components/atoms/MenuProfile/styles.js +57 -0
  87. package/src/components/atoms/Notification/Notification.stories.js +16 -0
  88. package/src/components/atoms/Notification/index.js +20 -0
  89. package/src/components/atoms/Notification/styles.js +42 -0
  90. package/src/components/atoms/Percent/Percent.stories.js +38 -0
  91. package/src/components/atoms/Percent/index.js +15 -0
  92. package/src/components/atoms/Percent/styles.js +79 -0
  93. package/src/components/atoms/PriorityFlag/index.js +1 -1
  94. package/src/components/atoms/ProductImage/styles.js +1 -1
  95. package/src/components/atoms/ProgressBar/index.js +2 -2
  96. package/src/components/atoms/ProgressBar/styles.js +53 -3
  97. package/src/components/atoms/ScreenHeader/ScreenHeader.stories.js +9 -0
  98. package/src/components/atoms/ScreenHeader/index.js +4 -1
  99. package/src/components/atoms/ScreenHeader/styles.js +17 -6
  100. package/src/components/atoms/Select/index.js +33 -0
  101. package/src/components/atoms/Select/style.js +77 -0
  102. package/src/components/atoms/StatusTag/styles.js +9 -1
  103. package/src/components/atoms/ValidationPanel/index.js +3 -3
  104. package/src/components/molecules/AddProvidersAndProducts/AddProvidersAndProducts.stories.js +16 -0
  105. package/src/components/molecules/AddProvidersAndProducts/index.js +19 -0
  106. package/src/components/molecules/AddProvidersAndProducts/styles.js +23 -0
  107. package/src/components/molecules/AssignedWork/AssignedWork.stories.js +41 -0
  108. package/src/components/molecules/AssignedWork/index.js +40 -0
  109. package/src/components/molecules/AssignedWork/styles.js +111 -0
  110. package/src/components/molecules/AvatarAndValidation/index.js +24 -6
  111. package/src/components/molecules/AvatarAndValidation/styles.js +1 -1
  112. package/src/components/molecules/EditionActiveImage/index.js +5 -2
  113. package/src/components/molecules/FeaturesBar/index.js +21 -8
  114. package/src/components/molecules/FeaturesBar/styles.js +9 -2
  115. package/src/components/molecules/GalleryElement/index.js +59 -37
  116. package/src/components/molecules/GalleryElement/styles.js +38 -11
  117. package/src/components/molecules/GalleryHeader/GalleryHeader.stories.js +10 -0
  118. package/src/components/molecules/GalleryHeader/index.js +19 -0
  119. package/src/components/molecules/GalleryHeader/styles.js +45 -0
  120. package/src/components/molecules/ImageSelector/index.js +14 -11
  121. package/src/components/molecules/ParentComponent/ParentComponent.stories.js +18 -0
  122. package/src/components/molecules/ParentComponent/index.js +66 -0
  123. package/src/components/molecules/ParentComponent/styles.js +7 -0
  124. package/src/components/molecules/PayMethod/PayMethod.stories.js +12 -0
  125. package/src/components/molecules/PayMethod/index.js +46 -0
  126. package/src/components/molecules/PayMethod/styles.js +31 -0
  127. package/src/components/molecules/PlanSelection/PlanSelection.stories.js +1 -3
  128. package/src/components/molecules/PlanSelection/index.js +1 -1
  129. package/src/components/molecules/PlanSelection/styles.js +2 -2
  130. package/src/components/molecules/ProductNameHeader/index.js +1 -2
  131. package/src/components/molecules/ProductNotification/ProductNotification.stories.js +13 -0
  132. package/src/components/molecules/ProductNotification/index.js +53 -0
  133. package/src/components/molecules/ProductNotification/styles.js +37 -0
  134. package/src/components/molecules/ProfileHeader/ProfileHeader.stories.js +16 -0
  135. package/src/components/molecules/ProfileHeader/index.js +54 -0
  136. package/src/components/molecules/ProfileHeader/styles.js +30 -0
  137. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +35 -0
  138. package/src/components/molecules/RetailerSelector/index.js +63 -0
  139. package/src/components/molecules/RetailerSelector/styles.js +18 -0
  140. package/src/components/molecules/SidebarNotification/SidebarNotification.stories.js +101 -0
  141. package/src/components/molecules/SidebarNotification/index.js +95 -0
  142. package/src/components/molecules/SidebarNotification/styles.js +63 -0
  143. package/src/components/molecules/StatusAsignationInfo/index.js +55 -19
  144. package/src/components/molecules/StatusAsignationInfo/styles.js +10 -0
  145. package/src/components/molecules/TableHeader/index.js +5 -2
  146. package/src/components/molecules/TabsMenu/index.js +6 -2
  147. package/src/components/molecules/TagAndInput/index.js +35 -2
  148. package/src/components/molecules/TagAndInput/styles.js +1 -1
  149. package/src/components/organisms/FullProductNameHeader/index.js +28 -7
  150. package/src/components/organisms/FullTabsMenu/index.js +13 -2
  151. package/src/components/organisms/FullTabsMenu/styles.js +1 -1
  152. package/src/components/organisms/Fullplan/FullPlan.stories.js +7 -9
  153. package/src/components/organisms/Fullplan/index.js +1 -1
  154. package/src/components/organisms/Fullplan/styles.js +2 -2
  155. package/src/components/organisms/ImageDataTable/index.js +77 -11
  156. package/src/components/organisms/ImageDataTable/styles.js +8 -0
  157. package/src/components/organisms/ImagePreviewer/index.js +5 -10
  158. package/src/components/organisms/InputGroup/index.js +56 -11
  159. package/src/components/organisms/InputGroup/styles.js +3 -0
  160. package/src/components/organisms/ProductImageModal/ProductImageModal.stories.js +77 -74
  161. package/src/components/organisms/ProductImageModal/index.js +29 -12
  162. package/src/components/organisms/ProductImageModal/styles.js +4 -0
  163. package/src/components/pages/CustomerLogin/CustomerLogin.stories.js +76 -0
  164. package/src/components/pages/CustomerLogin/index.js +22 -0
  165. package/src/components/pages/CustomerLogin/styles.js +12 -0
  166. package/src/components/pages/CustomerPayMethod/CustomerPayMethod.stories.js +56 -0
  167. package/src/components/pages/CustomerPayMethod/index.js +23 -0
  168. package/src/components/pages/CustomerPayMethod/styles.js +21 -0
  169. package/src/components/pages/CustomerType/CustomerType.stories.js +8 -8
  170. package/src/components/pages/CustomerType/styles.js +1 -1
  171. package/src/components/pages/OnboardPlan/OnboardPlan.stories.js +36 -21
  172. package/src/components/pages/OnboardPlan/index.js +8 -9
  173. package/src/components/pages/OnboardPlan/styles.js +16 -10
  174. package/src/components/pages/RetailerPlan/RetailerPlan.stories.js +49 -0
  175. package/src/components/pages/RetailerPlan/index.js +24 -0
  176. package/src/components/pages/RetailerPlan/styles.js +27 -0
  177. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +104 -317
  178. package/src/components/pages/RetailerProductEdition/index.js +809 -34
  179. package/src/components/pages/RetailerProductEdition/styles.js +54 -5
  180. package/src/global-files/data.js +152 -0
  181. package/src/global-files/global-styles.css +10 -0
  182. package/src/global-files/variables.js +1 -0
  183. package/src/components/molecules/TextAndGradient/TextAndGradient.stories.js +0 -23
  184. package/src/components/molecules/TextAndGradient/index.js +0 -23
  185. package/src/components/molecules/TextAndGradient/styles.js +0 -37
@@ -0,0 +1,63 @@
1
+ import { Container } from "./styles";
2
+ import { Avatar } from "../../atoms/Avatar";
3
+ import { useEffect, useState } from "react";
4
+ import { AsignationOption } from "../../atoms/AsignationOption";
5
+
6
+ export const RetailerSelector = ({
7
+ retailers,
8
+ activeRetailer,
9
+ setActiveRetailer,
10
+ }) => {
11
+ const [retailersPanel, setRetailersPanel] = useState(false);
12
+
13
+ const closeRetailersPanel = (e) => {
14
+ if (!e.target.closest("#retailers-assignation") && retailersPanel) {
15
+ document.removeEventListener("click", closeRetailersPanel, false);
16
+ setRetailersPanel(false);
17
+ }
18
+ };
19
+
20
+ useEffect(() => {
21
+ if (retailersPanel) {
22
+ document.addEventListener("click", closeRetailersPanel, false);
23
+ }
24
+ }, [retailersPanel]);
25
+
26
+ return (
27
+ <Container id="retailers-assignation">
28
+ <Avatar
29
+ image={activeRetailer?.image}
30
+ altText={activeRetailer?.name}
31
+ imageType={"medium-image"}
32
+ onClick={() => {
33
+ retailers.length > 1 && setRetailersPanel(!retailersPanel);
34
+ if (retailersPanel)
35
+ document.removeEventListener("click", closeRetailersPanel, false);
36
+ }}
37
+ />
38
+ {retailersPanel && (
39
+ <div className="retailers-panel">
40
+ {retailers.map((retailer, index) => (
41
+ <AsignationOption
42
+ key={`${index}-${retailer?.name}`}
43
+ profileImage={retailer?.image}
44
+ imageType={"medium-image"}
45
+ asignationType={null}
46
+ name={retailer?.name}
47
+ team={retailer?.team}
48
+ onClick={() => {
49
+ setActiveRetailer(retailer);
50
+ document.removeEventListener(
51
+ "click",
52
+ closeRetailersPanel,
53
+ false
54
+ );
55
+ setRetailersPanel(false);
56
+ }}
57
+ />
58
+ ))}
59
+ </div>
60
+ )}
61
+ </Container>
62
+ );
63
+ };
@@ -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
+ `;
@@ -0,0 +1,101 @@
1
+ import { SidebarNotification } from "./index";
2
+ import profileImg from "../../../assets/images/defaultImages/defaultProfileImage.svg";
3
+
4
+ export default {
5
+ title: "Components/molecules/SidebarNotification",
6
+ component: SidebarNotification,
7
+ argTypes: {
8
+ showSidebar: {
9
+ options: [true, false],
10
+ control: { type: "boolean" },
11
+ },
12
+ },
13
+ };
14
+ let showSidebar=false;
15
+ const setShowSidebar = (value) => {
16
+ showSidebar=value
17
+ }
18
+ const Template = (args) => <SidebarNotification {...args} />;
19
+ export const SidebarNotificationDefault = Template.bind({});
20
+
21
+ SidebarNotificationDefault.args = {
22
+ array: [
23
+ {
24
+ dates: "2/18/2022",
25
+ notifications: [
26
+ {
27
+ profilePicture: profileImg,
28
+ notification: "ODT 23441244",
29
+ newNotification: true,
30
+ },
31
+ {
32
+ profilePicture: profileImg,
33
+ notification: "ODT 23441244",
34
+ newNotification: true,
35
+ },
36
+ ],
37
+ },
38
+ {
39
+ dates: "2/17/2022",
40
+ notifications: [
41
+ {
42
+ profilePicture: profileImg,
43
+ notification: "ODT 23441244",
44
+ newNotification: true,
45
+ },
46
+ {
47
+ profilePicture: profileImg,
48
+ notification: "ODT 23441244",
49
+ newNotification: true,
50
+ },
51
+ ],
52
+ },
53
+ {
54
+ dates: "2/16/2022",
55
+ notifications: [
56
+ {
57
+ profilePicture: profileImg,
58
+ notification: "ODT 23441244",
59
+ newNotification: true,
60
+ },
61
+ {
62
+ profilePicture: profileImg,
63
+ notification: "ODT 23441244",
64
+ newNotification: true,
65
+ },
66
+ ],
67
+ },
68
+ {
69
+ dates: "2/14/2022",
70
+ notifications: [
71
+ {
72
+ profilePicture: profileImg,
73
+ notification: "ODT 23441244",
74
+ newNotification: true,
75
+ },
76
+ {
77
+ profilePicture: profileImg,
78
+ notification: "ODT 23441244",
79
+ newNotification: true,
80
+ },
81
+ ],
82
+ },
83
+ {
84
+ dates: "2/17/2022",
85
+ notifications: [
86
+ {
87
+ profilePicture: profileImg,
88
+ notification: "ODT 23441244",
89
+ newNotification: true,
90
+ },
91
+ {
92
+ profilePicture: profileImg,
93
+ notification: "ODT 23441244",
94
+ newNotification: true,
95
+ },
96
+ ],
97
+ },
98
+ ],
99
+ setShowSidebar:setShowSidebar,
100
+ showSidebar:showSidebar,
101
+ };
@@ -0,0 +1,95 @@
1
+ import { Container } from "./styles";
2
+ import { ScreenHeader } from "../../atoms/ScreenHeader/index";
3
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
4
+ import { Avatar } from "../../atoms/Avatar/index";
5
+ import notificationImg from "../../../assets/images/productNotification/productNotification.svg";
6
+ import { Button } from "../../atoms/GeneralButton";
7
+ import { Notification } from "../../atoms/Notification";
8
+ import { useEffect, useRef } from "react";
9
+
10
+ export const SidebarNotification = ({
11
+ array = [],
12
+ showSidebar,
13
+ setShowSidebar,
14
+ }) => {
15
+ const sidebar = useRef(null);
16
+
17
+ const closeSidebar = (e) => {
18
+ if (!e.target.closest("#side-bar") && showSidebar) {
19
+ document.removeEventListener("click", closeSidebar, false);
20
+ sidebar.current.classList.remove("active");
21
+ setTimeout(() => {
22
+ setShowSidebar(false);
23
+ }, 500);
24
+ }
25
+ };
26
+
27
+ useEffect(() => {
28
+ if (showSidebar) {
29
+ document.addEventListener("click", closeSidebar, false);
30
+ sidebar.current.classList.add("active");
31
+ }
32
+ }, [showSidebar]);
33
+
34
+ const comparisonDate = (dates) => {
35
+ const dateActual = new Date();
36
+ const dateComparison = new Date(dates);
37
+ let date = "";
38
+ if (dateActual.toDateString() === dateComparison.toDateString()) {
39
+ date = "Hoy";
40
+ } else if (
41
+ dateActual.getFullYear() === dateComparison.getFullYear() &&
42
+ dateActual.getMonth() === dateComparison.getMonth() &&
43
+ dateActual.getDate() - 1 === dateComparison.getDate()
44
+ ) {
45
+ date = "Ayer";
46
+ } else {
47
+ date = dateComparison.toLocaleDateString();
48
+ }
49
+ return date;
50
+ };
51
+ return (
52
+ <>
53
+ {showSidebar && (
54
+ <Container id="side-bar" ref={sidebar}>
55
+ <div className="notification-header">
56
+ <Avatar
57
+ image={notificationImg}
58
+ imageType={"retailer-image"}
59
+ altText={"Notification Picture"}
60
+ />
61
+ <ScreenHeader
62
+ headerType={"product-name-header"}
63
+ text={"Notificaciones"}
64
+ color={"#867586"}
65
+ />
66
+ <Button buttonType="close-button" />
67
+ </div>
68
+ <div className="scroll">
69
+ {array?.map((element, index) => (
70
+ <div
71
+ className="date-notification"
72
+ key={index + "-" + element?.dates}
73
+ >
74
+ <ScreenHeader
75
+ headerType={"input-name-header"}
76
+ text={comparisonDate(element?.dates)}
77
+ color={"#6A5880"}
78
+ FontFamily={FontFamily.AvenirNext}
79
+ />
80
+ {element?.notifications?.map((notification, index) => (
81
+ <Notification
82
+ key={index}
83
+ profilePicture={notification?.profilePicture}
84
+ notification={notification?.notification}
85
+ newNotification={notification?.newNotification}
86
+ />
87
+ ))}
88
+ </div>
89
+ ))}
90
+ </div>
91
+ </Container>
92
+ )}{" "}
93
+ </>
94
+ );
95
+ };
@@ -0,0 +1,63 @@
1
+ import styled from "styled-components";
2
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ position: absolute;
6
+ right: 0;
7
+ background-color: #f9f9fc;
8
+ overflow: hidden;
9
+ width: 380px;
10
+ height: 100vh;
11
+ padding: 10px;
12
+ border: none;
13
+ box-shadow: -3px 0px 4px rgba(0, 0, 0, 0.25);
14
+ right: -100%;
15
+ transition: right linear 1s;
16
+ &.active {
17
+ right: 0;
18
+ }
19
+ /*
20
+ clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%);
21
+ transition: clip-path linear 1s;
22
+ &.active {
23
+ clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
24
+ } */
25
+ .notification-header {
26
+ display: flex;
27
+ justify-content: space-between;
28
+ .retailer-image {
29
+ margin-left: 10px;
30
+ }
31
+ .product-name-header {
32
+ text-align: left;
33
+ flex: 1;
34
+ line-height: 50px;
35
+ margin-left: 13px;
36
+ }
37
+ .close-button {
38
+ height: 23px;
39
+ width: 23px;
40
+ padding: 3px;
41
+ border: 1px solid #ededed;
42
+ border-radius: 3px;
43
+ background-size: 23px;
44
+ }
45
+ }
46
+ .scroll {
47
+ overflow: auto;
48
+ height: 85vh;
49
+ .date-notification {
50
+ margin-top: 10px;
51
+ .input-name-header {
52
+ font-weight: 600;
53
+ display: flex;
54
+ justify-content: flex-end;
55
+ margin-right: 25px;
56
+ }
57
+ .new-notification {
58
+ margin-top: 7px;
59
+ width: 100%;
60
+ }
61
+ }
62
+ }
63
+ `;
@@ -5,14 +5,20 @@ 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
14
  asignationsList,
15
15
  percent = 0,
16
+ activeTab,
17
+ deleteImages,
18
+ saveDatasheets,
19
+ saveDescriptions,
20
+ updateImages,
21
+ assignationsImages,
16
22
  id = "default-id",
17
23
  }) => {
18
24
  const [showAsignationPanel, setShowAsignationPanel] = useState(false);
@@ -32,27 +38,57 @@ export const StatusAsignationInfo = ({
32
38
  }, [showAsignationPanel]);
33
39
 
34
40
  return (
35
- <Container
36
- onClick={() => {
37
- setShowAsignationPanel(true);
38
- }}
39
- id={id}
40
- >
41
+ <Container id={id}>
42
+ <Button
43
+ buttonType={"circular-button save-button"}
44
+ onClick={() => {
45
+ switch (activeTab) {
46
+ case "Descripción":
47
+ saveDescriptions && saveDescriptions();
48
+ break;
49
+ case "Ficha técnica":
50
+ saveDatasheets && saveDatasheets();
51
+ break;
52
+ case "Imágenes":
53
+ updateImages && updateImages();
54
+ break;
55
+
56
+ default:
57
+ break;
58
+ }
59
+ }}
60
+ />
41
61
  {imagesSection && (
42
- <Button
43
- buttonType={layout ? "grid-layout" : "row-layout"}
44
- onClick={() => {
45
- setLayout(!layout);
46
- setImageLayout(!layout);
47
- }}
48
- />
62
+ <div className="images-buttons">
63
+ <Button
64
+ buttonType={"circular-button delete-button"}
65
+ onClick={() => {
66
+ deleteImages && deleteImages();
67
+ }}
68
+ />
69
+ <Button
70
+ buttonType={layout ? "grid-layout" : "row-layout"}
71
+ onClick={() => {
72
+ setLayout(!layout);
73
+ setImageLayout && setImageLayout(!layout);
74
+ }}
75
+ />
76
+ </div>
49
77
  )}
50
78
  <StatusTag statusType={status} ovalForm={true} />
51
- <Avatar
52
- imageType={"small-image"}
53
- image={src}
54
- altText="user profile image"
55
- />
79
+ <div className="assignations-container">
80
+ {assignationsImages?.map((assignation, index) => (
81
+ <Avatar
82
+ key={index + "-" + assignation}
83
+ imageType={"small-image"}
84
+ image={getProfilePicture(assignation, 20, 20)}
85
+ altText="user profile image"
86
+ onClick={() => {
87
+ setShowAsignationPanel(true);
88
+ }}
89
+ />
90
+ ))}
91
+ </div>
56
92
  <ScreenHeader
57
93
  text={"Asig."}
58
94
  color={"#969696"}
@@ -10,6 +10,16 @@ export const Container = styled.div`
10
10
  margin-left: 8px;
11
11
  }
12
12
 
13
+ .images-buttons {
14
+ button + * {
15
+ margin-left: 8px;
16
+ }
17
+ }
18
+
19
+ .assignations-container {
20
+ display: flex;
21
+ }
22
+
13
23
  .asignation-panel {
14
24
  background: ${GlobalColors.s2};
15
25
  border: 1px solid ${GlobalColors.s3};
@@ -3,7 +3,7 @@ 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 = ({ imagesStatus, activeImage, assignationsImages }) => {
7
7
  return (
8
8
  <Container>
9
9
  <ScreenHeader
@@ -11,7 +11,10 @@ export const TableHeader = ({ headerInfo, activeImage }) => {
11
11
  color={GlobalColors.s5}
12
12
  headerType={"input-name-header"}
13
13
  />
14
- <StatusAsignationInfo status={headerInfo?.status} src={headerInfo?.src} />
14
+ <StatusAsignationInfo
15
+ status={imagesStatus}
16
+ assignationsImages={assignationsImages}
17
+ />
15
18
  </Container>
16
19
  );
17
20
  };
@@ -2,10 +2,14 @@ import { Container } from "./styles";
2
2
  import { TabSection } from "../../atoms/TabSection";
3
3
  import { useEffect, useState } from "react";
4
4
 
5
- export const TabsMenu = ({ tabsSections, setImagesSection, setActiveTab }) => {
5
+ export const TabsMenu = ({
6
+ tabsSections = {},
7
+ setImagesSection,
8
+ setActiveTab,
9
+ }) => {
6
10
  const [sections, setSections] = useState(tabsSections);
7
11
 
8
- const activeSection = (key, array) => {
12
+ const activeSection = (key, array = {}) => {
9
13
  let tempArray = {};
10
14
  setImagesSection(key === "Imágenes");
11
15
  Object.keys(array).forEach((section) => {
@@ -2,14 +2,47 @@ import { Container } from "./styles";
2
2
  import { ScreenHeader } from "../../atoms/ScreenHeader/index";
3
3
  import { GeneralInput } from "../../atoms/GeneralInput/index";
4
4
 
5
- export const TagAndInput = ({ inputType, label, value, inputPlaceHolder }) => {
5
+ export const TagAndInput = ({
6
+ inputType,
7
+ label,
8
+ value,
9
+ inputPlaceHolder,
10
+ inputId,
11
+ updatedDescriptions,
12
+ setUpdatedDescriptions,
13
+ updatedDatasheets,
14
+ setUpdatedDatasheets,
15
+ articleId,
16
+ version,
17
+ index,
18
+ isRequired,
19
+ dinamicHeight,
20
+ inputCols,
21
+ inputRows,
22
+ }) => {
6
23
  return (
7
- <Container inputType={inputType} className={"input-container"}>
24
+ <Container
25
+ inputType={inputType}
26
+ className={"input-container"}
27
+ key={`generalTagInput-${inputType}`}
28
+ >
8
29
  <ScreenHeader text={label} headerType={"input-name-header"} />
9
30
  <GeneralInput
31
+ inputId={inputId}
10
32
  inputType={inputType}
11
33
  inputValue={value}
34
+ index={index}
35
+ isRequired={isRequired}
12
36
  inputPlaceholder={inputPlaceHolder}
37
+ updatedDescriptions={updatedDescriptions}
38
+ setUpdatedDescriptions={setUpdatedDescriptions}
39
+ updatedDatasheets={updatedDatasheets}
40
+ setUpdatedDatasheets={setUpdatedDatasheets}
41
+ articleId={articleId}
42
+ version={version}
43
+ dinamicHeight={dinamicHeight}
44
+ inputCols={inputCols}
45
+ inputRows={inputRows}
13
46
  />
14
47
  </Container>
15
48
  );
@@ -3,7 +3,7 @@ import styled from "styled-components";
3
3
  export const Container = styled.div`
4
4
  & > :first-child {
5
5
  & + * {
6
- margin-top: ${({ inputType }) => (inputType === "text" ? 4 : 15)}px;
6
+ margin-top: ${({ inputType }) => (inputType !== "textarea" ? 4 : 15)}px;
7
7
  }
8
8
  }
9
9
  `;
@@ -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}
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,12 +5,18 @@ import { useState } from "react";
5
5
 
6
6
  export const FullTabsMenu = ({
7
7
  tabsSections,
8
- status,
8
+ status = "",
9
9
  profileImage,
10
+ activeTab,
10
11
  setActiveTab,
11
12
  setImageLayout,
13
+ saveDatasheets,
14
+ saveDescriptions,
15
+ updateImages,
16
+ assignations,
12
17
  }) => {
13
18
  const [imagesSection, setImagesSection] = useState(false);
19
+ //console.log(status);
14
20
 
15
21
  return (
16
22
  <Container>
@@ -20,10 +26,15 @@ export const FullTabsMenu = ({
20
26
  setActiveTab={setActiveTab}
21
27
  />
22
28
  <StatusAsignationInfo
23
- status={status}
29
+ status={status[activeTab]}
30
+ activeTab={activeTab}
24
31
  image={profileImage}
25
32
  setImageLayout={setImageLayout}
26
33
  imagesSection={imagesSection}
34
+ saveDatasheets={saveDatasheets}
35
+ saveDescriptions={saveDescriptions}
36
+ updateImages={updateImages}
37
+ assignationsImages={assignations[activeTab]}
27
38
  />
28
39
  </Container>
29
40
  );
@@ -5,6 +5,6 @@ export const Container = styled.div`
5
5
  justify-content: space-between;
6
6
 
7
7
  & + * {
8
- margin-top: 15px;
8
+ margin-top: 14px;
9
9
  }
10
10
  `;
@@ -12,12 +12,10 @@ FullPlanDefault.args = {
12
12
  title: "Elige el número de proveedores",
13
13
  textGeneral:
14
14
  "Bienvido a nuestra plataforma de cadena, para continuar elige el número de proveedores que tiene tu cadena",
15
- containerData: {
16
- planSelection: [
17
- { number: "300", name: "Proveedores" },
18
- { number: "1500", name: "Proveedores" },
19
- { number: "+3000", name: "Proveedores" },
20
- { number: "Ondemand", name: "agrega proveedores a tu forma" },
21
- ],
22
- },
23
- };
15
+ containerData: [
16
+ { number: "300", name: "Proveedores" },
17
+ { number: "1500", name: "Proveedores" },
18
+ { number: "+3000", name: "Proveedores" },
19
+ { number: "Ondemand", name: "agrega proveedores a tu forma" },
20
+ ],
21
+ };
@@ -20,7 +20,7 @@ export const FullPlan = ({ title, textGeneral, containerData }) => {
20
20
  <p>{textGeneral}</p>
21
21
  </div>
22
22
  <PlanSelection
23
- planSelection={containerData.planSelection}
23
+ planSelection={containerData}
24
24
  setbuttonActive={setbuttonActive}
25
25
  />
26
26
  <Button