contentoh-components-library 21.1.9 → 21.1.10
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 +24 -24
- package/dist/components/pages/ProviderProductEdition/index.js +22 -15
- package/dist/components/pages/RetailerProductEdition/index.js +21 -29
- package/package.json +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +26 -24
- package/src/components/pages/ProviderProductEdition/index.js +7 -3
- 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: 60,
|
|
40
40
|
article_status: "AP",
|
|
41
|
-
datasheet_status: "
|
|
42
|
-
description_status: "
|
|
43
|
-
images_status: "
|
|
41
|
+
datasheet_status: "AA",
|
|
42
|
+
description_status: "AA",
|
|
43
|
+
images_status: "NS",
|
|
44
44
|
prio: "none",
|
|
45
45
|
version: 2,
|
|
46
46
|
brand: null,
|
|
47
47
|
article: {
|
|
48
|
-
category: "
|
|
48
|
+
category: "ORGANIZADORES Y CLOSETS|MUEBLES DE ORGANIZACIÓN|CARRITOS Y CAJONES",
|
|
49
49
|
company_name: "THD Proveedor",
|
|
50
50
|
country: "México",
|
|
51
|
-
id_category: "
|
|
52
|
-
id_article:
|
|
53
|
-
name: "
|
|
54
|
-
upc: "
|
|
51
|
+
id_category: "2275",
|
|
52
|
+
id_article: 55126,
|
|
53
|
+
name: "ESCRITORIO PLEGABLE CAFÉ",
|
|
54
|
+
upc: "159786"
|
|
55
55
|
},
|
|
56
56
|
retailers: [{
|
|
57
57
|
id: 58,
|
|
@@ -69,9 +69,9 @@ ProviderProductEditionDefault.args = {
|
|
|
69
69
|
services: {
|
|
70
70
|
datasheets: 1,
|
|
71
71
|
descriptions: 1,
|
|
72
|
-
images:
|
|
72
|
+
images: 0
|
|
73
73
|
},
|
|
74
|
-
id_article:
|
|
74
|
+
id_article: 55126,
|
|
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: 55126,
|
|
91
|
+
idCategory: "2275",
|
|
92
92
|
product: {
|
|
93
|
-
orderId:
|
|
93
|
+
orderId: 60,
|
|
94
94
|
article_status: "AP",
|
|
95
|
-
datasheet_status: "
|
|
96
|
-
description_status: "
|
|
97
|
-
images_status: "
|
|
95
|
+
datasheet_status: "AA",
|
|
96
|
+
description_status: "AA",
|
|
97
|
+
images_status: "NS",
|
|
98
98
|
prio: "none",
|
|
99
99
|
version: 2,
|
|
100
100
|
brand: null,
|
|
101
101
|
article: {
|
|
102
|
-
category: "
|
|
102
|
+
category: "ORGANIZADORES Y CLOSETS|MUEBLES DE ORGANIZACIÓN|CARRITOS Y CAJONES",
|
|
103
103
|
company_name: "THD Proveedor",
|
|
104
104
|
country: "México",
|
|
105
|
-
id_category: "
|
|
106
|
-
id_article:
|
|
107
|
-
name: "
|
|
108
|
-
upc: "
|
|
105
|
+
id_category: "2275",
|
|
106
|
+
id_article: 55126,
|
|
107
|
+
name: "ESCRITORIO PLEGABLE CAFÉ",
|
|
108
|
+
upc: "159786"
|
|
109
109
|
},
|
|
110
110
|
retailers: [{
|
|
111
111
|
id: 58,
|
|
@@ -123,9 +123,9 @@ ProviderProductEditionDefault.args = {
|
|
|
123
123
|
services: {
|
|
124
124
|
datasheets: 1,
|
|
125
125
|
descriptions: 1,
|
|
126
|
-
images:
|
|
126
|
+
images: 0
|
|
127
127
|
},
|
|
128
|
-
id_article:
|
|
128
|
+
id_article: 55126,
|
|
129
129
|
retailersAvailable: [{
|
|
130
130
|
id: 58,
|
|
131
131
|
name: "The Home Depot Golden"
|
|
@@ -616,50 +616,56 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
616
616
|
}();
|
|
617
617
|
|
|
618
618
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
619
|
-
var arr;
|
|
619
|
+
var retailers, active, arr;
|
|
620
620
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
621
621
|
while (1) {
|
|
622
622
|
switch (_context5.prev = _context5.next) {
|
|
623
623
|
case 0:
|
|
624
624
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
625
625
|
loadData();
|
|
626
|
-
|
|
626
|
+
retailers = product.retailers || product.retailersAvailable;
|
|
627
|
+
active = retailers === null || retailers === void 0 ? void 0 : retailers.filter(function (retailer) {
|
|
628
|
+
return servicesData === null || servicesData === void 0 ? void 0 : servicesData.map(function (srv) {
|
|
629
|
+
return srv.id_retailer;
|
|
630
|
+
}).includes(retailer.id);
|
|
631
|
+
})[0];
|
|
632
|
+
setActiveRetailer(active ? active : retailers[0]); // getPercentage({ data: [product] }).then((res) =>
|
|
627
633
|
// setPercentages(res)
|
|
628
634
|
// );
|
|
629
635
|
|
|
630
636
|
getCart();
|
|
631
637
|
_context5.t0 = setUserGroups;
|
|
632
|
-
_context5.next =
|
|
638
|
+
_context5.next = 9;
|
|
633
639
|
return (0, _data2.fetchUsers)(token);
|
|
634
640
|
|
|
635
|
-
case
|
|
641
|
+
case 9:
|
|
636
642
|
_context5.t1 = _context5.sent;
|
|
637
643
|
(0, _context5.t0)(_context5.t1);
|
|
638
644
|
arr = [];
|
|
639
645
|
_context5.t2 = user.id_role;
|
|
640
|
-
_context5.next = _context5.t2 === 7 ?
|
|
646
|
+
_context5.next = _context5.t2 === 7 ? 15 : _context5.t2 === 8 ? 15 : _context5.t2 === 4 ? 17 : _context5.t2 === 5 ? 17 : _context5.t2 === 6 ? 19 : 21;
|
|
641
647
|
break;
|
|
642
648
|
|
|
643
|
-
case
|
|
649
|
+
case 15:
|
|
644
650
|
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
645
|
-
return _context5.abrupt("break",
|
|
651
|
+
return _context5.abrupt("break", 23);
|
|
646
652
|
|
|
647
|
-
case
|
|
653
|
+
case 17:
|
|
648
654
|
arr = ["RF", "AF", "AA", "AP", "AC"];
|
|
649
|
-
return _context5.abrupt("break",
|
|
655
|
+
return _context5.abrupt("break", 23);
|
|
650
656
|
|
|
651
|
-
case
|
|
657
|
+
case 19:
|
|
652
658
|
arr = ["RP", "RC", "AF"];
|
|
653
|
-
return _context5.abrupt("break",
|
|
659
|
+
return _context5.abrupt("break", 23);
|
|
654
660
|
|
|
655
|
-
case
|
|
661
|
+
case 21:
|
|
656
662
|
arr = [];
|
|
657
|
-
return _context5.abrupt("break",
|
|
663
|
+
return _context5.abrupt("break", 23);
|
|
658
664
|
|
|
659
|
-
case
|
|
665
|
+
case 23:
|
|
660
666
|
setStatusArray(arr);
|
|
661
667
|
|
|
662
|
-
case
|
|
668
|
+
case 24:
|
|
663
669
|
case "end":
|
|
664
670
|
return _context5.stop();
|
|
665
671
|
}
|
|
@@ -1763,6 +1769,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1763
1769
|
activeRetailer: activeRetailer,
|
|
1764
1770
|
setActiveRetailer: setActiveRetailer,
|
|
1765
1771
|
showValidationButtons: isRevision() && getSectionStatus(),
|
|
1772
|
+
servicesData: servicesData ? servicesData : null,
|
|
1766
1773
|
approve: function approve() {
|
|
1767
1774
|
if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
1768
1775
|
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,23 @@ ProviderProductEditionDefault.args = {
|
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
|
-
orderId:
|
|
24
|
+
orderId: 60,
|
|
25
25
|
article_status: "AP",
|
|
26
|
-
datasheet_status: "
|
|
27
|
-
description_status: "
|
|
28
|
-
images_status: "
|
|
26
|
+
datasheet_status: "AA",
|
|
27
|
+
description_status: "AA",
|
|
28
|
+
images_status: "NS",
|
|
29
29
|
prio: "none",
|
|
30
30
|
version: 2,
|
|
31
31
|
brand: null,
|
|
32
32
|
article: {
|
|
33
|
-
category:
|
|
33
|
+
category:
|
|
34
|
+
"ORGANIZADORES Y CLOSETS|MUEBLES DE ORGANIZACIÓN|CARRITOS Y CAJONES",
|
|
34
35
|
company_name: "THD Proveedor",
|
|
35
36
|
country: "México",
|
|
36
|
-
id_category: "
|
|
37
|
-
id_article:
|
|
38
|
-
name: "
|
|
39
|
-
upc: "
|
|
37
|
+
id_category: "2275",
|
|
38
|
+
id_article: 55126,
|
|
39
|
+
name: "ESCRITORIO PLEGABLE CAFÉ",
|
|
40
|
+
upc: "159786",
|
|
40
41
|
},
|
|
41
42
|
retailers: [
|
|
42
43
|
{
|
|
@@ -59,9 +60,9 @@ ProviderProductEditionDefault.args = {
|
|
|
59
60
|
services: {
|
|
60
61
|
datasheets: 1,
|
|
61
62
|
descriptions: 1,
|
|
62
|
-
images:
|
|
63
|
+
images: 0,
|
|
63
64
|
},
|
|
64
|
-
id_article:
|
|
65
|
+
id_article: 55126,
|
|
65
66
|
retailersAvailable: [
|
|
66
67
|
{
|
|
67
68
|
id: 58,
|
|
@@ -82,25 +83,26 @@ ProviderProductEditionDefault.args = {
|
|
|
82
83
|
],
|
|
83
84
|
},
|
|
84
85
|
productToEdit: {
|
|
85
|
-
ArticleId:
|
|
86
|
-
idCategory: "
|
|
86
|
+
ArticleId: 55126,
|
|
87
|
+
idCategory: "2275",
|
|
87
88
|
product: {
|
|
88
|
-
orderId:
|
|
89
|
+
orderId: 60,
|
|
89
90
|
article_status: "AP",
|
|
90
|
-
datasheet_status: "
|
|
91
|
-
description_status: "
|
|
92
|
-
images_status: "
|
|
91
|
+
datasheet_status: "AA",
|
|
92
|
+
description_status: "AA",
|
|
93
|
+
images_status: "NS",
|
|
93
94
|
prio: "none",
|
|
94
95
|
version: 2,
|
|
95
96
|
brand: null,
|
|
96
97
|
article: {
|
|
97
|
-
category:
|
|
98
|
+
category:
|
|
99
|
+
"ORGANIZADORES Y CLOSETS|MUEBLES DE ORGANIZACIÓN|CARRITOS Y CAJONES",
|
|
98
100
|
company_name: "THD Proveedor",
|
|
99
101
|
country: "México",
|
|
100
|
-
id_category: "
|
|
101
|
-
id_article:
|
|
102
|
-
name: "
|
|
103
|
-
upc: "
|
|
102
|
+
id_category: "2275",
|
|
103
|
+
id_article: 55126,
|
|
104
|
+
name: "ESCRITORIO PLEGABLE CAFÉ",
|
|
105
|
+
upc: "159786",
|
|
104
106
|
},
|
|
105
107
|
retailers: [
|
|
106
108
|
{
|
|
@@ -123,9 +125,9 @@ ProviderProductEditionDefault.args = {
|
|
|
123
125
|
services: {
|
|
124
126
|
datasheets: 1,
|
|
125
127
|
descriptions: 1,
|
|
126
|
-
images:
|
|
128
|
+
images: 0,
|
|
127
129
|
},
|
|
128
|
-
id_article:
|
|
130
|
+
id_article: 55126,
|
|
129
131
|
retailersAvailable: [
|
|
130
132
|
{
|
|
131
133
|
id: 58,
|
|
@@ -299,9 +299,12 @@ export const ProviderProductEdition = ({
|
|
|
299
299
|
useEffect(async () => {
|
|
300
300
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
301
301
|
loadData();
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
)
|
|
302
|
+
|
|
303
|
+
let retailers = product.retailers || product.retailersAvailable;
|
|
304
|
+
let active = retailers?.filter((retailer) =>
|
|
305
|
+
servicesData?.map((srv) => srv.id_retailer).includes(retailer.id)
|
|
306
|
+
)[0];
|
|
307
|
+
setActiveRetailer(active ? active : retailers[0]);
|
|
305
308
|
// getPercentage({ data: [product] }).then((res) =>
|
|
306
309
|
// setPercentages(res)
|
|
307
310
|
// );
|
|
@@ -1227,6 +1230,7 @@ export const ProviderProductEdition = ({
|
|
|
1227
1230
|
activeRetailer={activeRetailer}
|
|
1228
1231
|
setActiveRetailer={setActiveRetailer}
|
|
1229
1232
|
showValidationButtons={isRevision() && getSectionStatus()}
|
|
1233
|
+
servicesData={servicesData ? servicesData : null}
|
|
1230
1234
|
approve={() => {
|
|
1231
1235
|
if (
|
|
1232
1236
|
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())
|