contentoh-components-library 21.5.44 → 21.5.46
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/ProgressBar/index.js +1 -1
- package/dist/components/pages/ProductEditionv2/index.js +3 -9
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +145 -31
- package/dist/components/pages/RetailerProductEdition/index.js +150 -102
- package/package.json +1 -1
- package/src/components/atoms/ProgressBar/index.js +1 -1
- package/src/components/pages/ProductEditionv2/index.js +2 -2
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +161 -31
- package/src/components/pages/RetailerProductEdition/index.js +32 -10
|
@@ -50,7 +50,7 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
50
50
|
children: !percent && percent != 0 ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
51
51
|
className: "status-".concat(progressBarType),
|
|
52
52
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
53
|
-
children: [
|
|
53
|
+
children: [Math.round(percent), "%"]
|
|
54
54
|
})
|
|
55
55
|
}),
|
|
56
56
|
classNameTooltip: "container-tooltip"
|
|
@@ -2326,19 +2326,13 @@ var ProductEditionv2 = function ProductEditionv2(_ref) {
|
|
|
2326
2326
|
children: "Ir a checkout"
|
|
2327
2327
|
})]
|
|
2328
2328
|
})
|
|
2329
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.
|
|
2330
|
-
children:
|
|
2329
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
2330
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SliderToolTip.SliderToolTip, {
|
|
2331
2331
|
infoIcon: _infoIcon.default,
|
|
2332
2332
|
slidefront: slidefront,
|
|
2333
2333
|
iconSize: "big-image",
|
|
2334
2334
|
slidePosition: "top-slide"
|
|
2335
|
-
})
|
|
2336
|
-
onClick: function onClick() {
|
|
2337
|
-
setShowContentohRequestModal && setShowContentohRequestModal(true);
|
|
2338
|
-
},
|
|
2339
|
-
buttonType: "general-default-button",
|
|
2340
|
-
label: "Enviar a Content-oh!"
|
|
2341
|
-
})]
|
|
2335
|
+
})
|
|
2342
2336
|
})]
|
|
2343
2337
|
})]
|
|
2344
2338
|
})
|
|
@@ -33,37 +33,115 @@ RetailerProductEditionDefault.args = {
|
|
|
33
33
|
},
|
|
34
34
|
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIzOWE5MDMwOS04MWNkLTQ4ZGYtODZmYi1iMjJjNGEwZTA1NTkiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjM5YTkwMzA5LTgxY2QtNDhkZi04NmZiLWIyMmM0YTBlMDU1OSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJmOGMyYWZlYS01MDFjLTRiZDItOWVkMS1lNTYyOTNhM2RkZWIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTc2MDYzNjU2NywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTc2MDY0MDE2NywiaWF0IjoxNzYwNjM2NTY3LCJlbWFpbCI6ImVzcGVjaWFsaXN0YXRleHRvc2RldkBhbGxmcmVlbWFpbC5uZXQifQ.hcliXw44sm09Z3Lq4MgUp9Pgfmp0EIWL5fMBqCtnGJDKG1rtbbb19GqVqRZNt7H4C4n-5SvA_-UwGP_8_tFYqVQsGedecVB-dvhQMaiIV7OvwbMQq9JxLcygsAoJkWc54AEidxj4wXn7Jczxi8v_9STpBQo2ks4Vo8GyhHDQFd1mxmuXzr-7PVR5FHDr6dqUUaQn1RjUftTnabGRwUYbHo1WKyOPpNpSvK0HGmn8csP8ldU6111t-lA_Q9cF3y1Rcx_TFSAZfKAn-Jqa9I1Wp7l6bJ8o6QK0L5kJykJfpsjgTyoJuVj7-puv-a9-BEXEwyEAwrYbXm9eTpjXXsRhmw",
|
|
35
35
|
productSelected: {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
"
|
|
36
|
+
"articleId": 121906,
|
|
37
|
+
"services": {
|
|
38
|
+
"datasheets": 1,
|
|
39
|
+
"descriptions": 1,
|
|
40
|
+
"images": 1
|
|
41
|
+
},
|
|
42
|
+
"orderId": 15514,
|
|
43
|
+
"status": "AS",
|
|
44
|
+
"datasheet_status": "AS",
|
|
45
|
+
"prio": "none",
|
|
46
|
+
"version": 3,
|
|
47
|
+
"description_status": "AS",
|
|
48
|
+
"images_status": "AS",
|
|
49
|
+
"statusByRetailer": [{
|
|
50
|
+
"status": "AS",
|
|
51
|
+
"service": "datasheet",
|
|
52
|
+
"retailer_id": 9,
|
|
53
|
+
"task_user_group_id": 2
|
|
54
|
+
}, {
|
|
55
|
+
"status": "AS",
|
|
56
|
+
"service": "description",
|
|
57
|
+
"retailer_id": 9,
|
|
58
|
+
"task_user_group_id": 2
|
|
59
|
+
}, {
|
|
60
|
+
"status": "AS",
|
|
61
|
+
"service": "images",
|
|
62
|
+
"retailer_id": 9,
|
|
63
|
+
"task_user_group_id": 2
|
|
64
|
+
}, {
|
|
65
|
+
"status": "AS",
|
|
66
|
+
"service": "datasheet",
|
|
67
|
+
"retailer_id": 17,
|
|
68
|
+
"task_user_group_id": 2
|
|
69
|
+
}, {
|
|
70
|
+
"status": "AS",
|
|
71
|
+
"service": "description",
|
|
72
|
+
"retailer_id": 17,
|
|
73
|
+
"task_user_group_id": 2
|
|
74
|
+
}, {
|
|
75
|
+
"status": "AS",
|
|
76
|
+
"service": "images",
|
|
77
|
+
"retailer_id": 17,
|
|
78
|
+
"task_user_group_id": 2
|
|
61
79
|
}, {
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
}
|
|
80
|
+
"status": "AS",
|
|
81
|
+
"service": "datasheet",
|
|
82
|
+
"retailer_id": 1011,
|
|
83
|
+
"task_user_group_id": 2
|
|
84
|
+
}, {
|
|
85
|
+
"status": "AS",
|
|
86
|
+
"service": "description",
|
|
87
|
+
"retailer_id": 1011,
|
|
88
|
+
"task_user_group_id": 2
|
|
89
|
+
}, {
|
|
90
|
+
"status": "AS",
|
|
91
|
+
"service": "images",
|
|
92
|
+
"retailer_id": 1011,
|
|
93
|
+
"task_user_group_id": 2
|
|
94
|
+
}],
|
|
95
|
+
"article": {
|
|
96
|
+
"id_article": 121906,
|
|
97
|
+
"id_category": "120",
|
|
98
|
+
"name": "Prueba Flujo Serna 22 Oct",
|
|
99
|
+
"upc": "1234321234",
|
|
100
|
+
"sku": "1243454321",
|
|
101
|
+
"timestamp": "2025-10-22T17:11:32.000Z",
|
|
102
|
+
"active": 1,
|
|
103
|
+
"company_id": 1015,
|
|
104
|
+
"company_name": "72uheudehf",
|
|
105
|
+
"country": "México",
|
|
106
|
+
"id_order": 15514,
|
|
107
|
+
"id_datasheet_especialist": 442,
|
|
108
|
+
"id_datasheet_facilitator": null,
|
|
109
|
+
"id_description_especialist": 442,
|
|
110
|
+
"id_description_facilitator": null,
|
|
111
|
+
"id_images_especialist": 443,
|
|
112
|
+
"id_images_facilitator": null,
|
|
113
|
+
"id_auditor": null,
|
|
114
|
+
"id_recepcionist": null,
|
|
115
|
+
"category": "Congelados|Cárnicos|Carnes Granel",
|
|
116
|
+
"categoryRetailer": [{
|
|
117
|
+
"id_category": 4,
|
|
118
|
+
"id_retailer": 17,
|
|
119
|
+
"category_name": "Abarrotes|Abarrotes Secos|Alimentos Deshidratados",
|
|
120
|
+
"retailer_name": "Genérico"
|
|
121
|
+
}, {
|
|
122
|
+
"id_category": 120,
|
|
123
|
+
"id_retailer": 9,
|
|
124
|
+
"category_name": "Congelados|Cárnicos|Carnes Granel",
|
|
125
|
+
"retailer_name": "Amazon"
|
|
126
|
+
}, {
|
|
127
|
+
"id_category": 157,
|
|
128
|
+
"id_retailer": 1011,
|
|
129
|
+
"category_name": "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
130
|
+
"retailer_name": "Farmatodo"
|
|
131
|
+
}]
|
|
132
|
+
},
|
|
133
|
+
"retailers": [{
|
|
134
|
+
"id": 9,
|
|
135
|
+
"name": "Amazon"
|
|
136
|
+
}, {
|
|
137
|
+
"id": 17,
|
|
138
|
+
"name": "Genérico"
|
|
139
|
+
}, {
|
|
140
|
+
"id": 1011,
|
|
141
|
+
"name": "Farmatodo"
|
|
142
|
+
}],
|
|
143
|
+
"country": "México",
|
|
144
|
+
"upc": "1234321234"
|
|
67
145
|
},
|
|
68
146
|
// location: {
|
|
69
147
|
// product: { articleId: 126855, versionId: 3 },
|
|
@@ -107,5 +185,41 @@ RetailerProductEditionDefault.args = {
|
|
|
107
185
|
"type": "PyMES"
|
|
108
186
|
},
|
|
109
187
|
"src": "https://content-management-profile.s3.amazonaws.com/id-442/442.png?1760636567736"
|
|
110
|
-
}
|
|
188
|
+
} // user: {
|
|
189
|
+
// "id_user": 443,
|
|
190
|
+
// "name": "Especialista",
|
|
191
|
+
// "last_name": "Edición",
|
|
192
|
+
// "email": "especialistaimagenesdev@allfreemail.net",
|
|
193
|
+
// "position": "Especialista de edición",
|
|
194
|
+
// "telephone": null,
|
|
195
|
+
// "country": null,
|
|
196
|
+
// "id_company": 2,
|
|
197
|
+
// "id_role": 8,
|
|
198
|
+
// "about_me": null,
|
|
199
|
+
// "address": null,
|
|
200
|
+
// "job": null,
|
|
201
|
+
// "id_stripe": null,
|
|
202
|
+
// "active": 1,
|
|
203
|
+
// "email_notify": 1,
|
|
204
|
+
// "id_cognito": "1d1394ce-4e30-4fef-8fdc-f53cf11be408",
|
|
205
|
+
// "birth_Date": null,
|
|
206
|
+
// "zip_code": null,
|
|
207
|
+
// "is_retailer": 0,
|
|
208
|
+
// "is_onboarding": 0,
|
|
209
|
+
// "is_user_tech": null,
|
|
210
|
+
// "profile_picture_ext": null,
|
|
211
|
+
// "membership": {
|
|
212
|
+
// "id": 2,
|
|
213
|
+
// "start_date": "2021-11-05T02:35:12.000Z",
|
|
214
|
+
// "end_date": "2022-11-05T02:34:49.000Z",
|
|
215
|
+
// "planID": 1,
|
|
216
|
+
// "plan": "prod_KtkvuFFLpOdP6e",
|
|
217
|
+
// "name": "Plan Free",
|
|
218
|
+
// "user_limit": "1",
|
|
219
|
+
// "products_limit": "3",
|
|
220
|
+
// "type": "PyMES"
|
|
221
|
+
// },
|
|
222
|
+
// "src": "https://content-management-profile.s3.amazonaws.com/id-443/443.png?1761067566391"
|
|
223
|
+
// }
|
|
224
|
+
|
|
111
225
|
};
|
|
@@ -865,15 +865,16 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
865
865
|
setPercentages(JSON.parse(res === null || res === void 0 ? void 0 : (_res$ = res[0]) === null || _res$ === void 0 ? void 0 : _res$.body));
|
|
866
866
|
});
|
|
867
867
|
setLoading(false);
|
|
868
|
-
_context7.next =
|
|
868
|
+
_context7.next = 27;
|
|
869
869
|
break;
|
|
870
870
|
|
|
871
871
|
case 23:
|
|
872
872
|
_context7.prev = 23;
|
|
873
873
|
_context7.t0 = _context7["catch"](0);
|
|
874
|
+
setLoading(false);
|
|
874
875
|
console.log(_context7.t0);
|
|
875
876
|
|
|
876
|
-
case
|
|
877
|
+
case 27:
|
|
877
878
|
case "end":
|
|
878
879
|
return _context7.stop();
|
|
879
880
|
}
|
|
@@ -1017,8 +1018,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1017
1018
|
|
|
1018
1019
|
case 19:
|
|
1019
1020
|
setStatusArray(arr);
|
|
1021
|
+
setLoading(false);
|
|
1020
1022
|
|
|
1021
|
-
case
|
|
1023
|
+
case 21:
|
|
1022
1024
|
case "end":
|
|
1023
1025
|
return _context10.stop();
|
|
1024
1026
|
}
|
|
@@ -1160,7 +1162,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1160
1162
|
});
|
|
1161
1163
|
|
|
1162
1164
|
if (!(dataClean.length > 0)) {
|
|
1163
|
-
_context11.next =
|
|
1165
|
+
_context11.next = 29;
|
|
1164
1166
|
break;
|
|
1165
1167
|
}
|
|
1166
1168
|
|
|
@@ -1208,11 +1210,16 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1208
1210
|
console.log(_context11.t0);
|
|
1209
1211
|
|
|
1210
1212
|
case 26:
|
|
1213
|
+
_context11.prev = 26;
|
|
1214
|
+
setLoading(false);
|
|
1215
|
+
return _context11.finish(26);
|
|
1216
|
+
|
|
1217
|
+
case 29:
|
|
1211
1218
|
case "end":
|
|
1212
1219
|
return _context11.stop();
|
|
1213
1220
|
}
|
|
1214
1221
|
}
|
|
1215
|
-
}, _callee11, null, [[7, 23]]);
|
|
1222
|
+
}, _callee11, null, [[7, 23, 26, 29]]);
|
|
1216
1223
|
}));
|
|
1217
1224
|
|
|
1218
1225
|
return function saveDescriptions() {
|
|
@@ -1233,7 +1240,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1233
1240
|
});
|
|
1234
1241
|
|
|
1235
1242
|
if (!(dataClean.length > 0)) {
|
|
1236
|
-
_context12.next =
|
|
1243
|
+
_context12.next = 29;
|
|
1237
1244
|
break;
|
|
1238
1245
|
}
|
|
1239
1246
|
|
|
@@ -1281,11 +1288,16 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1281
1288
|
console.log(_context12.t0);
|
|
1282
1289
|
|
|
1283
1290
|
case 26:
|
|
1291
|
+
_context12.prev = 26;
|
|
1292
|
+
setLoading(false);
|
|
1293
|
+
return _context12.finish(26);
|
|
1294
|
+
|
|
1295
|
+
case 29:
|
|
1284
1296
|
case "end":
|
|
1285
1297
|
return _context12.stop();
|
|
1286
1298
|
}
|
|
1287
1299
|
}
|
|
1288
|
-
}, _callee12, null, [[7, 23]]);
|
|
1300
|
+
}, _callee12, null, [[7, 23, 26, 29]]);
|
|
1289
1301
|
}));
|
|
1290
1302
|
|
|
1291
1303
|
return function saveDatasheets() {
|
|
@@ -1367,7 +1379,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1367
1379
|
}
|
|
1368
1380
|
|
|
1369
1381
|
if (!(valid && (duplicated === null || duplicated === void 0 ? void 0 : duplicated.length) === 0)) {
|
|
1370
|
-
_context13.next =
|
|
1382
|
+
_context13.next = 33;
|
|
1371
1383
|
break;
|
|
1372
1384
|
}
|
|
1373
1385
|
|
|
@@ -1424,19 +1436,24 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1424
1436
|
console.log(_context13.t0); // setMainLoading(false);
|
|
1425
1437
|
|
|
1426
1438
|
case 28:
|
|
1427
|
-
_context13.
|
|
1439
|
+
_context13.prev = 28;
|
|
1440
|
+
setLoading(false);
|
|
1441
|
+
return _context13.finish(28);
|
|
1442
|
+
|
|
1443
|
+
case 31:
|
|
1444
|
+
_context13.next = 34;
|
|
1428
1445
|
break;
|
|
1429
1446
|
|
|
1430
|
-
case
|
|
1447
|
+
case 33:
|
|
1431
1448
|
// setMainLoading(false);
|
|
1432
1449
|
setMessage("Completa los campos que solicita cada una de la imágenes o hay imágenes con el mismo tipo de toma.\nRecuerda hay campos obligatorios y no podras avanzar si no estan completos.");
|
|
1433
1450
|
|
|
1434
|
-
case
|
|
1451
|
+
case 34:
|
|
1435
1452
|
case "end":
|
|
1436
1453
|
return _context13.stop();
|
|
1437
1454
|
}
|
|
1438
1455
|
}
|
|
1439
|
-
}, _callee13, null, [[10, 25]]);
|
|
1456
|
+
}, _callee13, null, [[10, 25, 28, 31]]);
|
|
1440
1457
|
})), [images, imagesUploaded]);
|
|
1441
1458
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
1442
1459
|
var res, _product$article18, productTemp, _JSON$parse4, newStatus, newArticleStatus;
|
|
@@ -1629,7 +1646,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1629
1646
|
while (1) {
|
|
1630
1647
|
switch (_context15.prev = _context15.next) {
|
|
1631
1648
|
case 0:
|
|
1632
|
-
setLoading(true);
|
|
1649
|
+
if (!loading) setLoading(true);
|
|
1633
1650
|
_context15.prev = 1;
|
|
1634
1651
|
concept = getConcept(activeTab);
|
|
1635
1652
|
productTemp = (0, _objectSpread2.default)({}, product);
|
|
@@ -1722,16 +1739,14 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1722
1739
|
setProduct(productTemp);
|
|
1723
1740
|
|
|
1724
1741
|
case 34:
|
|
1725
|
-
_context15.next =
|
|
1742
|
+
_context15.next = 40;
|
|
1726
1743
|
break;
|
|
1727
1744
|
|
|
1728
1745
|
case 36:
|
|
1729
1746
|
_context15.prev = 36;
|
|
1730
1747
|
_context15.t0 = _context15["catch"](1);
|
|
1731
|
-
console.log(_context15.t0);
|
|
1732
|
-
|
|
1733
|
-
case 39:
|
|
1734
1748
|
setLoading(false);
|
|
1749
|
+
console.log(_context15.t0);
|
|
1735
1750
|
|
|
1736
1751
|
case 40:
|
|
1737
1752
|
case "end":
|
|
@@ -1856,13 +1871,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1856
1871
|
return allDatasheetInputs[input].required && allDatasheetInputs[input].id_retailer === activeRetailer.id && (allDatasheetInputs[input].value === undefined || !allDatasheetInputs[input].value);
|
|
1857
1872
|
})));
|
|
1858
1873
|
});
|
|
1859
|
-
console.log({
|
|
1860
|
-
dsInputsRequired: dsInputsRequired
|
|
1861
|
-
});
|
|
1862
1874
|
});
|
|
1863
1875
|
objetcTemp["Ficha técnica"] = dsInputsRequired.length;
|
|
1864
1876
|
var regex = /(<\/?p>)|(<\/?strong>)|(<br>)/gm;
|
|
1865
1877
|
descriptionsServicesArray.forEach(function (description) {
|
|
1878
|
+
if (description.id != activeRetailer.id) return;
|
|
1879
|
+
|
|
1866
1880
|
var _servicesData$filter3 = servicesData.filter(function (srv) {
|
|
1867
1881
|
return srv.id_retailer === description.id && srv.service === getConcept(activeTab);
|
|
1868
1882
|
}),
|
|
@@ -1900,6 +1914,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
1900
1914
|
}).length === 0 && requiredCounter++;
|
|
1901
1915
|
});
|
|
1902
1916
|
objetcTemp["Imágenes"] = requiredCounter;
|
|
1917
|
+
console.log({
|
|
1918
|
+
requiredCounter: requiredCounter
|
|
1919
|
+
});
|
|
1903
1920
|
setRequiredNull(objetcTemp);
|
|
1904
1921
|
} catch (error) {
|
|
1905
1922
|
console.log(error);
|
|
@@ -2023,48 +2040,74 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
2023
2040
|
});
|
|
2024
2041
|
};
|
|
2025
2042
|
|
|
2026
|
-
var deleteImages = function
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2043
|
+
var deleteImages = /*#__PURE__*/function () {
|
|
2044
|
+
var _ref22 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
2045
|
+
var values, imgsInBack, imgsLeft, data;
|
|
2046
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
2047
|
+
while (1) {
|
|
2048
|
+
switch (_context19.prev = _context19.next) {
|
|
2049
|
+
case 0:
|
|
2050
|
+
setLoading(true);
|
|
2051
|
+
values = images.values;
|
|
2052
|
+
imgsInBack = [];
|
|
2053
|
+
selectedImages.forEach(function (selectedImg) {
|
|
2054
|
+
if (selectedImg.id) imgsInBack.push(selectedImg);
|
|
2055
|
+
});
|
|
2056
|
+
imgsLeft = values.filter(function (value) {
|
|
2057
|
+
return selectedImages.indexOf(value) === -1;
|
|
2058
|
+
});
|
|
2036
2059
|
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2060
|
+
if (!(imgsInBack.length > 0)) {
|
|
2061
|
+
_context19.next = 15;
|
|
2062
|
+
break;
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
data = {
|
|
2066
|
+
articleId: product.article.id_article,
|
|
2067
|
+
deleteImages: imgsInBack,
|
|
2068
|
+
orderId: product.orderId
|
|
2069
|
+
};
|
|
2070
|
+
_context19.prev = 7;
|
|
2071
|
+
_context19.next = 10;
|
|
2072
|
+
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?image=true&version=").concat(version), data, {
|
|
2073
|
+
headers: {
|
|
2074
|
+
Authorization: token
|
|
2075
|
+
}
|
|
2076
|
+
});
|
|
2043
2077
|
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2078
|
+
case 10:
|
|
2079
|
+
_context19.next = 15;
|
|
2080
|
+
break;
|
|
2081
|
+
|
|
2082
|
+
case 12:
|
|
2083
|
+
_context19.prev = 12;
|
|
2084
|
+
_context19.t0 = _context19["catch"](7);
|
|
2085
|
+
console.log(_context19.t0);
|
|
2086
|
+
|
|
2087
|
+
case 15:
|
|
2088
|
+
setImages({
|
|
2089
|
+
action: "deleteImage",
|
|
2090
|
+
selectedImages: selectedImages
|
|
2091
|
+
});
|
|
2092
|
+
getRequired([services[0], services[1], (0, _objectSpread2.default)((0, _objectSpread2.default)({}, services[2]), {}, {
|
|
2093
|
+
values: imgsLeft
|
|
2094
|
+
})]);
|
|
2095
|
+
setLoading(false);
|
|
2096
|
+
setMessage("");
|
|
2097
|
+
setComponentsArray([]);
|
|
2098
|
+
|
|
2099
|
+
case 20:
|
|
2100
|
+
case "end":
|
|
2101
|
+
return _context19.stop();
|
|
2048
2102
|
}
|
|
2049
|
-
}
|
|
2050
|
-
}
|
|
2051
|
-
|
|
2052
|
-
}
|
|
2053
|
-
}
|
|
2103
|
+
}
|
|
2104
|
+
}, _callee19, null, [[7, 12]]);
|
|
2105
|
+
}));
|
|
2054
2106
|
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
getRequired([services[0], services[1], (0, _objectSpread2.default)((0, _objectSpread2.default)({}, services[2]), {}, {
|
|
2060
|
-
values: imgsLeft
|
|
2061
|
-
})]);
|
|
2062
|
-
setTimeout(function () {
|
|
2063
|
-
setLoading(false);
|
|
2064
|
-
}, 500);
|
|
2065
|
-
setMessage("");
|
|
2066
|
-
setComponentsArray([]);
|
|
2067
|
-
};
|
|
2107
|
+
return function deleteImages() {
|
|
2108
|
+
return _ref22.apply(this, arguments);
|
|
2109
|
+
};
|
|
2110
|
+
}();
|
|
2068
2111
|
|
|
2069
2112
|
var askToDeleteImages = function askToDeleteImages() {
|
|
2070
2113
|
if (selectedImages.length > 0) {
|
|
@@ -2117,31 +2160,31 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
2117
2160
|
}, [loading]);
|
|
2118
2161
|
|
|
2119
2162
|
var validateAll = /*#__PURE__*/function () {
|
|
2120
|
-
var
|
|
2163
|
+
var _ref23 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(result) {
|
|
2121
2164
|
var evaluationArray, conceptArray, messages, productTemp, messagesResponse;
|
|
2122
|
-
return _regenerator.default.wrap(function
|
|
2165
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
2123
2166
|
while (1) {
|
|
2124
|
-
switch (
|
|
2167
|
+
switch (_context20.prev = _context20.next) {
|
|
2125
2168
|
case 0:
|
|
2126
|
-
|
|
2169
|
+
_context20.prev = 0;
|
|
2127
2170
|
setLoading(true);
|
|
2128
2171
|
evaluationArray = [];
|
|
2129
2172
|
conceptArray = [];
|
|
2130
|
-
|
|
2131
|
-
|
|
2173
|
+
_context20.t0 = user.id_role;
|
|
2174
|
+
_context20.next = _context20.t0 === 4 ? 7 : _context20.t0 === 5 ? 9 : 11;
|
|
2132
2175
|
break;
|
|
2133
2176
|
|
|
2134
2177
|
case 7:
|
|
2135
2178
|
conceptArray = ["description", "datasheet"];
|
|
2136
|
-
return
|
|
2179
|
+
return _context20.abrupt("break", 13);
|
|
2137
2180
|
|
|
2138
2181
|
case 9:
|
|
2139
2182
|
conceptArray = ["images"];
|
|
2140
|
-
return
|
|
2183
|
+
return _context20.abrupt("break", 13);
|
|
2141
2184
|
|
|
2142
2185
|
case 11:
|
|
2143
2186
|
conceptArray = ["description", "datasheet", "images"];
|
|
2144
|
-
return
|
|
2187
|
+
return _context20.abrupt("break", 13);
|
|
2145
2188
|
|
|
2146
2189
|
case 13:
|
|
2147
2190
|
messages = [];
|
|
@@ -2164,7 +2207,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
2164
2207
|
}));
|
|
2165
2208
|
}
|
|
2166
2209
|
});
|
|
2167
|
-
|
|
2210
|
+
_context20.next = 17;
|
|
2168
2211
|
return Promise.all(evaluationArray);
|
|
2169
2212
|
|
|
2170
2213
|
case 17:
|
|
@@ -2175,44 +2218,49 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
2175
2218
|
productTemp.images_status = productTemp.images_status === "NS" ? "NS" : "".concat(result, "A");
|
|
2176
2219
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
2177
2220
|
setProduct(productTemp);
|
|
2178
|
-
|
|
2221
|
+
_context20.next = 26;
|
|
2179
2222
|
return Promise.all(messages);
|
|
2180
2223
|
|
|
2181
2224
|
case 26:
|
|
2182
|
-
messagesResponse =
|
|
2183
|
-
|
|
2225
|
+
messagesResponse = _context20.sent;
|
|
2226
|
+
_context20.next = 29;
|
|
2184
2227
|
return loadData();
|
|
2185
2228
|
|
|
2186
2229
|
case 29:
|
|
2187
|
-
|
|
2230
|
+
_context20.next = 34;
|
|
2188
2231
|
break;
|
|
2189
2232
|
|
|
2190
2233
|
case 31:
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
console.log(
|
|
2234
|
+
_context20.prev = 31;
|
|
2235
|
+
_context20.t1 = _context20["catch"](0);
|
|
2236
|
+
console.log(_context20.t1);
|
|
2194
2237
|
|
|
2195
2238
|
case 34:
|
|
2239
|
+
_context20.prev = 34;
|
|
2240
|
+
setLoading(false);
|
|
2241
|
+
return _context20.finish(34);
|
|
2242
|
+
|
|
2243
|
+
case 37:
|
|
2196
2244
|
case "end":
|
|
2197
|
-
return
|
|
2245
|
+
return _context20.stop();
|
|
2198
2246
|
}
|
|
2199
2247
|
}
|
|
2200
|
-
},
|
|
2248
|
+
}, _callee20, null, [[0, 31, 34, 37]]);
|
|
2201
2249
|
}));
|
|
2202
2250
|
|
|
2203
2251
|
return function validateAll(_x11) {
|
|
2204
|
-
return
|
|
2252
|
+
return _ref23.apply(this, arguments);
|
|
2205
2253
|
};
|
|
2206
2254
|
}();
|
|
2207
2255
|
|
|
2208
2256
|
var getObservation = /*#__PURE__*/function () {
|
|
2209
|
-
var
|
|
2257
|
+
var _ref24 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2210
2258
|
var response, parseData;
|
|
2211
|
-
return _regenerator.default.wrap(function
|
|
2259
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2212
2260
|
while (1) {
|
|
2213
|
-
switch (
|
|
2261
|
+
switch (_context21.prev = _context21.next) {
|
|
2214
2262
|
case 0:
|
|
2215
|
-
|
|
2263
|
+
_context21.next = 2;
|
|
2216
2264
|
return _axios.default.get("".concat(process.env.REACT_APP_READ_OBSERVATION, "?articleId=").concat(product.article.id_article, "&orderId=").concat(product === null || product === void 0 ? void 0 : product.orderId), {
|
|
2217
2265
|
headers: {
|
|
2218
2266
|
Authorization: sessionStorage.getItem("jwt")
|
|
@@ -2220,20 +2268,20 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
2220
2268
|
});
|
|
2221
2269
|
|
|
2222
2270
|
case 2:
|
|
2223
|
-
response =
|
|
2271
|
+
response = _context21.sent;
|
|
2224
2272
|
parseData = JSON.parse(response.data.body).data[0];
|
|
2225
2273
|
setObservation(parseData.observations);
|
|
2226
2274
|
|
|
2227
2275
|
case 5:
|
|
2228
2276
|
case "end":
|
|
2229
|
-
return
|
|
2277
|
+
return _context21.stop();
|
|
2230
2278
|
}
|
|
2231
2279
|
}
|
|
2232
|
-
},
|
|
2280
|
+
}, _callee21);
|
|
2233
2281
|
}));
|
|
2234
2282
|
|
|
2235
2283
|
return function getObservation() {
|
|
2236
|
-
return
|
|
2284
|
+
return _ref24.apply(this, arguments);
|
|
2237
2285
|
};
|
|
2238
2286
|
}();
|
|
2239
2287
|
|
|
@@ -2432,20 +2480,20 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
2432
2480
|
reviewed: crossComment
|
|
2433
2481
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2434
2482
|
buttonType: "circular-button accept-button",
|
|
2435
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2436
|
-
return _regenerator.default.wrap(function
|
|
2483
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
2484
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
2437
2485
|
while (1) {
|
|
2438
|
-
switch (
|
|
2486
|
+
switch (_context22.prev = _context22.next) {
|
|
2439
2487
|
case 0:
|
|
2440
2488
|
setCrossComment(true);
|
|
2441
2489
|
commentRevised();
|
|
2442
2490
|
|
|
2443
2491
|
case 2:
|
|
2444
2492
|
case "end":
|
|
2445
|
-
return
|
|
2493
|
+
return _context22.stop();
|
|
2446
2494
|
}
|
|
2447
2495
|
}
|
|
2448
|
-
},
|
|
2496
|
+
}, _callee22);
|
|
2449
2497
|
}))
|
|
2450
2498
|
})]
|
|
2451
2499
|
}), [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
@@ -2504,35 +2552,35 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
2504
2552
|
label: "Aceptar",
|
|
2505
2553
|
size: 12,
|
|
2506
2554
|
onClick: /*#__PURE__*/function () {
|
|
2507
|
-
var
|
|
2555
|
+
var _ref26 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(e) {
|
|
2508
2556
|
var element, body;
|
|
2509
|
-
return _regenerator.default.wrap(function
|
|
2557
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
2510
2558
|
while (1) {
|
|
2511
|
-
switch (
|
|
2559
|
+
switch (_context23.prev = _context23.next) {
|
|
2512
2560
|
case 0:
|
|
2513
2561
|
element = document.querySelector("#modal-message-box .ql-container .ql-editor > p");
|
|
2514
2562
|
|
|
2515
2563
|
if (element) {
|
|
2516
|
-
|
|
2564
|
+
_context23.next = 4;
|
|
2517
2565
|
break;
|
|
2518
2566
|
}
|
|
2519
2567
|
|
|
2520
2568
|
console.error("Elemento no encontrado");
|
|
2521
|
-
return
|
|
2569
|
+
return _context23.abrupt("return");
|
|
2522
2570
|
|
|
2523
2571
|
case 4:
|
|
2524
2572
|
body = element.innerHTML;
|
|
2525
2573
|
|
|
2526
2574
|
if (!(typeof body !== "string")) {
|
|
2527
|
-
|
|
2575
|
+
_context23.next = 8;
|
|
2528
2576
|
break;
|
|
2529
2577
|
}
|
|
2530
2578
|
|
|
2531
2579
|
console.error("El contenido de body no es una cadena", body);
|
|
2532
|
-
return
|
|
2580
|
+
return _context23.abrupt("return");
|
|
2533
2581
|
|
|
2534
2582
|
case 8:
|
|
2535
|
-
|
|
2583
|
+
_context23.next = 10;
|
|
2536
2584
|
return createComment(e, body, activeTab);
|
|
2537
2585
|
|
|
2538
2586
|
case 10:
|
|
@@ -2542,14 +2590,14 @@ var RetailerProductEdition = function RetailerProductEdition(_ref3) {
|
|
|
2542
2590
|
|
|
2543
2591
|
case 13:
|
|
2544
2592
|
case "end":
|
|
2545
|
-
return
|
|
2593
|
+
return _context23.stop();
|
|
2546
2594
|
}
|
|
2547
2595
|
}
|
|
2548
|
-
},
|
|
2596
|
+
}, _callee23);
|
|
2549
2597
|
}));
|
|
2550
2598
|
|
|
2551
2599
|
return function (_x12) {
|
|
2552
|
-
return
|
|
2600
|
+
return _ref26.apply(this, arguments);
|
|
2553
2601
|
};
|
|
2554
2602
|
}()
|
|
2555
2603
|
}, "btn-Aceptar")]
|
package/package.json
CHANGED
|
@@ -46,7 +46,7 @@ export const ProgressBar = ({ percent, progressBarType, percentRequired }) => {
|
|
|
46
46
|
<Container className={`status-${progressBarType}`}>
|
|
47
47
|
{
|
|
48
48
|
<p>{
|
|
49
|
-
|
|
49
|
+
Math.round(percent)
|
|
50
50
|
}%</p>
|
|
51
51
|
}
|
|
52
52
|
</Container>
|
|
@@ -1585,14 +1585,14 @@ export const ProductEditionv2 = ({
|
|
|
1585
1585
|
iconSize={"big-image"}
|
|
1586
1586
|
slidePosition={"top-slide"}
|
|
1587
1587
|
/>
|
|
1588
|
-
<Button
|
|
1588
|
+
{/* <Button
|
|
1589
1589
|
onClick={() => {
|
|
1590
1590
|
setShowContentohRequestModal &&
|
|
1591
1591
|
setShowContentohRequestModal(true);
|
|
1592
1592
|
}}
|
|
1593
1593
|
buttonType="general-default-button"
|
|
1594
1594
|
label="Enviar a Content-oh!"
|
|
1595
|
-
/>
|
|
1595
|
+
/> */}
|
|
1596
1596
|
</>
|
|
1597
1597
|
)}
|
|
1598
1598
|
</div>
|
|
@@ -18,40 +18,133 @@ RetailerProductEditionDefault.args = {
|
|
|
18
18
|
token:
|
|
19
19
|
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIzOWE5MDMwOS04MWNkLTQ4ZGYtODZmYi1iMjJjNGEwZTA1NTkiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjM5YTkwMzA5LTgxY2QtNDhkZi04NmZiLWIyMmM0YTBlMDU1OSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJmOGMyYWZlYS01MDFjLTRiZDItOWVkMS1lNTYyOTNhM2RkZWIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTc2MDYzNjU2NywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTc2MDY0MDE2NywiaWF0IjoxNzYwNjM2NTY3LCJlbWFpbCI6ImVzcGVjaWFsaXN0YXRleHRvc2RldkBhbGxmcmVlbWFpbC5uZXQifQ.hcliXw44sm09Z3Lq4MgUp9Pgfmp0EIWL5fMBqCtnGJDKG1rtbbb19GqVqRZNt7H4C4n-5SvA_-UwGP_8_tFYqVQsGedecVB-dvhQMaiIV7OvwbMQq9JxLcygsAoJkWc54AEidxj4wXn7Jczxi8v_9STpBQo2ks4Vo8GyhHDQFd1mxmuXzr-7PVR5FHDr6dqUUaQn1RjUftTnabGRwUYbHo1WKyOPpNpSvK0HGmn8csP8ldU6111t-lA_Q9cF3y1Rcx_TFSAZfKAn-Jqa9I1Wp7l6bJ8o6QK0L5kJykJfpsjgTyoJuVj7-puv-a9-BEXEwyEAwrYbXm9eTpjXXsRhmw",
|
|
20
20
|
productSelected: {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
21
|
+
"articleId": 121906,
|
|
22
|
+
"services": {
|
|
23
|
+
"datasheets": 1,
|
|
24
|
+
"descriptions": 1,
|
|
25
|
+
"images": 1
|
|
26
|
+
},
|
|
27
|
+
"orderId": 15514,
|
|
28
|
+
"status": "AS",
|
|
29
|
+
"datasheet_status": "AS",
|
|
30
|
+
"prio": "none",
|
|
31
|
+
"version": 3,
|
|
32
|
+
"description_status": "AS",
|
|
33
|
+
"images_status": "AS",
|
|
34
|
+
"statusByRetailer": [
|
|
35
|
+
{
|
|
36
|
+
"status": "AS",
|
|
37
|
+
"service": "datasheet",
|
|
38
|
+
"retailer_id": 9,
|
|
39
|
+
"task_user_group_id": 2
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"status": "AS",
|
|
43
|
+
"service": "description",
|
|
44
|
+
"retailer_id": 9,
|
|
45
|
+
"task_user_group_id": 2
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"status": "AS",
|
|
49
|
+
"service": "images",
|
|
50
|
+
"retailer_id": 9,
|
|
51
|
+
"task_user_group_id": 2
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"status": "AS",
|
|
55
|
+
"service": "datasheet",
|
|
56
|
+
"retailer_id": 17,
|
|
57
|
+
"task_user_group_id": 2
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"status": "AS",
|
|
61
|
+
"service": "description",
|
|
62
|
+
"retailer_id": 17,
|
|
63
|
+
"task_user_group_id": 2
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"status": "AS",
|
|
67
|
+
"service": "images",
|
|
68
|
+
"retailer_id": 17,
|
|
69
|
+
"task_user_group_id": 2
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"status": "AS",
|
|
73
|
+
"service": "datasheet",
|
|
74
|
+
"retailer_id": 1011,
|
|
75
|
+
"task_user_group_id": 2
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"status": "AS",
|
|
79
|
+
"service": "description",
|
|
80
|
+
"retailer_id": 1011,
|
|
81
|
+
"task_user_group_id": 2
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"status": "AS",
|
|
85
|
+
"service": "images",
|
|
86
|
+
"retailer_id": 1011,
|
|
87
|
+
"task_user_group_id": 2
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"article": {
|
|
91
|
+
"id_article": 121906,
|
|
92
|
+
"id_category": "120",
|
|
93
|
+
"name": "Prueba Flujo Serna 22 Oct",
|
|
94
|
+
"upc": "1234321234",
|
|
95
|
+
"sku": "1243454321",
|
|
96
|
+
"timestamp": "2025-10-22T17:11:32.000Z",
|
|
97
|
+
"active": 1,
|
|
98
|
+
"company_id": 1015,
|
|
99
|
+
"company_name": "72uheudehf",
|
|
100
|
+
"country": "México",
|
|
101
|
+
"id_order": 15514,
|
|
102
|
+
"id_datasheet_especialist": 442,
|
|
103
|
+
"id_datasheet_facilitator": null,
|
|
104
|
+
"id_description_especialist": 442,
|
|
105
|
+
"id_description_facilitator": null,
|
|
106
|
+
"id_images_especialist": 443,
|
|
107
|
+
"id_images_facilitator": null,
|
|
108
|
+
"id_auditor": null,
|
|
109
|
+
"id_recepcionist": null,
|
|
110
|
+
"category": "Congelados|Cárnicos|Carnes Granel",
|
|
111
|
+
"categoryRetailer": [
|
|
112
|
+
{
|
|
113
|
+
"id_category": 4,
|
|
114
|
+
"id_retailer": 17,
|
|
115
|
+
"category_name": "Abarrotes|Abarrotes Secos|Alimentos Deshidratados",
|
|
116
|
+
"retailer_name": "Genérico"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id_category": 120,
|
|
120
|
+
"id_retailer": 9,
|
|
121
|
+
"category_name": "Congelados|Cárnicos|Carnes Granel",
|
|
122
|
+
"retailer_name": "Amazon"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"id_category": 157,
|
|
126
|
+
"id_retailer": 1011,
|
|
127
|
+
"category_name": "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
128
|
+
"retailer_name": "Farmatodo"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"retailers": [
|
|
133
|
+
{
|
|
134
|
+
"id": 9,
|
|
135
|
+
"name": "Amazon"
|
|
136
|
+
},
|
|
42
137
|
{
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"category_name": "Abarrotes|Abarrotes Secos|Azúcar, Endulzantes y Sustitutos",
|
|
46
|
-
"retailer_name": "La Comer"
|
|
138
|
+
"id": 17,
|
|
139
|
+
"name": "Genérico"
|
|
47
140
|
},
|
|
48
141
|
{
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"category_name": "Bebés|Carriolas y Autoasientos|Autoasientos",
|
|
52
|
-
"retailer_name": "Amazon"
|
|
142
|
+
"id": 1011,
|
|
143
|
+
"name": "Farmatodo"
|
|
53
144
|
}
|
|
54
|
-
]
|
|
145
|
+
],
|
|
146
|
+
"country": "México",
|
|
147
|
+
"upc": "1234321234"
|
|
55
148
|
},
|
|
56
149
|
// location: {
|
|
57
150
|
// product: { articleId: 126855, versionId: 3 },
|
|
@@ -95,5 +188,42 @@ RetailerProductEditionDefault.args = {
|
|
|
95
188
|
"type": "PyMES"
|
|
96
189
|
},
|
|
97
190
|
"src": "https://content-management-profile.s3.amazonaws.com/id-442/442.png?1760636567736"
|
|
98
|
-
}
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
// user: {
|
|
194
|
+
// "id_user": 443,
|
|
195
|
+
// "name": "Especialista",
|
|
196
|
+
// "last_name": "Edición",
|
|
197
|
+
// "email": "especialistaimagenesdev@allfreemail.net",
|
|
198
|
+
// "position": "Especialista de edición",
|
|
199
|
+
// "telephone": null,
|
|
200
|
+
// "country": null,
|
|
201
|
+
// "id_company": 2,
|
|
202
|
+
// "id_role": 8,
|
|
203
|
+
// "about_me": null,
|
|
204
|
+
// "address": null,
|
|
205
|
+
// "job": null,
|
|
206
|
+
// "id_stripe": null,
|
|
207
|
+
// "active": 1,
|
|
208
|
+
// "email_notify": 1,
|
|
209
|
+
// "id_cognito": "1d1394ce-4e30-4fef-8fdc-f53cf11be408",
|
|
210
|
+
// "birth_Date": null,
|
|
211
|
+
// "zip_code": null,
|
|
212
|
+
// "is_retailer": 0,
|
|
213
|
+
// "is_onboarding": 0,
|
|
214
|
+
// "is_user_tech": null,
|
|
215
|
+
// "profile_picture_ext": null,
|
|
216
|
+
// "membership": {
|
|
217
|
+
// "id": 2,
|
|
218
|
+
// "start_date": "2021-11-05T02:35:12.000Z",
|
|
219
|
+
// "end_date": "2022-11-05T02:34:49.000Z",
|
|
220
|
+
// "planID": 1,
|
|
221
|
+
// "plan": "prod_KtkvuFFLpOdP6e",
|
|
222
|
+
// "name": "Plan Free",
|
|
223
|
+
// "user_limit": "1",
|
|
224
|
+
// "products_limit": "3",
|
|
225
|
+
// "type": "PyMES"
|
|
226
|
+
// },
|
|
227
|
+
// "src": "https://content-management-profile.s3.amazonaws.com/id-443/443.png?1761067566391"
|
|
228
|
+
// }
|
|
99
229
|
};
|
|
@@ -400,6 +400,7 @@ export const RetailerProductEdition = ({
|
|
|
400
400
|
}, [checkAll]);
|
|
401
401
|
|
|
402
402
|
const loadData = async () => {
|
|
403
|
+
|
|
403
404
|
try {
|
|
404
405
|
|
|
405
406
|
const categoryRetailer = (
|
|
@@ -461,8 +462,10 @@ export const RetailerProductEdition = ({
|
|
|
461
462
|
getPercentage({ data, headers }).then((res) => {
|
|
462
463
|
setPercentages(JSON.parse(res?.[0]?.body));
|
|
463
464
|
});
|
|
465
|
+
|
|
464
466
|
setLoading(false);
|
|
465
467
|
} catch (error) {
|
|
468
|
+
setLoading(false);
|
|
466
469
|
console.log(error);
|
|
467
470
|
}
|
|
468
471
|
};
|
|
@@ -547,6 +550,7 @@ export const RetailerProductEdition = ({
|
|
|
547
550
|
break;
|
|
548
551
|
}
|
|
549
552
|
setStatusArray(arr);
|
|
553
|
+
setLoading(false);
|
|
550
554
|
}, [product, version]);
|
|
551
555
|
|
|
552
556
|
const loadAssignations = (currentProduct) => {
|
|
@@ -710,6 +714,8 @@ export const RetailerProductEdition = ({
|
|
|
710
714
|
}
|
|
711
715
|
} catch (error) {
|
|
712
716
|
console.log(error);
|
|
717
|
+
} finally {
|
|
718
|
+
setLoading(false);
|
|
713
719
|
}
|
|
714
720
|
}
|
|
715
721
|
};
|
|
@@ -751,6 +757,8 @@ export const RetailerProductEdition = ({
|
|
|
751
757
|
}
|
|
752
758
|
} catch (error) {
|
|
753
759
|
console.log(error);
|
|
760
|
+
} finally {
|
|
761
|
+
setLoading(false);
|
|
754
762
|
}
|
|
755
763
|
}
|
|
756
764
|
};
|
|
@@ -846,6 +854,8 @@ export const RetailerProductEdition = ({
|
|
|
846
854
|
} catch (err) {
|
|
847
855
|
console.log(err);
|
|
848
856
|
// setMainLoading(false);
|
|
857
|
+
} finally {
|
|
858
|
+
setLoading(false);
|
|
849
859
|
}
|
|
850
860
|
} else {
|
|
851
861
|
// setMainLoading(false);
|
|
@@ -1021,7 +1031,7 @@ export const RetailerProductEdition = ({
|
|
|
1021
1031
|
};
|
|
1022
1032
|
|
|
1023
1033
|
const sendToFacilitator = async (result) => {
|
|
1024
|
-
setLoading(true);
|
|
1034
|
+
if(!loading) setLoading(true);
|
|
1025
1035
|
try {
|
|
1026
1036
|
let concept = getConcept(activeTab);
|
|
1027
1037
|
|
|
@@ -1098,9 +1108,9 @@ export const RetailerProductEdition = ({
|
|
|
1098
1108
|
setProduct(productTemp);
|
|
1099
1109
|
}
|
|
1100
1110
|
} catch (error) {
|
|
1111
|
+
setLoading(false);
|
|
1101
1112
|
console.log(error);
|
|
1102
1113
|
}
|
|
1103
|
-
setLoading(false);
|
|
1104
1114
|
};
|
|
1105
1115
|
|
|
1106
1116
|
const userAssigned = (tab, rol) => {
|
|
@@ -1196,36 +1206,44 @@ export const RetailerProductEdition = ({
|
|
|
1196
1206
|
|
|
1197
1207
|
}
|
|
1198
1208
|
);
|
|
1199
|
-
console.log({dsInputsRequired})
|
|
1200
1209
|
});
|
|
1201
1210
|
|
|
1202
1211
|
objetcTemp["Ficha técnica"] = dsInputsRequired.length;
|
|
1203
1212
|
|
|
1204
1213
|
const regex = /(<\/?p>)|(<\/?strong>)|(<br>)/gm;
|
|
1205
1214
|
descriptionsServicesArray.forEach((description) => {
|
|
1215
|
+
|
|
1216
|
+
if(description.id != activeRetailer.id) return;
|
|
1217
|
+
|
|
1206
1218
|
const [requested] = servicesData.filter(
|
|
1207
1219
|
(srv) =>
|
|
1208
1220
|
srv.id_retailer === description.id &&
|
|
1209
1221
|
srv.service === getConcept(activeTab)
|
|
1210
1222
|
);
|
|
1223
|
+
|
|
1211
1224
|
if (requested) {
|
|
1212
1225
|
description.inputs.forEach((input) => {
|
|
1226
|
+
|
|
1213
1227
|
if (
|
|
1214
1228
|
input.required &&
|
|
1215
1229
|
(!input.value || input.value?.replace(regex, "") === "")
|
|
1216
1230
|
) {
|
|
1217
1231
|
desInputsRequired++;
|
|
1218
1232
|
}
|
|
1233
|
+
|
|
1219
1234
|
});
|
|
1235
|
+
|
|
1220
1236
|
}
|
|
1221
1237
|
});
|
|
1222
1238
|
|
|
1223
1239
|
objetcTemp["Descripción"] = desInputsRequired;
|
|
1224
1240
|
|
|
1225
1241
|
const retailersRequested = [];
|
|
1242
|
+
|
|
1226
1243
|
services[2]?.retailerMandatories?.forEach((retMan) =>
|
|
1227
1244
|
retMan.forEach((rm) => retailersRequested.push(rm))
|
|
1228
1245
|
);
|
|
1246
|
+
|
|
1229
1247
|
const requiredImages = services[2]?.inputs?.filter(
|
|
1230
1248
|
(e) =>
|
|
1231
1249
|
e.required === 1 &&
|
|
@@ -1239,11 +1257,15 @@ export const RetailerProductEdition = ({
|
|
|
1239
1257
|
|
|
1240
1258
|
let requiredCounter = 0;
|
|
1241
1259
|
requiredImages?.forEach(
|
|
1242
|
-
(req) =>
|
|
1243
|
-
|
|
1260
|
+
(req) => {
|
|
1261
|
+
|
|
1262
|
+
return services[2].values.filter((img) => img.image_id === req.id).length ===
|
|
1244
1263
|
0 && requiredCounter++
|
|
1264
|
+
|
|
1265
|
+
}
|
|
1245
1266
|
);
|
|
1246
1267
|
objetcTemp["Imágenes"] = requiredCounter;
|
|
1268
|
+
console.log({requiredCounter})
|
|
1247
1269
|
setRequiredNull(objetcTemp);
|
|
1248
1270
|
} catch (error) {
|
|
1249
1271
|
console.log(error);
|
|
@@ -1325,7 +1347,7 @@ export const RetailerProductEdition = ({
|
|
|
1325
1347
|
});
|
|
1326
1348
|
};
|
|
1327
1349
|
|
|
1328
|
-
const deleteImages = () => {
|
|
1350
|
+
const deleteImages = async () => {
|
|
1329
1351
|
setLoading(true);
|
|
1330
1352
|
const { values } = images;
|
|
1331
1353
|
const imgsInBack = [];
|
|
@@ -1345,7 +1367,7 @@ export const RetailerProductEdition = ({
|
|
|
1345
1367
|
orderId: product.orderId,
|
|
1346
1368
|
};
|
|
1347
1369
|
try {
|
|
1348
|
-
axios.put(
|
|
1370
|
+
await axios.put(
|
|
1349
1371
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
|
|
1350
1372
|
data,
|
|
1351
1373
|
{
|
|
@@ -1368,9 +1390,7 @@ export const RetailerProductEdition = ({
|
|
|
1368
1390
|
{ ...services[2], values: imgsLeft },
|
|
1369
1391
|
]);
|
|
1370
1392
|
|
|
1371
|
-
|
|
1372
|
-
setLoading(false);
|
|
1373
|
-
}, 500);
|
|
1393
|
+
setLoading(false);
|
|
1374
1394
|
|
|
1375
1395
|
setMessage("");
|
|
1376
1396
|
setComponentsArray([]);
|
|
@@ -1487,6 +1507,8 @@ export const RetailerProductEdition = ({
|
|
|
1487
1507
|
await loadData();
|
|
1488
1508
|
} catch (error) {
|
|
1489
1509
|
console.log(error);
|
|
1510
|
+
} finally {
|
|
1511
|
+
setLoading(false);
|
|
1490
1512
|
}
|
|
1491
1513
|
};
|
|
1492
1514
|
|