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.
@@ -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": 18193,
21
+ "articleId": 145186,
22
22
  "services": {
23
23
  "datasheets": 1,
24
24
  "descriptions": 1,
25
25
  "images": 1
26
26
  },
27
- "orderId": 10284,
28
- "city": "CDMX",
29
- "status": "AP",
30
- "datasheet_status": "AP",
27
+ "orderId": 10449,
28
+ "city": "CDMX, México",
29
+ "status": "AS",
30
+ "datasheet_status": "AC",
31
31
  "prio": "none",
32
- "version": 34,
33
- "description_status": "AP",
34
- "images_status": "AP",
32
+ "version": 3,
33
+ "description_status": "AS",
34
+ "images_status": "AC",
35
35
  "statusByRetailer": [
36
36
  {
37
- "status": "AP",
37
+ "status": "AC",
38
38
  "service": "datasheet",
39
- "retailer_id": 24,
40
- "task_user_group_id": 6
39
+ "retailer_id": 70,
40
+ "task_user_group_id": 4
41
41
  },
42
42
  {
43
- "status": "AP",
43
+ "status": "AS",
44
44
  "service": "description",
45
- "retailer_id": 24,
46
- "task_user_group_id": 6
45
+ "retailer_id": 70,
46
+ "task_user_group_id": 2
47
47
  },
48
48
  {
49
- "status": "AP",
49
+ "status": "AC",
50
50
  "service": "images",
51
- "retailer_id": 24,
52
- "task_user_group_id": 6
51
+ "retailer_id": 70,
52
+ "task_user_group_id": 4
53
53
  }
54
54
  ],
55
55
  "article": {
56
- "id_article": 18193,
57
- "id_category": "157",
58
- "brand": "Axion",
59
- "name": "Detergente lavatrastes líquido Axion limón 900 ml",
60
- "upc": "7509546052977",
61
- "sku": null,
62
- "timestamp": "2021-10-09T16:33:17.000Z",
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": 226,
65
- "company_name": "COLGATE PALMOLIVE S.A. DE C.V.",
64
+ "company_id": 291,
65
+ "company_name": "LATAM LOGISTICS",
66
66
  "country": "México",
67
- "id_order": 10284,
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": 3008,
72
+ "id_images_especialist": 427,
73
73
  "id_images_facilitator": null,
74
- "id_auditor": 495,
74
+ "id_auditor": 425,
75
75
  "id_recepcionist": null,
76
- "category": "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
76
+ "category": "Abarrotes Procesados|Abarrotes Básicos y Procesados|Abarrotes Básicos y Procesados",
77
77
  "categoryRetailer": [
78
78
  {
79
- "id_category": 157,
80
- "id_retailer": 17,
81
- "category_name": "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
82
- "retailer_name": "Genérico"
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": 4,
197
- "name": "Walmart Super y Superama"
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": "7509546052977"
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
- // user: {
259
- // "id_user": 427,
260
- // "name": "Especialista Edición",
261
- // "last_name": null,
262
- // "email": "kikije1467@mtlcz.com",
263
- // "position": "Tester",
264
- // "telephone": null,
265
- // "country": null,
266
- // "id_company": 254,
267
- // "id_cognito": "c7e5a6a4-2b3f-4d54-af98-9e09a4cbc01e",
268
- // "birth_Date": null,
269
- // "about_me": null,
270
- // "zip_code": null,
271
- // "address": null,
272
- // "job": null,
273
- // "id_stripe": null,
274
- // "id_role": 8,
275
- // "active": 1,
276
- // "is_retailer": 0,
277
- // "email_notify": null,
278
- // "is_user_tech": null,
279
- // "is_onboarding": 0,
280
- // "membership": {
281
- // "id": 750,
282
- // "start_date": "2022-01-07T21:32:54.000Z",
283
- // "end_date": "2023-01-07T21:32:54.000Z",
284
- // "planID": 6,
285
- // "plan": "prod_KvGd6YSTJyR3AP",
286
- // "name": "Plan Small",
287
- // "user_limit": "10",
288
- // "products_limit": "1000",
289
- // "type": "Enterprise"
290
- // },
291
- // "src": "https://content-management-profile-prod.s3.amazonaws.com/id-427/427.png?1775592220312"
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
- id_user: 426,
335
- name: "Especialista Textos",
336
- last_name: null,
337
- email: "karafe3218@mom2kid.com",
338
- position: "Tester",
339
- telephone: null,
340
- country: null,
341
- id_company: 254,
342
- id_cognito: "8d010214-5bfa-43c3-96fb-c556dc05774b",
343
- birth_Date: null,
344
- about_me: null,
345
- zip_code: null,
346
- address: null,
347
- job: null,
348
- id_stripe: null,
349
- id_role: 7,
350
- active: 1,
351
- is_retailer: 0,
352
- email_notify: null,
353
- is_user_tech: null,
354
- is_onboarding: 0,
355
- membership: {
356
- id: 750,
357
- start_date: "2022-01-07T21:32:54.000Z",
358
- end_date: "2023-01-07T21:32:54.000Z",
359
- planID: 6,
360
- plan: "prod_KvGd6YSTJyR3AP",
361
- name: "Plan Small",
362
- user_limit: "10",
363
- products_limit: "1000",
364
- type: "Enterprise",
365
- },
366
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-426/426.png?1768253179478",
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
+ }