contentoh-components-library 21.5.89 → 21.5.91
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/GeneralInput/index.js +11 -15
- package/dist/components/organisms/ChangeStatusModal/index.js +4 -4
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +92 -108
- package/dist/components/pages/RetailerProductEdition/index.js +48 -40
- package/package.json +1 -1
- package/src/components/atoms/GeneralInput/index.js +9 -9
- package/src/components/organisms/ChangeStatusModal/index.jsx +4 -4
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +98 -110
- package/src/components/pages/RetailerProductEdition/index.js +44 -39
|
@@ -213,19 +213,15 @@ var GeneralInput = function GeneralInput(_ref) {
|
|
|
213
213
|
var _textValue$value;
|
|
214
214
|
|
|
215
215
|
setRequiredEmpty(isRequired && (((_textValue$value = textValue.value) === null || _textValue$value === void 0 ? void 0 : _textValue$value.length) === 0 || textValue.value === undefined));
|
|
216
|
-
}, [textValue]);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return e.target.focus();
|
|
226
|
-
}, 0);
|
|
227
|
-
}; //AI Generation
|
|
228
|
-
|
|
216
|
+
}, [textValue]); // const numberInputOnWheelPreventChange = (e) => {
|
|
217
|
+
// // Prevent the input value change
|
|
218
|
+
// e.target.blur();
|
|
219
|
+
// // Prevent the page/container scrolling
|
|
220
|
+
// e.stopPropagation();
|
|
221
|
+
// // Refocus immediately, on the next tick (after the current function is done)
|
|
222
|
+
// setTimeout(() => e.target.focus(), 0);
|
|
223
|
+
// };
|
|
224
|
+
//AI Generation
|
|
229
225
|
|
|
230
226
|
var handleAcceptSuggestion = function handleAcceptSuggestion(suggestionValue) {
|
|
231
227
|
if (!suggestionValue) return;
|
|
@@ -277,8 +273,8 @@ var GeneralInput = function GeneralInput(_ref) {
|
|
|
277
273
|
},
|
|
278
274
|
maxLength: maxChar,
|
|
279
275
|
required: isRequired,
|
|
280
|
-
onKeyDown: onKeyDown
|
|
281
|
-
|
|
276
|
+
onKeyDown: onKeyDown // onWheel={numberInputOnWheelPreventChange}
|
|
277
|
+
|
|
282
278
|
}), hasAiGeneration && isBenefitInput && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
283
279
|
className: "icon_container ".concat(isAiAvailable ? "ai-available" : '', " ").concat(isAiActive ? 'ai-active' : ''),
|
|
284
280
|
title: !isAiAvailable ? 'Debes de completar ficha técnica e imágenes para desbloquear la generación con IA' : '',
|
|
@@ -434,7 +434,7 @@ var ChangeStatusModal = function ChangeStatusModal(_ref) {
|
|
|
434
434
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SectionTitle, {
|
|
435
435
|
children: "Estatus actual:"
|
|
436
436
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StatusPill, {
|
|
437
|
-
label: currentStatusObj.name,
|
|
437
|
+
label: currentStatusObj === null || currentStatusObj === void 0 ? void 0 : currentStatusObj.name,
|
|
438
438
|
selected: false,
|
|
439
439
|
disabled: true
|
|
440
440
|
})]
|
|
@@ -445,10 +445,10 @@ var ChangeStatusModal = function ChangeStatusModal(_ref) {
|
|
|
445
445
|
children: Object.values(_statusDictionary.STATUS_DICTIONARY).map(function (status) {
|
|
446
446
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StatusPill, {
|
|
447
447
|
label: status.name,
|
|
448
|
-
disabled: status.name === currentStatusObj.name,
|
|
448
|
+
disabled: status.name === (currentStatusObj === null || currentStatusObj === void 0 ? void 0 : currentStatusObj.name),
|
|
449
449
|
selected: status.name === newStatus,
|
|
450
450
|
onClick: function onClick() {
|
|
451
|
-
return status.name !== currentStatusObj.name && setNewStatus(status.name);
|
|
451
|
+
return status.name !== (currentStatusObj === null || currentStatusObj === void 0 ? void 0 : currentStatusObj.name) && setNewStatus(status.name);
|
|
452
452
|
}
|
|
453
453
|
}, status.name);
|
|
454
454
|
})
|
|
@@ -483,7 +483,7 @@ var ChangeStatusModal = function ChangeStatusModal(_ref) {
|
|
|
483
483
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
484
484
|
className: "status-flow",
|
|
485
485
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StatusPill, {
|
|
486
|
-
label: currentStatusObj.name,
|
|
486
|
+
label: currentStatusObj === null || currentStatusObj === void 0 ? void 0 : currentStatusObj.name,
|
|
487
487
|
selected: false,
|
|
488
488
|
disabled: true,
|
|
489
489
|
size: "small"
|
|
@@ -33,120 +33,140 @@ RetailerProductEditionDefault.args = {
|
|
|
33
33
|
},
|
|
34
34
|
token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI4ZDAxMDIxNC01YmZhLTQzYzMtOTZmYi1jNTU2ZGMwNTc3NGIiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjhkMDEwMjE0LTViZmEtNDNjMy05NmZiLWM1NTZkYzA1Nzc0YiIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI1MDgwMTVmMy1mZGVkLTQ2ODUtYTIxNy1mYzgyMTg0ZWRmNGMiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTc2ODI1MzE3NywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTc2ODI1Njc3NywiaWF0IjoxNzY4MjUzMTc3LCJlbWFpbCI6ImthcmFmZTMyMThAbW9tMmtpZC5jb20ifQ.QiZiscuTvrur0g328Zmh2bI-kZyg7YO_T5jT63096JNuSxGnX9wpK87cVTV1dED4ruD-2NMsgLShUIMcklAg17FL6i5_vCuB1dSIDY0LaybvSpriFJaVVdMUIMGFi_1Q7bI9qqyXYkevcf-HO33vVPdU-_-4-u8YRd-QganUk35vPYPh9vFJWbC0Qtvv25ZR4L2xuRIXx4e7StlTvZXysnYL8A84jkK1zn6d77V-9GqQQW8exO6sBW7R6cGt55vnF80NIfG_9lAqCK0PcZH4o50aqrAVhtfV5edlEmXBHeGK5R3Sz5iTeKb51QF3TWVFZCYGvQJ7FShulUWHcm3X2Q",
|
|
35
35
|
productSelected: {
|
|
36
|
-
"articleId":
|
|
36
|
+
"articleId": 145210,
|
|
37
37
|
"services": {
|
|
38
38
|
"datasheets": 1,
|
|
39
39
|
"descriptions": 1,
|
|
40
|
-
"images":
|
|
40
|
+
"images": 1
|
|
41
41
|
},
|
|
42
|
-
"orderId":
|
|
42
|
+
"orderId": 10459,
|
|
43
43
|
"city": "CDMX, México",
|
|
44
|
-
"status": "
|
|
45
|
-
"datasheet_status": "
|
|
44
|
+
"status": "AC",
|
|
45
|
+
"datasheet_status": "AC",
|
|
46
46
|
"prio": "none",
|
|
47
47
|
"version": 3,
|
|
48
|
-
"description_status": "
|
|
49
|
-
"images_status": "
|
|
48
|
+
"description_status": "AC",
|
|
49
|
+
"images_status": "AC",
|
|
50
50
|
"statusByRetailer": [{
|
|
51
|
-
"status": "
|
|
51
|
+
"status": "AC",
|
|
52
52
|
"service": "datasheet",
|
|
53
|
-
"retailer_id":
|
|
54
|
-
"task_user_group_id":
|
|
53
|
+
"retailer_id": 13,
|
|
54
|
+
"task_user_group_id": 4
|
|
55
55
|
}, {
|
|
56
|
-
"status": "
|
|
56
|
+
"status": "AC",
|
|
57
57
|
"service": "description",
|
|
58
|
-
"retailer_id":
|
|
59
|
-
"task_user_group_id":
|
|
58
|
+
"retailer_id": 13,
|
|
59
|
+
"task_user_group_id": 4
|
|
60
60
|
}, {
|
|
61
|
-
"status": "
|
|
61
|
+
"status": "AC",
|
|
62
|
+
"service": "images",
|
|
63
|
+
"retailer_id": 13,
|
|
64
|
+
"task_user_group_id": 4
|
|
65
|
+
}, {
|
|
66
|
+
"status": "AC",
|
|
62
67
|
"service": "datasheet",
|
|
63
|
-
"retailer_id":
|
|
64
|
-
"task_user_group_id":
|
|
68
|
+
"retailer_id": 29,
|
|
69
|
+
"task_user_group_id": 4
|
|
65
70
|
}, {
|
|
66
|
-
"status": "
|
|
71
|
+
"status": "AC",
|
|
67
72
|
"service": "description",
|
|
68
|
-
"retailer_id":
|
|
69
|
-
"task_user_group_id":
|
|
73
|
+
"retailer_id": 29,
|
|
74
|
+
"task_user_group_id": 4
|
|
75
|
+
}, {
|
|
76
|
+
"status": "AC",
|
|
77
|
+
"service": "images",
|
|
78
|
+
"retailer_id": 29,
|
|
79
|
+
"task_user_group_id": 4
|
|
70
80
|
}, {
|
|
71
|
-
"status": "
|
|
81
|
+
"status": "AC",
|
|
72
82
|
"service": "datasheet",
|
|
73
|
-
"retailer_id":
|
|
74
|
-
"task_user_group_id":
|
|
83
|
+
"retailer_id": 36,
|
|
84
|
+
"task_user_group_id": 4
|
|
75
85
|
}, {
|
|
76
|
-
"status": "
|
|
86
|
+
"status": "AC",
|
|
77
87
|
"service": "description",
|
|
78
|
-
"retailer_id":
|
|
79
|
-
"task_user_group_id":
|
|
88
|
+
"retailer_id": 36,
|
|
89
|
+
"task_user_group_id": 4
|
|
90
|
+
}, {
|
|
91
|
+
"status": "AC",
|
|
92
|
+
"service": "images",
|
|
93
|
+
"retailer_id": 36,
|
|
94
|
+
"task_user_group_id": 4
|
|
80
95
|
}, {
|
|
81
|
-
"status": "
|
|
96
|
+
"status": "AC",
|
|
82
97
|
"service": "datasheet",
|
|
83
|
-
"retailer_id":
|
|
84
|
-
"task_user_group_id":
|
|
98
|
+
"retailer_id": 70,
|
|
99
|
+
"task_user_group_id": 4
|
|
85
100
|
}, {
|
|
86
|
-
"status": "
|
|
101
|
+
"status": "AC",
|
|
87
102
|
"service": "description",
|
|
88
|
-
"retailer_id":
|
|
89
|
-
"task_user_group_id":
|
|
103
|
+
"retailer_id": 70,
|
|
104
|
+
"task_user_group_id": 4
|
|
105
|
+
}, {
|
|
106
|
+
"status": "AC",
|
|
107
|
+
"service": "images",
|
|
108
|
+
"retailer_id": 70,
|
|
109
|
+
"task_user_group_id": 4
|
|
90
110
|
}],
|
|
91
111
|
"article": {
|
|
92
|
-
"id_article":
|
|
93
|
-
"id_category": "
|
|
94
|
-
"brand":
|
|
95
|
-
"name": "Serna Status Bug
|
|
96
|
-
"upc": "
|
|
97
|
-
"sku": "
|
|
98
|
-
"timestamp": "2026-05-
|
|
112
|
+
"id_article": 145210,
|
|
113
|
+
"id_category": "4874",
|
|
114
|
+
"brand": "Generico",
|
|
115
|
+
"name": "Serna Status Bug 7",
|
|
116
|
+
"upc": "16168153",
|
|
117
|
+
"sku": "15631130151",
|
|
118
|
+
"timestamp": "2026-05-07T16:00:51.000Z",
|
|
99
119
|
"active": 1,
|
|
100
120
|
"company_id": 291,
|
|
101
121
|
"company_name": "LATAM LOGISTICS",
|
|
102
122
|
"country": "México",
|
|
103
|
-
"id_order":
|
|
123
|
+
"id_order": 10459,
|
|
104
124
|
"id_datasheet_especialist": 426,
|
|
105
125
|
"id_datasheet_facilitator": null,
|
|
106
126
|
"id_description_especialist": 426,
|
|
107
127
|
"id_description_facilitator": null,
|
|
108
|
-
"id_images_especialist":
|
|
128
|
+
"id_images_especialist": 427,
|
|
109
129
|
"id_images_facilitator": null,
|
|
110
130
|
"id_auditor": 425,
|
|
111
131
|
"id_recepcionist": null,
|
|
112
|
-
"category": "
|
|
132
|
+
"category": "Productos de Higiene Personal|Productos de Higiene Personal|Productos de Higiene Personal",
|
|
113
133
|
"categoryRetailer": [{
|
|
114
|
-
"id_category":
|
|
115
|
-
"id_retailer":
|
|
116
|
-
"category_name": "
|
|
117
|
-
"retailer_name": "
|
|
134
|
+
"id_category": 3561,
|
|
135
|
+
"id_retailer": 29,
|
|
136
|
+
"category_name": "Abarrotes Farmacias del Ahorro|Abarrotes|Abarrotes",
|
|
137
|
+
"retailer_name": "Farmacias del Ahorro"
|
|
118
138
|
}, {
|
|
119
|
-
"id_category":
|
|
120
|
-
"id_retailer":
|
|
121
|
-
"category_name": "
|
|
122
|
-
"retailer_name": "
|
|
139
|
+
"id_category": 4216,
|
|
140
|
+
"id_retailer": 70,
|
|
141
|
+
"category_name": "Limpieza|Cuarto de Lavado|Cuarto de Lavado",
|
|
142
|
+
"retailer_name": "Bodega Aurrera"
|
|
123
143
|
}, {
|
|
124
|
-
"id_category":
|
|
125
|
-
"id_retailer":
|
|
126
|
-
"category_name": "
|
|
127
|
-
"retailer_name": "
|
|
144
|
+
"id_category": 4874,
|
|
145
|
+
"id_retailer": 36,
|
|
146
|
+
"category_name": "Productos de Higiene Personal|Productos de Higiene Personal|Productos de Higiene Personal",
|
|
147
|
+
"retailer_name": "Oxxo"
|
|
128
148
|
}, {
|
|
129
|
-
"id_category":
|
|
130
|
-
"id_retailer":
|
|
131
|
-
"category_name": "
|
|
132
|
-
"retailer_name": "
|
|
149
|
+
"id_category": 4941,
|
|
150
|
+
"id_retailer": 13,
|
|
151
|
+
"category_name": "Supermercado Soriana|Supermercado|Supermercado",
|
|
152
|
+
"retailer_name": "Soriana"
|
|
133
153
|
}]
|
|
134
154
|
},
|
|
135
155
|
"retailers": [{
|
|
136
|
-
"id":
|
|
137
|
-
"name": "
|
|
156
|
+
"id": 13,
|
|
157
|
+
"name": "Soriana"
|
|
138
158
|
}, {
|
|
139
|
-
"id":
|
|
140
|
-
"name": "
|
|
159
|
+
"id": 29,
|
|
160
|
+
"name": "Farmacias del Ahorro"
|
|
141
161
|
}, {
|
|
142
|
-
"id":
|
|
143
|
-
"name": "
|
|
162
|
+
"id": 36,
|
|
163
|
+
"name": "Oxxo"
|
|
144
164
|
}, {
|
|
145
|
-
"id":
|
|
146
|
-
"name": "
|
|
165
|
+
"id": 70,
|
|
166
|
+
"name": "Bodega Aurrera"
|
|
147
167
|
}],
|
|
148
168
|
"country": "México",
|
|
149
|
-
"upc": "
|
|
169
|
+
"upc": "16168153"
|
|
150
170
|
},
|
|
151
171
|
// location: {
|
|
152
172
|
// product: { articleId: 126855, versionId: 3 },
|
|
@@ -193,42 +213,6 @@ RetailerProductEditionDefault.args = {
|
|
|
193
213
|
// },
|
|
194
214
|
//TEXTOS
|
|
195
215
|
// user: {
|
|
196
|
-
// "id_user": 442,
|
|
197
|
-
// "name": "Especialista",
|
|
198
|
-
// "last_name": "Textos",
|
|
199
|
-
// "email": "especialistatextosdev@allfreemail.net",
|
|
200
|
-
// "position": "Especialista de Imágenes",
|
|
201
|
-
// "telephone": null,
|
|
202
|
-
// "country": null,
|
|
203
|
-
// "id_company": 2,
|
|
204
|
-
// "id_role": 7,
|
|
205
|
-
// "about_me": null,
|
|
206
|
-
// "address": null,
|
|
207
|
-
// "job": null,
|
|
208
|
-
// "id_stripe": null,
|
|
209
|
-
// "active": 1,
|
|
210
|
-
// "email_notify": 1,
|
|
211
|
-
// "id_cognito": "39a90309-81cd-48df-86fb-b22c4a0e0559",
|
|
212
|
-
// "birth_Date": null,
|
|
213
|
-
// "zip_code": null,
|
|
214
|
-
// "is_retailer": 0,
|
|
215
|
-
// "is_onboarding": 0,
|
|
216
|
-
// "is_user_tech": null,
|
|
217
|
-
// "profile_picture_ext": null,
|
|
218
|
-
// "membership": {
|
|
219
|
-
// "id": 2,
|
|
220
|
-
// "start_date": "2021-11-05T02:35:12.000Z",
|
|
221
|
-
// "end_date": "2022-11-05T02:34:49.000Z",
|
|
222
|
-
// "planID": 1,
|
|
223
|
-
// "plan": "prod_KtkvuFFLpOdP6e",
|
|
224
|
-
// "name": "Plan Free",
|
|
225
|
-
// "user_limit": "1",
|
|
226
|
-
// "products_limit": "3",
|
|
227
|
-
// "type": "PyMES"
|
|
228
|
-
// },
|
|
229
|
-
// "src": "https://content-management-profile.s3.amazonaws.com/id-442/442.png?1760636567736"
|
|
230
|
-
// },
|
|
231
|
-
// user: {
|
|
232
216
|
// id_user: 426,
|
|
233
217
|
// name: "Especialista Textos",
|
|
234
218
|
// last_name: null,
|
|
@@ -265,22 +249,22 @@ RetailerProductEditionDefault.args = {
|
|
|
265
249
|
// },
|
|
266
250
|
// AUDITORES
|
|
267
251
|
user: {
|
|
268
|
-
"id_user":
|
|
269
|
-
"name": "
|
|
252
|
+
"id_user": 425,
|
|
253
|
+
"name": "Auditor QA",
|
|
270
254
|
"last_name": null,
|
|
271
|
-
"email": "
|
|
255
|
+
"email": "ladiboh785@mi166.com",
|
|
272
256
|
"position": "Tester",
|
|
273
257
|
"telephone": null,
|
|
274
258
|
"country": null,
|
|
275
259
|
"id_company": 254,
|
|
276
|
-
"id_cognito": "
|
|
260
|
+
"id_cognito": "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
|
|
277
261
|
"birth_Date": null,
|
|
278
262
|
"about_me": null,
|
|
279
263
|
"zip_code": null,
|
|
280
264
|
"address": null,
|
|
281
265
|
"job": null,
|
|
282
266
|
"id_stripe": null,
|
|
283
|
-
"id_role":
|
|
267
|
+
"id_role": 6,
|
|
284
268
|
"active": 1,
|
|
285
269
|
"is_retailer": 0,
|
|
286
270
|
"email_notify": null,
|
|
@@ -297,6 +281,6 @@ RetailerProductEditionDefault.args = {
|
|
|
297
281
|
"products_limit": "1000",
|
|
298
282
|
"type": "Enterprise"
|
|
299
283
|
},
|
|
300
|
-
"src": "https://content-management-profile-prod.s3.amazonaws.com/id-
|
|
284
|
+
"src": "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1778260157973"
|
|
301
285
|
}
|
|
302
286
|
};
|
|
@@ -1235,7 +1235,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1235
1235
|
|
|
1236
1236
|
var sendBulkEvaluation = /*#__PURE__*/function () {
|
|
1237
1237
|
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
|
|
1238
|
-
var _state$services_data3, evaluationArray, conceptArray, status, updatedStatusByRetailer, updatedProduct,
|
|
1238
|
+
var _state$services_data3, evaluationArray, conceptArray, status, updatedStatusByRetailer, updatedProduct, updatedServicesData;
|
|
1239
1239
|
|
|
1240
1240
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1241
1241
|
while (1) {
|
|
@@ -1247,21 +1247,20 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1247
1247
|
});
|
|
1248
1248
|
_context9.prev = 1;
|
|
1249
1249
|
evaluationArray = [];
|
|
1250
|
-
conceptArray = (0, _utils.getConceptsByRole)(user.id_role);
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
var service = ret.service,
|
|
1250
|
+
conceptArray = (0, _utils.getConceptsByRole)(user.id_role);
|
|
1251
|
+
(_state$services_data3 = state.services_data) === null || _state$services_data3 === void 0 ? void 0 : _state$services_data3.forEach(function (ret, idx) {
|
|
1252
|
+
var retailer_service = ret.service,
|
|
1254
1253
|
id_retailer = ret.id_retailer,
|
|
1255
|
-
|
|
1254
|
+
status_retailer_service = ret.status;
|
|
1255
|
+
var lastStatusLevel = status_retailer_service.replace(/.*\//, "");
|
|
1256
1256
|
|
|
1257
|
-
if (conceptArray.includes(
|
|
1258
|
-
var data = {
|
|
1259
|
-
data = {
|
|
1257
|
+
if (conceptArray.includes(retailer_service) && statusArray !== null && statusArray !== void 0 && statusArray.includes(lastStatusLevel)) {
|
|
1258
|
+
var data = {
|
|
1260
1259
|
articleId: state.product.id_article,
|
|
1261
1260
|
orderId: state.product.id_order,
|
|
1262
|
-
concept:
|
|
1261
|
+
concept: retailer_service,
|
|
1263
1262
|
result: result,
|
|
1264
|
-
evalStatus:
|
|
1263
|
+
evalStatus: status_retailer_service,
|
|
1265
1264
|
retailerId: id_retailer
|
|
1266
1265
|
};
|
|
1267
1266
|
evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
@@ -1285,6 +1284,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1285
1284
|
|
|
1286
1285
|
updatedProduct = (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1287
1286
|
article_status: status,
|
|
1287
|
+
status: status,
|
|
1288
1288
|
datasheet_status: state.product.datasheet_status === "NA" ? "NA" : status,
|
|
1289
1289
|
description_status: state.product.description_status === "NA" ? "NA" : status,
|
|
1290
1290
|
images_status: state.product.images_status === "NA" ? "NA" : status,
|
|
@@ -1294,20 +1294,27 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1294
1294
|
type: "SET_PRODUCT",
|
|
1295
1295
|
payload: updatedProduct
|
|
1296
1296
|
});
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
datasheet_status: updatedProduct.datasheet_status,
|
|
1302
|
-
description_status: updatedProduct.description_status,
|
|
1303
|
-
images_status: updatedProduct.images_status
|
|
1297
|
+
updatedServicesData = state.services_data.map(function (service) {
|
|
1298
|
+
return conceptArray.includes(service.service) ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, service), {}, {
|
|
1299
|
+
status: status
|
|
1300
|
+
}) : service;
|
|
1304
1301
|
});
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1302
|
+
dispatch({
|
|
1303
|
+
type: "SET_SERVICES_DATA",
|
|
1304
|
+
payload: updatedServicesData
|
|
1305
|
+
}); // sessionStorage.setItem(
|
|
1306
|
+
// "productSelected",
|
|
1307
|
+
// JSON.stringify(updatedProduct),
|
|
1308
|
+
// );
|
|
1309
|
+
// sessionStorage.setItem(
|
|
1310
|
+
// "productEdit",
|
|
1311
|
+
// JSON.stringify({
|
|
1312
|
+
// ArticleId: updatedProduct.id_article,
|
|
1313
|
+
// idCategory: updatedProduct.id_category,
|
|
1314
|
+
// product: updatedProduct,
|
|
1315
|
+
// }),
|
|
1316
|
+
// );
|
|
1317
|
+
// Mostrar modal de éxito
|
|
1311
1318
|
|
|
1312
1319
|
dispatch({
|
|
1313
1320
|
type: "SET_MODAL",
|
|
@@ -1318,28 +1325,28 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1318
1325
|
image: _genericModalCheck.default
|
|
1319
1326
|
}
|
|
1320
1327
|
});
|
|
1321
|
-
_context9.next =
|
|
1328
|
+
_context9.next = 19;
|
|
1322
1329
|
break;
|
|
1323
1330
|
|
|
1324
|
-
case
|
|
1325
|
-
_context9.prev =
|
|
1331
|
+
case 16:
|
|
1332
|
+
_context9.prev = 16;
|
|
1326
1333
|
_context9.t0 = _context9["catch"](1);
|
|
1327
1334
|
console.error("Error in bulk evaluation:", _context9.t0);
|
|
1328
1335
|
|
|
1329
|
-
case
|
|
1330
|
-
_context9.prev =
|
|
1336
|
+
case 19:
|
|
1337
|
+
_context9.prev = 19;
|
|
1331
1338
|
dispatch({
|
|
1332
1339
|
type: "SET_SAVING",
|
|
1333
1340
|
payload: false
|
|
1334
1341
|
});
|
|
1335
|
-
return _context9.finish(
|
|
1342
|
+
return _context9.finish(19);
|
|
1336
1343
|
|
|
1337
|
-
case
|
|
1344
|
+
case 22:
|
|
1338
1345
|
case "end":
|
|
1339
1346
|
return _context9.stop();
|
|
1340
1347
|
}
|
|
1341
1348
|
}
|
|
1342
|
-
}, _callee9, null, [[1,
|
|
1349
|
+
}, _callee9, null, [[1, 16, 19, 22]]);
|
|
1343
1350
|
}));
|
|
1344
1351
|
|
|
1345
1352
|
return function sendBulkEvaluation(_x3) {
|
|
@@ -1490,7 +1497,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1490
1497
|
var servicesByTab = servicesData === null || servicesData === void 0 ? void 0 : servicesData.filter(function (serv) {
|
|
1491
1498
|
return serv.service === concept;
|
|
1492
1499
|
});
|
|
1493
|
-
var
|
|
1500
|
+
var statusBySelectedRetailerService = servicesByTab === null || servicesByTab === void 0 ? void 0 : (_servicesByTab$find = servicesByTab.find(function (serv) {
|
|
1494
1501
|
return serv.id_retailer === (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id_retailer);
|
|
1495
1502
|
})) === null || _servicesByTab$find === void 0 ? void 0 : (_servicesByTab$find$s = _servicesByTab$find.status) === null || _servicesByTab$find$s === void 0 ? void 0 : _servicesByTab$find$s.replace(/.*\//, "");
|
|
1496
1503
|
var currentProducStatus = product === null || product === void 0 ? void 0 : (_product$ = product["".concat(concept, "_status")]) === null || _product$ === void 0 ? void 0 : _product$.replace(/.*\//, "");
|
|
@@ -1501,14 +1508,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1501
1508
|
switch (id_rol) {
|
|
1502
1509
|
case 7:
|
|
1503
1510
|
case 8:
|
|
1504
|
-
var
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1511
|
+
var canSendEvaluation = statusArray.includes(statusBySelectedRetailerService); // const conditionTwo = statusArray.includes(product?.status);
|
|
1512
|
+
// const conditionThree =
|
|
1513
|
+
// servicesByTab.filter((service) =>
|
|
1514
|
+
// statusArray.includes(service.status?.replace(/.*\//, "")),
|
|
1515
|
+
// ).length === servicesByTab.length;
|
|
1516
|
+
// return (canSendEvaluation && conditionTwo) || conditionThree;
|
|
1508
1517
|
|
|
1509
|
-
|
|
1510
|
-
}).length === servicesByTab.length;
|
|
1511
|
-
return conditionOne && conditionTwo || conditionThree;
|
|
1518
|
+
return canSendEvaluation;
|
|
1512
1519
|
|
|
1513
1520
|
case 4:
|
|
1514
1521
|
case 5:
|
|
@@ -1961,6 +1968,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1961
1968
|
canAssign: ![7, 8].includes(user.id_role)
|
|
1962
1969
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1963
1970
|
className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
|
|
1971
|
+
id: "services-information-container",
|
|
1964
1972
|
children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
1965
1973
|
children: [state.active_tab === "Descripción" && (((_state$product9 = state.product) === null || _state$product9 === void 0 ? void 0 : _state$product9.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
1966
1974
|
activeSection: state.active_tab,
|
package/package.json
CHANGED
|
@@ -175,14 +175,14 @@ export const GeneralInput = ({
|
|
|
175
175
|
);
|
|
176
176
|
}, [textValue]);
|
|
177
177
|
|
|
178
|
-
const numberInputOnWheelPreventChange = (e) => {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
};
|
|
178
|
+
// const numberInputOnWheelPreventChange = (e) => {
|
|
179
|
+
// // Prevent the input value change
|
|
180
|
+
// e.target.blur();
|
|
181
|
+
// // Prevent the page/container scrolling
|
|
182
|
+
// e.stopPropagation();
|
|
183
|
+
// // Refocus immediately, on the next tick (after the current function is done)
|
|
184
|
+
// setTimeout(() => e.target.focus(), 0);
|
|
185
|
+
// };
|
|
186
186
|
|
|
187
187
|
//AI Generation
|
|
188
188
|
|
|
@@ -237,7 +237,7 @@ export const GeneralInput = ({
|
|
|
237
237
|
maxLength={maxChar}
|
|
238
238
|
required={isRequired}
|
|
239
239
|
onKeyDown={onKeyDown}
|
|
240
|
-
onWheel={numberInputOnWheelPreventChange}
|
|
240
|
+
// onWheel={numberInputOnWheelPreventChange}
|
|
241
241
|
/>
|
|
242
242
|
{
|
|
243
243
|
|
|
@@ -383,7 +383,7 @@ const ChangeStatusModal = ({
|
|
|
383
383
|
<Section>
|
|
384
384
|
<SectionTitle>Estatus actual:</SectionTitle>
|
|
385
385
|
<StatusPill
|
|
386
|
-
label={currentStatusObj
|
|
386
|
+
label={currentStatusObj?.name}
|
|
387
387
|
selected={false}
|
|
388
388
|
disabled={true}
|
|
389
389
|
/>
|
|
@@ -396,10 +396,10 @@ const ChangeStatusModal = ({
|
|
|
396
396
|
<StatusPill
|
|
397
397
|
key={status.name}
|
|
398
398
|
label={status.name}
|
|
399
|
-
disabled={status.name === currentStatusObj
|
|
399
|
+
disabled={status.name === currentStatusObj?.name}
|
|
400
400
|
selected={status.name === newStatus}
|
|
401
401
|
onClick={() =>
|
|
402
|
-
status.name !== currentStatusObj
|
|
402
|
+
status.name !== currentStatusObj?.name &&
|
|
403
403
|
setNewStatus(status.name)
|
|
404
404
|
}
|
|
405
405
|
/>
|
|
@@ -431,7 +431,7 @@ const ChangeStatusModal = ({
|
|
|
431
431
|
<span className="summary-title">Resumen de impacto:</span>
|
|
432
432
|
<div className="status-flow">
|
|
433
433
|
<StatusPill
|
|
434
|
-
label={currentStatusObj
|
|
434
|
+
label={currentStatusObj?.name}
|
|
435
435
|
selected={false}
|
|
436
436
|
disabled={true}
|
|
437
437
|
size="small"
|
|
@@ -18,140 +18,165 @@ RetailerProductEditionDefault.args = {
|
|
|
18
18
|
token:
|
|
19
19
|
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI4ZDAxMDIxNC01YmZhLTQzYzMtOTZmYi1jNTU2ZGMwNTc3NGIiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjhkMDEwMjE0LTViZmEtNDNjMy05NmZiLWM1NTZkYzA1Nzc0YiIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI1MDgwMTVmMy1mZGVkLTQ2ODUtYTIxNy1mYzgyMTg0ZWRmNGMiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTc2ODI1MzE3NywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTc2ODI1Njc3NywiaWF0IjoxNzY4MjUzMTc3LCJlbWFpbCI6ImthcmFmZTMyMThAbW9tMmtpZC5jb20ifQ.QiZiscuTvrur0g328Zmh2bI-kZyg7YO_T5jT63096JNuSxGnX9wpK87cVTV1dED4ruD-2NMsgLShUIMcklAg17FL6i5_vCuB1dSIDY0LaybvSpriFJaVVdMUIMGFi_1Q7bI9qqyXYkevcf-HO33vVPdU-_-4-u8YRd-QganUk35vPYPh9vFJWbC0Qtvv25ZR4L2xuRIXx4e7StlTvZXysnYL8A84jkK1zn6d77V-9GqQQW8exO6sBW7R6cGt55vnF80NIfG_9lAqCK0PcZH4o50aqrAVhtfV5edlEmXBHeGK5R3Sz5iTeKb51QF3TWVFZCYGvQJ7FShulUWHcm3X2Q",
|
|
20
20
|
productSelected: {
|
|
21
|
-
"articleId":
|
|
21
|
+
"articleId": 145210,
|
|
22
22
|
"services": {
|
|
23
23
|
"datasheets": 1,
|
|
24
24
|
"descriptions": 1,
|
|
25
|
-
"images":
|
|
25
|
+
"images": 1
|
|
26
26
|
},
|
|
27
|
-
"orderId":
|
|
27
|
+
"orderId": 10459,
|
|
28
28
|
"city": "CDMX, México",
|
|
29
|
-
"status": "
|
|
30
|
-
"datasheet_status": "
|
|
29
|
+
"status": "AC",
|
|
30
|
+
"datasheet_status": "AC",
|
|
31
31
|
"prio": "none",
|
|
32
32
|
"version": 3,
|
|
33
|
-
"description_status": "
|
|
34
|
-
"images_status": "
|
|
33
|
+
"description_status": "AC",
|
|
34
|
+
"images_status": "AC",
|
|
35
35
|
"statusByRetailer": [
|
|
36
36
|
{
|
|
37
|
-
"status": "
|
|
37
|
+
"status": "AC",
|
|
38
38
|
"service": "datasheet",
|
|
39
|
-
"retailer_id":
|
|
40
|
-
"task_user_group_id":
|
|
39
|
+
"retailer_id": 13,
|
|
40
|
+
"task_user_group_id": 4
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
"status": "
|
|
43
|
+
"status": "AC",
|
|
44
44
|
"service": "description",
|
|
45
|
-
"retailer_id":
|
|
46
|
-
"task_user_group_id":
|
|
45
|
+
"retailer_id": 13,
|
|
46
|
+
"task_user_group_id": 4
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
"status": "
|
|
49
|
+
"status": "AC",
|
|
50
|
+
"service": "images",
|
|
51
|
+
"retailer_id": 13,
|
|
52
|
+
"task_user_group_id": 4
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"status": "AC",
|
|
50
56
|
"service": "datasheet",
|
|
51
|
-
"retailer_id":
|
|
52
|
-
"task_user_group_id":
|
|
57
|
+
"retailer_id": 29,
|
|
58
|
+
"task_user_group_id": 4
|
|
53
59
|
},
|
|
54
60
|
{
|
|
55
|
-
"status": "
|
|
61
|
+
"status": "AC",
|
|
56
62
|
"service": "description",
|
|
57
|
-
"retailer_id":
|
|
58
|
-
"task_user_group_id":
|
|
63
|
+
"retailer_id": 29,
|
|
64
|
+
"task_user_group_id": 4
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"status": "AC",
|
|
68
|
+
"service": "images",
|
|
69
|
+
"retailer_id": 29,
|
|
70
|
+
"task_user_group_id": 4
|
|
59
71
|
},
|
|
60
72
|
{
|
|
61
|
-
"status": "
|
|
73
|
+
"status": "AC",
|
|
62
74
|
"service": "datasheet",
|
|
63
|
-
"retailer_id":
|
|
64
|
-
"task_user_group_id":
|
|
75
|
+
"retailer_id": 36,
|
|
76
|
+
"task_user_group_id": 4
|
|
65
77
|
},
|
|
66
78
|
{
|
|
67
|
-
"status": "
|
|
79
|
+
"status": "AC",
|
|
68
80
|
"service": "description",
|
|
69
|
-
"retailer_id":
|
|
70
|
-
"task_user_group_id":
|
|
81
|
+
"retailer_id": 36,
|
|
82
|
+
"task_user_group_id": 4
|
|
71
83
|
},
|
|
72
84
|
{
|
|
73
|
-
"status": "
|
|
85
|
+
"status": "AC",
|
|
86
|
+
"service": "images",
|
|
87
|
+
"retailer_id": 36,
|
|
88
|
+
"task_user_group_id": 4
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"status": "AC",
|
|
74
92
|
"service": "datasheet",
|
|
75
|
-
"retailer_id":
|
|
76
|
-
"task_user_group_id":
|
|
93
|
+
"retailer_id": 70,
|
|
94
|
+
"task_user_group_id": 4
|
|
77
95
|
},
|
|
78
96
|
{
|
|
79
|
-
"status": "
|
|
97
|
+
"status": "AC",
|
|
80
98
|
"service": "description",
|
|
81
|
-
"retailer_id":
|
|
82
|
-
"task_user_group_id":
|
|
99
|
+
"retailer_id": 70,
|
|
100
|
+
"task_user_group_id": 4
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"status": "AC",
|
|
104
|
+
"service": "images",
|
|
105
|
+
"retailer_id": 70,
|
|
106
|
+
"task_user_group_id": 4
|
|
83
107
|
}
|
|
84
108
|
],
|
|
85
109
|
"article": {
|
|
86
|
-
"id_article":
|
|
87
|
-
"id_category": "
|
|
88
|
-
"brand":
|
|
89
|
-
"name": "Serna Status Bug
|
|
90
|
-
"upc": "
|
|
91
|
-
"sku": "
|
|
92
|
-
"timestamp": "2026-05-
|
|
110
|
+
"id_article": 145210,
|
|
111
|
+
"id_category": "4874",
|
|
112
|
+
"brand": "Generico",
|
|
113
|
+
"name": "Serna Status Bug 7",
|
|
114
|
+
"upc": "16168153",
|
|
115
|
+
"sku": "15631130151",
|
|
116
|
+
"timestamp": "2026-05-07T16:00:51.000Z",
|
|
93
117
|
"active": 1,
|
|
94
118
|
"company_id": 291,
|
|
95
119
|
"company_name": "LATAM LOGISTICS",
|
|
96
120
|
"country": "México",
|
|
97
|
-
"id_order":
|
|
121
|
+
"id_order": 10459,
|
|
98
122
|
"id_datasheet_especialist": 426,
|
|
99
123
|
"id_datasheet_facilitator": null,
|
|
100
124
|
"id_description_especialist": 426,
|
|
101
125
|
"id_description_facilitator": null,
|
|
102
|
-
"id_images_especialist":
|
|
126
|
+
"id_images_especialist": 427,
|
|
103
127
|
"id_images_facilitator": null,
|
|
104
128
|
"id_auditor": 425,
|
|
105
129
|
"id_recepcionist": null,
|
|
106
|
-
"category": "
|
|
130
|
+
"category": "Productos de Higiene Personal|Productos de Higiene Personal|Productos de Higiene Personal",
|
|
107
131
|
"categoryRetailer": [
|
|
108
132
|
{
|
|
109
|
-
"id_category":
|
|
110
|
-
"id_retailer":
|
|
111
|
-
"category_name": "
|
|
112
|
-
"retailer_name": "
|
|
133
|
+
"id_category": 3561,
|
|
134
|
+
"id_retailer": 29,
|
|
135
|
+
"category_name": "Abarrotes Farmacias del Ahorro|Abarrotes|Abarrotes",
|
|
136
|
+
"retailer_name": "Farmacias del Ahorro"
|
|
113
137
|
},
|
|
114
138
|
{
|
|
115
|
-
"id_category":
|
|
116
|
-
"id_retailer":
|
|
117
|
-
"category_name": "
|
|
118
|
-
"retailer_name": "
|
|
139
|
+
"id_category": 4216,
|
|
140
|
+
"id_retailer": 70,
|
|
141
|
+
"category_name": "Limpieza|Cuarto de Lavado|Cuarto de Lavado",
|
|
142
|
+
"retailer_name": "Bodega Aurrera"
|
|
119
143
|
},
|
|
120
144
|
{
|
|
121
|
-
"id_category":
|
|
122
|
-
"id_retailer":
|
|
123
|
-
"category_name": "
|
|
124
|
-
"retailer_name": "
|
|
145
|
+
"id_category": 4874,
|
|
146
|
+
"id_retailer": 36,
|
|
147
|
+
"category_name": "Productos de Higiene Personal|Productos de Higiene Personal|Productos de Higiene Personal",
|
|
148
|
+
"retailer_name": "Oxxo"
|
|
125
149
|
},
|
|
126
150
|
{
|
|
127
|
-
"id_category":
|
|
128
|
-
"id_retailer":
|
|
129
|
-
"category_name": "
|
|
130
|
-
"retailer_name": "
|
|
151
|
+
"id_category": 4941,
|
|
152
|
+
"id_retailer": 13,
|
|
153
|
+
"category_name": "Supermercado Soriana|Supermercado|Supermercado",
|
|
154
|
+
"retailer_name": "Soriana"
|
|
131
155
|
}
|
|
132
156
|
]
|
|
133
157
|
},
|
|
134
158
|
"retailers": [
|
|
135
159
|
{
|
|
136
|
-
"id":
|
|
137
|
-
"name": "
|
|
160
|
+
"id": 13,
|
|
161
|
+
"name": "Soriana"
|
|
138
162
|
},
|
|
139
163
|
{
|
|
140
|
-
"id":
|
|
141
|
-
"name": "
|
|
164
|
+
"id": 29,
|
|
165
|
+
"name": "Farmacias del Ahorro"
|
|
142
166
|
},
|
|
143
167
|
{
|
|
144
|
-
"id":
|
|
145
|
-
"name": "
|
|
168
|
+
"id": 36,
|
|
169
|
+
"name": "Oxxo"
|
|
146
170
|
},
|
|
147
171
|
{
|
|
148
|
-
"id":
|
|
149
|
-
"name": "
|
|
172
|
+
"id": 70,
|
|
173
|
+
"name": "Bodega Aurrera"
|
|
150
174
|
}
|
|
151
175
|
],
|
|
152
176
|
"country": "México",
|
|
153
|
-
"upc": "
|
|
154
|
-
},
|
|
177
|
+
"upc": "16168153"
|
|
178
|
+
},
|
|
179
|
+
|
|
155
180
|
|
|
156
181
|
// location: {
|
|
157
182
|
// product: { articleId: 126855, versionId: 3 },
|
|
@@ -201,43 +226,6 @@ RetailerProductEditionDefault.args = {
|
|
|
201
226
|
|
|
202
227
|
//TEXTOS
|
|
203
228
|
|
|
204
|
-
// user: {
|
|
205
|
-
// "id_user": 442,
|
|
206
|
-
// "name": "Especialista",
|
|
207
|
-
// "last_name": "Textos",
|
|
208
|
-
// "email": "especialistatextosdev@allfreemail.net",
|
|
209
|
-
// "position": "Especialista de Imágenes",
|
|
210
|
-
// "telephone": null,
|
|
211
|
-
// "country": null,
|
|
212
|
-
// "id_company": 2,
|
|
213
|
-
// "id_role": 7,
|
|
214
|
-
// "about_me": null,
|
|
215
|
-
// "address": null,
|
|
216
|
-
// "job": null,
|
|
217
|
-
// "id_stripe": null,
|
|
218
|
-
// "active": 1,
|
|
219
|
-
// "email_notify": 1,
|
|
220
|
-
// "id_cognito": "39a90309-81cd-48df-86fb-b22c4a0e0559",
|
|
221
|
-
// "birth_Date": null,
|
|
222
|
-
// "zip_code": null,
|
|
223
|
-
// "is_retailer": 0,
|
|
224
|
-
// "is_onboarding": 0,
|
|
225
|
-
// "is_user_tech": null,
|
|
226
|
-
// "profile_picture_ext": null,
|
|
227
|
-
// "membership": {
|
|
228
|
-
// "id": 2,
|
|
229
|
-
// "start_date": "2021-11-05T02:35:12.000Z",
|
|
230
|
-
// "end_date": "2022-11-05T02:34:49.000Z",
|
|
231
|
-
// "planID": 1,
|
|
232
|
-
// "plan": "prod_KtkvuFFLpOdP6e",
|
|
233
|
-
// "name": "Plan Free",
|
|
234
|
-
// "user_limit": "1",
|
|
235
|
-
// "products_limit": "3",
|
|
236
|
-
// "type": "PyMES"
|
|
237
|
-
// },
|
|
238
|
-
// "src": "https://content-management-profile.s3.amazonaws.com/id-442/442.png?1760636567736"
|
|
239
|
-
// },
|
|
240
|
-
|
|
241
229
|
// user: {
|
|
242
230
|
// id_user: 426,
|
|
243
231
|
// name: "Especialista Textos",
|
|
@@ -277,22 +265,22 @@ RetailerProductEditionDefault.args = {
|
|
|
277
265
|
// AUDITORES
|
|
278
266
|
|
|
279
267
|
user: {
|
|
280
|
-
"id_user":
|
|
281
|
-
"name": "
|
|
268
|
+
"id_user": 425,
|
|
269
|
+
"name": "Auditor QA",
|
|
282
270
|
"last_name": null,
|
|
283
|
-
"email": "
|
|
271
|
+
"email": "ladiboh785@mi166.com",
|
|
284
272
|
"position": "Tester",
|
|
285
273
|
"telephone": null,
|
|
286
274
|
"country": null,
|
|
287
275
|
"id_company": 254,
|
|
288
|
-
"id_cognito": "
|
|
276
|
+
"id_cognito": "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
|
|
289
277
|
"birth_Date": null,
|
|
290
278
|
"about_me": null,
|
|
291
279
|
"zip_code": null,
|
|
292
280
|
"address": null,
|
|
293
281
|
"job": null,
|
|
294
282
|
"id_stripe": null,
|
|
295
|
-
"id_role":
|
|
283
|
+
"id_role": 6,
|
|
296
284
|
"active": 1,
|
|
297
285
|
"is_retailer": 0,
|
|
298
286
|
"email_notify": null,
|
|
@@ -309,7 +297,7 @@ user: {
|
|
|
309
297
|
"products_limit": "1000",
|
|
310
298
|
"type": "Enterprise"
|
|
311
299
|
},
|
|
312
|
-
"src": "https://content-management-profile-prod.s3.amazonaws.com/id-
|
|
300
|
+
"src": "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1778260157973"
|
|
313
301
|
}
|
|
314
302
|
|
|
315
303
|
};
|
|
@@ -898,21 +898,24 @@ const RetailerProductEditionView = ({
|
|
|
898
898
|
dispatch({ type: "SET_SAVING", payload: true });
|
|
899
899
|
try {
|
|
900
900
|
const evaluationArray = [];
|
|
901
|
+
|
|
901
902
|
const conceptArray = getConceptsByRole(user.id_role);
|
|
902
903
|
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
904
|
+
state.services_data?.forEach((ret, idx) => {
|
|
905
|
+
const { service: retailer_service, id_retailer, status: status_retailer_service } = ret;
|
|
906
|
+
|
|
907
|
+
const lastStatusLevel = status_retailer_service.replace(/.*\//, "");
|
|
908
|
+
|
|
909
|
+
if (conceptArray.includes(retailer_service) && statusArray?.includes(lastStatusLevel)) {
|
|
910
|
+
const data = {
|
|
909
911
|
articleId: state.product.id_article,
|
|
910
912
|
orderId: state.product.id_order,
|
|
911
|
-
concept:
|
|
913
|
+
concept: retailer_service,
|
|
912
914
|
result,
|
|
913
|
-
evalStatus:
|
|
915
|
+
evalStatus: status_retailer_service,
|
|
914
916
|
retailerId: id_retailer,
|
|
915
917
|
};
|
|
918
|
+
|
|
916
919
|
evaluationArray.push(
|
|
917
920
|
axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
918
921
|
headers: {
|
|
@@ -922,6 +925,7 @@ const RetailerProductEditionView = ({
|
|
|
922
925
|
);
|
|
923
926
|
}
|
|
924
927
|
});
|
|
928
|
+
|
|
925
929
|
await Promise.all(evaluationArray);
|
|
926
930
|
|
|
927
931
|
const status = `${result}A`;
|
|
@@ -936,6 +940,7 @@ const RetailerProductEditionView = ({
|
|
|
936
940
|
const updatedProduct = {
|
|
937
941
|
...state.product,
|
|
938
942
|
article_status: status,
|
|
943
|
+
status: status,
|
|
939
944
|
datasheet_status:
|
|
940
945
|
state.product.datasheet_status === "NA" ? "NA" : status,
|
|
941
946
|
description_status:
|
|
@@ -949,30 +954,25 @@ const RetailerProductEditionView = ({
|
|
|
949
954
|
payload: updatedProduct,
|
|
950
955
|
});
|
|
951
956
|
|
|
952
|
-
const
|
|
953
|
-
sessionStorage.getItem("productSelected"),
|
|
954
|
-
);
|
|
957
|
+
const updatedServicesData = state.services_data.map(service => conceptArray.includes(service.service) ? { ...service, status: status } : service);
|
|
955
958
|
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
product: updatedProduct,
|
|
974
|
-
}),
|
|
975
|
-
);
|
|
959
|
+
dispatch({
|
|
960
|
+
type: "SET_SERVICES_DATA",
|
|
961
|
+
payload: updatedServicesData,
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
// sessionStorage.setItem(
|
|
965
|
+
// "productSelected",
|
|
966
|
+
// JSON.stringify(updatedProduct),
|
|
967
|
+
// );
|
|
968
|
+
// sessionStorage.setItem(
|
|
969
|
+
// "productEdit",
|
|
970
|
+
// JSON.stringify({
|
|
971
|
+
// ArticleId: updatedProduct.id_article,
|
|
972
|
+
// idCategory: updatedProduct.id_category,
|
|
973
|
+
// product: updatedProduct,
|
|
974
|
+
// }),
|
|
975
|
+
// );
|
|
976
976
|
|
|
977
977
|
// Mostrar modal de éxito
|
|
978
978
|
dispatch({
|
|
@@ -1097,7 +1097,7 @@ const RetailerProductEditionView = ({
|
|
|
1097
1097
|
(serv) => serv.service === concept,
|
|
1098
1098
|
);
|
|
1099
1099
|
|
|
1100
|
-
const
|
|
1100
|
+
const statusBySelectedRetailerService = servicesByTab
|
|
1101
1101
|
?.find((serv) => serv.id_retailer === activeRetailer?.id_retailer)
|
|
1102
1102
|
?.status?.replace(/.*\//, "");
|
|
1103
1103
|
|
|
@@ -1116,14 +1116,18 @@ const RetailerProductEditionView = ({
|
|
|
1116
1116
|
case 7:
|
|
1117
1117
|
case 8:
|
|
1118
1118
|
|
|
1119
|
-
const
|
|
1120
|
-
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1119
|
+
const canSendEvaluation = statusArray.includes(statusBySelectedRetailerService);
|
|
1120
|
+
|
|
1121
|
+
// const conditionTwo = statusArray.includes(product?.status);
|
|
1122
|
+
|
|
1123
|
+
// const conditionThree =
|
|
1124
|
+
// servicesByTab.filter((service) =>
|
|
1125
|
+
// statusArray.includes(service.status?.replace(/.*\//, "")),
|
|
1126
|
+
// ).length === servicesByTab.length;
|
|
1127
|
+
|
|
1128
|
+
// return (canSendEvaluation && conditionTwo) || conditionThree;
|
|
1125
1129
|
|
|
1126
|
-
return
|
|
1130
|
+
return canSendEvaluation;
|
|
1127
1131
|
|
|
1128
1132
|
case 4:
|
|
1129
1133
|
case 5:
|
|
@@ -1568,6 +1572,7 @@ const RetailerProductEditionView = ({
|
|
|
1568
1572
|
? "image-services"
|
|
1569
1573
|
: "")
|
|
1570
1574
|
}
|
|
1575
|
+
id="services-information-container"
|
|
1571
1576
|
>
|
|
1572
1577
|
{state.saving ? (
|
|
1573
1578
|
<Loading />
|