contentoh-components-library 21.5.88 → 21.5.90
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/RetailerProductEdition/RetailerProductEdition.stories.js +135 -168
- package/dist/components/pages/RetailerProductEdition/index.js +28 -24
- package/package.json +1 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +144 -181
- package/src/components/pages/RetailerProductEdition/index.js +16 -11
|
@@ -33,102 +33,52 @@ 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
|
-
"
|
|
36
|
+
"orderId": 10458,
|
|
37
|
+
"status": "RA",
|
|
38
|
+
"datasheet_status": "AA",
|
|
39
|
+
"prio": "none",
|
|
40
|
+
"version": 3,
|
|
41
|
+
"description_status": "RA",
|
|
42
|
+
"images_status": "RA",
|
|
43
|
+
"brand": "Generico",
|
|
44
|
+
"retailerOrder": 0,
|
|
45
|
+
"missing": {
|
|
46
|
+
"datasheet": null,
|
|
47
|
+
"descriptions": null,
|
|
48
|
+
"images": null
|
|
49
|
+
},
|
|
37
50
|
"services": {
|
|
38
51
|
"datasheets": 1,
|
|
39
52
|
"descriptions": 1,
|
|
40
|
-
"images":
|
|
53
|
+
"images": 1
|
|
41
54
|
},
|
|
42
|
-
"orderId": 10457,
|
|
43
|
-
"city": "CDMX, México",
|
|
44
|
-
"status": "AS",
|
|
45
|
-
"datasheet_status": "AS",
|
|
46
|
-
"prio": "none",
|
|
47
|
-
"version": 3,
|
|
48
|
-
"description_status": "AS",
|
|
49
|
-
"images_status": "NS",
|
|
50
|
-
"statusByRetailer": [{
|
|
51
|
-
"status": "AS",
|
|
52
|
-
"service": "datasheet",
|
|
53
|
-
"retailer_id": 9,
|
|
54
|
-
"task_user_group_id": 2
|
|
55
|
-
}, {
|
|
56
|
-
"status": "AS",
|
|
57
|
-
"service": "description",
|
|
58
|
-
"retailer_id": 9,
|
|
59
|
-
"task_user_group_id": 2
|
|
60
|
-
}, {
|
|
61
|
-
"status": "AS",
|
|
62
|
-
"service": "datasheet",
|
|
63
|
-
"retailer_id": 19,
|
|
64
|
-
"task_user_group_id": 2
|
|
65
|
-
}, {
|
|
66
|
-
"status": "AS",
|
|
67
|
-
"service": "description",
|
|
68
|
-
"retailer_id": 19,
|
|
69
|
-
"task_user_group_id": 2
|
|
70
|
-
}, {
|
|
71
|
-
"status": "AS",
|
|
72
|
-
"service": "datasheet",
|
|
73
|
-
"retailer_id": 24,
|
|
74
|
-
"task_user_group_id": 2
|
|
75
|
-
}, {
|
|
76
|
-
"status": "AS",
|
|
77
|
-
"service": "description",
|
|
78
|
-
"retailer_id": 24,
|
|
79
|
-
"task_user_group_id": 2
|
|
80
|
-
}, {
|
|
81
|
-
"status": "AS",
|
|
82
|
-
"service": "datasheet",
|
|
83
|
-
"retailer_id": 1011,
|
|
84
|
-
"task_user_group_id": 2
|
|
85
|
-
}, {
|
|
86
|
-
"status": "AS",
|
|
87
|
-
"service": "description",
|
|
88
|
-
"retailer_id": 1011,
|
|
89
|
-
"task_user_group_id": 2
|
|
90
|
-
}],
|
|
91
55
|
"article": {
|
|
92
|
-
"
|
|
93
|
-
"id_category": "10001",
|
|
94
|
-
"brand": null,
|
|
95
|
-
"name": "Serna Status Bug 4",
|
|
96
|
-
"upc": "14615181351",
|
|
97
|
-
"sku": "156845131",
|
|
98
|
-
"timestamp": "2026-05-05T15:08:54.000Z",
|
|
99
|
-
"active": 1,
|
|
100
|
-
"company_id": 291,
|
|
56
|
+
"category": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
|
|
101
57
|
"company_name": "LATAM LOGISTICS",
|
|
102
58
|
"country": "México",
|
|
103
|
-
"
|
|
59
|
+
"id_category": "6186",
|
|
104
60
|
"id_datasheet_especialist": 426,
|
|
105
61
|
"id_datasheet_facilitator": null,
|
|
106
62
|
"id_description_especialist": 426,
|
|
107
63
|
"id_description_facilitator": null,
|
|
108
|
-
"id_images_especialist":
|
|
64
|
+
"id_images_especialist": 427,
|
|
109
65
|
"id_images_facilitator": null,
|
|
66
|
+
"id_order": 10458,
|
|
67
|
+
"id_article": 145207,
|
|
110
68
|
"id_auditor": 425,
|
|
111
|
-
"
|
|
112
|
-
"
|
|
69
|
+
"name": "Serna Status Bug 5",
|
|
70
|
+
"timestamp": "2026-05-07T15:00:25.000Z",
|
|
71
|
+
"upc": "897654352",
|
|
72
|
+
"sku": "764535242",
|
|
113
73
|
"categoryRetailer": [{
|
|
114
|
-
"id_category":
|
|
115
|
-
"id_retailer":
|
|
116
|
-
"category_name": "Bebés
|
|
117
|
-
"retailer_name": "
|
|
118
|
-
}, {
|
|
119
|
-
"id_category": 3579,
|
|
120
|
-
"id_retailer": 1011,
|
|
121
|
-
"category_name": "Categoría Genérica Farmatodo|Categoría Genérica|Categoría Genérica",
|
|
122
|
-
"retailer_name": "Farmatodo"
|
|
74
|
+
"id_category": 4010,
|
|
75
|
+
"id_retailer": 70,
|
|
76
|
+
"category_name": "Accesorios de Bebés|Cuarto del Bebé Niño|Cuarto del Bebé Niño",
|
|
77
|
+
"retailer_name": "Bodega Aurrera"
|
|
123
78
|
}, {
|
|
124
|
-
"id_category":
|
|
125
|
-
"id_retailer": 19,
|
|
126
|
-
"category_name": "Categoría Generica Costco|Categoría Generica|Categoría Generica",
|
|
127
|
-
"retailer_name": "Costco"
|
|
128
|
-
}, {
|
|
129
|
-
"id_category": 10001,
|
|
79
|
+
"id_category": 6186,
|
|
130
80
|
"id_retailer": 9,
|
|
131
|
-
"category_name": "
|
|
81
|
+
"category_name": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
|
|
132
82
|
"retailer_name": "Amazon"
|
|
133
83
|
}]
|
|
134
84
|
},
|
|
@@ -136,17 +86,34 @@ RetailerProductEditionDefault.args = {
|
|
|
136
86
|
"id": 9,
|
|
137
87
|
"name": "Amazon"
|
|
138
88
|
}, {
|
|
139
|
-
"id":
|
|
140
|
-
"name": "
|
|
89
|
+
"id": 70,
|
|
90
|
+
"name": "Bodega Aurrera"
|
|
91
|
+
}],
|
|
92
|
+
"statusByRetailer": [{
|
|
93
|
+
"status": "AA",
|
|
94
|
+
"service": "datasheet",
|
|
95
|
+
"retailer_id": 9
|
|
141
96
|
}, {
|
|
142
|
-
"
|
|
143
|
-
"
|
|
97
|
+
"status": "AA",
|
|
98
|
+
"service": "description",
|
|
99
|
+
"retailer_id": 9
|
|
144
100
|
}, {
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
101
|
+
"status": "RA/AS",
|
|
102
|
+
"service": "images",
|
|
103
|
+
"retailer_id": 9
|
|
104
|
+
}, {
|
|
105
|
+
"status": "AP",
|
|
106
|
+
"service": "datasheet",
|
|
107
|
+
"retailer_id": 70
|
|
108
|
+
}, {
|
|
109
|
+
"status": "RA/AS",
|
|
110
|
+
"service": "description",
|
|
111
|
+
"retailer_id": 70
|
|
112
|
+
}, {
|
|
113
|
+
"status": "AP",
|
|
114
|
+
"service": "images",
|
|
115
|
+
"retailer_id": 70
|
|
116
|
+
}]
|
|
150
117
|
},
|
|
151
118
|
// location: {
|
|
152
119
|
// product: { articleId: 126855, versionId: 3 },
|
|
@@ -156,23 +123,94 @@ RetailerProductEditionDefault.args = {
|
|
|
156
123
|
// },
|
|
157
124
|
// },
|
|
158
125
|
// EDICION IMAGENES
|
|
126
|
+
user: {
|
|
127
|
+
"id_user": 427,
|
|
128
|
+
"name": "Especialista Edición",
|
|
129
|
+
"last_name": null,
|
|
130
|
+
"email": "kikije1467@mtlcz.com",
|
|
131
|
+
"position": "Tester",
|
|
132
|
+
"telephone": null,
|
|
133
|
+
"country": null,
|
|
134
|
+
"id_company": 254,
|
|
135
|
+
"id_cognito": "c7e5a6a4-2b3f-4d54-af98-9e09a4cbc01e",
|
|
136
|
+
"birth_Date": null,
|
|
137
|
+
"about_me": null,
|
|
138
|
+
"zip_code": null,
|
|
139
|
+
"address": null,
|
|
140
|
+
"job": null,
|
|
141
|
+
"id_stripe": null,
|
|
142
|
+
"id_role": 8,
|
|
143
|
+
"active": 1,
|
|
144
|
+
"is_retailer": 0,
|
|
145
|
+
"email_notify": null,
|
|
146
|
+
"is_user_tech": null,
|
|
147
|
+
"is_onboarding": 0,
|
|
148
|
+
"membership": {
|
|
149
|
+
"id": 750,
|
|
150
|
+
"start_date": "2022-01-07T21:32:54.000Z",
|
|
151
|
+
"end_date": "2023-01-07T21:32:54.000Z",
|
|
152
|
+
"planID": 6,
|
|
153
|
+
"plan": "prod_KvGd6YSTJyR3AP",
|
|
154
|
+
"name": "Plan Small",
|
|
155
|
+
"user_limit": "10",
|
|
156
|
+
"products_limit": "1000",
|
|
157
|
+
"type": "Enterprise"
|
|
158
|
+
},
|
|
159
|
+
"src": "https://content-management-profile-prod.s3.amazonaws.com/id-427/427.png?1775592220312"
|
|
160
|
+
} //TEXTOS
|
|
159
161
|
// user: {
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
+
// id_user: 426,
|
|
163
|
+
// name: "Especialista Textos",
|
|
164
|
+
// last_name: null,
|
|
165
|
+
// email: "karafe3218@mom2kid.com",
|
|
166
|
+
// position: "Tester",
|
|
167
|
+
// telephone: null,
|
|
168
|
+
// country: null,
|
|
169
|
+
// id_company: 254,
|
|
170
|
+
// id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
|
|
171
|
+
// birth_Date: null,
|
|
172
|
+
// about_me: null,
|
|
173
|
+
// zip_code: null,
|
|
174
|
+
// address: null,
|
|
175
|
+
// job: null,
|
|
176
|
+
// id_stripe: null,
|
|
177
|
+
// id_role: 7,
|
|
178
|
+
// active: 1,
|
|
179
|
+
// is_retailer: 0,
|
|
180
|
+
// email_notify: null,
|
|
181
|
+
// is_user_tech: null,
|
|
182
|
+
// is_onboarding: 0,
|
|
183
|
+
// membership: {
|
|
184
|
+
// id: 750,
|
|
185
|
+
// start_date: "2022-01-07T21:32:54.000Z",
|
|
186
|
+
// end_date: "2023-01-07T21:32:54.000Z",
|
|
187
|
+
// planID: 6,
|
|
188
|
+
// plan: "prod_KvGd6YSTJyR3AP",
|
|
189
|
+
// name: "Plan Small",
|
|
190
|
+
// user_limit: "10",
|
|
191
|
+
// products_limit: "1000",
|
|
192
|
+
// type: "Enterprise",
|
|
193
|
+
// },
|
|
194
|
+
// src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1768253179478",
|
|
195
|
+
// },
|
|
196
|
+
// AUDITORES
|
|
197
|
+
// user: {
|
|
198
|
+
// "id_user": 423,
|
|
199
|
+
// "name": "Facilitador Textos",
|
|
162
200
|
// "last_name": null,
|
|
163
|
-
// "email": "
|
|
201
|
+
// "email": "bayadi1538@mnqlm.com",
|
|
164
202
|
// "position": "Tester",
|
|
165
203
|
// "telephone": null,
|
|
166
204
|
// "country": null,
|
|
167
205
|
// "id_company": 254,
|
|
168
|
-
// "id_cognito": "
|
|
206
|
+
// "id_cognito": "0b66a4a9-7790-4034-a30a-c00808962867",
|
|
169
207
|
// "birth_Date": null,
|
|
170
208
|
// "about_me": null,
|
|
171
209
|
// "zip_code": null,
|
|
172
210
|
// "address": null,
|
|
173
211
|
// "job": null,
|
|
174
212
|
// "id_stripe": null,
|
|
175
|
-
// "id_role":
|
|
213
|
+
// "id_role": 4,
|
|
176
214
|
// "active": 1,
|
|
177
215
|
// "is_retailer": 0,
|
|
178
216
|
// "email_notify": null,
|
|
@@ -189,78 +227,7 @@ RetailerProductEditionDefault.args = {
|
|
|
189
227
|
// "products_limit": "1000",
|
|
190
228
|
// "type": "Enterprise"
|
|
191
229
|
// },
|
|
192
|
-
// "src": "https://content-management-profile-prod.s3.amazonaws.com/id-
|
|
193
|
-
// }
|
|
194
|
-
|
|
195
|
-
// 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
|
-
id_user: 426,
|
|
233
|
-
name: "Especialista Textos",
|
|
234
|
-
last_name: null,
|
|
235
|
-
email: "karafe3218@mom2kid.com",
|
|
236
|
-
position: "Tester",
|
|
237
|
-
telephone: null,
|
|
238
|
-
country: null,
|
|
239
|
-
id_company: 254,
|
|
240
|
-
id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
|
|
241
|
-
birth_Date: null,
|
|
242
|
-
about_me: null,
|
|
243
|
-
zip_code: null,
|
|
244
|
-
address: null,
|
|
245
|
-
job: null,
|
|
246
|
-
id_stripe: null,
|
|
247
|
-
id_role: 7,
|
|
248
|
-
active: 1,
|
|
249
|
-
is_retailer: 0,
|
|
250
|
-
email_notify: null,
|
|
251
|
-
is_user_tech: null,
|
|
252
|
-
is_onboarding: 0,
|
|
253
|
-
membership: {
|
|
254
|
-
id: 750,
|
|
255
|
-
start_date: "2022-01-07T21:32:54.000Z",
|
|
256
|
-
end_date: "2023-01-07T21:32:54.000Z",
|
|
257
|
-
planID: 6,
|
|
258
|
-
plan: "prod_KvGd6YSTJyR3AP",
|
|
259
|
-
name: "Plan Small",
|
|
260
|
-
user_limit: "10",
|
|
261
|
-
products_limit: "1000",
|
|
262
|
-
type: "Enterprise"
|
|
263
|
-
},
|
|
264
|
-
src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1768253179478"
|
|
265
|
-
}
|
|
230
|
+
// "src": "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1778003423713"
|
|
231
|
+
// }
|
|
232
|
+
|
|
266
233
|
};
|
|
@@ -96,7 +96,7 @@ var _material = require("@mui/material");
|
|
|
96
96
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
97
97
|
|
|
98
98
|
var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
99
|
-
var _location$state, _location$state2, _state$active_retaile4, _state$active_retaile5, _state$images_values$2, _state$images_values10, _state$images_values11, _state$
|
|
99
|
+
var _location$state, _location$state2, _state$active_retaile4, _state$active_retaile5, _state$images_values$2, _state$images_values10, _state$images_values11, _state$product8, _state$active_retaile6, _state$active_retaile7, _state$active_retaile8, _state$active_retaile9, _state$product9, _state$product10, _state$product11, _state$datasheets_inp, _state$datasheets_inp2, _state$product12, _state$images_values12, _state$comment;
|
|
100
100
|
|
|
101
101
|
var tabsSections = _ref.tabsSections,
|
|
102
102
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -757,10 +757,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
757
757
|
};
|
|
758
758
|
|
|
759
759
|
var isAuditorAssigned = function isAuditorAssigned() {
|
|
760
|
-
|
|
760
|
+
var _state$product5;
|
|
761
|
+
|
|
762
|
+
return ((_state$product5 = state.product) === null || _state$product5 === void 0 ? void 0 : _state$product5.id_auditor) === (user === null || user === void 0 ? void 0 : user.id_user);
|
|
761
763
|
};
|
|
762
764
|
|
|
763
765
|
var isUserAssignedToService = function isUserAssignedToService(tab, rol) {
|
|
766
|
+
var _state$product6;
|
|
767
|
+
|
|
764
768
|
var concept = (0, _utils.getConceptByTab)(state.active_tab);
|
|
765
769
|
var allowedRoles = [1, 4, 5, 6, 7, 8];
|
|
766
770
|
var validUser = allowedRoles.includes(user === null || user === void 0 ? void 0 : user.id_role); // Determinar rol por defecto si no se pasa
|
|
@@ -774,16 +778,16 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
774
778
|
}
|
|
775
779
|
|
|
776
780
|
var isAdmin = user.id_role === 1;
|
|
777
|
-
var idUserAssigned = state.product["id_".concat(concept, "_").concat(rol)];
|
|
781
|
+
var idUserAssigned = (_state$product6 = state.product) === null || _state$product6 === void 0 ? void 0 : _state$product6["id_".concat(concept, "_").concat(rol)];
|
|
778
782
|
var isAssigned = idUserAssigned === user.id_user;
|
|
779
783
|
return isAdmin || isAssigned && validUser;
|
|
780
784
|
};
|
|
781
785
|
|
|
782
786
|
var canShowSingleEvaluationButtons = function canShowSingleEvaluationButtons(action) {
|
|
783
|
-
var _state$services_data$, _state$services_data$2;
|
|
787
|
+
var _state$services_data, _state$services_data$, _state$services_data$2;
|
|
784
788
|
|
|
785
789
|
var concept = (0, _utils.getConceptByTab)(action || state.active_tab);
|
|
786
|
-
var retailerStatus = (_state$services_data
|
|
790
|
+
var retailerStatus = (_state$services_data = state.services_data) === null || _state$services_data === void 0 ? void 0 : (_state$services_data$ = _state$services_data.find(function (srv) {
|
|
787
791
|
var _state$active_retaile2;
|
|
788
792
|
|
|
789
793
|
return srv.id_retailer === ((_state$active_retaile2 = state.active_retailer) === null || _state$active_retaile2 === void 0 ? void 0 : _state$active_retaile2.id_retailer) && srv.service === concept;
|
|
@@ -826,9 +830,9 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
826
830
|
};
|
|
827
831
|
|
|
828
832
|
var handleOnClickSaveImages = function handleOnClickSaveImages() {
|
|
829
|
-
var _state$
|
|
833
|
+
var _state$product7, _state$product7$servi;
|
|
830
834
|
|
|
831
|
-
if (((_state$
|
|
835
|
+
if (((_state$product7 = state.product) === null || _state$product7 === void 0 ? void 0 : (_state$product7$servi = _state$product7.services) === null || _state$product7$servi === void 0 ? void 0 : _state$product7$servi.images) === 1) {
|
|
832
836
|
saveImageAttrs(token);
|
|
833
837
|
}
|
|
834
838
|
};
|
|
@@ -985,7 +989,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
985
989
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(result) {
|
|
986
990
|
var _state$product$id_ord, _state$active_retaile3;
|
|
987
991
|
|
|
988
|
-
var concept, articleId, orderId, sectionStatusKey, evalStatus, retailerId, data, res, message, icon, activeTab, newStatuses, serviceStatus, updatedStatusByRetailer, updatedProduct, specialistDone, _objectSpread2, _state$
|
|
992
|
+
var concept, articleId, orderId, sectionStatusKey, evalStatus, retailerId, data, res, message, icon, activeTab, newStatuses, serviceStatus, updatedStatusByRetailer, updatedProduct, specialistDone, _objectSpread2, _state$services_data2, _JSON$parse2, newStatus, newOrderStatus, newArticleStatus, _updatedProduct, updatedServicesData, sessionProduct, _objectSpread3, productInSession, updatedProductInSession;
|
|
989
993
|
|
|
990
994
|
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
991
995
|
while (1) {
|
|
@@ -1121,7 +1125,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1121
1125
|
return item;
|
|
1122
1126
|
})), _objectSpread2)); //Actualizamos el services_data en el servicio específico del retailer actual
|
|
1123
1127
|
|
|
1124
|
-
updatedServicesData = (_state$
|
|
1128
|
+
updatedServicesData = (_state$services_data2 = state.services_data) === null || _state$services_data2 === void 0 ? void 0 : _state$services_data2.map(function (service) {
|
|
1125
1129
|
return (0, _objectSpread5.default)((0, _objectSpread5.default)({}, service), {}, {
|
|
1126
1130
|
status: (service === null || service === void 0 ? void 0 : service.id_retailer) === retailerId && (service === null || service === void 0 ? void 0 : service.service) === concept ? newStatus : service === null || service === void 0 ? void 0 : service.status
|
|
1127
1131
|
});
|
|
@@ -1231,7 +1235,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1231
1235
|
|
|
1232
1236
|
var sendBulkEvaluation = /*#__PURE__*/function () {
|
|
1233
1237
|
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
|
|
1234
|
-
var _state$
|
|
1238
|
+
var _state$services_data3, evaluationArray, conceptArray, status, updatedStatusByRetailer, updatedProduct, productInSession, updatedProductInSession;
|
|
1235
1239
|
|
|
1236
1240
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1237
1241
|
while (1) {
|
|
@@ -1245,7 +1249,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1245
1249
|
evaluationArray = [];
|
|
1246
1250
|
conceptArray = (0, _utils.getConceptsByRole)(user.id_role); // Crear todas las evaluaciones para cada servicio y retailer
|
|
1247
1251
|
|
|
1248
|
-
(_state$
|
|
1252
|
+
(_state$services_data3 = state.services_data) === null || _state$services_data3 === void 0 ? void 0 : _state$services_data3.forEach(function (ret) {
|
|
1249
1253
|
var service = ret.service,
|
|
1250
1254
|
id_retailer = ret.id_retailer,
|
|
1251
1255
|
status = ret.status;
|
|
@@ -1486,7 +1490,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1486
1490
|
var servicesByTab = servicesData === null || servicesData === void 0 ? void 0 : servicesData.filter(function (serv) {
|
|
1487
1491
|
return serv.service === concept;
|
|
1488
1492
|
});
|
|
1489
|
-
var
|
|
1493
|
+
var statusBySelectedRetailerService = servicesByTab === null || servicesByTab === void 0 ? void 0 : (_servicesByTab$find = servicesByTab.find(function (serv) {
|
|
1490
1494
|
return serv.id_retailer === (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id_retailer);
|
|
1491
1495
|
})) === 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(/.*\//, "");
|
|
1492
1496
|
var currentProducStatus = product === null || product === void 0 ? void 0 : (_product$ = product["".concat(concept, "_status")]) === null || _product$ === void 0 ? void 0 : _product$.replace(/.*\//, "");
|
|
@@ -1497,14 +1501,14 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1497
1501
|
switch (id_rol) {
|
|
1498
1502
|
case 7:
|
|
1499
1503
|
case 8:
|
|
1500
|
-
var
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
+
var canSendEvaluation = statusArray.includes(statusBySelectedRetailerService); // const conditionTwo = statusArray.includes(product?.status);
|
|
1505
|
+
// const conditionThree =
|
|
1506
|
+
// servicesByTab.filter((service) =>
|
|
1507
|
+
// statusArray.includes(service.status?.replace(/.*\//, "")),
|
|
1508
|
+
// ).length === servicesByTab.length;
|
|
1509
|
+
// return (canSendEvaluation && conditionTwo) || conditionThree;
|
|
1504
1510
|
|
|
1505
|
-
|
|
1506
|
-
}).length === servicesByTab.length;
|
|
1507
|
-
return conditionOne && conditionTwo || conditionThree;
|
|
1511
|
+
return canSendEvaluation;
|
|
1508
1512
|
|
|
1509
1513
|
case 4:
|
|
1510
1514
|
case 5:
|
|
@@ -1886,7 +1890,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1886
1890
|
lists: state.images_values || [],
|
|
1887
1891
|
activeImage: (_state$images_values10 = state.images_values) !== null && _state$images_values10 !== void 0 && _state$images_values10.values ? (_state$images_values11 = state.images_values) === null || _state$images_values11 === void 0 ? void 0 : _state$images_values11.values[state.current_image] : {},
|
|
1888
1892
|
assignationsImages: state.collaborator_assignations["Imágenes"],
|
|
1889
|
-
imagesStatus: ((_state$
|
|
1893
|
+
imagesStatus: ((_state$product8 = state.product) === null || _state$product8 === void 0 ? void 0 : _state$product8.images_status) || "-",
|
|
1890
1894
|
retailerSelected: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
|
|
1891
1895
|
isRetailer: isRetailer,
|
|
1892
1896
|
version: state.product.version,
|
|
@@ -1958,11 +1962,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1958
1962
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1959
1963
|
className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
|
|
1960
1964
|
children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
1961
|
-
children: [state.active_tab === "Descripción" && (((_state$
|
|
1965
|
+
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, {
|
|
1962
1966
|
activeSection: state.active_tab,
|
|
1963
1967
|
inputGroup: state.descriptions_inputs[0],
|
|
1964
1968
|
updatedDescriptions: state.updated_descriptions_inputs,
|
|
1965
|
-
articleId: (_state$
|
|
1969
|
+
articleId: (_state$product10 = state.product) === null || _state$product10 === void 0 ? void 0 : _state$product10.id_article,
|
|
1966
1970
|
version: state.product.version,
|
|
1967
1971
|
auditInputGroup: auditDescriptions[0],
|
|
1968
1972
|
setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
|
|
@@ -1971,7 +1975,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1971
1975
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1972
1976
|
text: "No cuentas con este servicio",
|
|
1973
1977
|
headerType: "input-name-header"
|
|
1974
|
-
})), state.active_tab === "Ficha técnica" && (((_state$
|
|
1978
|
+
})), state.active_tab === "Ficha técnica" && (((_state$product11 = state.product) === null || _state$product11 === void 0 ? void 0 : _state$product11.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
1975
1979
|
children: (_state$datasheets_inp = state.datasheets_inputs[0]) === null || _state$datasheets_inp === void 0 ? void 0 : (_state$datasheets_inp2 = _state$datasheets_inp.data) === null || _state$datasheets_inp2 === void 0 ? void 0 : _state$datasheets_inp2.map(function (dataGroup, index) {
|
|
1976
1980
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
1977
1981
|
articleId: state.product.id_article,
|
|
@@ -1988,7 +1992,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1988
1992
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1989
1993
|
text: "No cuentas con este servicio",
|
|
1990
1994
|
headerType: "input-name-header"
|
|
1991
|
-
})), state.active_tab === "Imágenes" && (((_state$
|
|
1995
|
+
})), state.active_tab === "Imágenes" && (((_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
1992
1996
|
children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
|
|
1993
1997
|
checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
|
|
1994
1998
|
,
|
package/package.json
CHANGED
|
@@ -18,115 +18,54 @@ 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
|
-
"
|
|
21
|
+
"orderId": 10458,
|
|
22
|
+
"status": "RA",
|
|
23
|
+
"datasheet_status": "AA",
|
|
24
|
+
"prio": "none",
|
|
25
|
+
"version": 3,
|
|
26
|
+
"description_status": "RA",
|
|
27
|
+
"images_status": "RA",
|
|
28
|
+
"brand": "Generico",
|
|
29
|
+
"retailerOrder": 0,
|
|
30
|
+
"missing": {
|
|
31
|
+
"datasheet": null,
|
|
32
|
+
"descriptions": null,
|
|
33
|
+
"images": null
|
|
34
|
+
},
|
|
22
35
|
"services": {
|
|
23
36
|
"datasheets": 1,
|
|
24
37
|
"descriptions": 1,
|
|
25
|
-
"images":
|
|
38
|
+
"images": 1
|
|
26
39
|
},
|
|
27
|
-
"orderId": 10457,
|
|
28
|
-
"city": "CDMX, México",
|
|
29
|
-
"status": "AS",
|
|
30
|
-
"datasheet_status": "AS",
|
|
31
|
-
"prio": "none",
|
|
32
|
-
"version": 3,
|
|
33
|
-
"description_status": "AS",
|
|
34
|
-
"images_status": "NS",
|
|
35
|
-
"statusByRetailer": [
|
|
36
|
-
{
|
|
37
|
-
"status": "AS",
|
|
38
|
-
"service": "datasheet",
|
|
39
|
-
"retailer_id": 9,
|
|
40
|
-
"task_user_group_id": 2
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"status": "AS",
|
|
44
|
-
"service": "description",
|
|
45
|
-
"retailer_id": 9,
|
|
46
|
-
"task_user_group_id": 2
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"status": "AS",
|
|
50
|
-
"service": "datasheet",
|
|
51
|
-
"retailer_id": 19,
|
|
52
|
-
"task_user_group_id": 2
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"status": "AS",
|
|
56
|
-
"service": "description",
|
|
57
|
-
"retailer_id": 19,
|
|
58
|
-
"task_user_group_id": 2
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"status": "AS",
|
|
62
|
-
"service": "datasheet",
|
|
63
|
-
"retailer_id": 24,
|
|
64
|
-
"task_user_group_id": 2
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"status": "AS",
|
|
68
|
-
"service": "description",
|
|
69
|
-
"retailer_id": 24,
|
|
70
|
-
"task_user_group_id": 2
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"status": "AS",
|
|
74
|
-
"service": "datasheet",
|
|
75
|
-
"retailer_id": 1011,
|
|
76
|
-
"task_user_group_id": 2
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"status": "AS",
|
|
80
|
-
"service": "description",
|
|
81
|
-
"retailer_id": 1011,
|
|
82
|
-
"task_user_group_id": 2
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
40
|
"article": {
|
|
86
|
-
"
|
|
87
|
-
"id_category": "10001",
|
|
88
|
-
"brand": null,
|
|
89
|
-
"name": "Serna Status Bug 4",
|
|
90
|
-
"upc": "14615181351",
|
|
91
|
-
"sku": "156845131",
|
|
92
|
-
"timestamp": "2026-05-05T15:08:54.000Z",
|
|
93
|
-
"active": 1,
|
|
94
|
-
"company_id": 291,
|
|
41
|
+
"category": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
|
|
95
42
|
"company_name": "LATAM LOGISTICS",
|
|
96
43
|
"country": "México",
|
|
97
|
-
"
|
|
44
|
+
"id_category": "6186",
|
|
98
45
|
"id_datasheet_especialist": 426,
|
|
99
46
|
"id_datasheet_facilitator": null,
|
|
100
47
|
"id_description_especialist": 426,
|
|
101
48
|
"id_description_facilitator": null,
|
|
102
|
-
"id_images_especialist":
|
|
49
|
+
"id_images_especialist": 427,
|
|
103
50
|
"id_images_facilitator": null,
|
|
51
|
+
"id_order": 10458,
|
|
52
|
+
"id_article": 145207,
|
|
104
53
|
"id_auditor": 425,
|
|
105
|
-
"
|
|
106
|
-
"
|
|
54
|
+
"name": "Serna Status Bug 5",
|
|
55
|
+
"timestamp": "2026-05-07T15:00:25.000Z",
|
|
56
|
+
"upc": "897654352",
|
|
57
|
+
"sku": "764535242",
|
|
107
58
|
"categoryRetailer": [
|
|
108
59
|
{
|
|
109
|
-
"id_category":
|
|
110
|
-
"id_retailer":
|
|
111
|
-
"category_name": "Bebés
|
|
112
|
-
"retailer_name": "
|
|
60
|
+
"id_category": 4010,
|
|
61
|
+
"id_retailer": 70,
|
|
62
|
+
"category_name": "Accesorios de Bebés|Cuarto del Bebé Niño|Cuarto del Bebé Niño",
|
|
63
|
+
"retailer_name": "Bodega Aurrera"
|
|
113
64
|
},
|
|
114
65
|
{
|
|
115
|
-
"id_category":
|
|
116
|
-
"id_retailer": 1011,
|
|
117
|
-
"category_name": "Categoría Genérica Farmatodo|Categoría Genérica|Categoría Genérica",
|
|
118
|
-
"retailer_name": "Farmatodo"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"id_category": 6795,
|
|
122
|
-
"id_retailer": 19,
|
|
123
|
-
"category_name": "Categoría Generica Costco|Categoría Generica|Categoría Generica",
|
|
124
|
-
"retailer_name": "Costco"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"id_category": 10001,
|
|
66
|
+
"id_category": 6186,
|
|
128
67
|
"id_retailer": 9,
|
|
129
|
-
"category_name": "
|
|
68
|
+
"category_name": "Bebé|Actividad y Entretenimiento|Actividad y Entretenimiento",
|
|
130
69
|
"retailer_name": "Amazon"
|
|
131
70
|
}
|
|
132
71
|
]
|
|
@@ -137,20 +76,42 @@ RetailerProductEditionDefault.args = {
|
|
|
137
76
|
"name": "Amazon"
|
|
138
77
|
},
|
|
139
78
|
{
|
|
140
|
-
"id":
|
|
141
|
-
"name": "
|
|
79
|
+
"id": 70,
|
|
80
|
+
"name": "Bodega Aurrera"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"statusByRetailer": [
|
|
84
|
+
{
|
|
85
|
+
"status": "AA",
|
|
86
|
+
"service": "datasheet",
|
|
87
|
+
"retailer_id": 9
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"status": "AA",
|
|
91
|
+
"service": "description",
|
|
92
|
+
"retailer_id": 9
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"status": "RA/AS",
|
|
96
|
+
"service": "images",
|
|
97
|
+
"retailer_id": 9
|
|
142
98
|
},
|
|
143
99
|
{
|
|
144
|
-
"
|
|
145
|
-
"
|
|
100
|
+
"status": "AP",
|
|
101
|
+
"service": "datasheet",
|
|
102
|
+
"retailer_id": 70
|
|
146
103
|
},
|
|
147
104
|
{
|
|
148
|
-
"
|
|
149
|
-
"
|
|
105
|
+
"status": "RA/AS",
|
|
106
|
+
"service": "description",
|
|
107
|
+
"retailer_id": 70
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"status": "AP",
|
|
111
|
+
"service": "images",
|
|
112
|
+
"retailer_id": 70
|
|
150
113
|
}
|
|
151
|
-
]
|
|
152
|
-
"country": "México",
|
|
153
|
-
"upc": "14615181351"
|
|
114
|
+
]
|
|
154
115
|
},
|
|
155
116
|
|
|
156
117
|
// location: {
|
|
@@ -163,23 +124,99 @@ RetailerProductEditionDefault.args = {
|
|
|
163
124
|
|
|
164
125
|
// EDICION IMAGENES
|
|
165
126
|
|
|
127
|
+
user: {
|
|
128
|
+
"id_user": 427,
|
|
129
|
+
"name": "Especialista Edición",
|
|
130
|
+
"last_name": null,
|
|
131
|
+
"email": "kikije1467@mtlcz.com",
|
|
132
|
+
"position": "Tester",
|
|
133
|
+
"telephone": null,
|
|
134
|
+
"country": null,
|
|
135
|
+
"id_company": 254,
|
|
136
|
+
"id_cognito": "c7e5a6a4-2b3f-4d54-af98-9e09a4cbc01e",
|
|
137
|
+
"birth_Date": null,
|
|
138
|
+
"about_me": null,
|
|
139
|
+
"zip_code": null,
|
|
140
|
+
"address": null,
|
|
141
|
+
"job": null,
|
|
142
|
+
"id_stripe": null,
|
|
143
|
+
"id_role": 8,
|
|
144
|
+
"active": 1,
|
|
145
|
+
"is_retailer": 0,
|
|
146
|
+
"email_notify": null,
|
|
147
|
+
"is_user_tech": null,
|
|
148
|
+
"is_onboarding": 0,
|
|
149
|
+
"membership": {
|
|
150
|
+
"id": 750,
|
|
151
|
+
"start_date": "2022-01-07T21:32:54.000Z",
|
|
152
|
+
"end_date": "2023-01-07T21:32:54.000Z",
|
|
153
|
+
"planID": 6,
|
|
154
|
+
"plan": "prod_KvGd6YSTJyR3AP",
|
|
155
|
+
"name": "Plan Small",
|
|
156
|
+
"user_limit": "10",
|
|
157
|
+
"products_limit": "1000",
|
|
158
|
+
"type": "Enterprise"
|
|
159
|
+
},
|
|
160
|
+
"src": "https://content-management-profile-prod.s3.amazonaws.com/id-427/427.png?1775592220312"
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
//TEXTOS
|
|
164
|
+
|
|
165
|
+
// user: {
|
|
166
|
+
// id_user: 426,
|
|
167
|
+
// name: "Especialista Textos",
|
|
168
|
+
// last_name: null,
|
|
169
|
+
// email: "karafe3218@mom2kid.com",
|
|
170
|
+
// position: "Tester",
|
|
171
|
+
// telephone: null,
|
|
172
|
+
// country: null,
|
|
173
|
+
// id_company: 254,
|
|
174
|
+
// id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
|
|
175
|
+
// birth_Date: null,
|
|
176
|
+
// about_me: null,
|
|
177
|
+
// zip_code: null,
|
|
178
|
+
// address: null,
|
|
179
|
+
// job: null,
|
|
180
|
+
// id_stripe: null,
|
|
181
|
+
// id_role: 7,
|
|
182
|
+
// active: 1,
|
|
183
|
+
// is_retailer: 0,
|
|
184
|
+
// email_notify: null,
|
|
185
|
+
// is_user_tech: null,
|
|
186
|
+
// is_onboarding: 0,
|
|
187
|
+
// membership: {
|
|
188
|
+
// id: 750,
|
|
189
|
+
// start_date: "2022-01-07T21:32:54.000Z",
|
|
190
|
+
// end_date: "2023-01-07T21:32:54.000Z",
|
|
191
|
+
// planID: 6,
|
|
192
|
+
// plan: "prod_KvGd6YSTJyR3AP",
|
|
193
|
+
// name: "Plan Small",
|
|
194
|
+
// user_limit: "10",
|
|
195
|
+
// products_limit: "1000",
|
|
196
|
+
// type: "Enterprise",
|
|
197
|
+
// },
|
|
198
|
+
// src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1768253179478",
|
|
199
|
+
// },
|
|
200
|
+
|
|
201
|
+
// AUDITORES
|
|
202
|
+
|
|
166
203
|
// user: {
|
|
167
|
-
// "id_user":
|
|
168
|
-
// "name": "
|
|
204
|
+
// "id_user": 423,
|
|
205
|
+
// "name": "Facilitador Textos",
|
|
169
206
|
// "last_name": null,
|
|
170
|
-
// "email": "
|
|
207
|
+
// "email": "bayadi1538@mnqlm.com",
|
|
171
208
|
// "position": "Tester",
|
|
172
209
|
// "telephone": null,
|
|
173
210
|
// "country": null,
|
|
174
211
|
// "id_company": 254,
|
|
175
|
-
// "id_cognito": "
|
|
212
|
+
// "id_cognito": "0b66a4a9-7790-4034-a30a-c00808962867",
|
|
176
213
|
// "birth_Date": null,
|
|
177
214
|
// "about_me": null,
|
|
178
215
|
// "zip_code": null,
|
|
179
216
|
// "address": null,
|
|
180
217
|
// "job": null,
|
|
181
218
|
// "id_stripe": null,
|
|
182
|
-
// "id_role":
|
|
219
|
+
// "id_role": 4,
|
|
183
220
|
// "active": 1,
|
|
184
221
|
// "is_retailer": 0,
|
|
185
222
|
// "email_notify": null,
|
|
@@ -196,81 +233,7 @@ RetailerProductEditionDefault.args = {
|
|
|
196
233
|
// "products_limit": "1000",
|
|
197
234
|
// "type": "Enterprise"
|
|
198
235
|
// },
|
|
199
|
-
// "src": "https://content-management-profile-prod.s3.amazonaws.com/id-
|
|
200
|
-
// }
|
|
201
|
-
|
|
202
|
-
//TEXTOS
|
|
203
|
-
|
|
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
|
-
// },
|
|
236
|
+
// "src": "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1778003423713"
|
|
237
|
+
// }
|
|
240
238
|
|
|
241
|
-
user: {
|
|
242
|
-
id_user: 426,
|
|
243
|
-
name: "Especialista Textos",
|
|
244
|
-
last_name: null,
|
|
245
|
-
email: "karafe3218@mom2kid.com",
|
|
246
|
-
position: "Tester",
|
|
247
|
-
telephone: null,
|
|
248
|
-
country: null,
|
|
249
|
-
id_company: 254,
|
|
250
|
-
id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
|
|
251
|
-
birth_Date: null,
|
|
252
|
-
about_me: null,
|
|
253
|
-
zip_code: null,
|
|
254
|
-
address: null,
|
|
255
|
-
job: null,
|
|
256
|
-
id_stripe: null,
|
|
257
|
-
id_role: 7,
|
|
258
|
-
active: 1,
|
|
259
|
-
is_retailer: 0,
|
|
260
|
-
email_notify: null,
|
|
261
|
-
is_user_tech: null,
|
|
262
|
-
is_onboarding: 0,
|
|
263
|
-
membership: {
|
|
264
|
-
id: 750,
|
|
265
|
-
start_date: "2022-01-07T21:32:54.000Z",
|
|
266
|
-
end_date: "2023-01-07T21:32:54.000Z",
|
|
267
|
-
planID: 6,
|
|
268
|
-
plan: "prod_KvGd6YSTJyR3AP",
|
|
269
|
-
name: "Plan Small",
|
|
270
|
-
user_limit: "10",
|
|
271
|
-
products_limit: "1000",
|
|
272
|
-
type: "Enterprise",
|
|
273
|
-
},
|
|
274
|
-
src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1768253179478",
|
|
275
|
-
},
|
|
276
239
|
};
|
|
@@ -526,7 +526,7 @@ const RetailerProductEditionView = ({
|
|
|
526
526
|
};
|
|
527
527
|
|
|
528
528
|
const isAuditorAssigned = () => {
|
|
529
|
-
return state.product
|
|
529
|
+
return state.product?.id_auditor === user?.id_user;
|
|
530
530
|
};
|
|
531
531
|
|
|
532
532
|
const isUserAssignedToService = (tab, rol) => {
|
|
@@ -545,7 +545,7 @@ const RetailerProductEditionView = ({
|
|
|
545
545
|
}
|
|
546
546
|
|
|
547
547
|
const isAdmin = user.id_role === 1;
|
|
548
|
-
const idUserAssigned = state.product[`id_${concept}_${rol}`];
|
|
548
|
+
const idUserAssigned = state.product?.[`id_${concept}_${rol}`];
|
|
549
549
|
const isAssigned = idUserAssigned === user.id_user;
|
|
550
550
|
|
|
551
551
|
return isAdmin || (isAssigned && validUser);
|
|
@@ -555,7 +555,7 @@ const RetailerProductEditionView = ({
|
|
|
555
555
|
let concept = getConceptByTab(action || state.active_tab);
|
|
556
556
|
|
|
557
557
|
const retailerStatus = state.services_data
|
|
558
|
-
|
|
558
|
+
?.find(
|
|
559
559
|
(srv) =>
|
|
560
560
|
srv.id_retailer === state.active_retailer?.id_retailer &&
|
|
561
561
|
srv.service === concept,
|
|
@@ -567,6 +567,7 @@ const RetailerProductEditionView = ({
|
|
|
567
567
|
const adminAuditorCanEvaluate =
|
|
568
568
|
["AC", "RP", "RCA", "SAC"].includes(retailerStatus) &&
|
|
569
569
|
[1, 6].includes(user.id_role);
|
|
570
|
+
|
|
570
571
|
return adminFacilitatorCanEvaluate || adminAuditorCanEvaluate;
|
|
571
572
|
};
|
|
572
573
|
|
|
@@ -1096,7 +1097,7 @@ const RetailerProductEditionView = ({
|
|
|
1096
1097
|
(serv) => serv.service === concept,
|
|
1097
1098
|
);
|
|
1098
1099
|
|
|
1099
|
-
const
|
|
1100
|
+
const statusBySelectedRetailerService = servicesByTab
|
|
1100
1101
|
?.find((serv) => serv.id_retailer === activeRetailer?.id_retailer)
|
|
1101
1102
|
?.status?.replace(/.*\//, "");
|
|
1102
1103
|
|
|
@@ -1115,14 +1116,18 @@ const RetailerProductEditionView = ({
|
|
|
1115
1116
|
case 7:
|
|
1116
1117
|
case 8:
|
|
1117
1118
|
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
const
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
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;
|
|
1124
1129
|
|
|
1125
|
-
return
|
|
1130
|
+
return canSendEvaluation;
|
|
1126
1131
|
|
|
1127
1132
|
case 4:
|
|
1128
1133
|
case 5:
|