contentoh-components-library 21.3.41 → 21.3.43
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/DashboardMetric/dashboardMetricUtils.js +27 -0
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +63 -77
- package/dist/components/pages/ProviderProductEdition/index.js +453 -205
- package/package.json +1 -1
- package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +18 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +63 -83
- package/src/components/pages/ProviderProductEdition/index.js +138 -23
package/package.json
CHANGED
|
@@ -35,6 +35,16 @@ export const getFullStatus = (status) => {
|
|
|
35
35
|
return "Exportado";
|
|
36
36
|
case "NS":
|
|
37
37
|
return "No solicitado";
|
|
38
|
+
case "SAC":
|
|
39
|
+
return "Solicitud Auditoría Content-oh!";
|
|
40
|
+
case "AAC":
|
|
41
|
+
return "Aprobado Auditoría Content-oh!";
|
|
42
|
+
case "RAC":
|
|
43
|
+
return "Rechazado Auditoría Content-oh!";
|
|
44
|
+
case "FAP":
|
|
45
|
+
return "Finalización Auditoría por Proveedor";
|
|
46
|
+
default:
|
|
47
|
+
return "";
|
|
38
48
|
}
|
|
39
49
|
};
|
|
40
50
|
|
|
@@ -75,6 +85,14 @@ export const getStatusColor = (status) => {
|
|
|
75
85
|
return "black";
|
|
76
86
|
case "Ex":
|
|
77
87
|
return "#09CAD8";
|
|
88
|
+
case "SAC":
|
|
89
|
+
return "#2471A3";
|
|
90
|
+
case "AAC":
|
|
91
|
+
return "#1ABC9C";
|
|
92
|
+
case "RAC":
|
|
93
|
+
return "#229954";
|
|
94
|
+
case "FAP":
|
|
95
|
+
return "#F1C40F";
|
|
78
96
|
default:
|
|
79
97
|
return "white";
|
|
80
98
|
}
|
|
@@ -104,7 +122,6 @@ export const removeOldStatus = (object) => {
|
|
|
104
122
|
object["AC"] = object["AC"] + object["AF"];
|
|
105
123
|
delete object["AF"];
|
|
106
124
|
break;
|
|
107
|
-
|
|
108
125
|
default:
|
|
109
126
|
break;
|
|
110
127
|
}
|
|
@@ -16,28 +16,28 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJjOWRjOWE1OS0xNTAxLTQyOTgtODRjMi03MDM4NzRhNzIxMTEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MjQ2Mjc4NCwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjgyNDY2Mzg0LCJpYXQiOjE2ODI0NjI3ODQsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.ebKSsnTxKoNfWDoKGFJRlLWgNulGj4KrDe0EgsqLEIVx3Qu0lgmg43UY5tZ3FUlRE8XO2UGq0XxEgdbGOe_4nbTRYigdvxP3bh3cPQ0s68hlTDfhPRvxVJYlaO4s0rhk9rt_VVteTyLfhPHFCymrkFYYDB8bVvKnxUUCX_nJvqGQkl48JiYgvYVLpuus5FvRkGwi1u-jTtMoKiUK-jw9MxI18hD0FWXVnJr-q9ftf2d0bv4JRv4XJ_tRh1N6jps5n3c_KKZswqRfGLU-8MS2X3DU6pDqEP2BZAGXksiFYXYH_uHE6BKJAl7EEhkDTqZsx_jWtVSXTdDg_QDKrOw0Kg",
|
|
20
20
|
articleId: 238,
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
|
-
orderId:
|
|
25
|
-
article_status: "
|
|
24
|
+
orderId: 15165,
|
|
25
|
+
article_status: "AAC",
|
|
26
26
|
datasheet_status: "AAC",
|
|
27
|
-
description_status: "
|
|
28
|
-
images_status: "
|
|
27
|
+
description_status: "FAP",
|
|
28
|
+
images_status: "FAP",
|
|
29
29
|
prio: "none",
|
|
30
|
-
version:
|
|
30
|
+
version: 3,
|
|
31
31
|
brand: null,
|
|
32
32
|
article: {
|
|
33
33
|
category: "Puertas y Ventanas|Molduras|Molduras Madera Blanda",
|
|
34
34
|
company_name: "Demo",
|
|
35
|
-
id_company:
|
|
35
|
+
id_company: 923,
|
|
36
36
|
country: "México",
|
|
37
37
|
id_category: "2366",
|
|
38
|
-
id_article:
|
|
39
|
-
name: "
|
|
40
|
-
upc: "
|
|
38
|
+
id_article: 39336,
|
|
39
|
+
name: "Prueba Auditoria",
|
|
40
|
+
upc: "100030124",
|
|
41
41
|
},
|
|
42
42
|
retailers: [
|
|
43
43
|
{
|
|
@@ -46,7 +46,7 @@ ProviderProductEditionDefault.args = {
|
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
id: 68,
|
|
49
|
-
name: "The Home Depot
|
|
49
|
+
name: "The Home Depot Dropship",
|
|
50
50
|
},
|
|
51
51
|
],
|
|
52
52
|
services: {
|
|
@@ -57,12 +57,12 @@ ProviderProductEditionDefault.args = {
|
|
|
57
57
|
statusByRetailer: {
|
|
58
58
|
58: {
|
|
59
59
|
datasheet: "AAC",
|
|
60
|
-
description: "
|
|
61
|
-
images: "
|
|
60
|
+
description: "FAP",
|
|
61
|
+
images: "FAP",
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
64
|
retailersWithService: ["58"],
|
|
65
|
-
id_article:
|
|
65
|
+
id_article: 39336,
|
|
66
66
|
retailersAvailable: [
|
|
67
67
|
{
|
|
68
68
|
id: 58,
|
|
@@ -70,31 +70,31 @@ ProviderProductEditionDefault.args = {
|
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
id: 68,
|
|
73
|
-
name: "The Home Depot
|
|
73
|
+
name: "The Home Depot Dropship",
|
|
74
74
|
},
|
|
75
75
|
],
|
|
76
76
|
},
|
|
77
77
|
productToEdit: {
|
|
78
|
-
ArticleId:
|
|
78
|
+
ArticleId: 39336,
|
|
79
79
|
idCategory: "2366",
|
|
80
80
|
product: {
|
|
81
|
-
orderId:
|
|
82
|
-
article_status: "
|
|
81
|
+
orderId: 15165,
|
|
82
|
+
article_status: "AAC",
|
|
83
83
|
datasheet_status: "AAC",
|
|
84
|
-
description_status: "
|
|
85
|
-
images_status: "
|
|
84
|
+
description_status: "FAP",
|
|
85
|
+
images_status: "FAP",
|
|
86
86
|
prio: "none",
|
|
87
|
-
version:
|
|
87
|
+
version: 3,
|
|
88
88
|
brand: null,
|
|
89
89
|
article: {
|
|
90
90
|
category: "Puertas y Ventanas|Molduras|Molduras Madera Blanda",
|
|
91
91
|
company_name: "Demo",
|
|
92
|
-
id_company:
|
|
92
|
+
id_company: 923,
|
|
93
93
|
country: "México",
|
|
94
94
|
id_category: "2366",
|
|
95
|
-
id_article:
|
|
96
|
-
name: "
|
|
97
|
-
upc: "
|
|
95
|
+
id_article: 39336,
|
|
96
|
+
name: "Prueba Auditoria",
|
|
97
|
+
upc: "100030124",
|
|
98
98
|
},
|
|
99
99
|
retailers: [
|
|
100
100
|
{
|
|
@@ -103,7 +103,7 @@ ProviderProductEditionDefault.args = {
|
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
id: 68,
|
|
106
|
-
name: "The Home Depot
|
|
106
|
+
name: "The Home Depot Dropship",
|
|
107
107
|
},
|
|
108
108
|
],
|
|
109
109
|
services: {
|
|
@@ -114,12 +114,12 @@ ProviderProductEditionDefault.args = {
|
|
|
114
114
|
statusByRetailer: {
|
|
115
115
|
58: {
|
|
116
116
|
datasheet: "AAC",
|
|
117
|
-
description: "
|
|
118
|
-
images: "
|
|
117
|
+
description: "FAP",
|
|
118
|
+
images: "FAP",
|
|
119
119
|
},
|
|
120
120
|
},
|
|
121
121
|
retailersWithService: ["58"],
|
|
122
|
-
id_article:
|
|
122
|
+
id_article: 39336,
|
|
123
123
|
retailersAvailable: [
|
|
124
124
|
{
|
|
125
125
|
id: 58,
|
|
@@ -127,7 +127,7 @@ ProviderProductEditionDefault.args = {
|
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
id: 68,
|
|
130
|
-
name: "The Home Depot
|
|
130
|
+
name: "The Home Depot Dropship",
|
|
131
131
|
},
|
|
132
132
|
],
|
|
133
133
|
},
|
|
@@ -142,58 +142,38 @@ ProviderProductEditionDefault.args = {
|
|
|
142
142
|
key: "24vwut",
|
|
143
143
|
},
|
|
144
144
|
user: {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
descriptions: 1,
|
|
176
|
-
images: 1,
|
|
177
|
-
},
|
|
178
|
-
statusByRetailer: {
|
|
179
|
-
58: {
|
|
180
|
-
datasheet: "AAC",
|
|
181
|
-
description: "RAC",
|
|
182
|
-
images: "AAC",
|
|
183
|
-
},
|
|
145
|
+
id_user: 59,
|
|
146
|
+
name: "Cadena",
|
|
147
|
+
last_name: "Comercial",
|
|
148
|
+
email: "cadena.ismael@allfreemail.net",
|
|
149
|
+
position: "Admin",
|
|
150
|
+
telephone: "+523111366336",
|
|
151
|
+
country: "México",
|
|
152
|
+
id_company: 817,
|
|
153
|
+
id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
|
|
154
|
+
birth_Date: null,
|
|
155
|
+
about_me: "",
|
|
156
|
+
zip_code: "",
|
|
157
|
+
address: "",
|
|
158
|
+
job: "",
|
|
159
|
+
id_stripe: "",
|
|
160
|
+
id_role: 0,
|
|
161
|
+
active: 1,
|
|
162
|
+
is_retailer: 1,
|
|
163
|
+
email_notify: 0,
|
|
164
|
+
is_user_tech: null,
|
|
165
|
+
membership: {
|
|
166
|
+
id: 47,
|
|
167
|
+
start_date: "2022-05-25T14:31:12.000Z",
|
|
168
|
+
end_date: "2023-05-25T14:31:12.000Z",
|
|
169
|
+
planID: 5,
|
|
170
|
+
plan: "prod_Ktl6B5Ou2gqTB2",
|
|
171
|
+
name: "Plan Pro",
|
|
172
|
+
user_limit: "5",
|
|
173
|
+
products_limit: "500",
|
|
174
|
+
type: "PyMES",
|
|
184
175
|
},
|
|
185
|
-
|
|
186
|
-
id_article: 39290,
|
|
187
|
-
retailersAvailable: [
|
|
188
|
-
{
|
|
189
|
-
id: 58,
|
|
190
|
-
name: "The Home Depot Golden",
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
id: 68,
|
|
194
|
-
name: "The Home Depot Merchants",
|
|
195
|
-
},
|
|
196
|
-
],
|
|
176
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1682462786497",
|
|
197
177
|
},
|
|
198
178
|
company: {
|
|
199
179
|
id_company: 817,
|
|
@@ -211,7 +191,7 @@ ProviderProductEditionDefault.args = {
|
|
|
211
191
|
financedRetailers: [
|
|
212
192
|
{
|
|
213
193
|
id: 68,
|
|
214
|
-
name: "The Home Depot
|
|
194
|
+
name: "The Home Depot Dropship",
|
|
215
195
|
country: "México",
|
|
216
196
|
id_region: 1,
|
|
217
197
|
active: 1,
|
|
@@ -235,7 +215,7 @@ ProviderProductEditionDefault.args = {
|
|
|
235
215
|
},
|
|
236
216
|
{
|
|
237
217
|
id: 68,
|
|
238
|
-
name: "The Home Depot
|
|
218
|
+
name: "The Home Depot Dropship",
|
|
239
219
|
country: "México",
|
|
240
220
|
},
|
|
241
221
|
{
|
|
@@ -19,9 +19,6 @@ import { useDropzone } from "react-dropzone";
|
|
|
19
19
|
import axios from "axios";
|
|
20
20
|
import { v4 as uuidv4 } from "uuid";
|
|
21
21
|
import AWS from "aws-sdk";
|
|
22
|
-
import attributesSent from "../../../assets/images/modalsSVGs/attributesSent.svg";
|
|
23
|
-
import descriptionSent from "../../../assets/images/modalsSVGs/descriptionSent.svg";
|
|
24
|
-
import imagesSent from "../../../assets/images/modalsSVGs/uploadingImages.svg";
|
|
25
22
|
import { TagAndInput } from "../../molecules/TagAndInput/index";
|
|
26
23
|
import { Button } from "../../atoms/GeneralButton";
|
|
27
24
|
import { Commentary } from "../../atoms/Commentary";
|
|
@@ -133,6 +130,7 @@ export const ProviderProductEdition = ({
|
|
|
133
130
|
setShowContentohRequestModal,
|
|
134
131
|
showSurvey,
|
|
135
132
|
company,
|
|
133
|
+
addToCart,
|
|
136
134
|
}) => {
|
|
137
135
|
const [activeTab, setActiveTab] = useState("Descripción");
|
|
138
136
|
const [activeImage, setActiveImage] = useState();
|
|
@@ -233,7 +231,7 @@ export const ProviderProductEdition = ({
|
|
|
233
231
|
}`,
|
|
234
232
|
button1: {
|
|
235
233
|
name: "Cerrar",
|
|
236
|
-
action:
|
|
234
|
+
action: closeGlobalModal,
|
|
237
235
|
},
|
|
238
236
|
button2: {
|
|
239
237
|
name: "Continuar",
|
|
@@ -250,6 +248,97 @@ export const ProviderProductEdition = ({
|
|
|
250
248
|
useCloseModal("version-selector");
|
|
251
249
|
const [globalModal, setGlobalModal] = useState();
|
|
252
250
|
|
|
251
|
+
const updateAuditStatus = async (status) => {
|
|
252
|
+
const productTemp = product;
|
|
253
|
+
productTemp.article_status = status;
|
|
254
|
+
productTemp.datasheet_status = status;
|
|
255
|
+
productTemp.description_status = status;
|
|
256
|
+
productTemp.images_status = status;
|
|
257
|
+
|
|
258
|
+
const retailerStatusCopy = { ...retailerStatus };
|
|
259
|
+
const conceptArray = ["description", "datasheet", "images"];
|
|
260
|
+
Object.keys(retailerStatusCopy).forEach((key) => {
|
|
261
|
+
conceptArray.forEach((concept) => {
|
|
262
|
+
if (retailerStatusCopy[key][concept]) {
|
|
263
|
+
retailerStatusCopy[key][concept] = status;
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
setRetailerStatus(retailerStatusCopy);
|
|
268
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
269
|
+
setProduct(productTemp);
|
|
270
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
271
|
+
setProductEdit({
|
|
272
|
+
ArticleId: productTemp.id_article,
|
|
273
|
+
idCategory: productTemp.article.id_category,
|
|
274
|
+
product: productTemp,
|
|
275
|
+
});
|
|
276
|
+
sessionStorage.setItem(
|
|
277
|
+
"productEdit",
|
|
278
|
+
JSON.stringify({
|
|
279
|
+
ArticleId: productTemp.id_article,
|
|
280
|
+
idCategory: productTemp.article.id_category,
|
|
281
|
+
product: productTemp,
|
|
282
|
+
})
|
|
283
|
+
);
|
|
284
|
+
await loadData();
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const addCart = async (retailers) => {
|
|
288
|
+
const { article, version } = product;
|
|
289
|
+
const articleToOrder = [
|
|
290
|
+
{
|
|
291
|
+
articleId: article.id_article,
|
|
292
|
+
version,
|
|
293
|
+
userId: user.id_user,
|
|
294
|
+
discount: 0,
|
|
295
|
+
subtotal: 0,
|
|
296
|
+
companyId: user.id_company,
|
|
297
|
+
datasheet: retailers,
|
|
298
|
+
description: retailers,
|
|
299
|
+
image: retailers,
|
|
300
|
+
attributeTranslations: false,
|
|
301
|
+
descriptionTranslations: false,
|
|
302
|
+
build: "[]",
|
|
303
|
+
manual: "[]",
|
|
304
|
+
userCreated: user.id_user,
|
|
305
|
+
},
|
|
306
|
+
];
|
|
307
|
+
let modatlType = "addedToCartError";
|
|
308
|
+
if (addToCart) {
|
|
309
|
+
const resCart = await addToCart({ data: articleToOrder });
|
|
310
|
+
if (resCart.data.statusCode === 200) {
|
|
311
|
+
modatlType = "addedToCart";
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
showGlobalModal(modatlType);
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
const closeGlobalModal = () => setGlobalModal();
|
|
318
|
+
|
|
319
|
+
const seenByProvider = async () => {
|
|
320
|
+
const productTemp = product;
|
|
321
|
+
const articleId = productTemp.id_article;
|
|
322
|
+
const orderId = productTemp.id_order ?? productTemp.orderId;
|
|
323
|
+
const promises = [];
|
|
324
|
+
const conceptArray = ["description", "datasheet", "images"];
|
|
325
|
+
conceptArray.forEach((concept) => {
|
|
326
|
+
const sectionStatusKey = `${concept}_status`;
|
|
327
|
+
const evalStatus = product[sectionStatusKey] || product?.version_status;
|
|
328
|
+
const data = { articleId, orderId, concept, evalStatus };
|
|
329
|
+
promises.push(
|
|
330
|
+
axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
331
|
+
headers: {
|
|
332
|
+
Authorization: token,
|
|
333
|
+
},
|
|
334
|
+
})
|
|
335
|
+
);
|
|
336
|
+
});
|
|
337
|
+
await Promise.all(promises);
|
|
338
|
+
closeGlobalModal();
|
|
339
|
+
await updateAuditStatus("FAP");
|
|
340
|
+
};
|
|
341
|
+
|
|
253
342
|
const showGlobalModal = useCallback(
|
|
254
343
|
(type) => {
|
|
255
344
|
const formatter = new Intl.ListFormat("es", { type: "conjunction" });
|
|
@@ -285,7 +374,7 @@ export const ProviderProductEdition = ({
|
|
|
285
374
|
detail: "Trabajaremos en conjunto para resolverlo.",
|
|
286
375
|
button1: {
|
|
287
376
|
name: "Cerrar",
|
|
288
|
-
action:
|
|
377
|
+
action: closeGlobalModal,
|
|
289
378
|
},
|
|
290
379
|
img: face,
|
|
291
380
|
textArea: false,
|
|
@@ -294,9 +383,9 @@ export const ProviderProductEdition = ({
|
|
|
294
383
|
case "RAC":
|
|
295
384
|
const servicesRejected = [];
|
|
296
385
|
const translateServices = {
|
|
297
|
-
datasheet:
|
|
298
|
-
description:
|
|
299
|
-
images:
|
|
386
|
+
datasheet: "ficha técnica",
|
|
387
|
+
description: "descripción",
|
|
388
|
+
images: "imágenes",
|
|
300
389
|
};
|
|
301
390
|
Object.keys(translateServices).forEach((service) => {
|
|
302
391
|
if (product[`${service}_status`] === "RAC") {
|
|
@@ -309,6 +398,9 @@ export const ProviderProductEdition = ({
|
|
|
309
398
|
const formatted = formatter.format(servicesRejected);
|
|
310
399
|
const text1 = `${grammar[0]} de ${formatted} no ${grammar[1]} con lo que la cadena necesita.`;
|
|
311
400
|
const text2 = `¡Solicita el servicio de Content-oh! para completarlo!`;
|
|
401
|
+
const retailers = product.retailersWithService.map((retailer) =>
|
|
402
|
+
Number(retailer)
|
|
403
|
+
);
|
|
312
404
|
setGlobalModal({
|
|
313
405
|
message:
|
|
314
406
|
"Tu producto no cumple con los requerimientos de la cadena",
|
|
@@ -324,13 +416,16 @@ export const ProviderProductEdition = ({
|
|
|
324
416
|
),
|
|
325
417
|
button1: {
|
|
326
418
|
name: "Continuar",
|
|
327
|
-
action: () =>
|
|
419
|
+
action: async () => await seenByProvider(),
|
|
328
420
|
},
|
|
329
421
|
button2: {
|
|
330
422
|
name: "Solicitar a Content-oh!",
|
|
331
|
-
action: () =>
|
|
423
|
+
action: async () => {
|
|
424
|
+
await addCart(retailers);
|
|
425
|
+
await seenByProvider();
|
|
426
|
+
},
|
|
332
427
|
},
|
|
333
|
-
img:
|
|
428
|
+
img: errorModal,
|
|
334
429
|
});
|
|
335
430
|
break;
|
|
336
431
|
case "AAC":
|
|
@@ -339,17 +434,38 @@ export const ProviderProductEdition = ({
|
|
|
339
434
|
detail: "Tu producto cumple con los requerimientos de la cadena.",
|
|
340
435
|
button1: {
|
|
341
436
|
name: "Continuar",
|
|
342
|
-
action: () =>
|
|
437
|
+
action: async () => await seenByProvider(),
|
|
438
|
+
},
|
|
439
|
+
img: face,
|
|
440
|
+
});
|
|
441
|
+
break;
|
|
442
|
+
case "addedToCartError":
|
|
443
|
+
setGlobalModal({
|
|
444
|
+
detail:
|
|
445
|
+
"Parece que algo salió mal al intentar añadir tu producto a tu carrito.",
|
|
446
|
+
button1: {
|
|
447
|
+
name: "Continuar",
|
|
448
|
+
action: closeGlobalModal,
|
|
449
|
+
},
|
|
450
|
+
});
|
|
451
|
+
break;
|
|
452
|
+
case "addedToCart":
|
|
453
|
+
setGlobalModal({
|
|
454
|
+
message: "Producto añadido",
|
|
455
|
+
detail: "Tu producto se añadió al carrito de compras.",
|
|
456
|
+
button1: {
|
|
457
|
+
name: "Continuar",
|
|
458
|
+
action: closeGlobalModal,
|
|
343
459
|
},
|
|
344
460
|
img: face,
|
|
345
461
|
});
|
|
346
462
|
break;
|
|
347
463
|
default:
|
|
348
|
-
|
|
464
|
+
closeGlobalModal();
|
|
349
465
|
break;
|
|
350
466
|
}
|
|
351
467
|
},
|
|
352
|
-
[activeTab, dataGenericModal]
|
|
468
|
+
[activeTab, dataGenericModal, product]
|
|
353
469
|
);
|
|
354
470
|
|
|
355
471
|
useEffect(() => {
|
|
@@ -990,23 +1106,24 @@ export const ProviderProductEdition = ({
|
|
|
990
1106
|
})
|
|
991
1107
|
);
|
|
992
1108
|
});
|
|
993
|
-
|
|
1109
|
+
await Promise.all(evaluationArray);
|
|
994
1110
|
const userType = user.is_retailer === 1 ? "CA" : "P";
|
|
995
1111
|
|
|
996
1112
|
const productTemp = product;
|
|
997
|
-
|
|
1113
|
+
const status = `${result}${userType}`;
|
|
1114
|
+
productTemp.article_status = status;
|
|
998
1115
|
productTemp.datasheet_status =
|
|
999
|
-
productTemp.datasheet_status === "NA" ? "NA" :
|
|
1116
|
+
productTemp.datasheet_status === "NA" ? "NA" : status;
|
|
1000
1117
|
productTemp.description_status =
|
|
1001
|
-
productTemp.description_status === "NA" ? "NA" :
|
|
1118
|
+
productTemp.description_status === "NA" ? "NA" : status;
|
|
1002
1119
|
productTemp.images_status =
|
|
1003
|
-
productTemp.images_status === "NA" ? "NA" :
|
|
1120
|
+
productTemp.images_status === "NA" ? "NA" : status;
|
|
1004
1121
|
|
|
1005
1122
|
const retailerStatusCopy = { ...retailerStatus };
|
|
1006
1123
|
Object.keys(retailerStatusCopy).forEach((key) => {
|
|
1007
1124
|
conceptArray.forEach((concept) => {
|
|
1008
1125
|
if (retailerStatusCopy[key][concept]) {
|
|
1009
|
-
retailerStatusCopy[key][concept] =
|
|
1126
|
+
retailerStatusCopy[key][concept] = status;
|
|
1010
1127
|
}
|
|
1011
1128
|
});
|
|
1012
1129
|
});
|
|
@@ -1495,9 +1612,7 @@ export const ProviderProductEdition = ({
|
|
|
1495
1612
|
onClick={() => setMessage("")}
|
|
1496
1613
|
/>
|
|
1497
1614
|
)}
|
|
1498
|
-
{globalModal &&
|
|
1499
|
-
<GlobalModal close={() => setGlobalModal()} {...globalModal} />
|
|
1500
|
-
)}
|
|
1615
|
+
{globalModal && <GlobalModal close={closeGlobalModal} {...globalModal} />}
|
|
1501
1616
|
{showVersionSelector && (
|
|
1502
1617
|
<VersionSelector
|
|
1503
1618
|
modalId={"version-selector"}
|