contentoh-components-library 21.4.73 → 21.4.74

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.
@@ -16,64 +16,60 @@ RetailerProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI0OTMyY2JhZC1lYzcyLTRjYWItODgyNS0wMzY2M2RkNmE2ODIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY5Mjc1MDY0NywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY5Mjc1NDI0NywiaWF0IjoxNjkyNzUwNjQ3LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.eqOY-gcS-W99WcEC632Ewckcg3WJzKoV9fIGcn1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KzUyMTExMSIsImV4cCI6MTcwMTkwNTY4NywiaWF0IjoxNzAxOTAyMDg3LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.JpoKZHuzPZG2ttaT7Oz3CAPR7xZU19txSDyjGHIwya2zV9uOHxauS0-orNRry8lfpZHQt_ISF2W-XSARUvCG1SqTXi41-o53DsWfZhqe9dQk6DGDnvFzXFsaEbaxAPjTfYc491sHCpOjf4W98quBuzDZCRtdCsr9u3A0AnX8Lh1Jquvn83nrHN2ZeefpLyKc-xGGp50Oy6EnJgSK4PcAAV631nwYV9DfVaLb3SIWDrJIIuBjFjBBCXBcnGJBieErlnF-4gumHzsro_QqF-s7aq_3EJChAhfslFvczNSyDc-LXJVkpDuZW3TaYKlHwhoFxz1aMuYRFQ8xy5Pz8FDNKQ",
20
20
  productSelected: {
21
- services: {
22
- datasheets: 1,
23
- descriptions: 1,
24
- images: 1,
25
- },
26
- orderId: 15275,
27
- status: "AC",
28
- datasheet_status: "AC",
21
+ orderId: 15190,
22
+ status: "RA",
23
+ datasheet_status: "NS",
29
24
  prio: "none",
30
25
  version: 3,
31
- description_status: "AC",
32
- images_status: "AC",
33
- statusByRetailer: {
34
- 34: {
35
- datasheet: "AC",
36
- description: "AC",
37
- images: "AC",
38
- },
26
+ description_status: "NS",
27
+ images_status: "RA",
28
+ brand: null,
29
+ retailerOrder: 0,
30
+ missing: {
31
+ datasheet: null,
32
+ descriptions: null,
33
+ images: null,
34
+ },
35
+ services: {
36
+ datasheets: 0,
37
+ descriptions: 0,
38
+ images: 1,
39
39
  },
40
40
  article: {
41
- id_article: 39485,
42
- id_category: "11",
43
- name: "Mix de nueces",
44
- upc: "7543453453",
45
- timestamp: "2023-07-14T21:02:54.000Z",
46
- id_user: 28,
47
- status: "NULL",
48
- active: 1,
49
- company_id: 1,
41
+ category:
42
+ "Abarrotes Básicos|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
50
43
  company_name: "GRUPO BRAHMA",
51
44
  country: "México",
52
- id_order: 15275,
53
- id_datasheet_especialist: 54,
54
- id_datasheet_facilitator: 52,
55
- id_description_especialist: 54,
56
- id_description_facilitator: 52,
45
+ id_category: "4004",
46
+ id_datasheet_especialist: null,
47
+ id_datasheet_facilitator: null,
48
+ id_description_especialist: null,
49
+ id_description_facilitator: null,
57
50
  id_images_especialist: 55,
58
51
  id_images_facilitator: 53,
52
+ id_order: 15190,
53
+ id_article: 39364,
59
54
  id_auditor: 37,
60
- id_recepcionist: null,
61
- category: "Abarrotes|Abarrotes Secos|Frutos Secos",
62
- missingAttributes: 0,
63
- missingDescriptions: 0,
64
- missingImages: 0,
55
+ name: "test 2 img ba",
56
+ timestamp: "2023-05-05T02:56:16.000Z",
57
+ upc: "4353242",
65
58
  },
66
59
  retailers: [
67
60
  {
68
- id: 34,
69
- name: "San Pablo",
61
+ id: 70,
62
+ name: "Bodega Aurrera",
70
63
  },
71
64
  ],
72
- country: "México",
73
- upc: "7543453453",
65
+ statusByRetailer: {
66
+ 70: {
67
+ images: "RA/AC",
68
+ },
69
+ },
74
70
  },
75
71
  location: {
76
- product: { articleId: 39290, versionId: 7 },
72
+ product: { articleId: 39364, versionId: 3 },
77
73
  },
78
74
  user: {
79
75
  id_user: 37,
@@ -83,7 +79,7 @@ RetailerProductEditionDefault.args = {
83
79
  position: "Auditor",
84
80
  telephone: "",
85
81
  country: "México",
86
- id_company: 2,
82
+ id_company: 254,
87
83
  id_cognito: "9a213128-6482-4c16-a4b6-6e64f225b1bd",
88
84
  birth_Date: null,
89
85
  about_me: "",
@@ -97,16 +93,16 @@ RetailerProductEditionDefault.args = {
97
93
  email_notify: 1,
98
94
  is_user_tech: null,
99
95
  membership: {
100
- id: 2,
101
- start_date: "2021-11-05T02:35:12.000Z",
102
- end_date: "2022-11-05T02:34:49.000Z",
103
- planID: 1,
104
- plan: "prod_KtkvuFFLpOdP6e",
105
- name: "Plan Free",
106
- user_limit: "1",
107
- products_limit: "3",
108
- type: "PyMES",
96
+ id: 137,
97
+ start_date: "2023-10-04T15:46:14.000Z",
98
+ end_date: "2024-10-04T08:46:09.000Z",
99
+ planID: 8,
100
+ plan: "prod_KtlhECVSFG2iro",
101
+ name: "Plan Pro",
102
+ user_limit: "50",
103
+ products_limit: "5000",
104
+ type: "Enterprise",
109
105
  },
110
- src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1692750648813",
106
+ src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1701902088068",
111
107
  },
112
108
  };
@@ -272,7 +272,20 @@ export const RetailerProductEdition = ({
272
272
  getServices();
273
273
  setImages({ action: "init", init: services[2] });
274
274
  if (services[2]?.values?.length > 0) setActiveImage(0);
275
- getPercentage({ data: [product] }).then((res) => setPercentages(res[0]));
275
+ const data = [
276
+ {
277
+ id_article: product.article.id_article,
278
+ id_category: product.article.id_category,
279
+ version: product.version,
280
+ id_retailer_array: (
281
+ product.retailersAvailable ?? product.retailers
282
+ ).map(({ id }) => id),
283
+ },
284
+ ];
285
+ const headers = { Authorization: token };
286
+ getPercentage({ data, headers }).then((res) => {
287
+ setPercentages(res[0]);
288
+ });
276
289
  setLoading(false);
277
290
  } catch (error) {
278
291
  console.log(error);
@@ -1336,7 +1349,6 @@ export const RetailerProductEdition = ({
1336
1349
  // };
1337
1350
 
1338
1351
  const validateAll = async (result) => {
1339
-
1340
1352
  try {
1341
1353
  setLoading(true);
1342
1354
  const evaluationArray = [];
@@ -13,9 +13,7 @@ export const getRetailerServices = async (
13
13
  const responseArray = await Promise.all([
14
14
  axios.post(
15
15
  `${process.env.REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT}?idCategory=${categoryId}&articleId=${articleId}&version=${version}`,
16
- {
17
-
18
- },
16
+ {},
19
17
  {
20
18
  headers: {
21
19
  Authorization: token,
@@ -94,43 +92,17 @@ export const getImage = (imageGeneral, width = 250, height = 250) => {
94
92
 
95
93
  export const getPercentage = async (params = {}) => {
96
94
  const func = async () => {
97
- const dataToSend = [];
98
- const arrayRetailers = [];
99
- let retailers =
100
- params.data[0].retailers || params.data[0].retailersAvailable;
101
- params.data.forEach((product, i) => {
102
- dataToSend.push(
103
- product.article
104
- ? {
105
- id_article: product.article.id_article,
106
- id_category: product.article.id_category,
107
- version: product.version,
108
- }
109
- : {
110
- id_article: product.id_article,
111
- id_category: product.id_category,
112
- version: product.version,
113
- }
114
- );
115
- retailers.forEach((retailer) => {
116
- arrayRetailers.push(retailer.id);
117
- });
118
- dataToSend[i].id_retailer_array = arrayRetailers;
119
- });
120
-
95
+ const headers = {
96
+ Authorization:
97
+ params?.headers?.Authorization ?? sessionStorage.getItem("jwt"),
98
+ };
121
99
  return await axios
122
100
  .post(
123
101
  process.env.REACT_APP_VALID_EXPORT_ENDPOINT,
124
- { data: dataToSend },
125
- {
126
- headers: {
127
- Authorization: sessionStorage.getItem("jwt"),
128
- },
129
- }
102
+ { data: params.data },
103
+ { headers }
130
104
  )
131
- .then((response) => {
132
- return [response.data];
133
- })
105
+ .then((response) => [response.data])
134
106
  .catch((err) => console.log(err, "Errror"));
135
107
  };
136
108