contentoh-components-library 21.4.29 → 21.4.30

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 (171) hide show
  1. package/dist/components/atoms/Avatar/index.js +2 -3
  2. package/dist/components/atoms/Card/index.js +5 -46
  3. package/dist/components/atoms/Card/styles.js +1 -3
  4. package/dist/components/atoms/CheckBox/index.js +2 -7
  5. package/dist/components/atoms/CheckBox/styles.js +1 -1
  6. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  7. package/dist/components/atoms/SliderToolTip/styles.js +1 -1
  8. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  9. package/dist/components/molecules/HeaderTop/index.js +11 -68
  10. package/dist/components/molecules/TagAndInput/index.js +1 -1
  11. package/dist/components/organisms/Chat/Chat.stories.js +8 -27
  12. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  13. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  14. package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
  15. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  16. package/dist/components/organisms/Chat/index.js +4 -49
  17. package/dist/components/organisms/Chat/styles.js +1 -1
  18. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  19. package/dist/components/organisms/Modal/styles.js +1 -1
  20. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +4 -6
  21. package/dist/components/pages/ProviderProductEdition/index.js +142 -117
  22. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  23. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +3 -7
  24. package/dist/components/pages/RetailerProductEdition/index.js +274 -276
  25. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  26. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  27. package/dist/index.js +52 -247
  28. package/package.json +1 -4
  29. package/src/components/atoms/Avatar/index.js +2 -8
  30. package/src/components/atoms/Card/index.js +2 -35
  31. package/src/components/atoms/Card/styles.js +5 -41
  32. package/src/components/atoms/CheckBox/index.js +1 -4
  33. package/src/components/atoms/CheckBox/styles.js +0 -2
  34. package/src/components/atoms/InputFormatter/styles.js +1 -2
  35. package/src/components/atoms/SliderToolTip/styles.js +1 -1
  36. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  37. package/src/components/molecules/HeaderTop/index.js +6 -52
  38. package/src/components/molecules/TagAndInput/index.js +8 -10
  39. package/src/components/organisms/Chat/Chat.stories.js +7 -27
  40. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  41. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -14
  42. package/src/components/organisms/Chat/ContentChat/index.js +12 -88
  43. package/src/components/organisms/Chat/Footer/index.js +0 -11
  44. package/src/components/organisms/Chat/index.js +4 -46
  45. package/src/components/organisms/Chat/styles.js +0 -4
  46. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  47. package/src/components/organisms/Modal/styles.js +1 -4
  48. package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
  49. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +4 -6
  50. package/src/components/pages/ProviderProductEdition/index.js +129 -97
  51. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  52. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +2 -6
  53. package/src/components/pages/RetailerProductEdition/index.js +142 -111
  54. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  55. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  56. package/src/index.js +0 -15
  57. package/.env.development +0 -39
  58. package/.env.production +0 -36
  59. package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
  60. package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -90
  61. package/dist/components/atoms/ImageCarousel/index.js +0 -120
  62. package/dist/components/atoms/ImageCarousel/styles.js +0 -18
  63. package/dist/components/atoms/PercentTag/PercentTag.stories.js +0 -31
  64. package/dist/components/atoms/PercentTag/index.js +0 -23
  65. package/dist/components/atoms/PercentTag/styles.js +0 -22
  66. package/dist/components/atoms/RatingStars/RatingStars.stories.js +0 -30
  67. package/dist/components/atoms/RatingStars/index.js +0 -53
  68. package/dist/components/atoms/RatingStars/styles.js +0 -18
  69. package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -48
  70. package/dist/components/atoms/RetailerCatalog/index.js +0 -69
  71. package/dist/components/atoms/RetailerCatalog/styles.js +0 -20
  72. package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +0 -33
  73. package/dist/components/atoms/RetailerOption/index.js +0 -62
  74. package/dist/components/atoms/RetailerOption/styles.js +0 -20
  75. package/dist/components/atoms/RetailersList/RetailersList.stories.js +0 -45
  76. package/dist/components/atoms/RetailersList/index.js +0 -46
  77. package/dist/components/atoms/RetailersList/styles.js +0 -18
  78. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +0 -73
  79. package/dist/components/atoms/UserCatalog/index.js +0 -101
  80. package/dist/components/atoms/UserCatalog/styles.js +0 -18
  81. package/dist/components/atoms/UserOption/UserOption.stories.js +0 -40
  82. package/dist/components/atoms/UserOption/index.js +0 -130
  83. package/dist/components/atoms/UserOption/styles.js +0 -20
  84. package/dist/components/atoms/UserSelector/UserSelector.stories.js +0 -40
  85. package/dist/components/atoms/UserSelector/index.js +0 -98
  86. package/dist/components/atoms/UserSelector/styles.js +0 -32
  87. package/dist/components/molecules/GridItem/GridItem.stories.js +0 -123
  88. package/dist/components/molecules/GridItem/index.js +0 -152
  89. package/dist/components/molecules/GridItem/styles.js +0 -20
  90. package/dist/components/molecules/HeaderItem/ColumnItem.js +0 -23
  91. package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +0 -70
  92. package/dist/components/molecules/HeaderItem/index.js +0 -42
  93. package/dist/components/molecules/HeaderItem/styles.js +0 -30
  94. package/dist/components/molecules/RowItem/ColumnItem.js +0 -23
  95. package/dist/components/molecules/RowItem/RowItem.stories.js +0 -5242
  96. package/dist/components/molecules/RowItem/index.js +0 -58
  97. package/dist/components/molecules/RowItem/styles.js +0 -30
  98. package/dist/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -32
  99. package/dist/components/molecules/StripeCardForm/index.js +0 -94
  100. package/dist/components/molecules/StripeCardForm/paymentForm.js +0 -194
  101. package/dist/components/molecules/StripeCardForm/styles.js +0 -27
  102. package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -30
  103. package/dist/components/molecules/StripeCardSelector/index.js +0 -120
  104. package/dist/components/molecules/StripeCardSelector/styles.js +0 -22
  105. package/dist/components/molecules/StripeCardSelector/utils.js +0 -56
  106. package/dist/components/organisms/GridProducts/GridProducts.stories.js +0 -5097
  107. package/dist/components/organisms/GridProducts/index.js +0 -63
  108. package/dist/components/organisms/GridProducts/styles.js +0 -18
  109. package/dist/components/organisms/GridProducts/utils.js +0 -149
  110. package/dist/components/organisms/PanelLayout/PanelLayout.stories.js +0 -87
  111. package/dist/components/organisms/PanelLayout/index.js +0 -29
  112. package/dist/components/organisms/PanelLayout/styles.js +0 -32
  113. package/dist/components/organisms/SideModal/SideModal.stories.js +0 -42
  114. package/dist/components/organisms/SideModal/index.js +0 -72
  115. package/dist/components/organisms/SideModal/styles.js +0 -18
  116. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
  117. package/src/components/atoms/ImageCarousel/index.js +0 -103
  118. package/src/components/atoms/ImageCarousel/styles.js +0 -79
  119. package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
  120. package/src/components/atoms/PercentTag/index.js +0 -9
  121. package/src/components/atoms/PercentTag/styles.js +0 -69
  122. package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
  123. package/src/components/atoms/RatingStars/index.js +0 -31
  124. package/src/components/atoms/RatingStars/styles.js +0 -28
  125. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
  126. package/src/components/atoms/RetailerCatalog/index.js +0 -49
  127. package/src/components/atoms/RetailerCatalog/styles.js +0 -30
  128. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
  129. package/src/components/atoms/RetailerOption/index.js +0 -53
  130. package/src/components/atoms/RetailerOption/styles.js +0 -41
  131. package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
  132. package/src/components/atoms/RetailersList/index.js +0 -20
  133. package/src/components/atoms/RetailersList/styles.js +0 -19
  134. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
  135. package/src/components/atoms/UserCatalog/index.js +0 -100
  136. package/src/components/atoms/UserCatalog/styles.js +0 -24
  137. package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
  138. package/src/components/atoms/UserOption/index.js +0 -95
  139. package/src/components/atoms/UserOption/styles.js +0 -61
  140. package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
  141. package/src/components/atoms/UserSelector/index.js +0 -86
  142. package/src/components/atoms/UserSelector/styles.js +0 -55
  143. package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
  144. package/src/components/molecules/GridItem/index.js +0 -105
  145. package/src/components/molecules/GridItem/styles.js +0 -104
  146. package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
  147. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
  148. package/src/components/molecules/HeaderItem/index.js +0 -26
  149. package/src/components/molecules/HeaderItem/styles.js +0 -27
  150. package/src/components/molecules/RowItem/ColumnItem.js +0 -9
  151. package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
  152. package/src/components/molecules/RowItem/index.js +0 -45
  153. package/src/components/molecules/RowItem/styles.js +0 -40
  154. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -14
  155. package/src/components/molecules/StripeCardForm/index.js +0 -45
  156. package/src/components/molecules/StripeCardForm/paymentForm.js +0 -125
  157. package/src/components/molecules/StripeCardForm/styles.js +0 -74
  158. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
  159. package/src/components/molecules/StripeCardSelector/index.js +0 -57
  160. package/src/components/molecules/StripeCardSelector/styles.js +0 -6
  161. package/src/components/molecules/StripeCardSelector/utils.js +0 -17
  162. package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
  163. package/src/components/organisms/GridProducts/index.js +0 -50
  164. package/src/components/organisms/GridProducts/styles.js +0 -14
  165. package/src/components/organisms/GridProducts/utils.js +0 -111
  166. package/src/components/organisms/PanelLayout/PanelLayout.stories.js +0 -63
  167. package/src/components/organisms/PanelLayout/index.js +0 -11
  168. package/src/components/organisms/PanelLayout/styles.js +0 -39
  169. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  170. package/src/components/organisms/SideModal/index.js +0 -50
  171. package/src/components/organisms/SideModal/styles.js +0 -30
@@ -17,14 +17,14 @@ export const Chat = (props) => {
17
17
  const {
18
18
  chatType, // "merchant_product" | "order_product" | "ticket"
19
19
  chatContainerType, // ("fixed") | ("popUp")
20
- chatData = {}, // {} => aqui poner los datos requeridos segun el tipo de chat
20
+ chatData, // {} => aqui poner los datos requeridos segun el tipo de chat
21
21
  classNameContainerFixed, // clases CSS del envoltoria chat fixed
22
22
  size = 14, // tamaño del icono
23
23
  } = props;
24
24
  const [showPopUpChat, setShowPopUpChat] = useState(false);
25
25
  const [data, setData] = useState();
26
26
 
27
- const { ticketCompany, retailerId } = chatData || {};
27
+ const { ticketCompany } = chatData || {};
28
28
 
29
29
  useEffect(() => {
30
30
  switch (chatType) {
@@ -37,9 +37,6 @@ export const Chat = (props) => {
37
37
  case "ticket":
38
38
  validateChatTicket();
39
39
  break;
40
- case "product_status":
41
- validateProductStatus();
42
- break;
43
40
  default:
44
41
  setData({
45
42
  code: 404,
@@ -49,45 +46,6 @@ export const Chat = (props) => {
49
46
  }
50
47
  }, [chatType]);
51
48
 
52
- const validateProductStatus = () => {
53
- const {
54
- userToken, // string
55
- id, // number
56
- version,
57
- retailerId, // number
58
- status,
59
- orderId,
60
- } = chatData;
61
-
62
- if (!isValidGeneral(userToken, id)) return;
63
-
64
- // validar el ID de la cadena asociada al producto en la OT
65
- if (!isValidNaturalNumber(retailerId)) {
66
- setDataError("La cadena relacionada al producto no es válida");
67
- return;
68
- }
69
-
70
- // validar el ID de la version asociada al producto en la OT
71
- if (!isValidNaturalNumber(version)) {
72
- setDataError("La versión del producto no es válida");
73
- return;
74
- }
75
-
76
- if (orderId && !isValidNaturalNumber(orderId)) {
77
- setDataError("La orden del producto no es válida");
78
- return;
79
- }
80
-
81
- setData({
82
- userToken,
83
- id,
84
- version,
85
- retailerId,
86
- orderId,
87
- status,
88
- });
89
- };
90
-
91
49
  const isValidGeneral = (userToken, id) => {
92
50
  // validar token del user
93
51
  if (isStringEmpty(userToken)) {
@@ -239,7 +197,7 @@ export const Chat = (props) => {
239
197
  dataChat={data}
240
198
  showBtnClose={false}
241
199
  ticketCompany={ticketCompany}
242
- activeRetailer={props.activeRetailer || { id: retailerId }}
200
+ activeRetailer={props.activeRetailer}
243
201
  />
244
202
  </ContainerFixed>
245
203
  );
@@ -272,7 +230,7 @@ export const Chat = (props) => {
272
230
  onClickBtnClose={() => {
273
231
  setShowPopUpChat(false);
274
232
  }}
275
- activeRetailer={props.activeRetailer || { id: retailerId }}
233
+ activeRetailer={props.activeRetailer}
276
234
  />
277
235
  </ContainerPopUp>
278
236
  </Slide>
@@ -12,10 +12,6 @@ export const ContainerFixed = styled.div`
12
12
  border: 1px solid #f0f0f0;
13
13
  z-index: 1000;
14
14
  padding: 0px;
15
- @media (max-width: 1024px) {
16
- width: auto;
17
- max-width: 100%;
18
- }
19
15
  @media (max-width: 600px) {
20
16
  width: 90%;
21
17
  min-width: 300px;
@@ -23,7 +23,7 @@ export const FullProductNameHeader = ({
23
23
  useEffect(() => {
24
24
  const rtls = headerData?.retailers || headerData?.retailersAvailable;
25
25
  servicesData &&
26
- rtls?.forEach((rt) => {
26
+ rtls.forEach((rt) => {
27
27
  const element = [];
28
28
  servicesData.forEach((sd) => {
29
29
  if (sd.id_retailer === rt.id) {
@@ -31,6 +31,7 @@ export const ContainerModal = styled.div`
31
31
  align-items: center;
32
32
  justify-content: flex-start;
33
33
  gap: 6px;
34
+ margin-bottom: 20px;
34
35
 
35
36
  .label-title {
36
37
  width: 100%;
@@ -41,10 +42,6 @@ export const ContainerModal = styled.div`
41
42
  color: #262626;
42
43
  white-space: pre-wrap;
43
44
  }
44
-
45
- & + * {
46
- margin-top: 20px;
47
- }
48
45
  }
49
46
 
50
47
  .iconModal {
@@ -1,31 +1,41 @@
1
1
  export const servicesCodeIcon = {
2
2
  datasheet: (
3
3
  <div key="datasheet" className="tooltip">
4
- <span className="material-icons small">&#xf8ee;</span>
4
+ <span className="material-icons small">
5
+ &#xf8ee;
6
+ </span>
5
7
  <span className="tooltiptext">Ficha Técnica</span>
6
8
  </div>
7
9
  ),
8
10
  description: (
9
11
  <div key="description" className="tooltip">
10
- <span className="material-icons small">&#xe873;</span>
12
+ <span className="material-icons small">
13
+ &#xe873;
14
+ </span>
11
15
  <span className="tooltiptext">Descripción</span>
12
16
  </div>
13
17
  ),
14
18
  image: (
15
19
  <div key="image" className="tooltip">
16
- <span className="material-icons small">&#xe3f4;</span>
20
+ <span className="material-icons small">
21
+ &#xe3f4;
22
+ </span>
17
23
  <span className="tooltiptext">Imagen</span>
18
24
  </div>
19
25
  ),
20
26
  translate: (
21
27
  <div key="translate" className="tooltip">
22
- <span className="material-icons small">&#xe8e2;</span>
28
+ <span className="material-icons small">
29
+ &#xe8e2;
30
+ </span>
23
31
  <span className="tooltiptext">Traducción</span>
24
32
  </div>
25
33
  ),
26
34
  build: (
27
- <div key="build" className="tooltip">
28
- <span className="material-icons small">&#xe1bd;</span>
35
+ <div key="build" className="tooltip">
36
+ <span className="material-icons small">
37
+ &#xe1bd;
38
+ </span>
29
39
  <span className="tooltiptext">Construcción</span>
30
40
  </div>
31
41
  ),
@@ -16,10 +16,10 @@ ProviderProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ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VYd8xx4tkw3U6uyW_laE6ucyHQpXSXYMfadAxxV2PZ5ObbgmX98nFKj32E2F4CxHxw3W7B1Wj7ZoGML409GjlylQ1RuVVHjwTw0OH5TtveV1JNNpts0belvzxbk5vX9E1vKoZLOKn8gO9yaFe0YawKjS0hW-P4NcjIonsNJ5KWMsh0fJCM2oAKAk8oAGZcszYHknMPF6ahf-fWeboVuK89UEsKlQukr7W8fnIePFI8aSlKM1nG0I7nOT_1734Pf-A9QQDXEwhfj8NMHHICb2c_ECgHPEspM9VxIR6Lbws-gCTSG6FTMjsIFKU3EqaQvlVw",
20
+ articleId: 39485,
21
+ category: 11,
22
+ version: 3,
23
23
  productSelected: {
24
24
  orderId: 15275,
25
25
  status: "AA",
@@ -153,8 +153,6 @@ ProviderProductEditionDefault.args = {
153
153
  search: "",
154
154
  hash: "",
155
155
  state: {
156
- withChat: true,
157
- chatType: "product_status",
158
156
  origin: "RequestWithContentoh",
159
157
  },
160
158
  key: "24vwut",
@@ -39,9 +39,6 @@ import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
39
39
  import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
40
40
  import { VersionSelector } from "../../organisms/VersionSelector";
41
41
  import { useCloseModal } from "../../../global-files/customHooks";
42
- import { createMessage, sendMessage } from "../RetailerProductEdition/utils";
43
- import { Modal } from "../../organisms/Modal";
44
- import { ButtonV2 } from "../../atoms/ButtonV2";
45
42
 
46
43
  const reducerImages = (state, action) => {
47
44
  let { values, attrForImgs, inputsByRetailer } = state;
@@ -217,7 +214,6 @@ export const ProviderProductEdition = ({
217
214
  const isRetailer = user?.is_retailer;
218
215
  const [loading, setLoading] = useState(true);
219
216
  const [validatedAll, setValidatedAll] = useState(false);
220
- const [showRejectModal, setShowRejectModal] = useState(false);
221
217
 
222
218
  const [origin, setOrigin] = useState({
223
219
  "Ficha técnica": null,
@@ -347,6 +343,28 @@ export const ProviderProductEdition = ({
347
343
  (type) => {
348
344
  const formatter = new Intl.ListFormat("es", { type: "conjunction" });
349
345
  switch (type) {
346
+ case "error":
347
+ setGlobalModal({
348
+ message: `${activeTab} rechazada`,
349
+ detail: "Agrega tu comentarios para enviar el rechazo",
350
+ img: errorModal,
351
+ textArea: true,
352
+ button1: {
353
+ name: "Enviar",
354
+ action: (e) => {
355
+ const textArea = document.querySelector("#area");
356
+ if (textArea.value) {
357
+ textArea.style.border = "none";
358
+ createComment(e, textArea.value);
359
+ showGlobalModal("commentsSent");
360
+ validatedAll ? validateAll("R") : sendEvaluation("R");
361
+ } else {
362
+ textArea.style.border = "2px solid red";
363
+ }
364
+ },
365
+ },
366
+ });
367
+ break;
350
368
  case "generic":
351
369
  setGlobalModal(dataGenericModal);
352
370
  break;
@@ -506,9 +524,7 @@ export const ProviderProductEdition = ({
506
524
  );
507
525
  setServicesData(parsedResponse);
508
526
  }
509
- retailers &&
510
- !activeRetailer.id &&
511
- setActiveRetailer(active ? active : retailers[0]);
527
+ !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
512
528
  };
513
529
 
514
530
  const isRevision = () => {
@@ -584,7 +600,7 @@ export const ProviderProductEdition = ({
584
600
  });
585
601
  }
586
602
  setProduct(productTemp);
587
- retailers && setActivePercentage(retailers[0]?.percentage);
603
+ setActivePercentage(retailers[0]?.percentage);
588
604
  }, [percentages]);
589
605
 
590
606
  const loadInputs = () => {
@@ -828,19 +844,32 @@ export const ProviderProductEdition = ({
828
844
  }
829
845
  };
830
846
 
831
- const createComment = async (messages = [], retailerId) => {
847
+ const createComment = async (e, body, tab) => {
848
+ let concept = "";
849
+ switch (activeTab) {
850
+ case "Ficha técnica":
851
+ concept = "datasheet";
852
+ break;
853
+ case "Imágenes":
854
+ concept = "images";
855
+ break;
856
+
857
+ default:
858
+ concept = "description";
859
+ break;
860
+ }
832
861
  const data = {
833
- paramsBody: {
834
- id: product.article.id_article || productEdit.ArticleId,
835
- version: version,
836
- items: messages,
837
- retailerId: retailerId,
838
- status: product.status || productEdit.product.status,
839
- },
840
- paramsHeader: { Authorization: token },
862
+ articleId: product?.id_article,
863
+ orderId: product?.orderId,
864
+ message: body,
865
+ concept: concept,
866
+ version: version,
841
867
  };
842
- setMessage("");
843
- return sendMessage(data);
868
+ await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
869
+ headers: {
870
+ Authorization: token,
871
+ },
872
+ });
844
873
  };
845
874
 
846
875
  useEffect(() => {
@@ -1265,7 +1294,8 @@ export const ProviderProductEdition = ({
1265
1294
  return;
1266
1295
  } else if (user.is_retailer) {
1267
1296
  if (product.id_order || product.orderId) {
1268
- sendEvaluation("R");
1297
+ setValidatedAll(true);
1298
+ showGlobalModal("error");
1269
1299
  } else {
1270
1300
  setDataGenericModal((prev) => ({
1271
1301
  ...prev,
@@ -1277,7 +1307,8 @@ export const ProviderProductEdition = ({
1277
1307
  showGlobalModal("generic");
1278
1308
  }
1279
1309
  } else {
1280
- sendEvaluation("R");
1310
+ setValidatedAll(true);
1311
+ showGlobalModal("error");
1281
1312
  }
1282
1313
  }
1283
1314
  };
@@ -1287,7 +1318,6 @@ export const ProviderProductEdition = ({
1287
1318
  <HeaderTop
1288
1319
  setHeaderTop={setHeaderTop}
1289
1320
  withChat={location?.state?.withChat}
1290
- chatType={location?.state?.chatType}
1291
1321
  productSelected={productSelected}
1292
1322
  token={token}
1293
1323
  activeRetailer={activeRetailer}
@@ -1366,7 +1396,7 @@ export const ProviderProductEdition = ({
1366
1396
  } else if (user.is_retailer) {
1367
1397
  if (product.id_order || product.orderId) {
1368
1398
  setValidatedAll(true);
1369
- setShowRejectModal(true);
1399
+ showGlobalModal("error");
1370
1400
  } else {
1371
1401
  setDataGenericModal((prev) => ({
1372
1402
  ...prev,
@@ -1378,14 +1408,12 @@ export const ProviderProductEdition = ({
1378
1408
  showGlobalModal("generic");
1379
1409
  }
1380
1410
  } else {
1381
- setShowRejectModal(true);
1382
1411
  setValidatedAll(true);
1412
+ showGlobalModal("error");
1383
1413
  }
1384
1414
  }}
1385
1415
  approve={() => sendToEvaluation("A")}
1386
- reject={() => {
1387
- setShowRejectModal(true);
1388
- }}
1416
+ reject={() => sendToEvaluation("R")}
1389
1417
  />
1390
1418
  <FullTabsMenu
1391
1419
  tabsSections={tabsSections}
@@ -1505,41 +1533,87 @@ export const ProviderProductEdition = ({
1505
1533
  </>
1506
1534
  )}
1507
1535
  </div>
1508
- {!(isRevision() && getSectionStatus()) && !revision && (
1509
- <div className="required-inputs-message">
1510
- <div>
1511
- <p>
1512
- Los atributos son requeridos por las plataformas de las
1513
- cadenas, es muy importante completar los campos requeridos ya
1514
- que pueden rechazar el producto por falta de información.
1515
- </p>
1516
- </div>
1517
- {inCart ? (
1518
- <button type="button">
1519
- <Link to="/checkout">
1520
- <p>Articulo en carrito</p>
1521
- <p>Ir a checkout</p>
1522
- </Link>
1523
- </button>
1536
+ {isRevision() && getSectionStatus() ? (
1537
+ <div className="commentary-box">
1538
+ {!comment ? (
1539
+ <div className="commentary">
1540
+ <TagAndInput
1541
+ label={"Caja de Comentario"}
1542
+ inputType={"textarea"}
1543
+ inputCols={80}
1544
+ inputRows={4}
1545
+ inputId={"commentary-box"}
1546
+ index={0}
1547
+ />
1548
+ <div className="buttons-box">
1549
+ <Button
1550
+ buttonType={"general-transparent-button"}
1551
+ label={"Enviar comentario"}
1552
+ onClick={(e) =>
1553
+ createComment(
1554
+ e,
1555
+ document.querySelector(
1556
+ "#description-commentary-box-0 .ql-container .ql-editor > p"
1557
+ ).innerHTML,
1558
+ activeTab
1559
+ )
1560
+ }
1561
+ />
1562
+ </div>
1563
+ </div>
1524
1564
  ) : (
1525
- <>
1526
- <SliderToolTip
1527
- infoIcon={InfoIcon}
1528
- slidefront={slidefront}
1529
- iconSize={"big-image"}
1530
- slidePosition={"top-slide"}
1565
+ <div className="feedback-box">
1566
+ <Commentary
1567
+ comment={comment.message}
1568
+ reviewed={crossComment}
1531
1569
  />
1532
1570
  <Button
1533
- onClick={() => {
1534
- setShowContentohRequestModal &&
1535
- setShowContentohRequestModal(true);
1571
+ buttonType={"circular-button accept-button"}
1572
+ onClick={async () => {
1573
+ setCrossComment(true);
1574
+ commentRevised();
1536
1575
  }}
1537
- buttonType="general-default-button"
1538
- label="Enviar a Content-oh!"
1539
1576
  />
1540
- </>
1577
+ </div>
1541
1578
  )}
1542
1579
  </div>
1580
+ ) : (
1581
+ !revision && (
1582
+ <div className="required-inputs-message">
1583
+ <div>
1584
+ <p>
1585
+ Los atributos son requeridos por las plataformas de las
1586
+ cadenas, es muy importante completar los campos requeridos
1587
+ ya que pueden rechazar el producto por falta de información.
1588
+ </p>
1589
+ </div>
1590
+ {inCart ? (
1591
+ <button type="button">
1592
+ <Link to="/checkout">
1593
+ <p>Articulo en carrito</p>
1594
+ <p>Ir a checkout</p>
1595
+ </Link>
1596
+ </button>
1597
+ ) : (
1598
+ <>
1599
+ <SliderToolTip
1600
+ infoIcon={InfoIcon}
1601
+ slidefront={slidefront}
1602
+ iconSize={"big-image"}
1603
+ slidePosition={"top-slide"}
1604
+ />
1605
+ <Button
1606
+ onClick={() => {
1607
+ setShowContentohRequestModal &&
1608
+ setShowContentohRequestModal(true);
1609
+ }}
1610
+ buttonType="general-default-button"
1611
+ label="Enviar a Content-oh!"
1612
+ />
1613
+ </>
1614
+ )}
1615
+ </div>
1616
+ )
1543
1617
  )}
1544
1618
  </div>
1545
1619
  </div>
@@ -1582,48 +1656,6 @@ export const ProviderProductEdition = ({
1582
1656
  jwt={token}
1583
1657
  />
1584
1658
  )}
1585
- {showRejectModal && (
1586
- <Modal
1587
- title={"Agregar mensaje de rechazo"}
1588
- show={showRejectModal}
1589
- customComponent={
1590
- <TagAndInput
1591
- inputType={"textarea"}
1592
- inputId={"modal-message-box"}
1593
- index={0}
1594
- color={"white"}
1595
- />
1596
- }
1597
- buttons={[
1598
- <ButtonV2
1599
- key={"btn-Cancelar"}
1600
- type={"white"}
1601
- label={"Cancelar"}
1602
- size={12}
1603
- onClick={() => {
1604
- setShowRejectModal(false);
1605
- }}
1606
- />,
1607
- <ButtonV2
1608
- key={"btn-Aceptar"}
1609
- type={"pink"}
1610
- label={"Aceptar"}
1611
- size={12}
1612
- onClick={async () => {
1613
- const body = document.querySelector(
1614
- "#modal-message-box .ql-container .ql-editor > p"
1615
- ).innerHTML;
1616
- const messages = [
1617
- { type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
1618
- ];
1619
- await createComment(messages, activeRetailer.id);
1620
- validatedAll ? validateAll("R") : sendToEvaluation("R");
1621
- setShowRejectModal(false);
1622
- }}
1623
- />,
1624
- ]}
1625
- />
1626
- )}
1627
1659
  </Container>
1628
1660
  );
1629
1661
  };
@@ -107,10 +107,6 @@ export const Container = styled.div`
107
107
  }
108
108
  }
109
109
  }
110
- #modal-message-box {
111
- width: 400px;
112
- height: 100px;
113
- }
114
110
  .container {
115
111
  width: 100%;
116
112
  height: 100%;
@@ -119,4 +115,4 @@ export const Container = styled.div`
119
115
  width: 100%;
120
116
  }
121
117
  }
122
- `;
118
+ `;
@@ -16,7 +16,7 @@ RetailerProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06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uY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI0OTMyY2JhZC1lYzcyLTRjYWItODgyNS0wMzY2M2RkNmE2ODIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY5Mjc1MDY0NywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY5Mjc1NDI0NywiaWF0IjoxNjkyNzUwNjQ3LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.eqOY-gcS-W99WcEC632Ewckcg3WJzKoV9fIGcn1AkEE44_odGTcEk8fhVs-6_evIJkfShQOP0RFX0d2Dn31F-xFh5Lez6LvbT9F41_rAmMb3ELyRvdcz42V4eMw2IBH-FGrpGhSsJOHKV2T3WuUyZxPJu-C04ZAadfFSoNBBWnxX6SFk_eefcp9KghNmnELSSnWDh6DD1XDrWqEaLOVlQ5H7q4ARJqBo07KcXHIQo056anVud-inUMiX9KDTaorXdBCD0doWgv8NkYWSEpUS_Ctj-NG6vAled9g-6oLnC6DLR_ay6PRnAKGVNCv8bRZJL0GqF8ZnWk02svDHfUPJ0Q",
20
20
  productSelected: {
21
21
  services: {
22
22
  datasheets: 1,
@@ -73,11 +73,7 @@ RetailerProductEditionDefault.args = {
73
73
  upc: "7543453453",
74
74
  },
75
75
  location: {
76
- product: { articleId: 354, versionId: 3 },
77
- state: {
78
- withChat: true,
79
- chatType: "product_status",
80
- },
76
+ product: { articleId: 39290, versionId: 7 },
81
77
  },
82
78
  user: {
83
79
  id_user: 37,