contentoh-components-library 21.1.37 → 21.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +80 -46
- package/dist/components/pages/ProviderProductEdition/index.js +48 -21
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +33 -33
- package/dist/components/pages/RetailerProductEdition/index.js +6 -4
- package/package.json +1 -1
- package/src/components/molecules/StatusAsignationInfo/index.js +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +84 -46
- package/src/components/pages/ProviderProductEdition/index.js +68 -53
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +34 -34
- package/src/components/pages/RetailerProductEdition/index.js +7 -4
|
@@ -28,27 +28,27 @@ exports.ProviderProductEditionDefault = ProviderProductEditionDefault;
|
|
|
28
28
|
ProviderProductEditionDefault.args = {
|
|
29
29
|
tabsSections: {
|
|
30
30
|
Descripción: true,
|
|
31
|
-
"Ficha técnica":
|
|
32
|
-
Imágenes:
|
|
31
|
+
"Ficha técnica": true,
|
|
32
|
+
Imágenes: true
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
35
|
-
articleId:
|
|
36
|
-
category:
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ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39
|
+
orderId: 96,
|
|
40
40
|
status: "AA",
|
|
41
41
|
datasheet_status: "AA",
|
|
42
42
|
prio: "none",
|
|
43
43
|
version: 3,
|
|
44
44
|
description_status: "AA",
|
|
45
45
|
images_status: "AA",
|
|
46
|
-
brand:
|
|
46
|
+
brand: null,
|
|
47
47
|
retailerOrder: 0,
|
|
48
48
|
missing: {
|
|
49
|
-
datasheet:
|
|
50
|
-
descriptions:
|
|
51
|
-
images:
|
|
49
|
+
datasheet: null,
|
|
50
|
+
descriptions: null,
|
|
51
|
+
images: null
|
|
52
52
|
},
|
|
53
53
|
services: {
|
|
54
54
|
datasheets: 1,
|
|
@@ -56,52 +56,69 @@ ProviderProductEditionDefault.args = {
|
|
|
56
56
|
images: 1
|
|
57
57
|
},
|
|
58
58
|
article: {
|
|
59
|
-
category: "
|
|
59
|
+
category: "SEGURIDAD|BATERÍAS Y PILAS|BATERÍAS Y PILAS",
|
|
60
60
|
company_name: "COMPANY DEV",
|
|
61
61
|
country: "México",
|
|
62
|
-
id_category: "
|
|
62
|
+
id_category: "2568",
|
|
63
63
|
id_datasheet_especialist: 54,
|
|
64
64
|
id_datasheet_facilitator: 52,
|
|
65
65
|
id_description_especialist: 54,
|
|
66
66
|
id_description_facilitator: 52,
|
|
67
67
|
id_images_especialist: 55,
|
|
68
68
|
id_images_facilitator: 53,
|
|
69
|
-
id_order:
|
|
70
|
-
id_article:
|
|
69
|
+
id_order: 96,
|
|
70
|
+
id_article: 55154,
|
|
71
71
|
id_auditor: 37,
|
|
72
|
-
name: "
|
|
73
|
-
|
|
72
|
+
name: "Prueba 12312",
|
|
73
|
+
timestamp: "2022-07-04T22:17:43.000Z",
|
|
74
|
+
upc: "977812"
|
|
74
75
|
},
|
|
75
76
|
retailers: [{
|
|
76
|
-
id:
|
|
77
|
-
name: "
|
|
77
|
+
id: 58,
|
|
78
|
+
name: "The Home Depot Golden"
|
|
79
|
+
}, {
|
|
80
|
+
id: 59,
|
|
81
|
+
name: "The Home Depot Platinum"
|
|
78
82
|
}],
|
|
83
|
+
statusByRetailer: {
|
|
84
|
+
58: {
|
|
85
|
+
datasheet: "AA",
|
|
86
|
+
description: "AA",
|
|
87
|
+
images: "AA"
|
|
88
|
+
},
|
|
89
|
+
59: {
|
|
90
|
+
images: "AA"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
79
93
|
retailersAvailable: [{
|
|
80
|
-
id:
|
|
81
|
-
name: "
|
|
94
|
+
id: 58,
|
|
95
|
+
name: "The Home Depot Golden"
|
|
96
|
+
}, {
|
|
97
|
+
id: 59,
|
|
98
|
+
name: "The Home Depot Platinum"
|
|
82
99
|
}],
|
|
83
|
-
categoryName: "
|
|
84
|
-
upc: "
|
|
85
|
-
id_article:
|
|
86
|
-
id_order:
|
|
100
|
+
categoryName: "SEGURIDAD|BATERÍAS Y PILAS|BATERÍAS Y PILAS",
|
|
101
|
+
upc: "977812",
|
|
102
|
+
id_article: 55154,
|
|
103
|
+
id_order: 96
|
|
87
104
|
},
|
|
88
105
|
productToEdit: {
|
|
89
|
-
ArticleId:
|
|
90
|
-
idCategory: "
|
|
106
|
+
ArticleId: 55154,
|
|
107
|
+
idCategory: "2568",
|
|
91
108
|
product: {
|
|
92
|
-
orderId:
|
|
109
|
+
orderId: 96,
|
|
93
110
|
status: "AA",
|
|
94
111
|
datasheet_status: "AA",
|
|
95
112
|
prio: "none",
|
|
96
113
|
version: 3,
|
|
97
114
|
description_status: "AA",
|
|
98
115
|
images_status: "AA",
|
|
99
|
-
brand:
|
|
116
|
+
brand: null,
|
|
100
117
|
retailerOrder: 0,
|
|
101
118
|
missing: {
|
|
102
|
-
datasheet:
|
|
103
|
-
descriptions:
|
|
104
|
-
images:
|
|
119
|
+
datasheet: null,
|
|
120
|
+
descriptions: null,
|
|
121
|
+
images: null
|
|
105
122
|
},
|
|
106
123
|
services: {
|
|
107
124
|
datasheets: 1,
|
|
@@ -109,34 +126,51 @@ ProviderProductEditionDefault.args = {
|
|
|
109
126
|
images: 1
|
|
110
127
|
},
|
|
111
128
|
article: {
|
|
112
|
-
category: "
|
|
129
|
+
category: "SEGURIDAD|BATERÍAS Y PILAS|BATERÍAS Y PILAS",
|
|
113
130
|
company_name: "COMPANY DEV",
|
|
114
131
|
country: "México",
|
|
115
|
-
id_category: "
|
|
132
|
+
id_category: "2568",
|
|
116
133
|
id_datasheet_especialist: 54,
|
|
117
134
|
id_datasheet_facilitator: 52,
|
|
118
135
|
id_description_especialist: 54,
|
|
119
136
|
id_description_facilitator: 52,
|
|
120
137
|
id_images_especialist: 55,
|
|
121
138
|
id_images_facilitator: 53,
|
|
122
|
-
id_order:
|
|
123
|
-
id_article:
|
|
139
|
+
id_order: 96,
|
|
140
|
+
id_article: 55154,
|
|
124
141
|
id_auditor: 37,
|
|
125
|
-
name: "
|
|
126
|
-
|
|
142
|
+
name: "Prueba 12312",
|
|
143
|
+
timestamp: "2022-07-04T22:17:43.000Z",
|
|
144
|
+
upc: "977812"
|
|
127
145
|
},
|
|
128
146
|
retailers: [{
|
|
129
|
-
id:
|
|
130
|
-
name: "
|
|
147
|
+
id: 58,
|
|
148
|
+
name: "The Home Depot Golden"
|
|
149
|
+
}, {
|
|
150
|
+
id: 59,
|
|
151
|
+
name: "The Home Depot Platinum"
|
|
131
152
|
}],
|
|
153
|
+
statusByRetailer: {
|
|
154
|
+
58: {
|
|
155
|
+
datasheet: "AA",
|
|
156
|
+
description: "AA",
|
|
157
|
+
images: "AA"
|
|
158
|
+
},
|
|
159
|
+
59: {
|
|
160
|
+
images: "AA"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
132
163
|
retailersAvailable: [{
|
|
133
|
-
id:
|
|
134
|
-
name: "
|
|
164
|
+
id: 58,
|
|
165
|
+
name: "The Home Depot Golden"
|
|
166
|
+
}, {
|
|
167
|
+
id: 59,
|
|
168
|
+
name: "The Home Depot Platinum"
|
|
135
169
|
}],
|
|
136
|
-
categoryName: "
|
|
137
|
-
upc: "
|
|
138
|
-
id_article:
|
|
139
|
-
id_order:
|
|
170
|
+
categoryName: "SEGURIDAD|BATERÍAS Y PILAS|BATERÍAS Y PILAS",
|
|
171
|
+
upc: "977812",
|
|
172
|
+
id_article: 55154,
|
|
173
|
+
id_order: 96
|
|
140
174
|
}
|
|
141
175
|
},
|
|
142
176
|
location: {
|
|
@@ -179,6 +213,6 @@ ProviderProductEditionDefault.args = {
|
|
|
179
213
|
products_limit: "5000",
|
|
180
214
|
type: "Enterprise"
|
|
181
215
|
},
|
|
182
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?
|
|
216
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1656972421501"
|
|
183
217
|
}
|
|
184
218
|
};
|
|
@@ -473,6 +473,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
473
473
|
saving = _useState82[0],
|
|
474
474
|
setSaving = _useState82[1];
|
|
475
475
|
|
|
476
|
+
var _useState83 = (0, _react.useState)(product.statusByRetailer),
|
|
477
|
+
_useState84 = (0, _slicedToArray2.default)(_useState83, 2),
|
|
478
|
+
retailerStatus = _useState84[0],
|
|
479
|
+
setRetailerStatus = _useState84[1];
|
|
480
|
+
|
|
476
481
|
(0, _react.useEffect)(function () {
|
|
477
482
|
checkAll && setSelectedImages(images.values);
|
|
478
483
|
}, [checkAll]);
|
|
@@ -1341,7 +1346,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1341
1346
|
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(result) {
|
|
1342
1347
|
var _productTemp$id_order;
|
|
1343
1348
|
|
|
1344
|
-
var concept, productTemp, articleId, orderId, evalStatus, data, retailerId, res, orderStatus, newProductEdit;
|
|
1349
|
+
var concept, productTemp, articleId, orderId, evalStatus, data, retailerId, res, orderStatus, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status, newProductEdit;
|
|
1350
|
+
|
|
1345
1351
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1346
1352
|
while (1) {
|
|
1347
1353
|
switch (_context12.prev = _context12.next) {
|
|
@@ -1395,11 +1401,22 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1395
1401
|
|
|
1396
1402
|
case 22:
|
|
1397
1403
|
if (!(res.data.statusCode === 200)) {
|
|
1398
|
-
_context12.next =
|
|
1404
|
+
_context12.next = 38;
|
|
1399
1405
|
break;
|
|
1400
1406
|
}
|
|
1401
1407
|
|
|
1402
|
-
|
|
1408
|
+
_JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
|
|
1409
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1410
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1411
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1412
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1413
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1414
|
+
|
|
1415
|
+
if (newServiceStatus) {
|
|
1416
|
+
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1417
|
+
productTemp["".concat(concept, "_status")] = status;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1403
1420
|
setProduct(productTemp);
|
|
1404
1421
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1405
1422
|
newProductEdit = {
|
|
@@ -1410,26 +1427,26 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1410
1427
|
setProductEdit(newProductEdit);
|
|
1411
1428
|
sessionStorage.setItem("productEdit", JSON.stringify(newProductEdit));
|
|
1412
1429
|
setOrigin(function (prev) {
|
|
1413
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept,
|
|
1430
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1414
1431
|
});
|
|
1415
|
-
_context12.next =
|
|
1432
|
+
_context12.next = 38;
|
|
1416
1433
|
return loadData();
|
|
1417
1434
|
|
|
1418
|
-
case
|
|
1419
|
-
_context12.next =
|
|
1435
|
+
case 38:
|
|
1436
|
+
_context12.next = 43;
|
|
1420
1437
|
break;
|
|
1421
1438
|
|
|
1422
|
-
case
|
|
1423
|
-
_context12.prev =
|
|
1439
|
+
case 40:
|
|
1440
|
+
_context12.prev = 40;
|
|
1424
1441
|
_context12.t0 = _context12["catch"](8);
|
|
1425
1442
|
console.log(_context12.t0);
|
|
1426
1443
|
|
|
1427
|
-
case
|
|
1444
|
+
case 43:
|
|
1428
1445
|
case "end":
|
|
1429
1446
|
return _context12.stop();
|
|
1430
1447
|
}
|
|
1431
1448
|
}
|
|
1432
|
-
}, _callee12, null, [[8,
|
|
1449
|
+
}, _callee12, null, [[8, 40]]);
|
|
1433
1450
|
}));
|
|
1434
1451
|
|
|
1435
1452
|
return function sendEvaluation(_x7) {
|
|
@@ -1439,7 +1456,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1439
1456
|
|
|
1440
1457
|
var validateAll = /*#__PURE__*/function () {
|
|
1441
1458
|
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
|
|
1442
|
-
var evaluationArray, sendAll, conceptArray, productTemp;
|
|
1459
|
+
var evaluationArray, sendAll, conceptArray, productTemp, retailerStatusCopy;
|
|
1443
1460
|
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
1444
1461
|
while (1) {
|
|
1445
1462
|
switch (_context13.prev = _context13.next) {
|
|
@@ -1492,6 +1509,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1492
1509
|
productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "CA");
|
|
1493
1510
|
productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result, "CA");
|
|
1494
1511
|
productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "CA");
|
|
1512
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1513
|
+
Object.keys(retailerStatusCopy).forEach(function (key) {
|
|
1514
|
+
conceptArray.forEach(function (concept) {
|
|
1515
|
+
if (retailerStatusCopy[key][concept]) {
|
|
1516
|
+
retailerStatusCopy[key][concept] = "".concat(result, "CA");
|
|
1517
|
+
}
|
|
1518
|
+
});
|
|
1519
|
+
});
|
|
1520
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1521
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1495
1522
|
setProduct(productTemp);
|
|
1496
1523
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1497
1524
|
setProductEdit({
|
|
@@ -1504,24 +1531,24 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1504
1531
|
idCategory: productTemp.article.id_category,
|
|
1505
1532
|
product: productTemp
|
|
1506
1533
|
}));
|
|
1507
|
-
_context13.next =
|
|
1534
|
+
_context13.next = 26;
|
|
1508
1535
|
return loadData();
|
|
1509
1536
|
|
|
1510
|
-
case
|
|
1511
|
-
_context13.next =
|
|
1537
|
+
case 26:
|
|
1538
|
+
_context13.next = 31;
|
|
1512
1539
|
break;
|
|
1513
1540
|
|
|
1514
|
-
case
|
|
1515
|
-
_context13.prev =
|
|
1541
|
+
case 28:
|
|
1542
|
+
_context13.prev = 28;
|
|
1516
1543
|
_context13.t0 = _context13["catch"](0);
|
|
1517
1544
|
console.log(_context13.t0);
|
|
1518
1545
|
|
|
1519
|
-
case
|
|
1546
|
+
case 31:
|
|
1520
1547
|
case "end":
|
|
1521
1548
|
return _context13.stop();
|
|
1522
1549
|
}
|
|
1523
1550
|
}
|
|
1524
|
-
}, _callee13, null, [[0,
|
|
1551
|
+
}, _callee13, null, [[0, 28]]);
|
|
1525
1552
|
}));
|
|
1526
1553
|
|
|
1527
1554
|
return function validateAll(_x8) {
|
|
@@ -1772,7 +1799,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1772
1799
|
}
|
|
1773
1800
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1774
1801
|
tabsSections: tabsSections,
|
|
1775
|
-
status:
|
|
1802
|
+
status: activeRetailer.id ? retailerStatus[activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id][getConcept(activeTab)] || "NS" : "-",
|
|
1776
1803
|
activeTab: activeTab,
|
|
1777
1804
|
setActiveTab: setActiveTab,
|
|
1778
1805
|
setImageLayout: setImageLayout,
|
|
@@ -1891,7 +1918,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1891
1918
|
}))
|
|
1892
1919
|
})]
|
|
1893
1920
|
})
|
|
1894
|
-
}) : revision
|
|
1921
|
+
}) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1895
1922
|
className: "required-inputs-message",
|
|
1896
1923
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1897
1924
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -39,55 +39,55 @@ RetailerProductEditionDefault.args = {
|
|
|
39
39
|
"Ficha técnica": false,
|
|
40
40
|
Imágenes: false
|
|
41
41
|
},
|
|
42
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
42
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI3MTNhNzQ1Ny1mOTQzLTRiYzktOGViMC04NmI0MWY1YmQ0ZjgiLCJjb2duaXRvOmdyb3VwcyI6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46
|
-
descriptions:
|
|
45
|
+
datasheets: 0,
|
|
46
|
+
descriptions: 0,
|
|
47
47
|
images: 1
|
|
48
48
|
},
|
|
49
|
-
orderId:
|
|
50
|
-
status: "
|
|
51
|
-
datasheet_status: "
|
|
49
|
+
orderId: 97,
|
|
50
|
+
status: "PA",
|
|
51
|
+
datasheet_status: "NS",
|
|
52
52
|
prio: "none",
|
|
53
|
-
version:
|
|
54
|
-
description_status: "
|
|
55
|
-
images_status:
|
|
53
|
+
version: 2,
|
|
54
|
+
description_status: "NS",
|
|
55
|
+
images_status: null,
|
|
56
56
|
article: {
|
|
57
|
-
id_article:
|
|
58
|
-
id_category: "
|
|
59
|
-
name: "
|
|
60
|
-
upc: "
|
|
61
|
-
timestamp: "2022-
|
|
57
|
+
id_article: 76130,
|
|
58
|
+
id_category: "696",
|
|
59
|
+
name: "mascarilla para cabello",
|
|
60
|
+
upc: "54645454",
|
|
61
|
+
timestamp: "2022-07-05T17:50:35.000Z",
|
|
62
62
|
id_user: 28,
|
|
63
63
|
status: "NULL",
|
|
64
64
|
active: 1,
|
|
65
65
|
company_id: 1,
|
|
66
66
|
company_name: "COMPANY DEV",
|
|
67
67
|
country: "México",
|
|
68
|
-
id_order:
|
|
69
|
-
id_datasheet_especialist:
|
|
70
|
-
id_datasheet_facilitator:
|
|
71
|
-
id_description_especialist:
|
|
72
|
-
id_description_facilitator:
|
|
68
|
+
id_order: 97,
|
|
69
|
+
id_datasheet_especialist: null,
|
|
70
|
+
id_datasheet_facilitator: null,
|
|
71
|
+
id_description_especialist: null,
|
|
72
|
+
id_description_facilitator: null,
|
|
73
73
|
id_images_especialist: 55,
|
|
74
74
|
id_images_facilitator: 53,
|
|
75
|
-
id_auditor:
|
|
75
|
+
id_auditor: 30,
|
|
76
76
|
id_recepcionist: null,
|
|
77
|
-
category: "
|
|
78
|
-
missingAttributes:
|
|
79
|
-
missingDescriptions:
|
|
80
|
-
missingImages:
|
|
77
|
+
category: "SALUD Y BELLEZA|CUIDADO DEL CABELLO|CAPILARES",
|
|
78
|
+
missingAttributes: null,
|
|
79
|
+
missingDescriptions: null,
|
|
80
|
+
missingImages: null
|
|
81
81
|
},
|
|
82
82
|
retailers: [{
|
|
83
|
-
id:
|
|
84
|
-
name: "
|
|
83
|
+
id: 12,
|
|
84
|
+
name: "La Comer",
|
|
85
85
|
country: "México",
|
|
86
86
|
id_region: 1,
|
|
87
87
|
active: 1
|
|
88
88
|
}],
|
|
89
89
|
country: "México",
|
|
90
|
-
upc: "
|
|
90
|
+
upc: "54645454"
|
|
91
91
|
},
|
|
92
92
|
location: {
|
|
93
93
|
services: {
|
|
@@ -139,22 +139,22 @@ RetailerProductEditionDefault.args = {
|
|
|
139
139
|
upc: "807526"
|
|
140
140
|
},
|
|
141
141
|
user: {
|
|
142
|
-
id_user:
|
|
143
|
-
name: "
|
|
142
|
+
id_user: 55,
|
|
143
|
+
name: "ESPECIALISTA ED PRUEBA",
|
|
144
144
|
last_name: "",
|
|
145
|
-
email: "
|
|
145
|
+
email: "hcarrillo@contentoh.com",
|
|
146
146
|
position: null,
|
|
147
147
|
telephone: null,
|
|
148
148
|
country: null,
|
|
149
149
|
id_company: 2,
|
|
150
|
-
id_cognito: "
|
|
150
|
+
id_cognito: "713a7457-f943-4bc9-8eb0-86b41f5bd4f8",
|
|
151
151
|
birth_Date: null,
|
|
152
152
|
about_me: null,
|
|
153
153
|
zip_code: null,
|
|
154
154
|
address: null,
|
|
155
155
|
job: null,
|
|
156
156
|
id_stripe: null,
|
|
157
|
-
id_role:
|
|
157
|
+
id_role: 8,
|
|
158
158
|
active: 1,
|
|
159
159
|
is_retailer: 0,
|
|
160
160
|
email_notify: 0,
|
|
@@ -169,6 +169,6 @@ RetailerProductEditionDefault.args = {
|
|
|
169
169
|
products_limit: "3",
|
|
170
170
|
type: "PyMES"
|
|
171
171
|
},
|
|
172
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
172
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-55/55.png?1657046945610"
|
|
173
173
|
}
|
|
174
174
|
};
|
|
@@ -1006,7 +1006,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1006
1006
|
})), [dataImages, imagesUploaded]);
|
|
1007
1007
|
|
|
1008
1008
|
var evaluationFinished = function evaluationFinished(userId, tab, statusArray) {
|
|
1009
|
-
var _srv$find, _srv$find$status
|
|
1009
|
+
var _srv$find, _srv$find$status, _product$;
|
|
1010
1010
|
|
|
1011
1011
|
var srv = servicesData.filter(function (serv) {
|
|
1012
1012
|
return serv.service === getConcept(tab);
|
|
@@ -1014,7 +1014,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1014
1014
|
var srvActive = (_srv$find = srv.find(function (serv) {
|
|
1015
1015
|
return serv.id_retailer === (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id);
|
|
1016
1016
|
})) === null || _srv$find === void 0 ? void 0 : (_srv$find$status = _srv$find.status) === null || _srv$find$status === void 0 ? void 0 : _srv$find$status.replace(/.*\//, "");
|
|
1017
|
-
var currStatus = product["".concat(getConcept(tab), "_status")]
|
|
1017
|
+
var currStatus = (_product$ = product["".concat(getConcept(tab), "_status")]) === null || _product$ === void 0 ? void 0 : _product$.replace(/.*\//, "");
|
|
1018
1018
|
var unvalidated = ["IE", "CA"].includes(currStatus);
|
|
1019
1019
|
var auditorUnvalidated = !["RA", "AA", "ACA", "AP"].includes(currStatus);
|
|
1020
1020
|
|
|
@@ -1313,7 +1313,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1313
1313
|
requested = _servicesData$filter4[0];
|
|
1314
1314
|
|
|
1315
1315
|
requested && description.inputs.forEach(function (input) {
|
|
1316
|
-
|
|
1316
|
+
var _input$value;
|
|
1317
|
+
|
|
1318
|
+
return input.required && (!input.value || ((_input$value = input.value) === null || _input$value === void 0 ? void 0 : _input$value.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "")) === "") && desInputsRequired++;
|
|
1317
1319
|
});
|
|
1318
1320
|
});
|
|
1319
1321
|
objetcTemp["Descripción"] = desInputsRequired;
|
|
@@ -1742,7 +1744,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1742
1744
|
assig: assig[activeTab],
|
|
1743
1745
|
setAssignation: setAssignation,
|
|
1744
1746
|
isRetailer: isRetailer,
|
|
1745
|
-
showSaveButton: userAssigned(),
|
|
1747
|
+
showSaveButton: auditorAssigned() || userAssigned(),
|
|
1746
1748
|
onClickSave: function onClickSave() {
|
|
1747
1749
|
switch (activeTab) {
|
|
1748
1750
|
case "Descripción":
|
package/package.json
CHANGED
|
@@ -70,7 +70,7 @@ export const StatusAsignationInfo = ({
|
|
|
70
70
|
slidefront={slidefront}
|
|
71
71
|
iconSize={"medium-image"}
|
|
72
72
|
slidePosition={"bottom-slide"}
|
|
73
|
-
|
|
73
|
+
/>
|
|
74
74
|
{status !== "-" && <StatusTag statusType={status} ovalForm={true} />}
|
|
75
75
|
{showSaveButton && (
|
|
76
76
|
<Button
|
|
@@ -12,28 +12,28 @@ export const ProviderProductEditionDefault = Template.bind({});
|
|
|
12
12
|
ProviderProductEditionDefault.args = {
|
|
13
13
|
tabsSections: {
|
|
14
14
|
Descripción: true,
|
|
15
|
-
"Ficha técnica":
|
|
16
|
-
Imágenes:
|
|
15
|
+
"Ficha técnica": true,
|
|
16
|
+
Imágenes: true,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
20
|
-
articleId:
|
|
21
|
-
category:
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUw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M1jsHoOIvDDQJjvJGkqu63B-d5_G2vf2u_LfcQ",
|
|
20
|
+
articleId: 55154,
|
|
21
|
+
category: 2568,
|
|
22
22
|
version: 3,
|
|
23
23
|
productSelected: {
|
|
24
|
-
orderId:
|
|
24
|
+
orderId: 96,
|
|
25
25
|
status: "AA",
|
|
26
26
|
datasheet_status: "AA",
|
|
27
27
|
prio: "none",
|
|
28
28
|
version: 3,
|
|
29
29
|
description_status: "AA",
|
|
30
30
|
images_status: "AA",
|
|
31
|
-
brand:
|
|
31
|
+
brand: null,
|
|
32
32
|
retailerOrder: 0,
|
|
33
33
|
missing: {
|
|
34
|
-
datasheet:
|
|
35
|
-
descriptions:
|
|
36
|
-
images:
|
|
34
|
+
datasheet: null,
|
|
35
|
+
descriptions: null,
|
|
36
|
+
images: null,
|
|
37
37
|
},
|
|
38
38
|
services: {
|
|
39
39
|
datasheets: 1,
|
|
@@ -41,56 +41,75 @@ ProviderProductEditionDefault.args = {
|
|
|
41
41
|
images: 1,
|
|
42
42
|
},
|
|
43
43
|
article: {
|
|
44
|
-
category: "
|
|
44
|
+
category: "SEGURIDAD|BATERÍAS Y PILAS|BATERÍAS Y PILAS",
|
|
45
45
|
company_name: "COMPANY DEV",
|
|
46
46
|
country: "México",
|
|
47
|
-
id_category: "
|
|
47
|
+
id_category: "2568",
|
|
48
48
|
id_datasheet_especialist: 54,
|
|
49
49
|
id_datasheet_facilitator: 52,
|
|
50
50
|
id_description_especialist: 54,
|
|
51
51
|
id_description_facilitator: 52,
|
|
52
52
|
id_images_especialist: 55,
|
|
53
53
|
id_images_facilitator: 53,
|
|
54
|
-
id_order:
|
|
55
|
-
id_article:
|
|
54
|
+
id_order: 96,
|
|
55
|
+
id_article: 55154,
|
|
56
56
|
id_auditor: 37,
|
|
57
|
-
name: "
|
|
58
|
-
|
|
57
|
+
name: "Prueba 12312",
|
|
58
|
+
timestamp: "2022-07-04T22:17:43.000Z",
|
|
59
|
+
upc: "977812",
|
|
59
60
|
},
|
|
60
61
|
retailers: [
|
|
61
62
|
{
|
|
62
|
-
id:
|
|
63
|
-
name: "
|
|
63
|
+
id: 58,
|
|
64
|
+
name: "The Home Depot Golden",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 59,
|
|
68
|
+
name: "The Home Depot Platinum",
|
|
64
69
|
},
|
|
65
70
|
],
|
|
71
|
+
statusByRetailer: {
|
|
72
|
+
58: {
|
|
73
|
+
datasheet: "AA",
|
|
74
|
+
description: "AA",
|
|
75
|
+
images: "AA",
|
|
76
|
+
},
|
|
77
|
+
59: {
|
|
78
|
+
images: "AA",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
66
81
|
retailersAvailable: [
|
|
67
82
|
{
|
|
68
|
-
id:
|
|
69
|
-
name: "
|
|
83
|
+
id: 58,
|
|
84
|
+
name: "The Home Depot Golden",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 59,
|
|
88
|
+
name: "The Home Depot Platinum",
|
|
70
89
|
},
|
|
71
90
|
],
|
|
72
|
-
categoryName: "
|
|
73
|
-
upc: "
|
|
74
|
-
id_article:
|
|
75
|
-
id_order:
|
|
91
|
+
categoryName: "SEGURIDAD|BATERÍAS Y PILAS|BATERÍAS Y PILAS",
|
|
92
|
+
upc: "977812",
|
|
93
|
+
id_article: 55154,
|
|
94
|
+
id_order: 96,
|
|
76
95
|
},
|
|
77
96
|
productToEdit: {
|
|
78
|
-
ArticleId:
|
|
79
|
-
idCategory: "
|
|
97
|
+
ArticleId: 55154,
|
|
98
|
+
idCategory: "2568",
|
|
80
99
|
product: {
|
|
81
|
-
orderId:
|
|
100
|
+
orderId: 96,
|
|
82
101
|
status: "AA",
|
|
83
102
|
datasheet_status: "AA",
|
|
84
103
|
prio: "none",
|
|
85
104
|
version: 3,
|
|
86
105
|
description_status: "AA",
|
|
87
106
|
images_status: "AA",
|
|
88
|
-
brand:
|
|
107
|
+
brand: null,
|
|
89
108
|
retailerOrder: 0,
|
|
90
109
|
missing: {
|
|
91
|
-
datasheet:
|
|
92
|
-
descriptions:
|
|
93
|
-
images:
|
|
110
|
+
datasheet: null,
|
|
111
|
+
descriptions: null,
|
|
112
|
+
images: null,
|
|
94
113
|
},
|
|
95
114
|
services: {
|
|
96
115
|
datasheets: 1,
|
|
@@ -98,38 +117,57 @@ ProviderProductEditionDefault.args = {
|
|
|
98
117
|
images: 1,
|
|
99
118
|
},
|
|
100
119
|
article: {
|
|
101
|
-
category: "
|
|
120
|
+
category: "SEGURIDAD|BATERÍAS Y PILAS|BATERÍAS Y PILAS",
|
|
102
121
|
company_name: "COMPANY DEV",
|
|
103
122
|
country: "México",
|
|
104
|
-
id_category: "
|
|
123
|
+
id_category: "2568",
|
|
105
124
|
id_datasheet_especialist: 54,
|
|
106
125
|
id_datasheet_facilitator: 52,
|
|
107
126
|
id_description_especialist: 54,
|
|
108
127
|
id_description_facilitator: 52,
|
|
109
128
|
id_images_especialist: 55,
|
|
110
129
|
id_images_facilitator: 53,
|
|
111
|
-
id_order:
|
|
112
|
-
id_article:
|
|
130
|
+
id_order: 96,
|
|
131
|
+
id_article: 55154,
|
|
113
132
|
id_auditor: 37,
|
|
114
|
-
name: "
|
|
115
|
-
|
|
133
|
+
name: "Prueba 12312",
|
|
134
|
+
timestamp: "2022-07-04T22:17:43.000Z",
|
|
135
|
+
upc: "977812",
|
|
116
136
|
},
|
|
117
137
|
retailers: [
|
|
118
138
|
{
|
|
119
|
-
id:
|
|
120
|
-
name: "
|
|
139
|
+
id: 58,
|
|
140
|
+
name: "The Home Depot Golden",
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: 59,
|
|
144
|
+
name: "The Home Depot Platinum",
|
|
121
145
|
},
|
|
122
146
|
],
|
|
147
|
+
statusByRetailer: {
|
|
148
|
+
58: {
|
|
149
|
+
datasheet: "AA",
|
|
150
|
+
description: "AA",
|
|
151
|
+
images: "AA",
|
|
152
|
+
},
|
|
153
|
+
59: {
|
|
154
|
+
images: "AA",
|
|
155
|
+
},
|
|
156
|
+
},
|
|
123
157
|
retailersAvailable: [
|
|
124
158
|
{
|
|
125
|
-
id:
|
|
126
|
-
name: "
|
|
159
|
+
id: 58,
|
|
160
|
+
name: "The Home Depot Golden",
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: 59,
|
|
164
|
+
name: "The Home Depot Platinum",
|
|
127
165
|
},
|
|
128
166
|
],
|
|
129
|
-
categoryName: "
|
|
130
|
-
upc: "
|
|
131
|
-
id_article:
|
|
132
|
-
id_order:
|
|
167
|
+
categoryName: "SEGURIDAD|BATERÍAS Y PILAS|BATERÍAS Y PILAS",
|
|
168
|
+
upc: "977812",
|
|
169
|
+
id_article: 55154,
|
|
170
|
+
id_order: 96,
|
|
133
171
|
},
|
|
134
172
|
},
|
|
135
173
|
location: {
|
|
@@ -167,6 +205,6 @@ ProviderProductEditionDefault.args = {
|
|
|
167
205
|
products_limit: "5000",
|
|
168
206
|
type: "Enterprise",
|
|
169
207
|
},
|
|
170
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?
|
|
208
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1656972421501",
|
|
171
209
|
},
|
|
172
210
|
};
|
|
@@ -208,6 +208,9 @@ export const ProviderProductEdition = ({
|
|
|
208
208
|
const [modalViewTextArea, setModalViewTextArea] = useState(false);
|
|
209
209
|
const [socketType, setSocketType] = useState(null);
|
|
210
210
|
const [saving, setSaving] = useState(loading);
|
|
211
|
+
const [retailerStatus, setRetailerStatus] = useState(
|
|
212
|
+
product.statusByRetailer
|
|
213
|
+
);
|
|
211
214
|
|
|
212
215
|
useEffect(() => {
|
|
213
216
|
checkAll && setSelectedImages(images.values);
|
|
@@ -840,7 +843,19 @@ export const ProviderProductEdition = ({
|
|
|
840
843
|
});
|
|
841
844
|
}
|
|
842
845
|
if (res.data.statusCode === 200) {
|
|
843
|
-
|
|
846
|
+
const { newArticleStatus, newServiceStatus, newStatus } = JSON.parse(
|
|
847
|
+
res.data.body
|
|
848
|
+
);
|
|
849
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
850
|
+
const retailerStatusCopy = { ...retailerStatus };
|
|
851
|
+
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
852
|
+
setRetailerStatus(retailerStatusCopy);
|
|
853
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
854
|
+
let status;
|
|
855
|
+
if (newServiceStatus) {
|
|
856
|
+
status = newServiceStatus[articleId][`${concept}Status`];
|
|
857
|
+
productTemp[`${concept}_status`] = status;
|
|
858
|
+
}
|
|
844
859
|
setProduct(productTemp);
|
|
845
860
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
846
861
|
const newProductEdit = {
|
|
@@ -850,7 +865,7 @@ export const ProviderProductEdition = ({
|
|
|
850
865
|
};
|
|
851
866
|
setProductEdit(newProductEdit);
|
|
852
867
|
sessionStorage.setItem("productEdit", JSON.stringify(newProductEdit));
|
|
853
|
-
setOrigin((prev) => ({ ...prev, [concept]:
|
|
868
|
+
setOrigin((prev) => ({ ...prev, [concept]: status }));
|
|
854
869
|
await loadData();
|
|
855
870
|
}
|
|
856
871
|
} catch (err) {
|
|
@@ -908,6 +923,17 @@ export const ProviderProductEdition = ({
|
|
|
908
923
|
productTemp.description_status === "NA" ? "NA" : `${result}CA`;
|
|
909
924
|
productTemp.images_status =
|
|
910
925
|
productTemp.images_status === "NA" ? "NA" : `${result}CA`;
|
|
926
|
+
|
|
927
|
+
const retailerStatusCopy = { ...retailerStatus };
|
|
928
|
+
Object.keys(retailerStatusCopy).forEach((key) => {
|
|
929
|
+
conceptArray.forEach((concept) => {
|
|
930
|
+
if (retailerStatusCopy[key][concept]) {
|
|
931
|
+
retailerStatusCopy[key][concept] = `${result}CA`;
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
});
|
|
935
|
+
setRetailerStatus(retailerStatusCopy);
|
|
936
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
911
937
|
setProduct(productTemp);
|
|
912
938
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
913
939
|
setProductEdit({
|
|
@@ -1163,8 +1189,10 @@ export const ProviderProductEdition = ({
|
|
|
1163
1189
|
<FullTabsMenu
|
|
1164
1190
|
tabsSections={tabsSections}
|
|
1165
1191
|
status={
|
|
1166
|
-
|
|
1167
|
-
|
|
1192
|
+
activeRetailer.id
|
|
1193
|
+
? retailerStatus[activeRetailer?.id][getConcept(activeTab)] ||
|
|
1194
|
+
"NS"
|
|
1195
|
+
: "-"
|
|
1168
1196
|
}
|
|
1169
1197
|
activeTab={activeTab}
|
|
1170
1198
|
setActiveTab={setActiveTab}
|
|
@@ -1307,57 +1335,44 @@ export const ProviderProductEdition = ({
|
|
|
1307
1335
|
/>
|
|
1308
1336
|
</div>
|
|
1309
1337
|
)}
|
|
1310
|
-
{/* <Button
|
|
1311
|
-
buttonType={
|
|
1312
|
-
evaluationComplete(activeTab) &&
|
|
1313
|
-
(productEdit.product.id_order ||
|
|
1314
|
-
productEdit.product.orderId)
|
|
1315
|
-
? "general-green-button"
|
|
1316
|
-
: "general-button-disabled"
|
|
1317
|
-
}
|
|
1318
|
-
label={"Enviar evaluación"}
|
|
1319
|
-
onClick={() => {
|
|
1320
|
-
//setModalSent(true);
|
|
1321
|
-
sendEvaluation();
|
|
1322
|
-
setMessage(`¡Evaluación de ${activeTab} completada!`);
|
|
1323
|
-
}}
|
|
1324
|
-
/> */}
|
|
1325
1338
|
</div>
|
|
1326
|
-
) :
|
|
1327
|
-
|
|
1328
|
-
<div>
|
|
1329
|
-
<
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1339
|
+
) : (
|
|
1340
|
+
!revision && (
|
|
1341
|
+
<div className="required-inputs-message">
|
|
1342
|
+
<div>
|
|
1343
|
+
<p>
|
|
1344
|
+
Los atributos son requeridos por las plataformas de las
|
|
1345
|
+
cadenas, es muy importante completar los campos requeridos
|
|
1346
|
+
ya que pueden rechazar el producto por falta de información.
|
|
1347
|
+
</p>
|
|
1348
|
+
</div>
|
|
1349
|
+
{inCart ? (
|
|
1350
|
+
<button type="button">
|
|
1351
|
+
<Link to="/checkout">
|
|
1352
|
+
<p>Articulo en carrito</p>
|
|
1353
|
+
<p>Ir a checkout</p>
|
|
1354
|
+
</Link>
|
|
1355
|
+
</button>
|
|
1356
|
+
) : (
|
|
1357
|
+
<>
|
|
1358
|
+
<SliderToolTip
|
|
1359
|
+
infoIcon={InfoIcon}
|
|
1360
|
+
slidefront={slidefront}
|
|
1361
|
+
iconSize={"big-image"}
|
|
1362
|
+
slidePosition={"top-slide"}
|
|
1363
|
+
/>
|
|
1364
|
+
<Button
|
|
1365
|
+
onClick={() => {
|
|
1366
|
+
setShowContentohRequestModal &&
|
|
1367
|
+
setShowContentohRequestModal(true);
|
|
1368
|
+
}}
|
|
1369
|
+
buttonType="general-default-button"
|
|
1370
|
+
label="Enviar a Content-oh!"
|
|
1371
|
+
/>
|
|
1372
|
+
</>
|
|
1373
|
+
)}
|
|
1334
1374
|
</div>
|
|
1335
|
-
|
|
1336
|
-
<button type="button">
|
|
1337
|
-
<Link to="/checkout">
|
|
1338
|
-
<p>Articulo en carrito</p>
|
|
1339
|
-
<p>Ir a checkout</p>
|
|
1340
|
-
</Link>
|
|
1341
|
-
</button>
|
|
1342
|
-
) : (
|
|
1343
|
-
<>
|
|
1344
|
-
<SliderToolTip
|
|
1345
|
-
infoIcon={InfoIcon}
|
|
1346
|
-
slidefront={slidefront}
|
|
1347
|
-
iconSize={"big-image"}
|
|
1348
|
-
slidePosition={"top-slide"}
|
|
1349
|
-
></SliderToolTip>
|
|
1350
|
-
<Button
|
|
1351
|
-
onClick={() => {
|
|
1352
|
-
setShowContentohRequestModal &&
|
|
1353
|
-
setShowContentohRequestModal(true);
|
|
1354
|
-
}}
|
|
1355
|
-
buttonType="general-default-button"
|
|
1356
|
-
label="Enviar a Content-oh!"
|
|
1357
|
-
/>
|
|
1358
|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iKzUyMTExMSIsImV4cCI6MTY1NzA1MDU0NCwiaWF0IjoxNjU3MDQ2OTQ0LCJlbWFpbCI6ImhjYXJyaWxsb0Bjb250ZW50b2guY29tIn0.btw_69CgSyAKV2UEUqxGTOfVdvoDlGLIpmw0SMrI59HcpCIMqwpfVKd0ZphiwARLhGGZRYC6rgzx6BS1XTs850UX6L2148A8hwt9toInXcTuhC0Wl2h7kJwZFh-KEnS2pFW88FExnPtTqfnbTyc-L_jyWDPnY39vFU0EdMibcSz1jlspDBNOGUXDvV0TtT97KzU1808eK9h7S_YiCiALLofN_C7veQ0sMfvbc155iic0Izl43otMbcCwim7FlX-WsuJHVciYjH36tv-9YHK1PprtLzybTSm1ih0poB3rXlNCcxoyjNfRJFCq1G6xlOsNCvKFl8GwhKNXGaGT_KK5MA",
|
|
28
28
|
productSelected: {
|
|
29
29
|
services: {
|
|
30
|
-
datasheets:
|
|
31
|
-
descriptions:
|
|
30
|
+
datasheets: 0,
|
|
31
|
+
descriptions: 0,
|
|
32
32
|
images: 1,
|
|
33
33
|
},
|
|
34
|
-
orderId:
|
|
35
|
-
status: "
|
|
36
|
-
datasheet_status: "
|
|
34
|
+
orderId: 97,
|
|
35
|
+
status: "PA",
|
|
36
|
+
datasheet_status: "NS",
|
|
37
37
|
prio: "none",
|
|
38
|
-
version:
|
|
39
|
-
description_status: "
|
|
40
|
-
images_status:
|
|
38
|
+
version: 2,
|
|
39
|
+
description_status: "NS",
|
|
40
|
+
images_status: null,
|
|
41
41
|
article: {
|
|
42
|
-
id_article:
|
|
43
|
-
id_category: "
|
|
44
|
-
name: "
|
|
45
|
-
upc: "
|
|
46
|
-
timestamp: "2022-
|
|
42
|
+
id_article: 76130,
|
|
43
|
+
id_category: "696",
|
|
44
|
+
name: "mascarilla para cabello",
|
|
45
|
+
upc: "54645454",
|
|
46
|
+
timestamp: "2022-07-05T17:50:35.000Z",
|
|
47
47
|
id_user: 28,
|
|
48
48
|
status: "NULL",
|
|
49
49
|
active: 1,
|
|
50
50
|
company_id: 1,
|
|
51
51
|
company_name: "COMPANY DEV",
|
|
52
52
|
country: "México",
|
|
53
|
-
id_order:
|
|
54
|
-
id_datasheet_especialist:
|
|
55
|
-
id_datasheet_facilitator:
|
|
56
|
-
id_description_especialist:
|
|
57
|
-
id_description_facilitator:
|
|
53
|
+
id_order: 97,
|
|
54
|
+
id_datasheet_especialist: null,
|
|
55
|
+
id_datasheet_facilitator: null,
|
|
56
|
+
id_description_especialist: null,
|
|
57
|
+
id_description_facilitator: null,
|
|
58
58
|
id_images_especialist: 55,
|
|
59
59
|
id_images_facilitator: 53,
|
|
60
|
-
id_auditor:
|
|
60
|
+
id_auditor: 30,
|
|
61
61
|
id_recepcionist: null,
|
|
62
|
-
category: "
|
|
63
|
-
missingAttributes:
|
|
64
|
-
missingDescriptions:
|
|
65
|
-
missingImages:
|
|
62
|
+
category: "SALUD Y BELLEZA|CUIDADO DEL CABELLO|CAPILARES",
|
|
63
|
+
missingAttributes: null,
|
|
64
|
+
missingDescriptions: null,
|
|
65
|
+
missingImages: null,
|
|
66
66
|
},
|
|
67
67
|
retailers: [
|
|
68
68
|
{
|
|
69
|
-
id:
|
|
70
|
-
name: "
|
|
69
|
+
id: 12,
|
|
70
|
+
name: "La Comer",
|
|
71
71
|
country: "México",
|
|
72
72
|
id_region: 1,
|
|
73
73
|
active: 1,
|
|
74
74
|
},
|
|
75
75
|
],
|
|
76
76
|
country: "México",
|
|
77
|
-
upc: "
|
|
77
|
+
upc: "54645454",
|
|
78
78
|
},
|
|
79
79
|
location: {
|
|
80
80
|
services: {
|
|
@@ -128,22 +128,22 @@ RetailerProductEditionDefault.args = {
|
|
|
128
128
|
upc: "807526",
|
|
129
129
|
},
|
|
130
130
|
user: {
|
|
131
|
-
id_user:
|
|
132
|
-
name: "
|
|
131
|
+
id_user: 55,
|
|
132
|
+
name: "ESPECIALISTA ED PRUEBA",
|
|
133
133
|
last_name: "",
|
|
134
|
-
email: "
|
|
134
|
+
email: "hcarrillo@contentoh.com",
|
|
135
135
|
position: null,
|
|
136
136
|
telephone: null,
|
|
137
137
|
country: null,
|
|
138
138
|
id_company: 2,
|
|
139
|
-
id_cognito: "
|
|
139
|
+
id_cognito: "713a7457-f943-4bc9-8eb0-86b41f5bd4f8",
|
|
140
140
|
birth_Date: null,
|
|
141
141
|
about_me: null,
|
|
142
142
|
zip_code: null,
|
|
143
143
|
address: null,
|
|
144
144
|
job: null,
|
|
145
145
|
id_stripe: null,
|
|
146
|
-
id_role:
|
|
146
|
+
id_role: 8,
|
|
147
147
|
active: 1,
|
|
148
148
|
is_retailer: 0,
|
|
149
149
|
email_notify: 0,
|
|
@@ -158,6 +158,6 @@ RetailerProductEditionDefault.args = {
|
|
|
158
158
|
products_limit: "3",
|
|
159
159
|
type: "PyMES",
|
|
160
160
|
},
|
|
161
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
161
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-55/55.png?1657046945610",
|
|
162
162
|
},
|
|
163
|
-
};
|
|
163
|
+
};
|
|
@@ -586,7 +586,10 @@ export const RetailerProductEdition = ({
|
|
|
586
586
|
const srvActive = srv
|
|
587
587
|
.find((serv) => serv.id_retailer === activeRetailer?.id)
|
|
588
588
|
?.status?.replace(/.*\//, "");
|
|
589
|
-
const currStatus = product[`${getConcept(tab)}_status`]
|
|
589
|
+
const currStatus = product[`${getConcept(tab)}_status`]?.replace(
|
|
590
|
+
/.*\//,
|
|
591
|
+
""
|
|
592
|
+
);
|
|
590
593
|
const unvalidated = ["IE", "CA"].includes(currStatus);
|
|
591
594
|
|
|
592
595
|
const auditorUnvalidated = !["RA", "AA", "ACA", "AP"].includes(currStatus);
|
|
@@ -831,7 +834,7 @@ export const RetailerProductEdition = ({
|
|
|
831
834
|
(input) =>
|
|
832
835
|
input.required &&
|
|
833
836
|
(!input.value ||
|
|
834
|
-
input.value
|
|
837
|
+
input.value?.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") ===
|
|
835
838
|
"") &&
|
|
836
839
|
desInputsRequired++
|
|
837
840
|
);
|
|
@@ -1233,7 +1236,7 @@ export const RetailerProductEdition = ({
|
|
|
1233
1236
|
assig={assig[activeTab]}
|
|
1234
1237
|
setAssignation={setAssignation}
|
|
1235
1238
|
isRetailer={isRetailer}
|
|
1236
|
-
showSaveButton={userAssigned()}
|
|
1239
|
+
showSaveButton={auditorAssigned() || userAssigned()}
|
|
1237
1240
|
onClickSave={() => {
|
|
1238
1241
|
switch (activeTab) {
|
|
1239
1242
|
case "Descripción":
|
|
@@ -1421,4 +1424,4 @@ export const RetailerProductEdition = ({
|
|
|
1421
1424
|
)}
|
|
1422
1425
|
</Container>
|
|
1423
1426
|
);
|
|
1424
|
-
};
|
|
1427
|
+
};
|