contentoh-components-library 21.3.92 → 21.3.94

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 +0 -5
  2. package/.env.production +0 -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/TabsMenu/index.js +13 -7
  13. package/dist/components/molecules/TagAndInput/index.js +1 -1
  14. package/dist/components/organisms/Chat/Chat.stories.js +8 -27
  15. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  16. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  17. package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
  18. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  19. package/dist/components/organisms/Chat/index.js +4 -49
  20. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  21. package/dist/components/organisms/FullTabsMenu/index.js +3 -1
  22. package/dist/components/organisms/Modal/styles.js +1 -1
  23. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +96 -171
  24. package/dist/components/pages/ProviderProductEdition/index.js +178 -190
  25. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  26. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +52 -77
  27. package/dist/components/pages/RetailerProductEdition/index.js +276 -290
  28. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  29. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  30. package/dist/index.js +52 -182
  31. package/package.json +1 -4
  32. package/src/components/atoms/Avatar/index.js +2 -8
  33. package/src/components/atoms/Card/index.js +2 -35
  34. package/src/components/atoms/Card/styles.js +5 -41
  35. package/src/components/atoms/CheckBox/index.js +1 -4
  36. package/src/components/atoms/CheckBox/styles.js +0 -2
  37. package/src/components/atoms/InputFormatter/styles.js +1 -2
  38. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  39. package/src/components/molecules/HeaderTop/index.js +6 -52
  40. package/src/components/molecules/TabsMenu/index.js +16 -10
  41. package/src/components/molecules/TagAndInput/index.js +8 -10
  42. package/src/components/organisms/Chat/Chat.stories.js +7 -27
  43. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  44. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
  45. package/src/components/organisms/Chat/ContentChat/index.js +12 -88
  46. package/src/components/organisms/Chat/Footer/index.js +0 -11
  47. package/src/components/organisms/Chat/index.js +4 -46
  48. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  49. package/src/components/organisms/FullTabsMenu/index.js +3 -1
  50. package/src/components/organisms/Modal/styles.js +1 -4
  51. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +98 -181
  52. package/src/components/pages/ProviderProductEdition/index.js +132 -134
  53. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  54. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +46 -76
  55. package/src/components/pages/RetailerProductEdition/index.js +138 -123
  56. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  57. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  58. package/src/index.js +0 -11
  59. package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -90
  60. package/dist/components/atoms/ImageCarousel/index.js +0 -123
  61. package/dist/components/atoms/ImageCarousel/styles.js +0 -18
  62. package/dist/components/atoms/PercentTag/PercentTag.stories.js +0 -31
  63. package/dist/components/atoms/PercentTag/index.js +0 -23
  64. package/dist/components/atoms/PercentTag/styles.js +0 -22
  65. package/dist/components/atoms/RatingStars/RatingStars.stories.js +0 -30
  66. package/dist/components/atoms/RatingStars/index.js +0 -53
  67. package/dist/components/atoms/RatingStars/styles.js +0 -18
  68. package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -48
  69. package/dist/components/atoms/RetailerCatalog/index.js +0 -69
  70. package/dist/components/atoms/RetailerCatalog/styles.js +0 -20
  71. package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +0 -33
  72. package/dist/components/atoms/RetailerOption/index.js +0 -62
  73. package/dist/components/atoms/RetailerOption/styles.js +0 -20
  74. package/dist/components/atoms/RetailersList/RetailersList.stories.js +0 -45
  75. package/dist/components/atoms/RetailersList/index.js +0 -44
  76. package/dist/components/atoms/RetailersList/styles.js +0 -18
  77. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +0 -72
  78. package/dist/components/atoms/UserCatalog/index.js +0 -89
  79. package/dist/components/atoms/UserCatalog/styles.js +0 -18
  80. package/dist/components/atoms/UserOption/UserOption.stories.js +0 -40
  81. package/dist/components/atoms/UserOption/index.js +0 -80
  82. package/dist/components/atoms/UserOption/styles.js +0 -20
  83. package/dist/components/atoms/UserSelector/UserSelector.stories.js +0 -40
  84. package/dist/components/atoms/UserSelector/index.js +0 -91
  85. package/dist/components/atoms/UserSelector/styles.js +0 -32
  86. package/dist/components/molecules/GridItem/GridItem.stories.js +0 -123
  87. package/dist/components/molecules/GridItem/index.js +0 -122
  88. package/dist/components/molecules/GridItem/styles.js +0 -20
  89. package/dist/components/molecules/HeaderItem/ColumnItem.js +0 -23
  90. package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +0 -70
  91. package/dist/components/molecules/HeaderItem/index.js +0 -42
  92. package/dist/components/molecules/HeaderItem/styles.js +0 -30
  93. package/dist/components/molecules/RowItem/ColumnItem.js +0 -23
  94. package/dist/components/molecules/RowItem/RowItem.stories.js +0 -5242
  95. package/dist/components/molecules/RowItem/index.js +0 -59
  96. package/dist/components/molecules/RowItem/styles.js +0 -30
  97. package/dist/components/organisms/GridProducts/GridProducts.stories.js +0 -5093
  98. package/dist/components/organisms/GridProducts/index.js +0 -81
  99. package/dist/components/organisms/GridProducts/styles.js +0 -18
  100. package/dist/components/organisms/GridProducts/utils.js +0 -139
  101. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
  102. package/src/components/atoms/ImageCarousel/index.js +0 -103
  103. package/src/components/atoms/ImageCarousel/styles.js +0 -79
  104. package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
  105. package/src/components/atoms/PercentTag/index.js +0 -9
  106. package/src/components/atoms/PercentTag/styles.js +0 -69
  107. package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
  108. package/src/components/atoms/RatingStars/index.js +0 -31
  109. package/src/components/atoms/RatingStars/styles.js +0 -28
  110. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
  111. package/src/components/atoms/RetailerCatalog/index.js +0 -49
  112. package/src/components/atoms/RetailerCatalog/styles.js +0 -30
  113. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
  114. package/src/components/atoms/RetailerOption/index.js +0 -53
  115. package/src/components/atoms/RetailerOption/styles.js +0 -41
  116. package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
  117. package/src/components/atoms/RetailersList/index.js +0 -20
  118. package/src/components/atoms/RetailersList/styles.js +0 -19
  119. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -66
  120. package/src/components/atoms/UserCatalog/index.js +0 -77
  121. package/src/components/atoms/UserCatalog/styles.js +0 -24
  122. package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
  123. package/src/components/atoms/UserOption/index.js +0 -49
  124. package/src/components/atoms/UserOption/styles.js +0 -54
  125. package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
  126. package/src/components/atoms/UserSelector/index.js +0 -70
  127. package/src/components/atoms/UserSelector/styles.js +0 -55
  128. package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
  129. package/src/components/molecules/GridItem/index.js +0 -82
  130. package/src/components/molecules/GridItem/styles.js +0 -85
  131. package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
  132. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
  133. package/src/components/molecules/HeaderItem/index.js +0 -26
  134. package/src/components/molecules/HeaderItem/styles.js +0 -25
  135. package/src/components/molecules/RowItem/ColumnItem.js +0 -9
  136. package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
  137. package/src/components/molecules/RowItem/index.js +0 -45
  138. package/src/components/molecules/RowItem/styles.js +0 -38
  139. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
  140. package/src/components/molecules/StripeCardForm/index.js +0 -42
  141. package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
  142. package/src/components/molecules/StripeCardForm/styles.js +0 -73
  143. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
  144. package/src/components/molecules/StripeCardSelector/index.js +0 -44
  145. package/src/components/molecules/StripeCardSelector/styles.js +0 -4
  146. package/src/components/molecules/StripeCardSelector/utils.js +0 -17
  147. package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5474
  148. package/src/components/organisms/GridProducts/index.js +0 -59
  149. package/src/components/organisms/GridProducts/styles.js +0 -15
  150. package/src/components/organisms/GridProducts/utils.js +0 -103
  151. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  152. package/src/components/organisms/SideModal/index.js +0 -50
  153. 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 || {};
@@ -571,7 +560,6 @@ export const RetailerProductEdition = ({
571
560
  active: images?.values?.some((value) => value?.image_id === e?.id),
572
561
  }));
573
562
  setSocketType(imageInputs);
574
- console.log(images);
575
563
  }, [images]);
576
564
 
577
565
  const updateImages = useCallback(async () => {
@@ -867,25 +855,6 @@ export const RetailerProductEdition = ({
867
855
  const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
868
856
  res.data.body
869
857
  );
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
858
  if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
890
859
  productTemp[`${concept}_status`] = newStatus;
891
860
  await loadData();
@@ -928,19 +897,35 @@ export const RetailerProductEdition = ({
928
897
  return product?.article[`id_auditor`] === user.id_user;
929
898
  };
930
899
 
931
- const createComment = async (messages = [], retailerId) => {
900
+ const createComment = async (e, body, tab) => {
901
+ let concept = "";
902
+ switch (activeTab) {
903
+ case "Ficha técnica":
904
+ concept = "datasheet";
905
+ break;
906
+ case "Imágenes":
907
+ concept = "images";
908
+ break;
909
+
910
+ default:
911
+ concept = "description";
912
+ break;
913
+ }
932
914
  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 },
915
+ articleId: product?.article?.id_article,
916
+ orderId: product?.orderId,
917
+ message: body?.replace(/<.*?\/?>/gm, ""),
918
+ concept: concept,
919
+ version: version,
941
920
  };
921
+ await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
922
+ headers: {
923
+ Authorization: token,
924
+ },
925
+ });
926
+ await getComments(tab);
942
927
  setMessage("");
943
- return sendMessage(data);
928
+ setComponentsArray([]);
944
929
  };
945
930
 
946
931
  const getRequired = (services) => {
@@ -1192,7 +1177,6 @@ export const RetailerProductEdition = ({
1192
1177
  };
1193
1178
 
1194
1179
  useEffect(() => {
1195
- console.log(servicesData, "servicesData");
1196
1180
  let status = getRetailerStatus(servicesData, activeTab);
1197
1181
  setRetailerStatus(status);
1198
1182
  }, [activeTab, servicesData, activeRetailer]);
@@ -1223,8 +1207,6 @@ export const RetailerProductEdition = ({
1223
1207
  break;
1224
1208
  }
1225
1209
 
1226
- const messages = [];
1227
-
1228
1210
  servicesData?.forEach((ret) => {
1229
1211
  if (conceptArray.includes(ret.service)) {
1230
1212
  let data = {
@@ -1235,21 +1217,6 @@ export const RetailerProductEdition = ({
1235
1217
  evalStatus: ret.status,
1236
1218
  retailerId: ret.id_retailer,
1237
1219
  };
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
1220
  evaluationArray.push(
1254
1221
  axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
1255
1222
  headers: {
@@ -1259,19 +1226,19 @@ export const RetailerProductEdition = ({
1259
1226
  );
1260
1227
  }
1261
1228
  });
1229
+
1262
1230
  await Promise.all(evaluationArray);
1263
1231
 
1264
1232
  const productTemp = product;
1265
1233
  productTemp.status = `${result}A`;
1266
1234
  productTemp.datasheet_status =
1267
- productTemp.datasheet_status === "NS" ? "NS" : `${result}A`;
1235
+ productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
1268
1236
  productTemp.description_status =
1269
- productTemp.description_status === "NS" ? "NS" : `${result}A`;
1237
+ productTemp.description_status === "NA" ? "NA" : `${result}A`;
1270
1238
  productTemp.images_status =
1271
- productTemp.images_status === "NS" ? "NS" : `${result}A`;
1239
+ productTemp.images_status === "NA" ? "NA" : `${result}A`;
1272
1240
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1273
1241
  setProduct(productTemp);
1274
- const messagesResponse = await Promise.all(messages);
1275
1242
 
1276
1243
  await loadData();
1277
1244
  } catch (error) {
@@ -1287,10 +1254,8 @@ export const RetailerProductEdition = ({
1287
1254
  setCompare={setCompare}
1288
1255
  isAuditor={[1, 6].includes(user.id_role)}
1289
1256
  withChat={location?.state?.withChat}
1290
- chatType={location?.state?.chatType}
1291
- productSelected={product}
1257
+ productSelected={productSelected}
1292
1258
  token={token}
1293
- activeRetailer={activeRetailer}
1294
1259
  />
1295
1260
  <div className="data-container">
1296
1261
  <div className="image-data-panel">
@@ -1330,7 +1295,36 @@ export const RetailerProductEdition = ({
1330
1295
  sendToFacilitator("A");
1331
1296
  }}
1332
1297
  reject={() => {
1333
- setShowRejectModal(true);
1298
+ sendToFacilitator("R");
1299
+ setMessage("Rechazado");
1300
+ setComponentsArray([
1301
+ <img src={errorModal} />,
1302
+ <ScreenHeader
1303
+ text={"Agrega tu comentarios para enviar el rechazo"}
1304
+ headerType={"input-name-header"}
1305
+ color={"white"}
1306
+ />,
1307
+ <TagAndInput
1308
+ label={"Caja de Comentario"}
1309
+ inputType={"textarea"}
1310
+ inputId={"modal-commentary-box"}
1311
+ index={0}
1312
+ color={"white"}
1313
+ />,
1314
+ <Button
1315
+ buttonType={"general-default-button"}
1316
+ label={"Enviar comentario"}
1317
+ onClick={(e) =>
1318
+ createComment(
1319
+ e,
1320
+ document.querySelector(
1321
+ "#modal-commentary-box .ql-container .ql-editor > p"
1322
+ ).innerHTML,
1323
+ activeTab
1324
+ )
1325
+ }
1326
+ />,
1327
+ ]);
1334
1328
  }}
1335
1329
  showApproveRejectAll={
1336
1330
  approveRejectAllButtons() && (auditorAssigned() || userAssigned())
@@ -1340,8 +1334,36 @@ export const RetailerProductEdition = ({
1340
1334
  }
1341
1335
  approveAll={() => validateAll("A")}
1342
1336
  rejectAll={() => {
1343
- setShowRejectModal(true);
1344
- setValRejAll(true);
1337
+ validateAll("R");
1338
+ setMessage("Rechazado");
1339
+ setComponentsArray([
1340
+ <img src={errorModal} />,
1341
+ <ScreenHeader
1342
+ text={"Agrega tu comentarios para enviar el rechazo"}
1343
+ headerType={"input-name-header"}
1344
+ color={"white"}
1345
+ />,
1346
+ <TagAndInput
1347
+ label={"Caja de Comentario"}
1348
+ inputType={"textarea"}
1349
+ inputId={"modal-commentary-box"}
1350
+ index={0}
1351
+ color={"white"}
1352
+ />,
1353
+ <Button
1354
+ buttonType={"general-default-button"}
1355
+ label={"Enviar comentario"}
1356
+ onClick={(e) =>
1357
+ createComment(
1358
+ e,
1359
+ document.querySelector(
1360
+ "#modal-commentary-box .ql-container .ql-editor > p"
1361
+ ).innerHTML,
1362
+ activeTab
1363
+ )
1364
+ }
1365
+ />,
1366
+ ]);
1345
1367
  }}
1346
1368
  />
1347
1369
  <FullTabsMenu
@@ -1357,18 +1379,13 @@ export const RetailerProductEdition = ({
1357
1379
  isRetailer={isRetailer}
1358
1380
  showSaveButton={auditorAssigned() || userAssigned()}
1359
1381
  version={version}
1360
- desc={desc}
1361
- setDesc={setDesc}
1362
- fich={fich}
1363
- setFich={setFich}
1364
- imag={imag}
1365
- setImag={setImag}
1366
1382
  updatedDescriptions={updatedDescriptions}
1383
+ setUpdatedDescriptions={setUpdatedDescriptions}
1367
1384
  updatedDatasheets={updatedDatasheets}
1385
+ setUpdatedDatasheets={setUpdatedDatasheets}
1368
1386
  images={images}
1387
+ setImages={setImages}
1369
1388
  selectedImages={selectedImages}
1370
- setUpdatedDescriptions={setUpdatedDescriptions}
1371
- setUpdatedDatasheets={setUpdatedDatasheets}
1372
1389
  setSelectedImages={setSelectedImages}
1373
1390
  setShowVersionSelector={setShowVersionSelector}
1374
1391
  onClickSave={() => {
@@ -1476,6 +1493,47 @@ export const RetailerProductEdition = ({
1476
1493
  {(userAssigned(activeTab) || auditorAssigned()) &&
1477
1494
  product[`${getConcept(activeTab)}_status`] !== "NS" && (
1478
1495
  <div className="commentary-box">
1496
+ {!comment ? (
1497
+ <div className="commentary">
1498
+ <TagAndInput
1499
+ label={"Caja de Comentario"}
1500
+ inputType={"textarea"}
1501
+ inputCols={80}
1502
+ inputRows={4}
1503
+ inputId={"commentary-box"}
1504
+ index={0}
1505
+ />
1506
+ <div className="buttons-box">
1507
+ <Button
1508
+ buttonType={"general-transparent-button"}
1509
+ label={"Enviar comentario"}
1510
+ onClick={(e) =>
1511
+ createComment(
1512
+ e,
1513
+ document.querySelector(
1514
+ "#commentary-box .ql-container .ql-editor > p"
1515
+ ).innerHTML,
1516
+ activeTab
1517
+ )
1518
+ }
1519
+ />
1520
+ </div>
1521
+ </div>
1522
+ ) : (
1523
+ <div className="feedback-box">
1524
+ <Commentary
1525
+ comment={comment?.message?.replace(/<.*?\/?>/gm, "")}
1526
+ reviewed={crossComment}
1527
+ />
1528
+ <Button
1529
+ buttonType={"circular-button accept-button"}
1530
+ onClick={async () => {
1531
+ setCrossComment(true);
1532
+ commentRevised();
1533
+ }}
1534
+ />
1535
+ </div>
1536
+ )}
1479
1537
  {[7, 8].includes(user.id_role) && (
1480
1538
  <Button
1481
1539
  buttonType={
@@ -1533,49 +1591,6 @@ export const RetailerProductEdition = ({
1533
1591
  jwt={token}
1534
1592
  />
1535
1593
  )}
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
- )}
1579
1594
  </Container>
1580
1595
  );
1581
1596
  };
@@ -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,9 +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/UserCatalog/index";
37
- export * from "./components/atoms/UserSelector/index";
38
- export * from "./components/atoms/ImageCarousel/index";
39
36
 
40
37
  //molecules
41
38
  export * from "./components/molecules/AvatarAndValidation/index";
@@ -66,12 +63,6 @@ export * from "./components/molecules/ButtonDownloadFile/index";
66
63
  export * from "./components/molecules/ImageTooltip/index";
67
64
  export * from "./components/molecules/SelectV2/index";
68
65
  export * from "./components/molecules/Dropdown/index";
69
- export * from "./components/molecules/StripeCardForm/index";
70
- export * from "./components/molecules/StripeCardSelector/index";
71
- export * from "./components/molecules/GridItem/index";
72
- export * from "./components/molecules/HeaderItem/index";
73
- export * from "./components/molecules/RowItem/index";
74
- export * from "./components/molecules/RetailerSelector/index";
75
66
 
76
67
  //organisms
77
68
  export * from "./components/organisms/ChangePassword/index";
@@ -88,8 +79,6 @@ export * from "./components/organisms/Modal/index";
88
79
  export * from "./components/organisms/OrderDetail/index";
89
80
  export * from "./components/organisms/RangeCalendar";
90
81
  export * from "./components/organisms/TableResizable";
91
- export * from "./components/organisms/SideModal/index";
92
- export * from "./components/organisms/GridProducts/index";
93
82
 
94
83
  //pages
95
84
  export * from "./components/pages/ChangePasswordLogin";
@@ -1,90 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = exports.ImageCarouselDefault = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
-
12
- var _ = require(".");
13
-
14
- var _jsxRuntime = require("react/jsx-runtime");
15
-
16
- var _default = {
17
- title: "Components/atoms/ImageCarousel",
18
- component: _.ImageCarousel
19
- };
20
- exports.default = _default;
21
-
22
- var Template = function Template(args) {
23
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ImageCarousel, (0, _objectSpread2.default)({}, args));
24
- };
25
-
26
- var ImageCarouselDefault = Template.bind({});
27
- exports.ImageCarouselDefault = ImageCarouselDefault;
28
- ImageCarouselDefault.args = {
29
- imageArray: [{
30
- id: 35596,
31
- status: null,
32
- image_id: 1,
33
- packing_type: "3",
34
- image_type: "1",
35
- article_id: "38443",
36
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMS1kNDQ2ZjIwNy0wYTkzLTQyNzgtYWZjNi01MTY2ZjIyY2EzNDMucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
37
- timestamp: "2023-05-30T03:01:12.000Z",
38
- id_version: 15,
39
- width: null,
40
- height: null,
41
- scene_type: null,
42
- image_shot_type: null,
43
- last_modified: "2023-06-05T23:49:49.000Z",
44
- name: "Central (Frente Comercial)",
45
- version: 15,
46
- ext: "png",
47
- uuid: "d446f207-0a93-4278-afc6-5166f22ca343",
48
- srcDB: "id-38443/15/1-d446f207-0a93-4278-afc6-5166f22ca343.png"
49
- }, {
50
- id: 35597,
51
- status: null,
52
- image_id: 3,
53
- packing_type: "3",
54
- image_type: "1",
55
- article_id: "38443",
56
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMy0yOTZkMzU3ZC00OTUzLTRiMzktYjFjMy04YWZmZDI2NDgwMWIucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
57
- timestamp: "2023-05-30T03:01:12.000Z",
58
- id_version: 15,
59
- width: null,
60
- height: null,
61
- scene_type: null,
62
- image_shot_type: null,
63
- last_modified: "2023-06-05T23:49:49.000Z",
64
- name: "Trasera (Back)",
65
- version: 15,
66
- ext: "png",
67
- uuid: "296d357d-4953-4b39-b1c3-8affd264801b",
68
- srcDB: "id-38443/15/3-296d357d-4953-4b39-b1c3-8affd264801b.png"
69
- }, {
70
- id: 35598,
71
- status: null,
72
- image_id: 16,
73
- packing_type: "3",
74
- image_type: "1",
75
- article_id: "38443",
76
- src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMTYtOGMzNDIzM2YtZTRiMC00MjU0LWFlYzUtZjEyN2ZiYjhkYmVkLnBuZyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MTAwMCwiaGVpZ2h0IjoxMDAwLCJmaXQiOiJjb250YWluIiwiYmFja2dyb3VuZCI6eyJyIjoyNTUsImciOjI1NSwiYiI6MjU1LCJhbHBoYSI6MX19fX0=",
77
- timestamp: "2023-05-30T03:01:12.000Z",
78
- id_version: 15,
79
- width: null,
80
- height: null,
81
- scene_type: null,
82
- image_shot_type: null,
83
- last_modified: "2023-06-05T23:49:49.000Z",
84
- name: "Detalle / Características 1",
85
- version: 15,
86
- ext: "png",
87
- uuid: "8c34233f-e4b0-4254-aec5-f127fbb8dbed",
88
- srcDB: "id-38443/15/16-8c34233f-e4b0-4254-aec5-f127fbb8dbed.png"
89
- }]
90
- };