contentoh-components-library 21.4.7 → 21.4.9

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 (108) hide show
  1. package/.env.development +1 -5
  2. package/.env.production +1 -3
  3. package/dist/assets/fonts/roboto/LICENSE.txt +202 -0
  4. package/dist/components/atoms/Avatar/index.js +2 -3
  5. package/dist/components/atoms/Card/index.js +5 -46
  6. package/dist/components/atoms/Card/styles.js +1 -3
  7. package/dist/components/atoms/CheckBox/index.js +2 -7
  8. package/dist/components/atoms/CheckBox/styles.js +1 -1
  9. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  10. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  11. package/dist/components/molecules/HeaderTop/index.js +11 -68
  12. package/dist/components/molecules/TagAndInput/index.js +1 -1
  13. package/dist/components/organisms/Chat/Chat.stories.js +8 -27
  14. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  15. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  16. package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
  17. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  18. package/dist/components/organisms/Chat/index.js +4 -49
  19. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  20. package/dist/components/organisms/Modal/styles.js +1 -1
  21. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +29 -169
  22. package/dist/components/pages/ProviderProductEdition/index.js +203 -213
  23. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  24. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +60 -85
  25. package/dist/components/pages/RetailerProductEdition/index.js +303 -315
  26. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  27. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  28. package/dist/index.js +52 -234
  29. package/package.json +1 -4
  30. package/src/components/atoms/Avatar/index.js +2 -8
  31. package/src/components/atoms/Card/index.js +2 -35
  32. package/src/components/atoms/Card/styles.js +5 -41
  33. package/src/components/atoms/CheckBox/index.js +1 -4
  34. package/src/components/atoms/CheckBox/styles.js +0 -2
  35. package/src/components/atoms/InputFormatter/styles.js +1 -2
  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 -10
  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/FullProductNameHeader/index.js +1 -1
  46. package/src/components/organisms/Modal/styles.js +1 -4
  47. package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
  48. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +34 -188
  49. package/src/components/pages/ProviderProductEdition/index.js +132 -132
  50. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  51. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -72
  52. package/src/components/pages/RetailerProductEdition/index.js +138 -122
  53. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  54. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  55. package/src/index.js +0 -15
  56. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
  57. package/src/components/atoms/ImageCarousel/index.js +0 -103
  58. package/src/components/atoms/ImageCarousel/styles.js +0 -79
  59. package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
  60. package/src/components/atoms/PercentTag/index.js +0 -9
  61. package/src/components/atoms/PercentTag/styles.js +0 -69
  62. package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
  63. package/src/components/atoms/RatingStars/index.js +0 -31
  64. package/src/components/atoms/RatingStars/styles.js +0 -28
  65. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
  66. package/src/components/atoms/RetailerCatalog/index.js +0 -49
  67. package/src/components/atoms/RetailerCatalog/styles.js +0 -30
  68. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
  69. package/src/components/atoms/RetailerOption/index.js +0 -53
  70. package/src/components/atoms/RetailerOption/styles.js +0 -41
  71. package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
  72. package/src/components/atoms/RetailersList/index.js +0 -20
  73. package/src/components/atoms/RetailersList/styles.js +0 -19
  74. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
  75. package/src/components/atoms/UserCatalog/index.js +0 -96
  76. package/src/components/atoms/UserCatalog/styles.js +0 -24
  77. package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
  78. package/src/components/atoms/UserOption/index.js +0 -95
  79. package/src/components/atoms/UserOption/styles.js +0 -61
  80. package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
  81. package/src/components/atoms/UserSelector/index.js +0 -86
  82. package/src/components/atoms/UserSelector/styles.js +0 -55
  83. package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
  84. package/src/components/molecules/GridItem/index.js +0 -97
  85. package/src/components/molecules/GridItem/styles.js +0 -104
  86. package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
  87. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
  88. package/src/components/molecules/HeaderItem/index.js +0 -26
  89. package/src/components/molecules/HeaderItem/styles.js +0 -27
  90. package/src/components/molecules/RowItem/ColumnItem.js +0 -9
  91. package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
  92. package/src/components/molecules/RowItem/index.js +0 -45
  93. package/src/components/molecules/RowItem/styles.js +0 -40
  94. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
  95. package/src/components/molecules/StripeCardForm/index.js +0 -42
  96. package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
  97. package/src/components/molecules/StripeCardForm/styles.js +0 -73
  98. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
  99. package/src/components/molecules/StripeCardSelector/index.js +0 -44
  100. package/src/components/molecules/StripeCardSelector/styles.js +0 -4
  101. package/src/components/molecules/StripeCardSelector/utils.js +0 -17
  102. package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
  103. package/src/components/organisms/GridProducts/index.js +0 -50
  104. package/src/components/organisms/GridProducts/styles.js +0 -14
  105. package/src/components/organisms/GridProducts/utils.js +0 -111
  106. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  107. package/src/components/organisms/SideModal/index.js +0 -50
  108. package/src/components/organisms/SideModal/styles.js +0 -30
@@ -24,20 +24,15 @@ 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";
27
28
  import { GenericModal } from "../../atoms/GenericModal";
28
29
  import { ScreenHeader } from "../../atoms/ScreenHeader";
29
30
  import { Loading } from "../../atoms/Loading";
30
31
  import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
32
+ import errorModal from "../../../assets/images/genericModal/errorModal.svg";
31
33
  import { VersionSelector } from "../../organisms/VersionSelector";
32
34
  import { useCloseModal } from "../../../global-files/customHooks";
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";
35
+ import { getAuditVersion, getInputsData } from "./utils";
41
36
 
42
37
  const reducerImages = (state, action) => {
43
38
  let { values, attrForImgs, inputsByRetailer } = state;
@@ -137,7 +132,6 @@ export const RetailerProductEdition = ({
137
132
  const [datasheets, setDatasheets] = useState([]);
138
133
  const [images, setImages] = useReducer(reducerImages, {});
139
134
  const [showModal, setShowModal] = useState(false);
140
- const [showRejectModal, setShowRejectModal] = useState(false);
141
135
  const { getRootProps, getInputProps } = useDropzone({
142
136
  accept: "image/*",
143
137
  noKeyboard: true,
@@ -224,11 +218,6 @@ export const RetailerProductEdition = ({
224
218
  const [auditDescriptions, setAuditDescriptions] = useState([]);
225
219
  const [auditImages, setAuditImages] = useState([]);
226
220
  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([]);
232
221
 
233
222
  useEffect(async () => {
234
223
  const { id_article } = product?.article || {};
@@ -513,6 +502,7 @@ export const RetailerProductEdition = ({
513
502
  JSON.stringify(productTemp)
514
503
  );
515
504
 
505
+ setUpdatedDescriptions([]);
516
506
  setMessage("Descripciones guardadas con éxito");
517
507
  await loadData();
518
508
  }
@@ -553,7 +543,7 @@ export const RetailerProductEdition = ({
553
543
  "productSelected",
554
544
  JSON.stringify(productTemp)
555
545
  );
556
-
546
+ setUpdatedDatasheets([]);
557
547
  setMessage("Fichas técnicas guardadas");
558
548
  await loadData();
559
549
  }
@@ -571,7 +561,6 @@ export const RetailerProductEdition = ({
571
561
  active: images?.values?.some((value) => value?.image_id === e?.id),
572
562
  }));
573
563
  setSocketType(imageInputs);
574
- console.log(images);
575
564
  }, [images]);
576
565
 
577
566
  const updateImages = useCallback(async () => {
@@ -685,6 +674,7 @@ export const RetailerProductEdition = ({
685
674
  "productSelected",
686
675
  JSON.stringify(productTemp)
687
676
  );
677
+ setImages({});
688
678
  setMessage("Imágenes guardadas con éxito");
689
679
  sessionStorage.removeItem("imagesList");
690
680
  await loadData();
@@ -867,25 +857,6 @@ export const RetailerProductEdition = ({
867
857
  const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
868
858
  res.data.body
869
859
  );
870
- const messageToChat = createMessage(
871
- product.retailers,
872
- activeRetailer.id,
873
- evalStatus,
874
- newStatus,
875
- activeTab
876
- );
877
-
878
- const data = {
879
- paramsBody: {
880
- id: product.article.id_article,
881
- version: version,
882
- items: [{ type: "status", value: messageToChat }],
883
- retailerId: activeRetailer.id,
884
- status: product.status,
885
- },
886
- paramsHeader: { Authorization: token },
887
- };
888
- await sendMessage(data);
889
860
  if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
890
861
  productTemp[`${concept}_status`] = newStatus;
891
862
  await loadData();
@@ -928,19 +899,35 @@ export const RetailerProductEdition = ({
928
899
  return product?.article[`id_auditor`] === user.id_user;
929
900
  };
930
901
 
931
- const createComment = async (messages = [], retailerId) => {
902
+ const createComment = async (e, body, tab) => {
903
+ let concept = "";
904
+ switch (activeTab) {
905
+ case "Ficha técnica":
906
+ concept = "datasheet";
907
+ break;
908
+ case "Imágenes":
909
+ concept = "images";
910
+ break;
911
+
912
+ default:
913
+ concept = "description";
914
+ break;
915
+ }
932
916
  const data = {
933
- paramsBody: {
934
- id: product.article.id_article,
935
- version: version,
936
- items: messages,
937
- retailerId: retailerId,
938
- status: product.status,
939
- },
940
- paramsHeader: { Authorization: token },
917
+ articleId: product?.article?.id_article,
918
+ orderId: product?.orderId,
919
+ message: body?.replace(/<.*?\/?>/gm, ""),
920
+ concept: concept,
921
+ version: version,
941
922
  };
923
+ await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
924
+ headers: {
925
+ Authorization: token,
926
+ },
927
+ });
928
+ await getComments(tab);
942
929
  setMessage("");
943
- return sendMessage(data);
930
+ setComponentsArray([]);
944
931
  };
945
932
 
946
933
  const getRequired = (services) => {
@@ -1192,7 +1179,6 @@ export const RetailerProductEdition = ({
1192
1179
  };
1193
1180
 
1194
1181
  useEffect(() => {
1195
- console.log(servicesData, "servicesData");
1196
1182
  let status = getRetailerStatus(servicesData, activeTab);
1197
1183
  setRetailerStatus(status);
1198
1184
  }, [activeTab, servicesData, activeRetailer]);
@@ -1223,8 +1209,6 @@ export const RetailerProductEdition = ({
1223
1209
  break;
1224
1210
  }
1225
1211
 
1226
- const messages = [];
1227
-
1228
1212
  servicesData?.forEach((ret) => {
1229
1213
  if (conceptArray.includes(ret.service)) {
1230
1214
  let data = {
@@ -1235,21 +1219,6 @@ export const RetailerProductEdition = ({
1235
1219
  evalStatus: ret.status,
1236
1220
  retailerId: ret.id_retailer,
1237
1221
  };
1238
- if (product[`${ret.service}_status`] !== "NS") {
1239
- const message = createMessage(
1240
- product.retailers,
1241
- ret.id_retailer,
1242
- product[`${ret.service}_status`],
1243
- `${result}A`,
1244
- ret.service
1245
- );
1246
- messages.push(
1247
- createComment(
1248
- [{ type: "status", value: message }],
1249
- ret.id_retailer
1250
- )
1251
- );
1252
- }
1253
1222
  evaluationArray.push(
1254
1223
  axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
1255
1224
  headers: {
@@ -1259,19 +1228,19 @@ export const RetailerProductEdition = ({
1259
1228
  );
1260
1229
  }
1261
1230
  });
1231
+
1262
1232
  await Promise.all(evaluationArray);
1263
1233
 
1264
1234
  const productTemp = product;
1265
1235
  productTemp.status = `${result}A`;
1266
1236
  productTemp.datasheet_status =
1267
- productTemp.datasheet_status === "NS" ? "NS" : `${result}A`;
1237
+ productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
1268
1238
  productTemp.description_status =
1269
- productTemp.description_status === "NS" ? "NS" : `${result}A`;
1239
+ productTemp.description_status === "NA" ? "NA" : `${result}A`;
1270
1240
  productTemp.images_status =
1271
- productTemp.images_status === "NS" ? "NS" : `${result}A`;
1241
+ productTemp.images_status === "NA" ? "NA" : `${result}A`;
1272
1242
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1273
1243
  setProduct(productTemp);
1274
- const messagesResponse = await Promise.all(messages);
1275
1244
 
1276
1245
  await loadData();
1277
1246
  } catch (error) {
@@ -1287,10 +1256,8 @@ export const RetailerProductEdition = ({
1287
1256
  setCompare={setCompare}
1288
1257
  isAuditor={[1, 6].includes(user.id_role)}
1289
1258
  withChat={location?.state?.withChat}
1290
- chatType={location?.state?.chatType}
1291
- productSelected={product}
1259
+ productSelected={productSelected}
1292
1260
  token={token}
1293
- activeRetailer={activeRetailer}
1294
1261
  />
1295
1262
  <div className="data-container">
1296
1263
  <div className="image-data-panel">
@@ -1330,7 +1297,36 @@ export const RetailerProductEdition = ({
1330
1297
  sendToFacilitator("A");
1331
1298
  }}
1332
1299
  reject={() => {
1333
- setShowRejectModal(true);
1300
+ sendToFacilitator("R");
1301
+ setMessage("Rechazado");
1302
+ setComponentsArray([
1303
+ <img src={errorModal} />,
1304
+ <ScreenHeader
1305
+ text={"Agrega tu comentarios para enviar el rechazo"}
1306
+ headerType={"input-name-header"}
1307
+ color={"white"}
1308
+ />,
1309
+ <TagAndInput
1310
+ label={"Caja de Comentario"}
1311
+ inputType={"textarea"}
1312
+ inputId={"modal-commentary-box"}
1313
+ index={0}
1314
+ color={"white"}
1315
+ />,
1316
+ <Button
1317
+ buttonType={"general-default-button"}
1318
+ label={"Enviar comentario"}
1319
+ onClick={(e) =>
1320
+ createComment(
1321
+ e,
1322
+ document.querySelector(
1323
+ "#modal-commentary-box .ql-container .ql-editor > p"
1324
+ ).innerHTML,
1325
+ activeTab
1326
+ )
1327
+ }
1328
+ />,
1329
+ ]);
1334
1330
  }}
1335
1331
  showApproveRejectAll={
1336
1332
  approveRejectAllButtons() && (auditorAssigned() || userAssigned())
@@ -1340,8 +1336,36 @@ export const RetailerProductEdition = ({
1340
1336
  }
1341
1337
  approveAll={() => validateAll("A")}
1342
1338
  rejectAll={() => {
1343
- setShowRejectModal(true);
1344
- setValRejAll(true);
1339
+ validateAll("R");
1340
+ setMessage("Rechazado");
1341
+ setComponentsArray([
1342
+ <img src={errorModal} />,
1343
+ <ScreenHeader
1344
+ text={"Agrega tu comentarios para enviar el rechazo"}
1345
+ headerType={"input-name-header"}
1346
+ color={"white"}
1347
+ />,
1348
+ <TagAndInput
1349
+ label={"Caja de Comentario"}
1350
+ inputType={"textarea"}
1351
+ inputId={"modal-commentary-box"}
1352
+ index={0}
1353
+ color={"white"}
1354
+ />,
1355
+ <Button
1356
+ buttonType={"general-default-button"}
1357
+ label={"Enviar comentario"}
1358
+ onClick={(e) =>
1359
+ createComment(
1360
+ e,
1361
+ document.querySelector(
1362
+ "#modal-commentary-box .ql-container .ql-editor > p"
1363
+ ).innerHTML,
1364
+ activeTab
1365
+ )
1366
+ }
1367
+ />,
1368
+ ]);
1345
1369
  }}
1346
1370
  />
1347
1371
  <FullTabsMenu
@@ -1357,12 +1381,6 @@ export const RetailerProductEdition = ({
1357
1381
  isRetailer={isRetailer}
1358
1382
  showSaveButton={auditorAssigned() || userAssigned()}
1359
1383
  version={version}
1360
- desc={desc}
1361
- setDesc={setDesc}
1362
- fich={fich}
1363
- setFich={setFich}
1364
- imag={imag}
1365
- setImag={setImag}
1366
1384
  updatedDescriptions={updatedDescriptions}
1367
1385
  setUpdatedDescriptions={setUpdatedDescriptions}
1368
1386
  updatedDatasheets={updatedDatasheets}
@@ -1477,6 +1495,47 @@ export const RetailerProductEdition = ({
1477
1495
  {(userAssigned(activeTab) || auditorAssigned()) &&
1478
1496
  product[`${getConcept(activeTab)}_status`] !== "NS" && (
1479
1497
  <div className="commentary-box">
1498
+ {!comment ? (
1499
+ <div className="commentary">
1500
+ <TagAndInput
1501
+ label={"Caja de Comentario"}
1502
+ inputType={"textarea"}
1503
+ inputCols={80}
1504
+ inputRows={4}
1505
+ inputId={"commentary-box"}
1506
+ index={0}
1507
+ />
1508
+ <div className="buttons-box">
1509
+ <Button
1510
+ buttonType={"general-transparent-button"}
1511
+ label={"Enviar comentario"}
1512
+ onClick={(e) =>
1513
+ createComment(
1514
+ e,
1515
+ document.querySelector(
1516
+ "#commentary-box .ql-container .ql-editor > p"
1517
+ ).innerHTML,
1518
+ activeTab
1519
+ )
1520
+ }
1521
+ />
1522
+ </div>
1523
+ </div>
1524
+ ) : (
1525
+ <div className="feedback-box">
1526
+ <Commentary
1527
+ comment={comment?.message?.replace(/<.*?\/?>/gm, "")}
1528
+ reviewed={crossComment}
1529
+ />
1530
+ <Button
1531
+ buttonType={"circular-button accept-button"}
1532
+ onClick={async () => {
1533
+ setCrossComment(true);
1534
+ commentRevised();
1535
+ }}
1536
+ />
1537
+ </div>
1538
+ )}
1480
1539
  {[7, 8].includes(user.id_role) && (
1481
1540
  <Button
1482
1541
  buttonType={
@@ -1534,49 +1593,6 @@ export const RetailerProductEdition = ({
1534
1593
  jwt={token}
1535
1594
  />
1536
1595
  )}
1537
- {showRejectModal && (
1538
- <Modal
1539
- title={`Agregar mensaje de rechazo para ${activeTab?.toLowerCase()}`}
1540
- show={showRejectModal}
1541
- customComponent={
1542
- <TagAndInput
1543
- inputType={"textarea"}
1544
- inputId={"modal-message-box"}
1545
- index={0}
1546
- color={"white"}
1547
- />
1548
- }
1549
- buttons={[
1550
- <ButtonV2
1551
- key={"btn-Cancelar"}
1552
- type={"white"}
1553
- label={"Cancelar"}
1554
- size={12}
1555
- onClick={() => {
1556
- setShowRejectModal(false);
1557
- }}
1558
- />,
1559
- <ButtonV2
1560
- key={"btn-Aceptar"}
1561
- type={"pink"}
1562
- label={"Aceptar"}
1563
- size={12}
1564
- onClick={async () => {
1565
- const body = document.querySelector(
1566
- "#modal-message-box .ql-container .ql-editor > p"
1567
- ).innerHTML;
1568
- const messages = [
1569
- { type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
1570
- ];
1571
- await createComment(messages, activeRetailer.id);
1572
- valRejAll ? validateAll("R") : sendToFacilitator("R");
1573
- setMessage("Rechazado");
1574
- setShowRejectModal(false);
1575
- }}
1576
- />,
1577
- ]}
1578
- />
1579
- )}
1580
1596
  </Container>
1581
1597
  );
1582
1598
  };
@@ -89,10 +89,6 @@ export const Container = styled.div`
89
89
  }
90
90
  }
91
91
  }
92
- #modal-message-box {
93
- width: 400px;
94
- height: 100px;
95
- }
96
92
  .container {
97
93
  width: 100%;
98
94
  height: 100%;
@@ -1,5 +1,4 @@
1
1
  import axios from "axios";
2
- import { fetchPOST } from "../../../global-files/handle_http";
3
2
 
4
3
  export const getAuditVersion = async (articleId, setState, token) => {
5
4
  const auditResponse = await axios.get(
@@ -33,39 +32,3 @@ export const getInputsData = (
33
32
  setDescriptionState(descriptions);
34
33
  }
35
34
  };
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
- };
package/src/index.js CHANGED
@@ -33,13 +33,6 @@ 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";
43
36
 
44
37
  //molecules
45
38
  export * from "./components/molecules/AvatarAndValidation/index";
@@ -70,12 +63,6 @@ export * from "./components/molecules/ButtonDownloadFile/index";
70
63
  export * from "./components/molecules/ImageTooltip/index";
71
64
  export * from "./components/molecules/SelectV2/index";
72
65
  export * from "./components/molecules/Dropdown/index";
73
- export * from "./components/molecules/StripeCardForm/index";
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";
78
- export * from "./components/molecules/RetailerSelector/index";
79
66
 
80
67
  //organisms
81
68
  export * from "./components/organisms/ChangePassword/index";
@@ -92,8 +79,6 @@ export * from "./components/organisms/Modal/index";
92
79
  export * from "./components/organisms/OrderDetail/index";
93
80
  export * from "./components/organisms/RangeCalendar";
94
81
  export * from "./components/organisms/TableResizable";
95
- export * from "./components/organisms/SideModal/index";
96
- export * from "./components/organisms/GridProducts/index";
97
82
 
98
83
  //pages
99
84
  export * from "./components/pages/ChangePasswordLogin";
@@ -1,76 +0,0 @@
1
- import { ImageCarousel } from ".";
2
-
3
- export default {
4
- title: "Components/atoms/ImageCarousel",
5
- component: ImageCarousel,
6
- };
7
-
8
- const Template = (args) => <ImageCarousel {...args} />;
9
- export const ImageCarouselDefault = Template.bind({});
10
- ImageCarouselDefault.args = {
11
- imageArray: [
12
- {
13
- id: 35596,
14
- status: null,
15
- image_id: 1,
16
- packing_type: "3",
17
- image_type: "1",
18
- article_id: "38443",
19
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMS1kNDQ2ZjIwNy0wYTkzLTQyNzgtYWZjNi01MTY2ZjIyY2EzNDMucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
20
- timestamp: "2023-05-30T03:01:12.000Z",
21
- id_version: 15,
22
- width: null,
23
- height: null,
24
- scene_type: null,
25
- image_shot_type: null,
26
- last_modified: "2023-06-05T23:49:49.000Z",
27
- name: "Central (Frente Comercial)",
28
- version: 15,
29
- ext: "png",
30
- uuid: "d446f207-0a93-4278-afc6-5166f22ca343",
31
- srcDB: "id-38443/15/1-d446f207-0a93-4278-afc6-5166f22ca343.png",
32
- },
33
- {
34
- id: 35597,
35
- status: null,
36
- image_id: 3,
37
- packing_type: "3",
38
- image_type: "1",
39
- article_id: "38443",
40
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMy0yOTZkMzU3ZC00OTUzLTRiMzktYjFjMy04YWZmZDI2NDgwMWIucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
41
- timestamp: "2023-05-30T03:01:12.000Z",
42
- id_version: 15,
43
- width: null,
44
- height: null,
45
- scene_type: null,
46
- image_shot_type: null,
47
- last_modified: "2023-06-05T23:49:49.000Z",
48
- name: "Trasera (Back)",
49
- version: 15,
50
- ext: "png",
51
- uuid: "296d357d-4953-4b39-b1c3-8affd264801b",
52
- srcDB: "id-38443/15/3-296d357d-4953-4b39-b1c3-8affd264801b.png",
53
- },
54
- {
55
- id: 35598,
56
- status: null,
57
- image_id: 16,
58
- packing_type: "3",
59
- image_type: "1",
60
- article_id: "38443",
61
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMTYtOGMzNDIzM2YtZTRiMC00MjU0LWFlYzUtZjEyN2ZiYjhkYmVkLnBuZyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MTAwMCwiaGVpZ2h0IjoxMDAwLCJmaXQiOiJjb250YWluIiwiYmFja2dyb3VuZCI6eyJyIjoyNTUsImciOjI1NSwiYiI6MjU1LCJhbHBoYSI6MX19fX0=",
62
- timestamp: "2023-05-30T03:01:12.000Z",
63
- id_version: 15,
64
- width: null,
65
- height: null,
66
- scene_type: null,
67
- image_shot_type: null,
68
- last_modified: "2023-06-05T23:49:49.000Z",
69
- name: "Detalle / Características 1",
70
- version: 15,
71
- ext: "png",
72
- uuid: "8c34233f-e4b0-4254-aec5-f127fbb8dbed",
73
- srcDB: "id-38443/15/16-8c34233f-e4b0-4254-aec5-f127fbb8dbed.png",
74
- },
75
- ],
76
- };
@@ -1,103 +0,0 @@
1
- import { Container } from "./styles";
2
- import { useState, useEffect } from "react";
3
- import ReactImageFallback from "react-image-fallback";
4
- import spinner from "../../../assets/images/Icons/Spinner.gif";
5
- import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos";
6
- import productImage from "../../../assets/images/defaultImages/defaultProductImage.png";
7
-
8
- export const ImageCarousel = ({ imageArray = [] }) => {
9
- const [currentIndex, setCurrentIndex] = useState(0);
10
- const [transitioning, setTransitioning] = useState(false);
11
- const [isHover, setIsHover] = useState(false);
12
-
13
- const goToNextSlide = () => {
14
- if (!transitioning) {
15
- setTransitioning(true);
16
- setCurrentIndex((prevIndex) => (prevIndex + 1) % imageArray.length);
17
-
18
- setTimeout(() => {
19
- setTransitioning(false);
20
- }, 500); // Adjust the transition duration to match your CSS
21
- }
22
- };
23
-
24
- const goToPrevSlide = () => {
25
- if (!transitioning) {
26
- setTransitioning(true);
27
- setCurrentIndex(
28
- (prevIndex) => (prevIndex - 1 + imageArray.length) % imageArray.length
29
- );
30
-
31
- setTimeout(() => {
32
- setTransitioning(false);
33
- }, 500); // Adjust the transition duration to match your CSS
34
- }
35
- };
36
-
37
- // useEffect(() => {
38
- // const delay = 0;
39
- // let repeat;
40
- // setTimeout(() => {
41
- // repeat = setInterval(() => {
42
- // if (!isHover && imageArray.length > 1) goToNextSlide();
43
- // }, 10000);
44
- // }, delay);
45
- // return () => {
46
- // clearInterval(repeat);
47
- // };
48
- // }, [isHover]);
49
-
50
- return (
51
- <Container
52
- // onMouseEnter={() => setIsHover(true)}
53
- // onMouseLeave={() => setIsHover(false)}
54
- >
55
- {imageArray.length > 1 && (
56
- <button
57
- className="prev"
58
- onClick={(e) => {
59
- e.stopPropagation();
60
- goToPrevSlide();
61
- }}
62
- >
63
- <ArrowBackIosIcon />
64
- </button>
65
- )}
66
- <div className="slide-container">
67
- {imageArray.length ? (
68
- imageArray.map((img, index) => (
69
- <div
70
- key={index}
71
- className={`image-container slide ${
72
- index === currentIndex ? "active" : ""
73
- }`}
74
- >
75
- <ReactImageFallback
76
- key={index}
77
- src={`https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${img.src}`}
78
- fallbackImage={spinner}
79
- alt={img?.name}
80
- style={{
81
- transform: `translateX(-${currentIndex * 100}%)`,
82
- }}
83
- />
84
- </div>
85
- ))
86
- ) : (
87
- <img src={productImage} alt="not image" />
88
- )}
89
- </div>
90
- {imageArray.length > 1 && (
91
- <button
92
- className="next"
93
- onClick={(e) => {
94
- e.stopPropagation();
95
- goToNextSlide();
96
- }}
97
- >
98
- <ArrowBackIosIcon />
99
- </button>
100
- )}
101
- </Container>
102
- );
103
- };