contentoh-components-library 21.2.69 → 21.2.71
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/assets/images/chatPopup/Spinner.gif +0 -0
- package/dist/assets/images/chatPopup/close.svg +3 -0
- package/dist/assets/images/chatPopup/defaultImage.png +0 -0
- package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
- package/dist/assets/images/chatPopup/doc.svg +1 -0
- package/dist/assets/images/chatPopup/document.svg +1 -0
- package/dist/assets/images/chatPopup/iconChat.svg +19 -0
- package/dist/assets/images/chatPopup/iconPlus.svg +3 -0
- package/dist/assets/images/chatPopup/pdf.svg +75 -0
- package/dist/assets/images/chatPopup/remove.svg +4 -0
- package/dist/assets/images/chatPopup/send.svg +3 -0
- package/dist/assets/images/chatPopup/svgIcon.svg +109 -0
- package/dist/assets/images/chatPopup/upload_file.svg +3 -0
- package/dist/assets/images/chatPopup/xls.svg +53 -0
- package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +28 -0
- package/dist/components/atoms/ChatPopUp/index.js +841 -0
- package/dist/components/atoms/ChatPopUp/styles.js +27 -0
- package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +182 -0
- package/dist/components/atoms/CustomSelectItem/index.js +7 -3
- package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
- package/dist/components/atoms/StatusTag/index.js +58 -0
- package/dist/components/atoms/StatusTag/styles.js +20 -0
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +36 -0
- package/dist/components/atoms/Tooltip/index.js +55 -0
- package/dist/components/atoms/Tooltip/styles.js +18 -0
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +158 -69
- package/dist/components/pages/RetailerProductEdition/index.js +46 -40
- package/package.json +1 -1
- package/src/components/atoms/CustomSelectItem/index.js +7 -2
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +343 -69
- package/src/components/pages/RetailerProductEdition/index.js +68 -56
|
@@ -16,117 +16,391 @@ RetailerProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"
|
|
19
|
+
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI4ZDAxMDIxNC01YmZhLTQzYzMtOTZmYi1jNTU2ZGMwNTc3NGIiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjhkMDEwMjE0LTViZmEtNDNjMy05NmZiLWM1NTZkYzA1Nzc0YiIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI3YWYzZTgyNS02YmVhLTRjMmItOTdiYi04NTVjZGVkZTQ2MjAiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2NzI1MzUzNywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2NzI1NzEzNywiaWF0IjoxNjY3MjUzNTM3LCJlbWFpbCI6ImthcmFmZTMyMThAbW9tMmtpZC5jb20ifQ.q0rZh2bcMA926m3M3sa1NNmHPXlbDLt0qskcy19OHC5RL1MdvYeK5XpEdVbVKNeiWbsQpshJLqE0gb70EMYhh1mBxi7PKhi8HiCPFrUYRGbYTyVtGWN9CoqnVtoT2dag4MY2DSo6kVtH-M__Sw1UA5Y90INKutsBtx2GxW_uzeBzxxWpJ51WGvtsatUE0-_esd4yIZMvzgkzX-tCtIDzpZPI2x9HLeLdneEHnjM-zzI5ke8BQVCnbcv4q7kkETP0bWADApli0VJ5UBKRaL6_nNFqlDY0F6MWmz09LXirYV_jAoG09d4UCaa14u0VNDFKuIO08pSpiGcYXHOkh2C6Yw",
|
|
20
20
|
productSelected: {
|
|
21
21
|
services: {
|
|
22
22
|
datasheets: 1,
|
|
23
23
|
descriptions: 1,
|
|
24
24
|
images: 1,
|
|
25
25
|
},
|
|
26
|
-
orderId:
|
|
27
|
-
status: "
|
|
28
|
-
datasheet_status: "
|
|
26
|
+
orderId: 3265,
|
|
27
|
+
status: "AA",
|
|
28
|
+
datasheet_status: "RP",
|
|
29
29
|
prio: "none",
|
|
30
|
-
version:
|
|
31
|
-
description_status: "
|
|
32
|
-
images_status: "
|
|
30
|
+
version: 3,
|
|
31
|
+
description_status: "RP",
|
|
32
|
+
images_status: "AA",
|
|
33
|
+
statusByRetailer: {
|
|
34
|
+
4: {
|
|
35
|
+
datasheet: "RP/RA/CA",
|
|
36
|
+
description: "RP/RA/CA",
|
|
37
|
+
images: "AP",
|
|
38
|
+
},
|
|
39
|
+
5: {
|
|
40
|
+
datasheet: "RP/RA/AS",
|
|
41
|
+
description: "RP/RA/CA",
|
|
42
|
+
images: "AA",
|
|
43
|
+
},
|
|
44
|
+
12: {
|
|
45
|
+
description: "RP/RA/CA",
|
|
46
|
+
images: "AA",
|
|
47
|
+
datasheet: "RP/RA/AS",
|
|
48
|
+
},
|
|
49
|
+
13: {
|
|
50
|
+
datasheet: "RP/RA/AS",
|
|
51
|
+
description: "RP/RA/CA",
|
|
52
|
+
images: "AA",
|
|
53
|
+
},
|
|
54
|
+
16: {
|
|
55
|
+
datasheet: "RP/RA/AS",
|
|
56
|
+
description: "RP/RA/CA",
|
|
57
|
+
images: "AA",
|
|
58
|
+
},
|
|
59
|
+
29: {
|
|
60
|
+
datasheet: "RP/RA/AS",
|
|
61
|
+
description: "RP/RA/CA",
|
|
62
|
+
images: "AA",
|
|
63
|
+
},
|
|
64
|
+
34: {
|
|
65
|
+
datasheet: "RP/RA/AC",
|
|
66
|
+
description: "RP/RA/AC",
|
|
67
|
+
images: "AA",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
33
70
|
article: {
|
|
34
|
-
id_article:
|
|
35
|
-
id_category: "
|
|
36
|
-
name: "
|
|
37
|
-
upc: "
|
|
38
|
-
timestamp: "2022-
|
|
39
|
-
id_user:
|
|
71
|
+
id_article: 78435,
|
|
72
|
+
id_category: "700",
|
|
73
|
+
name: "GAR S.ACT EA GEL SERUM 50ML",
|
|
74
|
+
upc: "7509552844672",
|
|
75
|
+
timestamp: "2022-07-27T04:02:57.000Z",
|
|
76
|
+
id_user: 342,
|
|
40
77
|
status: "NULL",
|
|
41
78
|
active: 1,
|
|
42
|
-
company_id:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
79
|
+
company_id: 234,
|
|
80
|
+
SKU: null,
|
|
81
|
+
Descripcion: null,
|
|
82
|
+
Proveedor: null,
|
|
83
|
+
id_proveedor: 0,
|
|
84
|
+
company_name: "L'ORÉAL",
|
|
85
|
+
country: null,
|
|
86
|
+
id_order: 3265,
|
|
87
|
+
id_datasheet_especialist: 426,
|
|
88
|
+
id_datasheet_facilitator: null,
|
|
89
|
+
id_description_especialist: 405,
|
|
90
|
+
id_description_facilitator: null,
|
|
91
|
+
id_images_especialist: 1462,
|
|
92
|
+
id_images_facilitator: 160,
|
|
93
|
+
id_auditor: 9,
|
|
53
94
|
id_recepcionist: null,
|
|
54
|
-
category:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
95
|
+
category:
|
|
96
|
+
"Salud y Belleza|Cuidado Facial|Cremas, Mascarillas y Tratamientos",
|
|
97
|
+
missingAttributes: null,
|
|
98
|
+
missingDescriptions: null,
|
|
99
|
+
missingImages: null,
|
|
58
100
|
},
|
|
59
101
|
retailers: [
|
|
60
102
|
{
|
|
61
|
-
id:
|
|
62
|
-
name: "
|
|
63
|
-
|
|
103
|
+
id: 4,
|
|
104
|
+
name: "Walmart Super y Superama",
|
|
105
|
+
country: "México",
|
|
106
|
+
id_region: 1,
|
|
107
|
+
active: 1,
|
|
108
|
+
percentage: 100,
|
|
109
|
+
image:
|
|
110
|
+
"https://content-management-images.s3.amazonaws.com/retailers/4.png",
|
|
111
|
+
services: [
|
|
112
|
+
"RP/RA/CA",
|
|
113
|
+
"RP/RA/CA",
|
|
114
|
+
"AP",
|
|
115
|
+
"NA",
|
|
116
|
+
"NA",
|
|
117
|
+
"NA",
|
|
118
|
+
"NA",
|
|
119
|
+
"NA",
|
|
120
|
+
"NA",
|
|
121
|
+
"NA",
|
|
122
|
+
"NA",
|
|
123
|
+
"NA",
|
|
124
|
+
"NA",
|
|
125
|
+
"NA",
|
|
126
|
+
"NA",
|
|
127
|
+
"NA",
|
|
128
|
+
"NA",
|
|
129
|
+
"NA",
|
|
130
|
+
"NA",
|
|
131
|
+
"NA",
|
|
132
|
+
"NA",
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 5,
|
|
137
|
+
name: "Chedraui",
|
|
138
|
+
country: "México",
|
|
139
|
+
id_region: 1,
|
|
140
|
+
active: 1,
|
|
141
|
+
percentage: 100,
|
|
64
142
|
image:
|
|
65
|
-
"https://content-management-images.s3.amazonaws.com/retailers/
|
|
66
|
-
services: [
|
|
143
|
+
"https://content-management-images.s3.amazonaws.com/retailers/5.png",
|
|
144
|
+
services: [
|
|
145
|
+
"NA",
|
|
146
|
+
"NA",
|
|
147
|
+
"NA",
|
|
148
|
+
"RP/RA/AS",
|
|
149
|
+
"RP/RA/CA",
|
|
150
|
+
"AA",
|
|
151
|
+
"NA",
|
|
152
|
+
"NA",
|
|
153
|
+
"NA",
|
|
154
|
+
"NA",
|
|
155
|
+
"NA",
|
|
156
|
+
"NA",
|
|
157
|
+
"NA",
|
|
158
|
+
"NA",
|
|
159
|
+
"NA",
|
|
160
|
+
"NA",
|
|
161
|
+
"NA",
|
|
162
|
+
"NA",
|
|
163
|
+
"NA",
|
|
164
|
+
"NA",
|
|
165
|
+
"NA",
|
|
166
|
+
],
|
|
67
167
|
},
|
|
68
168
|
{
|
|
69
|
-
id:
|
|
70
|
-
name: "
|
|
71
|
-
|
|
169
|
+
id: 6,
|
|
170
|
+
name: "HEB",
|
|
171
|
+
country: "México",
|
|
172
|
+
id_region: 1,
|
|
173
|
+
active: 1,
|
|
174
|
+
percentage: 100,
|
|
72
175
|
image:
|
|
73
|
-
"https://content-management-images.s3.amazonaws.com/retailers/
|
|
74
|
-
services: [
|
|
176
|
+
"https://content-management-images.s3.amazonaws.com/retailers/6.png",
|
|
177
|
+
services: [
|
|
178
|
+
"NA",
|
|
179
|
+
"NA",
|
|
180
|
+
"NA",
|
|
181
|
+
"NA",
|
|
182
|
+
"NA",
|
|
183
|
+
"NA",
|
|
184
|
+
"NA",
|
|
185
|
+
"NA",
|
|
186
|
+
"NA",
|
|
187
|
+
"NA",
|
|
188
|
+
"NA",
|
|
189
|
+
"NA",
|
|
190
|
+
"NA",
|
|
191
|
+
"NA",
|
|
192
|
+
"NA",
|
|
193
|
+
"NA",
|
|
194
|
+
"NA",
|
|
195
|
+
"NA",
|
|
196
|
+
"NA",
|
|
197
|
+
"NA",
|
|
198
|
+
"NA",
|
|
199
|
+
],
|
|
75
200
|
},
|
|
76
201
|
{
|
|
77
|
-
id:
|
|
78
|
-
name: "
|
|
79
|
-
|
|
202
|
+
id: 12,
|
|
203
|
+
name: "La Comer",
|
|
204
|
+
country: "México",
|
|
205
|
+
id_region: 1,
|
|
206
|
+
active: 1,
|
|
207
|
+
percentage: 100,
|
|
80
208
|
image:
|
|
81
|
-
"https://content-management-images.s3.amazonaws.com/retailers/
|
|
82
|
-
services: [
|
|
209
|
+
"https://content-management-images.s3.amazonaws.com/retailers/12.png",
|
|
210
|
+
services: [
|
|
211
|
+
"NA",
|
|
212
|
+
"NA",
|
|
213
|
+
"NA",
|
|
214
|
+
"NA",
|
|
215
|
+
"NA",
|
|
216
|
+
"NA",
|
|
217
|
+
"RP/RA/AS",
|
|
218
|
+
"RP/RA/CA",
|
|
219
|
+
"AA",
|
|
220
|
+
"NA",
|
|
221
|
+
"NA",
|
|
222
|
+
"NA",
|
|
223
|
+
"NA",
|
|
224
|
+
"NA",
|
|
225
|
+
"NA",
|
|
226
|
+
"NA",
|
|
227
|
+
"NA",
|
|
228
|
+
"NA",
|
|
229
|
+
"NA",
|
|
230
|
+
"NA",
|
|
231
|
+
"NA",
|
|
232
|
+
],
|
|
83
233
|
},
|
|
84
234
|
{
|
|
85
|
-
id:
|
|
86
|
-
name: "
|
|
87
|
-
|
|
235
|
+
id: 13,
|
|
236
|
+
name: "Soriana",
|
|
237
|
+
country: "México",
|
|
238
|
+
id_region: 1,
|
|
239
|
+
active: 1,
|
|
240
|
+
percentage: 100,
|
|
88
241
|
image:
|
|
89
|
-
"https://content-management-images.s3.amazonaws.com/retailers/
|
|
90
|
-
services: [
|
|
242
|
+
"https://content-management-images.s3.amazonaws.com/retailers/13.png",
|
|
243
|
+
services: [
|
|
244
|
+
"NA",
|
|
245
|
+
"NA",
|
|
246
|
+
"NA",
|
|
247
|
+
"NA",
|
|
248
|
+
"NA",
|
|
249
|
+
"NA",
|
|
250
|
+
"NA",
|
|
251
|
+
"NA",
|
|
252
|
+
"NA",
|
|
253
|
+
"RP/RA/AS",
|
|
254
|
+
"RP/RA/CA",
|
|
255
|
+
"AA",
|
|
256
|
+
"NA",
|
|
257
|
+
"NA",
|
|
258
|
+
"NA",
|
|
259
|
+
"NA",
|
|
260
|
+
"NA",
|
|
261
|
+
"NA",
|
|
262
|
+
"NA",
|
|
263
|
+
"NA",
|
|
264
|
+
"NA",
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: 16,
|
|
269
|
+
name: "Rappi",
|
|
270
|
+
country: "México",
|
|
271
|
+
id_region: 1,
|
|
272
|
+
active: 1,
|
|
273
|
+
percentage: 100,
|
|
274
|
+
image:
|
|
275
|
+
"https://content-management-images.s3.amazonaws.com/retailers/16.png",
|
|
276
|
+
services: [
|
|
277
|
+
"NA",
|
|
278
|
+
"NA",
|
|
279
|
+
"NA",
|
|
280
|
+
"NA",
|
|
281
|
+
"NA",
|
|
282
|
+
"NA",
|
|
283
|
+
"NA",
|
|
284
|
+
"NA",
|
|
285
|
+
"NA",
|
|
286
|
+
"NA",
|
|
287
|
+
"NA",
|
|
288
|
+
"NA",
|
|
289
|
+
"RP/RA/AS",
|
|
290
|
+
"RP/RA/CA",
|
|
291
|
+
"AA",
|
|
292
|
+
"NA",
|
|
293
|
+
"NA",
|
|
294
|
+
"NA",
|
|
295
|
+
"NA",
|
|
296
|
+
"NA",
|
|
297
|
+
"NA",
|
|
298
|
+
],
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: 29,
|
|
302
|
+
name: "Farmacias del Ahorro",
|
|
303
|
+
country: "México",
|
|
304
|
+
id_region: 1,
|
|
305
|
+
active: 1,
|
|
306
|
+
percentage: 100,
|
|
307
|
+
image:
|
|
308
|
+
"https://content-management-images.s3.amazonaws.com/retailers/29.png",
|
|
309
|
+
services: [
|
|
310
|
+
"NA",
|
|
311
|
+
"NA",
|
|
312
|
+
"NA",
|
|
313
|
+
"NA",
|
|
314
|
+
"NA",
|
|
315
|
+
"NA",
|
|
316
|
+
"NA",
|
|
317
|
+
"NA",
|
|
318
|
+
"NA",
|
|
319
|
+
"NA",
|
|
320
|
+
"NA",
|
|
321
|
+
"NA",
|
|
322
|
+
"NA",
|
|
323
|
+
"NA",
|
|
324
|
+
"NA",
|
|
325
|
+
"RP/RA/AS",
|
|
326
|
+
"RP/RA/CA",
|
|
327
|
+
"AA",
|
|
328
|
+
"NA",
|
|
329
|
+
"NA",
|
|
330
|
+
"NA",
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
id: 34,
|
|
335
|
+
name: "San Pablo",
|
|
336
|
+
country: "México",
|
|
337
|
+
id_region: 1,
|
|
338
|
+
active: 1,
|
|
339
|
+
percentage: 83.33333333333333,
|
|
340
|
+
image:
|
|
341
|
+
"https://content-management-images.s3.amazonaws.com/retailers/34.png",
|
|
342
|
+
services: [
|
|
343
|
+
"NA",
|
|
344
|
+
"NA",
|
|
345
|
+
"NA",
|
|
346
|
+
"NA",
|
|
347
|
+
"NA",
|
|
348
|
+
"NA",
|
|
349
|
+
"NA",
|
|
350
|
+
"NA",
|
|
351
|
+
"NA",
|
|
352
|
+
"NA",
|
|
353
|
+
"NA",
|
|
354
|
+
"NA",
|
|
355
|
+
"NA",
|
|
356
|
+
"NA",
|
|
357
|
+
"NA",
|
|
358
|
+
"NA",
|
|
359
|
+
"NA",
|
|
360
|
+
"NA",
|
|
361
|
+
"RP/RA/AC",
|
|
362
|
+
"RP/RA/AC",
|
|
363
|
+
"AA",
|
|
364
|
+
],
|
|
91
365
|
},
|
|
92
366
|
],
|
|
93
|
-
country:
|
|
94
|
-
upc: "
|
|
367
|
+
country: null,
|
|
368
|
+
upc: "7509552844672",
|
|
95
369
|
},
|
|
96
370
|
location: {
|
|
97
371
|
product: { articleId: 109485, versionId: 3 },
|
|
98
372
|
},
|
|
99
373
|
user: {
|
|
100
|
-
id_user:
|
|
101
|
-
name: "
|
|
102
|
-
last_name: "",
|
|
103
|
-
email: "
|
|
104
|
-
position:
|
|
374
|
+
id_user: 426,
|
|
375
|
+
name: "Especialista Textos",
|
|
376
|
+
last_name: " ",
|
|
377
|
+
email: "karafe3218@mom2kid.com",
|
|
378
|
+
position: "Tester",
|
|
105
379
|
telephone: null,
|
|
106
380
|
country: null,
|
|
107
|
-
id_company:
|
|
108
|
-
id_cognito: "
|
|
381
|
+
id_company: 254,
|
|
382
|
+
id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
|
|
109
383
|
birth_Date: null,
|
|
110
384
|
about_me: null,
|
|
111
385
|
zip_code: null,
|
|
112
386
|
address: null,
|
|
113
387
|
job: null,
|
|
114
388
|
id_stripe: null,
|
|
115
|
-
id_role:
|
|
389
|
+
id_role: 7,
|
|
116
390
|
active: 1,
|
|
117
391
|
is_retailer: 0,
|
|
118
|
-
email_notify:
|
|
392
|
+
email_notify: null,
|
|
119
393
|
membership: {
|
|
120
|
-
id:
|
|
121
|
-
start_date: "
|
|
122
|
-
end_date: "
|
|
123
|
-
planID:
|
|
124
|
-
plan: "
|
|
125
|
-
name: "Plan
|
|
126
|
-
user_limit: "
|
|
127
|
-
products_limit: "
|
|
128
|
-
type: "
|
|
394
|
+
id: 750,
|
|
395
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
396
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
397
|
+
planID: 6,
|
|
398
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
399
|
+
name: "Plan Small",
|
|
400
|
+
user_limit: "10",
|
|
401
|
+
products_limit: "1000",
|
|
402
|
+
type: "Enterprise",
|
|
129
403
|
},
|
|
130
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
404
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1667253537878",
|
|
131
405
|
},
|
|
132
406
|
};
|
|
@@ -441,70 +441,82 @@ export const RetailerProductEdition = ({
|
|
|
441
441
|
};
|
|
442
442
|
|
|
443
443
|
const saveDescriptions = async () => {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
444
|
+
if (updatedDescriptions) {
|
|
445
|
+
setLoading(true);
|
|
446
|
+
const productTemp = product;
|
|
447
|
+
const articleId = product?.article?.id_article;
|
|
448
|
+
const dataObject = {
|
|
449
|
+
articleId,
|
|
450
|
+
articleData: updatedDescriptions,
|
|
451
|
+
};
|
|
452
|
+
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
453
|
+
try {
|
|
454
|
+
const res = await axios.put(
|
|
455
|
+
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
|
|
456
|
+
dataObject,
|
|
457
|
+
{
|
|
458
|
+
headers: {
|
|
459
|
+
Authorization: token,
|
|
460
|
+
},
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
if (res.data.statusCode === 200) {
|
|
464
|
+
const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
|
|
465
|
+
if (newArticleStatus)
|
|
466
|
+
productTemp.status = newArticleStatus[articleId];
|
|
467
|
+
if (newStatus) productTemp.description_status = newStatus;
|
|
468
|
+
setProduct(productTemp);
|
|
469
|
+
sessionStorage.setItem(
|
|
470
|
+
"productSelected",
|
|
471
|
+
JSON.stringify(productTemp)
|
|
472
|
+
);
|
|
468
473
|
|
|
469
|
-
|
|
470
|
-
|
|
474
|
+
setMessage("Descripciones guardadas con éxito");
|
|
475
|
+
await loadData();
|
|
476
|
+
}
|
|
477
|
+
} catch (error) {
|
|
478
|
+
console.log(error);
|
|
471
479
|
}
|
|
472
|
-
} catch (error) {
|
|
473
|
-
console.log(error);
|
|
474
480
|
}
|
|
475
481
|
};
|
|
476
482
|
|
|
477
483
|
const saveDatasheets = async () => {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
484
|
+
if (updatedDatasheets.length > 0) {
|
|
485
|
+
setLoading(true);
|
|
486
|
+
const productTemp = product;
|
|
487
|
+
const articleId = product?.article?.id_article;
|
|
488
|
+
const dataObject = {
|
|
489
|
+
articleId,
|
|
490
|
+
articleData: updatedDatasheets,
|
|
491
|
+
};
|
|
492
|
+
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
493
|
+
try {
|
|
494
|
+
const res = await axios.put(
|
|
495
|
+
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?datasheet=true&version=${version}`,
|
|
496
|
+
dataObject,
|
|
497
|
+
{
|
|
498
|
+
headers: {
|
|
499
|
+
Authorization: token,
|
|
500
|
+
},
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
if (res.data.statusCode === 200) {
|
|
504
|
+
const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
|
|
505
|
+
if (newArticleStatus)
|
|
506
|
+
productTemp.status = newArticleStatus[articleId];
|
|
507
|
+
if (newStatus) productTemp.datasheet_status = newStatus;
|
|
508
|
+
setProduct(productTemp);
|
|
509
|
+
sessionStorage.setItem(
|
|
510
|
+
"productSelected",
|
|
511
|
+
JSON.stringify(productTemp)
|
|
512
|
+
);
|
|
502
513
|
|
|
503
|
-
|
|
504
|
-
|
|
514
|
+
setMessage("Fichas técnicas guardadas");
|
|
515
|
+
await loadData();
|
|
516
|
+
}
|
|
517
|
+
} catch (error) {
|
|
518
|
+
console.log(error);
|
|
505
519
|
}
|
|
506
|
-
} catch (error) {
|
|
507
|
-
console.log(error);
|
|
508
520
|
}
|
|
509
521
|
};
|
|
510
522
|
|