contentoh-components-library 21.5.85 → 21.5.87
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/molecules/TagAndInput/index.js +55 -14
- package/dist/components/molecules/TagAndInput/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/contexts/AiProductEdition.js +75 -22
- 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/molecules/TagAndInput/index.js +32 -2
- package/src/components/molecules/TagAndInput/styles.js +11 -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 +46 -0
- package/src/global-files/statusDictionary.js +103 -0
|
@@ -33,194 +33,71 @@ 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": 145186,
|
|
37
37
|
"services": {
|
|
38
38
|
"datasheets": 1,
|
|
39
39
|
"descriptions": 1,
|
|
40
40
|
"images": 1
|
|
41
41
|
},
|
|
42
|
-
"orderId":
|
|
43
|
-
"city": "CDMX",
|
|
44
|
-
"status": "
|
|
45
|
-
"datasheet_status": "
|
|
42
|
+
"orderId": 10449,
|
|
43
|
+
"city": "CDMX, México",
|
|
44
|
+
"status": "AS",
|
|
45
|
+
"datasheet_status": "AC",
|
|
46
46
|
"prio": "none",
|
|
47
|
-
"version":
|
|
48
|
-
"description_status": "
|
|
49
|
-
"images_status": "
|
|
47
|
+
"version": 3,
|
|
48
|
+
"description_status": "AS",
|
|
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": 70,
|
|
54
|
+
"task_user_group_id": 4
|
|
55
55
|
}, {
|
|
56
|
-
"status": "
|
|
56
|
+
"status": "AS",
|
|
57
57
|
"service": "description",
|
|
58
|
-
"retailer_id":
|
|
59
|
-
"task_user_group_id":
|
|
58
|
+
"retailer_id": 70,
|
|
59
|
+
"task_user_group_id": 2
|
|
60
60
|
}, {
|
|
61
|
-
"status": "
|
|
61
|
+
"status": "AC",
|
|
62
62
|
"service": "images",
|
|
63
|
-
"retailer_id":
|
|
64
|
-
"task_user_group_id":
|
|
63
|
+
"retailer_id": 70,
|
|
64
|
+
"task_user_group_id": 4
|
|
65
65
|
}],
|
|
66
66
|
"article": {
|
|
67
|
-
"id_article":
|
|
68
|
-
"id_category": "
|
|
69
|
-
"brand":
|
|
70
|
-
"name": "
|
|
71
|
-
"upc": "
|
|
72
|
-
"sku":
|
|
73
|
-
"timestamp": "
|
|
67
|
+
"id_article": 145186,
|
|
68
|
+
"id_category": "4007",
|
|
69
|
+
"brand": null,
|
|
70
|
+
"name": "Mayonesa",
|
|
71
|
+
"upc": "098928",
|
|
72
|
+
"sku": "899",
|
|
73
|
+
"timestamp": "2026-04-23T16:02:14.000Z",
|
|
74
74
|
"active": 1,
|
|
75
|
-
"company_id":
|
|
76
|
-
"company_name": "
|
|
75
|
+
"company_id": 291,
|
|
76
|
+
"company_name": "LATAM LOGISTICS",
|
|
77
77
|
"country": "México",
|
|
78
|
-
"id_order":
|
|
78
|
+
"id_order": 10449,
|
|
79
79
|
"id_datasheet_especialist": 426,
|
|
80
80
|
"id_datasheet_facilitator": null,
|
|
81
81
|
"id_description_especialist": 426,
|
|
82
82
|
"id_description_facilitator": null,
|
|
83
|
-
"id_images_especialist":
|
|
83
|
+
"id_images_especialist": 427,
|
|
84
84
|
"id_images_facilitator": null,
|
|
85
|
-
"id_auditor":
|
|
85
|
+
"id_auditor": 425,
|
|
86
86
|
"id_recepcionist": null,
|
|
87
|
-
"category": "
|
|
87
|
+
"category": "Abarrotes Procesados|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
|
|
88
88
|
"categoryRetailer": [{
|
|
89
|
-
"id_category":
|
|
90
|
-
"id_retailer":
|
|
91
|
-
"category_name": "
|
|
92
|
-
"retailer_name": "
|
|
93
|
-
}, {
|
|
94
|
-
"id_category": 3430,
|
|
95
|
-
"id_retailer": 12,
|
|
96
|
-
"category_name": "Departamento General La Comer|Departamento General|Departamento General",
|
|
97
|
-
"retailer_name": "La Comer"
|
|
98
|
-
}, {
|
|
99
|
-
"id_category": 3433,
|
|
100
|
-
"id_retailer": 24,
|
|
101
|
-
"category_name": "Limpieza Del Hogar|Limpieza Del Hogar|Limpieza Del Hogar",
|
|
102
|
-
"retailer_name": "Alsuper"
|
|
103
|
-
}, {
|
|
104
|
-
"id_category": 3456,
|
|
105
|
-
"id_retailer": 41,
|
|
106
|
-
"category_name": "Categoría Genérica Chapa|Categoría Genérica|Categoría Genérica",
|
|
107
|
-
"retailer_name": "Chapa"
|
|
108
|
-
}, {
|
|
109
|
-
"id_category": 3499,
|
|
110
|
-
"id_retailer": 20,
|
|
111
|
-
"category_name": "Consumibles Cornershop|Consumibles|Consumibles",
|
|
112
|
-
"retailer_name": "Cornershop"
|
|
113
|
-
}, {
|
|
114
|
-
"id_category": 3507,
|
|
115
|
-
"id_retailer": 38,
|
|
116
|
-
"category_name": "Hogar|Artículos de Limpieza|Multiusos",
|
|
117
|
-
"retailer_name": "Del Sol"
|
|
118
|
-
}, {
|
|
119
|
-
"id_category": 3562,
|
|
120
|
-
"id_retailer": 29,
|
|
121
|
-
"category_name": "Consumibles Farmacias del Ahorro|Consumibles|Consumibles",
|
|
122
|
-
"retailer_name": "Farmacias del Ahorro"
|
|
123
|
-
}, {
|
|
124
|
-
"id_category": 3588,
|
|
125
|
-
"id_retailer": 8,
|
|
126
|
-
"category_name": "Hogar|Limpieza|Lavatrastes",
|
|
127
|
-
"retailer_name": "Fragua"
|
|
128
|
-
}, {
|
|
129
|
-
"id_category": 3604,
|
|
130
|
-
"id_retailer": 18,
|
|
131
|
-
"category_name": "Categoría Genérica Google|Categoría Genérica|Categoría Genérica",
|
|
132
|
-
"retailer_name": "Google"
|
|
133
|
-
}, {
|
|
134
|
-
"id_category": 3741,
|
|
135
|
-
"id_retailer": 6,
|
|
136
|
-
"category_name": "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
137
|
-
"retailer_name": "HEB"
|
|
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
|
-
"id_category": 4796,
|
|
145
|
-
"id_retailer": 39,
|
|
146
|
-
"category_name": "Limpieza y Hogar|Limpieza General|Limpieza General",
|
|
147
|
-
"retailer_name": "Justo"
|
|
148
|
-
}, {
|
|
149
|
-
"id_category": 4835,
|
|
150
|
-
"id_retailer": 7,
|
|
151
|
-
"category_name": "Categoría Genérica Mega|Categoría Genérica|Categoría Genérica",
|
|
152
|
-
"retailer_name": "Mega"
|
|
153
|
-
}, {
|
|
154
|
-
"id_category": 4853,
|
|
155
|
-
"id_retailer": 33,
|
|
156
|
-
"category_name": "Cuidado Hogar|Lavatrastes|Lavatrastes Liquidos",
|
|
157
|
-
"retailer_name": "Merza"
|
|
158
|
-
}, {
|
|
159
|
-
"id_category": 4873,
|
|
160
|
-
"id_retailer": 36,
|
|
161
|
-
"category_name": "Productos del Hogar|Productos del Hogar|Productos del Hogar",
|
|
162
|
-
"retailer_name": "Oxxo"
|
|
163
|
-
}, {
|
|
164
|
-
"id_category": 4911,
|
|
165
|
-
"id_retailer": 16,
|
|
166
|
-
"category_name": "Categoría Genérica Rappi|Categoría Genérica|Categoría Genérica",
|
|
167
|
-
"retailer_name": "Rappi"
|
|
168
|
-
}, {
|
|
169
|
-
"id_category": 5918,
|
|
170
|
-
"id_retailer": 4,
|
|
171
|
-
"category_name": "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
172
|
-
"retailer_name": "Walmart Super y Superama"
|
|
173
|
-
}, {
|
|
174
|
-
"id_category": 7126,
|
|
175
|
-
"id_retailer": 13,
|
|
176
|
-
"category_name": "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
177
|
-
"retailer_name": "Soriana"
|
|
178
|
-
}, {
|
|
179
|
-
"id_category": 7196,
|
|
180
|
-
"id_retailer": 5,
|
|
181
|
-
"category_name": "Categoría Consumibles Chedraui|Consumibles|Productos de Limpieza y Lavandería",
|
|
182
|
-
"retailer_name": "Chedraui"
|
|
89
|
+
"id_category": 4007,
|
|
90
|
+
"id_retailer": 70,
|
|
91
|
+
"category_name": "Abarrotes Procesados|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
|
|
92
|
+
"retailer_name": "Bodega Aurrera"
|
|
183
93
|
}]
|
|
184
94
|
},
|
|
185
95
|
"retailers": [{
|
|
186
|
-
"id":
|
|
187
|
-
"name": "
|
|
188
|
-
}, {
|
|
189
|
-
"id": 5,
|
|
190
|
-
"name": "Chedraui"
|
|
191
|
-
}, {
|
|
192
|
-
"id": 6,
|
|
193
|
-
"name": "HEB"
|
|
194
|
-
}, {
|
|
195
|
-
"id": 8,
|
|
196
|
-
"name": "Fragua"
|
|
197
|
-
}, {
|
|
198
|
-
"id": 12,
|
|
199
|
-
"name": "La Comer"
|
|
200
|
-
}, {
|
|
201
|
-
"id": 13,
|
|
202
|
-
"name": "Soriana"
|
|
203
|
-
}, {
|
|
204
|
-
"id": 16,
|
|
205
|
-
"name": "Rappi"
|
|
206
|
-
}, {
|
|
207
|
-
"id": 17,
|
|
208
|
-
"name": "Genérico"
|
|
209
|
-
}, {
|
|
210
|
-
"id": 20,
|
|
211
|
-
"name": "Cornershop"
|
|
212
|
-
}, {
|
|
213
|
-
"id": 24,
|
|
214
|
-
"name": "Alsuper"
|
|
215
|
-
}, {
|
|
216
|
-
"id": 29,
|
|
217
|
-
"name": "Farmacias del Ahorro"
|
|
218
|
-
}, {
|
|
219
|
-
"id": 36,
|
|
220
|
-
"name": "Oxxo"
|
|
96
|
+
"id": 70,
|
|
97
|
+
"name": "Bodega Aurrera"
|
|
221
98
|
}],
|
|
222
99
|
"country": "México",
|
|
223
|
-
"upc": "
|
|
100
|
+
"upc": "098928"
|
|
224
101
|
},
|
|
225
102
|
// location: {
|
|
226
103
|
// product: { articleId: 126855, versionId: 3 },
|
|
@@ -230,42 +107,41 @@ RetailerProductEditionDefault.args = {
|
|
|
230
107
|
// },
|
|
231
108
|
// },
|
|
232
109
|
// EDICION IMAGENES
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
//
|
|
268
|
-
//TEXTOS
|
|
110
|
+
user: {
|
|
111
|
+
"id_user": 427,
|
|
112
|
+
"name": "Especialista Edición",
|
|
113
|
+
"last_name": null,
|
|
114
|
+
"email": "kikije1467@mtlcz.com",
|
|
115
|
+
"position": "Tester",
|
|
116
|
+
"telephone": null,
|
|
117
|
+
"country": null,
|
|
118
|
+
"id_company": 254,
|
|
119
|
+
"id_cognito": "c7e5a6a4-2b3f-4d54-af98-9e09a4cbc01e",
|
|
120
|
+
"birth_Date": null,
|
|
121
|
+
"about_me": null,
|
|
122
|
+
"zip_code": null,
|
|
123
|
+
"address": null,
|
|
124
|
+
"job": null,
|
|
125
|
+
"id_stripe": null,
|
|
126
|
+
"id_role": 8,
|
|
127
|
+
"active": 1,
|
|
128
|
+
"is_retailer": 0,
|
|
129
|
+
"email_notify": null,
|
|
130
|
+
"is_user_tech": null,
|
|
131
|
+
"is_onboarding": 0,
|
|
132
|
+
"membership": {
|
|
133
|
+
"id": 750,
|
|
134
|
+
"start_date": "2022-01-07T21:32:54.000Z",
|
|
135
|
+
"end_date": "2023-01-07T21:32:54.000Z",
|
|
136
|
+
"planID": 6,
|
|
137
|
+
"plan": "prod_KvGd6YSTJyR3AP",
|
|
138
|
+
"name": "Plan Small",
|
|
139
|
+
"user_limit": "10",
|
|
140
|
+
"products_limit": "1000",
|
|
141
|
+
"type": "Enterprise"
|
|
142
|
+
},
|
|
143
|
+
"src": "https://content-management-profile-prod.s3.amazonaws.com/id-427/427.png?1775592220312"
|
|
144
|
+
} //TEXTOS
|
|
269
145
|
// user: {
|
|
270
146
|
// "id_user": 442,
|
|
271
147
|
// "name": "Especialista",
|
|
@@ -302,39 +178,40 @@ RetailerProductEditionDefault.args = {
|
|
|
302
178
|
// },
|
|
303
179
|
// "src": "https://content-management-profile.s3.amazonaws.com/id-442/442.png?1760636567736"
|
|
304
180
|
// },
|
|
305
|
-
user: {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
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
|
+
// },
|
|
216
|
+
|
|
340
217
|
};
|
|
@@ -9,6 +9,8 @@ exports.productReducer = exports.productInitialState = exports.PRODUCT_ACTIONS =
|
|
|
9
9
|
|
|
10
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
11
|
|
|
12
|
+
var _statusDictionary = require("../../../../../global-files/statusDictionary");
|
|
13
|
+
|
|
12
14
|
var productInitialState = {
|
|
13
15
|
product: null,
|
|
14
16
|
services: null,
|
|
@@ -20,7 +22,8 @@ var PRODUCT_ACTIONS = {
|
|
|
20
22
|
SET_SERVICES: "SET_SERVICES",
|
|
21
23
|
SET_SERVICES_DATA: "SET_SERVICES_DATA",
|
|
22
24
|
SET_PRODUCT_VERSION: "SET_PRODUCT_VERSION",
|
|
23
|
-
SET_PERCENTAGES: "SET_PERCENTAGES"
|
|
25
|
+
SET_PERCENTAGES: "SET_PERCENTAGES",
|
|
26
|
+
SET_RETAILER_STATUS: "SET_RETAILER_STATUS"
|
|
24
27
|
};
|
|
25
28
|
exports.PRODUCT_ACTIONS = PRODUCT_ACTIONS;
|
|
26
29
|
|
|
@@ -40,6 +43,33 @@ var productReducer = function productReducer(state, action) {
|
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
case PRODUCT_ACTIONS.SET_RETAILER_STATUS:
|
|
47
|
+
{
|
|
48
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
49
|
+
product: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.product), {}, {
|
|
50
|
+
status: getMinorStatus(action.payload.map(function (status) {
|
|
51
|
+
return status === null || status === void 0 ? void 0 : status.status;
|
|
52
|
+
})),
|
|
53
|
+
description_status: action.payload.find(function (status) {
|
|
54
|
+
var _state$active_retaile;
|
|
55
|
+
|
|
56
|
+
return (status === null || status === void 0 ? void 0 : status.service) === "description" && (status === null || status === void 0 ? void 0 : status.retailer_id) === (state === null || state === void 0 ? void 0 : (_state$active_retaile = state.active_retailer) === null || _state$active_retaile === void 0 ? void 0 : _state$active_retaile.id_retailer);
|
|
57
|
+
}).status || "NS",
|
|
58
|
+
datasheet_status: action.payload.find(function (status) {
|
|
59
|
+
var _state$active_retaile2;
|
|
60
|
+
|
|
61
|
+
return (status === null || status === void 0 ? void 0 : status.service) === "datasheet" && (status === null || status === void 0 ? void 0 : status.retailer_id) === (state === null || state === void 0 ? void 0 : (_state$active_retaile2 = state.active_retailer) === null || _state$active_retaile2 === void 0 ? void 0 : _state$active_retaile2.id_retailer);
|
|
62
|
+
}).status || "NS",
|
|
63
|
+
images_status: action.payload.find(function (status) {
|
|
64
|
+
var _state$active_retaile3;
|
|
65
|
+
|
|
66
|
+
return (status === null || status === void 0 ? void 0 : status.service) === "images" && (status === null || status === void 0 ? void 0 : status.retailer_id) === (state === null || state === void 0 ? void 0 : (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer);
|
|
67
|
+
}).status || "NS",
|
|
68
|
+
statusByRetailer: action.payload
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
43
73
|
case PRODUCT_ACTIONS.SET_SERVICES_DATA:
|
|
44
74
|
{
|
|
45
75
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
@@ -72,4 +102,20 @@ var productReducer = function productReducer(state, action) {
|
|
|
72
102
|
}
|
|
73
103
|
};
|
|
74
104
|
|
|
75
|
-
exports.productReducer = productReducer;
|
|
105
|
+
exports.productReducer = productReducer;
|
|
106
|
+
|
|
107
|
+
function getMinorStatus() {
|
|
108
|
+
var servicesStatus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
109
|
+
if (!servicesStatus || servicesStatus.length === 0) return _statusDictionary.STATUS_DICTIONARY.NS.name;
|
|
110
|
+
console.log({
|
|
111
|
+
servicesStatus: servicesStatus
|
|
112
|
+
});
|
|
113
|
+
var winner = servicesStatus.reduce(function (minor, current) {
|
|
114
|
+
var currentObj = typeof current === "string" ? _statusDictionary.STATUS_DICTIONARY[current] : current;
|
|
115
|
+
var minorObj = typeof minor === "string" ? _statusDictionary.STATUS_DICTIONARY[minor] : minor;
|
|
116
|
+
if (!currentObj || typeof currentObj.weight === "undefined") return minor;
|
|
117
|
+
if (!minorObj || typeof minorObj.weight === "undefined") return current;
|
|
118
|
+
return currentObj.weight < minorObj.weight ? currentObj : minorObj;
|
|
119
|
+
}, servicesStatus[0] || _statusDictionary.STATUS_DICTIONARY.NS);
|
|
120
|
+
return (winner === null || winner === void 0 ? void 0 : winner.status) || _statusDictionary.STATUS_DICTIONARY.NS.status;
|
|
121
|
+
}
|