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
@@ -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 || {};
@@ -560,6 +571,7 @@ export const RetailerProductEdition = ({
560
571
  active: images?.values?.some((value) => value?.image_id === e?.id),
561
572
  }));
562
573
  setSocketType(imageInputs);
574
+ console.log(images);
563
575
  }, [images]);
564
576
 
565
577
  const updateImages = useCallback(async () => {
@@ -855,6 +867,25 @@ export const RetailerProductEdition = ({
855
867
  const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
856
868
  res.data.body
857
869
  );
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);
858
889
  if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
859
890
  productTemp[`${concept}_status`] = newStatus;
860
891
  await loadData();
@@ -897,35 +928,19 @@ export const RetailerProductEdition = ({
897
928
  return product?.article[`id_auditor`] === user.id_user;
898
929
  };
899
930
 
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
- }
931
+ const createComment = async (messages = [], retailerId) => {
914
932
  const data = {
915
- articleId: product?.article?.id_article,
916
- orderId: product?.orderId,
917
- message: body?.replace(/<.*?\/?>/gm, ""),
918
- concept: concept,
919
- version: version,
920
- };
921
- await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
922
- headers: {
923
- Authorization: token,
933
+ paramsBody: {
934
+ id: product.article.id_article,
935
+ version: version,
936
+ items: messages,
937
+ retailerId: retailerId,
938
+ status: product.status,
924
939
  },
925
- });
926
- await getComments(tab);
940
+ paramsHeader: { Authorization: token },
941
+ };
927
942
  setMessage("");
928
- setComponentsArray([]);
943
+ return sendMessage(data);
929
944
  };
930
945
 
931
946
  const getRequired = (services) => {
@@ -1177,6 +1192,7 @@ export const RetailerProductEdition = ({
1177
1192
  };
1178
1193
 
1179
1194
  useEffect(() => {
1195
+ console.log(servicesData, "servicesData");
1180
1196
  let status = getRetailerStatus(servicesData, activeTab);
1181
1197
  setRetailerStatus(status);
1182
1198
  }, [activeTab, servicesData, activeRetailer]);
@@ -1207,6 +1223,8 @@ export const RetailerProductEdition = ({
1207
1223
  break;
1208
1224
  }
1209
1225
 
1226
+ const messages = [];
1227
+
1210
1228
  servicesData?.forEach((ret) => {
1211
1229
  if (conceptArray.includes(ret.service)) {
1212
1230
  let data = {
@@ -1217,6 +1235,21 @@ export const RetailerProductEdition = ({
1217
1235
  evalStatus: ret.status,
1218
1236
  retailerId: ret.id_retailer,
1219
1237
  };
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
+ }
1220
1253
  evaluationArray.push(
1221
1254
  axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
1222
1255
  headers: {
@@ -1226,19 +1259,19 @@ export const RetailerProductEdition = ({
1226
1259
  );
1227
1260
  }
1228
1261
  });
1229
-
1230
1262
  await Promise.all(evaluationArray);
1231
1263
 
1232
1264
  const productTemp = product;
1233
1265
  productTemp.status = `${result}A`;
1234
1266
  productTemp.datasheet_status =
1235
- productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
1267
+ productTemp.datasheet_status === "NS" ? "NS" : `${result}A`;
1236
1268
  productTemp.description_status =
1237
- productTemp.description_status === "NA" ? "NA" : `${result}A`;
1269
+ productTemp.description_status === "NS" ? "NS" : `${result}A`;
1238
1270
  productTemp.images_status =
1239
- productTemp.images_status === "NA" ? "NA" : `${result}A`;
1271
+ productTemp.images_status === "NS" ? "NS" : `${result}A`;
1240
1272
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1241
1273
  setProduct(productTemp);
1274
+ const messagesResponse = await Promise.all(messages);
1242
1275
 
1243
1276
  await loadData();
1244
1277
  } catch (error) {
@@ -1254,8 +1287,10 @@ export const RetailerProductEdition = ({
1254
1287
  setCompare={setCompare}
1255
1288
  isAuditor={[1, 6].includes(user.id_role)}
1256
1289
  withChat={location?.state?.withChat}
1257
- productSelected={productSelected}
1290
+ chatType={location?.state?.chatType}
1291
+ productSelected={product}
1258
1292
  token={token}
1293
+ activeRetailer={activeRetailer}
1259
1294
  />
1260
1295
  <div className="data-container">
1261
1296
  <div className="image-data-panel">
@@ -1295,36 +1330,7 @@ export const RetailerProductEdition = ({
1295
1330
  sendToFacilitator("A");
1296
1331
  }}
1297
1332
  reject={() => {
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
- ]);
1333
+ setShowRejectModal(true);
1328
1334
  }}
1329
1335
  showApproveRejectAll={
1330
1336
  approveRejectAllButtons() && (auditorAssigned() || userAssigned())
@@ -1334,36 +1340,8 @@ export const RetailerProductEdition = ({
1334
1340
  }
1335
1341
  approveAll={() => validateAll("A")}
1336
1342
  rejectAll={() => {
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
- ]);
1343
+ setShowRejectModal(true);
1344
+ setValRejAll(true);
1367
1345
  }}
1368
1346
  />
1369
1347
  <FullTabsMenu
@@ -1379,13 +1357,18 @@ export const RetailerProductEdition = ({
1379
1357
  isRetailer={isRetailer}
1380
1358
  showSaveButton={auditorAssigned() || userAssigned()}
1381
1359
  version={version}
1360
+ desc={desc}
1361
+ setDesc={setDesc}
1362
+ fich={fich}
1363
+ setFich={setFich}
1364
+ imag={imag}
1365
+ setImag={setImag}
1382
1366
  updatedDescriptions={updatedDescriptions}
1383
- setUpdatedDescriptions={setUpdatedDescriptions}
1384
1367
  updatedDatasheets={updatedDatasheets}
1385
- setUpdatedDatasheets={setUpdatedDatasheets}
1386
1368
  images={images}
1387
- setImages={setImages}
1388
1369
  selectedImages={selectedImages}
1370
+ setUpdatedDescriptions={setUpdatedDescriptions}
1371
+ setUpdatedDatasheets={setUpdatedDatasheets}
1389
1372
  setSelectedImages={setSelectedImages}
1390
1373
  setShowVersionSelector={setShowVersionSelector}
1391
1374
  onClickSave={() => {
@@ -1493,47 +1476,6 @@ export const RetailerProductEdition = ({
1493
1476
  {(userAssigned(activeTab) || auditorAssigned()) &&
1494
1477
  product[`${getConcept(activeTab)}_status`] !== "NS" && (
1495
1478
  <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
- )}
1537
1479
  {[7, 8].includes(user.id_role) && (
1538
1480
  <Button
1539
1481
  buttonType={
@@ -1591,6 +1533,49 @@ export const RetailerProductEdition = ({
1591
1533
  jwt={token}
1592
1534
  />
1593
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
+ )}
1594
1579
  </Container>
1595
1580
  );
1596
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
+ };
package/src/index.js CHANGED
@@ -33,6 +33,9 @@ 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";
36
39
 
37
40
  //molecules
38
41
  export * from "./components/molecules/AvatarAndValidation/index";
@@ -63,6 +66,12 @@ export * from "./components/molecules/ButtonDownloadFile/index";
63
66
  export * from "./components/molecules/ImageTooltip/index";
64
67
  export * from "./components/molecules/SelectV2/index";
65
68
  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";
66
75
 
67
76
  //organisms
68
77
  export * from "./components/organisms/ChangePassword/index";
@@ -79,6 +88,8 @@ export * from "./components/organisms/Modal/index";
79
88
  export * from "./components/organisms/OrderDetail/index";
80
89
  export * from "./components/organisms/RangeCalendar";
81
90
  export * from "./components/organisms/TableResizable";
91
+ export * from "./components/organisms/SideModal/index";
92
+ export * from "./components/organisms/GridProducts/index";
82
93
 
83
94
  //pages
84
95
  export * from "./components/pages/ChangePasswordLogin";
@@ -1,202 +0,0 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright [yyyy] [name of copyright owner]
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.