contentoh-components-library 21.3.32 → 21.3.34

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 (35) hide show
  1. package/dist/components/atoms/CustomSelectItem/index.js +1 -1
  2. package/dist/components/atoms/InputText/index.js +1 -1
  3. package/dist/components/atoms/ProductPercentCard/index.js +1 -1
  4. package/dist/components/atoms/Select/index.js +1 -1
  5. package/dist/components/molecules/ButtonDownloadFile/index.js +1 -1
  6. package/dist/components/molecules/CarouselImagesLogin/index.js +2 -2
  7. package/dist/components/molecules/ImageTooltip/index.js +7 -21
  8. package/dist/components/molecules/ProductNameHeader/index.js +0 -1
  9. package/dist/components/molecules/SelectV2/index.js +1 -1
  10. package/dist/components/organisms/Chat/Chat.stories.js +6 -5
  11. package/dist/components/organisms/Chat/ChatLists/index.js +2 -2
  12. package/dist/components/organisms/Chat/ContentChat/index.js +85 -49
  13. package/dist/components/organisms/Chat/Footer/index.js +21 -22
  14. package/dist/components/organisms/Chat/index.js +1 -1
  15. package/dist/components/organisms/FullProductNameHeader/index.js +7 -1
  16. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +87 -241
  17. package/dist/global-files/handle_http.js +33 -31
  18. package/package.json +5 -5
  19. package/src/components/atoms/CustomSelectItem/index.js +2 -1
  20. package/src/components/atoms/InputText/index.js +1 -1
  21. package/src/components/atoms/ProductPercentCard/index.js +2 -2
  22. package/src/components/atoms/Select/index.js +1 -1
  23. package/src/components/molecules/ButtonDownloadFile/index.js +1 -1
  24. package/src/components/molecules/CarouselImagesLogin/index.js +2 -2
  25. package/src/components/molecules/ImageTooltip/index.js +7 -17
  26. package/src/components/molecules/ProductNameHeader/index.js +0 -1
  27. package/src/components/molecules/SelectV2/index.js +1 -1
  28. package/src/components/organisms/Chat/Chat.stories.js +5 -4
  29. package/src/components/organisms/Chat/ChatLists/index.js +2 -2
  30. package/src/components/organisms/Chat/ContentChat/index.js +35 -28
  31. package/src/components/organisms/Chat/Footer/index.js +4 -8
  32. package/src/components/organisms/Chat/index.js +1 -1
  33. package/src/components/organisms/FullProductNameHeader/index.js +8 -3
  34. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +97 -265
  35. package/src/global-files/handle_http.js +11 -13
@@ -12,305 +12,137 @@ export const ProviderProductEditionDefault = Template.bind({});
12
12
  ProviderProductEditionDefault.args = {
13
13
  tabsSections: {
14
14
  Descripción: true,
15
- "Ficha técnica": true,
16
- Imágenes: true,
15
+ "Ficha técnica": false,
16
+ Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIzZTNmZTBhOS1kY2U2LTRjYjAtYTg3MS02YzljNTBiMmRmZmQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY3OTYxMDg4NywibmFt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CI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJlZjViNDQzYi02ODc0LTQ2NGQtOWZiZS00Y2UwNWU4ZDQ3YTEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MDAzODYyNiwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjgwMDQyMjI1LCJpYXQiOjE2ODAwMzg2MjYsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.rhufpJdUaJOpiKtXJgNoDq863ecFnLp63c9_6NeEbpYYNN19d_xac8aZADN-QMpkmz1oxtqfxf_-JN5jMJexi9gJCRb9O7-xL75v_G9UjdmE8sRA6qRNb_tFUCt1oee_ulgqm_2wTjb7qGMGvY1eb1J1IX2pBYKnBy64KM6J5xFfZ57ac_bGruYhCzUexPBWyZKc5ckoY2zJqK5m5Ok7ds0m1hC0t-eQSGX_8KMsGQKiHevQ07cZUQ9mxOGVweRuAqITNx8fVmpD9QTpoZJJ5STVVcKO2CS0ltyE_DNlyejO7mZqbKvGEeLYc4ga0nozK9aP8H2cN_topT0d4JZ5rA",
20
20
  articleId: 238,
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- orderId: 14606,
25
- status: "AA",
26
- datasheet_status: "AA",
27
- prio: "none",
28
- version: 3,
29
- description_status: "AA",
30
- images_status: "AA",
31
- brand: "Axion",
32
- retailerOrder: 0,
33
- missing: {
34
- datasheet: null,
35
- descriptions: null,
36
- images: null,
37
- },
38
- services: {
39
- datasheets: 1,
40
- descriptions: 1,
41
- images: 1,
42
- },
43
- article: {
44
- category:
45
- "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
46
- company_name: "GRUPO BRAHMA",
47
- country: "México",
48
- id_category: "157",
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_order: 14606,
56
- id_article: 37317,
57
- id_auditor: 37,
58
- name: "Detergente lavatrastres líquido Axion Complete tricloro 1.1 l",
59
- timestamp: "2023-03-10T20:19:46.000Z",
60
- upc: "7509546078915",
61
- },
62
- retailers: [
63
- {
64
- id: 4,
65
- name: "Walmart Super y Superama",
66
- },
67
- {
68
- id: 5,
69
- name: "Chedraui",
70
- },
71
- {
72
- id: 6,
73
- name: "HEB",
74
- },
75
- {
76
- id: 12,
77
- name: "La Comer",
78
- },
79
- {
80
- id: 17,
81
- name: "Genérico",
82
- },
83
- ],
84
- statusByRetailer: {
85
- 4: {
86
- datasheet: "AA",
87
- description: "AA",
88
- images: "AA",
89
- },
90
- 5: {
91
- datasheet: "AA",
92
- description: "AA",
93
- images: "AA",
94
- },
95
- 6: {
96
- datasheet: "AA",
97
- description: "AA",
98
- images: "AA",
99
- },
100
- 12: {
101
- datasheet: "AA",
102
- description: "AA",
103
- images: "AA",
104
- },
105
- 17: {
106
- datasheet: "AA",
107
- description: "AA",
108
- images: "AA",
109
- },
110
- },
24
+ category: "Iluminación|Lámparas de Interior|Pie y Pedestal",
25
+ company_name: "Demo",
26
+ company_id: 923,
27
+ id_category: "2676",
28
+ id_article: 17163,
29
+ name: "Eglo 95055",
30
+ upc: "165033",
31
+ version: 1,
111
32
  retailersAvailable: [
112
33
  {
113
- id: 4,
114
- name: "Walmart Super y Superama",
115
- },
116
- {
117
- id: 5,
118
- name: "Chedraui",
119
- },
120
- {
121
- id: 6,
122
- name: "HEB",
123
- },
124
- {
125
- id: 12,
126
- name: "La Comer",
127
- },
128
- {
129
- id: 17,
130
- name: "Genérico",
34
+ id: 68,
35
+ name: "The Home Depot Merchants",
131
36
  },
132
37
  ],
133
- categoryName:
134
- "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
135
- upc: "7509546078915",
136
- id_article: 37317,
137
- id_order: 14606,
138
38
  },
139
39
  productToEdit: {
140
- ArticleId: 37317,
141
- idCategory: "157",
142
- product: {
143
- orderId: 14606,
144
- status: "AA",
145
- datasheet_status: "AA",
146
- prio: "none",
147
- version: 3,
148
- description_status: "AA",
149
- images_status: "AA",
150
- brand: "Axion",
151
- retailerOrder: 0,
152
- missing: {
153
- datasheet: null,
154
- descriptions: null,
155
- images: null,
156
- },
157
- services: {
158
- datasheets: 1,
159
- descriptions: 1,
160
- images: 1,
161
- },
162
- article: {
163
- category:
164
- "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
165
- company_name: "GRUPO BRAHMA",
166
- country: "México",
167
- id_category: "157",
168
- id_datasheet_especialist: 54,
169
- id_datasheet_facilitator: 52,
170
- id_description_especialist: 54,
171
- id_description_facilitator: 52,
172
- id_images_especialist: 55,
173
- id_images_facilitator: 53,
174
- id_order: 14606,
175
- id_article: 37317,
176
- id_auditor: 37,
177
- name: "Detergente lavatrastres líquido Axion Complete tricloro 1.1 l",
178
- timestamp: "2023-03-10T20:19:46.000Z",
179
- upc: "7509546078915",
180
- },
181
- retailers: [
182
- {
183
- id: 4,
184
- name: "Walmart Super y Superama",
185
- },
186
- {
187
- id: 5,
188
- name: "Chedraui",
189
- },
190
- {
191
- id: 6,
192
- name: "HEB",
193
- },
194
- {
195
- id: 12,
196
- name: "La Comer",
197
- },
198
- {
199
- id: 17,
200
- name: "Genérico",
201
- },
202
- ],
203
- statusByRetailer: {
204
- 4: {
205
- datasheet: "AA",
206
- description: "AA",
207
- images: "AA",
208
- },
209
- 5: {
210
- datasheet: "AA",
211
- description: "AA",
212
- images: "AA",
213
- },
214
- 6: {
215
- datasheet: "AA",
216
- description: "AA",
217
- images: "AA",
218
- },
219
- 12: {
220
- datasheet: "AA",
221
- description: "AA",
222
- images: "AA",
223
- },
224
- 17: {
225
- datasheet: "AA",
226
- description: "AA",
227
- images: "AA",
228
- },
40
+ idCategory: "2676",
41
+ ArticleId: 17163,
42
+ product: [
43
+ {
44
+ category: "Iluminación|Lámparas de Interior|Pie y Pedestal",
45
+ company_name: "Demo",
46
+ company_id: 923,
47
+ id_category: "2676",
48
+ id_article: 17163,
49
+ name: "Eglo 95055",
50
+ upc: "165033",
51
+ version: 1,
52
+ retailersAvailable: [
53
+ {
54
+ id: 68,
55
+ name: "The Home Depot Merchants",
56
+ },
57
+ ],
229
58
  },
230
- retailersAvailable: [
231
- {
232
- id: 4,
233
- name: "Walmart Super y Superama",
234
- },
235
- {
236
- id: 5,
237
- name: "Chedraui",
238
- },
239
- {
240
- id: 6,
241
- name: "HEB",
242
- },
243
- {
244
- id: 12,
245
- name: "La Comer",
246
- },
247
- {
248
- id: 17,
249
- name: "Genérico",
250
- },
251
- ],
252
- categoryName:
253
- "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
254
- upc: "7509546078915",
255
- id_article: 37317,
256
- id_order: 14606,
257
- },
59
+ ],
258
60
  },
259
61
  location: {
260
- state: { origin: "Contentoh", withChat: true },
62
+ pathname: "/EditProducts",
63
+ search: "",
64
+ hash: "",
65
+ state: {
66
+ withChat: true,
67
+ },
68
+ key: "24vwut",
261
69
  },
262
70
  user: {
263
- id_user: 28,
264
- name: "Ismael",
265
- last_name: "López",
266
- email: "ilopez@contentoh.com",
267
- position: "Test States",
71
+ id_user: 59,
72
+ name: "Cadena",
73
+ last_name: "Comercial",
74
+ email: "cadena.ismael@allfreemail.net",
75
+ position: "Admin",
268
76
  telephone: "+523111366336",
269
77
  country: "México",
270
- id_company: 1,
271
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
78
+ id_company: 817,
79
+ id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
272
80
  birth_Date: null,
273
81
  about_me: "",
274
82
  zip_code: "",
275
83
  address: "",
276
84
  job: "",
277
- id_stripe: "cus_KuEt6R6vwmN09f",
85
+ id_stripe: "",
278
86
  id_role: 0,
279
87
  active: 1,
280
- is_retailer: 0,
281
- email_notify: 1,
282
- is_user_tech: "ADMIN-AS",
88
+ is_retailer: 1,
89
+ email_notify: 0,
90
+ is_user_tech: null,
283
91
  membership: {
284
- id: 76,
285
- start_date: "2022-01-18T17:25:35.000Z",
286
- end_date: "2023-01-18T17:25:35.000Z",
287
- planID: 8,
288
- plan: "prod_KtlhECVSFG2iro",
92
+ id: 47,
93
+ start_date: "2022-05-25T14:31:12.000Z",
94
+ end_date: "2023-05-25T14:31:12.000Z",
95
+ planID: 5,
96
+ plan: "prod_Ktl6B5Ou2gqTB2",
289
97
  name: "Plan Pro",
290
- user_limit: "20",
291
- products_limit: "5000",
292
- type: "Enterprise",
98
+ user_limit: "5",
99
+ products_limit: "500",
100
+ type: "PyMES",
293
101
  },
294
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1679610888753",
102
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1680038627077",
295
103
  },
296
104
  company: {
297
- id_company: 1,
298
- trade_name: "GRUPO BRAHMA",
299
- company_name: "GRUPO BRAHMA",
300
- rfc: "XAXX010101000",
301
- adress: "AA",
302
- about_company: "",
303
- telephone: "",
304
- web_site: "",
305
- zip_code: "",
105
+ id_company: 817,
106
+ trade_name: "Retailer acc",
107
+ company_name: "Retailer acc",
108
+ rfc: "ASER12345",
109
+ adress: "Av. Insurgentes",
110
+ about_company: null,
111
+ telephone: null,
112
+ web_site: null,
113
+ zip_code: null,
306
114
  email: null,
307
- social_link: "",
308
- is_retailer: 0,
115
+ social_link: null,
116
+ is_retailer: 1,
117
+ financedRetailers: [
118
+ {
119
+ id: 68,
120
+ name: "The Home Depot Merchants",
121
+ country: "México",
122
+ id_region: 1,
123
+ active: 1,
124
+ },
125
+ ],
309
126
  retailers: [
310
127
  {
311
- id: null,
312
- name: null,
313
- country: null,
128
+ id: 59,
129
+ name: "The Home Depot Platinum",
130
+ country: "México",
131
+ },
132
+ {
133
+ id: 60,
134
+ name: "The Home Depot Resizing",
135
+ country: "México",
136
+ },
137
+ {
138
+ id: 61,
139
+ name: "Home Depot TAB",
140
+ country: "México",
141
+ },
142
+ {
143
+ id: 68,
144
+ name: "The Home Depot Merchants",
145
+ country: "México",
314
146
  },
315
147
  ],
316
148
  },
@@ -1,6 +1,14 @@
1
1
  import axios from "axios";
2
2
 
3
- //============================================================
3
+ const objToQueryString = (obj) => {
4
+ if (!Object.values(obj).length) return null;
5
+ return Object.entries(obj)
6
+ .map(
7
+ ([key, value]) => `${key}=${encodeURIComponent(JSON.stringify(value))}`
8
+ )
9
+ .join("&");
10
+ };
11
+
4
12
  /**
5
13
  * funcion que realiza un axios GET
6
14
  *
@@ -10,10 +18,7 @@ import axios from "axios";
10
18
  * body: {} | undefined ,
11
19
  * message: string,
12
20
  * errorDetail: string
13
- * }> }
14
- *
15
- */
16
- //============================================================
21
+ * }> } */
17
22
  export const fetchGET = (
18
23
  endpoint = "",
19
24
  paramsQuery = {},
@@ -21,16 +26,9 @@ export const fetchGET = (
21
26
  ) => {
22
27
  return new Promise(async (response) => {
23
28
  try {
24
- let URL = endpoint;
29
+ let URL = `${endpoint}?${objToQueryString(paramsQuery)}`;
25
30
  const keysParamsQuery = Object.keys(paramsQuery);
26
31
  // agregar cada param query a la URL
27
- keysParamsQuery.forEach((key, index) => {
28
- if (index == 0) {
29
- URL += `?${key}=${paramsQuery[key]}`;
30
- } else {
31
- URL += `&${key}=${paramsQuery[key]}`;
32
- }
33
- });
34
32
  const respHTTPjson = await axios.get(URL, { headers: paramsHeaders });
35
33
  // verificar si existe un error en la peticion realizada
36
34
  if (respHTTPjson.status !== 200) {