contentoh-components-library 21.1.45 → 21.1.48
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 +2 -17
- package/dist/components/atoms/StatusTag/styles.js +1 -1
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +75 -69
- package/dist/components/pages/ProviderProductEdition/index.js +380 -328
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +86 -41
- package/dist/components/pages/RetailerProductEdition/index.js +211 -198
- package/dist/global-files/data.js +10 -9
- package/package.json +2 -2
- package/src/components/atoms/StatusTag/index.js +2 -12
- package/src/components/atoms/StatusTag/styles.js +11 -11
- package/src/components/molecules/StatusAsignationInfo/index.js +1 -1
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +66 -68
- package/src/components/pages/ProviderProductEdition/index.js +218 -208
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +87 -38
- package/src/components/pages/RetailerProductEdition/index.js +143 -168
- package/src/global-files/data.js +10 -9
|
@@ -29,7 +29,6 @@ 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";
|
|
33
32
|
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
34
33
|
|
|
35
34
|
const reducerImages = (state, action) => {
|
|
@@ -182,11 +181,8 @@ export const RetailerProductEdition = ({
|
|
|
182
181
|
setServices(services);
|
|
183
182
|
getServices();
|
|
184
183
|
|
|
185
|
-
//setActiveRetailer(product?.retailers[0]);
|
|
186
|
-
setImages({
|
|
187
|
-
action: "init",
|
|
188
|
-
init: services[2],
|
|
189
|
-
});
|
|
184
|
+
// setActiveRetailer(product?.retailers[0]);
|
|
185
|
+
setImages({ action: "init", init: services[2] });
|
|
190
186
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
191
187
|
|
|
192
188
|
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
@@ -204,24 +200,22 @@ export const RetailerProductEdition = ({
|
|
|
204
200
|
);
|
|
205
201
|
const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
|
|
206
202
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
203
|
+
const retailers = product.retailers || product.retailersAvailable;
|
|
204
|
+
const retailerResponse = parsedResponse?.map((srv) => srv.id_retailer);
|
|
205
|
+
const active = retailers?.find((retailer) =>
|
|
206
|
+
retailerResponse.includes(retailer.id)
|
|
207
|
+
);
|
|
211
208
|
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
212
209
|
setServicesData(parsedResponse);
|
|
213
210
|
};
|
|
214
211
|
|
|
215
212
|
const translateConcept = (concept) => {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
translation = "Imágenes";
|
|
223
|
-
}
|
|
224
|
-
return translation;
|
|
213
|
+
const translation = {
|
|
214
|
+
datasheet: "Ficha técnica",
|
|
215
|
+
description: "Descripción",
|
|
216
|
+
images: "Imágenes",
|
|
217
|
+
};
|
|
218
|
+
return translation[concept];
|
|
225
219
|
};
|
|
226
220
|
|
|
227
221
|
const getComments = async (tab = "Descripción") => {
|
|
@@ -257,14 +251,14 @@ export const RetailerProductEdition = ({
|
|
|
257
251
|
switch (user.id_role) {
|
|
258
252
|
case 7:
|
|
259
253
|
case 8:
|
|
260
|
-
arr = ["
|
|
254
|
+
arr = ["CA", "RC", "RA"];
|
|
261
255
|
break;
|
|
262
256
|
case 4:
|
|
263
257
|
case 5:
|
|
264
|
-
arr = ["
|
|
258
|
+
arr = ["RC", "AC", "AA", "AP", "ACA"];
|
|
265
259
|
break;
|
|
266
260
|
case 6:
|
|
267
|
-
arr = ["RP", "
|
|
261
|
+
arr = ["RP", "RCA", "AC", "RA"];
|
|
268
262
|
break;
|
|
269
263
|
default:
|
|
270
264
|
arr = [];
|
|
@@ -390,13 +384,14 @@ export const RetailerProductEdition = ({
|
|
|
390
384
|
const saveDescriptions = async () => {
|
|
391
385
|
setLoading(true);
|
|
392
386
|
const productTemp = product;
|
|
387
|
+
const articleId = product?.article?.id_article;
|
|
393
388
|
const dataObject = {
|
|
394
|
-
articleId
|
|
389
|
+
articleId,
|
|
395
390
|
articleData: updatedDescriptions,
|
|
396
391
|
};
|
|
397
392
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
398
393
|
try {
|
|
399
|
-
await axios.put(
|
|
394
|
+
const res = await axios.put(
|
|
400
395
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
|
|
401
396
|
dataObject,
|
|
402
397
|
{
|
|
@@ -405,14 +400,16 @@ export const RetailerProductEdition = ({
|
|
|
405
400
|
},
|
|
406
401
|
}
|
|
407
402
|
);
|
|
408
|
-
if (
|
|
409
|
-
|
|
403
|
+
if (res.data.statusCode === 200) {
|
|
404
|
+
const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
|
|
405
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
406
|
+
if (newStatus) productTemp.description_status = newStatus;
|
|
410
407
|
setProduct(productTemp);
|
|
411
408
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
412
|
-
}
|
|
413
409
|
|
|
414
|
-
|
|
415
|
-
|
|
410
|
+
setMessage("Descripciones guardadas con éxito");
|
|
411
|
+
await loadData();
|
|
412
|
+
}
|
|
416
413
|
} catch (error) {
|
|
417
414
|
console.log(error);
|
|
418
415
|
}
|
|
@@ -421,13 +418,14 @@ export const RetailerProductEdition = ({
|
|
|
421
418
|
const saveDatasheets = async () => {
|
|
422
419
|
setLoading(true);
|
|
423
420
|
const productTemp = product;
|
|
421
|
+
const articleId = product?.article?.id_article;
|
|
424
422
|
const dataObject = {
|
|
425
|
-
articleId
|
|
423
|
+
articleId,
|
|
426
424
|
articleData: updatedDatasheets,
|
|
427
425
|
};
|
|
428
426
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
429
427
|
try {
|
|
430
|
-
await axios.put(
|
|
428
|
+
const res = await axios.put(
|
|
431
429
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?datasheet=true&version=${version}`,
|
|
432
430
|
dataObject,
|
|
433
431
|
{
|
|
@@ -436,13 +434,16 @@ export const RetailerProductEdition = ({
|
|
|
436
434
|
},
|
|
437
435
|
}
|
|
438
436
|
);
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
productTemp.status =
|
|
437
|
+
if (res.data.statusCode === 200) {
|
|
438
|
+
const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
|
|
439
|
+
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
440
|
+
if (newStatus) productTemp.datasheet_status = newStatus;
|
|
442
441
|
setProduct(productTemp);
|
|
443
442
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
443
|
+
|
|
444
|
+
setMessage("Fichas técnicas guardadas");
|
|
445
|
+
await loadData();
|
|
444
446
|
}
|
|
445
|
-
loadData();
|
|
446
447
|
} catch (error) {
|
|
447
448
|
console.log(error);
|
|
448
449
|
}
|
|
@@ -526,15 +527,6 @@ export const RetailerProductEdition = ({
|
|
|
526
527
|
} else {
|
|
527
528
|
setImagesUploaded(true);
|
|
528
529
|
}
|
|
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
|
-
}
|
|
538
530
|
} catch (err) {
|
|
539
531
|
console.log(err);
|
|
540
532
|
// setMainLoading(false);
|
|
@@ -559,7 +551,7 @@ export const RetailerProductEdition = ({
|
|
|
559
551
|
return e;
|
|
560
552
|
});
|
|
561
553
|
try {
|
|
562
|
-
await axios.put(
|
|
554
|
+
const res = await axios.put(
|
|
563
555
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
|
|
564
556
|
dataImages,
|
|
565
557
|
{
|
|
@@ -568,9 +560,21 @@ export const RetailerProductEdition = ({
|
|
|
568
560
|
},
|
|
569
561
|
}
|
|
570
562
|
);
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
563
|
+
if (res.data.statusCode === 200) {
|
|
564
|
+
let productTemp = product;
|
|
565
|
+
const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
|
|
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
|
+
}
|
|
574
578
|
} catch (error) {
|
|
575
579
|
console.log(error);
|
|
576
580
|
}
|
|
@@ -579,24 +583,23 @@ export const RetailerProductEdition = ({
|
|
|
579
583
|
|
|
580
584
|
const evaluationFinished = (userId, tab, statusArray) => {
|
|
581
585
|
const srv = servicesData.filter((serv) => serv.service === getConcept(tab));
|
|
582
|
-
const
|
|
583
|
-
(serv) => serv.id_retailer === activeRetailer?.id
|
|
586
|
+
const srvActive = srv
|
|
587
|
+
.find((serv) => serv.id_retailer === activeRetailer?.id)
|
|
588
|
+
?.status?.replace(/.*\//, "");
|
|
589
|
+
const currStatus = product[`${getConcept(tab)}_status`]?.replace(
|
|
590
|
+
/.*\//,
|
|
591
|
+
""
|
|
584
592
|
);
|
|
585
|
-
const unvalidated =
|
|
586
|
-
product[`${getConcept(tab)}_status`] === "QF" ||
|
|
587
|
-
product[`${getConcept(tab)}_status`] === "IN_PROGRESS";
|
|
593
|
+
const unvalidated = ["IE", "CA"].includes(currStatus);
|
|
588
594
|
|
|
589
|
-
const auditorUnvalidated = !["RA", "AA", "
|
|
590
|
-
product[`${getConcept(tab)}_status`]
|
|
591
|
-
);
|
|
595
|
+
const auditorUnvalidated = !["RA", "AA", "ACA", "AP"].includes(currStatus);
|
|
592
596
|
|
|
593
597
|
switch (userId) {
|
|
594
598
|
case 7:
|
|
595
599
|
case 8:
|
|
596
600
|
return (
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
(statusArray.includes(product.status) &&
|
|
601
|
+
statusArray.includes(srvActive) &&
|
|
602
|
+
(["RA", "RC"].includes(product?.status) ||
|
|
600
603
|
srv.filter((serv) => statusArray.includes(serv.status)).length ===
|
|
601
604
|
srv.length)
|
|
602
605
|
);
|
|
@@ -604,14 +607,16 @@ export const RetailerProductEdition = ({
|
|
|
604
607
|
case 5:
|
|
605
608
|
return (
|
|
606
609
|
unvalidated &&
|
|
607
|
-
["
|
|
610
|
+
["CA", "IE"].includes(product.status) && // "RC", "AC", "AA", "AP", "ACA"
|
|
608
611
|
srv.filter((serv) => statusArray.includes(serv.status)).length ===
|
|
609
612
|
srv.length
|
|
610
613
|
);
|
|
611
614
|
case 6:
|
|
612
615
|
return (
|
|
613
|
-
statusArray.includes(product.status) && //RP,
|
|
614
|
-
srv.every((serv) =>
|
|
616
|
+
statusArray.includes(product.status) && // RP, RCA, AC, RA true
|
|
617
|
+
srv.every((serv) =>
|
|
618
|
+
["RA", "AA", "AP", "ACA"].includes(serv.status)
|
|
619
|
+
) &&
|
|
615
620
|
auditorUnvalidated
|
|
616
621
|
);
|
|
617
622
|
default:
|
|
@@ -633,20 +638,20 @@ export const RetailerProductEdition = ({
|
|
|
633
638
|
const approveRejectButtons = (action) => {
|
|
634
639
|
let concept = getConcept(action || activeTab);
|
|
635
640
|
|
|
636
|
-
const
|
|
637
|
-
(
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
641
|
+
const retailerStatus = servicesData
|
|
642
|
+
.find(
|
|
643
|
+
(srv) =>
|
|
644
|
+
srv.id_retailer === activeRetailer?.id && srv.service === concept
|
|
645
|
+
)
|
|
646
|
+
?.status?.replace(/.*\//, "");
|
|
647
|
+
|
|
648
|
+
//sessionStorage product
|
|
649
|
+
const adminFacilitatorCanEvaluate =
|
|
650
|
+
retailerStatus === "IE" && [1, 4, 5].includes(user.id_role);
|
|
651
|
+
const adminAuditorCanEvaluate =
|
|
652
|
+
["AC", "RP", "RCA"].includes(retailerStatus) &&
|
|
653
|
+
[1, 6].includes(user.id_role);
|
|
654
|
+
return adminFacilitatorCanEvaluate || adminAuditorCanEvaluate;
|
|
650
655
|
};
|
|
651
656
|
|
|
652
657
|
const getSectionIcon = () => {
|
|
@@ -670,92 +675,57 @@ export const RetailerProductEdition = ({
|
|
|
670
675
|
try {
|
|
671
676
|
let concept = getConcept(activeTab);
|
|
672
677
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
678
|
+
const productTemp = { ...product };
|
|
679
|
+
const evalStatus = retailerStatus;
|
|
680
|
+
const articleId = product.article.id_article;
|
|
681
|
+
const orderId = product.orderId;
|
|
682
|
+
|
|
683
|
+
let data = {
|
|
684
|
+
articleId,
|
|
685
|
+
orderId,
|
|
686
|
+
concept,
|
|
687
|
+
evalStatus,
|
|
688
|
+
retailerId: activeRetailer.id,
|
|
689
|
+
};
|
|
690
|
+
let res;
|
|
677
691
|
if (result) {
|
|
678
|
-
data =
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
headers: {
|
|
689
|
-
Authorization: token,
|
|
690
|
-
},
|
|
691
|
-
});
|
|
692
|
+
data.result = result;
|
|
693
|
+
res = await axios.put(
|
|
694
|
+
`${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
|
|
695
|
+
data,
|
|
696
|
+
{
|
|
697
|
+
headers: {
|
|
698
|
+
Authorization: token,
|
|
699
|
+
},
|
|
700
|
+
}
|
|
701
|
+
);
|
|
692
702
|
getServices();
|
|
693
703
|
} else {
|
|
694
|
-
const specialistDone =
|
|
695
|
-
evalStatus === "RF" ||
|
|
696
|
-
evalStatus === "RA" ||
|
|
697
|
-
evalStatus === "IN_PROGRESS";
|
|
704
|
+
const specialistDone = ["RC", "RA", "CA"].includes(evalStatus);
|
|
698
705
|
|
|
706
|
+
let message;
|
|
699
707
|
if (specialistDone) {
|
|
700
|
-
|
|
701
|
-
getSectionIcon();
|
|
702
|
-
} else if (evalStatus === "QF") {
|
|
703
|
-
setMessage("Evaluación enviada");
|
|
704
|
-
getSectionIcon();
|
|
705
|
-
} else if (evalStatus === "AF") {
|
|
706
|
-
setMessage("Evaluación enviada");
|
|
708
|
+
message = `${activeTab} enviada a facilitador`;
|
|
707
709
|
getSectionIcon();
|
|
708
|
-
} else if (
|
|
709
|
-
|
|
710
|
-
getSectionIcon();
|
|
711
|
-
} else if (evalStatus === "RC") {
|
|
712
|
-
setMessage("Evaluación enviada");
|
|
710
|
+
} else if (["IE", "AC", "RP", "RCA"].includes(evalStatus)) {
|
|
711
|
+
message = "Evaluación enviada";
|
|
713
712
|
getSectionIcon();
|
|
714
713
|
}
|
|
715
|
-
|
|
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;
|
|
749
|
-
}
|
|
750
|
-
await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
714
|
+
res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
751
715
|
headers: {
|
|
752
716
|
Authorization: token,
|
|
753
717
|
},
|
|
754
718
|
});
|
|
755
719
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
720
|
+
if (res.data.statusCode === 200) {
|
|
721
|
+
const { newStatus, newOrderStatus } = JSON.parse(res.data.body);
|
|
722
|
+
if (newOrderStatus) productTemp.status = newOrderStatus[orderId];
|
|
723
|
+
productTemp[`${concept}_status`] = newStatus;
|
|
724
|
+
await loadData();
|
|
725
|
+
if (message) setMessage(message);
|
|
726
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
727
|
+
setProduct(productTemp);
|
|
728
|
+
}
|
|
759
729
|
} catch (error) {
|
|
760
730
|
console.log(error);
|
|
761
731
|
}
|
|
@@ -808,7 +778,7 @@ export const RetailerProductEdition = ({
|
|
|
808
778
|
const data = {
|
|
809
779
|
articleId: product?.article?.id_article,
|
|
810
780
|
orderId: product?.orderId,
|
|
811
|
-
message: body?.replace(/<.*?\/?>/gm,
|
|
781
|
+
message: body?.replace(/<.*?\/?>/gm,""),
|
|
812
782
|
concept: concept,
|
|
813
783
|
version: version,
|
|
814
784
|
};
|
|
@@ -864,7 +834,7 @@ export const RetailerProductEdition = ({
|
|
|
864
834
|
(input) =>
|
|
865
835
|
input.required &&
|
|
866
836
|
(!input.value ||
|
|
867
|
-
input.value
|
|
837
|
+
input.value?.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") ===
|
|
868
838
|
"") &&
|
|
869
839
|
desInputsRequired++
|
|
870
840
|
);
|
|
@@ -941,12 +911,12 @@ export const RetailerProductEdition = ({
|
|
|
941
911
|
},
|
|
942
912
|
],
|
|
943
913
|
concept: concept,
|
|
944
|
-
|
|
914
|
+
userId: assignationId,
|
|
945
915
|
};
|
|
946
|
-
axios({
|
|
916
|
+
await axios({
|
|
947
917
|
method: "post",
|
|
948
918
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
949
|
-
data
|
|
919
|
+
data,
|
|
950
920
|
headers: {
|
|
951
921
|
Authorization: token,
|
|
952
922
|
},
|
|
@@ -1135,7 +1105,7 @@ export const RetailerProductEdition = ({
|
|
|
1135
1105
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1136
1106
|
setProduct(productTemp);
|
|
1137
1107
|
|
|
1138
|
-
loadData();
|
|
1108
|
+
await loadData();
|
|
1139
1109
|
} catch (error) {
|
|
1140
1110
|
console.log(error);
|
|
1141
1111
|
}
|
|
@@ -1164,7 +1134,7 @@ export const RetailerProductEdition = ({
|
|
|
1164
1134
|
onClickSave={() =>
|
|
1165
1135
|
product?.services?.images === 1 && updateImages()
|
|
1166
1136
|
}
|
|
1167
|
-
showSaveButton={
|
|
1137
|
+
showSaveButton={userAssigned()}
|
|
1168
1138
|
/>
|
|
1169
1139
|
</div>
|
|
1170
1140
|
<div className="product-information">
|
|
@@ -1213,7 +1183,7 @@ export const RetailerProductEdition = ({
|
|
|
1213
1183
|
showApproveRejectAll={
|
|
1214
1184
|
isAuditor &&
|
|
1215
1185
|
servicesData.every((serv) =>
|
|
1216
|
-
["RA", "AA", "AP", "
|
|
1186
|
+
["RA", "AA", "AP", "ACA", "AC"].includes(serv.status)
|
|
1217
1187
|
) &&
|
|
1218
1188
|
approveRejectButtons() &&
|
|
1219
1189
|
(auditorAssigned() || userAssigned())
|
|
@@ -1394,7 +1364,7 @@ export const RetailerProductEdition = ({
|
|
|
1394
1364
|
) : (
|
|
1395
1365
|
<div className="feedback-box">
|
|
1396
1366
|
<Commentary
|
|
1397
|
-
comment={comment?.message?.replace(/<.*?\/?>/gm,
|
|
1367
|
+
comment={comment?.message?.replace(/<.*?\/?>/gm,"")}
|
|
1398
1368
|
reviewed={crossComment}
|
|
1399
1369
|
/>
|
|
1400
1370
|
<Button
|
|
@@ -1406,16 +1376,21 @@ export const RetailerProductEdition = ({
|
|
|
1406
1376
|
/>
|
|
1407
1377
|
</div>
|
|
1408
1378
|
)}
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1379
|
+
{[7, 8].includes(user.id_role) && (
|
|
1380
|
+
<Button
|
|
1381
|
+
buttonType={
|
|
1382
|
+
evaluationFinished(
|
|
1383
|
+
user.id_role,
|
|
1384
|
+
activeTab,
|
|
1385
|
+
statusArray
|
|
1386
|
+
) && requiredNull[activeTab] === 0
|
|
1387
|
+
? "general-green-button"
|
|
1388
|
+
: "general-button-disabled"
|
|
1389
|
+
}
|
|
1390
|
+
label={"Enviar evaluación"}
|
|
1391
|
+
onClick={() => sendToFacilitator()}
|
|
1392
|
+
/>
|
|
1393
|
+
)}
|
|
1419
1394
|
</div>
|
|
1420
1395
|
)}
|
|
1421
1396
|
</div>
|
package/src/global-files/data.js
CHANGED
|
@@ -195,18 +195,19 @@ export const fetchUsers = async (auth) => {
|
|
|
195
195
|
export const getNewStatus = (statusArray) => {
|
|
196
196
|
let lookupString = "";
|
|
197
197
|
statusArray.forEach((element) => (lookupString += element + "/"));
|
|
198
|
-
if (lookupString.includes("
|
|
198
|
+
if (lookupString.includes("RCA")) return "RCA";
|
|
199
|
+
if (lookupString.includes("RC")) return "RC";
|
|
199
200
|
if (lookupString.includes("RA")) return "RA";
|
|
200
201
|
if (lookupString.includes("RP")) return "RP";
|
|
201
|
-
if (lookupString.includes("
|
|
202
|
-
if (lookupString.includes("UNASSIGNED")) return "
|
|
203
|
-
if (lookupString.includes("
|
|
204
|
-
if (lookupString.includes("
|
|
205
|
-
if (lookupString.includes("
|
|
202
|
+
if (lookupString.includes("ACA")) return "ACA";
|
|
203
|
+
if (lookupString.includes("UNASSIGNED")) return "CA";
|
|
204
|
+
if (lookupString.includes("CA")) return "CA";
|
|
205
|
+
if (lookupString.includes("IE")) return "IE";
|
|
206
|
+
if (lookupString.includes("AC")) return "AC";
|
|
206
207
|
if (lookupString.includes("AA")) return "AA";
|
|
207
208
|
if (lookupString.includes("AP")) return "AP";
|
|
208
|
-
if (lookupString.includes("
|
|
209
|
-
if (lookupString.includes("RECEIVED")) return "RECEIVED";
|
|
209
|
+
if (lookupString.includes("R")) return "R";
|
|
210
210
|
if (lookupString.includes("NA")) return "NA";
|
|
211
|
-
|
|
211
|
+
console.log("Status not found");
|
|
212
|
+
return "NA";
|
|
212
213
|
};
|