contentoh-components-library 21.5.85 → 21.5.86
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/GeneralButton/styles.js +1 -1
- package/dist/components/organisms/ChangeStatusModal/index.js +531 -0
- package/dist/components/organisms/ChangeStatusModal/styles.js +85 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +108 -231
- package/dist/components/pages/RetailerProductEdition/context/reducers/product.js +48 -2
- package/dist/components/pages/RetailerProductEdition/index.js +329 -101
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/global-files/statusDictionary.js +103 -0
- package/package.json +1 -1
- package/src/components/atoms/GeneralButton/styles.js +4 -0
- package/src/components/organisms/ChangeStatusModal/index.jsx +488 -0
- package/src/components/organisms/ChangeStatusModal/styles.js +333 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +107 -259
- package/src/components/pages/RetailerProductEdition/context/reducers/product.js +55 -0
- package/src/components/pages/RetailerProductEdition/index.js +236 -78
- package/src/components/pages/RetailerProductEdition/styles.js +6 -0
- package/src/contexts/AiProductEdition.jsx +1 -0
- package/src/global-files/statusDictionary.js +103 -0
|
@@ -18,231 +18,79 @@ 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": 145186,
|
|
22
22
|
"services": {
|
|
23
23
|
"datasheets": 1,
|
|
24
24
|
"descriptions": 1,
|
|
25
25
|
"images": 1
|
|
26
26
|
},
|
|
27
|
-
"orderId":
|
|
28
|
-
"city": "CDMX",
|
|
29
|
-
"status": "
|
|
30
|
-
"datasheet_status": "
|
|
27
|
+
"orderId": 10449,
|
|
28
|
+
"city": "CDMX, México",
|
|
29
|
+
"status": "AS",
|
|
30
|
+
"datasheet_status": "AC",
|
|
31
31
|
"prio": "none",
|
|
32
|
-
"version":
|
|
33
|
-
"description_status": "
|
|
34
|
-
"images_status": "
|
|
32
|
+
"version": 3,
|
|
33
|
+
"description_status": "AS",
|
|
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": 70,
|
|
40
|
+
"task_user_group_id": 4
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
"status": "
|
|
43
|
+
"status": "AS",
|
|
44
44
|
"service": "description",
|
|
45
|
-
"retailer_id":
|
|
46
|
-
"task_user_group_id":
|
|
45
|
+
"retailer_id": 70,
|
|
46
|
+
"task_user_group_id": 2
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
"status": "
|
|
49
|
+
"status": "AC",
|
|
50
50
|
"service": "images",
|
|
51
|
-
"retailer_id":
|
|
52
|
-
"task_user_group_id":
|
|
51
|
+
"retailer_id": 70,
|
|
52
|
+
"task_user_group_id": 4
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
"article": {
|
|
56
|
-
"id_article":
|
|
57
|
-
"id_category": "
|
|
58
|
-
"brand":
|
|
59
|
-
"name": "
|
|
60
|
-
"upc": "
|
|
61
|
-
"sku":
|
|
62
|
-
"timestamp": "
|
|
56
|
+
"id_article": 145186,
|
|
57
|
+
"id_category": "4007",
|
|
58
|
+
"brand": null,
|
|
59
|
+
"name": "Mayonesa",
|
|
60
|
+
"upc": "098928",
|
|
61
|
+
"sku": "899",
|
|
62
|
+
"timestamp": "2026-04-23T16:02:14.000Z",
|
|
63
63
|
"active": 1,
|
|
64
|
-
"company_id":
|
|
65
|
-
"company_name": "
|
|
64
|
+
"company_id": 291,
|
|
65
|
+
"company_name": "LATAM LOGISTICS",
|
|
66
66
|
"country": "México",
|
|
67
|
-
"id_order":
|
|
67
|
+
"id_order": 10449,
|
|
68
68
|
"id_datasheet_especialist": 426,
|
|
69
69
|
"id_datasheet_facilitator": null,
|
|
70
70
|
"id_description_especialist": 426,
|
|
71
71
|
"id_description_facilitator": null,
|
|
72
|
-
"id_images_especialist":
|
|
72
|
+
"id_images_especialist": 427,
|
|
73
73
|
"id_images_facilitator": null,
|
|
74
|
-
"id_auditor":
|
|
74
|
+
"id_auditor": 425,
|
|
75
75
|
"id_recepcionist": null,
|
|
76
|
-
"category": "
|
|
76
|
+
"category": "Abarrotes Procesados|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
|
|
77
77
|
"categoryRetailer": [
|
|
78
78
|
{
|
|
79
|
-
"id_category":
|
|
80
|
-
"id_retailer":
|
|
81
|
-
"category_name": "
|
|
82
|
-
"retailer_name": "
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"id_category": 3430,
|
|
86
|
-
"id_retailer": 12,
|
|
87
|
-
"category_name": "Departamento General La Comer|Departamento General|Departamento General",
|
|
88
|
-
"retailer_name": "La Comer"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"id_category": 3433,
|
|
92
|
-
"id_retailer": 24,
|
|
93
|
-
"category_name": "Limpieza Del Hogar|Limpieza Del Hogar|Limpieza Del Hogar",
|
|
94
|
-
"retailer_name": "Alsuper"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"id_category": 3456,
|
|
98
|
-
"id_retailer": 41,
|
|
99
|
-
"category_name": "Categoría Genérica Chapa|Categoría Genérica|Categoría Genérica",
|
|
100
|
-
"retailer_name": "Chapa"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"id_category": 3499,
|
|
104
|
-
"id_retailer": 20,
|
|
105
|
-
"category_name": "Consumibles Cornershop|Consumibles|Consumibles",
|
|
106
|
-
"retailer_name": "Cornershop"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"id_category": 3507,
|
|
110
|
-
"id_retailer": 38,
|
|
111
|
-
"category_name": "Hogar|Artículos de Limpieza|Multiusos",
|
|
112
|
-
"retailer_name": "Del Sol"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"id_category": 3562,
|
|
116
|
-
"id_retailer": 29,
|
|
117
|
-
"category_name": "Consumibles Farmacias del Ahorro|Consumibles|Consumibles",
|
|
118
|
-
"retailer_name": "Farmacias del Ahorro"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"id_category": 3588,
|
|
122
|
-
"id_retailer": 8,
|
|
123
|
-
"category_name": "Hogar|Limpieza|Lavatrastes",
|
|
124
|
-
"retailer_name": "Fragua"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"id_category": 3604,
|
|
128
|
-
"id_retailer": 18,
|
|
129
|
-
"category_name": "Categoría Genérica Google|Categoría Genérica|Categoría Genérica",
|
|
130
|
-
"retailer_name": "Google"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"id_category": 3741,
|
|
134
|
-
"id_retailer": 6,
|
|
135
|
-
"category_name": "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
136
|
-
"retailer_name": "HEB"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"id_category": 4780,
|
|
140
|
-
"id_retailer": 27,
|
|
141
|
-
"category_name": "Categoría Genérica IMPIRA México|Categoría Genérica|Categoría Genérica",
|
|
142
|
-
"retailer_name": "IMPIRA México"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"id_category": 4796,
|
|
146
|
-
"id_retailer": 39,
|
|
147
|
-
"category_name": "Limpieza y Hogar|Limpieza General|Limpieza General",
|
|
148
|
-
"retailer_name": "Justo"
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
"id_category": 4835,
|
|
152
|
-
"id_retailer": 7,
|
|
153
|
-
"category_name": "Categoría Genérica Mega|Categoría Genérica|Categoría Genérica",
|
|
154
|
-
"retailer_name": "Mega"
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"id_category": 4853,
|
|
158
|
-
"id_retailer": 33,
|
|
159
|
-
"category_name": "Cuidado Hogar|Lavatrastes|Lavatrastes Liquidos",
|
|
160
|
-
"retailer_name": "Merza"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"id_category": 4873,
|
|
164
|
-
"id_retailer": 36,
|
|
165
|
-
"category_name": "Productos del Hogar|Productos del Hogar|Productos del Hogar",
|
|
166
|
-
"retailer_name": "Oxxo"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"id_category": 4911,
|
|
170
|
-
"id_retailer": 16,
|
|
171
|
-
"category_name": "Categoría Genérica Rappi|Categoría Genérica|Categoría Genérica",
|
|
172
|
-
"retailer_name": "Rappi"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"id_category": 5918,
|
|
176
|
-
"id_retailer": 4,
|
|
177
|
-
"category_name": "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
178
|
-
"retailer_name": "Walmart Super y Superama"
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"id_category": 7126,
|
|
182
|
-
"id_retailer": 13,
|
|
183
|
-
"category_name": "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
184
|
-
"retailer_name": "Soriana"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"id_category": 7196,
|
|
188
|
-
"id_retailer": 5,
|
|
189
|
-
"category_name": "Categoría Consumibles Chedraui|Consumibles|Productos de Limpieza y Lavandería",
|
|
190
|
-
"retailer_name": "Chedraui"
|
|
79
|
+
"id_category": 4007,
|
|
80
|
+
"id_retailer": 70,
|
|
81
|
+
"category_name": "Abarrotes Procesados|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
|
|
82
|
+
"retailer_name": "Bodega Aurrera"
|
|
191
83
|
}
|
|
192
84
|
]
|
|
193
85
|
},
|
|
194
86
|
"retailers": [
|
|
195
87
|
{
|
|
196
|
-
"id":
|
|
197
|
-
"name": "
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
"id": 5,
|
|
201
|
-
"name": "Chedraui"
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"id": 6,
|
|
205
|
-
"name": "HEB"
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
"id": 8,
|
|
209
|
-
"name": "Fragua"
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
"id": 12,
|
|
213
|
-
"name": "La Comer"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"id": 13,
|
|
217
|
-
"name": "Soriana"
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
"id": 16,
|
|
221
|
-
"name": "Rappi"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"id": 17,
|
|
225
|
-
"name": "Genérico"
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"id": 20,
|
|
229
|
-
"name": "Cornershop"
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
"id": 24,
|
|
233
|
-
"name": "Alsuper"
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
"id": 29,
|
|
237
|
-
"name": "Farmacias del Ahorro"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"id": 36,
|
|
241
|
-
"name": "Oxxo"
|
|
88
|
+
"id": 70,
|
|
89
|
+
"name": "Bodega Aurrera"
|
|
242
90
|
}
|
|
243
91
|
],
|
|
244
92
|
"country": "México",
|
|
245
|
-
"upc": "
|
|
93
|
+
"upc": "098928"
|
|
246
94
|
},
|
|
247
95
|
|
|
248
96
|
// location: {
|
|
@@ -255,41 +103,41 @@ RetailerProductEditionDefault.args = {
|
|
|
255
103
|
|
|
256
104
|
// EDICION IMAGENES
|
|
257
105
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
106
|
+
user: {
|
|
107
|
+
"id_user": 427,
|
|
108
|
+
"name": "Especialista Edición",
|
|
109
|
+
"last_name": null,
|
|
110
|
+
"email": "kikije1467@mtlcz.com",
|
|
111
|
+
"position": "Tester",
|
|
112
|
+
"telephone": null,
|
|
113
|
+
"country": null,
|
|
114
|
+
"id_company": 254,
|
|
115
|
+
"id_cognito": "c7e5a6a4-2b3f-4d54-af98-9e09a4cbc01e",
|
|
116
|
+
"birth_Date": null,
|
|
117
|
+
"about_me": null,
|
|
118
|
+
"zip_code": null,
|
|
119
|
+
"address": null,
|
|
120
|
+
"job": null,
|
|
121
|
+
"id_stripe": null,
|
|
122
|
+
"id_role": 8,
|
|
123
|
+
"active": 1,
|
|
124
|
+
"is_retailer": 0,
|
|
125
|
+
"email_notify": null,
|
|
126
|
+
"is_user_tech": null,
|
|
127
|
+
"is_onboarding": 0,
|
|
128
|
+
"membership": {
|
|
129
|
+
"id": 750,
|
|
130
|
+
"start_date": "2022-01-07T21:32:54.000Z",
|
|
131
|
+
"end_date": "2023-01-07T21:32:54.000Z",
|
|
132
|
+
"planID": 6,
|
|
133
|
+
"plan": "prod_KvGd6YSTJyR3AP",
|
|
134
|
+
"name": "Plan Small",
|
|
135
|
+
"user_limit": "10",
|
|
136
|
+
"products_limit": "1000",
|
|
137
|
+
"type": "Enterprise"
|
|
138
|
+
},
|
|
139
|
+
"src": "https://content-management-profile-prod.s3.amazonaws.com/id-427/427.png?1775592220312"
|
|
140
|
+
},
|
|
293
141
|
|
|
294
142
|
//TEXTOS
|
|
295
143
|
|
|
@@ -330,39 +178,39 @@ RetailerProductEditionDefault.args = {
|
|
|
330
178
|
// "src": "https://content-management-profile.s3.amazonaws.com/id-442/442.png?1760636567736"
|
|
331
179
|
// },
|
|
332
180
|
|
|
333
|
-
user: {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
},
|
|
181
|
+
// user: {
|
|
182
|
+
// id_user: 426,
|
|
183
|
+
// name: "Especialista Textos",
|
|
184
|
+
// last_name: null,
|
|
185
|
+
// email: "karafe3218@mom2kid.com",
|
|
186
|
+
// position: "Tester",
|
|
187
|
+
// telephone: null,
|
|
188
|
+
// country: null,
|
|
189
|
+
// id_company: 254,
|
|
190
|
+
// id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
|
|
191
|
+
// birth_Date: null,
|
|
192
|
+
// about_me: null,
|
|
193
|
+
// zip_code: null,
|
|
194
|
+
// address: null,
|
|
195
|
+
// job: null,
|
|
196
|
+
// id_stripe: null,
|
|
197
|
+
// id_role: 7,
|
|
198
|
+
// active: 1,
|
|
199
|
+
// is_retailer: 0,
|
|
200
|
+
// email_notify: null,
|
|
201
|
+
// is_user_tech: null,
|
|
202
|
+
// is_onboarding: 0,
|
|
203
|
+
// membership: {
|
|
204
|
+
// id: 750,
|
|
205
|
+
// start_date: "2022-01-07T21:32:54.000Z",
|
|
206
|
+
// end_date: "2023-01-07T21:32:54.000Z",
|
|
207
|
+
// planID: 6,
|
|
208
|
+
// plan: "prod_KvGd6YSTJyR3AP",
|
|
209
|
+
// name: "Plan Small",
|
|
210
|
+
// user_limit: "10",
|
|
211
|
+
// products_limit: "1000",
|
|
212
|
+
// type: "Enterprise",
|
|
213
|
+
// },
|
|
214
|
+
// src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1768253179478",
|
|
215
|
+
// },
|
|
368
216
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { STATUS_DICTIONARY } from "../../../../../global-files/statusDictionary";
|
|
2
|
+
|
|
1
3
|
export const productInitialState = {
|
|
2
4
|
product: null,
|
|
3
5
|
services: null,
|
|
@@ -10,6 +12,7 @@ export const PRODUCT_ACTIONS = {
|
|
|
10
12
|
SET_SERVICES_DATA: "SET_SERVICES_DATA",
|
|
11
13
|
SET_PRODUCT_VERSION: "SET_PRODUCT_VERSION",
|
|
12
14
|
SET_PERCENTAGES: "SET_PERCENTAGES",
|
|
15
|
+
SET_RETAILER_STATUS: "SET_RETAILER_STATUS",
|
|
13
16
|
};
|
|
14
17
|
|
|
15
18
|
export const productReducer = (state, action) => {
|
|
@@ -28,6 +31,37 @@ export const productReducer = (state, action) => {
|
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
case PRODUCT_ACTIONS.SET_RETAILER_STATUS: {
|
|
35
|
+
return {
|
|
36
|
+
...state,
|
|
37
|
+
product: {
|
|
38
|
+
...state.product,
|
|
39
|
+
status: getMinorStatus(
|
|
40
|
+
action.payload.map((status) => status?.status),
|
|
41
|
+
),
|
|
42
|
+
description_status:
|
|
43
|
+
action.payload.find(
|
|
44
|
+
(status) =>
|
|
45
|
+
status?.service === "description" &&
|
|
46
|
+
status?.retailer_id === state?.active_retailer?.id_retailer,
|
|
47
|
+
).status || "NS",
|
|
48
|
+
datasheet_status:
|
|
49
|
+
action.payload.find(
|
|
50
|
+
(status) =>
|
|
51
|
+
status?.service === "datasheet" &&
|
|
52
|
+
status?.retailer_id === state?.active_retailer?.id_retailer,
|
|
53
|
+
).status || "NS",
|
|
54
|
+
images_status:
|
|
55
|
+
action.payload.find(
|
|
56
|
+
(status) =>
|
|
57
|
+
status?.service === "images" &&
|
|
58
|
+
status?.retailer_id === state?.active_retailer?.id_retailer,
|
|
59
|
+
).status || "NS",
|
|
60
|
+
statusByRetailer: action.payload,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
31
65
|
case PRODUCT_ACTIONS.SET_SERVICES_DATA: {
|
|
32
66
|
return {
|
|
33
67
|
...state,
|
|
@@ -57,3 +91,24 @@ export const productReducer = (state, action) => {
|
|
|
57
91
|
}
|
|
58
92
|
}
|
|
59
93
|
};
|
|
94
|
+
|
|
95
|
+
function getMinorStatus(servicesStatus = []) {
|
|
96
|
+
if (!servicesStatus || servicesStatus.length === 0)
|
|
97
|
+
return STATUS_DICTIONARY.NS.name;
|
|
98
|
+
|
|
99
|
+
console.log({ servicesStatus });
|
|
100
|
+
|
|
101
|
+
const winner = servicesStatus.reduce((minor, current) => {
|
|
102
|
+
const currentObj =
|
|
103
|
+
typeof current === "string" ? STATUS_DICTIONARY[current] : current;
|
|
104
|
+
const minorObj =
|
|
105
|
+
typeof minor === "string" ? STATUS_DICTIONARY[minor] : minor;
|
|
106
|
+
|
|
107
|
+
if (!currentObj || typeof currentObj.weight === "undefined") return minor;
|
|
108
|
+
if (!minorObj || typeof minorObj.weight === "undefined") return current;
|
|
109
|
+
|
|
110
|
+
return currentObj.weight < minorObj.weight ? currentObj : minorObj;
|
|
111
|
+
}, servicesStatus[0] || STATUS_DICTIONARY.NS);
|
|
112
|
+
|
|
113
|
+
return winner?.status || STATUS_DICTIONARY.NS.status;
|
|
114
|
+
}
|