contentoh-components-library 21.3.94 → 21.3.96

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 (153) hide show
  1. package/.env.development +5 -0
  2. package/.env.production +3 -0
  3. package/dist/components/atoms/Avatar/index.js +3 -2
  4. package/dist/components/atoms/Card/index.js +46 -5
  5. package/dist/components/atoms/Card/styles.js +3 -1
  6. package/dist/components/atoms/CheckBox/index.js +7 -2
  7. package/dist/components/atoms/CheckBox/styles.js +1 -1
  8. package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +90 -0
  9. package/dist/components/atoms/ImageCarousel/index.js +120 -0
  10. package/dist/components/atoms/ImageCarousel/styles.js +18 -0
  11. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  12. package/dist/components/atoms/PercentTag/PercentTag.stories.js +31 -0
  13. package/dist/components/atoms/PercentTag/index.js +23 -0
  14. package/dist/components/atoms/PercentTag/styles.js +22 -0
  15. package/dist/components/atoms/RatingStars/RatingStars.stories.js +30 -0
  16. package/dist/components/atoms/RatingStars/index.js +53 -0
  17. package/dist/components/atoms/RatingStars/styles.js +18 -0
  18. package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +48 -0
  19. package/dist/components/atoms/RetailerCatalog/index.js +70 -0
  20. package/dist/components/atoms/RetailerCatalog/styles.js +20 -0
  21. package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +33 -0
  22. package/dist/components/atoms/RetailerOption/index.js +62 -0
  23. package/dist/components/atoms/RetailerOption/styles.js +20 -0
  24. package/dist/components/atoms/RetailersList/RetailersList.stories.js +45 -0
  25. package/dist/components/atoms/RetailersList/index.js +44 -0
  26. package/dist/components/atoms/RetailersList/styles.js +18 -0
  27. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +72 -0
  28. package/dist/components/atoms/UserCatalog/index.js +89 -0
  29. package/dist/components/atoms/UserCatalog/styles.js +18 -0
  30. package/dist/components/atoms/UserOption/UserOption.stories.js +40 -0
  31. package/dist/components/atoms/UserOption/index.js +80 -0
  32. package/dist/components/atoms/UserOption/styles.js +20 -0
  33. package/dist/components/atoms/UserSelector/UserSelector.stories.js +40 -0
  34. package/dist/components/atoms/UserSelector/index.js +91 -0
  35. package/dist/components/atoms/UserSelector/styles.js +32 -0
  36. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  37. package/dist/components/molecules/GridItem/GridItem.stories.js +123 -0
  38. package/dist/components/molecules/GridItem/index.js +122 -0
  39. package/dist/components/molecules/GridItem/styles.js +20 -0
  40. package/dist/components/molecules/HeaderItem/ColumnItem.js +23 -0
  41. package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +70 -0
  42. package/dist/components/molecules/HeaderItem/index.js +42 -0
  43. package/dist/components/molecules/HeaderItem/styles.js +30 -0
  44. package/dist/components/molecules/HeaderTop/index.js +68 -11
  45. package/dist/components/molecules/RowItem/ColumnItem.js +23 -0
  46. package/dist/components/molecules/RowItem/RowItem.stories.js +5242 -0
  47. package/dist/components/molecules/RowItem/index.js +59 -0
  48. package/dist/components/molecules/RowItem/styles.js +30 -0
  49. package/dist/components/molecules/TabsMenu/index.js +7 -13
  50. package/dist/components/molecules/TagAndInput/index.js +1 -1
  51. package/dist/components/organisms/Chat/Chat.stories.js +27 -8
  52. package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
  53. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  54. package/dist/components/organisms/Chat/ContentChat/index.js +350 -197
  55. package/dist/components/organisms/Chat/Footer/index.js +48 -39
  56. package/dist/components/organisms/Chat/index.js +49 -4
  57. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  58. package/dist/components/organisms/FullTabsMenu/index.js +1 -3
  59. package/dist/components/organisms/GridProducts/GridProducts.stories.js +5093 -0
  60. package/dist/components/organisms/GridProducts/index.js +68 -0
  61. package/dist/components/organisms/GridProducts/styles.js +18 -0
  62. package/dist/components/organisms/GridProducts/utils.js +139 -0
  63. package/dist/components/organisms/Modal/styles.js +1 -1
  64. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +171 -96
  65. package/dist/components/pages/ProviderProductEdition/index.js +190 -178
  66. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  67. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +77 -52
  68. package/dist/components/pages/RetailerProductEdition/index.js +290 -276
  69. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  70. package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
  71. package/dist/index.js +182 -52
  72. package/package.json +4 -1
  73. package/src/components/atoms/Avatar/index.js +8 -2
  74. package/src/components/atoms/Card/index.js +35 -2
  75. package/src/components/atoms/Card/styles.js +41 -5
  76. package/src/components/atoms/CheckBox/index.js +4 -1
  77. package/src/components/atoms/CheckBox/styles.js +2 -0
  78. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
  79. package/src/components/atoms/ImageCarousel/index.js +103 -0
  80. package/src/components/atoms/ImageCarousel/styles.js +79 -0
  81. package/src/components/atoms/InputFormatter/styles.js +2 -1
  82. package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
  83. package/src/components/atoms/PercentTag/index.js +9 -0
  84. package/src/components/atoms/PercentTag/styles.js +69 -0
  85. package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
  86. package/src/components/atoms/RatingStars/index.js +31 -0
  87. package/src/components/atoms/RatingStars/styles.js +28 -0
  88. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
  89. package/src/components/atoms/RetailerCatalog/index.js +50 -0
  90. package/src/components/atoms/RetailerCatalog/styles.js +30 -0
  91. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
  92. package/src/components/atoms/RetailerOption/index.js +53 -0
  93. package/src/components/atoms/RetailerOption/styles.js +41 -0
  94. package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
  95. package/src/components/atoms/RetailersList/index.js +20 -0
  96. package/src/components/atoms/RetailersList/styles.js +19 -0
  97. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +66 -0
  98. package/src/components/atoms/UserCatalog/index.js +77 -0
  99. package/src/components/atoms/UserCatalog/styles.js +24 -0
  100. package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
  101. package/src/components/atoms/UserOption/index.js +49 -0
  102. package/src/components/atoms/UserOption/styles.js +54 -0
  103. package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
  104. package/src/components/atoms/UserSelector/index.js +70 -0
  105. package/src/components/atoms/UserSelector/styles.js +55 -0
  106. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  107. package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
  108. package/src/components/molecules/GridItem/index.js +82 -0
  109. package/src/components/molecules/GridItem/styles.js +85 -0
  110. package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
  111. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
  112. package/src/components/molecules/HeaderItem/index.js +26 -0
  113. package/src/components/molecules/HeaderItem/styles.js +25 -0
  114. package/src/components/molecules/HeaderTop/index.js +52 -6
  115. package/src/components/molecules/RowItem/ColumnItem.js +9 -0
  116. package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
  117. package/src/components/molecules/RowItem/index.js +45 -0
  118. package/src/components/molecules/RowItem/styles.js +38 -0
  119. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +13 -0
  120. package/src/components/molecules/StripeCardForm/index.js +42 -0
  121. package/src/components/molecules/StripeCardForm/paymentForm.js +124 -0
  122. package/src/components/molecules/StripeCardForm/styles.js +73 -0
  123. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -0
  124. package/src/components/molecules/StripeCardSelector/index.js +44 -0
  125. package/src/components/molecules/StripeCardSelector/styles.js +4 -0
  126. package/src/components/molecules/StripeCardSelector/utils.js +17 -0
  127. package/src/components/molecules/TabsMenu/index.js +10 -16
  128. package/src/components/molecules/TagAndInput/index.js +10 -8
  129. package/src/components/organisms/Chat/Chat.stories.js +27 -7
  130. package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
  131. package/src/components/organisms/Chat/ContainerItems/styles.js +10 -2
  132. package/src/components/organisms/Chat/ContentChat/index.js +88 -12
  133. package/src/components/organisms/Chat/Footer/index.js +11 -0
  134. package/src/components/organisms/Chat/index.js +46 -4
  135. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  136. package/src/components/organisms/FullTabsMenu/index.js +1 -3
  137. package/src/components/organisms/GridProducts/GridProducts.stories.js +5474 -0
  138. package/src/components/organisms/GridProducts/index.js +53 -0
  139. package/src/components/organisms/GridProducts/styles.js +15 -0
  140. package/src/components/organisms/GridProducts/utils.js +103 -0
  141. package/src/components/organisms/Modal/styles.js +4 -1
  142. package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
  143. package/src/components/organisms/SideModal/index.js +50 -0
  144. package/src/components/organisms/SideModal/styles.js +30 -0
  145. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +181 -98
  146. package/src/components/pages/ProviderProductEdition/index.js +134 -132
  147. package/src/components/pages/ProviderProductEdition/styles.js +5 -1
  148. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +76 -46
  149. package/src/components/pages/RetailerProductEdition/index.js +123 -138
  150. package/src/components/pages/RetailerProductEdition/styles.js +4 -0
  151. package/src/components/pages/RetailerProductEdition/utils.js +37 -0
  152. package/src/index.js +11 -0
  153. package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
@@ -39,6 +39,9 @@ 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";
42
45
 
43
46
  const reducerImages = (state, action) => {
44
47
  let { values, attrForImgs, inputsByRetailer } = state;
@@ -214,6 +217,7 @@ export const ProviderProductEdition = ({
214
217
  const isRetailer = user?.is_retailer;
215
218
  const [loading, setLoading] = useState(true);
216
219
  const [validatedAll, setValidatedAll] = useState(false);
220
+ const [showRejectModal, setShowRejectModal] = useState(false);
217
221
 
218
222
  const [origin, setOrigin] = useState({
219
223
  "Ficha técnica": null,
@@ -343,28 +347,6 @@ export const ProviderProductEdition = ({
343
347
  (type) => {
344
348
  const formatter = new Intl.ListFormat("es", { type: "conjunction" });
345
349
  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;
368
350
  case "generic":
369
351
  setGlobalModal(dataGenericModal);
370
352
  break;
@@ -524,7 +506,9 @@ export const ProviderProductEdition = ({
524
506
  );
525
507
  setServicesData(parsedResponse);
526
508
  }
527
- !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
509
+ retailers &&
510
+ !activeRetailer.id &&
511
+ setActiveRetailer(active ? active : retailers[0]);
528
512
  };
529
513
 
530
514
  const isRevision = () => {
@@ -600,7 +584,7 @@ export const ProviderProductEdition = ({
600
584
  });
601
585
  }
602
586
  setProduct(productTemp);
603
- setActivePercentage(retailers[0]?.percentage);
587
+ retailers && setActivePercentage(retailers[0]?.percentage);
604
588
  }, [percentages]);
605
589
 
606
590
  const loadInputs = () => {
@@ -841,32 +825,19 @@ export const ProviderProductEdition = ({
841
825
  }
842
826
  };
843
827
 
844
- const createComment = async (e, body, tab) => {
845
- let concept = "";
846
- switch (activeTab) {
847
- case "Ficha técnica":
848
- concept = "datasheet";
849
- break;
850
- case "Imágenes":
851
- concept = "images";
852
- break;
853
-
854
- default:
855
- concept = "description";
856
- break;
857
- }
828
+ const createComment = async (messages = [], retailerId) => {
858
829
  const data = {
859
- articleId: product?.id_article,
860
- orderId: product?.orderId,
861
- message: body,
862
- concept: concept,
863
- version: version,
864
- };
865
- await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
866
- headers: {
867
- Authorization: token,
830
+ paramsBody: {
831
+ id: product.article.id_article || productEdit.ArticleId,
832
+ version: version,
833
+ items: messages,
834
+ retailerId: retailerId,
835
+ status: product.status || productEdit.product.status,
868
836
  },
869
- });
837
+ paramsHeader: { Authorization: token },
838
+ };
839
+ setMessage("");
840
+ return sendMessage(data);
870
841
  };
871
842
 
872
843
  useEffect(() => {
@@ -1066,6 +1037,27 @@ export const ProviderProductEdition = ({
1066
1037
  const { newArticleStatus, newServiceStatus, newStatus } = JSON.parse(
1067
1038
  res.data.body
1068
1039
  );
1040
+
1041
+ const message = createMessage(
1042
+ product.retailers || product.retailersAvailable,
1043
+ activeRetailer.id,
1044
+ product[sectionStatusKey],
1045
+ newStatus,
1046
+ activeTab
1047
+ );
1048
+
1049
+ const messageData = {
1050
+ paramsBody: {
1051
+ id: product.article.id_article || productEdit.ArticleId,
1052
+ version: version,
1053
+ items: [{ type: "status", value: message }],
1054
+ retailerId: activeRetailer.id,
1055
+ status: product.status || productEdit.product.status,
1056
+ },
1057
+ paramsHeader: { Authorization: token },
1058
+ };
1059
+ await sendMessage(messageData);
1060
+
1069
1061
  if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
1070
1062
  const retailerStatusCopy = { ...retailerStatus };
1071
1063
  retailerStatusCopy[activeRetailer.id][concept] = newStatus;
@@ -1097,6 +1089,7 @@ export const ProviderProductEdition = ({
1097
1089
  result,
1098
1090
  isAproved: result === "A",
1099
1091
  };
1092
+ const messages = [];
1100
1093
  servicesData?.forEach((ret) => {
1101
1094
  const { service, id_retailer } = ret;
1102
1095
  let data = {};
@@ -1113,6 +1106,18 @@ export const ProviderProductEdition = ({
1113
1106
  },
1114
1107
  })
1115
1108
  );
1109
+ if (product[`${ret.service}_status`] !== "NS") {
1110
+ const message = createMessage(
1111
+ product.retailers,
1112
+ ret.id_retailer,
1113
+ product[`${ret.service}_status`],
1114
+ `${result}A`,
1115
+ ret.service
1116
+ );
1117
+ messages.push(
1118
+ createComment([{ type: "status", value: message }], ret.id_retailer)
1119
+ );
1120
+ }
1116
1121
  });
1117
1122
  await Promise.all(evaluationArray);
1118
1123
  const userType = user.is_retailer === 1 ? "CA" : "P";
@@ -1152,6 +1157,7 @@ export const ProviderProductEdition = ({
1152
1157
  product: productTemp,
1153
1158
  })
1154
1159
  );
1160
+ await Promise.all(messages);
1155
1161
 
1156
1162
  await loadData();
1157
1163
  } catch (error) {
@@ -1280,8 +1286,7 @@ export const ProviderProductEdition = ({
1280
1286
  return;
1281
1287
  } else if (user.is_retailer) {
1282
1288
  if (product.id_order || product.orderId) {
1283
- setValidatedAll(true);
1284
- showGlobalModal("error");
1289
+ sendEvaluation("R");
1285
1290
  } else {
1286
1291
  setDataGenericModal((prev) => ({
1287
1292
  ...prev,
@@ -1293,8 +1298,7 @@ export const ProviderProductEdition = ({
1293
1298
  showGlobalModal("generic");
1294
1299
  }
1295
1300
  } else {
1296
- setValidatedAll(true);
1297
- showGlobalModal("error");
1301
+ sendEvaluation("R");
1298
1302
  }
1299
1303
  }
1300
1304
  };
@@ -1304,6 +1308,7 @@ export const ProviderProductEdition = ({
1304
1308
  <HeaderTop
1305
1309
  setHeaderTop={setHeaderTop}
1306
1310
  withChat={location?.state?.withChat}
1311
+ chatType={location?.state?.chatType}
1307
1312
  productSelected={productSelected}
1308
1313
  token={token}
1309
1314
  activeRetailer={activeRetailer}
@@ -1382,7 +1387,7 @@ export const ProviderProductEdition = ({
1382
1387
  } else if (user.is_retailer) {
1383
1388
  if (product.id_order || product.orderId) {
1384
1389
  setValidatedAll(true);
1385
- showGlobalModal("error");
1390
+ setShowRejectModal(true);
1386
1391
  } else {
1387
1392
  setDataGenericModal((prev) => ({
1388
1393
  ...prev,
@@ -1394,12 +1399,14 @@ export const ProviderProductEdition = ({
1394
1399
  showGlobalModal("generic");
1395
1400
  }
1396
1401
  } else {
1402
+ setShowRejectModal(true);
1397
1403
  setValidatedAll(true);
1398
- showGlobalModal("error");
1399
1404
  }
1400
1405
  }}
1401
1406
  approve={() => sendToEvaluation("A")}
1402
- reject={() => sendToEvaluation("R")}
1407
+ reject={() => {
1408
+ setShowRejectModal(true);
1409
+ }}
1403
1410
  />
1404
1411
  <FullTabsMenu
1405
1412
  tabsSections={tabsSections}
@@ -1422,12 +1429,11 @@ export const ProviderProductEdition = ({
1422
1429
  showSaveButton={enableActions(product.version_status)}
1423
1430
  version={version}
1424
1431
  updatedDescriptions={updatedDescriptions}
1425
- setUpdatedDescriptions={setUpdatedDescriptions}
1426
1432
  updatedDatasheets={updatedDatasheets}
1427
- setUpdatedDatasheets={setUpdatedDatasheets}
1428
1433
  images={images}
1429
- setImages={setImages}
1430
1434
  selectedImages={selectedImages}
1435
+ setUpdatedDescriptions={setUpdatedDescriptions}
1436
+ setUpdatedDatasheets={setUpdatedDatasheets}
1431
1437
  setSelectedImages={setSelectedImages}
1432
1438
  setShowVersionSelector={setShowVersionSelector}
1433
1439
  onClickSave={() => {
@@ -1519,87 +1525,41 @@ export const ProviderProductEdition = ({
1519
1525
  </>
1520
1526
  )}
1521
1527
  </div>
1522
- {isRevision() && getSectionStatus() ? (
1523
- <div className="commentary-box">
1524
- {!comment ? (
1525
- <div className="commentary">
1526
- <TagAndInput
1527
- label={"Caja de Comentario"}
1528
- inputType={"textarea"}
1529
- inputCols={80}
1530
- inputRows={4}
1531
- inputId={"commentary-box"}
1532
- index={0}
1533
- />
1534
- <div className="buttons-box">
1535
- <Button
1536
- buttonType={"general-transparent-button"}
1537
- label={"Enviar comentario"}
1538
- onClick={(e) =>
1539
- createComment(
1540
- e,
1541
- document.querySelector(
1542
- "#description-commentary-box-0 .ql-container .ql-editor > p"
1543
- ).innerHTML,
1544
- activeTab
1545
- )
1546
- }
1547
- />
1548
- </div>
1549
- </div>
1528
+ {!(isRevision() && getSectionStatus()) && !revision && (
1529
+ <div className="required-inputs-message">
1530
+ <div>
1531
+ <p>
1532
+ Los atributos son requeridos por las plataformas de las
1533
+ cadenas, es muy importante completar los campos requeridos ya
1534
+ que pueden rechazar el producto por falta de información.
1535
+ </p>
1536
+ </div>
1537
+ {inCart ? (
1538
+ <button type="button">
1539
+ <Link to="/checkout">
1540
+ <p>Articulo en carrito</p>
1541
+ <p>Ir a checkout</p>
1542
+ </Link>
1543
+ </button>
1550
1544
  ) : (
1551
- <div className="feedback-box">
1552
- <Commentary
1553
- comment={comment.message}
1554
- reviewed={crossComment}
1545
+ <>
1546
+ <SliderToolTip
1547
+ infoIcon={InfoIcon}
1548
+ slidefront={slidefront}
1549
+ iconSize={"big-image"}
1550
+ slidePosition={"top-slide"}
1555
1551
  />
1556
1552
  <Button
1557
- buttonType={"circular-button accept-button"}
1558
- onClick={async () => {
1559
- setCrossComment(true);
1560
- commentRevised();
1553
+ onClick={() => {
1554
+ setShowContentohRequestModal &&
1555
+ setShowContentohRequestModal(true);
1561
1556
  }}
1557
+ buttonType="general-default-button"
1558
+ label="Enviar a Content-oh!"
1562
1559
  />
1563
- </div>
1560
+ </>
1564
1561
  )}
1565
1562
  </div>
1566
- ) : (
1567
- !revision && (
1568
- <div className="required-inputs-message">
1569
- <div>
1570
- <p>
1571
- Los atributos son requeridos por las plataformas de las
1572
- cadenas, es muy importante completar los campos requeridos
1573
- ya que pueden rechazar el producto por falta de información.
1574
- </p>
1575
- </div>
1576
- {inCart ? (
1577
- <button type="button">
1578
- <Link to="/checkout">
1579
- <p>Articulo en carrito</p>
1580
- <p>Ir a checkout</p>
1581
- </Link>
1582
- </button>
1583
- ) : (
1584
- <>
1585
- <SliderToolTip
1586
- infoIcon={InfoIcon}
1587
- slidefront={slidefront}
1588
- iconSize={"big-image"}
1589
- slidePosition={"top-slide"}
1590
- />
1591
- <Button
1592
- onClick={() => {
1593
- setShowContentohRequestModal &&
1594
- setShowContentohRequestModal(true);
1595
- }}
1596
- buttonType="general-default-button"
1597
- label="Enviar a Content-oh!"
1598
- />
1599
- </>
1600
- )}
1601
- </div>
1602
- )
1603
1563
  )}
1604
1564
  </div>
1605
1565
  </div>
@@ -1642,6 +1602,48 @@ export const ProviderProductEdition = ({
1642
1602
  jwt={token}
1643
1603
  />
1644
1604
  )}
1605
+ {showRejectModal && (
1606
+ <Modal
1607
+ title={"Agregar mensaje de rechazo"}
1608
+ show={showRejectModal}
1609
+ customComponent={
1610
+ <TagAndInput
1611
+ inputType={"textarea"}
1612
+ inputId={"modal-message-box"}
1613
+ index={0}
1614
+ color={"white"}
1615
+ />
1616
+ }
1617
+ buttons={[
1618
+ <ButtonV2
1619
+ key={"btn-Cancelar"}
1620
+ type={"white"}
1621
+ label={"Cancelar"}
1622
+ size={12}
1623
+ onClick={() => {
1624
+ setShowRejectModal(false);
1625
+ }}
1626
+ />,
1627
+ <ButtonV2
1628
+ key={"btn-Aceptar"}
1629
+ type={"pink"}
1630
+ label={"Aceptar"}
1631
+ size={12}
1632
+ onClick={async () => {
1633
+ const body = document.querySelector(
1634
+ "#modal-message-box .ql-container .ql-editor > p"
1635
+ ).innerHTML;
1636
+ const messages = [
1637
+ { type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
1638
+ ];
1639
+ await createComment(messages, activeRetailer.id);
1640
+ validatedAll ? validateAll("R") : sendToEvaluation("R");
1641
+ setShowRejectModal(false);
1642
+ }}
1643
+ />,
1644
+ ]}
1645
+ />
1646
+ )}
1645
1647
  </Container>
1646
1648
  );
1647
1649
  };
@@ -107,6 +107,10 @@ export const Container = styled.div`
107
107
  }
108
108
  }
109
109
  }
110
+ #modal-message-box {
111
+ width: 400px;
112
+ height: 100px;
113
+ }
110
114
  .container {
111
115
  width: 100%;
112
116
  height: 100%;
@@ -115,4 +119,4 @@ export const Container = styled.div`
115
119
  width: 100%;
116
120
  }
117
121
  }
118
- `;
122
+ `;
@@ -16,65 +16,95 @@ RetailerProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImE2YzRkM2Q2LTI0YTQtNDFkNC1hZDBmLWQwODc0MzhhYjViNiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyYjU3MjZlMy04MjM2LTRmYzMtODBkMi05NWVmYmU4ODdjOTYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MjAxNjI5MSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY4MjAxOTg5MSwiaWF0IjoxNjgyMDE2MjkxLCJlbWFpbCI6ImV0Y0Bjb250ZW50b2guY29tIn0.SCj_yp1NkGCED59JHoDSdFAOakIOvZVeC0yLwt9z0BtenDXlU0m5cUofQQonnWPM8Q70yMFEkyMGI9kQs_fz1gxrmrSc2FGefn3B_1Vymq3pQ_S1JrY_syYf88m_GtJKOywEnE6--Ef9lZhFBFKGtqRJ4H8JBa9Xb96uCjAKyEMCSURDlw37pk2RQdULlZPj17Zb6Xrqi2lwrhpI1ByptX3__UoTiZklnTXwIxM4JdU7yuhXLznaEH8NOSd2Jw-CV6FCUbYBHlnRYBQg7B5mwyVKtDQm6QpRgBTBPCvljJJpFjRKUcnon8WZiFXx1qVbkWPt2vCT1TZqqoSLdlP6lA",
19
+ "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI5OGE0NzYxMy04ZGIyLTRlZjUtYjA0Mi01ZDU3MWRkZjIwMWIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4Mzg3NTIyNiwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY4Mzg3ODgyNiwiaWF0IjoxNjgzODc1MjI2LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.EtgmT_THMx-Zy_zB5yZK4gz6TXNTVVJEKFt5X0JK2UkGVrp_q_92YCEuejS4n976fyTez0jkwOee6IkVHLV71uZWRBDFt-3Yw4ZxfsZYPNJWhoHXGNxhMU8MCkSntfu597esBTk-VsUpstT5R7L-WJfN8viE7R-qVo-42RlPTG0TFrWA9q0oTcqjv8vbxLpOBUjiEpjmqRhg4blJZwgkGNta6MOlw1vfmisOVbo9wMvqwnCZ9xx9KMKoH9U4uNObK_JomjbvPmTmkcUXsE-wGSD7XcoSwtuhBngLC7-jiu1u8MvL_ff5Z0Qp70sSpLdUglcSS8d1Xf7j_fcZuJ5jKA",
20
20
  productSelected: {
21
- orderId: 15160,
22
- status: "SAC",
23
- datasheet_status: "SAC",
21
+ orderId: 14606,
22
+ status: "RA",
23
+ datasheet_status: "RA",
24
24
  prio: "none",
25
- version: 7,
26
- description_status: "SAC",
27
- images_status: "SAC",
28
- brand: null,
29
- retailerOrder: 1,
30
- missing: {
31
- datasheet: null,
32
- descriptions: null,
33
- images: null,
25
+ version: 3,
26
+ description_status: "RA",
27
+ images_status: "RA",
28
+ statusByRetailer: {
29
+ 4: {
30
+ datasheet: "RA/AC",
31
+ description: "RA/AC",
32
+ images: "RA/AC",
33
+ },
34
+ 5: {
35
+ datasheet: "RA/AC",
36
+ description: "RA/AC",
37
+ images: "RA/AC",
38
+ },
39
+ 6: {
40
+ description: "RA/AC",
41
+ images: "RA/AC",
42
+ datasheet: "RA/AC",
43
+ },
44
+ 12: {
45
+ datasheet: "RA/AC",
46
+ description: "RA/AC",
47
+ images: "RA/AC",
48
+ },
49
+ 17: {
50
+ datasheet: "RA/AC",
51
+ description: "RA/AC",
52
+ images: "RA/AC",
53
+ },
34
54
  },
35
- services: {
36
- datasheets: 1,
37
- descriptions: 1,
38
- images: 1,
55
+ orderId: 15209,
56
+ status: "ACA",
57
+ datasheet_status: "ACA",
58
+ prio: "none",
59
+ version: 3,
60
+ description_status: "ACA",
61
+ images_status: "ACA",
62
+ statusByRetailer: {
63
+ 70: {
64
+ datasheet: "ACA",
65
+ description: "ACA",
66
+ images: "ACA",
67
+ },
39
68
  },
40
69
  article: {
41
- category: "Puertas y Ventanas|Molduras|Molduras Madera Blanda",
42
- company_name: "Demo",
70
+ id_article: 39390,
71
+ id_category: "4311",
72
+ name: "test demo 1",
73
+ upc: "2312312313",
74
+ timestamp: "2023-05-12T20:07:42.000Z",
75
+ id_user: 133,
76
+ status: "NULL",
77
+ active: 1,
78
+ company_id: 912,
79
+ company_name: "GRUPO BRAHMA",
43
80
  country: "México",
44
- id_category: "2366",
45
- id_datasheet_especialist: null,
46
- id_datasheet_facilitator: null,
47
- id_description_especialist: null,
48
- id_description_facilitator: null,
49
- id_images_especialist: null,
50
- id_images_facilitator: null,
51
- id_order: 15160,
52
- id_article: 39290,
53
- id_auditor: 37,
54
- name: "MOLDURA MARCO MODER 11X4X244 CM",
55
- timestamp: "2023-04-19T21:36:02.000Z",
56
- upc: "100030",
81
+ id_order: 15209,
82
+ id_datasheet_especialist: 232,
83
+ id_datasheet_facilitator: 52,
84
+ id_description_especialist: 232,
85
+ id_description_facilitator: 52,
86
+ id_images_especialist: 196,
87
+ id_images_facilitator: 53,
88
+ id_auditor: 195,
89
+ id_recepcionist: null,
90
+ category: "Ropa Interior Dama|Ropa Interior|Ropa Interior",
91
+ missingAttributes: 0,
92
+ missingDescriptions: 0,
93
+ missingImages: 0,
57
94
  },
58
95
  retailers: [
59
96
  {
60
- id: 58,
61
- name: "The Home Depot Golden",
62
- },
63
- {
64
- id: 68,
65
- name: "The Home Depot Merchants",
97
+ id: 70,
98
+ name: "Bodega Aurrera",
66
99
  },
67
100
  ],
68
- statusByRetailer: {
69
- 58: {
70
- datasheet: "SAC",
71
- description: "SAC",
72
- images: "SAC",
73
- },
74
- },
75
101
  },
76
102
  location: {
77
- product: { articleId: 39290, versionId: 7 },
103
+ product: { articleId: 354, versionId: 3 },
104
+ state: {
105
+ withChat: true,
106
+ chatType: "product_status",
107
+ },
78
108
  },
79
109
  user: {
80
110
  id_user: 51,