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.
- package/dist/components/atoms/CustomSelectItem/index.js +1 -1
- package/dist/components/atoms/InputText/index.js +1 -1
- package/dist/components/atoms/ProductPercentCard/index.js +1 -1
- package/dist/components/atoms/Select/index.js +1 -1
- package/dist/components/molecules/ButtonDownloadFile/index.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +2 -2
- package/dist/components/molecules/ImageTooltip/index.js +7 -21
- package/dist/components/molecules/ProductNameHeader/index.js +0 -1
- package/dist/components/molecules/SelectV2/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +6 -5
- package/dist/components/organisms/Chat/ChatLists/index.js +2 -2
- package/dist/components/organisms/Chat/ContentChat/index.js +85 -49
- package/dist/components/organisms/Chat/Footer/index.js +21 -22
- package/dist/components/organisms/Chat/index.js +1 -1
- package/dist/components/organisms/FullProductNameHeader/index.js +7 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +87 -241
- package/dist/global-files/handle_http.js +33 -31
- package/package.json +5 -5
- package/src/components/atoms/CustomSelectItem/index.js +2 -1
- package/src/components/atoms/InputText/index.js +1 -1
- package/src/components/atoms/ProductPercentCard/index.js +2 -2
- package/src/components/atoms/Select/index.js +1 -1
- package/src/components/molecules/ButtonDownloadFile/index.js +1 -1
- package/src/components/molecules/CarouselImagesLogin/index.js +2 -2
- package/src/components/molecules/ImageTooltip/index.js +7 -17
- package/src/components/molecules/ProductNameHeader/index.js +0 -1
- package/src/components/molecules/SelectV2/index.js +1 -1
- package/src/components/organisms/Chat/Chat.stories.js +5 -4
- package/src/components/organisms/Chat/ChatLists/index.js +2 -2
- package/src/components/organisms/Chat/ContentChat/index.js +35 -28
- package/src/components/organisms/Chat/Footer/index.js +4 -8
- package/src/components/organisms/Chat/index.js +1 -1
- package/src/components/organisms/FullProductNameHeader/index.js +8 -3
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +97 -265
- package/src/global-files/handle_http.js +11 -13
|
@@ -55,6 +55,12 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
55
55
|
});
|
|
56
56
|
setRetailers(rtls);
|
|
57
57
|
}, [servicesData]);
|
|
58
|
+
|
|
59
|
+
var getTime = function getTime(date) {
|
|
60
|
+
if (!date) return "";
|
|
61
|
+
return new Date(date).toLocaleDateString();
|
|
62
|
+
};
|
|
63
|
+
|
|
58
64
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
59
65
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductNameHeader.ProductNameHeader, {
|
|
60
66
|
productName: (headerData === null || headerData === void 0 ? void 0 : (_headerData$article = headerData.article) === null || _headerData$article === void 0 ? void 0 : _headerData$article.name) || (headerData === null || headerData === void 0 ? void 0 : headerData.name),
|
|
@@ -62,7 +68,7 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
62
68
|
percentRequired: percent,
|
|
63
69
|
percent: percent === null || percent === void 0 ? void 0 : percent.toFixed(0),
|
|
64
70
|
priority: headerData === null || headerData === void 0 ? void 0 : headerData.prio,
|
|
65
|
-
date:
|
|
71
|
+
date: getTime((headerData === null || headerData === void 0 ? void 0 : (_headerData$article2 = headerData.article) === null || _headerData$article2 === void 0 ? void 0 : _headerData$article2.timestamp) || (headerData === null || headerData === void 0 ? void 0 : headerData.timestamp))
|
|
66
72
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
67
73
|
className: "features-bar-container",
|
|
68
74
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FeaturesBar.FeaturesBar, {
|
|
@@ -28,278 +28,124 @@ exports.ProviderProductEditionDefault = ProviderProductEditionDefault;
|
|
|
28
28
|
ProviderProductEditionDefault.args = {
|
|
29
29
|
tabsSections: {
|
|
30
30
|
Descripción: true,
|
|
31
|
-
"Ficha técnica":
|
|
32
|
-
Imágenes:
|
|
31
|
+
"Ficha técnica": false,
|
|
32
|
+
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJlZjViNDQzYi02ODc0LTQ2NGQtOWZiZS00Y2UwNWU4ZDQ3YTEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MDAzODYyNiwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjgwMDQyMjI1LCJpYXQiOjE2ODAwMzg2MjYsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.rhufpJdUaJOpiKtXJgNoDq863ecFnLp63c9_6NeEbpYYNN19d_xac8aZADN-QMpkmz1oxtqfxf_-JN5jMJexi9gJCRb9O7-xL75v_G9UjdmE8sRA6qRNb_tFUCt1oee_ulgqm_2wTjb7qGMGvY1eb1J1IX2pBYKnBy64KM6J5xFfZ57ac_bGruYhCzUexPBWyZKc5ckoY2zJqK5m5Ok7ds0m1hC0t-eQSGX_8KMsGQKiHevQ07cZUQ9mxOGVweRuAqITNx8fVmpD9QTpoZJJ5STVVcKO2CS0ltyE_DNlyejO7mZqbKvGEeLYc4ga0nozK9aP8H2cN_topT0d4JZ5rA",
|
|
35
35
|
articleId: 238,
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
retailerOrder: 0,
|
|
48
|
-
missing: {
|
|
49
|
-
datasheet: null,
|
|
50
|
-
descriptions: null,
|
|
51
|
-
images: null
|
|
52
|
-
},
|
|
53
|
-
services: {
|
|
54
|
-
datasheets: 1,
|
|
55
|
-
descriptions: 1,
|
|
56
|
-
images: 1
|
|
57
|
-
},
|
|
58
|
-
article: {
|
|
59
|
-
category: "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
60
|
-
company_name: "GRUPO BRAHMA",
|
|
61
|
-
country: "México",
|
|
62
|
-
id_category: "157",
|
|
63
|
-
id_datasheet_especialist: 54,
|
|
64
|
-
id_datasheet_facilitator: 52,
|
|
65
|
-
id_description_especialist: 54,
|
|
66
|
-
id_description_facilitator: 52,
|
|
67
|
-
id_images_especialist: 55,
|
|
68
|
-
id_images_facilitator: 53,
|
|
69
|
-
id_order: 14606,
|
|
70
|
-
id_article: 37317,
|
|
71
|
-
id_auditor: 37,
|
|
72
|
-
name: "Detergente lavatrastres líquido Axion Complete tricloro 1.1 l",
|
|
73
|
-
timestamp: "2023-03-10T20:19:46.000Z",
|
|
74
|
-
upc: "7509546078915"
|
|
75
|
-
},
|
|
76
|
-
retailers: [{
|
|
77
|
-
id: 4,
|
|
78
|
-
name: "Walmart Super y Superama"
|
|
79
|
-
}, {
|
|
80
|
-
id: 5,
|
|
81
|
-
name: "Chedraui"
|
|
82
|
-
}, {
|
|
83
|
-
id: 6,
|
|
84
|
-
name: "HEB"
|
|
85
|
-
}, {
|
|
86
|
-
id: 12,
|
|
87
|
-
name: "La Comer"
|
|
88
|
-
}, {
|
|
89
|
-
id: 17,
|
|
90
|
-
name: "Genérico"
|
|
91
|
-
}],
|
|
92
|
-
statusByRetailer: {
|
|
93
|
-
4: {
|
|
94
|
-
datasheet: "AA",
|
|
95
|
-
description: "AA",
|
|
96
|
-
images: "AA"
|
|
97
|
-
},
|
|
98
|
-
5: {
|
|
99
|
-
datasheet: "AA",
|
|
100
|
-
description: "AA",
|
|
101
|
-
images: "AA"
|
|
102
|
-
},
|
|
103
|
-
6: {
|
|
104
|
-
datasheet: "AA",
|
|
105
|
-
description: "AA",
|
|
106
|
-
images: "AA"
|
|
107
|
-
},
|
|
108
|
-
12: {
|
|
109
|
-
datasheet: "AA",
|
|
110
|
-
description: "AA",
|
|
111
|
-
images: "AA"
|
|
112
|
-
},
|
|
113
|
-
17: {
|
|
114
|
-
datasheet: "AA",
|
|
115
|
-
description: "AA",
|
|
116
|
-
images: "AA"
|
|
117
|
-
}
|
|
118
|
-
},
|
|
39
|
+
category: "Iluminación|Lámparas de Interior|Pie y Pedestal",
|
|
40
|
+
company_name: "Demo",
|
|
41
|
+
company_id: 923,
|
|
42
|
+
id_category: "2676",
|
|
43
|
+
id_article: 17163,
|
|
44
|
+
name: "Eglo 95055",
|
|
45
|
+
upc: "165033",
|
|
46
|
+
version: 1,
|
|
119
47
|
retailersAvailable: [{
|
|
120
|
-
id:
|
|
121
|
-
name: "
|
|
122
|
-
}
|
|
123
|
-
id: 5,
|
|
124
|
-
name: "Chedraui"
|
|
125
|
-
}, {
|
|
126
|
-
id: 6,
|
|
127
|
-
name: "HEB"
|
|
128
|
-
}, {
|
|
129
|
-
id: 12,
|
|
130
|
-
name: "La Comer"
|
|
131
|
-
}, {
|
|
132
|
-
id: 17,
|
|
133
|
-
name: "Genérico"
|
|
134
|
-
}],
|
|
135
|
-
categoryName: "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
136
|
-
upc: "7509546078915",
|
|
137
|
-
id_article: 37317,
|
|
138
|
-
id_order: 14606
|
|
48
|
+
id: 68,
|
|
49
|
+
name: "The Home Depot Merchants"
|
|
50
|
+
}]
|
|
139
51
|
},
|
|
140
52
|
productToEdit: {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
product: {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
retailerOrder: 0,
|
|
153
|
-
missing: {
|
|
154
|
-
datasheet: null,
|
|
155
|
-
descriptions: null,
|
|
156
|
-
images: null
|
|
157
|
-
},
|
|
158
|
-
services: {
|
|
159
|
-
datasheets: 1,
|
|
160
|
-
descriptions: 1,
|
|
161
|
-
images: 1
|
|
162
|
-
},
|
|
163
|
-
article: {
|
|
164
|
-
category: "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
|
-
id: 4,
|
|
183
|
-
name: "Walmart Super y Superama"
|
|
184
|
-
}, {
|
|
185
|
-
id: 5,
|
|
186
|
-
name: "Chedraui"
|
|
187
|
-
}, {
|
|
188
|
-
id: 6,
|
|
189
|
-
name: "HEB"
|
|
190
|
-
}, {
|
|
191
|
-
id: 12,
|
|
192
|
-
name: "La Comer"
|
|
193
|
-
}, {
|
|
194
|
-
id: 17,
|
|
195
|
-
name: "Genérico"
|
|
196
|
-
}],
|
|
197
|
-
statusByRetailer: {
|
|
198
|
-
4: {
|
|
199
|
-
datasheet: "AA",
|
|
200
|
-
description: "AA",
|
|
201
|
-
images: "AA"
|
|
202
|
-
},
|
|
203
|
-
5: {
|
|
204
|
-
datasheet: "AA",
|
|
205
|
-
description: "AA",
|
|
206
|
-
images: "AA"
|
|
207
|
-
},
|
|
208
|
-
6: {
|
|
209
|
-
datasheet: "AA",
|
|
210
|
-
description: "AA",
|
|
211
|
-
images: "AA"
|
|
212
|
-
},
|
|
213
|
-
12: {
|
|
214
|
-
datasheet: "AA",
|
|
215
|
-
description: "AA",
|
|
216
|
-
images: "AA"
|
|
217
|
-
},
|
|
218
|
-
17: {
|
|
219
|
-
datasheet: "AA",
|
|
220
|
-
description: "AA",
|
|
221
|
-
images: "AA"
|
|
222
|
-
}
|
|
223
|
-
},
|
|
53
|
+
idCategory: "2676",
|
|
54
|
+
ArticleId: 17163,
|
|
55
|
+
product: [{
|
|
56
|
+
category: "Iluminación|Lámparas de Interior|Pie y Pedestal",
|
|
57
|
+
company_name: "Demo",
|
|
58
|
+
company_id: 923,
|
|
59
|
+
id_category: "2676",
|
|
60
|
+
id_article: 17163,
|
|
61
|
+
name: "Eglo 95055",
|
|
62
|
+
upc: "165033",
|
|
63
|
+
version: 1,
|
|
224
64
|
retailersAvailable: [{
|
|
225
|
-
id:
|
|
226
|
-
name: "
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
name: "Chedraui"
|
|
230
|
-
}, {
|
|
231
|
-
id: 6,
|
|
232
|
-
name: "HEB"
|
|
233
|
-
}, {
|
|
234
|
-
id: 12,
|
|
235
|
-
name: "La Comer"
|
|
236
|
-
}, {
|
|
237
|
-
id: 17,
|
|
238
|
-
name: "Genérico"
|
|
239
|
-
}],
|
|
240
|
-
categoryName: "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
241
|
-
upc: "7509546078915",
|
|
242
|
-
id_article: 37317,
|
|
243
|
-
id_order: 14606
|
|
244
|
-
}
|
|
65
|
+
id: 68,
|
|
66
|
+
name: "The Home Depot Merchants"
|
|
67
|
+
}]
|
|
68
|
+
}]
|
|
245
69
|
},
|
|
246
70
|
location: {
|
|
71
|
+
pathname: "/EditProducts",
|
|
72
|
+
search: "",
|
|
73
|
+
hash: "",
|
|
247
74
|
state: {
|
|
248
|
-
origin: "Contentoh",
|
|
249
75
|
withChat: true
|
|
250
|
-
}
|
|
76
|
+
},
|
|
77
|
+
key: "24vwut"
|
|
251
78
|
},
|
|
252
79
|
user: {
|
|
253
|
-
id_user:
|
|
254
|
-
name: "
|
|
255
|
-
last_name: "
|
|
256
|
-
email: "
|
|
257
|
-
position: "
|
|
80
|
+
id_user: 59,
|
|
81
|
+
name: "Cadena",
|
|
82
|
+
last_name: "Comercial",
|
|
83
|
+
email: "cadena.ismael@allfreemail.net",
|
|
84
|
+
position: "Admin",
|
|
258
85
|
telephone: "+523111366336",
|
|
259
86
|
country: "México",
|
|
260
|
-
id_company:
|
|
261
|
-
id_cognito: "
|
|
87
|
+
id_company: 817,
|
|
88
|
+
id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
|
|
262
89
|
birth_Date: null,
|
|
263
90
|
about_me: "",
|
|
264
91
|
zip_code: "",
|
|
265
92
|
address: "",
|
|
266
93
|
job: "",
|
|
267
|
-
id_stripe: "
|
|
94
|
+
id_stripe: "",
|
|
268
95
|
id_role: 0,
|
|
269
96
|
active: 1,
|
|
270
|
-
is_retailer:
|
|
271
|
-
email_notify:
|
|
272
|
-
is_user_tech:
|
|
97
|
+
is_retailer: 1,
|
|
98
|
+
email_notify: 0,
|
|
99
|
+
is_user_tech: null,
|
|
273
100
|
membership: {
|
|
274
|
-
id:
|
|
275
|
-
start_date: "2022-
|
|
276
|
-
end_date: "2023-
|
|
277
|
-
planID:
|
|
278
|
-
plan: "
|
|
101
|
+
id: 47,
|
|
102
|
+
start_date: "2022-05-25T14:31:12.000Z",
|
|
103
|
+
end_date: "2023-05-25T14:31:12.000Z",
|
|
104
|
+
planID: 5,
|
|
105
|
+
plan: "prod_Ktl6B5Ou2gqTB2",
|
|
279
106
|
name: "Plan Pro",
|
|
280
|
-
user_limit: "
|
|
281
|
-
products_limit: "
|
|
282
|
-
type: "
|
|
107
|
+
user_limit: "5",
|
|
108
|
+
products_limit: "500",
|
|
109
|
+
type: "PyMES"
|
|
283
110
|
},
|
|
284
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
111
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1680038627077"
|
|
285
112
|
},
|
|
286
113
|
company: {
|
|
287
|
-
id_company:
|
|
288
|
-
trade_name: "
|
|
289
|
-
company_name: "
|
|
290
|
-
rfc: "
|
|
291
|
-
adress: "
|
|
292
|
-
about_company:
|
|
293
|
-
telephone:
|
|
294
|
-
web_site:
|
|
295
|
-
zip_code:
|
|
114
|
+
id_company: 817,
|
|
115
|
+
trade_name: "Retailer acc",
|
|
116
|
+
company_name: "Retailer acc",
|
|
117
|
+
rfc: "ASER12345",
|
|
118
|
+
adress: "Av. Insurgentes",
|
|
119
|
+
about_company: null,
|
|
120
|
+
telephone: null,
|
|
121
|
+
web_site: null,
|
|
122
|
+
zip_code: null,
|
|
296
123
|
email: null,
|
|
297
|
-
social_link:
|
|
298
|
-
is_retailer:
|
|
124
|
+
social_link: null,
|
|
125
|
+
is_retailer: 1,
|
|
126
|
+
financedRetailers: [{
|
|
127
|
+
id: 68,
|
|
128
|
+
name: "The Home Depot Merchants",
|
|
129
|
+
country: "México",
|
|
130
|
+
id_region: 1,
|
|
131
|
+
active: 1
|
|
132
|
+
}],
|
|
299
133
|
retailers: [{
|
|
300
|
-
id:
|
|
301
|
-
name:
|
|
302
|
-
country:
|
|
134
|
+
id: 59,
|
|
135
|
+
name: "The Home Depot Platinum",
|
|
136
|
+
country: "México"
|
|
137
|
+
}, {
|
|
138
|
+
id: 60,
|
|
139
|
+
name: "The Home Depot Resizing",
|
|
140
|
+
country: "México"
|
|
141
|
+
}, {
|
|
142
|
+
id: 61,
|
|
143
|
+
name: "Home Depot TAB",
|
|
144
|
+
country: "México"
|
|
145
|
+
}, {
|
|
146
|
+
id: 68,
|
|
147
|
+
name: "The Home Depot Merchants",
|
|
148
|
+
country: "México"
|
|
303
149
|
}]
|
|
304
150
|
},
|
|
305
151
|
showSurvey: function showSurvey(v) {
|
|
@@ -11,10 +11,20 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
11
11
|
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
13
13
|
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
|
+
|
|
14
16
|
var _axios = _interopRequireDefault(require("axios"));
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
var objToQueryString = function objToQueryString(obj) {
|
|
19
|
+
if (!Object.values(obj).length) return null;
|
|
20
|
+
return Object.entries(obj).map(function (_ref) {
|
|
21
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
22
|
+
key = _ref2[0],
|
|
23
|
+
value = _ref2[1];
|
|
17
24
|
|
|
25
|
+
return "".concat(key, "=").concat(encodeURIComponent(JSON.stringify(value)));
|
|
26
|
+
}).join("&");
|
|
27
|
+
};
|
|
18
28
|
/**
|
|
19
29
|
* funcion que realiza un axios GET
|
|
20
30
|
*
|
|
@@ -24,16 +34,15 @@ var _axios = _interopRequireDefault(require("axios"));
|
|
|
24
34
|
* body: {} | undefined ,
|
|
25
35
|
* message: string,
|
|
26
36
|
* errorDetail: string
|
|
27
|
-
* }> }
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//============================================================
|
|
37
|
+
* }> } */
|
|
38
|
+
|
|
39
|
+
|
|
31
40
|
var fetchGET = function fetchGET() {
|
|
32
41
|
var endpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
33
42
|
var paramsQuery = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
34
43
|
var paramsHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
35
44
|
return new Promise( /*#__PURE__*/function () {
|
|
36
|
-
var
|
|
45
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response) {
|
|
37
46
|
var URL, keysParamsQuery, respHTTPjson, body, _body$message, _body$errorDetail;
|
|
38
47
|
|
|
39
48
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
@@ -41,26 +50,19 @@ var fetchGET = function fetchGET() {
|
|
|
41
50
|
switch (_context.prev = _context.next) {
|
|
42
51
|
case 0:
|
|
43
52
|
_context.prev = 0;
|
|
44
|
-
URL = endpoint;
|
|
53
|
+
URL = "".concat(endpoint, "?").concat(objToQueryString(paramsQuery));
|
|
45
54
|
keysParamsQuery = Object.keys(paramsQuery); // agregar cada param query a la URL
|
|
46
55
|
|
|
47
|
-
|
|
48
|
-
if (index == 0) {
|
|
49
|
-
URL += "?".concat(key, "=").concat(paramsQuery[key]);
|
|
50
|
-
} else {
|
|
51
|
-
URL += "&".concat(key, "=").concat(paramsQuery[key]);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
_context.next = 6;
|
|
56
|
+
_context.next = 5;
|
|
55
57
|
return _axios.default.get(URL, {
|
|
56
58
|
headers: paramsHeaders
|
|
57
59
|
});
|
|
58
60
|
|
|
59
|
-
case
|
|
61
|
+
case 5:
|
|
60
62
|
respHTTPjson = _context.sent;
|
|
61
63
|
|
|
62
64
|
if (!(respHTTPjson.status !== 200)) {
|
|
63
|
-
_context.next =
|
|
65
|
+
_context.next = 8;
|
|
64
66
|
break;
|
|
65
67
|
}
|
|
66
68
|
|
|
@@ -69,12 +71,12 @@ var fetchGET = function fetchGET() {
|
|
|
69
71
|
errorDetail: respHTTPjson.statusText
|
|
70
72
|
}));
|
|
71
73
|
|
|
72
|
-
case
|
|
74
|
+
case 8:
|
|
73
75
|
// obtener body backend
|
|
74
76
|
body = JSON.parse(respHTTPjson.data.body); // verificar si existe error desde el backend
|
|
75
77
|
|
|
76
78
|
if (!(respHTTPjson.data.statusCode !== 200)) {
|
|
77
|
-
_context.next =
|
|
79
|
+
_context.next = 11;
|
|
78
80
|
break;
|
|
79
81
|
}
|
|
80
82
|
|
|
@@ -83,29 +85,29 @@ var fetchGET = function fetchGET() {
|
|
|
83
85
|
errorDetail: (_body$errorDetail = body.errorDetail) !== null && _body$errorDetail !== void 0 ? _body$errorDetail : ""
|
|
84
86
|
}));
|
|
85
87
|
|
|
86
|
-
case
|
|
88
|
+
case 11:
|
|
87
89
|
return _context.abrupt("return", response({
|
|
88
90
|
body: body
|
|
89
91
|
}));
|
|
90
92
|
|
|
91
|
-
case
|
|
92
|
-
_context.prev =
|
|
93
|
+
case 14:
|
|
94
|
+
_context.prev = 14;
|
|
93
95
|
_context.t0 = _context["catch"](0);
|
|
94
96
|
return _context.abrupt("return", response({
|
|
95
97
|
message: "Error al obtener los datos",
|
|
96
98
|
errorDetail: _context.t0.message
|
|
97
99
|
}));
|
|
98
100
|
|
|
99
|
-
case
|
|
101
|
+
case 17:
|
|
100
102
|
case "end":
|
|
101
103
|
return _context.stop();
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
|
-
}, _callee, null, [[0,
|
|
106
|
+
}, _callee, null, [[0, 14]]);
|
|
105
107
|
}));
|
|
106
108
|
|
|
107
109
|
return function (_x) {
|
|
108
|
-
return
|
|
110
|
+
return _ref3.apply(this, arguments);
|
|
109
111
|
};
|
|
110
112
|
}());
|
|
111
113
|
}; //============================================================
|
|
@@ -132,7 +134,7 @@ var fetchPOST = function fetchPOST() {
|
|
|
132
134
|
var paramsBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
133
135
|
var paramsHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
134
136
|
return new Promise( /*#__PURE__*/function () {
|
|
135
|
-
var
|
|
137
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(response) {
|
|
136
138
|
var respHTTPjson, body, _body$message2, _body$errorDetail2;
|
|
137
139
|
|
|
138
140
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
@@ -194,7 +196,7 @@ var fetchPOST = function fetchPOST() {
|
|
|
194
196
|
}));
|
|
195
197
|
|
|
196
198
|
return function (_x2) {
|
|
197
|
-
return
|
|
199
|
+
return _ref4.apply(this, arguments);
|
|
198
200
|
};
|
|
199
201
|
}());
|
|
200
202
|
}; //============================================================
|
|
@@ -221,7 +223,7 @@ var fetchPUT = function fetchPUT() {
|
|
|
221
223
|
var paramsBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
222
224
|
var paramsHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
223
225
|
return new Promise( /*#__PURE__*/function () {
|
|
224
|
-
var
|
|
226
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(response) {
|
|
225
227
|
var respHTTPjson, body, _body$message3, _body$errorDetail3;
|
|
226
228
|
|
|
227
229
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
@@ -283,7 +285,7 @@ var fetchPUT = function fetchPUT() {
|
|
|
283
285
|
}));
|
|
284
286
|
|
|
285
287
|
return function (_x3) {
|
|
286
|
-
return
|
|
288
|
+
return _ref5.apply(this, arguments);
|
|
287
289
|
};
|
|
288
290
|
}());
|
|
289
291
|
}; //============================================================
|
|
@@ -310,7 +312,7 @@ var fetchDELETE = function fetchDELETE() {
|
|
|
310
312
|
var paramsBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
311
313
|
var paramsHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
312
314
|
return new Promise( /*#__PURE__*/function () {
|
|
313
|
-
var
|
|
315
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(response) {
|
|
314
316
|
var respHTTPjson, body, _body$message4, _body$errorDetail4;
|
|
315
317
|
|
|
316
318
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
@@ -373,7 +375,7 @@ var fetchDELETE = function fetchDELETE() {
|
|
|
373
375
|
}));
|
|
374
376
|
|
|
375
377
|
return function (_x4) {
|
|
376
|
-
return
|
|
378
|
+
return _ref6.apply(this, arguments);
|
|
377
379
|
};
|
|
378
380
|
}());
|
|
379
381
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentoh-components-library",
|
|
3
|
-
"version": "21.3.
|
|
3
|
+
"version": "21.3.34",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@aws-amplify/auth": "^4.5.3",
|
|
6
6
|
"@aws-amplify/datastore": "^3.11.0",
|
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@babel/cli": "^7.17.10",
|
|
94
94
|
"@babel/core": "^7.16.0",
|
|
95
|
-
"@storybook/addon-actions": "^6.5.
|
|
96
|
-
"@storybook/addon-essentials": "^6.5.
|
|
97
|
-
"@storybook/addon-links": "^6.5.
|
|
98
|
-
"@storybook/react": "^6.5.
|
|
95
|
+
"@storybook/addon-actions": "^6.5.16",
|
|
96
|
+
"@storybook/addon-essentials": "^6.5.16",
|
|
97
|
+
"@storybook/addon-links": "^6.5.16",
|
|
98
|
+
"@storybook/react": "^6.5.16",
|
|
99
99
|
"auth": "^0.0.9",
|
|
100
100
|
"auto": "^10.36.5",
|
|
101
101
|
"babel-loader": "^8.2.3",
|
|
@@ -25,7 +25,8 @@ export const CustomSelectItem = ({
|
|
|
25
25
|
const oneDimensionArray = (arr) => {
|
|
26
26
|
var array = [];
|
|
27
27
|
arr.forEach((element) => {
|
|
28
|
-
if (typeof element
|
|
28
|
+
if (typeof element === "object")
|
|
29
|
+
array.push(...oneDimensionArray(element));
|
|
29
30
|
else array.push(element);
|
|
30
31
|
});
|
|
31
32
|
return array;
|
|
@@ -49,7 +49,7 @@ export const InputText = (props) => {
|
|
|
49
49
|
value={text}
|
|
50
50
|
onChange={(event) => onChangeText && onChangeText(event.target.value)}
|
|
51
51
|
onKeyDown={(event) => {
|
|
52
|
-
if (event.key
|
|
52
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
53
53
|
event.preventDefault();
|
|
54
54
|
onEnter && onEnter(event);
|
|
55
55
|
}
|
|
@@ -9,14 +9,14 @@ export const ProductPercentCard = ({
|
|
|
9
9
|
var result = (productsInStatus / totalProcucts) * 100;
|
|
10
10
|
|
|
11
11
|
var percent = result.toString().search(/\./) ? result.toFixed(2) : result;
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
return (
|
|
14
14
|
<Container className={`status-${statusType}`}>
|
|
15
15
|
<p className="text">Productos en proceso</p>
|
|
16
16
|
<div className="percent-text">
|
|
17
17
|
<p className="number">{productsInStatus}</p>
|
|
18
18
|
<img src={polygon} alt="" />
|
|
19
|
-
<span className="span">{percent
|
|
19
|
+
<span className="span">{percent === "NaN" ? 0 : percent}%</span>
|
|
20
20
|
</div>
|
|
21
21
|
</Container>
|
|
22
22
|
);
|
|
@@ -22,7 +22,7 @@ export default function Select(props) {
|
|
|
22
22
|
value={item.value ? item.value : item}
|
|
23
23
|
// selected={
|
|
24
24
|
// item.value
|
|
25
|
-
// ? item.value
|
|
25
|
+
// ? item.value === props.valueSelected && "selected"
|
|
26
26
|
// : item === props.valueSelected && "selected"
|
|
27
27
|
// }
|
|
28
28
|
>
|
|
@@ -25,13 +25,13 @@ export const CarouselImagesLogin = ({
|
|
|
25
25
|
circulos[0].classList.add("resaltado");
|
|
26
26
|
const slideshow = () => {
|
|
27
27
|
img2.src = images[i];
|
|
28
|
-
const circulo_actual = Array.from(circulos).find((el) => el.id
|
|
28
|
+
const circulo_actual = Array.from(circulos).find((el) => el.id === i);
|
|
29
29
|
Array.from(circulos).forEach((cir) => cir.classList.remove("resaltado"));
|
|
30
30
|
circulo_actual.classList.add("resaltado");
|
|
31
31
|
img1.classList.add("right");
|
|
32
32
|
img2.classList.add("active");
|
|
33
33
|
i++;
|
|
34
|
-
if (i
|
|
34
|
+
if (i === images.length) {
|
|
35
35
|
i = 0;
|
|
36
36
|
}
|
|
37
37
|
setTimeout(() => {
|