contentoh-components-library 21.4.63 → 21.4.65

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 (114) hide show
  1. package/dist/components/atoms/Avatar/index.js +3 -2
  2. package/dist/components/atoms/CheckBox/styles.js +1 -1
  3. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  4. package/dist/components/atoms/SliderToolTip/styles.js +1 -1
  5. package/dist/components/molecules/BoxAttribute/index.js +3 -3
  6. package/dist/components/molecules/BoxAttribute/styles.js +1 -1
  7. package/dist/components/molecules/BoxButtons/index.js +0 -1
  8. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  9. package/dist/components/molecules/HeaderTop/index.js +68 -11
  10. package/dist/components/molecules/SignInLogin/index.js +36 -28
  11. package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +1 -2
  12. package/dist/components/organisms/Chat/Chat.stories.js +27 -8
  13. package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
  14. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  15. package/dist/components/organisms/Chat/ContentChat/index.js +350 -197
  16. package/dist/components/organisms/Chat/Footer/index.js +48 -39
  17. package/dist/components/organisms/Chat/index.js +49 -4
  18. package/dist/components/organisms/Chat/styles.js +1 -1
  19. package/dist/components/organisms/DashboardMetric/index.js +12 -6
  20. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  21. package/dist/components/organisms/InputGroup/index.js +1 -10
  22. package/dist/components/organisms/Modal/styles.js +1 -1
  23. package/dist/components/pages/Dashboard/Dashboard.stories.js +33 -36
  24. package/dist/components/pages/Dashboard/index.js +34 -8
  25. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +3 -3
  26. package/dist/components/pages/ProviderProductEdition/index.js +120 -144
  27. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  28. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +7 -3
  29. package/dist/components/pages/RetailerProductEdition/index.js +279 -277
  30. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  31. package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
  32. package/dist/global-files/data.js +11 -3
  33. package/dist/global-files/variables.js +5 -1
  34. package/dist/index.js +201 -58
  35. package/package.json +2 -1
  36. package/src/components/atoms/Avatar/index.js +8 -2
  37. package/src/components/atoms/CheckBox/styles.js +2 -0
  38. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
  39. package/src/components/atoms/ImageCarousel/index.js +103 -0
  40. package/src/components/atoms/ImageCarousel/styles.js +79 -0
  41. package/src/components/atoms/InputFormatter/styles.js +2 -1
  42. package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
  43. package/src/components/atoms/PercentTag/index.js +9 -0
  44. package/src/components/atoms/PercentTag/styles.js +69 -0
  45. package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
  46. package/src/components/atoms/RatingStars/index.js +31 -0
  47. package/src/components/atoms/RatingStars/styles.js +28 -0
  48. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
  49. package/src/components/atoms/RetailerCatalog/index.js +49 -0
  50. package/src/components/atoms/RetailerCatalog/styles.js +30 -0
  51. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
  52. package/src/components/atoms/RetailerOption/index.js +53 -0
  53. package/src/components/atoms/RetailerOption/styles.js +41 -0
  54. package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
  55. package/src/components/atoms/RetailersList/index.js +20 -0
  56. package/src/components/atoms/RetailersList/styles.js +19 -0
  57. package/src/components/atoms/SliderToolTip/styles.js +1 -1
  58. package/src/components/atoms/TabSection/styles.js +1 -1
  59. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +67 -0
  60. package/src/components/atoms/UserCatalog/index.js +100 -0
  61. package/src/components/atoms/UserCatalog/styles.js +24 -0
  62. package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
  63. package/src/components/atoms/UserOption/index.js +95 -0
  64. package/src/components/atoms/UserOption/styles.js +61 -0
  65. package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
  66. package/src/components/atoms/UserSelector/index.js +86 -0
  67. package/src/components/atoms/UserSelector/styles.js +55 -0
  68. package/src/components/molecules/BoxAttribute/index.js +32 -25
  69. package/src/components/molecules/BoxAttribute/styles.js +1 -1
  70. package/src/components/molecules/BoxButtons/index.js +23 -22
  71. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  72. package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
  73. package/src/components/molecules/GridItem/index.js +105 -0
  74. package/src/components/molecules/GridItem/styles.js +104 -0
  75. package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
  76. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
  77. package/src/components/molecules/HeaderItem/index.js +26 -0
  78. package/src/components/molecules/HeaderItem/styles.js +27 -0
  79. package/src/components/molecules/HeaderTop/index.js +52 -6
  80. package/src/components/molecules/RowItem/ColumnItem.js +9 -0
  81. package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
  82. package/src/components/molecules/RowItem/index.js +45 -0
  83. package/src/components/molecules/RowItem/styles.js +40 -0
  84. package/src/components/molecules/SignInLogin/index.js +11 -11
  85. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +1 -2
  86. package/src/components/molecules/TagAndInput/index.js +6 -5
  87. package/src/components/organisms/Chat/Chat.stories.js +27 -7
  88. package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
  89. package/src/components/organisms/Chat/ContainerItems/styles.js +14 -2
  90. package/src/components/organisms/Chat/ContentChat/index.js +88 -12
  91. package/src/components/organisms/Chat/Footer/index.js +11 -0
  92. package/src/components/organisms/Chat/index.js +46 -4
  93. package/src/components/organisms/Chat/styles.js +4 -0
  94. package/src/components/organisms/DashboardMetric/index.js +6 -3
  95. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  96. package/src/components/organisms/GridProducts/GridProducts.stories.js +5485 -0
  97. package/src/components/organisms/GridProducts/index.js +50 -0
  98. package/src/components/organisms/GridProducts/styles.js +14 -0
  99. package/src/components/organisms/GridProducts/utils.js +111 -0
  100. package/src/components/organisms/InputGroup/index.js +131 -119
  101. package/src/components/organisms/Modal/styles.js +4 -1
  102. package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
  103. package/src/components/pages/Dashboard/Dashboard.stories.js +33 -38
  104. package/src/components/pages/Dashboard/index.js +31 -5
  105. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +100 -83
  106. package/src/components/pages/ProviderProductEdition/index.js +100 -131
  107. package/src/components/pages/ProviderProductEdition/styles.js +5 -1
  108. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +6 -2
  109. package/src/components/pages/RetailerProductEdition/index.js +114 -145
  110. package/src/components/pages/RetailerProductEdition/styles.js +4 -0
  111. package/src/components/pages/RetailerProductEdition/utils.js +37 -0
  112. package/src/global-files/data.js +7 -13
  113. package/src/global-files/variables.js +4 -0
  114. package/src/index.js +11 -0
@@ -24,15 +24,20 @@ import descriptionSent from "../../../assets/images/modalsSVGs/descriptionSent.s
24
24
  import imagesSent from "../../../assets/images/modalsSVGs/uploadingImages.svg";
25
25
  import { TagAndInput } from "../../molecules/TagAndInput/index";
26
26
  import { Button } from "../../atoms/GeneralButton";
27
- import { Commentary } from "../../atoms/Commentary";
28
27
  import { GenericModal } from "../../atoms/GenericModal";
29
28
  import { ScreenHeader } from "../../atoms/ScreenHeader";
30
29
  import { Loading } from "../../atoms/Loading";
31
30
  import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
32
- import errorModal from "../../../assets/images/genericModal/errorModal.svg";
33
31
  import { VersionSelector } from "../../organisms/VersionSelector";
34
32
  import { useCloseModal } from "../../../global-files/customHooks";
35
- import { getAuditVersion, getInputsData } from "./utils";
33
+ import {
34
+ getAuditVersion,
35
+ getInputsData,
36
+ createMessage,
37
+ sendMessage,
38
+ } from "./utils";
39
+ import { Modal } from "../../organisms/Modal";
40
+ import { ButtonV2 } from "../../atoms/ButtonV2";
36
41
 
37
42
  const reducerImages = (state, action) => {
38
43
  let { values, attrForImgs, inputsByRetailer } = state;
@@ -132,6 +137,7 @@ export const RetailerProductEdition = ({
132
137
  const [datasheets, setDatasheets] = useState([]);
133
138
  const [images, setImages] = useReducer(reducerImages, {});
134
139
  const [showModal, setShowModal] = useState(false);
140
+ const [showRejectModal, setShowRejectModal] = useState(false);
135
141
  const { getRootProps, getInputProps } = useDropzone({
136
142
  accept: "image/*",
137
143
  noKeyboard: true,
@@ -218,6 +224,11 @@ export const RetailerProductEdition = ({
218
224
  const [auditDescriptions, setAuditDescriptions] = useState([]);
219
225
  const [auditImages, setAuditImages] = useState([]);
220
226
  const [compare, setCompare] = useState(false);
227
+ const [valRejAll, setValRejAll] = useState(false);
228
+
229
+ const [desc, setDesc] = useState([]);
230
+ const [fich, setFich] = useState([]);
231
+ const [imag, setImag] = useState([]);
221
232
 
222
233
  useEffect(async () => {
223
234
  const { id_article } = product?.article || {};
@@ -563,6 +574,7 @@ export const RetailerProductEdition = ({
563
574
  active: images?.values?.some((value) => value?.image_id === e?.id),
564
575
  }));
565
576
  setSocketType(imageInputs);
577
+ console.log(images);
566
578
  }, [images]);
567
579
 
568
580
  const updateImages = useCallback(async () => {
@@ -829,7 +841,7 @@ export const RetailerProductEdition = ({
829
841
  let message;
830
842
  if (result) {
831
843
  body.isAproved = result === "A";
832
- res = await axios.put(
844
+ res = await axios.post(
833
845
  `${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
834
846
  body,
835
847
  {
@@ -850,7 +862,7 @@ export const RetailerProductEdition = ({
850
862
  message = "Evaluación enviada";
851
863
  getSectionIcon();
852
864
  }
853
- res = await axios.put(
865
+ res = await axios.post(
854
866
  `${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
855
867
  body,
856
868
  {
@@ -861,11 +873,30 @@ export const RetailerProductEdition = ({
861
873
  );
862
874
  }
863
875
  if (res.data.statusCode === 200) {
864
- const response = JSON.parse(res.data.body)?.successfulData;
865
- const statusObject =
866
- response[`${orderId}-${articleId}-${activeRetailer.id}`];
867
- productTemp.status = statusObject["generalStatus"];
868
- productTemp[`${concept}_status`] = statusObject[`${concept}Status`];
876
+ const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
877
+ res.data.body
878
+ );
879
+ const messageToChat = createMessage(
880
+ product.retailers,
881
+ activeRetailer.id,
882
+ evalStatus,
883
+ newStatus,
884
+ activeTab
885
+ );
886
+
887
+ const data = {
888
+ paramsBody: {
889
+ id: product.article.id_article,
890
+ version: version,
891
+ items: [{ type: "status", value: messageToChat }],
892
+ retailerId: activeRetailer.id,
893
+ status: product.status,
894
+ },
895
+ paramsHeader: { Authorization: token },
896
+ };
897
+ await sendMessage(data);
898
+ if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
899
+ productTemp[`${concept}_status`] = newStatus;
869
900
  await loadData();
870
901
  if (message) setMessage(message);
871
902
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
@@ -906,35 +937,19 @@ export const RetailerProductEdition = ({
906
937
  return product?.article[`id_auditor`] === user.id_user;
907
938
  };
908
939
 
909
- const createComment = async (e, body, tab) => {
910
- let concept = "";
911
- switch (activeTab) {
912
- case "Ficha técnica":
913
- concept = "datasheet";
914
- break;
915
- case "Imágenes":
916
- concept = "images";
917
- break;
918
-
919
- default:
920
- concept = "description";
921
- break;
922
- }
940
+ const createComment = async (messages = [], retailerId) => {
923
941
  const data = {
924
- articleId: product?.article?.id_article,
925
- orderId: product?.orderId,
926
- message: body?.replace(/<.*?\/?>/gm, ""),
927
- concept: concept,
928
- version: version,
929
- };
930
- await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
931
- headers: {
932
- Authorization: token,
942
+ paramsBody: {
943
+ id: product.article.id_article,
944
+ version: version,
945
+ items: messages,
946
+ retailerId: retailerId,
947
+ status: product.status,
933
948
  },
934
- });
935
- await getComments(tab);
949
+ paramsHeader: { Authorization: token },
950
+ };
936
951
  setMessage("");
937
- setComponentsArray([]);
952
+ return sendMessage(data);
938
953
  };
939
954
 
940
955
  const getRequired = (services) => {
@@ -1186,6 +1201,7 @@ export const RetailerProductEdition = ({
1186
1201
  };
1187
1202
 
1188
1203
  useEffect(() => {
1204
+ console.log(servicesData, "servicesData");
1189
1205
  let status = getRetailerStatus(servicesData, activeTab);
1190
1206
  setRetailerStatus(status);
1191
1207
  }, [activeTab, servicesData, activeRetailer]);
@@ -1216,8 +1232,8 @@ export const RetailerProductEdition = ({
1216
1232
  break;
1217
1233
  }
1218
1234
 
1219
- const isAproved = result === "A";
1220
- const retailersIds = [];
1235
+ const messages = [];
1236
+
1221
1237
  servicesData?.forEach((ret) => {
1222
1238
  if (!retailersIds.includes(ret.id_retailer))
1223
1239
  retailersIds.push(ret.id_retailer);
@@ -1235,26 +1251,26 @@ export const RetailerProductEdition = ({
1235
1251
  conceptArray.forEach((concept) => {
1236
1252
  body.service = concept;
1237
1253
  evaluationArray.push(
1238
- axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, body, {
1254
+ axios.post(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, body, {
1239
1255
  headers: {
1240
1256
  Authorization: token,
1241
1257
  },
1242
1258
  })
1243
1259
  );
1244
1260
  });
1245
-
1246
1261
  await Promise.all(evaluationArray);
1247
1262
 
1248
1263
  const productTemp = product;
1249
1264
  productTemp.status = `${result}A`;
1250
1265
  productTemp.datasheet_status =
1251
- productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
1266
+ productTemp.datasheet_status === "NS" ? "NS" : `${result}A`;
1252
1267
  productTemp.description_status =
1253
- productTemp.description_status === "NA" ? "NA" : `${result}A`;
1268
+ productTemp.description_status === "NS" ? "NS" : `${result}A`;
1254
1269
  productTemp.images_status =
1255
- productTemp.images_status === "NA" ? "NA" : `${result}A`;
1270
+ productTemp.images_status === "NS" ? "NS" : `${result}A`;
1256
1271
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1257
1272
  setProduct(productTemp);
1273
+ const messagesResponse = await Promise.all(messages);
1258
1274
 
1259
1275
  await loadData();
1260
1276
  } catch (error) {
@@ -1270,8 +1286,10 @@ export const RetailerProductEdition = ({
1270
1286
  setCompare={setCompare}
1271
1287
  isAuditor={[1, 6].includes(user.id_role)}
1272
1288
  withChat={location?.state?.withChat}
1273
- productSelected={productSelected}
1289
+ chatType={location?.state?.chatType}
1290
+ productSelected={product}
1274
1291
  token={token}
1292
+ activeRetailer={activeRetailer}
1275
1293
  />
1276
1294
  <div className="data-container">
1277
1295
  <div className="image-data-panel">
@@ -1311,36 +1329,7 @@ export const RetailerProductEdition = ({
1311
1329
  sendToFacilitator("A");
1312
1330
  }}
1313
1331
  reject={() => {
1314
- sendToFacilitator("R");
1315
- setMessage("Rechazado");
1316
- setComponentsArray([
1317
- <img src={errorModal} />,
1318
- <ScreenHeader
1319
- text={"Agrega tu comentarios para enviar el rechazo"}
1320
- headerType={"input-name-header"}
1321
- color={"white"}
1322
- />,
1323
- <TagAndInput
1324
- label={"Caja de Comentario"}
1325
- inputType={"textarea"}
1326
- inputId={"modal-commentary-box"}
1327
- index={0}
1328
- color={"white"}
1329
- />,
1330
- <Button
1331
- buttonType={"general-default-button"}
1332
- label={"Enviar comentario"}
1333
- onClick={(e) =>
1334
- createComment(
1335
- e,
1336
- document.querySelector(
1337
- "#modal-commentary-box .ql-container .ql-editor > p"
1338
- ).innerHTML,
1339
- activeTab
1340
- )
1341
- }
1342
- />,
1343
- ]);
1332
+ setShowRejectModal(true);
1344
1333
  }}
1345
1334
  showApproveRejectAll={
1346
1335
  approveRejectAllButtons() && (auditorAssigned() || userAssigned())
@@ -1350,36 +1339,8 @@ export const RetailerProductEdition = ({
1350
1339
  }
1351
1340
  approveAll={() => validateAll("A")}
1352
1341
  rejectAll={() => {
1353
- validateAll("R");
1354
- setMessage("Rechazado");
1355
- setComponentsArray([
1356
- <img src={errorModal} />,
1357
- <ScreenHeader
1358
- text={"Agrega tu comentarios para enviar el rechazo"}
1359
- headerType={"input-name-header"}
1360
- color={"white"}
1361
- />,
1362
- <TagAndInput
1363
- label={"Caja de Comentario"}
1364
- inputType={"textarea"}
1365
- inputId={"modal-commentary-box"}
1366
- index={0}
1367
- color={"white"}
1368
- />,
1369
- <Button
1370
- buttonType={"general-default-button"}
1371
- label={"Enviar comentario"}
1372
- onClick={(e) =>
1373
- createComment(
1374
- e,
1375
- document.querySelector(
1376
- "#modal-commentary-box .ql-container .ql-editor > p"
1377
- ).innerHTML,
1378
- activeTab
1379
- )
1380
- }
1381
- />,
1382
- ]);
1342
+ setShowRejectModal(true);
1343
+ setValRejAll(true);
1383
1344
  }}
1384
1345
  />
1385
1346
  <FullTabsMenu
@@ -1395,6 +1356,12 @@ export const RetailerProductEdition = ({
1395
1356
  isRetailer={isRetailer}
1396
1357
  showSaveButton={auditorAssigned() || userAssigned()}
1397
1358
  version={version}
1359
+ desc={desc}
1360
+ setDesc={setDesc}
1361
+ fich={fich}
1362
+ setFich={setFich}
1363
+ imag={imag}
1364
+ setImag={setImag}
1398
1365
  updatedDescriptions={updatedDescriptions}
1399
1366
  setUpdatedDescriptions={setUpdatedDescriptions}
1400
1367
  updatedDatasheets={updatedDatasheets}
@@ -1509,47 +1476,6 @@ export const RetailerProductEdition = ({
1509
1476
  {(userAssigned(activeTab) || auditorAssigned()) &&
1510
1477
  product[`${getConcept(activeTab)}_status`] !== "NS" && (
1511
1478
  <div className="commentary-box">
1512
- {!comment ? (
1513
- <div className="commentary">
1514
- <TagAndInput
1515
- label={"Caja de Comentario"}
1516
- inputType={"textarea"}
1517
- inputCols={80}
1518
- inputRows={4}
1519
- inputId={"commentary-box"}
1520
- index={0}
1521
- />
1522
- <div className="buttons-box">
1523
- <Button
1524
- buttonType={"general-transparent-button"}
1525
- label={"Enviar comentario"}
1526
- onClick={(e) =>
1527
- createComment(
1528
- e,
1529
- document.querySelector(
1530
- "#commentary-box .ql-container .ql-editor > p"
1531
- ).innerHTML,
1532
- activeTab
1533
- )
1534
- }
1535
- />
1536
- </div>
1537
- </div>
1538
- ) : (
1539
- <div className="feedback-box">
1540
- <Commentary
1541
- comment={comment?.message?.replace(/<.*?\/?>/gm, "")}
1542
- reviewed={crossComment}
1543
- />
1544
- <Button
1545
- buttonType={"circular-button accept-button"}
1546
- onClick={async () => {
1547
- setCrossComment(true);
1548
- commentRevised();
1549
- }}
1550
- />
1551
- </div>
1552
- )}
1553
1479
  {[7, 8].includes(user.id_role) && (
1554
1480
  <Button
1555
1481
  buttonType={
@@ -1607,6 +1533,49 @@ export const RetailerProductEdition = ({
1607
1533
  jwt={token}
1608
1534
  />
1609
1535
  )}
1536
+ {showRejectModal && (
1537
+ <Modal
1538
+ title={`Agregar mensaje de rechazo para ${activeTab?.toLowerCase()}`}
1539
+ show={showRejectModal}
1540
+ customComponent={
1541
+ <TagAndInput
1542
+ inputType={"textarea"}
1543
+ inputId={"modal-message-box"}
1544
+ index={0}
1545
+ color={"white"}
1546
+ />
1547
+ }
1548
+ buttons={[
1549
+ <ButtonV2
1550
+ key={"btn-Cancelar"}
1551
+ type={"white"}
1552
+ label={"Cancelar"}
1553
+ size={12}
1554
+ onClick={() => {
1555
+ setShowRejectModal(false);
1556
+ }}
1557
+ />,
1558
+ <ButtonV2
1559
+ key={"btn-Aceptar"}
1560
+ type={"pink"}
1561
+ label={"Aceptar"}
1562
+ size={12}
1563
+ onClick={async () => {
1564
+ const body = document.querySelector(
1565
+ "#modal-message-box .ql-container .ql-editor > p"
1566
+ ).innerHTML;
1567
+ const messages = [
1568
+ { type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
1569
+ ];
1570
+ await createComment(messages, activeRetailer.id);
1571
+ valRejAll ? validateAll("R") : sendToFacilitator("R");
1572
+ setMessage("Rechazado");
1573
+ setShowRejectModal(false);
1574
+ }}
1575
+ />,
1576
+ ]}
1577
+ />
1578
+ )}
1610
1579
  </Container>
1611
1580
  );
1612
1581
  };
@@ -89,6 +89,10 @@ export const Container = styled.div`
89
89
  }
90
90
  }
91
91
  }
92
+ #modal-message-box {
93
+ width: 400px;
94
+ height: 100px;
95
+ }
92
96
  .container {
93
97
  width: 100%;
94
98
  height: 100%;
@@ -1,4 +1,5 @@
1
1
  import axios from "axios";
2
+ import { fetchPOST } from "../../../global-files/handle_http";
2
3
 
3
4
  export const getAuditVersion = async (articleId, setState, token) => {
4
5
  const auditResponse = await axios.get(
@@ -32,3 +33,39 @@ export const getInputsData = (
32
33
  setDescriptionState(descriptions);
33
34
  }
34
35
  };
36
+
37
+ export const translateService = (tab) => {
38
+ switch (tab) {
39
+ case "description":
40
+ case "Descripción":
41
+ return "Descripciones";
42
+ case "datasheet":
43
+ case "Ficha técnica":
44
+ return "Fichas técnicas";
45
+ case "images":
46
+ case "Imágenes":
47
+ return "Imágenes";
48
+ }
49
+ };
50
+
51
+ export const createMessage = (
52
+ retailers,
53
+ idRetailer,
54
+ oldStatus,
55
+ newStatus,
56
+ service
57
+ ) => {
58
+ const [retailer] = retailers?.filter((ret) => ret.id === idRetailer) || [];
59
+ return `${translateService(service)} de ${
60
+ retailer.name
61
+ } |${oldStatus}| a |${newStatus}`;
62
+ };
63
+
64
+ export const sendMessage = async (data) => {
65
+ const { paramsBody, paramsHeader } = data;
66
+ return fetchPOST(
67
+ process.env.REACT_APP_CREATE_MESSAGES,
68
+ paramsBody,
69
+ paramsHeader
70
+ );
71
+ };
@@ -7,29 +7,23 @@ export const getRetailerServices = async (
7
7
  category,
8
8
  categoryId,
9
9
  version,
10
- token
10
+ Authorization
11
11
  ) => {
12
12
  try {
13
13
  const responseArray = await Promise.all([
14
14
  axios.post(
15
15
  `${process.env.REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}`,
16
- {
17
-
18
- },
19
- {
20
- headers: {
21
- Authorization: token,
22
- },
23
- }
16
+ {},
17
+ { headers: { Authorization } }
24
18
  ),
25
19
  axios.get(
26
- `${process.env.REACT_APP_ARTICLE_DATA_DESCRIPTION_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}`
20
+ `${process.env.REACT_APP_ARTICLE_DATA_DESCRIPTION_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}`,
21
+ { headers: { Authorization } }
27
22
  ),
28
23
  axios.post(
29
24
  `${process.env.REACT_APP_ARTICLE_DATA_IMAGES_ENDPOINT}?articleId=${articleId}&version=${version}`,
30
- {
31
- category,
32
- }
25
+ { category },
26
+ { headers: { Authorization } }
33
27
  ),
34
28
  ]);
35
29
 
@@ -15,6 +15,10 @@ export const GlobalColors = {
15
15
  finished: "#18A0FB",
16
16
  exported: "#71DE56",
17
17
  white: "#FFFFFF",
18
+ gray_light: "#F0F0F0",
19
+ gray:"#707070",
20
+ blue_light:"#F7F7FC",
21
+ purple:"#8A6CAA",
18
22
  };
19
23
 
20
24
  export const FontFamily = {
package/src/index.js CHANGED
@@ -33,6 +33,13 @@ export * from "./components/atoms/ImagePreview/index";
33
33
  export * from "./components/atoms/InputText/index";
34
34
  export * from "./components/atoms/NotFound/index";
35
35
  export * from "./components/atoms/Tooltip/index";
36
+ export * from "./components/atoms/UserOption/index";
37
+ export * from "./components/atoms/UserCatalog/index";
38
+ export * from "./components/atoms/UserSelector/index";
39
+ export * from "./components/atoms/ImageCarousel/index";
40
+ export * from "./components/atoms/RetailersList/index";
41
+ export * from "./components/atoms/RetailerOption/index";
42
+ export * from "./components/atoms/RetailerCatalog/index";
36
43
 
37
44
  //molecules
38
45
  export * from "./components/molecules/AvatarAndValidation/index";
@@ -65,6 +72,9 @@ export * from "./components/molecules/SelectV2/index";
65
72
  export * from "./components/molecules/Dropdown/index";
66
73
  export * from "./components/molecules/StripeCardForm/index";
67
74
  export * from "./components/molecules/StripeCardSelector/index";
75
+ export * from "./components/molecules/GridItem/index";
76
+ export * from "./components/molecules/HeaderItem/index";
77
+ export * from "./components/molecules/RowItem/index";
68
78
 
69
79
  //organisms
70
80
  export * from "./components/organisms/ChangePassword/index";
@@ -82,6 +92,7 @@ export * from "./components/organisms/OrderDetail/index";
82
92
  export * from "./components/organisms/RangeCalendar";
83
93
  export * from "./components/organisms/TableResizable";
84
94
  export * from "./components/organisms/SideModal/index";
95
+ export * from "./components/organisms/GridProducts/index";
85
96
  export * from "./components/organisms/PanelLayout";
86
97
 
87
98
  //pages