contentoh-components-library 21.1.9 → 21.1.12
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 +48 -48
- package/dist/components/pages/ProviderProductEdition/index.js +24 -20
- package/dist/components/pages/RetailerProductEdition/index.js +21 -29
- package/package.json +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +48 -48
- package/src/components/pages/ProviderProductEdition/index.js +6 -6
- package/src/components/pages/RetailerProductEdition/index.js +29 -29
|
@@ -36,22 +36,22 @@ ProviderProductEditionDefault.args = {
|
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
|
-
orderId:
|
|
39
|
+
orderId: 77,
|
|
40
40
|
article_status: "AP",
|
|
41
|
-
datasheet_status: "
|
|
42
|
-
description_status: "
|
|
41
|
+
datasheet_status: "NS",
|
|
42
|
+
description_status: "NS",
|
|
43
43
|
images_status: "AP",
|
|
44
44
|
prio: "none",
|
|
45
|
-
version:
|
|
45
|
+
version: 19,
|
|
46
46
|
brand: null,
|
|
47
47
|
article: {
|
|
48
|
-
category: "
|
|
49
|
-
company_name: "THD Proveedor",
|
|
50
|
-
country:
|
|
51
|
-
id_category: "
|
|
52
|
-
id_article:
|
|
53
|
-
name: "
|
|
54
|
-
upc: "
|
|
48
|
+
category: "RESIZING|RESIZING|RESIZING",
|
|
49
|
+
company_name: "THD Resize Proveedor",
|
|
50
|
+
country: null,
|
|
51
|
+
id_category: "2999",
|
|
52
|
+
id_article: 55109,
|
|
53
|
+
name: "Resize Ismael",
|
|
54
|
+
upc: "ResizeIsmael"
|
|
55
55
|
},
|
|
56
56
|
retailers: [{
|
|
57
57
|
id: 58,
|
|
@@ -67,11 +67,11 @@ ProviderProductEditionDefault.args = {
|
|
|
67
67
|
name: "Home Depot TAB"
|
|
68
68
|
}],
|
|
69
69
|
services: {
|
|
70
|
-
datasheets:
|
|
71
|
-
descriptions:
|
|
70
|
+
datasheets: 0,
|
|
71
|
+
descriptions: 0,
|
|
72
72
|
images: 1
|
|
73
73
|
},
|
|
74
|
-
id_article:
|
|
74
|
+
id_article: 55109,
|
|
75
75
|
retailersAvailable: [{
|
|
76
76
|
id: 58,
|
|
77
77
|
name: "The Home Depot Golden"
|
|
@@ -87,25 +87,25 @@ ProviderProductEditionDefault.args = {
|
|
|
87
87
|
}]
|
|
88
88
|
},
|
|
89
89
|
productToEdit: {
|
|
90
|
-
ArticleId:
|
|
91
|
-
idCategory: "
|
|
90
|
+
ArticleId: 55109,
|
|
91
|
+
idCategory: "2999",
|
|
92
92
|
product: {
|
|
93
|
-
orderId:
|
|
93
|
+
orderId: 77,
|
|
94
94
|
article_status: "AP",
|
|
95
|
-
datasheet_status: "
|
|
96
|
-
description_status: "
|
|
95
|
+
datasheet_status: "NS",
|
|
96
|
+
description_status: "NS",
|
|
97
97
|
images_status: "AP",
|
|
98
98
|
prio: "none",
|
|
99
|
-
version:
|
|
99
|
+
version: 19,
|
|
100
100
|
brand: null,
|
|
101
101
|
article: {
|
|
102
|
-
category: "
|
|
103
|
-
company_name: "THD Proveedor",
|
|
104
|
-
country:
|
|
105
|
-
id_category: "
|
|
106
|
-
id_article:
|
|
107
|
-
name: "
|
|
108
|
-
upc: "
|
|
102
|
+
category: "RESIZING|RESIZING|RESIZING",
|
|
103
|
+
company_name: "THD Resize Proveedor",
|
|
104
|
+
country: null,
|
|
105
|
+
id_category: "2999",
|
|
106
|
+
id_article: 55109,
|
|
107
|
+
name: "Resize Ismael",
|
|
108
|
+
upc: "ResizeIsmael"
|
|
109
109
|
},
|
|
110
110
|
retailers: [{
|
|
111
111
|
id: 58,
|
|
@@ -121,11 +121,11 @@ ProviderProductEditionDefault.args = {
|
|
|
121
121
|
name: "Home Depot TAB"
|
|
122
122
|
}],
|
|
123
123
|
services: {
|
|
124
|
-
datasheets:
|
|
125
|
-
descriptions:
|
|
124
|
+
datasheets: 0,
|
|
125
|
+
descriptions: 0,
|
|
126
126
|
images: 1
|
|
127
127
|
},
|
|
128
|
-
id_article:
|
|
128
|
+
id_article: 55109,
|
|
129
129
|
retailersAvailable: [{
|
|
130
130
|
id: 58,
|
|
131
131
|
name: "The Home Depot Golden"
|
|
@@ -151,35 +151,35 @@ ProviderProductEditionDefault.args = {
|
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
user: {
|
|
154
|
-
id_user:
|
|
155
|
-
name: "
|
|
156
|
-
last_name: "
|
|
157
|
-
email: "
|
|
158
|
-
position: "Admin",
|
|
154
|
+
id_user: 28,
|
|
155
|
+
name: "Proveedor",
|
|
156
|
+
last_name: "Colgate",
|
|
157
|
+
email: "ilopez@contentoh.com",
|
|
158
|
+
position: "Prueba Admin",
|
|
159
159
|
telephone: "+523111366336",
|
|
160
160
|
country: "México",
|
|
161
|
-
id_company:
|
|
162
|
-
id_cognito: "
|
|
161
|
+
id_company: 1,
|
|
162
|
+
id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
|
|
163
163
|
birth_Date: null,
|
|
164
164
|
about_me: null,
|
|
165
165
|
zip_code: null,
|
|
166
166
|
address: null,
|
|
167
167
|
job: null,
|
|
168
|
-
id_stripe: "",
|
|
168
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
169
169
|
id_role: 0,
|
|
170
170
|
active: 1,
|
|
171
|
-
is_retailer:
|
|
171
|
+
is_retailer: 0,
|
|
172
172
|
membership: {
|
|
173
|
-
id:
|
|
174
|
-
start_date: "
|
|
175
|
-
end_date: "
|
|
176
|
-
planID:
|
|
177
|
-
plan: "
|
|
178
|
-
name: "Plan
|
|
179
|
-
user_limit: "
|
|
180
|
-
products_limit: "
|
|
173
|
+
id: 38,
|
|
174
|
+
start_date: "2022-01-18T17:25:35.000Z",
|
|
175
|
+
end_date: "2023-01-18T17:25:35.000Z",
|
|
176
|
+
planID: 8,
|
|
177
|
+
plan: "prod_KtlhECVSFG2iro",
|
|
178
|
+
name: "Plan Pro",
|
|
179
|
+
user_limit: "20",
|
|
180
|
+
products_limit: "5000",
|
|
181
181
|
type: "Enterprise"
|
|
182
182
|
},
|
|
183
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
183
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655691624761"
|
|
184
184
|
}
|
|
185
185
|
};
|
|
@@ -510,7 +510,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
510
510
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
511
511
|
var _product$article3;
|
|
512
512
|
|
|
513
|
-
var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse;
|
|
513
|
+
var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailers, active;
|
|
514
514
|
|
|
515
515
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
516
516
|
while (1) {
|
|
@@ -520,7 +520,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
520
520
|
idArticle = (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_article);
|
|
521
521
|
|
|
522
522
|
if (!(isRevision() || productInOrder)) {
|
|
523
|
-
_context3.next =
|
|
523
|
+
_context3.next = 11;
|
|
524
524
|
break;
|
|
525
525
|
}
|
|
526
526
|
|
|
@@ -530,9 +530,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
530
530
|
case 5:
|
|
531
531
|
servicesResponse = _context3.sent;
|
|
532
532
|
parsedResponse = JSON.parse(servicesResponse === null || servicesResponse === void 0 ? void 0 : (_servicesResponse$dat = servicesResponse.data) === null || _servicesResponse$dat === void 0 ? void 0 : _servicesResponse$dat.body).data;
|
|
533
|
+
retailers = product.retailers || product.retailersAvailable;
|
|
534
|
+
active = retailers === null || retailers === void 0 ? void 0 : retailers.filter(function (retailer) {
|
|
535
|
+
return parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.map(function (srv) {
|
|
536
|
+
return srv.id_retailer;
|
|
537
|
+
}).includes(retailer.id);
|
|
538
|
+
})[0];
|
|
539
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
533
540
|
setServicesData(parsedResponse);
|
|
534
541
|
|
|
535
|
-
case
|
|
542
|
+
case 11:
|
|
536
543
|
case "end":
|
|
537
544
|
return _context3.stop();
|
|
538
545
|
}
|
|
@@ -623,43 +630,39 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
623
630
|
case 0:
|
|
624
631
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
625
632
|
loadData();
|
|
626
|
-
setActiveRetailer(product.retailers ? product.retailers[0] : product.retailersAvailable[0]); // getPercentage({ data: [product] }).then((res) =>
|
|
627
|
-
// setPercentages(res)
|
|
628
|
-
// );
|
|
629
|
-
|
|
630
633
|
getCart();
|
|
631
634
|
_context5.t0 = setUserGroups;
|
|
632
|
-
_context5.next =
|
|
635
|
+
_context5.next = 6;
|
|
633
636
|
return (0, _data2.fetchUsers)(token);
|
|
634
637
|
|
|
635
|
-
case
|
|
638
|
+
case 6:
|
|
636
639
|
_context5.t1 = _context5.sent;
|
|
637
640
|
(0, _context5.t0)(_context5.t1);
|
|
638
641
|
arr = [];
|
|
639
642
|
_context5.t2 = user.id_role;
|
|
640
|
-
_context5.next = _context5.t2 === 7 ?
|
|
643
|
+
_context5.next = _context5.t2 === 7 ? 12 : _context5.t2 === 8 ? 12 : _context5.t2 === 4 ? 14 : _context5.t2 === 5 ? 14 : _context5.t2 === 6 ? 16 : 18;
|
|
641
644
|
break;
|
|
642
645
|
|
|
643
|
-
case
|
|
646
|
+
case 12:
|
|
644
647
|
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
645
|
-
return _context5.abrupt("break",
|
|
648
|
+
return _context5.abrupt("break", 20);
|
|
646
649
|
|
|
647
|
-
case
|
|
650
|
+
case 14:
|
|
648
651
|
arr = ["RF", "AF", "AA", "AP", "AC"];
|
|
649
|
-
return _context5.abrupt("break",
|
|
652
|
+
return _context5.abrupt("break", 20);
|
|
650
653
|
|
|
651
|
-
case
|
|
654
|
+
case 16:
|
|
652
655
|
arr = ["RP", "RC", "AF"];
|
|
653
|
-
return _context5.abrupt("break",
|
|
656
|
+
return _context5.abrupt("break", 20);
|
|
654
657
|
|
|
655
|
-
case
|
|
658
|
+
case 18:
|
|
656
659
|
arr = [];
|
|
657
|
-
return _context5.abrupt("break",
|
|
660
|
+
return _context5.abrupt("break", 20);
|
|
658
661
|
|
|
659
|
-
case
|
|
662
|
+
case 20:
|
|
660
663
|
setStatusArray(arr);
|
|
661
664
|
|
|
662
|
-
case
|
|
665
|
+
case 21:
|
|
663
666
|
case "end":
|
|
664
667
|
return _context5.stop();
|
|
665
668
|
}
|
|
@@ -1763,6 +1766,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1763
1766
|
activeRetailer: activeRetailer,
|
|
1764
1767
|
setActiveRetailer: setActiveRetailer,
|
|
1765
1768
|
showValidationButtons: isRevision() && getSectionStatus(),
|
|
1769
|
+
servicesData: servicesData ? servicesData : null,
|
|
1766
1770
|
approve: function approve() {
|
|
1767
1771
|
if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
1768
1772
|
setDataGenericModal(function (prev) {
|
|
@@ -1639,35 +1639,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1639
1639
|
sendToFacilitator("A");
|
|
1640
1640
|
},
|
|
1641
1641
|
reject: function reject() {
|
|
1642
|
-
sendToFacilitator("R");
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
// document.querySelector(
|
|
1664
|
-
// "#modal-commentary-box .ql-container .ql-editor > p"
|
|
1665
|
-
// ).innerHTML,
|
|
1666
|
-
// activeTab
|
|
1667
|
-
// )
|
|
1668
|
-
// }
|
|
1669
|
-
// />,
|
|
1670
|
-
// ]);
|
|
1642
|
+
sendToFacilitator("R");
|
|
1643
|
+
setMessage("Rechazado");
|
|
1644
|
+
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1645
|
+
src: _errorModal.default
|
|
1646
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1647
|
+
text: "Agrega tu comentarios para enviar el rechazo",
|
|
1648
|
+
headerType: "input-name-header",
|
|
1649
|
+
color: "white"
|
|
1650
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1651
|
+
label: "Caja de Comentario",
|
|
1652
|
+
inputType: "textarea",
|
|
1653
|
+
inputId: "modal-commentary-box",
|
|
1654
|
+
index: 0,
|
|
1655
|
+
color: "white"
|
|
1656
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1657
|
+
buttonType: "general-default-button",
|
|
1658
|
+
label: "Enviar comentario",
|
|
1659
|
+
onClick: function onClick(e) {
|
|
1660
|
+
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1661
|
+
}
|
|
1662
|
+
})]);
|
|
1671
1663
|
},
|
|
1672
1664
|
showValidationButtons: approveRejectButtons() && (auditorAssigned() || userAssigned())
|
|
1673
1665
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
package/package.json
CHANGED
|
@@ -21,22 +21,22 @@ ProviderProductEditionDefault.args = {
|
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
|
-
orderId:
|
|
24
|
+
orderId: 77,
|
|
25
25
|
article_status: "AP",
|
|
26
|
-
datasheet_status: "
|
|
27
|
-
description_status: "
|
|
26
|
+
datasheet_status: "NS",
|
|
27
|
+
description_status: "NS",
|
|
28
28
|
images_status: "AP",
|
|
29
29
|
prio: "none",
|
|
30
|
-
version:
|
|
30
|
+
version: 19,
|
|
31
31
|
brand: null,
|
|
32
32
|
article: {
|
|
33
|
-
category: "
|
|
34
|
-
company_name: "THD Proveedor",
|
|
35
|
-
country:
|
|
36
|
-
id_category: "
|
|
37
|
-
id_article:
|
|
38
|
-
name: "
|
|
39
|
-
upc: "
|
|
33
|
+
category: "RESIZING|RESIZING|RESIZING",
|
|
34
|
+
company_name: "THD Resize Proveedor",
|
|
35
|
+
country: null,
|
|
36
|
+
id_category: "2999",
|
|
37
|
+
id_article: 55109,
|
|
38
|
+
name: "Resize Ismael",
|
|
39
|
+
upc: "ResizeIsmael",
|
|
40
40
|
},
|
|
41
41
|
retailers: [
|
|
42
42
|
{
|
|
@@ -57,11 +57,11 @@ ProviderProductEditionDefault.args = {
|
|
|
57
57
|
},
|
|
58
58
|
],
|
|
59
59
|
services: {
|
|
60
|
-
datasheets:
|
|
61
|
-
descriptions:
|
|
60
|
+
datasheets: 0,
|
|
61
|
+
descriptions: 0,
|
|
62
62
|
images: 1,
|
|
63
63
|
},
|
|
64
|
-
id_article:
|
|
64
|
+
id_article: 55109,
|
|
65
65
|
retailersAvailable: [
|
|
66
66
|
{
|
|
67
67
|
id: 58,
|
|
@@ -82,25 +82,25 @@ ProviderProductEditionDefault.args = {
|
|
|
82
82
|
],
|
|
83
83
|
},
|
|
84
84
|
productToEdit: {
|
|
85
|
-
ArticleId:
|
|
86
|
-
idCategory: "
|
|
85
|
+
ArticleId: 55109,
|
|
86
|
+
idCategory: "2999",
|
|
87
87
|
product: {
|
|
88
|
-
orderId:
|
|
88
|
+
orderId: 77,
|
|
89
89
|
article_status: "AP",
|
|
90
|
-
datasheet_status: "
|
|
91
|
-
description_status: "
|
|
90
|
+
datasheet_status: "NS",
|
|
91
|
+
description_status: "NS",
|
|
92
92
|
images_status: "AP",
|
|
93
93
|
prio: "none",
|
|
94
|
-
version:
|
|
94
|
+
version: 19,
|
|
95
95
|
brand: null,
|
|
96
96
|
article: {
|
|
97
|
-
category: "
|
|
98
|
-
company_name: "THD Proveedor",
|
|
99
|
-
country:
|
|
100
|
-
id_category: "
|
|
101
|
-
id_article:
|
|
102
|
-
name: "
|
|
103
|
-
upc: "
|
|
97
|
+
category: "RESIZING|RESIZING|RESIZING",
|
|
98
|
+
company_name: "THD Resize Proveedor",
|
|
99
|
+
country: null,
|
|
100
|
+
id_category: "2999",
|
|
101
|
+
id_article: 55109,
|
|
102
|
+
name: "Resize Ismael",
|
|
103
|
+
upc: "ResizeIsmael",
|
|
104
104
|
},
|
|
105
105
|
retailers: [
|
|
106
106
|
{
|
|
@@ -121,11 +121,11 @@ ProviderProductEditionDefault.args = {
|
|
|
121
121
|
},
|
|
122
122
|
],
|
|
123
123
|
services: {
|
|
124
|
-
datasheets:
|
|
125
|
-
descriptions:
|
|
124
|
+
datasheets: 0,
|
|
125
|
+
descriptions: 0,
|
|
126
126
|
images: 1,
|
|
127
127
|
},
|
|
128
|
-
id_article:
|
|
128
|
+
id_article: 55109,
|
|
129
129
|
retailersAvailable: [
|
|
130
130
|
{
|
|
131
131
|
id: 58,
|
|
@@ -151,35 +151,35 @@ ProviderProductEditionDefault.args = {
|
|
|
151
151
|
state: { origin: "RequestWithContentoh" },
|
|
152
152
|
},
|
|
153
153
|
user: {
|
|
154
|
-
id_user:
|
|
155
|
-
name: "
|
|
156
|
-
last_name: "
|
|
157
|
-
email: "
|
|
158
|
-
position: "Admin",
|
|
154
|
+
id_user: 28,
|
|
155
|
+
name: "Proveedor",
|
|
156
|
+
last_name: "Colgate",
|
|
157
|
+
email: "ilopez@contentoh.com",
|
|
158
|
+
position: "Prueba Admin",
|
|
159
159
|
telephone: "+523111366336",
|
|
160
160
|
country: "México",
|
|
161
|
-
id_company:
|
|
162
|
-
id_cognito: "
|
|
161
|
+
id_company: 1,
|
|
162
|
+
id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
|
|
163
163
|
birth_Date: null,
|
|
164
164
|
about_me: null,
|
|
165
165
|
zip_code: null,
|
|
166
166
|
address: null,
|
|
167
167
|
job: null,
|
|
168
|
-
id_stripe: "",
|
|
168
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
169
169
|
id_role: 0,
|
|
170
170
|
active: 1,
|
|
171
|
-
is_retailer:
|
|
171
|
+
is_retailer: 0,
|
|
172
172
|
membership: {
|
|
173
|
-
id:
|
|
174
|
-
start_date: "
|
|
175
|
-
end_date: "
|
|
176
|
-
planID:
|
|
177
|
-
plan: "
|
|
178
|
-
name: "Plan
|
|
179
|
-
user_limit: "
|
|
180
|
-
products_limit: "
|
|
173
|
+
id: 38,
|
|
174
|
+
start_date: "2022-01-18T17:25:35.000Z",
|
|
175
|
+
end_date: "2023-01-18T17:25:35.000Z",
|
|
176
|
+
planID: 8,
|
|
177
|
+
plan: "prod_KtlhECVSFG2iro",
|
|
178
|
+
name: "Plan Pro",
|
|
179
|
+
user_limit: "20",
|
|
180
|
+
products_limit: "5000",
|
|
181
181
|
type: "Enterprise",
|
|
182
182
|
},
|
|
183
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
183
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655691624761",
|
|
184
184
|
},
|
|
185
185
|
};
|
|
@@ -240,6 +240,11 @@ export const ProviderProductEdition = ({
|
|
|
240
240
|
}&end=true`
|
|
241
241
|
);
|
|
242
242
|
const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
|
|
243
|
+
let retailers = product.retailers || product.retailersAvailable;
|
|
244
|
+
let active = retailers?.filter((retailer) =>
|
|
245
|
+
parsedResponse?.map((srv) => srv.id_retailer).includes(retailer.id)
|
|
246
|
+
)[0];
|
|
247
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
243
248
|
setServicesData(parsedResponse);
|
|
244
249
|
}
|
|
245
250
|
};
|
|
@@ -299,12 +304,6 @@ export const ProviderProductEdition = ({
|
|
|
299
304
|
useEffect(async () => {
|
|
300
305
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
301
306
|
loadData();
|
|
302
|
-
setActiveRetailer(
|
|
303
|
-
product.retailers ? product.retailers[0] : product.retailersAvailable[0]
|
|
304
|
-
);
|
|
305
|
-
// getPercentage({ data: [product] }).then((res) =>
|
|
306
|
-
// setPercentages(res)
|
|
307
|
-
// );
|
|
308
307
|
getCart();
|
|
309
308
|
setUserGroups(await fetchUsers(token));
|
|
310
309
|
let arr = [];
|
|
@@ -1227,6 +1226,7 @@ export const ProviderProductEdition = ({
|
|
|
1227
1226
|
activeRetailer={activeRetailer}
|
|
1228
1227
|
setActiveRetailer={setActiveRetailer}
|
|
1229
1228
|
showValidationButtons={isRevision() && getSectionStatus()}
|
|
1229
|
+
servicesData={servicesData ? servicesData : null}
|
|
1230
1230
|
approve={() => {
|
|
1231
1231
|
if (
|
|
1232
1232
|
origin[activeTab] === "RequestWithoutContentoh" &&
|
|
@@ -1187,35 +1187,35 @@ export const RetailerProductEdition = ({
|
|
|
1187
1187
|
}}
|
|
1188
1188
|
reject={() => {
|
|
1189
1189
|
sendToFacilitator("R");
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1190
|
+
setMessage("Rechazado");
|
|
1191
|
+
setComponentsArray([
|
|
1192
|
+
<img src={errorModal} />,
|
|
1193
|
+
<ScreenHeader
|
|
1194
|
+
text={"Agrega tu comentarios para enviar el rechazo"}
|
|
1195
|
+
headerType={"input-name-header"}
|
|
1196
|
+
color={"white"}
|
|
1197
|
+
/>,
|
|
1198
|
+
<TagAndInput
|
|
1199
|
+
label={"Caja de Comentario"}
|
|
1200
|
+
inputType={"textarea"}
|
|
1201
|
+
inputId={"modal-commentary-box"}
|
|
1202
|
+
index={0}
|
|
1203
|
+
color={"white"}
|
|
1204
|
+
/>,
|
|
1205
|
+
<Button
|
|
1206
|
+
buttonType={"general-default-button"}
|
|
1207
|
+
label={"Enviar comentario"}
|
|
1208
|
+
onClick={(e) =>
|
|
1209
|
+
createComment(
|
|
1210
|
+
e,
|
|
1211
|
+
document.querySelector(
|
|
1212
|
+
"#modal-commentary-box .ql-container .ql-editor > p"
|
|
1213
|
+
).innerHTML,
|
|
1214
|
+
activeTab
|
|
1215
|
+
)
|
|
1216
|
+
}
|
|
1217
|
+
/>,
|
|
1218
|
+
]);
|
|
1219
1219
|
}}
|
|
1220
1220
|
showValidationButtons={
|
|
1221
1221
|
approveRejectButtons() && (auditorAssigned() || userAssigned())
|