contentoh-components-library 21.1.10 → 21.1.11
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 +52 -52
- package/dist/components/pages/ProviderProductEdition/index.js +24 -23
- package/package.json +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +52 -54
- package/src/components/pages/ProviderProductEdition/index.js +5 -4
|
@@ -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: "
|
|
43
|
-
images_status: "
|
|
41
|
+
datasheet_status: "NS",
|
|
42
|
+
description_status: "NS",
|
|
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:
|
|
72
|
-
images:
|
|
70
|
+
datasheets: 0,
|
|
71
|
+
descriptions: 0,
|
|
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: "
|
|
97
|
-
images_status: "
|
|
95
|
+
datasheet_status: "NS",
|
|
96
|
+
description_status: "NS",
|
|
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:
|
|
126
|
-
images:
|
|
124
|
+
datasheets: 0,
|
|
125
|
+
descriptions: 0,
|
|
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
|
}
|
|
@@ -616,56 +623,50 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
616
623
|
}();
|
|
617
624
|
|
|
618
625
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
619
|
-
var
|
|
626
|
+
var arr;
|
|
620
627
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
621
628
|
while (1) {
|
|
622
629
|
switch (_context5.prev = _context5.next) {
|
|
623
630
|
case 0:
|
|
624
631
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
625
632
|
loadData();
|
|
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
633
|
setActiveRetailer(active ? active : retailers[0]); // getPercentage({ data: [product] }).then((res) =>
|
|
633
634
|
// setPercentages(res)
|
|
634
635
|
// );
|
|
635
636
|
|
|
636
637
|
getCart();
|
|
637
638
|
_context5.t0 = setUserGroups;
|
|
638
|
-
_context5.next =
|
|
639
|
+
_context5.next = 7;
|
|
639
640
|
return (0, _data2.fetchUsers)(token);
|
|
640
641
|
|
|
641
|
-
case
|
|
642
|
+
case 7:
|
|
642
643
|
_context5.t1 = _context5.sent;
|
|
643
644
|
(0, _context5.t0)(_context5.t1);
|
|
644
645
|
arr = [];
|
|
645
646
|
_context5.t2 = user.id_role;
|
|
646
|
-
_context5.next = _context5.t2 === 7 ?
|
|
647
|
+
_context5.next = _context5.t2 === 7 ? 13 : _context5.t2 === 8 ? 13 : _context5.t2 === 4 ? 15 : _context5.t2 === 5 ? 15 : _context5.t2 === 6 ? 17 : 19;
|
|
647
648
|
break;
|
|
648
649
|
|
|
649
|
-
case
|
|
650
|
+
case 13:
|
|
650
651
|
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
651
|
-
return _context5.abrupt("break",
|
|
652
|
+
return _context5.abrupt("break", 21);
|
|
652
653
|
|
|
653
|
-
case
|
|
654
|
+
case 15:
|
|
654
655
|
arr = ["RF", "AF", "AA", "AP", "AC"];
|
|
655
|
-
return _context5.abrupt("break",
|
|
656
|
+
return _context5.abrupt("break", 21);
|
|
656
657
|
|
|
657
|
-
case
|
|
658
|
+
case 17:
|
|
658
659
|
arr = ["RP", "RC", "AF"];
|
|
659
|
-
return _context5.abrupt("break",
|
|
660
|
+
return _context5.abrupt("break", 21);
|
|
660
661
|
|
|
661
|
-
case
|
|
662
|
+
case 19:
|
|
662
663
|
arr = [];
|
|
663
|
-
return _context5.abrupt("break",
|
|
664
|
+
return _context5.abrupt("break", 21);
|
|
664
665
|
|
|
665
|
-
case
|
|
666
|
+
case 21:
|
|
666
667
|
setStatusArray(arr);
|
|
667
668
|
|
|
668
|
-
case
|
|
669
|
+
case 22:
|
|
669
670
|
case "end":
|
|
670
671
|
return _context5.stop();
|
|
671
672
|
}
|
package/package.json
CHANGED
|
@@ -21,23 +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: "
|
|
28
|
-
images_status: "
|
|
26
|
+
datasheet_status: "NS",
|
|
27
|
+
description_status: "NS",
|
|
28
|
+
images_status: "AP",
|
|
29
29
|
prio: "none",
|
|
30
|
-
version:
|
|
30
|
+
version: 19,
|
|
31
31
|
brand: null,
|
|
32
32
|
article: {
|
|
33
|
-
category:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
upc: "159786",
|
|
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",
|
|
41
40
|
},
|
|
42
41
|
retailers: [
|
|
43
42
|
{
|
|
@@ -58,11 +57,11 @@ ProviderProductEditionDefault.args = {
|
|
|
58
57
|
},
|
|
59
58
|
],
|
|
60
59
|
services: {
|
|
61
|
-
datasheets:
|
|
62
|
-
descriptions:
|
|
63
|
-
images:
|
|
60
|
+
datasheets: 0,
|
|
61
|
+
descriptions: 0,
|
|
62
|
+
images: 1,
|
|
64
63
|
},
|
|
65
|
-
id_article:
|
|
64
|
+
id_article: 55109,
|
|
66
65
|
retailersAvailable: [
|
|
67
66
|
{
|
|
68
67
|
id: 58,
|
|
@@ -83,26 +82,25 @@ ProviderProductEditionDefault.args = {
|
|
|
83
82
|
],
|
|
84
83
|
},
|
|
85
84
|
productToEdit: {
|
|
86
|
-
ArticleId:
|
|
87
|
-
idCategory: "
|
|
85
|
+
ArticleId: 55109,
|
|
86
|
+
idCategory: "2999",
|
|
88
87
|
product: {
|
|
89
|
-
orderId:
|
|
88
|
+
orderId: 77,
|
|
90
89
|
article_status: "AP",
|
|
91
|
-
datasheet_status: "
|
|
92
|
-
description_status: "
|
|
93
|
-
images_status: "
|
|
90
|
+
datasheet_status: "NS",
|
|
91
|
+
description_status: "NS",
|
|
92
|
+
images_status: "AP",
|
|
94
93
|
prio: "none",
|
|
95
|
-
version:
|
|
94
|
+
version: 19,
|
|
96
95
|
brand: null,
|
|
97
96
|
article: {
|
|
98
|
-
category:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
upc: "159786",
|
|
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",
|
|
106
104
|
},
|
|
107
105
|
retailers: [
|
|
108
106
|
{
|
|
@@ -123,11 +121,11 @@ ProviderProductEditionDefault.args = {
|
|
|
123
121
|
},
|
|
124
122
|
],
|
|
125
123
|
services: {
|
|
126
|
-
datasheets:
|
|
127
|
-
descriptions:
|
|
128
|
-
images:
|
|
124
|
+
datasheets: 0,
|
|
125
|
+
descriptions: 0,
|
|
126
|
+
images: 1,
|
|
129
127
|
},
|
|
130
|
-
id_article:
|
|
128
|
+
id_article: 55109,
|
|
131
129
|
retailersAvailable: [
|
|
132
130
|
{
|
|
133
131
|
id: 58,
|
|
@@ -153,35 +151,35 @@ ProviderProductEditionDefault.args = {
|
|
|
153
151
|
state: { origin: "RequestWithContentoh" },
|
|
154
152
|
},
|
|
155
153
|
user: {
|
|
156
|
-
id_user:
|
|
157
|
-
name: "
|
|
158
|
-
last_name: "
|
|
159
|
-
email: "
|
|
160
|
-
position: "Admin",
|
|
154
|
+
id_user: 28,
|
|
155
|
+
name: "Proveedor",
|
|
156
|
+
last_name: "Colgate",
|
|
157
|
+
email: "ilopez@contentoh.com",
|
|
158
|
+
position: "Prueba Admin",
|
|
161
159
|
telephone: "+523111366336",
|
|
162
160
|
country: "México",
|
|
163
|
-
id_company:
|
|
164
|
-
id_cognito: "
|
|
161
|
+
id_company: 1,
|
|
162
|
+
id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
|
|
165
163
|
birth_Date: null,
|
|
166
164
|
about_me: null,
|
|
167
165
|
zip_code: null,
|
|
168
166
|
address: null,
|
|
169
167
|
job: null,
|
|
170
|
-
id_stripe: "",
|
|
168
|
+
id_stripe: "cus_KuEt6R6vwmN09f",
|
|
171
169
|
id_role: 0,
|
|
172
170
|
active: 1,
|
|
173
|
-
is_retailer:
|
|
171
|
+
is_retailer: 0,
|
|
174
172
|
membership: {
|
|
175
|
-
id:
|
|
176
|
-
start_date: "
|
|
177
|
-
end_date: "
|
|
178
|
-
planID:
|
|
179
|
-
plan: "
|
|
180
|
-
name: "Plan
|
|
181
|
-
user_limit: "
|
|
182
|
-
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",
|
|
183
181
|
type: "Enterprise",
|
|
184
182
|
},
|
|
185
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
183
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655691624761",
|
|
186
184
|
},
|
|
187
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
|
};
|
|
@@ -300,10 +305,6 @@ export const ProviderProductEdition = ({
|
|
|
300
305
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
301
306
|
loadData();
|
|
302
307
|
|
|
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
308
|
setActiveRetailer(active ? active : retailers[0]);
|
|
308
309
|
// getPercentage({ data: [product] }).then((res) =>
|
|
309
310
|
// setPercentages(res)
|