contentoh-components-library 21.5.21 → 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/organisms/Table/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/MultipleEdition.stories.js +2 -2
- package/dist/components/pages/MultipleEdition/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/utils.js +12 -51
- 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/organisms/Table/styles.js +1 -0
- package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +2 -2
- package/src/components/pages/MultipleEdition/styles.js +8 -6
- package/src/components/pages/MultipleEdition/utils.js +16 -7
- 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,50 +16,133 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: true,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"
|
|
20
|
-
articleId:
|
|
21
|
-
category:
|
|
22
|
-
version:
|
|
19
|
+
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI2MjM3OWU5OS01Mjk2LTRhZGQtODkyNy01YzU2ZmFjZDlkYmMiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjYyMzc5ZTk5LTUyOTYtNGFkZC04OTI3LTVjNTZmYWNkOWRiYyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI4ZmRkOWJlYS1jYTE0LTQ4MmQtYmUwNi1iMjA4YjdjMTM1MWYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcxODgyMDI2MCwibmFtZSI6IlByb3ZlZWRvciBQcnVlYmEiLCJwaG9uZV9udW1iZXIiOiIrNTI1NTM5MDA2NTcwIiwiZXhwIjoxNzE4ODIzODYwLCJpYXQiOjE3MTg4MjAyNjAsImVtYWlsIjoibGltYW43NDAyNkBtbnFsbS5jb20ifQ.j4PhSKzZ0yb_5QyXYh_vviA-zbMhJc_wE3yqFErlrPsCZsqY43hx-fvEwwOJnzqwNlPFms6kZbddaGPVu0jnGw8TmiaKtoDVOmui_db8DuWGDHLPQhPZNeoM_g5qKY8H7ZIClGSOohj_61XDrJBYQf9utcimiPGkCHET4_3mq1cSfKm9Sk_jd9q5_zblODT2gzC3SnLcD9JBxh1cj6sIL5oBCVxcwbgdAVM82xo2OL9qMCoUomRlvMTOQ7b3LjATS88ZAx4lrLuLHQjMEnYmRFYbsE4kii9JkvBYo9PE6U9F944C1W8toyELGvXjI4Lp5LjpQCr141Z-KohqXeoYww",
|
|
20
|
+
articleId: 127595,
|
|
21
|
+
category: "2902",
|
|
22
|
+
version: 3,
|
|
23
23
|
productSelected: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
orderId: 8086,
|
|
25
|
+
status: "AA",
|
|
26
|
+
datasheet_status: "AA",
|
|
27
|
+
prio: "none",
|
|
28
|
+
version: 3,
|
|
29
|
+
description_status: "AA",
|
|
30
|
+
images_status: "AA",
|
|
31
|
+
brand: null,
|
|
32
|
+
retailerOrder: 0,
|
|
33
|
+
missing: {
|
|
34
|
+
datasheet: null,
|
|
35
|
+
descriptions: null,
|
|
36
|
+
images: null,
|
|
37
|
+
},
|
|
38
|
+
services: {
|
|
39
|
+
datasheets: 1,
|
|
40
|
+
descriptions: 1,
|
|
41
|
+
images: 1,
|
|
42
|
+
},
|
|
43
|
+
article: {
|
|
44
|
+
category: "Navidad|Decoración Interior|Mallas y Listones",
|
|
45
|
+
company_name: "THD IMPORTACIONES",
|
|
46
|
+
country: null,
|
|
47
|
+
id_category: "2902",
|
|
48
|
+
id_datasheet_especialist: 2757,
|
|
49
|
+
id_datasheet_facilitator: null,
|
|
50
|
+
id_description_especialist: 2757,
|
|
51
|
+
id_description_facilitator: null,
|
|
52
|
+
id_images_especialist: 1259,
|
|
53
|
+
id_images_facilitator: null,
|
|
54
|
+
id_order: 8086,
|
|
55
|
+
id_article: 127595,
|
|
56
|
+
id_auditor: 514,
|
|
57
|
+
name: "LISTON DECORATIVO DISNEY 5M 2 ESTILOS",
|
|
58
|
+
timestamp: "2024-06-05T14:30:33.000Z",
|
|
59
|
+
upc: "214715",
|
|
60
|
+
},
|
|
61
|
+
retailers: [
|
|
62
|
+
{
|
|
63
|
+
id: 58,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
statusByRetailer: {
|
|
67
|
+
"58": {
|
|
68
|
+
datasheet: "AA",
|
|
69
|
+
description: "AA",
|
|
70
|
+
images: "AA",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
32
73
|
retailersAvailable: [
|
|
33
74
|
{
|
|
34
|
-
|
|
35
|
-
id: 74,
|
|
75
|
+
id: 58,
|
|
36
76
|
},
|
|
37
77
|
],
|
|
38
|
-
|
|
78
|
+
categoryName: "Navidad|Decoración Interior|Mallas y Listones",
|
|
79
|
+
upc: "214715",
|
|
80
|
+
id_article: 127595,
|
|
81
|
+
id_order: 8086,
|
|
39
82
|
},
|
|
40
83
|
productToEdit: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
product:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
percentage: 100,
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
percentage: 100,
|
|
84
|
+
ArticleId: 127595,
|
|
85
|
+
idCategory: "2902",
|
|
86
|
+
product: {
|
|
87
|
+
orderId: 8086,
|
|
88
|
+
status: "AA",
|
|
89
|
+
datasheet_status: "AA",
|
|
90
|
+
prio: "none",
|
|
91
|
+
version: 3,
|
|
92
|
+
description_status: "AA",
|
|
93
|
+
images_status: "AA",
|
|
94
|
+
brand: null,
|
|
95
|
+
retailerOrder: 0,
|
|
96
|
+
missing: {
|
|
97
|
+
datasheet: null,
|
|
98
|
+
descriptions: null,
|
|
99
|
+
images: null,
|
|
61
100
|
},
|
|
62
|
-
|
|
101
|
+
services: {
|
|
102
|
+
datasheets: 1,
|
|
103
|
+
descriptions: 1,
|
|
104
|
+
images: 1,
|
|
105
|
+
},
|
|
106
|
+
article: {
|
|
107
|
+
category: "Navidad|Decoración Interior|Mallas y Listones",
|
|
108
|
+
company_name: "THD IMPORTACIONES",
|
|
109
|
+
country: null,
|
|
110
|
+
id_category: "2902",
|
|
111
|
+
id_datasheet_especialist: 2757,
|
|
112
|
+
id_datasheet_facilitator: null,
|
|
113
|
+
id_description_especialist: 2757,
|
|
114
|
+
id_description_facilitator: null,
|
|
115
|
+
id_images_especialist: 1259,
|
|
116
|
+
id_images_facilitator: null,
|
|
117
|
+
id_order: 8086,
|
|
118
|
+
id_article: 127595,
|
|
119
|
+
id_auditor: 514,
|
|
120
|
+
name: "LISTON DECORATIVO DISNEY 5M 2 ESTILOS",
|
|
121
|
+
timestamp: "2024-06-05T14:30:33.000Z",
|
|
122
|
+
upc: "214715",
|
|
123
|
+
},
|
|
124
|
+
retailers: [
|
|
125
|
+
{
|
|
126
|
+
id: 58,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
statusByRetailer: {
|
|
130
|
+
"58": {
|
|
131
|
+
datasheet: "AA",
|
|
132
|
+
description: "AA",
|
|
133
|
+
images: "AA",
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
retailersAvailable: [
|
|
137
|
+
{
|
|
138
|
+
id: 58,
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
categoryName: "Navidad|Decoración Interior|Mallas y Listones",
|
|
142
|
+
upc: "214715",
|
|
143
|
+
id_article: 127595,
|
|
144
|
+
id_order: 8086,
|
|
145
|
+
},
|
|
63
146
|
},
|
|
64
147
|
location: {
|
|
65
148
|
pathname: "/EditProducts",
|
|
@@ -73,21 +156,21 @@ ProviderProductEditionDefault.args = {
|
|
|
73
156
|
key: "24vwut",
|
|
74
157
|
},
|
|
75
158
|
user: {
|
|
76
|
-
id_user:
|
|
77
|
-
name: "Proveedor
|
|
78
|
-
last_name: "
|
|
79
|
-
email: "
|
|
80
|
-
position: "
|
|
81
|
-
telephone: "
|
|
159
|
+
id_user: 419,
|
|
160
|
+
name: "Proveedor",
|
|
161
|
+
last_name: "Prueba",
|
|
162
|
+
email: "liman74026@mnqlm.com",
|
|
163
|
+
position: "Cliente",
|
|
164
|
+
telephone: "5539006570",
|
|
82
165
|
country: "México",
|
|
83
|
-
id_company:
|
|
84
|
-
id_cognito: "
|
|
85
|
-
birth_Date:
|
|
166
|
+
id_company: 535,
|
|
167
|
+
id_cognito: "62379e99-5296-4add-8927-5c56facd9dbc",
|
|
168
|
+
birth_Date: "2021-08-30T00:00:00.000Z",
|
|
86
169
|
about_me: null,
|
|
87
|
-
zip_code:
|
|
88
|
-
address:
|
|
170
|
+
zip_code: "53000",
|
|
171
|
+
address: "Av 16 de Septiembre #27",
|
|
89
172
|
job: null,
|
|
90
|
-
id_stripe:
|
|
173
|
+
id_stripe: "cus_KBCZoGEdXpxqVS",
|
|
91
174
|
id_role: 0,
|
|
92
175
|
active: 1,
|
|
93
176
|
is_retailer: 0,
|
|
@@ -95,24 +178,24 @@ ProviderProductEditionDefault.args = {
|
|
|
95
178
|
is_user_tech: null,
|
|
96
179
|
is_onboarding: 0,
|
|
97
180
|
membership: {
|
|
98
|
-
id:
|
|
99
|
-
start_date: "
|
|
100
|
-
end_date: "
|
|
181
|
+
id: 1119,
|
|
182
|
+
start_date: "2022-06-20T13:35:19.000Z",
|
|
183
|
+
end_date: "2022-06-20T08:35:10.000Z",
|
|
101
184
|
planID: 8,
|
|
102
|
-
plan: "
|
|
185
|
+
plan: "prod_KvGeJs0E9cSO4y",
|
|
103
186
|
name: "Plan Pro",
|
|
104
187
|
user_limit: "50",
|
|
105
188
|
products_limit: "5000",
|
|
106
189
|
type: "Enterprise",
|
|
107
190
|
},
|
|
108
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
191
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-419/419.png?1718820261153",
|
|
109
192
|
},
|
|
110
193
|
company: {
|
|
111
|
-
id_company:
|
|
112
|
-
trade_name: "
|
|
113
|
-
company_name: "
|
|
114
|
-
rfc:
|
|
115
|
-
adress:
|
|
194
|
+
id_company: 535,
|
|
195
|
+
trade_name: "THD IMPORTACIONES",
|
|
196
|
+
company_name: "THD IMPORTACIONES",
|
|
197
|
+
rfc: null,
|
|
198
|
+
adress: null,
|
|
116
199
|
about_company: null,
|
|
117
200
|
telephone: null,
|
|
118
201
|
web_site: null,
|
|
@@ -122,22 +205,34 @@ ProviderProductEditionDefault.args = {
|
|
|
122
205
|
is_retailer: 0,
|
|
123
206
|
financedRetailers: [
|
|
124
207
|
{
|
|
125
|
-
id:
|
|
126
|
-
name: "
|
|
208
|
+
id: 58,
|
|
209
|
+
name: "The Home Depot Golden",
|
|
210
|
+
country: "México",
|
|
211
|
+
id_region: 1,
|
|
212
|
+
active: 1,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
id: 59,
|
|
216
|
+
name: "The Home Depot Platinum",
|
|
127
217
|
country: "México",
|
|
128
218
|
id_region: 1,
|
|
129
219
|
active: 1,
|
|
130
|
-
flow: 1,
|
|
131
220
|
},
|
|
132
221
|
],
|
|
133
222
|
retailers: [
|
|
134
223
|
{
|
|
135
|
-
id:
|
|
136
|
-
name: "
|
|
224
|
+
id: 58,
|
|
225
|
+
name: "The Home Depot Golden",
|
|
226
|
+
country: "México",
|
|
227
|
+
id_region: 1,
|
|
228
|
+
active: 1,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: 59,
|
|
232
|
+
name: "The Home Depot Platinum",
|
|
137
233
|
country: "México",
|
|
138
234
|
id_region: 1,
|
|
139
235
|
active: 1,
|
|
140
|
-
flow: 1,
|
|
141
236
|
},
|
|
142
237
|
],
|
|
143
238
|
},
|
|
@@ -914,19 +914,33 @@ export const ProviderProductEdition = ({
|
|
|
914
914
|
}
|
|
915
915
|
};
|
|
916
916
|
|
|
917
|
-
const createComment = async (
|
|
917
|
+
const createComment = async (e, body, tab) => {
|
|
918
|
+
let concept = "";
|
|
919
|
+
switch (activeTab) {
|
|
920
|
+
case "Ficha técnica":
|
|
921
|
+
concept = "datasheet";
|
|
922
|
+
break;
|
|
923
|
+
case "Imágenes":
|
|
924
|
+
concept = "images";
|
|
925
|
+
break;
|
|
926
|
+
|
|
927
|
+
default:
|
|
928
|
+
concept = "description";
|
|
929
|
+
break;
|
|
930
|
+
}
|
|
918
931
|
const data = {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
status: product.status || productEdit.product.status,
|
|
925
|
-
},
|
|
926
|
-
paramsHeader: { Authorization: token },
|
|
932
|
+
articleId: product?.id_article,
|
|
933
|
+
orderId: product?.orderId,
|
|
934
|
+
message: body,
|
|
935
|
+
concept: concept,
|
|
936
|
+
version: version,
|
|
927
937
|
};
|
|
928
|
-
|
|
929
|
-
|
|
938
|
+
console.log('comentario:', data.message);
|
|
939
|
+
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
940
|
+
headers: {
|
|
941
|
+
Authorization: token,
|
|
942
|
+
},
|
|
943
|
+
});
|
|
930
944
|
};
|
|
931
945
|
|
|
932
946
|
useEffect(() => {
|
|
@@ -1590,41 +1604,88 @@ export const ProviderProductEdition = ({
|
|
|
1590
1604
|
</>
|
|
1591
1605
|
)}
|
|
1592
1606
|
</div>
|
|
1593
|
-
{
|
|
1594
|
-
<div className="
|
|
1595
|
-
|
|
1596
|
-
<
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
<
|
|
1607
|
-
|
|
1608
|
-
|
|
1607
|
+
{isRevision() && getSectionStatus() ? (
|
|
1608
|
+
<div className="commentary-box">
|
|
1609
|
+
{!comment ? (
|
|
1610
|
+
<div className="commentary">
|
|
1611
|
+
<TagAndInput
|
|
1612
|
+
label={"Caja de Comentario"}
|
|
1613
|
+
inputType={"textarea"}
|
|
1614
|
+
inputCols={80}
|
|
1615
|
+
inputRows={4}
|
|
1616
|
+
inputId={"commentary-box"}
|
|
1617
|
+
index={0}
|
|
1618
|
+
/>
|
|
1619
|
+
<div className="buttons-box">
|
|
1620
|
+
<Button
|
|
1621
|
+
buttonType={"general-transparent-button"}
|
|
1622
|
+
label={"Enviar comentario"}
|
|
1623
|
+
onClick={(e) =>{
|
|
1624
|
+
createComment(
|
|
1625
|
+
e,
|
|
1626
|
+
document.querySelector(
|
|
1627
|
+
"#commentary-box .ql-container .ql-editor > p"
|
|
1628
|
+
).innerHTML,
|
|
1629
|
+
activeTab
|
|
1630
|
+
)
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
/>
|
|
1634
|
+
</div>
|
|
1635
|
+
</div>
|
|
1609
1636
|
) : (
|
|
1610
|
-
|
|
1611
|
-
<
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
iconSize={"big-image"}
|
|
1615
|
-
slidePosition={"top-slide"}
|
|
1637
|
+
<div className="feedback-box">
|
|
1638
|
+
<Commentary
|
|
1639
|
+
comment={comment.message}
|
|
1640
|
+
reviewed={crossComment}
|
|
1616
1641
|
/>
|
|
1617
1642
|
<Button
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1643
|
+
buttonType={"circular-button accept-button"}
|
|
1644
|
+
onClick={async () => {
|
|
1645
|
+
setCrossComment(true);
|
|
1646
|
+
commentRevised();
|
|
1621
1647
|
}}
|
|
1622
|
-
buttonType="general-default-button"
|
|
1623
|
-
label="Enviar a Content-oh!"
|
|
1624
1648
|
/>
|
|
1625
|
-
|
|
1649
|
+
</div>
|
|
1626
1650
|
)}
|
|
1627
1651
|
</div>
|
|
1652
|
+
) : (
|
|
1653
|
+
!revision && (
|
|
1654
|
+
<div className="required-inputs-message">
|
|
1655
|
+
<div>
|
|
1656
|
+
<p>
|
|
1657
|
+
Los atributos son requeridos por las plataformas de las
|
|
1658
|
+
cadenas, es muy importante completar los campos requeridos
|
|
1659
|
+
ya que pueden rechazar el producto por falta de información.
|
|
1660
|
+
</p>
|
|
1661
|
+
</div>
|
|
1662
|
+
{inCart ? (
|
|
1663
|
+
<button type="button">
|
|
1664
|
+
<Link to="/checkout">
|
|
1665
|
+
<p>Articulo en carrito</p>
|
|
1666
|
+
<p>Ir a checkout</p>
|
|
1667
|
+
</Link>
|
|
1668
|
+
</button>
|
|
1669
|
+
) : (
|
|
1670
|
+
<>
|
|
1671
|
+
<SliderToolTip
|
|
1672
|
+
infoIcon={InfoIcon}
|
|
1673
|
+
slidefront={slidefront}
|
|
1674
|
+
iconSize={"big-image"}
|
|
1675
|
+
slidePosition={"top-slide"}
|
|
1676
|
+
/>
|
|
1677
|
+
<Button
|
|
1678
|
+
onClick={() => {
|
|
1679
|
+
setShowContentohRequestModal &&
|
|
1680
|
+
setShowContentohRequestModal(true);
|
|
1681
|
+
}}
|
|
1682
|
+
buttonType="general-default-button"
|
|
1683
|
+
label="Enviar a Content-oh!"
|
|
1684
|
+
/>
|
|
1685
|
+
</>
|
|
1686
|
+
)}
|
|
1687
|
+
</div>
|
|
1688
|
+
)
|
|
1628
1689
|
)}
|
|
1629
1690
|
</div>
|
|
1630
1691
|
</div>
|
|
@@ -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>
|