contentoh-components-library 21.3.13 → 21.3.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 (154) hide show
  1. package/.env.development +5 -0
  2. package/dist/assets/fonts/{roboto → Roboto}/LICENSE.txt +0 -0
  3. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Black.ttf +0 -0
  4. package/dist/assets/fonts/{roboto → Roboto}/Roboto-BlackItalic.ttf +0 -0
  5. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Bold.ttf +0 -0
  6. package/dist/assets/fonts/{roboto → Roboto}/Roboto-BoldItalic.ttf +0 -0
  7. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Italic.ttf +0 -0
  8. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Light.ttf +0 -0
  9. package/dist/assets/fonts/{roboto → Roboto}/Roboto-LightItalic.ttf +0 -0
  10. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Medium.ttf +0 -0
  11. package/dist/assets/fonts/{roboto → Roboto}/Roboto-MediumItalic.ttf +0 -0
  12. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Regular.ttf +0 -0
  13. package/dist/assets/fonts/{roboto → Roboto}/Roboto-Thin.ttf +0 -0
  14. package/dist/assets/fonts/{roboto → Roboto}/Roboto-ThinItalic.ttf +0 -0
  15. package/dist/assets/images/chatPopup/Spinner.gif +0 -0
  16. package/dist/assets/images/chatPopup/close.svg +3 -0
  17. package/dist/assets/images/chatPopup/defaultImage.png +0 -0
  18. package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
  19. package/dist/assets/images/chatPopup/doc.svg +1 -0
  20. package/dist/assets/images/chatPopup/document.svg +1 -0
  21. package/dist/assets/images/chatPopup/iconChat.svg +19 -0
  22. package/dist/assets/images/chatPopup/iconPlus.svg +3 -0
  23. package/dist/assets/images/chatPopup/pdf.svg +75 -0
  24. package/dist/assets/images/chatPopup/remove.svg +4 -0
  25. package/dist/assets/images/chatPopup/send.svg +3 -0
  26. package/dist/assets/images/chatPopup/svgIcon.svg +109 -0
  27. package/dist/assets/images/chatPopup/upload_file.svg +3 -0
  28. package/dist/assets/images/chatPopup/xls.svg +53 -0
  29. package/dist/assets/images/generalButton/closeIcon.svg +2 -2
  30. package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +28 -0
  31. package/dist/components/atoms/ChatPopUp/index.js +841 -0
  32. package/dist/components/atoms/ChatPopUp/styles.js +27 -0
  33. package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +182 -0
  34. package/dist/components/atoms/ProgressBar/index.js +36 -6
  35. package/dist/components/atoms/ProgressBar/styles.js +11 -3
  36. package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
  37. package/dist/components/atoms/StatusTag/index.js +58 -0
  38. package/dist/components/atoms/StatusTag/styles.js +20 -0
  39. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
  40. package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
  41. package/dist/components/molecules/HeaderTop/index.js +23 -6
  42. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  43. package/dist/components/molecules/ProductNameHeader/index.js +6 -4
  44. package/dist/components/organisms/FullProductNameHeader/index.js +1 -0
  45. package/dist/components/organisms/RangeCalendar/index.js +4 -3
  46. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +65 -50
  47. package/dist/components/pages/ProviderProductEdition/index.js +15 -11
  48. package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
  49. package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
  50. package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
  51. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +60 -86
  52. package/dist/components/pages/RetailerProductEdition/index.js +13 -12
  53. package/dist/global-files/fonts.css +6 -0
  54. package/dist/global-files/utils.js +22 -2
  55. package/dist/global-files/variables.js +2 -0
  56. package/dist/index.js +267 -46
  57. package/package.json +12 -1
  58. package/src/assets/images/customSelect/starIcon.svg +14 -0
  59. package/src/assets/images/defaultImages/Spinner.gif +0 -0
  60. package/src/assets/images/defaultImages/notFound.svg +124 -0
  61. package/src/assets/images/generalButton/closeIcon.svg +2 -2
  62. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
  63. package/src/components/atoms/ButtonFileChooser/index.js +68 -0
  64. package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
  65. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +53 -0
  66. package/src/components/atoms/ButtonV2/index.js +85 -0
  67. package/src/components/atoms/ButtonV2/styles.js +217 -0
  68. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
  69. package/src/components/atoms/CustomIcon/index.js +41 -0
  70. package/src/components/atoms/CustomIcon/styles.js +85 -0
  71. package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
  72. package/src/components/atoms/IconFile/index.js +119 -0
  73. package/src/components/atoms/IconFile/styles.js +67 -0
  74. package/src/components/atoms/Image/Image.stories.js +51 -0
  75. package/src/components/atoms/Image/index.js +55 -0
  76. package/src/components/atoms/Image/styles.js +34 -0
  77. package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
  78. package/src/components/atoms/ImageLink/index.js +57 -0
  79. package/src/components/atoms/ImageLink/styles.js +30 -0
  80. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
  81. package/src/components/atoms/ImagePreview/index.js +178 -0
  82. package/src/components/atoms/ImagePreview/styles.js +77 -0
  83. package/src/components/atoms/InputText/InputText.stories.js +39 -0
  84. package/src/components/atoms/InputText/index.js +61 -0
  85. package/src/components/atoms/InputText/styles.js +89 -0
  86. package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
  87. package/src/components/atoms/NotFound/index.js +52 -0
  88. package/src/components/atoms/NotFound/styles.js +55 -0
  89. package/src/components/atoms/ProgressBar/index.js +40 -5
  90. package/src/components/atoms/ProgressBar/styles.js +24 -0
  91. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
  92. package/src/components/atoms/SelectItemV2/index.js +61 -0
  93. package/src/components/atoms/SelectItemV2/styles.js +90 -0
  94. package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
  95. package/src/components/atoms/Tooltip/index.js +59 -0
  96. package/src/components/atoms/Tooltip/styles.js +42 -0
  97. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
  98. package/src/components/molecules/ButtonDownloadFile/index.js +109 -0
  99. package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
  100. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
  101. package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
  102. package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -0
  103. package/src/components/molecules/Dropdown/index.js +150 -0
  104. package/src/components/molecules/Dropdown/styles.js +75 -0
  105. package/src/components/molecules/HeaderTop/index.js +29 -8
  106. package/src/components/molecules/HeaderTop/styles.js +4 -0
  107. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -0
  108. package/src/components/molecules/ImageTooltip/index.js +63 -0
  109. package/src/components/molecules/ImageTooltip/styles.js +18 -0
  110. package/src/components/molecules/ProductNameHeader/index.js +7 -2
  111. package/src/components/molecules/SelectV2/SelectV2.stories.js +115 -0
  112. package/src/components/molecules/SelectV2/index.js +357 -0
  113. package/src/components/molecules/SelectV2/styles.js +105 -0
  114. package/src/components/molecules/SelectV2/test.js +61 -0
  115. package/src/components/molecules/SelectV2/test.stories.js +10 -0
  116. package/src/components/organisms/Chat/Chat.stories.js +147 -0
  117. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
  118. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  119. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  120. package/src/components/organisms/Chat/ChatLists/index.js +141 -0
  121. package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
  122. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
  123. package/src/components/organisms/Chat/ContainerItems/index.js +512 -0
  124. package/src/components/organisms/Chat/ContainerItems/styles.js +328 -0
  125. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
  126. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  127. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  128. package/src/components/organisms/Chat/ContentChat/index.js +897 -0
  129. package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
  130. package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
  131. package/src/components/organisms/Chat/Footer/index.js +661 -0
  132. package/src/components/organisms/Chat/Footer/styles.js +286 -0
  133. package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
  134. package/src/components/organisms/Chat/Header/index.js +94 -0
  135. package/src/components/organisms/Chat/Header/styles.js +49 -0
  136. package/src/components/organisms/Chat/index.js +235 -0
  137. package/src/components/organisms/Chat/styles.js +42 -0
  138. package/src/components/organisms/FullProductNameHeader/index.js +1 -0
  139. package/src/components/organisms/Modal/Modal.stories.js +55 -0
  140. package/src/components/organisms/Modal/index.js +97 -0
  141. package/src/components/organisms/Modal/styles.js +103 -0
  142. package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +16 -0
  143. package/src/components/organisms/RangeCalendar/index.js +121 -0
  144. package/src/components/organisms/RangeCalendar/styles.js +883 -0
  145. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +67 -49
  146. package/src/components/pages/ProviderProductEdition/index.js +16 -7
  147. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +62 -85
  148. package/src/components/pages/RetailerProductEdition/index.js +12 -10
  149. package/src/global-files/fonts.css +6 -0
  150. package/src/global-files/handle_http.js +225 -0
  151. package/src/global-files/handle_userTech.js +7 -0
  152. package/src/global-files/utils.js +330 -0
  153. package/src/global-files/variables.js +2 -0
  154. package/src/index.js +17 -0
@@ -16,74 +16,76 @@ ProviderPro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JpYXQiOjE2NzQ1OTk4MDYsImVtYWlsIjoibWVyY2hhbnRzMjRlbmVAYWxsZnJlZW1haWwubmV0In0.osGY8Rdr20hTwL86dZ_CzXxHLvPe-L0iaLtWVwJ78prdMlbDoEZWNePr-Di1rb8F2efV6FAsf9mELW6Tw3PETo_d5yeDEPVAGD0pXFvVntTlSrJGtfEDMnpNWTG2uaMlL1_zJ8BcFYmIUniZN8VvEKW6ezFOt01cK3We-Vrv92TqKa-ePQRkDnhKu52nnTgxs5aysGf-mYLxLumQ4TcOPXJ2x6OsszedJaujFDeCPN7JVGbg9HC68__WklpgocSasU6fQg4Glh1kXWQ-fy4XaFw6cBParJjkqic2Gg1iqwB5wGbrwD4E0crZyPkgwwPydTLLu6WguGWBuQHhcoG-xg",
20
20
  articleId: 238,
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- id_article: 3,
25
- id_category: 2032,
26
- name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
27
- upc: "161157",
28
- timestamp: "2022-11-14T16:02:47.000Z",
29
- categoryName: "Decoración|Cortinas y Persianas|Cortinas",
24
+ category: "Decoración|Accesorios Decorativos|Accesorios Decorativos",
25
+ company_name: "merchants24ene@allfreemail.net",
26
+ company_id: 918,
27
+ id_category: "2028",
28
+ id_article: 432,
29
+ name: "VELA AROMA 18 OZ MAN/CAN",
30
+ upc: "102852",
30
31
  version: 1,
31
32
  retailersAvailable: [
32
33
  {
33
- name: "The Home Depot Golden",
34
- id: 58,
34
+ id: 68,
35
+ name: "The Home Depot Merchants",
35
36
  },
36
37
  ],
37
38
  },
38
39
  productToEdit: {
39
- idCategory: 2032,
40
- ArticleId: 3,
40
+ idCategory: "2028",
41
+ ArticleId: 432,
41
42
  product: [
42
43
  {
43
- id_article: 3,
44
- id_category: 2032,
45
- name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
46
- upc: "161157",
47
- timestamp: "2022-11-14T16:02:47.000Z",
48
- categoryName: "Decoración|Cortinas y Persianas|Cortinas",
44
+ category: "Decoración|Accesorios Decorativos|Accesorios Decorativos",
45
+ company_name: "merchants24ene@allfreemail.net",
46
+ company_id: 918,
47
+ id_category: "2028",
48
+ id_article: 432,
49
+ name: "VELA AROMA 18 OZ MAN/CAN",
50
+ upc: "102852",
49
51
  version: 1,
50
52
  retailersAvailable: [
51
53
  {
52
- name: "The Home Depot Golden",
53
- id: 58,
54
+ id: 68,
55
+ name: "The Home Depot Merchants",
54
56
  },
55
57
  ],
56
58
  },
57
59
  ],
58
60
  },
59
61
  location: {
60
- state: { origin: "Contentoh" },
62
+ state: { origin: "Contentoh", withChat: true },
61
63
  },
62
64
  user: {
63
- id_user: 28,
64
- name: "Ismael",
65
- last_name: "López",
66
- email: "ilopez@contentoh.com",
67
- position: "Test States",
68
- telephone: "+523111366336",
65
+ id_user: 140,
66
+ name: "Prueba",
67
+ last_name: "Merchants",
68
+ email: "merchants24ene@allfreemail.net",
69
+ position: "merchants24ene@allfreemail.net",
70
+ telephone: "+521234567891",
69
71
  country: "México",
70
- id_company: 1,
71
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
72
+ id_company: 918,
73
+ id_cognito: "03eb26a0-ab56-4767-b64f-84925807702a",
72
74
  birth_Date: null,
73
- about_me: "",
74
- zip_code: "",
75
- address: "",
76
- job: "",
77
- id_stripe: "cus_KuEt6R6vwmN09f",
75
+ about_me: null,
76
+ zip_code: null,
77
+ address: null,
78
+ job: null,
79
+ id_stripe: null,
78
80
  id_role: 0,
79
81
  active: 1,
80
82
  is_retailer: 0,
81
- email_notify: 0,
82
- is_user_tech: "AS",
83
+ email_notify: 1,
84
+ is_user_tech: null,
83
85
  membership: {
84
- id: 76,
85
- start_date: "2022-01-18T17:25:35.000Z",
86
- end_date: "2023-01-18T17:25:35.000Z",
86
+ id: 109,
87
+ start_date: "2023-01-24T22:07:34.000Z",
88
+ end_date: "2024-01-24T22:07:34.000Z",
87
89
  planID: 8,
88
90
  plan: "prod_KtlhECVSFG2iro",
89
91
  name: "Plan Pro",
@@ -91,21 +93,37 @@ ProviderProductEditionDefault.args = {
91
93
  products_limit: "5000",
92
94
  type: "Enterprise",
93
95
  },
94
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1669927021851",
96
+ src: "https://content-management-profile.s3.amazonaws.com/id-140/140.png?1674599807427",
95
97
  },
96
98
  company: {
97
- id_company: 1,
98
- trade_name: "GRUPO BRAHMA",
99
- company_name: "GRUPO BRAHMA",
100
- rfc: "XAXX010101000",
101
- adress: "AA",
102
- about_company: "",
103
- telephone: "",
104
- web_site: "",
105
- zip_code: "",
99
+ id_company: 918,
100
+ trade_name: "merchants24ene@allfreemail.net",
101
+ company_name: "merchants24ene@allfreemail.net",
102
+ rfc: "merchants24ene@allfreemail.net",
103
+ adress: "merchants24ene@allfreemail.net",
104
+ about_company: null,
105
+ telephone: null,
106
+ web_site: null,
107
+ zip_code: null,
106
108
  email: null,
107
- social_link: "",
109
+ social_link: null,
108
110
  is_retailer: 0,
111
+ financedRetailers: [
112
+ {
113
+ id: 68,
114
+ name: "The Home Depot Merchants",
115
+ country: "México",
116
+ id_region: 1,
117
+ active: 1,
118
+ },
119
+ ],
120
+ retailers: [
121
+ {
122
+ id: null,
123
+ name: null,
124
+ country: null,
125
+ },
126
+ ],
109
127
  },
110
128
  showSurvey: (v) => v && alert("se muestra"),
111
129
  };
@@ -42,6 +42,7 @@ import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
42
42
  import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
43
43
  import { VersionSelector } from "../../organisms/VersionSelector";
44
44
  import { useCloseModal } from "../../../global-files/customHooks";
45
+ import { number } from "prop-types";
45
46
 
46
47
  const reducerImages = (state, action) => {
47
48
  let { values, attrForImgs, inputsByRetailer } = state;
@@ -133,6 +134,7 @@ export const ProviderProductEdition = ({
133
134
  setShowContentohRequestModal,
134
135
  showSurvey,
135
136
  company,
137
+ withChat,
136
138
  }) => {
137
139
  const [activeTab, setActiveTab] = useState("Descripción");
138
140
  const [activeImage, setActiveImage] = useState();
@@ -273,7 +275,7 @@ export const ProviderProductEdition = ({
273
275
  setImages({ action: "init", init: services[2] });
274
276
  if (services[2]?.values?.length > 0) setActiveImage(0);
275
277
 
276
- getPercentage({ data: [product] }).then((res) => setPercentages(res));
278
+ getPercentage({ data: [product] }).then((res) => setPercentages(res[0]));
277
279
  setLoading(false);
278
280
  };
279
281
 
@@ -363,11 +365,13 @@ export const ProviderProductEdition = ({
363
365
  useEffect(() => {
364
366
  const productTemp = product;
365
367
  const retailers = productTemp?.retailersAvailable || productTemp?.retailers;
366
- retailers?.forEach((retailer) => {
367
- retailer["percentage"] = percentages?.find(
368
- (percent) => retailer?.id === percent?.id_retailer
369
- )?.percentage;
370
- });
368
+ if (Object.keys(percentages?.retailers ?? {})?.length > 0) {
369
+ retailers?.forEach((retailer) => {
370
+ retailer["percentage"] = Number(
371
+ percentages?.retailers[retailer.id].percentageRequired
372
+ );
373
+ });
374
+ }
371
375
 
372
376
  setProduct(productTemp);
373
377
  setActivePercentage(retailers[0]?.percentage);
@@ -1056,7 +1060,12 @@ export const ProviderProductEdition = ({
1056
1060
  ];
1057
1061
  return (
1058
1062
  <Container headerTop={headerTop}>
1059
- <HeaderTop setHeaderTop={setHeaderTop} />
1063
+ <HeaderTop
1064
+ setHeaderTop={setHeaderTop}
1065
+ withChat={location?.state?.withChat}
1066
+ productSelected={productSelected}
1067
+ token={token}
1068
+ />
1060
1069
  <div className="data-container">
1061
1070
  <div className="image-data-panel">
1062
1071
  <ImagePreviewer
@@ -12,120 +12,97 @@ export const RetailerProductEditionDefault = Template.bind({});
12
12
  RetailerProductEditionDefault.args = {
13
13
  tabsSections: {
14
14
  Descripción: true,
15
- "Ficha técnica": false,
16
- Imágenes: false,
15
+ "Ficha técnica": true,
16
+ Imágenes: true,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQU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YYE0Dh1AfUK_K0mrk2_78_rhTNxCQT85W7XS3ZEcxIOUekqoxaKFl8LSVN_eWz3SlsGG0yRflhJGt6d4gBVByXZbdNiyp1rkjgMln6fhwlRUnuGRbG1WKQvdAPli3qfH8mLzgoTz-6HWs1Jf2Ujheavf3ipGMNtj-OSUdQsh04Ov7jehDWdnPNn2s2DAl4eubgjdXrwIiBPCRkbuFeYZZJpzj1wy__a0nCM7bzly5uTZ2aWujgEJvf9bJb-Y4gkS8TxyJaggJ01ZsMki36aEpIt8J1tJag",
20
20
  productSelected: {
21
- services: {
22
- datasheets: 1,
23
- descriptions: 1,
24
- images: 1,
25
- },
26
- orderId: 123,
27
- status: "PA",
28
- datasheet_status: "PA",
29
- prio: "none",
21
+ articleStatus: "AA",
30
22
  version: 3,
31
- description_status: "PA",
32
- images_status: "PA",
33
- statusByRetailer: {
34
- 4: {
35
- datasheet: "PA",
36
- description: "PA",
37
- images: "PA",
38
- },
39
- 5: {
40
- datasheet: "PA",
41
- description: "PA",
42
- images: "PA",
43
- },
44
- 6: {
45
- datasheet: "PA",
46
- description: "PA",
47
- images: "PA",
48
- },
49
- },
23
+ missing: {},
50
24
  article: {
51
- id_article: 127,
52
- id_category: "700",
53
- name: "prueba prod flujo",
54
- upc: "34234353324",
55
- timestamp: "2022-11-23T23:12:30.000Z",
56
- id_user: 28,
57
- status: "NULL",
58
- active: 1,
59
- company_id: 1,
60
- company_name: "GRUPO BRAHMA",
61
- country: "México",
62
- id_order: 123,
63
- id_datasheet_especialist: 54,
64
- id_datasheet_facilitator: 52,
65
- id_description_especialist: 54,
66
- id_description_facilitator: 52,
67
- id_images_especialist: 55,
68
- id_images_facilitator: 53,
69
- id_auditor: 37,
70
- id_recepcionist: null,
71
25
  category:
72
- "Salud y Belleza|Cuidado Facial|Cremas, Mascarillas y Tratamientos",
73
- missingAttributes: 0,
74
- missingDescriptions: 0,
75
- missingImages: 0,
26
+ "Ventilación y Calefacción|Ventiladores de Techo|Ventiladores de Techo",
27
+ company_name: "GRUPO BRAHMA",
28
+ company_id: 1,
29
+ id_category: "2416",
30
+ id_article: 221,
31
+ name: 'DEMO VENTILADOR DE TECHO TRIBECA 52"',
32
+ upc: "147259",
76
33
  },
34
+ asignations: [],
77
35
  retailers: [
78
36
  {
79
- id: 4,
80
- name: "Walmart Super y Superama",
37
+ id: 59,
38
+ name: "The Home Depot Platinum",
39
+ country: "México",
40
+ id_region: 1,
41
+ active: 1,
81
42
  },
43
+ ],
44
+ retailersAvailable: [
82
45
  {
83
- id: 5,
84
- name: "Chedraui",
46
+ id: 59,
47
+ name: "The Home Depot Platinum",
48
+ country: "México",
49
+ id_region: 1,
50
+ active: 1,
85
51
  },
52
+ ],
53
+ upc: "147259",
54
+ name: 'DEMO VENTILADOR DE TECHO TRIBECA 52"',
55
+ categoryName:
56
+ "Ventilación y Calefacción|Ventiladores de Techo|Ventiladores de Techo",
57
+ id_category: "2416",
58
+ id_article: 221,
59
+ services: [
86
60
  {
87
- id: 6,
88
- name: "HEB",
61
+ id_article: 221,
62
+ service: "datasheet",
63
+ quantity: 1,
64
+ price: 0,
65
+ id_user: 59,
66
+ datasheet_common: null,
67
+ discount: null,
89
68
  },
90
69
  ],
91
- country: "México",
92
- upc: "34234353324",
93
70
  },
94
71
  location: {
95
- product: { articleId: 109485, versionId: 3 },
72
+ product: { articleId: 221, versionId: 3 },
96
73
  },
97
74
  user: {
98
- id_user: 51,
99
- name: "ADMIN PRUEBA",
100
- last_name: "",
101
- email: "etc@contentoh.com",
102
- position: "",
103
- telephone: "",
104
- country: "",
105
- id_company: 2,
106
- id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
75
+ id_user: 59,
76
+ name: "The Home",
77
+ last_name: "Depot",
78
+ email: "cadena.ismael@allfreemail.net",
79
+ position: "Admin",
80
+ telephone: "+523111366336",
81
+ country: "México",
82
+ id_company: 817,
83
+ id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
107
84
  birth_Date: null,
108
85
  about_me: "",
109
86
  zip_code: "",
110
87
  address: "",
111
88
  job: "",
112
89
  id_stripe: "",
113
- id_role: 1,
90
+ id_role: 0,
114
91
  active: 1,
115
- is_retailer: 0,
116
- email_notify: 1,
92
+ is_retailer: 1,
93
+ email_notify: 0,
117
94
  is_user_tech: null,
118
95
  membership: {
119
- id: 2,
120
- start_date: "2021-11-05T02:35:12.000Z",
121
- end_date: "2022-11-05T02:34:49.000Z",
122
- planID: 1,
123
- plan: "prod_KtkvuFFLpOdP6e",
124
- name: "Plan Free",
125
- user_limit: "1",
126
- products_limit: "3",
96
+ id: 47,
97
+ start_date: "2022-05-25T14:31:12.000Z",
98
+ end_date: "2023-05-25T14:31:12.000Z",
99
+ planID: 5,
100
+ plan: "prod_Ktl6B5Ou2gqTB2",
101
+ name: "Plan Pro",
102
+ user_limit: "5",
103
+ products_limit: "500",
127
104
  type: "PyMES",
128
105
  },
129
- src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1669928511679",
106
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1671735033010",
130
107
  },
131
108
  };
@@ -175,6 +175,7 @@ export const RetailerProductEdition = ({
175
175
  const [percentages, setPercentages] = useState(
176
176
  new Array(product?.retailers?.length).fill({ percentage: 0 })
177
177
  );
178
+ // const [percentages, setPercentages] = useState([{ retailers: {} }]);
178
179
  const [activePercentage, setActivePercentage] = useState(0);
179
180
  const [activeRetailer, setActiveRetailer] = useState({});
180
181
  const [services, setServices] = useState([]);
@@ -225,12 +226,9 @@ export const RetailerProductEdition = ({
225
226
  //Converts the data inside the datasheets object to array
226
227
  setServices(services);
227
228
  getServices();
228
-
229
- // setActiveRetailer(product?.retailers[0]);
230
229
  setImages({ action: "init", init: services[2] });
231
230
  if (services[2]?.values?.length > 0) setActiveImage(0);
232
-
233
- getPercentage({ data: [product] }).then((res) => setPercentages(res));
231
+ getPercentage({ data: [product] }).then((res) => setPercentages(res[0]));
234
232
  setLoading(false);
235
233
  } catch (error) {
236
234
  console.log(error);
@@ -371,12 +369,16 @@ export const RetailerProductEdition = ({
371
369
  }, [userGroups]);
372
370
 
373
371
  useEffect(() => {
374
- product?.retailers?.forEach((retailer) => {
375
- retailer["percentage"] = percentages?.filter(
376
- (percent) => retailer?.id === percent?.id_retailer
377
- )[0]?.percentage;
378
- });
379
- setActivePercentage(product?.retailers[0]?.percentage);
372
+ const retailers = product?.retailersAvailable || product?.retailers;
373
+ if (Object.keys(percentages?.retailers ?? {})?.length > 0) {
374
+ retailers?.forEach((retailer) => {
375
+ retailer["percentage"] = Number(
376
+ percentages?.retailers[retailer.id].percentageRequired
377
+ );
378
+ });
379
+ }
380
+
381
+ setActivePercentage(retailers[0]?.percentage);
380
382
  }, [percentages]);
381
383
 
382
384
  useEffect(() => {
@@ -61,3 +61,9 @@
61
61
  src: url("../assets/fonts/roboto/Roboto-Regular.ttf");
62
62
  font-weight: 400;
63
63
  }
64
+
65
+ .prueba {
66
+ color: #9e3e26;
67
+ color: #b42983;
68
+ color: #e7e7e7;
69
+ }