contentoh-components-library 21.1.25 → 21.1.28
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/ValidationPanel/index.js +4 -3
- package/dist/components/molecules/AvatarAndValidation/index.js +4 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +5 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +98 -108
- package/dist/components/pages/ProviderProductEdition/index.js +140 -56
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +56 -65
- package/dist/components/pages/RetailerProductEdition/index.js +118 -8
- package/package.json +1 -1
- package/src/components/atoms/ValidationPanel/index.js +4 -3
- package/src/components/molecules/AvatarAndValidation/index.js +4 -0
- package/src/components/organisms/FullProductNameHeader/index.js +4 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +104 -106
- package/src/components/pages/ProviderProductEdition/index.js +94 -20
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +56 -67
- package/src/components/pages/RetailerProductEdition/index.js +102 -1
|
@@ -23,8 +23,9 @@ var ValidationPanel = function ValidationPanel(_ref) {
|
|
|
23
23
|
setShowValidationPanel = _ref.setShowValidationPanel,
|
|
24
24
|
approve = _ref.approve,
|
|
25
25
|
reject = _ref.reject,
|
|
26
|
+
approveAll = _ref.approveAll,
|
|
27
|
+
rejectAll = _ref.rejectAll,
|
|
26
28
|
showApproveRejectAll = _ref.showApproveRejectAll;
|
|
27
|
-
console.log(showApproveRejectAll);
|
|
28
29
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
29
30
|
id: id,
|
|
30
31
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
@@ -52,7 +53,7 @@ var ValidationPanel = function ValidationPanel(_ref) {
|
|
|
52
53
|
}), showApproveRejectAll && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
53
54
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
54
55
|
onClick: function onClick() {
|
|
55
|
-
|
|
56
|
+
approveAll && approveAll();
|
|
56
57
|
},
|
|
57
58
|
className: "validation-option",
|
|
58
59
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
@@ -63,7 +64,7 @@ var ValidationPanel = function ValidationPanel(_ref) {
|
|
|
63
64
|
})]
|
|
64
65
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
65
66
|
onClick: function onClick() {
|
|
66
|
-
|
|
67
|
+
rejectAll && rejectAll();
|
|
67
68
|
},
|
|
68
69
|
className: "validation-option",
|
|
69
70
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
@@ -30,6 +30,8 @@ var AvatarAndValidation = function AvatarAndValidation(_ref) {
|
|
|
30
30
|
showValidationButtons = _ref.showValidationButtons,
|
|
31
31
|
approve = _ref.approve,
|
|
32
32
|
reject = _ref.reject,
|
|
33
|
+
approveAll = _ref.approveAll,
|
|
34
|
+
rejectAll = _ref.rejectAll,
|
|
33
35
|
showApproveRejectAll = _ref.showApproveRejectAll;
|
|
34
36
|
|
|
35
37
|
var _useState = (0, _react.useState)(false),
|
|
@@ -74,6 +76,8 @@ var AvatarAndValidation = function AvatarAndValidation(_ref) {
|
|
|
74
76
|
setShowValidationPanel: setShowValidationPanel,
|
|
75
77
|
approve: approve,
|
|
76
78
|
reject: reject,
|
|
79
|
+
approveAll: approveAll,
|
|
80
|
+
rejectAll: rejectAll,
|
|
77
81
|
showApproveRejectAll: showApproveRejectAll
|
|
78
82
|
})]
|
|
79
83
|
});
|
|
@@ -31,6 +31,8 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
31
31
|
showValidationButtons = _ref.showValidationButtons,
|
|
32
32
|
approve = _ref.approve,
|
|
33
33
|
reject = _ref.reject,
|
|
34
|
+
approveAll = _ref.approveAll,
|
|
35
|
+
rejectAll = _ref.rejectAll,
|
|
34
36
|
servicesData = _ref.servicesData,
|
|
35
37
|
showApproveRejectAll = _ref.showApproveRejectAll;
|
|
36
38
|
|
|
@@ -82,7 +84,9 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
82
84
|
showValidationButtons: showValidationButtons,
|
|
83
85
|
showApproveRejectAll: showApproveRejectAll,
|
|
84
86
|
approve: approve,
|
|
85
|
-
reject: reject
|
|
87
|
+
reject: reject,
|
|
88
|
+
approveAll: approveAll,
|
|
89
|
+
rejectAll: rejectAll
|
|
86
90
|
})]
|
|
87
91
|
})]
|
|
88
92
|
});
|
|
@@ -31,124 +31,114 @@ ProviderProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": false,
|
|
32
32
|
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJhODE2NGMwNi1hN2U5LTQ2OGItYTBiMS02MDIxNzMyNWY0ZTgiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NjExMzE0NiwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjU2MTE2NzQ2LCJpYXQiOjE2NTYxMTMxNDYsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.kfMoKcxYDkpNZJibGdw50oOkRwPVl26YNAwwDoLEfQjOZB6WRCY95iHfU1maYcTTvA5KlT5ali8XZ-nLnxh60vZoLGTDOfCvEnwd1t94JtfE5CsWDr_jfH1U0AVidxihqKnkwvCezkHwU1DUFlbu2iBNo7MHQw4ydiK2sx4q0-QGltmE7W2JJ0sayRDuNchy2S6FQoyIWhsP3oaKTvJGDKCaJxwkFEKk-3antoMtfua9H8V4p2Kkqa_eDbFk8pLYGaYgImLlaia2orGgETkHZIWEMr4WJq1V_7qOg4lYq2BUUuMhWdmK6XUL_Jhmv05TUJ3Rp_Ti4_J2WE4zQqhbfQ",
|
|
35
35
|
articleId: 238,
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
|
-
orderId:
|
|
40
|
-
|
|
39
|
+
orderId: 55,
|
|
40
|
+
article_status: "AP",
|
|
41
41
|
datasheet_status: "AP",
|
|
42
|
-
prio: "none",
|
|
43
|
-
version: 7,
|
|
44
42
|
description_status: "AP",
|
|
45
43
|
images_status: "AP",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
datasheet: null,
|
|
50
|
-
descriptions: null,
|
|
51
|
-
images: null
|
|
52
|
-
},
|
|
53
|
-
services: {
|
|
54
|
-
datasheets: 1,
|
|
55
|
-
descriptions: 1,
|
|
56
|
-
images: 1
|
|
57
|
-
},
|
|
44
|
+
prio: "none",
|
|
45
|
+
version: 2,
|
|
46
|
+
brand: null,
|
|
58
47
|
article: {
|
|
59
|
-
category: "
|
|
60
|
-
company_name: "
|
|
48
|
+
category: "ILUMINACIÓN|FOCOS|FOCOS",
|
|
49
|
+
company_name: "THD Proveedor",
|
|
61
50
|
country: "México",
|
|
62
|
-
id_category: "
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
id_description_facilitator: 52,
|
|
67
|
-
id_images_especialist: 55,
|
|
68
|
-
id_images_facilitator: 53,
|
|
69
|
-
id_order: 64,
|
|
70
|
-
id_article: 35707,
|
|
71
|
-
id_auditor: 37,
|
|
72
|
-
name: "chetos",
|
|
73
|
-
upc: "1010101010"
|
|
51
|
+
id_category: "2143",
|
|
52
|
+
id_article: 55118,
|
|
53
|
+
name: "FOCO BLUETOOTH SPOT PHILIPS 6 WATTS 300 LÚMENES MULTICOLOR",
|
|
54
|
+
upc: "145582"
|
|
74
55
|
},
|
|
75
56
|
retailers: [{
|
|
76
|
-
id:
|
|
77
|
-
name: "
|
|
57
|
+
id: 58,
|
|
58
|
+
name: "The Home Depot Golden"
|
|
59
|
+
}, {
|
|
60
|
+
id: 59,
|
|
61
|
+
name: "The Home Depot Platinum"
|
|
78
62
|
}, {
|
|
79
|
-
id:
|
|
80
|
-
name: "
|
|
63
|
+
id: 60,
|
|
64
|
+
name: "The Home Depot Resizing"
|
|
65
|
+
}, {
|
|
66
|
+
id: 61,
|
|
67
|
+
name: "Home Depot TAB"
|
|
81
68
|
}],
|
|
69
|
+
services: {
|
|
70
|
+
datasheets: 1,
|
|
71
|
+
descriptions: 1,
|
|
72
|
+
images: 1
|
|
73
|
+
},
|
|
74
|
+
id_article: 55118,
|
|
82
75
|
retailersAvailable: [{
|
|
83
|
-
id:
|
|
84
|
-
name: "
|
|
76
|
+
id: 58,
|
|
77
|
+
name: "The Home Depot Golden"
|
|
85
78
|
}, {
|
|
86
|
-
id:
|
|
87
|
-
name: "
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
79
|
+
id: 59,
|
|
80
|
+
name: "The Home Depot Platinum"
|
|
81
|
+
}, {
|
|
82
|
+
id: 60,
|
|
83
|
+
name: "The Home Depot Resizing"
|
|
84
|
+
}, {
|
|
85
|
+
id: 61,
|
|
86
|
+
name: "Home Depot TAB"
|
|
87
|
+
}]
|
|
93
88
|
},
|
|
94
89
|
productToEdit: {
|
|
95
|
-
ArticleId:
|
|
96
|
-
idCategory: "
|
|
90
|
+
ArticleId: 55118,
|
|
91
|
+
idCategory: "2143",
|
|
97
92
|
product: {
|
|
98
|
-
orderId:
|
|
99
|
-
|
|
93
|
+
orderId: 55,
|
|
94
|
+
article_status: "AP",
|
|
100
95
|
datasheet_status: "AP",
|
|
101
|
-
prio: "none",
|
|
102
|
-
version: 7,
|
|
103
96
|
description_status: "AP",
|
|
104
97
|
images_status: "AP",
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
datasheet: null,
|
|
109
|
-
descriptions: null,
|
|
110
|
-
images: null
|
|
111
|
-
},
|
|
112
|
-
services: {
|
|
113
|
-
datasheets: 1,
|
|
114
|
-
descriptions: 1,
|
|
115
|
-
images: 1
|
|
116
|
-
},
|
|
98
|
+
prio: "none",
|
|
99
|
+
version: 2,
|
|
100
|
+
brand: null,
|
|
117
101
|
article: {
|
|
118
|
-
category: "
|
|
119
|
-
company_name: "
|
|
102
|
+
category: "ILUMINACIÓN|FOCOS|FOCOS",
|
|
103
|
+
company_name: "THD Proveedor",
|
|
120
104
|
country: "México",
|
|
121
|
-
id_category: "
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
id_description_facilitator: 52,
|
|
126
|
-
id_images_especialist: 55,
|
|
127
|
-
id_images_facilitator: 53,
|
|
128
|
-
id_order: 64,
|
|
129
|
-
id_article: 35707,
|
|
130
|
-
id_auditor: 37,
|
|
131
|
-
name: "chetos",
|
|
132
|
-
upc: "1010101010"
|
|
105
|
+
id_category: "2143",
|
|
106
|
+
id_article: 55118,
|
|
107
|
+
name: "FOCO BLUETOOTH SPOT PHILIPS 6 WATTS 300 LÚMENES MULTICOLOR",
|
|
108
|
+
upc: "145582"
|
|
133
109
|
},
|
|
134
110
|
retailers: [{
|
|
135
|
-
id:
|
|
136
|
-
name: "
|
|
111
|
+
id: 58,
|
|
112
|
+
name: "The Home Depot Golden"
|
|
113
|
+
}, {
|
|
114
|
+
id: 59,
|
|
115
|
+
name: "The Home Depot Platinum"
|
|
137
116
|
}, {
|
|
138
|
-
id:
|
|
139
|
-
name: "
|
|
117
|
+
id: 60,
|
|
118
|
+
name: "The Home Depot Resizing"
|
|
119
|
+
}, {
|
|
120
|
+
id: 61,
|
|
121
|
+
name: "Home Depot TAB"
|
|
140
122
|
}],
|
|
123
|
+
services: {
|
|
124
|
+
datasheets: 1,
|
|
125
|
+
descriptions: 1,
|
|
126
|
+
images: 1
|
|
127
|
+
},
|
|
128
|
+
id_article: 55118,
|
|
141
129
|
retailersAvailable: [{
|
|
142
|
-
id:
|
|
143
|
-
name: "
|
|
130
|
+
id: 58,
|
|
131
|
+
name: "The Home Depot Golden"
|
|
144
132
|
}, {
|
|
145
|
-
id:
|
|
146
|
-
name: "
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
133
|
+
id: 59,
|
|
134
|
+
name: "The Home Depot Platinum"
|
|
135
|
+
}, {
|
|
136
|
+
id: 60,
|
|
137
|
+
name: "The Home Depot Resizing"
|
|
138
|
+
}, {
|
|
139
|
+
id: 61,
|
|
140
|
+
name: "Home Depot TAB"
|
|
141
|
+
}]
|
|
152
142
|
}
|
|
153
143
|
},
|
|
154
144
|
location: {
|
|
@@ -161,36 +151,36 @@ ProviderProductEditionDefault.args = {
|
|
|
161
151
|
}
|
|
162
152
|
},
|
|
163
153
|
user: {
|
|
164
|
-
id_user:
|
|
165
|
-
name: "
|
|
166
|
-
last_name: "
|
|
167
|
-
email: "
|
|
168
|
-
position: "
|
|
154
|
+
id_user: 59,
|
|
155
|
+
name: "The Home",
|
|
156
|
+
last_name: "Depot",
|
|
157
|
+
email: "cadena.ismael@allfreemail.net",
|
|
158
|
+
position: "Admin",
|
|
169
159
|
telephone: "+523111366336",
|
|
170
160
|
country: "México",
|
|
171
|
-
id_company:
|
|
172
|
-
id_cognito: "
|
|
161
|
+
id_company: 7,
|
|
162
|
+
id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
|
|
173
163
|
birth_Date: null,
|
|
174
164
|
about_me: null,
|
|
175
165
|
zip_code: null,
|
|
176
166
|
address: null,
|
|
177
167
|
job: null,
|
|
178
|
-
id_stripe: "
|
|
168
|
+
id_stripe: "",
|
|
179
169
|
id_role: 0,
|
|
180
170
|
active: 1,
|
|
181
|
-
is_retailer:
|
|
182
|
-
email_notify:
|
|
171
|
+
is_retailer: 0,
|
|
172
|
+
email_notify: 1,
|
|
183
173
|
membership: {
|
|
184
|
-
id:
|
|
185
|
-
start_date: "
|
|
186
|
-
end_date: "
|
|
187
|
-
planID:
|
|
188
|
-
plan: "
|
|
189
|
-
name: "Plan
|
|
190
|
-
user_limit: "
|
|
191
|
-
products_limit: "
|
|
174
|
+
id: 24,
|
|
175
|
+
start_date: "2021-11-23T03:35:50.000Z",
|
|
176
|
+
end_date: "2022-11-23T03:35:50.000Z",
|
|
177
|
+
planID: 9,
|
|
178
|
+
plan: "prod_KtlkzZVGq6bRTO",
|
|
179
|
+
name: "Plan Enterprise Full",
|
|
180
|
+
user_limit: "30",
|
|
181
|
+
products_limit: "10000",
|
|
192
182
|
type: "Enterprise"
|
|
193
183
|
},
|
|
194
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
184
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1656113146885"
|
|
195
185
|
}
|
|
196
186
|
};
|
|
@@ -465,7 +465,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
465
465
|
|
|
466
466
|
var loadData = /*#__PURE__*/function () {
|
|
467
467
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
468
|
-
var _product$article, _product$article2, _services$, _services$$values;
|
|
468
|
+
var _product$article, _product$article2, _product$article3, _services$, _services$$values;
|
|
469
469
|
|
|
470
470
|
var services;
|
|
471
471
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
@@ -473,7 +473,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
473
473
|
switch (_context2.prev = _context2.next) {
|
|
474
474
|
case 0:
|
|
475
475
|
_context2.next = 2;
|
|
476
|
-
return (0, _data2.getRetailerServices)((product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article),
|
|
476
|
+
return (0, _data2.getRetailerServices)((product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article), (product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.company_name) || (product === null || product === void 0 ? void 0 : product.categoryName), parseInt((product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category) || (product === null || product === void 0 ? void 0 : product.id_category)), product === null || product === void 0 ? void 0 : product.version);
|
|
477
477
|
|
|
478
478
|
case 2:
|
|
479
479
|
services = _context2.sent;
|
|
@@ -513,7 +513,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
513
513
|
|
|
514
514
|
var getServices = /*#__PURE__*/function () {
|
|
515
515
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
516
|
-
var _product$
|
|
516
|
+
var _product$article4;
|
|
517
517
|
|
|
518
518
|
var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailers, active;
|
|
519
519
|
|
|
@@ -522,7 +522,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
522
522
|
switch (_context3.prev = _context3.next) {
|
|
523
523
|
case 0:
|
|
524
524
|
productInOrder = product.id_order || product.orderId;
|
|
525
|
-
idArticle = (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$
|
|
525
|
+
idArticle = (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article);
|
|
526
526
|
|
|
527
527
|
if (!(isRevision() || productInOrder)) {
|
|
528
528
|
_context3.next = 11;
|
|
@@ -1236,10 +1236,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1236
1236
|
});
|
|
1237
1237
|
|
|
1238
1238
|
if (imgsInBack.length > 0) {
|
|
1239
|
-
var _product$
|
|
1239
|
+
var _product$article5;
|
|
1240
1240
|
|
|
1241
1241
|
var data = {
|
|
1242
|
-
articleId: (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$
|
|
1242
|
+
articleId: (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.id_article),
|
|
1243
1243
|
deleteImages: imgsInBack
|
|
1244
1244
|
};
|
|
1245
1245
|
|
|
@@ -1333,7 +1333,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1333
1333
|
});
|
|
1334
1334
|
|
|
1335
1335
|
case 7:
|
|
1336
|
-
_context13.next =
|
|
1336
|
+
_context13.next = 19;
|
|
1337
1337
|
break;
|
|
1338
1338
|
|
|
1339
1339
|
case 9:
|
|
@@ -1353,6 +1353,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1353
1353
|
});
|
|
1354
1354
|
|
|
1355
1355
|
setProduct(productTemp);
|
|
1356
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1356
1357
|
setProductEdit({
|
|
1357
1358
|
ArticleId: productTemp.id_article,
|
|
1358
1359
|
idCategory: productTemp.article.id_category,
|
|
@@ -1367,11 +1368,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1367
1368
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, "Evaluated"));
|
|
1368
1369
|
});
|
|
1369
1370
|
|
|
1370
|
-
case
|
|
1371
|
+
case 19:
|
|
1371
1372
|
loadData();
|
|
1372
1373
|
showSurvey && showSurvey(confirmStatusComplete());
|
|
1373
1374
|
|
|
1374
|
-
case
|
|
1375
|
+
case 21:
|
|
1375
1376
|
case "end":
|
|
1376
1377
|
return _context13.stop();
|
|
1377
1378
|
}
|
|
@@ -1386,58 +1387,86 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1386
1387
|
|
|
1387
1388
|
var validateAll = /*#__PURE__*/function () {
|
|
1388
1389
|
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
|
|
1389
|
-
var evaluationArray, sendAll, conceptArray;
|
|
1390
|
+
var evaluationArray, sendAll, conceptArray, productTemp;
|
|
1390
1391
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
1391
1392
|
while (1) {
|
|
1392
1393
|
switch (_context14.prev = _context14.next) {
|
|
1393
1394
|
case 0:
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1395
|
+
_context14.prev = 0;
|
|
1396
|
+
setLoading(true);
|
|
1397
|
+
evaluationArray = [];
|
|
1398
|
+
sendAll = [];
|
|
1399
|
+
conceptArray = ["description", "datasheet", "images"];
|
|
1400
|
+
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1401
|
+
var _product$id_order4;
|
|
1402
|
+
|
|
1403
|
+
var data = {
|
|
1404
|
+
articleId: product.id_article,
|
|
1405
|
+
orderId: (_product$id_order4 = product.id_order) !== null && _product$id_order4 !== void 0 ? _product$id_order4 : product.orderId,
|
|
1406
|
+
concept: ret.service,
|
|
1407
|
+
result: result,
|
|
1408
|
+
retailerId: ret.id_retailer
|
|
1409
|
+
};
|
|
1410
|
+
evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1411
|
+
headers: {
|
|
1412
|
+
Authorization: token
|
|
1413
|
+
}
|
|
1414
|
+
}));
|
|
1415
|
+
});
|
|
1416
|
+
_context14.next = 8;
|
|
1417
|
+
return Promise.all(evaluationArray);
|
|
1418
|
+
|
|
1419
|
+
case 8:
|
|
1420
|
+
conceptArray === null || conceptArray === void 0 ? void 0 : conceptArray.forEach(function (concept) {
|
|
1421
|
+
var _product$id_order5;
|
|
1422
|
+
|
|
1423
|
+
var data = {
|
|
1424
|
+
articleId: product.id_article,
|
|
1425
|
+
orderId: (_product$id_order5 = product.id_order) !== null && _product$id_order5 !== void 0 ? _product$id_order5 : product.orderId,
|
|
1426
|
+
concept: concept
|
|
1427
|
+
};
|
|
1428
|
+
sendAll.push(_axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
1429
|
+
headers: {
|
|
1430
|
+
Authorization: token
|
|
1431
|
+
}
|
|
1432
|
+
}));
|
|
1433
|
+
});
|
|
1434
|
+
_context14.next = 11;
|
|
1435
|
+
return Promise.all(sendAll);
|
|
1436
|
+
|
|
1437
|
+
case 11:
|
|
1438
|
+
productTemp = product;
|
|
1439
|
+
productTemp.article_status = "".concat(result, "C");
|
|
1440
|
+
productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "C");
|
|
1441
|
+
productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result, "C");
|
|
1442
|
+
productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "C");
|
|
1443
|
+
setProduct(productTemp);
|
|
1444
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1445
|
+
setProductEdit({
|
|
1446
|
+
ArticleId: productTemp.id_article,
|
|
1447
|
+
idCategory: productTemp.article.id_category,
|
|
1448
|
+
product: productTemp
|
|
1449
|
+
});
|
|
1450
|
+
sessionStorage.setItem("productEdit", JSON.stringify({
|
|
1451
|
+
ArticleId: productTemp.id_article,
|
|
1452
|
+
idCategory: productTemp.article.id_category,
|
|
1453
|
+
product: productTemp
|
|
1454
|
+
}));
|
|
1455
|
+
loadData();
|
|
1456
|
+
_context14.next = 26;
|
|
1457
|
+
break;
|
|
1458
|
+
|
|
1459
|
+
case 23:
|
|
1460
|
+
_context14.prev = 23;
|
|
1461
|
+
_context14.t0 = _context14["catch"](0);
|
|
1462
|
+
console.log(_context14.t0);
|
|
1434
1463
|
|
|
1435
|
-
case
|
|
1464
|
+
case 26:
|
|
1436
1465
|
case "end":
|
|
1437
1466
|
return _context14.stop();
|
|
1438
1467
|
}
|
|
1439
1468
|
}
|
|
1440
|
-
}, _callee14);
|
|
1469
|
+
}, _callee14, null, [[0, 23]]);
|
|
1441
1470
|
}));
|
|
1442
1471
|
|
|
1443
1472
|
return function validateAll(_x8) {
|
|
@@ -1515,7 +1544,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1515
1544
|
(0, _react.useEffect)(function () {
|
|
1516
1545
|
setSaving(loading);
|
|
1517
1546
|
}, [loading]);
|
|
1518
|
-
console.log(user.is_retailer === 1, product.id_order || product.orderId, isRevision(), getSectionStatus(), "XD");
|
|
1519
1547
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
1520
1548
|
headerTop: headerTop,
|
|
1521
1549
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
@@ -1553,12 +1581,68 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1553
1581
|
setActiveRetailer: setActiveRetailer,
|
|
1554
1582
|
showValidationButtons: isRevision() && getSectionStatus(),
|
|
1555
1583
|
servicesData: servicesData ? servicesData : null,
|
|
1556
|
-
showApproveRejectAll:
|
|
1584
|
+
showApproveRejectAll: isRevision() && getSectionStatus(),
|
|
1557
1585
|
approveAll: function approveAll() {
|
|
1558
|
-
|
|
1586
|
+
if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
1587
|
+
setDataGenericModal(function (prev) {
|
|
1588
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1589
|
+
button2: {
|
|
1590
|
+
name: "Continuar",
|
|
1591
|
+
action: function action() {
|
|
1592
|
+
return evaluationToRetailer("A");
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
});
|
|
1596
|
+
});
|
|
1597
|
+
setShowGenericModal(true);
|
|
1598
|
+
} else {
|
|
1599
|
+
if (user.is_retailer) {
|
|
1600
|
+
if (product.id_order || product.orderId) {
|
|
1601
|
+
validateAll("A");
|
|
1602
|
+
} else {
|
|
1603
|
+
setDataGenericModal(function (prev) {
|
|
1604
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1605
|
+
button2: {
|
|
1606
|
+
name: "Continuar",
|
|
1607
|
+
action: function action() {
|
|
1608
|
+
return evaluationToRetailer("A");
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
});
|
|
1613
|
+
setShowGenericModal(true);
|
|
1614
|
+
}
|
|
1615
|
+
} else {
|
|
1616
|
+
validateAll("A");
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1559
1619
|
},
|
|
1560
1620
|
rejectAll: function rejectAll() {
|
|
1561
|
-
|
|
1621
|
+
if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
1622
|
+
return;
|
|
1623
|
+
} else {
|
|
1624
|
+
if (user.is_retailer) {
|
|
1625
|
+
if (product.id_order || product.orderId) {
|
|
1626
|
+
validateAll("R");
|
|
1627
|
+
setModalViewError(true);
|
|
1628
|
+
} else {
|
|
1629
|
+
setDataGenericModal(function (prev) {
|
|
1630
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1631
|
+
button2: {
|
|
1632
|
+
name: "Continuar",
|
|
1633
|
+
action: function action() {
|
|
1634
|
+
return evaluationToRetailer("R");
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
});
|
|
1638
|
+
});
|
|
1639
|
+
setShowGenericModal(true);
|
|
1640
|
+
}
|
|
1641
|
+
} else {
|
|
1642
|
+
validateAll("R");
|
|
1643
|
+
setModalViewError(true);
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1562
1646
|
},
|
|
1563
1647
|
approve: function approve() {
|
|
1564
1648
|
if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|