contentoh-components-library 21.2.80 → 21.2.82
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/pages/ProviderProductEdition/ProviderProductEdition.stories.js +142 -200
- package/dist/components/pages/ProviderProductEdition/index.js +19 -16
- package/dist/components/pages/RetailerProductEdition/index.js +3 -2
- package/package.json +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +161 -218
- package/src/components/pages/ProviderProductEdition/index.js +6 -4
- package/src/components/pages/RetailerProductEdition/index.js +2 -2
|
@@ -31,178 +31,92 @@ ProviderProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": true,
|
|
32
32
|
Imágenes: true
|
|
33
33
|
},
|
|
34
|
-
token: "
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5MmFiMWFkNS0zOWM4LTRhMjAtODFlNC02N2VjMTRmMzhmNDMiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjkyYWIxYWQ1LTM5YzgtNGEyMC04MWU0LTY3ZWMxNGYzOGY0MyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI4Y2U5MjYyMi0xYjZlLTQ1MWEtODUyYy04MjMxYzcwOTk5YTciLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2ODEwODQ1MiwibmFtZSI6IkVsaSBJbmRhIiwicGhvbmVfbnVtYmVyIjoiKzUyMzExMTkwODg2OCIsImV4cCI6MTY2ODExMjA1MiwiaWF0IjoxNjY4MTA4NDUyLCJlbWFpbCI6Im1hcnRoYTI1Lm1pb0BnbWFpbC5jb20ifQ.JbpinyPv_38xvwwT_td3M_vP3xEffZ6dI0Xl3B9EVjPF7uW4ctZ_B7nKydPyUcB6LTaYEzCI1RfAgZpUQUFbYTfFHJ3T9kgwa9b9mDeDx3kiy2GK3CdYIuWiii5ZivxVKK10gV871OvxDish4w-vEOsClXDncoTX2zAx3wDM4xO83UdI0ahECOTYszuGB3FRnkrHnWJO0b2dpsyhqAmhw0aEcw6gwbqP5l-spOjMM3lE-bGm89pK_9oLYcyRMr09vcGJartmk_ctUisCflrYudnwVgwTwCi1PRBkiaUoDywYeGr6HxRoU1zsiC3LwB-m9b2YnNhEZmPanLfPstKVbw",
|
|
35
35
|
articleId: 238,
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
|
-
orderId:
|
|
40
|
-
|
|
41
|
-
datasheet_status: "
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
brand:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
"orderId": 3366,
|
|
40
|
+
"article_status": "AP",
|
|
41
|
+
"datasheet_status": "NS",
|
|
42
|
+
"description_status": "NS",
|
|
43
|
+
"images_status": "AP",
|
|
44
|
+
"prio": "none",
|
|
45
|
+
"version": 3,
|
|
46
|
+
"brand": null,
|
|
47
|
+
"article": {
|
|
48
|
+
"category": "Iluminación|Lámparas|Lámparas de Mesa",
|
|
49
|
+
"company_name": "Norday",
|
|
50
|
+
"id_company": 810,
|
|
51
|
+
"country": "México",
|
|
52
|
+
"id_category": "2454",
|
|
53
|
+
"id_article": 84492,
|
|
54
|
+
"name": "prueba dos",
|
|
55
|
+
"upc": "8375"
|
|
52
56
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
images: 1
|
|
57
|
-
},
|
|
58
|
-
article: {
|
|
59
|
-
category: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
|
|
60
|
-
company_name: "COMPANY DEV",
|
|
61
|
-
country: "México",
|
|
62
|
-
id_category: "682",
|
|
63
|
-
id_datasheet_especialist: 54,
|
|
64
|
-
id_datasheet_facilitator: 52,
|
|
65
|
-
id_description_especialist: 55,
|
|
66
|
-
id_description_facilitator: 52,
|
|
67
|
-
id_images_especialist: 55,
|
|
68
|
-
id_images_facilitator: 53,
|
|
69
|
-
id_order: 125,
|
|
70
|
-
id_article: 76125,
|
|
71
|
-
id_auditor: 30,
|
|
72
|
-
name: "prueba 11",
|
|
73
|
-
timestamp: "2022-07-20T19:20:46.000Z",
|
|
74
|
-
upc: "35646655"
|
|
75
|
-
},
|
|
76
|
-
retailers: [{
|
|
77
|
-
id: 2,
|
|
78
|
-
name: "Walmart Mercancías Generales"
|
|
79
|
-
}, {
|
|
80
|
-
id: 3,
|
|
81
|
-
name: "Sam´s Club"
|
|
82
|
-
}, {
|
|
83
|
-
id: 5,
|
|
84
|
-
name: "Chedraui"
|
|
57
|
+
"retailers": [{
|
|
58
|
+
"id": 59,
|
|
59
|
+
"name": "The Home Depot Platinum"
|
|
85
60
|
}],
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
datasheet: "AA",
|
|
95
|
-
datasheetTranslations: "AA",
|
|
96
|
-
description: "AA",
|
|
97
|
-
images: "AA"
|
|
98
|
-
},
|
|
99
|
-
5: {
|
|
100
|
-
datasheet: "AA",
|
|
101
|
-
datasheetTranslations: "AA",
|
|
102
|
-
description: "AA",
|
|
103
|
-
images: "AA"
|
|
61
|
+
"services": {
|
|
62
|
+
"datasheets": 0,
|
|
63
|
+
"descriptions": 0,
|
|
64
|
+
"images": 1
|
|
65
|
+
},
|
|
66
|
+
"statusByRetailer": {
|
|
67
|
+
"59": {
|
|
68
|
+
"images": "AP"
|
|
104
69
|
}
|
|
105
70
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}, {
|
|
113
|
-
id: 5,
|
|
114
|
-
name: "Chedraui"
|
|
115
|
-
}],
|
|
116
|
-
categoryName: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
|
|
117
|
-
upc: "35646655",
|
|
118
|
-
id_article: 76125,
|
|
119
|
-
id_order: 125
|
|
71
|
+
"retailersWithService": ["59"],
|
|
72
|
+
"id_article": 84492,
|
|
73
|
+
"retailersAvailable": [{
|
|
74
|
+
"id": 59,
|
|
75
|
+
"name": "The Home Depot Platinum"
|
|
76
|
+
}]
|
|
120
77
|
},
|
|
121
78
|
productToEdit: {
|
|
122
|
-
ArticleId:
|
|
123
|
-
idCategory: "
|
|
124
|
-
product: {
|
|
125
|
-
orderId:
|
|
126
|
-
|
|
127
|
-
datasheet_status: "
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
brand:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
79
|
+
"ArticleId": 84492,
|
|
80
|
+
"idCategory": "2454",
|
|
81
|
+
"product": {
|
|
82
|
+
"orderId": 3366,
|
|
83
|
+
"article_status": "AP",
|
|
84
|
+
"datasheet_status": "NS",
|
|
85
|
+
"description_status": "NS",
|
|
86
|
+
"images_status": "AP",
|
|
87
|
+
"prio": "none",
|
|
88
|
+
"version": 3,
|
|
89
|
+
"brand": null,
|
|
90
|
+
"article": {
|
|
91
|
+
"category": "Iluminación|Lámparas|Lámparas de Mesa",
|
|
92
|
+
"company_name": "Norday",
|
|
93
|
+
"id_company": 810,
|
|
94
|
+
"country": "México",
|
|
95
|
+
"id_category": "2454",
|
|
96
|
+
"id_article": 84492,
|
|
97
|
+
"name": "prueba dos",
|
|
98
|
+
"upc": "8375"
|
|
138
99
|
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
images: 1
|
|
143
|
-
},
|
|
144
|
-
article: {
|
|
145
|
-
category: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
|
|
146
|
-
company_name: "COMPANY DEV",
|
|
147
|
-
country: "México",
|
|
148
|
-
id_category: "682",
|
|
149
|
-
id_datasheet_especialist: 54,
|
|
150
|
-
id_datasheet_facilitator: 52,
|
|
151
|
-
id_description_especialist: 55,
|
|
152
|
-
id_description_facilitator: 52,
|
|
153
|
-
id_images_especialist: 55,
|
|
154
|
-
id_images_facilitator: 53,
|
|
155
|
-
id_order: 125,
|
|
156
|
-
id_article: 76125,
|
|
157
|
-
id_auditor: 30,
|
|
158
|
-
name: "prueba 11",
|
|
159
|
-
timestamp: "2022-07-20T19:20:46.000Z",
|
|
160
|
-
upc: "35646655"
|
|
161
|
-
},
|
|
162
|
-
retailers: [{
|
|
163
|
-
id: 2,
|
|
164
|
-
name: "Walmart Mercancías Generales"
|
|
165
|
-
}, {
|
|
166
|
-
id: 3,
|
|
167
|
-
name: "Sam´s Club"
|
|
168
|
-
}, {
|
|
169
|
-
id: 5,
|
|
170
|
-
name: "Chedraui"
|
|
100
|
+
"retailers": [{
|
|
101
|
+
"id": 59,
|
|
102
|
+
"name": "The Home Depot Platinum"
|
|
171
103
|
}],
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
datasheet: "AA",
|
|
181
|
-
datasheetTranslations: "AA",
|
|
182
|
-
description: "AA",
|
|
183
|
-
images: "AA"
|
|
184
|
-
},
|
|
185
|
-
5: {
|
|
186
|
-
datasheet: "AA",
|
|
187
|
-
datasheetTranslations: "AA",
|
|
188
|
-
description: "AA",
|
|
189
|
-
images: "AA"
|
|
104
|
+
"services": {
|
|
105
|
+
"datasheets": 0,
|
|
106
|
+
"descriptions": 0,
|
|
107
|
+
"images": 1
|
|
108
|
+
},
|
|
109
|
+
"statusByRetailer": {
|
|
110
|
+
"59": {
|
|
111
|
+
"images": "AP"
|
|
190
112
|
}
|
|
191
113
|
},
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}, {
|
|
199
|
-
id: 5,
|
|
200
|
-
name: "Chedraui"
|
|
201
|
-
}],
|
|
202
|
-
categoryName: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
|
|
203
|
-
upc: "35646655",
|
|
204
|
-
id_article: 76125,
|
|
205
|
-
id_order: 125
|
|
114
|
+
"retailersWithService": ["59"],
|
|
115
|
+
"id_article": 84492,
|
|
116
|
+
"retailersAvailable": [{
|
|
117
|
+
"id": 59,
|
|
118
|
+
"name": "The Home Depot Platinum"
|
|
119
|
+
}]
|
|
206
120
|
}
|
|
207
121
|
},
|
|
208
122
|
location: {
|
|
@@ -211,50 +125,78 @@ ProviderProductEditionDefault.args = {
|
|
|
211
125
|
}
|
|
212
126
|
},
|
|
213
127
|
user: {
|
|
214
|
-
id_user:
|
|
215
|
-
name: "
|
|
216
|
-
last_name: "
|
|
217
|
-
email: "
|
|
218
|
-
position: "
|
|
219
|
-
telephone: "+523111366336",
|
|
220
|
-
country: "México",
|
|
221
|
-
id_company:
|
|
222
|
-
id_cognito: "
|
|
223
|
-
birth_Date: null,
|
|
224
|
-
about_me:
|
|
225
|
-
zip_code:
|
|
226
|
-
address:
|
|
227
|
-
job:
|
|
228
|
-
id_stripe: "
|
|
229
|
-
id_role: 0,
|
|
230
|
-
active: 1,
|
|
231
|
-
is_retailer:
|
|
232
|
-
email_notify:
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
128
|
+
"id_user": 59,
|
|
129
|
+
"name": "The Home",
|
|
130
|
+
"last_name": "Depot",
|
|
131
|
+
"email": "cadena.ismael@allfreemail.net",
|
|
132
|
+
"position": "Admin",
|
|
133
|
+
"telephone": "+523111366336",
|
|
134
|
+
"country": "México",
|
|
135
|
+
"id_company": 817,
|
|
136
|
+
"id_cognito": "5884ae34-59d6-4454-b98e-821518bcc3a7",
|
|
137
|
+
"birth_Date": null,
|
|
138
|
+
"about_me": "",
|
|
139
|
+
"zip_code": "",
|
|
140
|
+
"address": "",
|
|
141
|
+
"job": "",
|
|
142
|
+
"id_stripe": "",
|
|
143
|
+
"id_role": 0,
|
|
144
|
+
"active": 1,
|
|
145
|
+
"is_retailer": 1,
|
|
146
|
+
"email_notify": 0,
|
|
147
|
+
"is_user_tech": null,
|
|
148
|
+
"membership": {
|
|
149
|
+
"id": 47,
|
|
150
|
+
"start_date": "2022-05-25T14:31:12.000Z",
|
|
151
|
+
"end_date": "2023-05-25T14:31:12.000Z",
|
|
152
|
+
"planID": 5,
|
|
153
|
+
"plan": "prod_Ktl6B5Ou2gqTB2",
|
|
154
|
+
"name": "Plan Pro",
|
|
155
|
+
"user_limit": "5",
|
|
156
|
+
"products_limit": "500",
|
|
157
|
+
"type": "PyMES"
|
|
243
158
|
},
|
|
244
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
159
|
+
"src": "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1668127460068"
|
|
245
160
|
},
|
|
246
161
|
company: {
|
|
247
|
-
id_company:
|
|
248
|
-
trade_name: "
|
|
249
|
-
company_name: "
|
|
250
|
-
rfc:
|
|
251
|
-
adress: "",
|
|
252
|
-
about_company:
|
|
253
|
-
telephone:
|
|
254
|
-
web_site:
|
|
255
|
-
zip_code:
|
|
256
|
-
email: null,
|
|
257
|
-
social_link:
|
|
258
|
-
is_retailer:
|
|
162
|
+
"id_company": 817,
|
|
163
|
+
"trade_name": "Retailer acc",
|
|
164
|
+
"company_name": "Retailer acc",
|
|
165
|
+
"rfc": "ASER12345",
|
|
166
|
+
"adress": "Av. Insurgentes",
|
|
167
|
+
"about_company": null,
|
|
168
|
+
"telephone": null,
|
|
169
|
+
"web_site": null,
|
|
170
|
+
"zip_code": null,
|
|
171
|
+
"email": null,
|
|
172
|
+
"social_link": null,
|
|
173
|
+
"is_retailer": 1,
|
|
174
|
+
"financedRetailers": [{
|
|
175
|
+
"id": 68,
|
|
176
|
+
"name": "The Home Depot Merchants",
|
|
177
|
+
"country": "México",
|
|
178
|
+
"id_region": 1,
|
|
179
|
+
"active": 1
|
|
180
|
+
}],
|
|
181
|
+
"retailers": [{
|
|
182
|
+
"id": 59,
|
|
183
|
+
"name": "The Home Depot Platinum",
|
|
184
|
+
"country": "México"
|
|
185
|
+
}, {
|
|
186
|
+
"id": 60,
|
|
187
|
+
"name": "The Home Depot Resizing",
|
|
188
|
+
"country": "México"
|
|
189
|
+
}, {
|
|
190
|
+
"id": 61,
|
|
191
|
+
"name": "Home Depot TAB",
|
|
192
|
+
"country": "México"
|
|
193
|
+
}, {
|
|
194
|
+
"id": 68,
|
|
195
|
+
"name": "The Home Depot Merchants",
|
|
196
|
+
"country": "México"
|
|
197
|
+
}]
|
|
198
|
+
},
|
|
199
|
+
showSurvey: function showSurvey(v) {
|
|
200
|
+
return v && alert('se muestra');
|
|
259
201
|
}
|
|
260
202
|
};
|
|
@@ -106,7 +106,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
106
106
|
var reducerImages = function reducerImages(state, action) {
|
|
107
107
|
var _action$init, _action$init$inputsBy;
|
|
108
108
|
|
|
109
|
-
var values = state.values,
|
|
109
|
+
var _state$values = state.values,
|
|
110
|
+
values = _state$values === void 0 ? [] : _state$values,
|
|
110
111
|
attrForImgs = state.attrForImgs,
|
|
111
112
|
inputsByRetailer = state.inputsByRetailer;
|
|
112
113
|
|
|
@@ -182,7 +183,7 @@ var reducerImages = function reducerImages(state, action) {
|
|
|
182
183
|
inputs = inputsInitial === null || inputsInitial === void 0 ? void 0 : inputsInitial.filter(function (input) {
|
|
183
184
|
return imageIdArray.includes(input.id);
|
|
184
185
|
});
|
|
185
|
-
|
|
186
|
+
if (orderedImages.length > 0) values = orderedImages;
|
|
186
187
|
} catch (error) {
|
|
187
188
|
console.log(error);
|
|
188
189
|
}
|
|
@@ -1408,7 +1409,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1408
1409
|
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(result) {
|
|
1409
1410
|
var _productTemp$id_order;
|
|
1410
1411
|
|
|
1411
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1412
|
+
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
1412
1413
|
|
|
1413
1414
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1414
1415
|
while (1) {
|
|
@@ -1431,7 +1432,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1431
1432
|
_context12.prev = 9;
|
|
1432
1433
|
|
|
1433
1434
|
if (!result) {
|
|
1434
|
-
_context12.next =
|
|
1435
|
+
_context12.next = 27;
|
|
1435
1436
|
break;
|
|
1436
1437
|
}
|
|
1437
1438
|
|
|
@@ -1452,22 +1453,24 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1452
1453
|
newProductEdit = productEdit;
|
|
1453
1454
|
newProductEdit.product[sectionStatusKey] = serviceStatus;
|
|
1454
1455
|
setProductEdit(newProductEdit);
|
|
1455
|
-
|
|
1456
|
-
|
|
1456
|
+
showSurveyByProvider = !user.is_retailer && orderStatus[orderId] === "AP";
|
|
1457
|
+
showSurveyByRetailer = user.is_retailer && orderStatus[orderId] === "ACA";
|
|
1458
|
+
showSurvey && showSurvey(showSurveyByProvider || showSurveyByRetailer);
|
|
1459
|
+
_context12.next = 30;
|
|
1457
1460
|
break;
|
|
1458
1461
|
|
|
1459
|
-
case
|
|
1460
|
-
_context12.next =
|
|
1462
|
+
case 27:
|
|
1463
|
+
_context12.next = 29;
|
|
1461
1464
|
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1462
1465
|
headers: {
|
|
1463
1466
|
Authorization: token
|
|
1464
1467
|
}
|
|
1465
1468
|
});
|
|
1466
1469
|
|
|
1467
|
-
case
|
|
1470
|
+
case 29:
|
|
1468
1471
|
res = _context12.sent;
|
|
1469
1472
|
|
|
1470
|
-
case
|
|
1473
|
+
case 30:
|
|
1471
1474
|
if (res.data.statusCode === 200) {
|
|
1472
1475
|
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1473
1476
|
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
@@ -1488,23 +1491,23 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1488
1491
|
});
|
|
1489
1492
|
}
|
|
1490
1493
|
|
|
1491
|
-
_context12.next =
|
|
1494
|
+
_context12.next = 36;
|
|
1492
1495
|
break;
|
|
1493
1496
|
|
|
1494
|
-
case
|
|
1495
|
-
_context12.prev =
|
|
1497
|
+
case 33:
|
|
1498
|
+
_context12.prev = 33;
|
|
1496
1499
|
_context12.t0 = _context12["catch"](9);
|
|
1497
1500
|
console.log(_context12.t0);
|
|
1498
1501
|
|
|
1499
|
-
case
|
|
1502
|
+
case 36:
|
|
1500
1503
|
loadData();
|
|
1501
1504
|
|
|
1502
|
-
case
|
|
1505
|
+
case 37:
|
|
1503
1506
|
case "end":
|
|
1504
1507
|
return _context12.stop();
|
|
1505
1508
|
}
|
|
1506
1509
|
}
|
|
1507
|
-
}, _callee12, null, [[9,
|
|
1510
|
+
}, _callee12, null, [[9, 33]]);
|
|
1508
1511
|
}));
|
|
1509
1512
|
|
|
1510
1513
|
return function sendEvaluation(_x7) {
|
|
@@ -84,7 +84,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
84
84
|
var reducerImages = function reducerImages(state, action) {
|
|
85
85
|
var _action$init, _action$init$inputsBy;
|
|
86
86
|
|
|
87
|
-
var values = state.values,
|
|
87
|
+
var _state$values = state.values,
|
|
88
|
+
values = _state$values === void 0 ? [] : _state$values,
|
|
88
89
|
attrForImgs = state.attrForImgs,
|
|
89
90
|
inputsByRetailer = state.inputsByRetailer;
|
|
90
91
|
|
|
@@ -166,7 +167,7 @@ var reducerImages = function reducerImages(state, action) {
|
|
|
166
167
|
inputs = inputsInitial === null || inputsInitial === void 0 ? void 0 : inputsInitial.filter(function (input) {
|
|
167
168
|
return imageIdArray.includes(input.id);
|
|
168
169
|
});
|
|
169
|
-
|
|
170
|
+
if (orderedImages.length > 0) values = orderedImages;
|
|
170
171
|
} catch (error) {
|
|
171
172
|
console.log(error);
|
|
172
173
|
}
|
package/package.json
CHANGED
|
@@ -16,244 +16,187 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: true,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5MmFiMWFkNS0zOWM4LTRhMjAtODFlNC02N2VjMTRmMzhmNDMiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjkyYWIxYWQ1LTM5YzgtNGEyMC04MWU0LTY3ZWMxNGYzOGY0MyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI4Y2U5MjYyMi0xYjZlLTQ1MWEtODUyYy04MjMxYzcwOTk5YTciLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2ODEwODQ1MiwibmFtZSI6IkVsaSBJbmRhIiwicGhvbmVfbnVtYmVyIjoiKzUyMzExMTkwODg2OCIsImV4cCI6MTY2ODExMjA1MiwiaWF0IjoxNjY4MTA4NDUyLCJlbWFpbCI6Im1hcnRoYTI1Lm1pb0BnbWFpbC5jb20ifQ.JbpinyPv_38xvwwT_td3M_vP3xEffZ6dI0Xl3B9EVjPF7uW4ctZ_B7nKydPyUcB6LTaYEzCI1RfAgZpUQUFbYTfFHJ3T9kgwa9b9mDeDx3kiy2GK3CdYIuWiii5ZivxVKK10gV871OvxDish4w-vEOsClXDncoTX2zAx3wDM4xO83UdI0ahECOTYszuGB3FRnkrHnWJO0b2dpsyhqAmhw0aEcw6gwbqP5l-spOjMM3lE-bGm89pK_9oLYcyRMr09vcGJartmk_ctUisCflrYudnwVgwTwCi1PRBkiaUoDywYeGr6HxRoU1zsiC3LwB-m9b2YnNhEZmPanLfPstKVbw",
|
|
20
20
|
articleId: 238,
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
|
-
orderId:
|
|
25
|
-
|
|
26
|
-
datasheet_status: "
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
brand:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
"orderId": 3366,
|
|
25
|
+
"article_status": "AP",
|
|
26
|
+
"datasheet_status": "NS",
|
|
27
|
+
"description_status": "NS",
|
|
28
|
+
"images_status": "AP",
|
|
29
|
+
"prio": "none",
|
|
30
|
+
"version": 3,
|
|
31
|
+
"brand": null,
|
|
32
|
+
"article": {
|
|
33
|
+
"category": "Iluminación|Lámparas|Lámparas de Mesa",
|
|
34
|
+
"company_name": "Norday",
|
|
35
|
+
"id_company": 810,
|
|
36
|
+
"country": "México",
|
|
37
|
+
"id_category": "2454",
|
|
38
|
+
"id_article": 84492,
|
|
39
|
+
"name": "prueba dos",
|
|
40
|
+
"upc": "8375"
|
|
37
41
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
article: {
|
|
44
|
-
category: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
|
|
45
|
-
company_name: "COMPANY DEV",
|
|
46
|
-
country: "México",
|
|
47
|
-
id_category: "682",
|
|
48
|
-
id_datasheet_especialist: 54,
|
|
49
|
-
id_datasheet_facilitator: 52,
|
|
50
|
-
id_description_especialist: 55,
|
|
51
|
-
id_description_facilitator: 52,
|
|
52
|
-
id_images_especialist: 55,
|
|
53
|
-
id_images_facilitator: 53,
|
|
54
|
-
id_order: 125,
|
|
55
|
-
id_article: 76125,
|
|
56
|
-
id_auditor: 30,
|
|
57
|
-
name: "prueba 11",
|
|
58
|
-
timestamp: "2022-07-20T19:20:46.000Z",
|
|
59
|
-
upc: "35646655",
|
|
60
|
-
},
|
|
61
|
-
retailers: [
|
|
62
|
-
{
|
|
63
|
-
id: 2,
|
|
64
|
-
name: "Walmart Mercancías Generales",
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: 3,
|
|
68
|
-
name: "Sam´s Club",
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: 5,
|
|
72
|
-
name: "Chedraui",
|
|
73
|
-
},
|
|
42
|
+
"retailers": [
|
|
43
|
+
{
|
|
44
|
+
"id": 59,
|
|
45
|
+
"name": "The Home Depot Platinum"
|
|
46
|
+
}
|
|
74
47
|
],
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
datasheetTranslations: "AA",
|
|
85
|
-
description: "AA",
|
|
86
|
-
images: "AA",
|
|
87
|
-
},
|
|
88
|
-
5: {
|
|
89
|
-
datasheet: "AA",
|
|
90
|
-
datasheetTranslations: "AA",
|
|
91
|
-
description: "AA",
|
|
92
|
-
images: "AA",
|
|
93
|
-
},
|
|
48
|
+
"services": {
|
|
49
|
+
"datasheets": 0,
|
|
50
|
+
"descriptions": 0,
|
|
51
|
+
"images": 1
|
|
52
|
+
},
|
|
53
|
+
"statusByRetailer": {
|
|
54
|
+
"59": {
|
|
55
|
+
"images": "AP"
|
|
56
|
+
}
|
|
94
57
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
id: 2,
|
|
98
|
-
name: "Walmart Mercancías Generales",
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: 3,
|
|
102
|
-
name: "Sam´s Club",
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
id: 5,
|
|
106
|
-
name: "Chedraui",
|
|
107
|
-
},
|
|
58
|
+
"retailersWithService": [
|
|
59
|
+
"59"
|
|
108
60
|
],
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
61
|
+
"id_article": 84492,
|
|
62
|
+
"retailersAvailable": [
|
|
63
|
+
{
|
|
64
|
+
"id": 59,
|
|
65
|
+
"name": "The Home Depot Platinum"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
113
68
|
},
|
|
114
69
|
productToEdit: {
|
|
115
|
-
ArticleId:
|
|
116
|
-
idCategory: "
|
|
117
|
-
product: {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
images: 1,
|
|
136
|
-
},
|
|
137
|
-
article: {
|
|
138
|
-
category: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
|
|
139
|
-
company_name: "COMPANY DEV",
|
|
140
|
-
country: "México",
|
|
141
|
-
id_category: "682",
|
|
142
|
-
id_datasheet_especialist: 54,
|
|
143
|
-
id_datasheet_facilitator: 52,
|
|
144
|
-
id_description_especialist: 55,
|
|
145
|
-
id_description_facilitator: 52,
|
|
146
|
-
id_images_especialist: 55,
|
|
147
|
-
id_images_facilitator: 53,
|
|
148
|
-
id_order: 125,
|
|
149
|
-
id_article: 76125,
|
|
150
|
-
id_auditor: 30,
|
|
151
|
-
name: "prueba 11",
|
|
152
|
-
timestamp: "2022-07-20T19:20:46.000Z",
|
|
153
|
-
upc: "35646655",
|
|
154
|
-
},
|
|
155
|
-
retailers: [
|
|
156
|
-
{
|
|
157
|
-
id: 2,
|
|
158
|
-
name: "Walmart Mercancías Generales",
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
id: 3,
|
|
162
|
-
name: "Sam´s Club",
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
id: 5,
|
|
166
|
-
name: "Chedraui",
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
statusByRetailer: {
|
|
170
|
-
2: {
|
|
171
|
-
datasheet: "AA",
|
|
172
|
-
datasheetTranslations: "AA",
|
|
173
|
-
description: "AA",
|
|
174
|
-
images: "AA",
|
|
70
|
+
"ArticleId": 84492,
|
|
71
|
+
"idCategory": "2454",
|
|
72
|
+
"product": {
|
|
73
|
+
"orderId": 3366,
|
|
74
|
+
"article_status": "AP",
|
|
75
|
+
"datasheet_status": "NS",
|
|
76
|
+
"description_status": "NS",
|
|
77
|
+
"images_status": "AP",
|
|
78
|
+
"prio": "none",
|
|
79
|
+
"version": 3,
|
|
80
|
+
"brand": null,
|
|
81
|
+
"article": {
|
|
82
|
+
"category": "Iluminación|Lámparas|Lámparas de Mesa",
|
|
83
|
+
"company_name": "Norday",
|
|
84
|
+
"id_company": 810,
|
|
85
|
+
"country": "México",
|
|
86
|
+
"id_category": "2454",
|
|
87
|
+
"id_article": 84492,
|
|
88
|
+
"name": "prueba dos",
|
|
89
|
+
"upc": "8375"
|
|
175
90
|
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
91
|
+
"retailers": [
|
|
92
|
+
{
|
|
93
|
+
"id": 59,
|
|
94
|
+
"name": "The Home Depot Platinum"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"services": {
|
|
98
|
+
"datasheets": 0,
|
|
99
|
+
"descriptions": 0,
|
|
100
|
+
"images": 1
|
|
181
101
|
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
images: "AA",
|
|
102
|
+
"statusByRetailer": {
|
|
103
|
+
"59": {
|
|
104
|
+
"images": "AP"
|
|
105
|
+
}
|
|
187
106
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
id: 5,
|
|
200
|
-
name: "Chedraui",
|
|
201
|
-
},
|
|
202
|
-
],
|
|
203
|
-
categoryName: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
|
|
204
|
-
upc: "35646655",
|
|
205
|
-
id_article: 76125,
|
|
206
|
-
id_order: 125,
|
|
207
|
-
},
|
|
107
|
+
"retailersWithService": [
|
|
108
|
+
"59"
|
|
109
|
+
],
|
|
110
|
+
"id_article": 84492,
|
|
111
|
+
"retailersAvailable": [
|
|
112
|
+
{
|
|
113
|
+
"id": 59,
|
|
114
|
+
"name": "The Home Depot Platinum"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
208
118
|
},
|
|
209
119
|
location: {
|
|
210
120
|
state: { origin: "Contentoh" },
|
|
211
121
|
},
|
|
212
122
|
user: {
|
|
213
|
-
id_user:
|
|
214
|
-
name: "
|
|
215
|
-
last_name: "
|
|
216
|
-
email: "
|
|
217
|
-
position: "
|
|
218
|
-
telephone: "+523111366336",
|
|
219
|
-
country: "México",
|
|
220
|
-
id_company:
|
|
221
|
-
id_cognito: "
|
|
222
|
-
birth_Date: null,
|
|
223
|
-
about_me:
|
|
224
|
-
zip_code:
|
|
225
|
-
address:
|
|
226
|
-
job:
|
|
227
|
-
id_stripe: "
|
|
228
|
-
id_role: 0,
|
|
229
|
-
active: 1,
|
|
230
|
-
is_retailer:
|
|
231
|
-
email_notify:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
123
|
+
"id_user": 59,
|
|
124
|
+
"name": "The Home",
|
|
125
|
+
"last_name": "Depot",
|
|
126
|
+
"email": "cadena.ismael@allfreemail.net",
|
|
127
|
+
"position": "Admin",
|
|
128
|
+
"telephone": "+523111366336",
|
|
129
|
+
"country": "México",
|
|
130
|
+
"id_company": 817,
|
|
131
|
+
"id_cognito": "5884ae34-59d6-4454-b98e-821518bcc3a7",
|
|
132
|
+
"birth_Date": null,
|
|
133
|
+
"about_me": "",
|
|
134
|
+
"zip_code": "",
|
|
135
|
+
"address": "",
|
|
136
|
+
"job": "",
|
|
137
|
+
"id_stripe": "",
|
|
138
|
+
"id_role": 0,
|
|
139
|
+
"active": 1,
|
|
140
|
+
"is_retailer": 1,
|
|
141
|
+
"email_notify": 0,
|
|
142
|
+
"is_user_tech": null,
|
|
143
|
+
"membership": {
|
|
144
|
+
"id": 47,
|
|
145
|
+
"start_date": "2022-05-25T14:31:12.000Z",
|
|
146
|
+
"end_date": "2023-05-25T14:31:12.000Z",
|
|
147
|
+
"planID": 5,
|
|
148
|
+
"plan": "prod_Ktl6B5Ou2gqTB2",
|
|
149
|
+
"name": "Plan Pro",
|
|
150
|
+
"user_limit": "5",
|
|
151
|
+
"products_limit": "500",
|
|
152
|
+
"type": "PyMES"
|
|
242
153
|
},
|
|
243
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
154
|
+
"src": "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1668127460068"
|
|
244
155
|
},
|
|
245
156
|
company: {
|
|
246
|
-
id_company:
|
|
247
|
-
trade_name: "
|
|
248
|
-
company_name: "
|
|
249
|
-
rfc:
|
|
250
|
-
adress: "",
|
|
251
|
-
about_company:
|
|
252
|
-
telephone:
|
|
253
|
-
web_site:
|
|
254
|
-
zip_code:
|
|
255
|
-
email: null,
|
|
256
|
-
social_link:
|
|
257
|
-
is_retailer:
|
|
157
|
+
"id_company": 817,
|
|
158
|
+
"trade_name": "Retailer acc",
|
|
159
|
+
"company_name": "Retailer acc",
|
|
160
|
+
"rfc": "ASER12345",
|
|
161
|
+
"adress": "Av. Insurgentes",
|
|
162
|
+
"about_company": null,
|
|
163
|
+
"telephone": null,
|
|
164
|
+
"web_site": null,
|
|
165
|
+
"zip_code": null,
|
|
166
|
+
"email": null,
|
|
167
|
+
"social_link": null,
|
|
168
|
+
"is_retailer": 1,
|
|
169
|
+
"financedRetailers": [
|
|
170
|
+
{
|
|
171
|
+
"id": 68,
|
|
172
|
+
"name": "The Home Depot Merchants",
|
|
173
|
+
"country": "México",
|
|
174
|
+
"id_region": 1,
|
|
175
|
+
"active": 1
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"retailers": [
|
|
179
|
+
{
|
|
180
|
+
"id": 59,
|
|
181
|
+
"name": "The Home Depot Platinum",
|
|
182
|
+
"country": "México"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": 60,
|
|
186
|
+
"name": "The Home Depot Resizing",
|
|
187
|
+
"country": "México"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": 61,
|
|
191
|
+
"name": "Home Depot TAB",
|
|
192
|
+
"country": "México"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": 68,
|
|
196
|
+
"name": "The Home Depot Merchants",
|
|
197
|
+
"country": "México"
|
|
198
|
+
}
|
|
199
|
+
]
|
|
258
200
|
},
|
|
201
|
+
showSurvey: (v) => v && alert('se muestra'),
|
|
259
202
|
};
|
|
@@ -45,7 +45,7 @@ import { useCloseModal } from "../../../global-files/customHooks";
|
|
|
45
45
|
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
46
46
|
|
|
47
47
|
const reducerImages = (state, action) => {
|
|
48
|
-
let { values, attrForImgs, inputsByRetailer } = state;
|
|
48
|
+
let { values = [], attrForImgs, inputsByRetailer } = state;
|
|
49
49
|
switch (action.action) {
|
|
50
50
|
case "init":
|
|
51
51
|
const newInputsByRetailer = {};
|
|
@@ -100,7 +100,7 @@ const reducerImages = (state, action) => {
|
|
|
100
100
|
imageIdArray.includes(input.id)
|
|
101
101
|
);
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
if (orderedImages.length > 0) values = orderedImages;
|
|
104
104
|
} catch (error) {
|
|
105
105
|
console.log(error);
|
|
106
106
|
}
|
|
@@ -877,8 +877,10 @@ export const ProviderProductEdition = ({
|
|
|
877
877
|
const newProductEdit = productEdit;
|
|
878
878
|
newProductEdit.product[sectionStatusKey] = serviceStatus;
|
|
879
879
|
setProductEdit(newProductEdit);
|
|
880
|
-
|
|
881
|
-
|
|
880
|
+
const showSurveyByProvider = !user.is_retailer && orderStatus[orderId] === "AP";
|
|
881
|
+
const showSurveyByRetailer = user.is_retailer && orderStatus[orderId] === "ACA";
|
|
882
|
+
showSurvey &&
|
|
883
|
+
showSurvey(showSurveyByProvider || showSurveyByRetailer);
|
|
882
884
|
} else {
|
|
883
885
|
res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
884
886
|
headers: {
|
|
@@ -35,7 +35,7 @@ import { useCloseModal } from "../../../global-files/customHooks";
|
|
|
35
35
|
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
36
36
|
|
|
37
37
|
const reducerImages = (state, action) => {
|
|
38
|
-
let { values, attrForImgs, inputsByRetailer } = state;
|
|
38
|
+
let { values = [], attrForImgs, inputsByRetailer } = state;
|
|
39
39
|
switch (action.action) {
|
|
40
40
|
case "init":
|
|
41
41
|
const newInputsByRetailer = {};
|
|
@@ -94,7 +94,7 @@ const reducerImages = (state, action) => {
|
|
|
94
94
|
imageIdArray.includes(input.id)
|
|
95
95
|
);
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
if (orderedImages.length > 0) values = orderedImages;
|
|
98
98
|
} catch (error) {
|
|
99
99
|
console.log(error);
|
|
100
100
|
}
|