contentoh-components-library 21.1.60 → 21.1.63
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/ProductPercentCard/Percent.stories.js +1 -1
- package/dist/components/atoms/ProductPercentCard/styles.js +1 -1
- package/dist/components/molecules/AssignedWork/AssignedWork.stories.js +1 -1
- package/dist/components/molecules/AssignedWork/styles.js +1 -1
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +93 -109
- package/dist/components/pages/ProviderProductEdition/index.js +430 -429
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +1 -1
- package/dist/components/pages/RetailerProductEdition/index.js +217 -200
- package/dist/global-files/data.js +8 -8
- package/package.json +1 -1
- package/src/components/atoms/ProductPercentCard/Percent.stories.js +11 -12
- package/src/components/atoms/ProductPercentCard/styles.js +9 -9
- package/src/components/molecules/AssignedWork/AssignedWork.stories.js +8 -8
- package/src/components/molecules/AssignedWork/styles.js +9 -10
- package/src/components/organisms/FullProductNameHeader/index.js +2 -2
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +95 -114
- package/src/components/pages/ProviderProductEdition/index.js +232 -248
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +1 -1
- package/src/components/pages/RetailerProductEdition/index.js +149 -173
- package/src/global-files/data.js +8 -8
- package/src/components/atoms/ProgressBar/styles.js +0 -69
|
@@ -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
|
}
|
|
@@ -525,15 +526,6 @@ export const RetailerProductEdition = ({
|
|
|
525
526
|
} else {
|
|
526
527
|
setImagesUploaded(true);
|
|
527
528
|
}
|
|
528
|
-
let productTemp = product;
|
|
529
|
-
if (productTemp.status === "ASSIGNED") {
|
|
530
|
-
productTemp.status = "IN_PROGRESS";
|
|
531
|
-
setProduct(productTemp);
|
|
532
|
-
sessionStorage.setItem(
|
|
533
|
-
"productSelected",
|
|
534
|
-
JSON.stringify(productTemp)
|
|
535
|
-
);
|
|
536
|
-
}
|
|
537
529
|
} catch (err) {
|
|
538
530
|
console.log(err);
|
|
539
531
|
// setMainLoading(false);
|
|
@@ -558,7 +550,7 @@ export const RetailerProductEdition = ({
|
|
|
558
550
|
return e;
|
|
559
551
|
});
|
|
560
552
|
try {
|
|
561
|
-
await axios.put(
|
|
553
|
+
const res = await axios.put(
|
|
562
554
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
|
|
563
555
|
dataImages,
|
|
564
556
|
{
|
|
@@ -567,9 +559,21 @@ export const RetailerProductEdition = ({
|
|
|
567
559
|
},
|
|
568
560
|
}
|
|
569
561
|
);
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
562
|
+
if (res.data.statusCode === 200) {
|
|
563
|
+
let productTemp = product;
|
|
564
|
+
const { newStatus, newArticleStatus } = JSON.parse(res.data.body);
|
|
565
|
+
if (newArticleStatus)
|
|
566
|
+
productTemp.status = newArticleStatus[articleId];
|
|
567
|
+
if (newStatus) productTemp.images_status = newStatus;
|
|
568
|
+
setProduct(productTemp);
|
|
569
|
+
sessionStorage.setItem(
|
|
570
|
+
"productSelected",
|
|
571
|
+
JSON.stringify(productTemp)
|
|
572
|
+
);
|
|
573
|
+
setMessage("Imágenes guardadas con éxito");
|
|
574
|
+
sessionStorage.removeItem("imagesList");
|
|
575
|
+
await loadData();
|
|
576
|
+
}
|
|
573
577
|
} catch (error) {
|
|
574
578
|
console.log(error);
|
|
575
579
|
}
|
|
@@ -578,24 +582,23 @@ export const RetailerProductEdition = ({
|
|
|
578
582
|
|
|
579
583
|
const evaluationFinished = (userId, tab, statusArray) => {
|
|
580
584
|
const srv = servicesData.filter((serv) => serv.service === getConcept(tab));
|
|
581
|
-
const
|
|
582
|
-
(serv) => serv.id_retailer === activeRetailer?.id
|
|
585
|
+
const srvActive = srv
|
|
586
|
+
.find((serv) => serv.id_retailer === activeRetailer?.id)
|
|
587
|
+
?.status?.replace(/.*\//, "");
|
|
588
|
+
const currStatus = product[`${getConcept(tab)}_status`]?.replace(
|
|
589
|
+
/.*\//,
|
|
590
|
+
""
|
|
583
591
|
);
|
|
584
|
-
const unvalidated =
|
|
585
|
-
product[`${getConcept(tab)}_status`] === "QF" ||
|
|
586
|
-
product[`${getConcept(tab)}_status`] === "IN_PROGRESS";
|
|
592
|
+
const unvalidated = ["IE", "CA"].includes(currStatus);
|
|
587
593
|
|
|
588
|
-
const auditorUnvalidated = !["RA", "AA", "
|
|
589
|
-
product[`${getConcept(tab)}_status`]
|
|
590
|
-
);
|
|
594
|
+
const auditorUnvalidated = !["RA", "AA", "ACA", "AP"].includes(currStatus);
|
|
591
595
|
|
|
592
596
|
switch (userId) {
|
|
593
597
|
case 7:
|
|
594
598
|
case 8:
|
|
595
599
|
return (
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
(statusArray.includes(product.status) &&
|
|
600
|
+
statusArray.includes(srvActive) &&
|
|
601
|
+
(["RA", "RC"].includes(product?.status) ||
|
|
599
602
|
srv.filter((serv) => statusArray.includes(serv.status)).length ===
|
|
600
603
|
srv.length)
|
|
601
604
|
);
|
|
@@ -603,14 +606,16 @@ export const RetailerProductEdition = ({
|
|
|
603
606
|
case 5:
|
|
604
607
|
return (
|
|
605
608
|
unvalidated &&
|
|
606
|
-
["
|
|
609
|
+
["CA", "IE"].includes(product.status) && // "RC", "AC", "AA", "AP", "ACA"
|
|
607
610
|
srv.filter((serv) => statusArray.includes(serv.status)).length ===
|
|
608
611
|
srv.length
|
|
609
612
|
);
|
|
610
613
|
case 6:
|
|
611
614
|
return (
|
|
612
|
-
statusArray.includes(product.status) && //RP,
|
|
613
|
-
srv.every((serv) =>
|
|
615
|
+
statusArray.includes(product.status) && // RP, RCA, AC, RA true
|
|
616
|
+
srv.every((serv) =>
|
|
617
|
+
["RA", "AA", "AP", "ACA"].includes(serv.status)
|
|
618
|
+
) &&
|
|
614
619
|
auditorUnvalidated
|
|
615
620
|
);
|
|
616
621
|
default:
|
|
@@ -632,20 +637,20 @@ export const RetailerProductEdition = ({
|
|
|
632
637
|
const approveRejectButtons = (action) => {
|
|
633
638
|
let concept = getConcept(action || activeTab);
|
|
634
639
|
|
|
635
|
-
const
|
|
636
|
-
(
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
640
|
+
const retailerStatus = servicesData
|
|
641
|
+
.find(
|
|
642
|
+
(srv) =>
|
|
643
|
+
srv.id_retailer === activeRetailer?.id && srv.service === concept
|
|
644
|
+
)
|
|
645
|
+
?.status?.replace(/.*\//, "");
|
|
646
|
+
|
|
647
|
+
//sessionStorage product
|
|
648
|
+
const adminFacilitatorCanEvaluate =
|
|
649
|
+
retailerStatus === "IE" && [1, 4, 5].includes(user.id_role);
|
|
650
|
+
const adminAuditorCanEvaluate =
|
|
651
|
+
["AC", "RP", "RCA"].includes(retailerStatus) &&
|
|
652
|
+
[1, 6].includes(user.id_role);
|
|
653
|
+
return adminFacilitatorCanEvaluate || adminAuditorCanEvaluate;
|
|
649
654
|
};
|
|
650
655
|
|
|
651
656
|
const getSectionIcon = () => {
|
|
@@ -669,92 +674,57 @@ export const RetailerProductEdition = ({
|
|
|
669
674
|
try {
|
|
670
675
|
let concept = getConcept(activeTab);
|
|
671
676
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
677
|
+
const productTemp = { ...product };
|
|
678
|
+
const evalStatus = retailerStatus;
|
|
679
|
+
const articleId = product.article.id_article;
|
|
680
|
+
const orderId = product.orderId;
|
|
681
|
+
|
|
682
|
+
let data = {
|
|
683
|
+
articleId,
|
|
684
|
+
orderId,
|
|
685
|
+
concept,
|
|
686
|
+
evalStatus,
|
|
687
|
+
retailerId: activeRetailer.id,
|
|
688
|
+
};
|
|
689
|
+
let res;
|
|
690
|
+
let message;
|
|
676
691
|
if (result) {
|
|
677
|
-
data =
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
headers: {
|
|
688
|
-
Authorization: token,
|
|
689
|
-
},
|
|
690
|
-
});
|
|
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
|
+
);
|
|
691
702
|
getServices();
|
|
692
703
|
} else {
|
|
693
|
-
const specialistDone =
|
|
694
|
-
evalStatus === "RF" ||
|
|
695
|
-
evalStatus === "RA" ||
|
|
696
|
-
evalStatus === "IN_PROGRESS";
|
|
704
|
+
const specialistDone = ["RC", "RA", "CA"].includes(evalStatus);
|
|
697
705
|
|
|
698
706
|
if (specialistDone) {
|
|
699
|
-
|
|
707
|
+
message = `${activeTab} enviada a facilitador`;
|
|
700
708
|
getSectionIcon();
|
|
701
|
-
} else if (
|
|
702
|
-
|
|
703
|
-
getSectionIcon();
|
|
704
|
-
} else if (evalStatus === "AF") {
|
|
705
|
-
setMessage("Evaluación enviada");
|
|
706
|
-
getSectionIcon();
|
|
707
|
-
} else if (evalStatus === "RP") {
|
|
708
|
-
setMessage("Evaluación enviada");
|
|
709
|
-
getSectionIcon();
|
|
710
|
-
} else if (evalStatus === "RC") {
|
|
711
|
-
setMessage("Evaluación enviada");
|
|
709
|
+
} else if (["IE", "AC", "RP", "RCA"].includes(evalStatus)) {
|
|
710
|
+
message = "Evaluación enviada";
|
|
712
711
|
getSectionIcon();
|
|
713
712
|
}
|
|
714
|
-
|
|
715
|
-
servicesData.forEach((srv) => {
|
|
716
|
-
srv.service === concept && statusArr.push(srv.status);
|
|
717
|
-
});
|
|
718
|
-
|
|
719
|
-
productTemp[`${concept}_status`] = getNewStatus(statusArr);
|
|
720
|
-
|
|
721
|
-
let newStatus = getNewStatus([
|
|
722
|
-
productTemp.datasheet_status,
|
|
723
|
-
productTemp.description_status,
|
|
724
|
-
productTemp.images_status,
|
|
725
|
-
]);
|
|
726
|
-
|
|
727
|
-
productTemp.status = newStatus;
|
|
728
|
-
|
|
729
|
-
data = {
|
|
730
|
-
articleId: product.article.id_article,
|
|
731
|
-
orderId: product.orderId,
|
|
732
|
-
concept: concept,
|
|
733
|
-
evalStatus: evalStatus,
|
|
734
|
-
retailerId: activeRetailer.id,
|
|
735
|
-
};
|
|
736
|
-
|
|
737
|
-
switch (user.id_role) {
|
|
738
|
-
case 7:
|
|
739
|
-
case 8:
|
|
740
|
-
data.especialist = true;
|
|
741
|
-
break;
|
|
742
|
-
case 4:
|
|
743
|
-
case 5:
|
|
744
|
-
data.facilitator = true;
|
|
745
|
-
break;
|
|
746
|
-
default:
|
|
747
|
-
break;
|
|
748
|
-
}
|
|
749
|
-
await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
713
|
+
res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
750
714
|
headers: {
|
|
751
715
|
Authorization: token,
|
|
752
716
|
},
|
|
753
717
|
});
|
|
754
718
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
719
|
+
if (res.data.statusCode === 200) {
|
|
720
|
+
const { newStatus, newOrderStatus } = JSON.parse(res.data.body);
|
|
721
|
+
if (newOrderStatus) productTemp.status = newOrderStatus[orderId];
|
|
722
|
+
productTemp[`${concept}_status`] = newStatus;
|
|
723
|
+
await loadData();
|
|
724
|
+
if (message) setMessage(message);
|
|
725
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
726
|
+
setProduct(productTemp);
|
|
727
|
+
}
|
|
758
728
|
} catch (error) {
|
|
759
729
|
console.log(error);
|
|
760
730
|
}
|
|
@@ -852,21 +822,23 @@ export const RetailerProductEdition = ({
|
|
|
852
822
|
|
|
853
823
|
objetcTemp["Ficha técnica"] = dsInputsRequired.length;
|
|
854
824
|
|
|
825
|
+
const regex = /(<\/?p>)|(<\/?strong>)|(<br>)/gm;
|
|
855
826
|
descriptionsServicesArray.forEach((description) => {
|
|
856
827
|
const [requested] = servicesData.filter(
|
|
857
828
|
(srv) =>
|
|
858
829
|
srv.id_retailer === description.id &&
|
|
859
830
|
srv.service === getConcept(activeTab)
|
|
860
831
|
);
|
|
861
|
-
requested
|
|
862
|
-
description.inputs.forEach(
|
|
863
|
-
(
|
|
832
|
+
if (requested) {
|
|
833
|
+
description.inputs.forEach((input) => {
|
|
834
|
+
if (
|
|
864
835
|
input.required &&
|
|
865
|
-
(!input.value ||
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
);
|
|
836
|
+
(!input.value || input.value?.replace(regex, "") === "")
|
|
837
|
+
) {
|
|
838
|
+
desInputsRequired++;
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
}
|
|
870
842
|
});
|
|
871
843
|
|
|
872
844
|
objetcTemp["Descripción"] = desInputsRequired;
|
|
@@ -940,12 +912,12 @@ export const RetailerProductEdition = ({
|
|
|
940
912
|
},
|
|
941
913
|
],
|
|
942
914
|
concept: concept,
|
|
943
|
-
|
|
915
|
+
userId: assignationId,
|
|
944
916
|
};
|
|
945
|
-
axios({
|
|
917
|
+
await axios({
|
|
946
918
|
method: "post",
|
|
947
919
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
948
|
-
data
|
|
920
|
+
data,
|
|
949
921
|
headers: {
|
|
950
922
|
Authorization: token,
|
|
951
923
|
},
|
|
@@ -1134,7 +1106,7 @@ export const RetailerProductEdition = ({
|
|
|
1134
1106
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1135
1107
|
setProduct(productTemp);
|
|
1136
1108
|
|
|
1137
|
-
loadData();
|
|
1109
|
+
await loadData();
|
|
1138
1110
|
} catch (error) {
|
|
1139
1111
|
console.log(error);
|
|
1140
1112
|
}
|
|
@@ -1212,7 +1184,7 @@ export const RetailerProductEdition = ({
|
|
|
1212
1184
|
showApproveRejectAll={
|
|
1213
1185
|
isAuditor &&
|
|
1214
1186
|
servicesData.every((serv) =>
|
|
1215
|
-
["RA", "AA", "AP", "
|
|
1187
|
+
["RA", "AA", "AP", "ACA", "AC"].includes(serv.status)
|
|
1216
1188
|
) &&
|
|
1217
1189
|
approveRejectButtons() &&
|
|
1218
1190
|
(auditorAssigned() || userAssigned())
|
|
@@ -1255,7 +1227,6 @@ export const RetailerProductEdition = ({
|
|
|
1255
1227
|
}}
|
|
1256
1228
|
/>
|
|
1257
1229
|
<FullTabsMenu
|
|
1258
|
-
canAssign={![7, 8].includes(user.id_role)}
|
|
1259
1230
|
tabsSections={tabsSections}
|
|
1260
1231
|
status={retailerStatus}
|
|
1261
1232
|
activeTab={activeTab}
|
|
@@ -1406,16 +1377,21 @@ export const RetailerProductEdition = ({
|
|
|
1406
1377
|
/>
|
|
1407
1378
|
</div>
|
|
1408
1379
|
)}
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1380
|
+
{[7, 8].includes(user.id_role) && (
|
|
1381
|
+
<Button
|
|
1382
|
+
buttonType={
|
|
1383
|
+
evaluationFinished(
|
|
1384
|
+
user.id_role,
|
|
1385
|
+
activeTab,
|
|
1386
|
+
statusArray
|
|
1387
|
+
) && requiredNull[activeTab] === 0
|
|
1388
|
+
? "general-green-button"
|
|
1389
|
+
: "general-button-disabled"
|
|
1390
|
+
}
|
|
1391
|
+
label={"Enviar evaluación"}
|
|
1392
|
+
onClick={() => sendToFacilitator()}
|
|
1393
|
+
/>
|
|
1394
|
+
)}
|
|
1419
1395
|
</div>
|
|
1420
1396
|
)}
|
|
1421
1397
|
</div>
|
package/src/global-files/data.js
CHANGED
|
@@ -195,18 +195,18 @@ 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("
|
|
203
|
-
if (lookupString.includes("
|
|
204
|
-
if (lookupString.includes("
|
|
205
|
-
if (lookupString.includes("
|
|
202
|
+
if (lookupString.includes("ACA")) return "ACA";
|
|
203
|
+
if (lookupString.includes("PA")) return "PA";
|
|
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
|
return new Error("Status not found");
|
|
212
212
|
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
3
|
-
|
|
4
|
-
export const Container = styled.div`
|
|
5
|
-
background-color: ${GlobalColors.s3};
|
|
6
|
-
width: fit-content;
|
|
7
|
-
height: 27px;
|
|
8
|
-
padding: 4px;
|
|
9
|
-
border-radius: 15px;
|
|
10
|
-
font-family: ${FontFamily.AvenirNext};
|
|
11
|
-
font-weight: 600;
|
|
12
|
-
font-size: 14px;
|
|
13
|
-
line-height: 19px;
|
|
14
|
-
color: ${(backgroundColor) =>
|
|
15
|
-
backgroundColor === "s2" || backgroundColor === "s1"
|
|
16
|
-
? GlobalColors.s4
|
|
17
|
-
: GlobalColors.white};
|
|
18
|
-
|
|
19
|
-
&.status-As,
|
|
20
|
-
&.status-P {
|
|
21
|
-
background-color: ${GlobalColors.in_progress};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&.status-Pr,
|
|
25
|
-
&.status-Rr {
|
|
26
|
-
background-color: ${GlobalColors.reception};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&.status-AA,
|
|
30
|
-
&.status-AP,
|
|
31
|
-
&.status-AC,
|
|
32
|
-
&.status-AF {
|
|
33
|
-
background-color: ${GlobalColors.finished};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&.status-RA,
|
|
37
|
-
&.status-RF,
|
|
38
|
-
&.status-RP,
|
|
39
|
-
&.status-RC {
|
|
40
|
-
background-color: ${GlobalColors.rejected_status};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&.status-Dat,
|
|
44
|
-
&.status-Dsc,
|
|
45
|
-
&.status-Imgs {
|
|
46
|
-
background-color: ${GlobalColors.s4};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&.status-Ex {
|
|
50
|
-
background-color: ${GlobalColors.exported};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&.status-DDI {
|
|
54
|
-
background-color: ${GlobalColors.original_purpura};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&.status-GLD {
|
|
58
|
-
background-color: ${GlobalColors.in_progress};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&.status-TAB {
|
|
62
|
-
background-color: ${GlobalColors.deep_gray};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&.status-Pt {
|
|
66
|
-
background-color: ${GlobalColors.s2};
|
|
67
|
-
color: ${GlobalColors.s4};
|
|
68
|
-
}
|
|
69
|
-
`;
|