contentoh-components-library 21.5.22 → 21.5.23
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 +152 -61
- package/dist/components/pages/ProviderProductEdition/index.js +89 -31
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +20 -20
- package/dist/components/pages/RetailerProductEdition/index.js +54 -29
- package/package.json +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +159 -64
- package/src/components/pages/ProviderProductEdition/index.js +100 -39
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +23 -23
- package/src/components/pages/RetailerProductEdition/index.js +36 -20
|
@@ -16,49 +16,49 @@ RetailerProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNGRiODI2My1jYjA1LTQzMTItOWU0NS1lM2RlY2E2NjllNzIiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6ImY0ZGI4MjYzLWNiMDUtNDMxMi05ZTQ1LWUzZGVjYTY2OWU3MiIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiIwZGZkNTRmZC1lMjU1LTRkNmEtYmE1ZS1hYzdjYWM2NjY0NzciLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcxODgxMjc1MSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTcxODgxNjM1MCwiaWF0IjoxNzE4ODEyNzUxLCJlbWFpbCI6ImVtb250YW5vQGNvbnRlbnRvaC5jb20ifQ.eruTcERQql3d7XO5LWbmTAOgrU7avQQ-GN3iiRGuVYUmI1tqMsHxWVsxC8T3QMBkZFL9djpMaOvw53Fc_Gl84WKPr9pmECDsqUkgXKJZxHE5jsRJjsyAd9pdJ00jYdeWePoitxYazBR9TW0TofiB7L5F9b_gjZrGdoAzz1gQvWABL_eGYxrGfJCoNBzxbU8zAIfPJV6u6PR98rumtMVWHW_FyzpZnNKSiP4rEkG7H9cW-Mdzl39seeHQRo9SNht55tnlPkXi7jN6R-AOGhgK0yBHgAwVBbv3aT_TDArXEiXFUFG9viCIq7H6lRvCaXEmJoKnOZOCbpX1y3QI8ayMVQ",
|
|
20
20
|
productSelected: {
|
|
21
21
|
services: {
|
|
22
22
|
datasheets: 1,
|
|
23
23
|
descriptions: 1,
|
|
24
24
|
images: 1,
|
|
25
25
|
},
|
|
26
|
-
orderId:
|
|
26
|
+
orderId: 8086,
|
|
27
27
|
status: "RP",
|
|
28
28
|
datasheet_status: "AA",
|
|
29
29
|
prio: "none",
|
|
30
30
|
version: 3,
|
|
31
|
-
description_status: "
|
|
32
|
-
images_status: "
|
|
31
|
+
description_status: "AA",
|
|
32
|
+
images_status: "RA",
|
|
33
33
|
statusByRetailer: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
"58": {
|
|
35
|
+
datasheet: "AA",
|
|
36
|
+
description: "AA",
|
|
37
|
+
images: "RA/CA",
|
|
38
|
+
},
|
|
38
39
|
},
|
|
39
|
-
},
|
|
40
40
|
article: {
|
|
41
|
-
id_article:
|
|
42
|
-
id_category: "
|
|
43
|
-
name: "
|
|
44
|
-
upc: "
|
|
45
|
-
timestamp: "2024-
|
|
46
|
-
id_user:
|
|
41
|
+
id_article: 127595,
|
|
42
|
+
id_category: "2902",
|
|
43
|
+
name: "LISTON DECORATIVO DISNEY 5M 2 ESTILOS",
|
|
44
|
+
upc: "214715",
|
|
45
|
+
timestamp: "2024-06-05T14:29:41.000Z",
|
|
46
|
+
id_user: 673,
|
|
47
47
|
status: null,
|
|
48
48
|
active: 1,
|
|
49
|
-
company_id:
|
|
50
|
-
company_name: "
|
|
51
|
-
country:
|
|
52
|
-
id_order:
|
|
49
|
+
company_id: 535,
|
|
50
|
+
company_name: "THD IMPORTACIONES",
|
|
51
|
+
country: null,
|
|
52
|
+
id_order: 8086,
|
|
53
53
|
id_datasheet_especialist: 2757,
|
|
54
54
|
id_datasheet_facilitator: null,
|
|
55
55
|
id_description_especialist: 2757,
|
|
56
56
|
id_description_facilitator: null,
|
|
57
|
-
id_images_especialist:
|
|
57
|
+
id_images_especialist: 1259,
|
|
58
58
|
id_images_facilitator: null,
|
|
59
59
|
id_auditor: 514,
|
|
60
60
|
id_recepcionist: null,
|
|
61
|
-
category: "
|
|
61
|
+
category: "Navidad|Decoración Interior|Mallas y Listones",
|
|
62
62
|
missingAttributes: 0,
|
|
63
63
|
missingDescriptions: 0,
|
|
64
64
|
missingImages: 0,
|
|
@@ -69,8 +69,8 @@ RetailerProductEditionDefault.args = {
|
|
|
69
69
|
name: "The Home Depot Golden",
|
|
70
70
|
},
|
|
71
71
|
],
|
|
72
|
-
country: "
|
|
73
|
-
upc: "
|
|
72
|
+
country: "",
|
|
73
|
+
upc: "214715",
|
|
74
74
|
}
|
|
75
75
|
,
|
|
76
76
|
// location: {
|
|
@@ -354,6 +354,15 @@ export const RetailerProductEdition = ({
|
|
|
354
354
|
setObservationVisible(false);
|
|
355
355
|
};
|
|
356
356
|
|
|
357
|
+
const handleCommentSubmit = (e) => {
|
|
358
|
+
e.preventDefault();
|
|
359
|
+
const commentText = document.querySelector(
|
|
360
|
+
"#commentary-box .ql-container .ql-editor > p"
|
|
361
|
+
).innerHTML;
|
|
362
|
+
createComment(e, commentText, activeTab);
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
|
|
357
366
|
useEffect(async () => {
|
|
358
367
|
const { id_article } = product?.article || {};
|
|
359
368
|
if (id_article)
|
|
@@ -1077,19 +1086,35 @@ export const RetailerProductEdition = ({
|
|
|
1077
1086
|
return product?.article[`id_auditor`] === user.id_user;
|
|
1078
1087
|
};
|
|
1079
1088
|
|
|
1080
|
-
const createComment = async (
|
|
1089
|
+
const createComment = async (e, body, tab) => {
|
|
1090
|
+
let concept = "";
|
|
1091
|
+
switch (activeTab) {
|
|
1092
|
+
case "Ficha técnica":
|
|
1093
|
+
concept = "datasheet";
|
|
1094
|
+
break;
|
|
1095
|
+
case "Imágenes":
|
|
1096
|
+
concept = "images";
|
|
1097
|
+
break;
|
|
1098
|
+
|
|
1099
|
+
default:
|
|
1100
|
+
concept = "description";
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1081
1103
|
const data = {
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
status: product.status,
|
|
1088
|
-
},
|
|
1089
|
-
paramsHeader: { Authorization: token },
|
|
1104
|
+
articleId: product?.article?.id_article,
|
|
1105
|
+
orderId: product?.orderId,
|
|
1106
|
+
message: body?.replace(/<.*?\/?>/gm, ""),
|
|
1107
|
+
concept: concept,
|
|
1108
|
+
version: version,
|
|
1090
1109
|
};
|
|
1110
|
+
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
1111
|
+
headers: {
|
|
1112
|
+
Authorization: token,
|
|
1113
|
+
},
|
|
1114
|
+
});
|
|
1115
|
+
await getComments(tab);
|
|
1091
1116
|
setMessage("");
|
|
1092
|
-
|
|
1117
|
+
setComponentsArray([]);
|
|
1093
1118
|
};
|
|
1094
1119
|
|
|
1095
1120
|
const getRequired = (services) => {
|
|
@@ -1341,7 +1366,6 @@ export const RetailerProductEdition = ({
|
|
|
1341
1366
|
};
|
|
1342
1367
|
|
|
1343
1368
|
useEffect(() => {
|
|
1344
|
-
console.log(servicesData, "servicesData");
|
|
1345
1369
|
let status = getRetailerStatus(servicesData, activeTab);
|
|
1346
1370
|
setRetailerStatus(status);
|
|
1347
1371
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1666,15 +1690,7 @@ export const RetailerProductEdition = ({
|
|
|
1666
1690
|
<Button
|
|
1667
1691
|
buttonType={"general-transparent-button"}
|
|
1668
1692
|
label={"Enviar comentario"}
|
|
1669
|
-
onClick={
|
|
1670
|
-
createComment(
|
|
1671
|
-
e,
|
|
1672
|
-
document.querySelector(
|
|
1673
|
-
"#commentary-box .ql-container .ql-editor > p"
|
|
1674
|
-
).innerHTML,
|
|
1675
|
-
activeTab
|
|
1676
|
-
)
|
|
1677
|
-
}
|
|
1693
|
+
onClick={handleCommentSubmit}
|
|
1678
1694
|
/>
|
|
1679
1695
|
</div>
|
|
1680
1696
|
</div>
|