contentoh-components-library 21.1.23 → 21.1.26

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 (31) hide show
  1. package/dist/components/atoms/SliderToolTip/styles.js +2 -2
  2. package/dist/components/atoms/ValidationPanel/index.js +26 -17
  3. package/dist/components/atoms/ValidationPanel/styles.js +1 -1
  4. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +1 -1
  5. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +21 -23
  6. package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +22 -6
  7. package/dist/components/molecules/AvatarAndValidation/index.js +4 -2
  8. package/dist/components/molecules/StatusAsignationInfo/index.js +0 -6
  9. package/dist/components/organisms/FullProductNameHeader/index.js +3 -1
  10. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +111 -72
  11. package/dist/components/pages/ProviderProductEdition/index.js +159 -81
  12. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +58 -51
  13. package/dist/components/pages/RetailerProductEdition/index.js +25 -19
  14. package/dist/global-files/data.js +21 -12
  15. package/dist/index.js +38 -51
  16. package/package.json +1 -1
  17. package/src/components/atoms/SliderToolTip/styles.js +6 -3
  18. package/src/components/atoms/ValidationPanel/index.js +24 -14
  19. package/src/components/atoms/ValidationPanel/styles.js +6 -2
  20. package/src/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +2 -2
  21. package/src/components/atoms/VerticalSideMenuMainPage/index.js +19 -22
  22. package/src/components/atoms/VerticalSideMenuMainPage/styles.js +25 -19
  23. package/src/components/molecules/AvatarAndValidation/index.js +2 -0
  24. package/src/components/molecules/StatusAsignationInfo/index.js +0 -6
  25. package/src/components/organisms/FullProductNameHeader/index.js +2 -0
  26. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +119 -82
  27. package/src/components/pages/ProviderProductEdition/index.js +131 -49
  28. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +59 -51
  29. package/src/components/pages/RetailerProductEdition/index.js +18 -8
  30. package/src/global-files/data.js +32 -20
  31. package/src/index.js +0 -1
@@ -33,6 +33,13 @@ import { Link } from "react-router-dom";
33
33
  import face from "../../../assets/images/defaultImages/defaultProfileImage.svg";
34
34
  import errorModal from "../../../assets/images/genericModal/errorModal.svg";
35
35
  import { GlobalModal } from "../../organisms/GlobalModal/index";
36
+ import { SliderToolTip } from "../../atoms/SliderToolTip";
37
+ import InfoIcon from "../../../assets/images/sliderToolTip/infoIcon.svg";
38
+ import Slide1_1 from "../../../assets/images/sliderToolTip/slide1.svg";
39
+ import Slide1_2 from "../../../assets/images/sliderToolTip/slide2.svg";
40
+ import Slide1_3 from "../../../assets/images/sliderToolTip/slide3.svg";
41
+ import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
42
+ import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
36
43
 
37
44
  const reducerImages = (state, action) => {
38
45
  let { values, attrForImgs } = state;
@@ -406,7 +413,6 @@ export const ProviderProductEdition = ({
406
413
 
407
414
  const saveDescriptions = async () => {
408
415
  setLoading(true);
409
- const productTemp = product;
410
416
  const dataObject = {
411
417
  articleId: product?.id_article,
412
418
  articleData: updatedDescriptions,
@@ -422,12 +428,6 @@ export const ProviderProductEdition = ({
422
428
  },
423
429
  }
424
430
  );
425
- if (productTemp.status === "ASSIGNED") {
426
- productTemp.status = "IN_PROGRESS";
427
- setProduct(productTemp);
428
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
429
- }
430
-
431
431
  setMessage("Descripciones guardadas con éxito");
432
432
  loadData();
433
433
  } catch (error) {
@@ -453,11 +453,6 @@ export const ProviderProductEdition = ({
453
453
  }
454
454
  );
455
455
  setMessage("Fichas técnicas guardadas");
456
- if (productTemp.status === "ASSIGNED") {
457
- productTemp.status = "IN_PROGRESS";
458
- setProduct(productTemp);
459
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
460
- }
461
456
  loadData();
462
457
  } catch (error) {
463
458
  console.log(error);
@@ -699,14 +694,23 @@ export const ProviderProductEdition = ({
699
694
  };
700
695
 
701
696
  const downloadImages = () => {
702
- selectedImages.forEach((e) => {
703
- if (e.id) {
704
- saveAs(
705
- `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
706
- `${product.article.upc}_${e.name}.${e.ext}`
707
- );
708
- }
709
- });
697
+ selectedImages.length > 0
698
+ ? selectedImages.forEach((e) => {
699
+ if (e.id) {
700
+ saveAs(
701
+ `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
702
+ `${product.upc || product.article.upc}_${e.name}.${e.ext}`
703
+ );
704
+ }
705
+ })
706
+ : images?.values?.forEach((e) => {
707
+ if (e.id) {
708
+ saveAs(
709
+ `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
710
+ `${product.upc || product.article.upc}_${e.name}.${e.ext}`
711
+ );
712
+ }
713
+ });
710
714
  };
711
715
 
712
716
  const deleteImages = () => {
@@ -782,26 +786,6 @@ export const ProviderProductEdition = ({
782
786
  }
783
787
  };
784
788
 
785
- const specialistValid = (tab) => {
786
- let concept = "";
787
- switch (tab) {
788
- case "Ficha técnica":
789
- concept = "datasheet";
790
- break;
791
- case "Imágenes":
792
- concept = "images";
793
- break;
794
- case "Descripción":
795
- concept = "description";
796
- break;
797
- }
798
- return (
799
- product[`${concept}_status`] === "IN_PROGRESS" ||
800
- product[`${concept}_status`] === "RF" ||
801
- product[`${concept}_status`] === "RA"
802
- );
803
- };
804
-
805
789
  const confirmStatusComplete = () => {
806
790
  const { datasheet_status, description_status, images_status } = product;
807
791
  const completionStates =
@@ -842,7 +826,6 @@ export const ProviderProductEdition = ({
842
826
  articleId: product.id_article,
843
827
  orderId: product.id_order ?? product.orderId,
844
828
  concept,
845
- retailerId,
846
829
  };
847
830
  axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
848
831
  headers: {
@@ -869,6 +852,52 @@ export const ProviderProductEdition = ({
869
852
  showSurvey && showSurvey(confirmStatusComplete());
870
853
  };
871
854
 
855
+ const validateAll = async (result) => {
856
+ try {
857
+ const evaluationArray = [];
858
+ const sendAll = [];
859
+ const conceptArray = ["description", "datasheet", "images"];
860
+ console.log(servicesData);
861
+
862
+ servicesData?.forEach((ret) => {
863
+ let data = {
864
+ articleId: product.id_article,
865
+ orderId: product.id_order ?? product.orderId,
866
+ concept: ret.service,
867
+ result: result,
868
+ retailerId: ret.id_retailer,
869
+ };
870
+ evaluationArray.push(
871
+ axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
872
+ headers: {
873
+ Authorization: token,
874
+ },
875
+ })
876
+ );
877
+ });
878
+
879
+ conceptArray.forEach((concept) => {
880
+ let data = {
881
+ articleId: product.id_article,
882
+ orderId: product.id_order ?? product.orderId,
883
+ concept,
884
+ };
885
+ sendAll.push(
886
+ axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
887
+ headers: {
888
+ Authorization: token,
889
+ },
890
+ })
891
+ );
892
+ });
893
+
894
+ Promise.all(conceptArray);
895
+ Promise.all(sendAll);
896
+ } catch (error) {
897
+ console.log(error);
898
+ }
899
+ };
900
+
872
901
  const evaluationToRetailer = async (result) => {
873
902
  const data = {
874
903
  articleId: product.id_article,
@@ -919,10 +948,47 @@ export const ProviderProductEdition = ({
919
948
  }
920
949
  };
921
950
 
951
+ const slidefront = [
952
+ {
953
+ slide: Slide1_1,
954
+ description:
955
+ "Creamos tu contenido, y todo lo que haga falta para tu producto, cada sección puedes socilitar contenido enriquecido, y nosotros lo haremos por ti.",
956
+ },
957
+ {
958
+ slide: Slide1_2,
959
+ description:
960
+ "Puedes agregar solicitudes de contenido enriquecido a tu carrito de compra las veces que sean necesarias. Una vez completada tu lista con los servicios necesitados sigue el proceso de compra en checkout.",
961
+ },
962
+ {
963
+ slide: Slide1_3,
964
+ description:
965
+ "Revisa el contenido que deseas solicilitar, valida y tambien puedes agregar contenido extra, traducciones, o simplemente completar el checkout.",
966
+ },
967
+ {
968
+ slide: Slide1_4,
969
+ description:
970
+ "Elige el tipo de entrega de tu producto, puedes ser recolección en el lugar o por el contrario puedes dejarlo en nuestras oficinas.",
971
+ },
972
+ {
973
+ slide: Slide1_5,
974
+ title: "Bienvenido al modo Content-oh!",
975
+ description:
976
+ "Finalmente elige la forma de pago que más te guste, procede con el pago y listo.",
977
+ },
978
+ ];
979
+
922
980
  useEffect(() => {
923
981
  setSaving(loading);
924
982
  }, [loading]);
925
983
 
984
+ console.log(
985
+ user.is_retailer === 1,
986
+ product.id_order || product.orderId,
987
+ isRevision(),
988
+ getSectionStatus(),
989
+ "XD"
990
+ );
991
+
926
992
  return (
927
993
  <Container headerTop={headerTop}>
928
994
  <HeaderTop setHeaderTop={setHeaderTop} />
@@ -956,6 +1022,14 @@ export const ProviderProductEdition = ({
956
1022
  setActiveRetailer={setActiveRetailer}
957
1023
  showValidationButtons={isRevision() && getSectionStatus()}
958
1024
  servicesData={servicesData ? servicesData : null}
1025
+ showApproveRejectAll={
1026
+ user.is_retailer === 1 &&
1027
+ (product.id_order || product.orderId) &&
1028
+ isRevision() &&
1029
+ getSectionStatus()
1030
+ }
1031
+ approveAll={() => validateAll("A")}
1032
+ rejectAll={() => validateAll("R")}
959
1033
  approve={() => {
960
1034
  if (
961
1035
  origin[activeTab] === "RequestWithoutContentoh" &&
@@ -1197,14 +1271,22 @@ export const ProviderProductEdition = ({
1197
1271
  </Link>
1198
1272
  </button>
1199
1273
  ) : (
1200
- <Button
1201
- onClick={() => {
1202
- setShowContentohRequestModal &&
1203
- setShowContentohRequestModal(true);
1204
- }}
1205
- buttonType="general-default-button"
1206
- label="Enviar a Content-oh!"
1207
- />
1274
+ <>
1275
+ <SliderToolTip
1276
+ infoIcon={InfoIcon}
1277
+ slidefront={slidefront}
1278
+ iconSize={"big-image"}
1279
+ slidePosition={"top-slide"}
1280
+ ></SliderToolTip>
1281
+ <Button
1282
+ onClick={() => {
1283
+ setShowContentohRequestModal &&
1284
+ setShowContentohRequestModal(true);
1285
+ }}
1286
+ buttonType="general-default-button"
1287
+ label="Enviar a Content-oh!"
1288
+ />
1289
+ </>
1208
1290
  )}
1209
1291
  </div>
1210
1292
  )}
@@ -16,7 +16,7 @@ RetailerProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImE2YzRkM2Q2LTI0YTQtNDFkNC1hZDBmLWQwODc0MzhhYjViNiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIxMDEyMmE5OC0wMDc1LTQxYmMtYjkxMi02NjBiNTE2MzMxMDQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NTc1NDEyNSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY1NTc1NzcyNSwiaWF0IjoxNjU1NzU0MTI1LCJlbWFpbCI6ImV0Y0Bjb250ZW50b2guY29tIn0.KFEGYLEDArzX7rXRsXo4wCc6nuSxATU6E8aL_XSCJyvYk3F2fn-cslstPX-zEgG1uybmzXfxMvSfnhjMGe1hCdxpHXXrcq4Khm6jlHcnsF62QUdIz5gPqZDoXjegctkCqQtTYhuZEhxhXmHn9Ijj3rSdk2_5-4AKYx89l9p1_G3u1EN8Vs1jH6BuE2v7u1wv45QQ9KB6h7s8DLZF_SfmivlJbQrqKmOzbwlDBpll94rRffKjHXzJtXx0YmKM--zU0E3dzAEdq-UcfEnM7GpC-SV__xMoLK7Rj7yTAq1fTHEfcMnAFBzkSoPjNAUi5xBw9GLCxt55DmZlVfvKyfzx6Q",
19
+ "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJkMjc2ZGUwMy01YmM3LTRkZjEtYTk4MC1jYmYwYjkyOGU3MDEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NjEwMDM2MSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY1NjEwMzk2MSwiaWF0IjoxNjU2MTAwMzYxLCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.WmbNT419c79ZIIZIxT8bW6YjSAvlGW_36cehBQWtdPPIeeRWO1ZVOkJeimGNm9dKwIVzdieg13mUPmJOcFZMQGtNoj4yOYOhSrQBEOg4Gr3Rv94RAEa-AcoFNns55Cl98krqF42qoYYeFRV9nH1iZrMU2sEML6kxwWgxAza5eXFie_MioMphXxMsWj3BT5Fmzk8SSHsAuf8jIjUTdGtFsNv2TOOU8YjTlljYij9cvLpu9Udlaj6tVnnElCcGskQk-U7QXqjHYDpOgeEkdWZU-Cy-vm4bT6qYCQHNtMxVCu_RZPpNm_p3vSWgkhj__baJsffhsb-PAETQKPTLuT690w",
20
20
  articleId: 238,
21
21
  category: 846,
22
22
  version: 2,
@@ -26,39 +26,39 @@ RetailerProductEditionDefault.args = {
26
26
  descriptions: 1,
27
27
  images: 1,
28
28
  },
29
- orderId: 83,
30
- status: "ASSIGNED",
31
- datasheet_status: "IN_PROGRESS",
32
- prio: "none",
29
+ orderId: 1213,
30
+ status: "AA",
31
+ datasheet_status: "AA",
32
+ prio: "low",
33
33
  version: 2,
34
- description_status: "IN_PROGRESS",
35
- images_status: "IN_PROGRESS",
34
+ description_status: "AA",
35
+ images_status: "AA",
36
36
  article: {
37
- id_article: 55150,
38
- id_category: "697",
39
- name: "Shampoo hidratante",
40
- upc: "4116665",
41
- timestamp: "2022-06-21T19:47:57.000Z",
42
- id_user: 28,
43
- status: "NULL",
37
+ id_article: 17517,
38
+ id_category: "691",
39
+ name: "Antitranspirante Lady Speed Stick Clinical Complete en Barra para Dama 45 g",
40
+ upc: "7509546066172",
41
+ timestamp: "2021-10-09T16:33:17.000Z",
42
+ id_user: 203,
43
+ status: "RECEPTION",
44
44
  active: 1,
45
- company_id: 1,
46
- company_name: "COMPANY DEV",
47
- country: "México",
48
- id_order: 83,
49
- id_datasheet_especialist: 54,
50
- id_datasheet_facilitator: 52,
51
- id_description_especialist: 54,
52
- id_description_facilitator: 52,
53
- id_images_especialist: 55,
54
- id_images_facilitator: 53,
55
- id_auditor: 30,
45
+ company_id: 226,
46
+ company_name: "Prueba Test S.A de C.V.",
47
+ country: "null",
48
+ id_order: 1213,
49
+ id_datasheet_especialist: 334,
50
+ id_datasheet_facilitator: 158,
51
+ id_description_especialist: 334,
52
+ id_description_facilitator: 158,
53
+ id_images_especialist: 366,
54
+ id_images_facilitator: 14,
55
+ id_auditor: 94,
56
56
  id_recepcionist: null,
57
57
  category:
58
- "SALUD Y BELLEZA|CUIDADO DEL CABELLO|SHAMPOOS Y ACONDICIONADORES",
59
- missingAttributes: 31,
60
- missingDescriptions: 6,
61
- missingImages: 3,
58
+ "SALUD Y BELLEZA|CUIDADO CORPORAL|DESODORANTES CABALLERO Y DAMA",
59
+ missingAttributes: 1,
60
+ missingDescriptions: 0,
61
+ missingImages: -4,
62
62
  },
63
63
  retailers: [
64
64
  {
@@ -69,49 +69,57 @@ RetailerProductEditionDefault.args = {
69
69
  active: 1,
70
70
  },
71
71
  {
72
- id: 26,
73
- name: "Mercado Libre",
72
+ id: 6,
73
+ name: "HEB",
74
+ country: "México",
75
+ id_region: 1,
76
+ active: 1,
77
+ },
78
+ {
79
+ id: 29,
80
+ name: "Farmacias del Ahorro",
74
81
  country: "México",
75
82
  id_region: 1,
76
83
  active: 1,
77
84
  },
78
85
  ],
79
- country: "México",
80
- upc: "4116665",
86
+ country: "null",
87
+ upc: "7509546066172",
81
88
  },
82
89
  location: {
83
90
  product: { articleId: 109485, versionId: 3 },
84
91
  },
85
92
  user: {
86
- id_user: 51,
87
- name: "ADMIN PRUEBA",
88
- last_name: "",
89
- email: "etc@contentoh.com",
90
- position: null,
93
+ id_user: 423,
94
+ name: "Facilitador Textos",
95
+ last_name: " ",
96
+ email: "bayadi1538@mnqlm.com",
97
+ position: "Tester",
91
98
  telephone: null,
92
99
  country: null,
93
- id_company: 2,
94
- id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
100
+ id_company: 254,
101
+ id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
95
102
  birth_Date: null,
96
103
  about_me: null,
97
104
  zip_code: null,
98
105
  address: null,
99
106
  job: null,
100
107
  id_stripe: null,
101
- id_role: 1,
108
+ id_role: 4,
102
109
  active: 1,
103
110
  is_retailer: 0,
111
+ email_notify: null,
104
112
  membership: {
105
- id: 2,
106
- start_date: "2021-11-05T02:35:12.000Z",
107
- end_date: "2022-11-05T02:34:49.000Z",
108
- planID: 1,
109
- plan: "prod_KtkvuFFLpOdP6e",
110
- name: "Plan Free",
111
- user_limit: "1",
112
- products_limit: "3",
113
- type: "PyMES",
113
+ id: 750,
114
+ start_date: "2022-01-07T21:32:54.000Z",
115
+ end_date: "2023-01-07T21:32:54.000Z",
116
+ planID: 6,
117
+ plan: "prod_KvGd6YSTJyR3AP",
118
+ name: "Plan Small",
119
+ user_limit: "10",
120
+ products_limit: "1000",
121
+ type: "Enterprise",
114
122
  },
115
- src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1655754126500",
123
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1656100361978",
116
124
  },
117
125
  };
@@ -174,6 +174,7 @@ export const RetailerProductEdition = ({
174
174
  try {
175
175
  const services = await getRetailerServices(
176
176
  product?.article?.id_article,
177
+ product?.article?.category,
177
178
  parseInt(product?.article?.id_category),
178
179
  product?.version
179
180
  );
@@ -956,14 +957,23 @@ export const RetailerProductEdition = ({
956
957
  };
957
958
 
958
959
  const downloadImages = () => {
959
- selectedImages.forEach((e) => {
960
- if (e.id) {
961
- saveAs(
962
- `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
963
- `${product.article.upc}_${e.name}.${e.ext}`
964
- );
965
- }
966
- });
960
+ selectedImages.length > 0
961
+ ? selectedImages.forEach((e) => {
962
+ if (e.id) {
963
+ saveAs(
964
+ `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
965
+ `${product.article.upc}_${e.name}.${e.ext}`
966
+ );
967
+ }
968
+ })
969
+ : images?.values?.forEach((e) => {
970
+ if (e.id) {
971
+ saveAs(
972
+ `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${e.srcDB}`,
973
+ `${product.article.upc}_${e.name}.${e.ext}`
974
+ );
975
+ }
976
+ });
967
977
  };
968
978
 
969
979
  const deleteImages = () => {
@@ -2,29 +2,41 @@ import axios from "axios";
2
2
  import { Base64 } from "js-base64";
3
3
  import { v4 as uuidv4 } from "uuid";
4
4
 
5
- export const getRetailerServices = async (articleId, category, version) => {
6
- const responseArray = await Promise.all([
7
- axios.post(
8
- `${process.env.REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT}?idCategory=${category}&articleId=${articleId}&version=${version}`
9
- ),
10
- axios.get(
11
- `${process.env.REACT_APP_ARTICLE_DATA_DESCRIPTION_ENDPOINT}?idCategory=${category}&articleId=${articleId}&version=${version}`
12
- ),
13
- axios.post(
14
- `${process.env.REACT_APP_ARTICLE_DATA_IMAGES_ENDPOINT}?idCategory=${category}&articleId=${articleId}&version=${version}`
15
- ),
16
- ]);
5
+ export const getRetailerServices = async (
6
+ articleId,
7
+ category,
8
+ categoryId,
9
+ version
10
+ ) => {
11
+ try {
12
+ const responseArray = await Promise.all([
13
+ axios.post(
14
+ `${process.env.REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}`
15
+ ),
16
+ axios.get(
17
+ `${process.env.REACT_APP_ARTICLE_DATA_DESCRIPTION_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}`
18
+ ),
19
+ axios.post(
20
+ `${process.env.REACT_APP_ARTICLE_DATA_IMAGES_ENDPOINT}?articleId=${articleId}&version=${version}`,
21
+ {
22
+ category,
23
+ }
24
+ ),
25
+ ]);
17
26
 
18
- const datasheets = JSON.parse(responseArray[0].data.body).data;
19
- const descriptions = JSON.parse(responseArray[1].data.body).data;
20
- const images = JSON.parse(responseArray[2].data.body).data;
27
+ const datasheets = JSON.parse(responseArray[0].data.body).data;
28
+ const descriptions = JSON.parse(responseArray[1].data.body).data;
29
+ const images = JSON.parse(responseArray[2].data.body).data;
21
30
 
22
- images.values = images?.values?.map((value) => {
23
- value.name = images.inputs.find((e) => e.id === value.image_id).name;
24
- return getImage(value);
25
- });
31
+ images.values = images?.values?.map((value) => {
32
+ value.name = images.inputs.find((e) => e.id === value.image_id)?.name;
33
+ return getImage(value);
34
+ });
26
35
 
27
- return [datasheets, descriptions, images];
36
+ return [datasheets, descriptions, images];
37
+ } catch (error) {
38
+ console.log(error);
39
+ }
28
40
  };
29
41
 
30
42
  export const getImage = (imageGeneral, width = 250, height = 250) => {
package/src/index.js CHANGED
@@ -22,7 +22,6 @@ export * from "./components/atoms/SliderToolTip/index";
22
22
  export * from "./components/atoms/StatusTag/index";
23
23
  export * from "./components/atoms/TabSection/index";
24
24
  export * from "./components/atoms/ValidationPanel/index";
25
- export * from "./components/atoms/VerticalSideMenuMainPage/index";
26
25
 
27
26
  //molecules
28
27
  export * from "./components/molecules/AvatarAndValidation/index";