contentoh-components-library 21.0.84 → 21.0.85
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/package.json +1 -1
- package/src/components/atoms/AsignationOption/index.js +2 -0
- package/src/components/atoms/AsignationOption/styles.js +7 -1
- package/src/components/molecules/RetailerSelector/index.js +2 -1
- package/src/components/molecules/RetailerSelector/styles.js +2 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +107 -76
- package/src/components/pages/ProviderProductEdition/index.js +22 -17
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ export const AsignationOption = ({
|
|
|
14
14
|
team,
|
|
15
15
|
onClick,
|
|
16
16
|
btnOnClick,
|
|
17
|
+
active,
|
|
17
18
|
}) => {
|
|
18
19
|
const iconsAsignation = {
|
|
19
20
|
assigned: (
|
|
@@ -38,6 +39,7 @@ export const AsignationOption = ({
|
|
|
38
39
|
<p className="team-label">{team}</p>
|
|
39
40
|
</div>
|
|
40
41
|
{asignationType && iconsAsignation[asignationType]}
|
|
42
|
+
{active && <div className="green-circle"></div>}
|
|
41
43
|
</Container>
|
|
42
44
|
);
|
|
43
45
|
};
|
|
@@ -3,7 +3,6 @@ import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div`
|
|
5
5
|
display: flex;
|
|
6
|
-
width: fit-content;
|
|
7
6
|
align-items: center;
|
|
8
7
|
cursor: pointer;
|
|
9
8
|
border-radius: 3px;
|
|
@@ -41,6 +40,13 @@ export const Container = styled.div`
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
|
|
43
|
+
.green-circle {
|
|
44
|
+
background-color: ${GlobalColors.exported};
|
|
45
|
+
width: 20px;
|
|
46
|
+
height: 20px;
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
}
|
|
49
|
+
|
|
44
50
|
button {
|
|
45
51
|
background-color: transparent;
|
|
46
52
|
cursor: pointer;
|
|
@@ -30,7 +30,7 @@ export const RetailerSelector = ({
|
|
|
30
30
|
altText={activeRetailer?.name}
|
|
31
31
|
imageType={"medium-image"}
|
|
32
32
|
onClick={() => {
|
|
33
|
-
retailers?.length >
|
|
33
|
+
retailers?.length > 0 && setRetailersPanel(!retailersPanel);
|
|
34
34
|
if (retailersPanel)
|
|
35
35
|
document.removeEventListener("click", closeRetailersPanel, false);
|
|
36
36
|
}}
|
|
@@ -54,6 +54,7 @@ export const RetailerSelector = ({
|
|
|
54
54
|
);
|
|
55
55
|
setRetailersPanel(false);
|
|
56
56
|
}}
|
|
57
|
+
active={retailer.id === activeRetailer.id}
|
|
57
58
|
/>
|
|
58
59
|
))}
|
|
59
60
|
</div>
|
|
@@ -21,115 +21,146 @@ ProviderProductEditionDefault.args = {
|
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
|
-
orderId:
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
orderId: 7,
|
|
25
|
+
id_category: "684",
|
|
26
|
+
status: "RECEPTION",
|
|
27
|
+
datasheet_status: null,
|
|
27
28
|
prio: "none",
|
|
28
|
-
version:
|
|
29
|
-
description_status:
|
|
30
|
-
images_status:
|
|
29
|
+
version: 4,
|
|
30
|
+
description_status: null,
|
|
31
|
+
images_status: null,
|
|
31
32
|
brand: null,
|
|
32
|
-
retailerOrder: 0,
|
|
33
33
|
missing: {
|
|
34
|
-
datasheet:
|
|
35
|
-
descriptions:
|
|
36
|
-
images:
|
|
37
|
-
},
|
|
38
|
-
services: {
|
|
39
|
-
datasheets: 1,
|
|
40
|
-
descriptions: 1,
|
|
41
|
-
images: 1,
|
|
34
|
+
datasheet: 33,
|
|
35
|
+
descriptions: 14,
|
|
36
|
+
images: 3,
|
|
42
37
|
},
|
|
43
38
|
article: {
|
|
44
|
-
category: "
|
|
39
|
+
category: "SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
|
|
45
40
|
company_name: "COMPANY DEV",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
id_description_facilitator: 52,
|
|
52
|
-
id_images_especialist: 55,
|
|
53
|
-
id_images_facilitator: 53,
|
|
54
|
-
id_order: 2,
|
|
55
|
-
id_article: 35319,
|
|
56
|
-
id_auditor: 30,
|
|
57
|
-
name: "FOCO LED A19 (60W) LUZ AMARILLA",
|
|
58
|
-
upc: "120873",
|
|
41
|
+
id_category: "684",
|
|
42
|
+
id_article: 33249,
|
|
43
|
+
name: "Crema dental ",
|
|
44
|
+
timestamp: "2022-06-14T23:24:08.000Z",
|
|
45
|
+
upc: "232435",
|
|
59
46
|
},
|
|
60
47
|
retailers: [
|
|
61
48
|
{
|
|
62
|
-
id:
|
|
63
|
-
name: "
|
|
49
|
+
id: 4,
|
|
50
|
+
name: "Walmart Super y Superama",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 9,
|
|
54
|
+
name: "Amazon",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 1013,
|
|
58
|
+
name: "Cencosud Colombia",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 2005,
|
|
62
|
+
name: "ClubCo",
|
|
64
63
|
},
|
|
65
64
|
],
|
|
65
|
+
services: {
|
|
66
|
+
datasheets: 1,
|
|
67
|
+
descriptions: 1,
|
|
68
|
+
images: 1,
|
|
69
|
+
},
|
|
66
70
|
retailersAvailable: [
|
|
67
71
|
{
|
|
68
|
-
id:
|
|
69
|
-
name: "
|
|
72
|
+
id: 4,
|
|
73
|
+
name: "Walmart Super y Superama",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 9,
|
|
77
|
+
name: "Amazon",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 1013,
|
|
81
|
+
name: "Cencosud Colombia",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 2005,
|
|
85
|
+
name: "ClubCo",
|
|
70
86
|
},
|
|
71
87
|
],
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
id_order: 2,
|
|
88
|
+
id_article: 33249,
|
|
89
|
+
categoryName: "SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
|
|
90
|
+
version_status: "RECEPTION",
|
|
76
91
|
},
|
|
77
92
|
productToEdit: {
|
|
78
|
-
ArticleId:
|
|
79
|
-
idCategory: "
|
|
93
|
+
ArticleId: 33249,
|
|
94
|
+
idCategory: "684",
|
|
80
95
|
product: {
|
|
81
|
-
orderId:
|
|
82
|
-
|
|
83
|
-
|
|
96
|
+
orderId: 7,
|
|
97
|
+
id_category: "684",
|
|
98
|
+
status: "RECEPTION",
|
|
99
|
+
datasheet_status: null,
|
|
84
100
|
prio: "none",
|
|
85
|
-
version:
|
|
86
|
-
description_status:
|
|
87
|
-
images_status:
|
|
101
|
+
version: 4,
|
|
102
|
+
description_status: null,
|
|
103
|
+
images_status: null,
|
|
88
104
|
brand: null,
|
|
89
|
-
retailerOrder: 0,
|
|
90
105
|
missing: {
|
|
91
|
-
datasheet:
|
|
92
|
-
descriptions:
|
|
93
|
-
images:
|
|
94
|
-
},
|
|
95
|
-
services: {
|
|
96
|
-
datasheets: 1,
|
|
97
|
-
descriptions: 1,
|
|
98
|
-
images: 1,
|
|
106
|
+
datasheet: 33,
|
|
107
|
+
descriptions: 14,
|
|
108
|
+
images: 3,
|
|
99
109
|
},
|
|
100
110
|
article: {
|
|
101
|
-
category: "
|
|
111
|
+
category: "SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
|
|
102
112
|
company_name: "COMPANY DEV",
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
id_description_facilitator: 52,
|
|
109
|
-
id_images_especialist: 55,
|
|
110
|
-
id_images_facilitator: 53,
|
|
111
|
-
id_order: 2,
|
|
112
|
-
id_article: 35319,
|
|
113
|
-
id_auditor: 30,
|
|
114
|
-
name: "FOCO LED A19 (60W) LUZ AMARILLA",
|
|
115
|
-
upc: "120873",
|
|
113
|
+
id_category: "684",
|
|
114
|
+
id_article: 33249,
|
|
115
|
+
name: "Crema dental ",
|
|
116
|
+
timestamp: "2022-06-14T23:24:08.000Z",
|
|
117
|
+
upc: "232435",
|
|
116
118
|
},
|
|
117
119
|
retailers: [
|
|
118
120
|
{
|
|
119
|
-
id:
|
|
120
|
-
name: "
|
|
121
|
+
id: 4,
|
|
122
|
+
name: "Walmart Super y Superama",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 9,
|
|
126
|
+
name: "Amazon",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 1013,
|
|
130
|
+
name: "Cencosud Colombia",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 2005,
|
|
134
|
+
name: "ClubCo",
|
|
121
135
|
},
|
|
122
136
|
],
|
|
137
|
+
services: {
|
|
138
|
+
datasheets: 1,
|
|
139
|
+
descriptions: 1,
|
|
140
|
+
images: 1,
|
|
141
|
+
},
|
|
123
142
|
retailersAvailable: [
|
|
124
143
|
{
|
|
125
|
-
id:
|
|
126
|
-
name: "
|
|
144
|
+
id: 4,
|
|
145
|
+
name: "Walmart Super y Superama",
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 9,
|
|
149
|
+
name: "Amazon",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: 1013,
|
|
153
|
+
name: "Cencosud Colombia",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 2005,
|
|
157
|
+
name: "ClubCo",
|
|
127
158
|
},
|
|
128
159
|
],
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
160
|
+
id_article: 33249,
|
|
161
|
+
categoryName:
|
|
162
|
+
"SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
|
|
163
|
+
version_status: "RECEPTION",
|
|
133
164
|
},
|
|
134
165
|
},
|
|
135
166
|
location: {
|
|
@@ -225,11 +225,14 @@ export const ProviderProductEdition = ({
|
|
|
225
225
|
|
|
226
226
|
const getServices = async () => {
|
|
227
227
|
const productInOrder = product.id_order || product.orderId;
|
|
228
|
+
const idArticle = product?.id_article || product?.article?.id_article;
|
|
228
229
|
if (isRevision() || productInOrder) {
|
|
229
230
|
const servicesResponse = await axios.get(
|
|
230
|
-
`${
|
|
231
|
-
|
|
232
|
-
}&orderId=${
|
|
231
|
+
`${
|
|
232
|
+
process.env.REACT_APP_SERVICES_ENDPOINT
|
|
233
|
+
}?articleId=${idArticle}&orderId=${
|
|
234
|
+
product?.id_order ?? product.orderId
|
|
235
|
+
}&end=true`
|
|
233
236
|
);
|
|
234
237
|
const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
|
|
235
238
|
setServicesData(parsedResponse);
|
|
@@ -339,17 +342,18 @@ export const ProviderProductEdition = ({
|
|
|
339
342
|
|
|
340
343
|
useEffect(() => {
|
|
341
344
|
if (services.length > 0) {
|
|
342
|
-
if (services[0][activeRetailer
|
|
345
|
+
if (services[0][activeRetailer.id]?.data)
|
|
343
346
|
services[0][activeRetailer.id].data = Object.values(
|
|
344
347
|
services[0][activeRetailer.id].data
|
|
345
348
|
);
|
|
346
349
|
setActivePercentage(Math.round(activeRetailer?.percentage, 0));
|
|
347
350
|
|
|
348
|
-
const datagroups = services[0][activeRetailer
|
|
351
|
+
const datagroups = services[0][activeRetailer.id];
|
|
349
352
|
const inputs = services[0]?.inputs;
|
|
350
353
|
const descriptions = services[1]?.filter(
|
|
351
354
|
(service) => service?.id === activeRetailer?.id
|
|
352
355
|
);
|
|
356
|
+
console.log(services[0], "services[0]");
|
|
353
357
|
setDatasheets([datagroups, inputs]);
|
|
354
358
|
setDescriptions(descriptions);
|
|
355
359
|
}
|
|
@@ -918,8 +922,9 @@ export const ProviderProductEdition = ({
|
|
|
918
922
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
919
923
|
};
|
|
920
924
|
|
|
921
|
-
const evaluationComplete = () => {
|
|
922
|
-
|
|
925
|
+
const evaluationComplete = (tab) => {
|
|
926
|
+
console.log(servicesData, "servicesData");
|
|
927
|
+
const concept = getConcept(tab);
|
|
923
928
|
let serv = servicesData.filter((item) => item.service === concept);
|
|
924
929
|
if (
|
|
925
930
|
["RequestWithContentoh", "RequestWithoutContentoh"].includes(
|
|
@@ -1070,9 +1075,9 @@ export const ProviderProductEdition = ({
|
|
|
1070
1075
|
};
|
|
1071
1076
|
|
|
1072
1077
|
const sendEvaluation = async (result) => {
|
|
1078
|
+
setLoading(true);
|
|
1073
1079
|
let data = {};
|
|
1074
1080
|
const retailerId = activeRetailer?.id;
|
|
1075
|
-
const productTemp = product;
|
|
1076
1081
|
if (result) {
|
|
1077
1082
|
data = {
|
|
1078
1083
|
articleId: product.id_article,
|
|
@@ -1081,13 +1086,13 @@ export const ProviderProductEdition = ({
|
|
|
1081
1086
|
result: result,
|
|
1082
1087
|
retailerId,
|
|
1083
1088
|
};
|
|
1084
|
-
productTemp[`${concept}_status`] = `${result}P`;
|
|
1085
1089
|
await axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
1086
1090
|
headers: {
|
|
1087
1091
|
Authorization: token,
|
|
1088
1092
|
},
|
|
1089
1093
|
});
|
|
1090
1094
|
} else {
|
|
1095
|
+
const productTemp = product;
|
|
1091
1096
|
const concept = getConcept(activeTab);
|
|
1092
1097
|
productTemp[`${concept}_status`] = "Evaluated";
|
|
1093
1098
|
data = {
|
|
@@ -1406,14 +1411,14 @@ export const ProviderProductEdition = ({
|
|
|
1406
1411
|
)}
|
|
1407
1412
|
<Button
|
|
1408
1413
|
buttonType={
|
|
1409
|
-
evaluationComplete() &&
|
|
1414
|
+
evaluationComplete(activeTab) &&
|
|
1410
1415
|
(productEdit.product.id_order || productEdit.product.orderId)
|
|
1411
1416
|
? "general-green-button"
|
|
1412
1417
|
: "general-button-disabled"
|
|
1413
1418
|
}
|
|
1414
1419
|
label={"Enviar evaluación"}
|
|
1415
1420
|
onClick={() => {
|
|
1416
|
-
setModalSent(true);
|
|
1421
|
+
//setModalSent(true);
|
|
1417
1422
|
sendEvaluation();
|
|
1418
1423
|
setMessage(
|
|
1419
1424
|
`¡Evaluación de ${translateConcept()} completada!`
|
|
@@ -1432,10 +1437,10 @@ export const ProviderProductEdition = ({
|
|
|
1432
1437
|
</div>
|
|
1433
1438
|
{inCart ? (
|
|
1434
1439
|
<button type="button">
|
|
1435
|
-
<Link to="/checkout">
|
|
1440
|
+
{/* <Link to="/checkout">
|
|
1436
1441
|
<p>Articulo en carrito</p>
|
|
1437
1442
|
<p>Ir a checkout</p>
|
|
1438
|
-
</Link>
|
|
1443
|
+
</Link> */}
|
|
1439
1444
|
</button>
|
|
1440
1445
|
) : (
|
|
1441
1446
|
<Button
|
|
@@ -1477,10 +1482,10 @@ export const ProviderProductEdition = ({
|
|
|
1477
1482
|
<GlobalModal
|
|
1478
1483
|
close={() => setModalSent(false)}
|
|
1479
1484
|
message={message}
|
|
1480
|
-
detail={
|
|
1481
|
-
bold={!evaluationComplete() && "Aprueba / Rechaza"}
|
|
1482
|
-
widthImg={!evaluationComplete() ? "160px" : "354px"}
|
|
1483
|
-
heightImg={!evaluationComplete() ? "84px" : "354px"}
|
|
1485
|
+
detail={""}
|
|
1486
|
+
bold={!evaluationComplete(activeTab) && "Aprueba / Rechaza"}
|
|
1487
|
+
widthImg={!evaluationComplete(activeTab) ? "160px" : "354px"}
|
|
1488
|
+
heightImg={!evaluationComplete(activeTab) ? "84px" : "354px"}
|
|
1484
1489
|
img={getSectionIcon()}
|
|
1485
1490
|
/>
|
|
1486
1491
|
)}
|