contentoh-components-library 21.1.49 → 21.1.52
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/StatusTag/index.js +17 -2
- package/dist/components/atoms/StatusTag/styles.js +1 -1
- package/dist/components/molecules/RetailerSelector/index.js +0 -2
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
- package/dist/components/organisms/FullTabsMenu/index.js +2 -2
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +87 -119
- package/dist/components/pages/ProviderProductEdition/index.js +328 -380
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +33 -75
- package/dist/components/pages/RetailerProductEdition/index.js +197 -210
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/global-files/data.js +9 -10
- package/dist/index.js +13 -0
- package/package.json +1 -1
- package/src/components/atoms/StatusTag/index.js +12 -2
- package/src/components/atoms/StatusTag/styles.js +11 -11
- package/src/components/molecules/RetailerSelector/index.js +0 -1
- package/src/components/molecules/StatusAsignationInfo/index.js +1 -1
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/FullTabsMenu/index.js +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +92 -116
- package/src/components/pages/ProviderProductEdition/index.js +207 -217
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +31 -77
- package/src/components/pages/RetailerProductEdition/index.js +165 -140
- package/src/components/pages/RetailerProductEdition/styles.js +1 -1
- package/src/global-files/data.js +9 -10
- package/src/index.js +1 -0
|
@@ -9,14 +9,6 @@ const Template = (args) => <RetailerProductEdition {...args} />;
|
|
|
9
9
|
|
|
10
10
|
export const RetailerProductEditionDefault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wNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIxZDFhY2ZkYy00M2Y2LTQwZGUtOWQ0NS04Y2NmYmIxNGU5ODYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NjYwNTI5NywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY1NjYwODg5NywiaWF0IjoxNjU2NjA1Mjk3LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.NFeT4ehU-626Y5h4mXmdRLFRzvwWvDyOaWtQo4moq10nz-C5UQS_AbcKg9M8hZunUi6Xes3KNigXrRRW8NlajYDWzfzw-Y2H1TWAaPU6pe1Nnup0oxpgn6fLRcEKoayeJaSrQM1Fpq9nNCFFelGggac1xUPJ57nhVSeHLRNacHHASKyHXhAAheKqJBXc-cOmqAiyqlrNlwAQqziu5KEE63zSWh34e-Q4aG189YkD3kNwC3x4tscyxOonF5xQl6pw9TgJDxLgWuPNGpz83e6tIzzUib9GPtkmOzTjsV3hz5FTLOnGpmlhqQ2BvY66W30UdvRLAbFj_qBR55TyJGc-XQ
|
|
19
|
-
// id: 37 rol: 6
|
|
20
12
|
RetailerProductEditionDefault.args = {
|
|
21
13
|
tabsSections: {
|
|
22
14
|
Descripción: true,
|
|
@@ -24,93 +16,45 @@ RetailerProductEditionDefault.args = {
|
|
|
24
16
|
Imágenes: false,
|
|
25
17
|
},
|
|
26
18
|
token:
|
|
27
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM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irzTOqJxrKebFeWnUMs5D3hlFpKeBSKodgB6lLw2522SJmxWXmGCaDOVSMUP9LqB9PsboSOBfSeQpkbIZqd9iNWbrFCusGhnoRrQABucqFwlQ6KPHYTPaOOux-X3pf6i5woX4g",
|
|
28
20
|
productSelected: {
|
|
29
|
-
services: {
|
|
30
|
-
datasheets: 0,
|
|
31
|
-
descriptions: 0,
|
|
32
|
-
images: 1,
|
|
33
|
-
},
|
|
34
|
-
orderId: 116,
|
|
35
|
-
status: "PA",
|
|
36
|
-
datasheet_status: null,
|
|
37
|
-
prio: "none",
|
|
38
|
-
version: 2,
|
|
39
|
-
description_status: null,
|
|
40
|
-
images_status: null,
|
|
41
|
-
article: {
|
|
42
|
-
id_article: 76155,
|
|
43
|
-
id_category: "14",
|
|
44
|
-
name: "pan integral",
|
|
45
|
-
upc: "34243",
|
|
46
|
-
timestamp: "2022-07-13T16:51:20.000Z",
|
|
47
|
-
id_user: 28,
|
|
48
|
-
status: "NULL",
|
|
49
|
-
active: 1,
|
|
50
|
-
company_id: 1,
|
|
51
|
-
company_name: "COMPANY DEV",
|
|
52
|
-
country: "México",
|
|
53
|
-
id_order: 116,
|
|
54
|
-
id_datasheet_especialist: 54,
|
|
55
|
-
id_datasheet_facilitator: 52,
|
|
56
|
-
id_description_especialist: 54,
|
|
57
|
-
id_description_facilitator: 52,
|
|
58
|
-
id_images_especialist: 55,
|
|
59
|
-
id_images_facilitator: 53,
|
|
60
|
-
id_auditor: 30,
|
|
61
|
-
id_recepcionist: null,
|
|
62
|
-
category: "ABARROTES|ABARROTES SECOS|PAN DE CAJA",
|
|
63
|
-
missingAttributes: 0,
|
|
64
|
-
missingDescriptions: 0,
|
|
65
|
-
missingImages: 0,
|
|
66
|
-
},
|
|
67
|
-
retailers: [
|
|
68
|
-
{
|
|
69
|
-
id: 65,
|
|
70
|
-
name: "Súper Aki",
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
country: "México",
|
|
74
|
-
upc: "34243",
|
|
75
|
-
},
|
|
76
|
-
location: {
|
|
77
21
|
services: {
|
|
78
22
|
datasheets: 1,
|
|
79
23
|
descriptions: 1,
|
|
80
24
|
images: 1,
|
|
81
25
|
},
|
|
82
|
-
orderId:
|
|
83
|
-
status: "
|
|
84
|
-
datasheet_status: "
|
|
26
|
+
orderId: 64,
|
|
27
|
+
status: "AF",
|
|
28
|
+
datasheet_status: "AF",
|
|
85
29
|
prio: "none",
|
|
86
|
-
version:
|
|
87
|
-
description_status: "
|
|
88
|
-
images_status: "
|
|
30
|
+
version: 7,
|
|
31
|
+
description_status: "AF",
|
|
32
|
+
images_status: "AF",
|
|
89
33
|
article: {
|
|
90
|
-
id_article:
|
|
91
|
-
id_category: "
|
|
92
|
-
name: "
|
|
93
|
-
upc: "
|
|
94
|
-
timestamp: "2022-06-
|
|
34
|
+
id_article: 35707,
|
|
35
|
+
id_category: "41",
|
|
36
|
+
name: "chetos",
|
|
37
|
+
upc: "1010101010",
|
|
38
|
+
timestamp: "2022-06-16T18:12:42.000Z",
|
|
95
39
|
id_user: 28,
|
|
96
40
|
status: "NULL",
|
|
97
41
|
active: 1,
|
|
98
42
|
company_id: 1,
|
|
99
43
|
company_name: "COMPANY DEV",
|
|
100
44
|
country: "México",
|
|
101
|
-
id_order:
|
|
45
|
+
id_order: 64,
|
|
102
46
|
id_datasheet_especialist: 54,
|
|
103
47
|
id_datasheet_facilitator: 52,
|
|
104
48
|
id_description_especialist: 54,
|
|
105
49
|
id_description_facilitator: 52,
|
|
106
50
|
id_images_especialist: 55,
|
|
107
51
|
id_images_facilitator: 53,
|
|
108
|
-
id_auditor:
|
|
52
|
+
id_auditor: 30,
|
|
109
53
|
id_recepcionist: null,
|
|
110
|
-
category: "ABARROTES|
|
|
111
|
-
missingAttributes:
|
|
112
|
-
missingDescriptions:
|
|
113
|
-
missingImages:
|
|
54
|
+
category: "ABARROTES|BOTANAS, GOLOSINAS Y CHOCOLATES|BOTANAS",
|
|
55
|
+
missingAttributes: null,
|
|
56
|
+
missingDescriptions: null,
|
|
57
|
+
missingImages: null,
|
|
114
58
|
},
|
|
115
59
|
retailers: [
|
|
116
60
|
{
|
|
@@ -120,9 +64,19 @@ RetailerProductEditionDefault.args = {
|
|
|
120
64
|
id_region: 1,
|
|
121
65
|
active: 1,
|
|
122
66
|
},
|
|
67
|
+
{
|
|
68
|
+
id: 8,
|
|
69
|
+
name: "Fragua",
|
|
70
|
+
country: "México",
|
|
71
|
+
id_region: 1,
|
|
72
|
+
active: 1,
|
|
73
|
+
},
|
|
123
74
|
],
|
|
124
75
|
country: "México",
|
|
125
|
-
upc: "
|
|
76
|
+
upc: "1010101010",
|
|
77
|
+
},
|
|
78
|
+
location: {
|
|
79
|
+
product: { articleId: 109485, versionId: 3 },
|
|
126
80
|
},
|
|
127
81
|
user: {
|
|
128
82
|
id_user: 30,
|
|
@@ -155,6 +109,6 @@ RetailerProductEditionDefault.args = {
|
|
|
155
109
|
products_limit: "3",
|
|
156
110
|
type: "PyMES",
|
|
157
111
|
},
|
|
158
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?
|
|
112
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1656375350443",
|
|
159
113
|
},
|
|
160
|
-
};
|
|
114
|
+
};
|
|
@@ -29,6 +29,7 @@ import { GenericModal } from "../../atoms/GenericModal";
|
|
|
29
29
|
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
30
30
|
import { Loading } from "../../atoms/Loading";
|
|
31
31
|
import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
|
|
32
|
+
import { getNewStatus } from "../../../global-files/data";
|
|
32
33
|
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
33
34
|
|
|
34
35
|
const reducerImages = (state, action) => {
|
|
@@ -181,8 +182,11 @@ export const RetailerProductEdition = ({
|
|
|
181
182
|
setServices(services);
|
|
182
183
|
getServices();
|
|
183
184
|
|
|
184
|
-
//
|
|
185
|
-
setImages({
|
|
185
|
+
//setActiveRetailer(product?.retailers[0]);
|
|
186
|
+
setImages({
|
|
187
|
+
action: "init",
|
|
188
|
+
init: services[2],
|
|
189
|
+
});
|
|
186
190
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
187
191
|
|
|
188
192
|
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
@@ -200,22 +204,24 @@ export const RetailerProductEdition = ({
|
|
|
200
204
|
);
|
|
201
205
|
const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
|
|
202
206
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
);
|
|
207
|
+
let retailers = product.retailers || product.retailersAvailable;
|
|
208
|
+
let active = retailers?.filter((retailer) =>
|
|
209
|
+
parsedResponse?.map((srv) => srv.id_retailer).includes(retailer.id)
|
|
210
|
+
)[0];
|
|
208
211
|
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
209
212
|
setServicesData(parsedResponse);
|
|
210
213
|
};
|
|
211
214
|
|
|
212
215
|
const translateConcept = (concept) => {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
let translation = "";
|
|
217
|
+
if (concept === "datasheet") {
|
|
218
|
+
translation = "Ficha técnica";
|
|
219
|
+
} else if (concept === "description") {
|
|
220
|
+
translation = "Descripción";
|
|
221
|
+
} else if (concept === "images") {
|
|
222
|
+
translation = "Imágenes";
|
|
223
|
+
}
|
|
224
|
+
return translation;
|
|
219
225
|
};
|
|
220
226
|
|
|
221
227
|
const getComments = async (tab = "Descripción") => {
|
|
@@ -251,14 +257,14 @@ export const RetailerProductEdition = ({
|
|
|
251
257
|
switch (user.id_role) {
|
|
252
258
|
case 7:
|
|
253
259
|
case 8:
|
|
254
|
-
arr = ["
|
|
260
|
+
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
255
261
|
break;
|
|
256
262
|
case 4:
|
|
257
263
|
case 5:
|
|
258
|
-
arr = ["
|
|
264
|
+
arr = ["RF", "AF", "AA", "AP", "AC"];
|
|
259
265
|
break;
|
|
260
266
|
case 6:
|
|
261
|
-
arr = ["RP", "
|
|
267
|
+
arr = ["RP", "RC", "AF", "RA"];
|
|
262
268
|
break;
|
|
263
269
|
default:
|
|
264
270
|
arr = [];
|
|
@@ -384,14 +390,13 @@ export const RetailerProductEdition = ({
|
|
|
384
390
|
const saveDescriptions = async () => {
|
|
385
391
|
setLoading(true);
|
|
386
392
|
const productTemp = product;
|
|
387
|
-
const articleId = product?.article?.id_article;
|
|
388
393
|
const dataObject = {
|
|
389
|
-
articleId,
|
|
394
|
+
articleId: product?.article?.id_article,
|
|
390
395
|
articleData: updatedDescriptions,
|
|
391
396
|
};
|
|
392
397
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
393
398
|
try {
|
|
394
|
-
|
|
399
|
+
await axios.put(
|
|
395
400
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
|
|
396
401
|
dataObject,
|
|
397
402
|
{
|
|
@@ -400,16 +405,14 @@ export const RetailerProductEdition = ({
|
|
|
400
405
|
},
|
|
401
406
|
}
|
|
402
407
|
);
|
|
403
|
-
if (
|
|
404
|
-
|
|
405
|
-
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
406
|
-
if (newStatus) productTemp.description_status = newStatus;
|
|
408
|
+
if (productTemp.status === "ASSIGNED") {
|
|
409
|
+
productTemp.status = "IN_PROGRESS";
|
|
407
410
|
setProduct(productTemp);
|
|
408
411
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
409
|
-
|
|
410
|
-
setMessage("Descripciones guardadas con éxito");
|
|
411
|
-
await loadData();
|
|
412
412
|
}
|
|
413
|
+
|
|
414
|
+
setMessage("Descripciones guardadas con éxito");
|
|
415
|
+
loadData();
|
|
413
416
|
} catch (error) {
|
|
414
417
|
console.log(error);
|
|
415
418
|
}
|
|
@@ -418,14 +421,13 @@ export const RetailerProductEdition = ({
|
|
|
418
421
|
const saveDatasheets = async () => {
|
|
419
422
|
setLoading(true);
|
|
420
423
|
const productTemp = product;
|
|
421
|
-
const articleId = product?.article?.id_article;
|
|
422
424
|
const dataObject = {
|
|
423
|
-
articleId,
|
|
425
|
+
articleId: product?.article?.id_article,
|
|
424
426
|
articleData: updatedDatasheets,
|
|
425
427
|
};
|
|
426
428
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
427
429
|
try {
|
|
428
|
-
|
|
430
|
+
await axios.put(
|
|
429
431
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?datasheet=true&version=${version}`,
|
|
430
432
|
dataObject,
|
|
431
433
|
{
|
|
@@ -434,16 +436,13 @@ export const RetailerProductEdition = ({
|
|
|
434
436
|
},
|
|
435
437
|
}
|
|
436
438
|
);
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
if (newStatus) productTemp.datasheet_status = newStatus;
|
|
439
|
+
setMessage("Fichas técnicas guardadas");
|
|
440
|
+
if (productTemp.status === "ASSIGNED") {
|
|
441
|
+
productTemp.status = "IN_PROGRESS";
|
|
441
442
|
setProduct(productTemp);
|
|
442
443
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
443
|
-
|
|
444
|
-
setMessage("Fichas técnicas guardadas");
|
|
445
|
-
await loadData();
|
|
446
444
|
}
|
|
445
|
+
loadData();
|
|
447
446
|
} catch (error) {
|
|
448
447
|
console.log(error);
|
|
449
448
|
}
|
|
@@ -527,6 +526,15 @@ export const RetailerProductEdition = ({
|
|
|
527
526
|
} else {
|
|
528
527
|
setImagesUploaded(true);
|
|
529
528
|
}
|
|
529
|
+
let productTemp = product;
|
|
530
|
+
if (productTemp.status === "ASSIGNED") {
|
|
531
|
+
productTemp.status = "IN_PROGRESS";
|
|
532
|
+
setProduct(productTemp);
|
|
533
|
+
sessionStorage.setItem(
|
|
534
|
+
"productSelected",
|
|
535
|
+
JSON.stringify(productTemp)
|
|
536
|
+
);
|
|
537
|
+
}
|
|
530
538
|
} catch (err) {
|
|
531
539
|
console.log(err);
|
|
532
540
|
// setMainLoading(false);
|
|
@@ -551,7 +559,7 @@ export const RetailerProductEdition = ({
|
|
|
551
559
|
return e;
|
|
552
560
|
});
|
|
553
561
|
try {
|
|
554
|
-
|
|
562
|
+
await axios.put(
|
|
555
563
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
|
|
556
564
|
dataImages,
|
|
557
565
|
{
|
|
@@ -560,21 +568,9 @@ export const RetailerProductEdition = ({
|
|
|
560
568
|
},
|
|
561
569
|
}
|
|
562
570
|
);
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
if (newArticleStatus)
|
|
567
|
-
productTemp.status = newArticleStatus[articleId];
|
|
568
|
-
if (newStatus) productTemp.images_status = newStatus;
|
|
569
|
-
setProduct(productTemp);
|
|
570
|
-
sessionStorage.setItem(
|
|
571
|
-
"productSelected",
|
|
572
|
-
JSON.stringify(productTemp)
|
|
573
|
-
);
|
|
574
|
-
setMessage("Imágenes guardadas con éxito");
|
|
575
|
-
sessionStorage.removeItem("imagesList");
|
|
576
|
-
await loadData();
|
|
577
|
-
}
|
|
571
|
+
setMessage("Imágenes guardadas con éxito");
|
|
572
|
+
sessionStorage.removeItem("imagesList");
|
|
573
|
+
loadData();
|
|
578
574
|
} catch (error) {
|
|
579
575
|
console.log(error);
|
|
580
576
|
}
|
|
@@ -583,23 +579,24 @@ export const RetailerProductEdition = ({
|
|
|
583
579
|
|
|
584
580
|
const evaluationFinished = (userId, tab, statusArray) => {
|
|
585
581
|
const srv = servicesData.filter((serv) => serv.service === getConcept(tab));
|
|
586
|
-
const srvActive = srv
|
|
587
|
-
|
|
588
|
-
?.status?.replace(/.*\//, "");
|
|
589
|
-
const currStatus = product[`${getConcept(tab)}_status`]?.replace(
|
|
590
|
-
/.*\//,
|
|
591
|
-
""
|
|
582
|
+
const [srvActive] = srv.filter(
|
|
583
|
+
(serv) => serv.id_retailer === activeRetailer?.id
|
|
592
584
|
);
|
|
593
|
-
const unvalidated =
|
|
585
|
+
const unvalidated =
|
|
586
|
+
product[`${getConcept(tab)}_status`] === "QF" ||
|
|
587
|
+
product[`${getConcept(tab)}_status`] === "IN_PROGRESS";
|
|
594
588
|
|
|
595
|
-
const auditorUnvalidated = !["RA", "AA", "
|
|
589
|
+
const auditorUnvalidated = !["RA", "AA", "AC", "AP"].includes(
|
|
590
|
+
product[`${getConcept(tab)}_status`]
|
|
591
|
+
);
|
|
596
592
|
|
|
597
593
|
switch (userId) {
|
|
598
594
|
case 7:
|
|
599
595
|
case 8:
|
|
600
596
|
return (
|
|
601
|
-
|
|
602
|
-
|
|
597
|
+
(["RA", "RF"].includes(product?.status) && //"IN_PROGRESS", "RF", "RA"
|
|
598
|
+
statusArray.includes(srvActive?.status)) ||
|
|
599
|
+
(statusArray.includes(product.status) &&
|
|
603
600
|
srv.filter((serv) => statusArray.includes(serv.status)).length ===
|
|
604
601
|
srv.length)
|
|
605
602
|
);
|
|
@@ -607,16 +604,14 @@ export const RetailerProductEdition = ({
|
|
|
607
604
|
case 5:
|
|
608
605
|
return (
|
|
609
606
|
unvalidated &&
|
|
610
|
-
["
|
|
607
|
+
["IN_PROGRESS", "QF"].includes(product.status) && //"RF", "AF", "AA", "AP", "AC
|
|
611
608
|
srv.filter((serv) => statusArray.includes(serv.status)).length ===
|
|
612
609
|
srv.length
|
|
613
610
|
);
|
|
614
611
|
case 6:
|
|
615
612
|
return (
|
|
616
|
-
statusArray.includes(product.status) && //
|
|
617
|
-
srv.every((serv) =>
|
|
618
|
-
["RA", "AA", "AP", "ACA"].includes(serv.status)
|
|
619
|
-
) &&
|
|
613
|
+
statusArray.includes(product.status) && //RP, RC, AF, RA true
|
|
614
|
+
srv.every((serv) => ["RA", "AA", "AP", "AC"].includes(serv.status)) &&
|
|
620
615
|
auditorUnvalidated
|
|
621
616
|
);
|
|
622
617
|
default:
|
|
@@ -638,20 +633,20 @@ export const RetailerProductEdition = ({
|
|
|
638
633
|
const approveRejectButtons = (action) => {
|
|
639
634
|
let concept = getConcept(action || activeTab);
|
|
640
635
|
|
|
641
|
-
const retailerStatus = servicesData
|
|
642
|
-
.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
?.status
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
retailerStatus === "
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
636
|
+
const [retailerStatus] = servicesData.filter(
|
|
637
|
+
(srv) => srv.id_retailer === activeRetailer?.id && srv.service === concept
|
|
638
|
+
);
|
|
639
|
+
|
|
640
|
+
return (
|
|
641
|
+
(retailerStatus?.status === "QF" &&
|
|
642
|
+
(user.id_role === 1 || user.id_role === 4 || user.id_role === 5)) ||
|
|
643
|
+
(retailerStatus?.status === "AF" && //sessionStorage product
|
|
644
|
+
(user.id_role === 1 || user.id_role === 6)) ||
|
|
645
|
+
(retailerStatus?.status === "RP" &&
|
|
646
|
+
(user.id_role === 1 || user.id_role === 6)) ||
|
|
647
|
+
(retailerStatus?.status === "RC" &&
|
|
648
|
+
(user.id_role === 1 || user.id_role === 6))
|
|
649
|
+
);
|
|
655
650
|
};
|
|
656
651
|
|
|
657
652
|
const getSectionIcon = () => {
|
|
@@ -675,57 +670,92 @@ export const RetailerProductEdition = ({
|
|
|
675
670
|
try {
|
|
676
671
|
let concept = getConcept(activeTab);
|
|
677
672
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
let data = {
|
|
684
|
-
articleId,
|
|
685
|
-
orderId,
|
|
686
|
-
concept,
|
|
687
|
-
evalStatus,
|
|
688
|
-
retailerId: activeRetailer.id,
|
|
689
|
-
};
|
|
690
|
-
let res;
|
|
673
|
+
let productTemp = { ...product };
|
|
674
|
+
let evalStatus = product[`${concept}_status`];
|
|
675
|
+
|
|
676
|
+
let data = {};
|
|
691
677
|
if (result) {
|
|
692
|
-
data
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
678
|
+
data = {
|
|
679
|
+
articleId: product.article.id_article,
|
|
680
|
+
orderId: product.orderId,
|
|
681
|
+
concept: concept,
|
|
682
|
+
result: result,
|
|
683
|
+
evalStatus: evalStatus,
|
|
684
|
+
retailerId: activeRetailer.id,
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
await axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
688
|
+
headers: {
|
|
689
|
+
Authorization: token,
|
|
690
|
+
},
|
|
691
|
+
});
|
|
702
692
|
getServices();
|
|
703
693
|
} else {
|
|
704
|
-
const specialistDone =
|
|
694
|
+
const specialistDone =
|
|
695
|
+
evalStatus === "RF" ||
|
|
696
|
+
evalStatus === "RA" ||
|
|
697
|
+
evalStatus === "IN_PROGRESS";
|
|
705
698
|
|
|
706
|
-
let message;
|
|
707
699
|
if (specialistDone) {
|
|
708
|
-
|
|
700
|
+
setMessage(`${activeTab} enviada a facilitador`);
|
|
701
|
+
getSectionIcon();
|
|
702
|
+
} else if (evalStatus === "QF") {
|
|
703
|
+
setMessage("Evaluación enviada");
|
|
709
704
|
getSectionIcon();
|
|
710
|
-
} else if (
|
|
711
|
-
|
|
705
|
+
} else if (evalStatus === "AF") {
|
|
706
|
+
setMessage("Evaluación enviada");
|
|
712
707
|
getSectionIcon();
|
|
708
|
+
} else if (evalStatus === "RP") {
|
|
709
|
+
setMessage("Evaluación enviada");
|
|
710
|
+
getSectionIcon();
|
|
711
|
+
} else if (evalStatus === "RC") {
|
|
712
|
+
setMessage("Evaluación enviada");
|
|
713
|
+
getSectionIcon();
|
|
714
|
+
}
|
|
715
|
+
let statusArr = [];
|
|
716
|
+
servicesData.forEach((srv) => {
|
|
717
|
+
srv.service === concept && statusArr.push(srv.status);
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
productTemp[`${concept}_status`] = getNewStatus(statusArr);
|
|
721
|
+
|
|
722
|
+
let newStatus = getNewStatus([
|
|
723
|
+
productTemp.datasheet_status,
|
|
724
|
+
productTemp.description_status,
|
|
725
|
+
productTemp.images_status,
|
|
726
|
+
]);
|
|
727
|
+
|
|
728
|
+
productTemp.status = newStatus;
|
|
729
|
+
|
|
730
|
+
data = {
|
|
731
|
+
articleId: product.article.id_article,
|
|
732
|
+
orderId: product.orderId,
|
|
733
|
+
concept: concept,
|
|
734
|
+
evalStatus: evalStatus,
|
|
735
|
+
retailerId: activeRetailer.id,
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
switch (user.id_role) {
|
|
739
|
+
case 7:
|
|
740
|
+
case 8:
|
|
741
|
+
data.especialist = true;
|
|
742
|
+
break;
|
|
743
|
+
case 4:
|
|
744
|
+
case 5:
|
|
745
|
+
data.facilitator = true;
|
|
746
|
+
break;
|
|
747
|
+
default:
|
|
748
|
+
break;
|
|
713
749
|
}
|
|
714
|
-
|
|
750
|
+
await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
715
751
|
headers: {
|
|
716
752
|
Authorization: token,
|
|
717
753
|
},
|
|
718
754
|
});
|
|
719
755
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
productTemp[`${concept}_status`] = newStatus;
|
|
724
|
-
await loadData();
|
|
725
|
-
if (message) setMessage(message);
|
|
726
|
-
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
727
|
-
setProduct(productTemp);
|
|
728
|
-
}
|
|
756
|
+
loadData();
|
|
757
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
758
|
+
setProduct(productTemp);
|
|
729
759
|
} catch (error) {
|
|
730
760
|
console.log(error);
|
|
731
761
|
}
|
|
@@ -834,7 +864,7 @@ export const RetailerProductEdition = ({
|
|
|
834
864
|
(input) =>
|
|
835
865
|
input.required &&
|
|
836
866
|
(!input.value ||
|
|
837
|
-
input.value
|
|
867
|
+
input.value.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") ===
|
|
838
868
|
"") &&
|
|
839
869
|
desInputsRequired++
|
|
840
870
|
);
|
|
@@ -911,12 +941,12 @@ export const RetailerProductEdition = ({
|
|
|
911
941
|
},
|
|
912
942
|
],
|
|
913
943
|
concept: concept,
|
|
914
|
-
|
|
944
|
+
[`${assignationType}Id`]: assignationId,
|
|
915
945
|
};
|
|
916
|
-
|
|
946
|
+
axios({
|
|
917
947
|
method: "post",
|
|
918
948
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
919
|
-
data,
|
|
949
|
+
data: data,
|
|
920
950
|
headers: {
|
|
921
951
|
Authorization: token,
|
|
922
952
|
},
|
|
@@ -1105,7 +1135,7 @@ export const RetailerProductEdition = ({
|
|
|
1105
1135
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1106
1136
|
setProduct(productTemp);
|
|
1107
1137
|
|
|
1108
|
-
|
|
1138
|
+
loadData();
|
|
1109
1139
|
} catch (error) {
|
|
1110
1140
|
console.log(error);
|
|
1111
1141
|
}
|
|
@@ -1183,7 +1213,7 @@ export const RetailerProductEdition = ({
|
|
|
1183
1213
|
showApproveRejectAll={
|
|
1184
1214
|
isAuditor &&
|
|
1185
1215
|
servicesData.every((serv) =>
|
|
1186
|
-
["RA", "AA", "AP", "
|
|
1216
|
+
["RA", "AA", "AP", "AC", "AF"].includes(serv.status)
|
|
1187
1217
|
) &&
|
|
1188
1218
|
approveRejectButtons() &&
|
|
1189
1219
|
(auditorAssigned() || userAssigned())
|
|
@@ -1377,21 +1407,16 @@ export const RetailerProductEdition = ({
|
|
|
1377
1407
|
/>
|
|
1378
1408
|
</div>
|
|
1379
1409
|
)}
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
}
|
|
1391
|
-
label={"Enviar evaluación"}
|
|
1392
|
-
onClick={() => sendToFacilitator()}
|
|
1393
|
-
/>
|
|
1394
|
-
)}
|
|
1410
|
+
<Button
|
|
1411
|
+
buttonType={
|
|
1412
|
+
evaluationFinished(user.id_role, activeTab, statusArray) &&
|
|
1413
|
+
requiredNull[activeTab] === 0
|
|
1414
|
+
? "general-green-button"
|
|
1415
|
+
: "general-button-disabled"
|
|
1416
|
+
}
|
|
1417
|
+
label={"Enviar evaluación"}
|
|
1418
|
+
onClick={() => sendToFacilitator()}
|
|
1419
|
+
/>
|
|
1395
1420
|
</div>
|
|
1396
1421
|
)}
|
|
1397
1422
|
</div>
|