contentoh-components-library 21.1.36 → 21.1.39
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/Percent/Percent.stories.js +39 -0
- package/dist/components/atoms/Percent/index.js +39 -0
- package/dist/components/atoms/Percent/styles.js +20 -0
- package/dist/components/atoms/StatusTag/index.js +17 -2
- package/dist/components/atoms/StatusTag/styles.js +1 -1
- package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +31 -0
- package/dist/components/molecules/TextAndGradient/index.js +36 -0
- package/dist/components/molecules/TextAndGradient/styles.js +18 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +105 -103
- package/dist/components/pages/ProviderProductEdition/index.js +323 -349
- 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 +38 -83
- package/dist/components/pages/RetailerProductEdition/index.js +197 -208
- 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/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +117 -103
- package/src/components/pages/ProviderProductEdition/index.js +171 -165
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +33 -82
- package/src/components/pages/RetailerProductEdition/index.js +167 -139
- package/src/global-files/data.js +9 -10
- package/src/index.js +1 -0
|
@@ -233,8 +233,11 @@ export const ProviderProductEdition = ({
|
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
//
|
|
237
|
-
setImages({
|
|
236
|
+
//setActiveRetailer(product?.retailers[0]);
|
|
237
|
+
setImages({
|
|
238
|
+
action: "init",
|
|
239
|
+
init: services[2],
|
|
240
|
+
});
|
|
238
241
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
239
242
|
|
|
240
243
|
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
@@ -253,11 +256,10 @@ export const ProviderProductEdition = ({
|
|
|
253
256
|
}&end=true`
|
|
254
257
|
);
|
|
255
258
|
const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
|
|
256
|
-
const retailerResponse = parsedResponse?.map((srv) => srv.id_retailer);
|
|
257
259
|
let retailers = product.retailers || product.retailersAvailable;
|
|
258
|
-
let active = retailers?.
|
|
259
|
-
|
|
260
|
-
);
|
|
260
|
+
let active = retailers?.filter((retailer) =>
|
|
261
|
+
parsedResponse?.map((srv) => srv.id_retailer).includes(retailer.id)
|
|
262
|
+
)[0];
|
|
261
263
|
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
262
264
|
setServicesData(parsedResponse);
|
|
263
265
|
}
|
|
@@ -278,15 +280,15 @@ export const ProviderProductEdition = ({
|
|
|
278
280
|
if (revision && currentService === "AP") return true;
|
|
279
281
|
} else {
|
|
280
282
|
const { product } = productEdit;
|
|
281
|
-
|
|
282
|
-
orgn === "
|
|
283
|
-
(["
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
283
|
+
if (
|
|
284
|
+
orgn === "Contentoh" ||
|
|
285
|
+
(["RECEIVED", "IN_PROGRESS"].includes(currentService) &&
|
|
286
|
+
orgn === "RequestWithoutContentoh") ||
|
|
287
|
+
(currentService === "AA" && orgn === "RequestWithContentoh") ||
|
|
288
|
+
(currentService === "RC" &&
|
|
289
|
+
orgn === "RequestWithoutContentoh" &&
|
|
290
|
+
(!product.id_order || !product.orderId))
|
|
291
|
+
)
|
|
290
292
|
return true;
|
|
291
293
|
}
|
|
292
294
|
}
|
|
@@ -303,26 +305,26 @@ export const ProviderProductEdition = ({
|
|
|
303
305
|
setInCart(arr.some((e) => e.articleId === product.id_article));
|
|
304
306
|
};
|
|
305
307
|
|
|
306
|
-
useEffect(() => {
|
|
308
|
+
useEffect(async () => {
|
|
307
309
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
308
310
|
loadData();
|
|
309
311
|
getCart();
|
|
310
|
-
fetchUsers(token)
|
|
312
|
+
setUserGroups(await fetchUsers(token));
|
|
311
313
|
let arr = [];
|
|
312
|
-
// ?? Que sentido tiene verificar los roles de colaborador en la app de proveedor
|
|
313
314
|
switch (user.id_role) {
|
|
314
315
|
case 7:
|
|
315
316
|
case 8:
|
|
316
|
-
arr = ["
|
|
317
|
+
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
317
318
|
break;
|
|
318
319
|
case 4:
|
|
319
320
|
case 5:
|
|
320
|
-
arr = ["
|
|
321
|
+
arr = ["RF", "AF", "AA", "AP", "AC"];
|
|
321
322
|
break;
|
|
322
323
|
case 6:
|
|
323
|
-
arr = ["RP", "
|
|
324
|
+
arr = ["RP", "RC", "AF"];
|
|
324
325
|
break;
|
|
325
326
|
default:
|
|
327
|
+
arr = [];
|
|
326
328
|
break;
|
|
327
329
|
}
|
|
328
330
|
setStatusArray(arr);
|
|
@@ -340,9 +342,9 @@ export const ProviderProductEdition = ({
|
|
|
340
342
|
const productTemp = product;
|
|
341
343
|
const retailers = productTemp?.retailersAvailable || productTemp?.retailers;
|
|
342
344
|
retailers?.forEach((retailer) => {
|
|
343
|
-
retailer["percentage"] = percentages?.
|
|
345
|
+
retailer["percentage"] = percentages?.filter(
|
|
344
346
|
(percent) => retailer?.id === percent?.id_retailer
|
|
345
|
-
)?.percentage;
|
|
347
|
+
)[0]?.percentage;
|
|
346
348
|
});
|
|
347
349
|
|
|
348
350
|
setProduct(productTemp);
|
|
@@ -418,7 +420,7 @@ export const ProviderProductEdition = ({
|
|
|
418
420
|
};
|
|
419
421
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
420
422
|
try {
|
|
421
|
-
|
|
423
|
+
await axios.put(
|
|
422
424
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
|
|
423
425
|
dataObject,
|
|
424
426
|
{
|
|
@@ -427,10 +429,8 @@ export const ProviderProductEdition = ({
|
|
|
427
429
|
},
|
|
428
430
|
}
|
|
429
431
|
);
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
await loadData();
|
|
433
|
-
}
|
|
432
|
+
setMessage("Descripciones guardadas con éxito");
|
|
433
|
+
loadData();
|
|
434
434
|
} catch (error) {
|
|
435
435
|
console.log(error);
|
|
436
436
|
}
|
|
@@ -453,10 +453,8 @@ export const ProviderProductEdition = ({
|
|
|
453
453
|
},
|
|
454
454
|
}
|
|
455
455
|
);
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
await loadData();
|
|
459
|
-
}
|
|
456
|
+
setMessage("Fichas técnicas guardadas");
|
|
457
|
+
loadData();
|
|
460
458
|
} catch (error) {
|
|
461
459
|
console.log(error);
|
|
462
460
|
}
|
|
@@ -554,7 +552,7 @@ export const ProviderProductEdition = ({
|
|
|
554
552
|
return e;
|
|
555
553
|
});
|
|
556
554
|
try {
|
|
557
|
-
|
|
555
|
+
await axios.put(
|
|
558
556
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
|
|
559
557
|
dataImages,
|
|
560
558
|
{
|
|
@@ -563,11 +561,9 @@ export const ProviderProductEdition = ({
|
|
|
563
561
|
},
|
|
564
562
|
}
|
|
565
563
|
);
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
await loadData();
|
|
570
|
-
}
|
|
564
|
+
setMessage("Imágenes guardadas con éxito");
|
|
565
|
+
sessionStorage.removeItem("imagesList");
|
|
566
|
+
loadData();
|
|
571
567
|
} catch (error) {
|
|
572
568
|
console.log(error);
|
|
573
569
|
}
|
|
@@ -669,12 +665,12 @@ export const ProviderProductEdition = ({
|
|
|
669
665
|
},
|
|
670
666
|
],
|
|
671
667
|
concept: concept,
|
|
672
|
-
|
|
668
|
+
[`${assignationType}Id`]: assignationId,
|
|
673
669
|
};
|
|
674
|
-
|
|
670
|
+
axios({
|
|
675
671
|
method: "post",
|
|
676
672
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
677
|
-
data,
|
|
673
|
+
data: data,
|
|
678
674
|
headers: {
|
|
679
675
|
Authorization: token,
|
|
680
676
|
},
|
|
@@ -692,7 +688,7 @@ export const ProviderProductEdition = ({
|
|
|
692
688
|
serv = serv.filter((f) => f.id_retailer === activeRetailer.id);
|
|
693
689
|
}
|
|
694
690
|
const statusArray =
|
|
695
|
-
user.is_retailer === 1 ? ["
|
|
691
|
+
user.is_retailer === 1 ? ["AC", "RC"] : ["AP", "RP", "AC"];
|
|
696
692
|
return (
|
|
697
693
|
serv.length > 0 && serv.every((item) => statusArray.includes(item.status))
|
|
698
694
|
);
|
|
@@ -795,7 +791,7 @@ export const ProviderProductEdition = ({
|
|
|
795
791
|
const { datasheet_status, description_status, images_status } = product;
|
|
796
792
|
const completionStates =
|
|
797
793
|
user.is_retailer === 1
|
|
798
|
-
? ["
|
|
794
|
+
? ["AC", "Evaluated", "NS"]
|
|
799
795
|
: ["AP", "Evaluated", "NS"];
|
|
800
796
|
const dsEvaluated = completionStates.includes(datasheet_status);
|
|
801
797
|
const descsEvaluated = completionStates.includes(description_status);
|
|
@@ -808,53 +804,54 @@ export const ProviderProductEdition = ({
|
|
|
808
804
|
|
|
809
805
|
const sendEvaluation = async (result) => {
|
|
810
806
|
setLoading(true);
|
|
811
|
-
|
|
812
|
-
const productTemp = product;
|
|
813
|
-
const articleId = productTemp.id_article;
|
|
814
|
-
const orderId = productTemp.id_order ?? productTemp.orderId;
|
|
815
|
-
const evalStatus =
|
|
816
|
-
product[`${getConcept(activeTab)}_status`] || product?.version_status;
|
|
817
|
-
let data = { articleId, orderId, concept, evalStatus };
|
|
807
|
+
let data = {};
|
|
818
808
|
const retailerId = activeRetailer?.id;
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
809
|
+
if (result) {
|
|
810
|
+
data = {
|
|
811
|
+
articleId: product.id_article,
|
|
812
|
+
orderId: product.id_order ?? product.orderId,
|
|
813
|
+
concept: getConcept(activeTab),
|
|
814
|
+
result: result,
|
|
815
|
+
retailerId,
|
|
816
|
+
};
|
|
817
|
+
await axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
818
|
+
headers: {
|
|
819
|
+
Authorization: token,
|
|
820
|
+
},
|
|
821
|
+
});
|
|
822
|
+
} else {
|
|
823
|
+
const productTemp = product;
|
|
824
|
+
const concept = getConcept(activeTab);
|
|
825
|
+
productTemp[`${concept}_status`] = "Evaluated";
|
|
826
|
+
data = {
|
|
827
|
+
articleId: product.id_article,
|
|
828
|
+
orderId: product.id_order ?? product.orderId,
|
|
829
|
+
concept,
|
|
830
|
+
};
|
|
831
|
+
axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
832
|
+
headers: {
|
|
833
|
+
Authorization: token,
|
|
834
|
+
},
|
|
835
|
+
});
|
|
836
|
+
setProduct(productTemp);
|
|
837
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
838
|
+
setProductEdit({
|
|
839
|
+
ArticleId: productTemp.id_article,
|
|
840
|
+
idCategory: productTemp.article.id_category,
|
|
841
|
+
product: productTemp,
|
|
842
|
+
});
|
|
843
|
+
sessionStorage.setItem(
|
|
844
|
+
"productEdit",
|
|
845
|
+
JSON.stringify({
|
|
846
|
+
ArticleId: productTemp.id_article,
|
|
846
847
|
idCategory: productTemp.article.id_category,
|
|
847
848
|
product: productTemp,
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
setOrigin((prev) => ({ ...prev, [concept]: "Evaluated" }));
|
|
852
|
-
await loadData();
|
|
853
|
-
showSurvey && showSurvey(confirmStatusComplete());
|
|
854
|
-
}
|
|
855
|
-
} catch (err) {
|
|
856
|
-
console.log(err);
|
|
849
|
+
})
|
|
850
|
+
);
|
|
851
|
+
setOrigin((prev) => ({ ...prev, [concept]: "Evaluated" }));
|
|
857
852
|
}
|
|
853
|
+
loadData();
|
|
854
|
+
showSurvey && showSurvey(confirmStatusComplete());
|
|
858
855
|
};
|
|
859
856
|
|
|
860
857
|
const validateAll = async (result) => {
|
|
@@ -900,13 +897,13 @@ export const ProviderProductEdition = ({
|
|
|
900
897
|
|
|
901
898
|
await Promise.all(sendAll);
|
|
902
899
|
const productTemp = product;
|
|
903
|
-
productTemp.article_status = `${result}
|
|
900
|
+
productTemp.article_status = `${result}C`;
|
|
904
901
|
productTemp.datasheet_status =
|
|
905
|
-
productTemp.datasheet_status === "NA" ? "NA" : `${result}
|
|
902
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}C`;
|
|
906
903
|
productTemp.description_status =
|
|
907
|
-
productTemp.description_status === "NA" ? "NA" : `${result}
|
|
904
|
+
productTemp.description_status === "NA" ? "NA" : `${result}C`;
|
|
908
905
|
productTemp.images_status =
|
|
909
|
-
productTemp.images_status === "NA" ? "NA" : `${result}
|
|
906
|
+
productTemp.images_status === "NA" ? "NA" : `${result}C`;
|
|
910
907
|
setProduct(productTemp);
|
|
911
908
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
912
909
|
setProductEdit({
|
|
@@ -923,7 +920,7 @@ export const ProviderProductEdition = ({
|
|
|
923
920
|
})
|
|
924
921
|
);
|
|
925
922
|
|
|
926
|
-
|
|
923
|
+
loadData();
|
|
927
924
|
} catch (error) {
|
|
928
925
|
console.log(error);
|
|
929
926
|
}
|
|
@@ -944,7 +941,7 @@ export const ProviderProductEdition = ({
|
|
|
944
941
|
},
|
|
945
942
|
});
|
|
946
943
|
const prod = productEdit;
|
|
947
|
-
const statusComplete = user.is_retailer ? `${result}
|
|
944
|
+
const statusComplete = user.is_retailer ? `${result}C` : `${result}P`;
|
|
948
945
|
prod.product.datasheet_status = statusComplete;
|
|
949
946
|
prod.product.description_status = statusComplete;
|
|
950
947
|
prod.product.images_status = statusComplete;
|
|
@@ -953,22 +950,24 @@ export const ProviderProductEdition = ({
|
|
|
953
950
|
sessionStorage.setItem("productEdit", JSON.stringify(prod));
|
|
954
951
|
setProduct(prod);
|
|
955
952
|
setShowGenericModal && setShowGenericModal(false);
|
|
956
|
-
|
|
953
|
+
loadData();
|
|
957
954
|
};
|
|
958
955
|
|
|
959
956
|
const getSectionStatus = () => {
|
|
960
957
|
const concept = getConcept(activeTab);
|
|
961
|
-
return ["AA", "AP", "
|
|
958
|
+
return ["AA", "AP", "RECEIVED", "IN_PROGRESS", "RC"].includes(
|
|
962
959
|
productEdit.product[`${concept}_status`]
|
|
963
960
|
);
|
|
964
961
|
};
|
|
965
962
|
|
|
966
963
|
const enableActions = (versionStatus) => {
|
|
967
964
|
try {
|
|
968
|
-
|
|
965
|
+
const userIsRetailer = user.is_retailer;
|
|
966
|
+
|
|
967
|
+
if (userIsRetailer) return false;
|
|
969
968
|
|
|
970
969
|
if (versionStatus) {
|
|
971
|
-
return ["AP", "
|
|
970
|
+
return ["AP", "AC", "RC", null].includes(versionStatus);
|
|
972
971
|
}
|
|
973
972
|
return true;
|
|
974
973
|
} catch (err) {
|
|
@@ -1058,21 +1057,23 @@ export const ProviderProductEdition = ({
|
|
|
1058
1057
|
},
|
|
1059
1058
|
}));
|
|
1060
1059
|
setShowGenericModal(true);
|
|
1061
|
-
} else
|
|
1062
|
-
if (
|
|
1063
|
-
|
|
1060
|
+
} else {
|
|
1061
|
+
if (user.is_retailer) {
|
|
1062
|
+
if (product.id_order || product.orderId) {
|
|
1063
|
+
validateAll("A");
|
|
1064
|
+
} else {
|
|
1065
|
+
setDataGenericModal((prev) => ({
|
|
1066
|
+
...prev,
|
|
1067
|
+
button2: {
|
|
1068
|
+
name: "Continuar",
|
|
1069
|
+
action: () => evaluationToRetailer("A"),
|
|
1070
|
+
},
|
|
1071
|
+
}));
|
|
1072
|
+
setShowGenericModal(true);
|
|
1073
|
+
}
|
|
1064
1074
|
} else {
|
|
1065
|
-
|
|
1066
|
-
...prev,
|
|
1067
|
-
button2: {
|
|
1068
|
-
name: "Continuar",
|
|
1069
|
-
action: () => evaluationToRetailer("A"),
|
|
1070
|
-
},
|
|
1071
|
-
}));
|
|
1072
|
-
setShowGenericModal(true);
|
|
1075
|
+
validateAll("A");
|
|
1073
1076
|
}
|
|
1074
|
-
} else {
|
|
1075
|
-
validateAll("A");
|
|
1076
1077
|
}
|
|
1077
1078
|
}}
|
|
1078
1079
|
rejectAll={() => {
|
|
@@ -1082,23 +1083,25 @@ export const ProviderProductEdition = ({
|
|
|
1082
1083
|
(!product.id_order || !product.orderId)
|
|
1083
1084
|
) {
|
|
1084
1085
|
return;
|
|
1085
|
-
} else
|
|
1086
|
-
if (
|
|
1086
|
+
} else {
|
|
1087
|
+
if (user.is_retailer) {
|
|
1088
|
+
if (product.id_order || product.orderId) {
|
|
1089
|
+
validateAll("R");
|
|
1090
|
+
setModalViewError(true);
|
|
1091
|
+
} else {
|
|
1092
|
+
setDataGenericModal((prev) => ({
|
|
1093
|
+
...prev,
|
|
1094
|
+
button2: {
|
|
1095
|
+
name: "Continuar",
|
|
1096
|
+
action: () => evaluationToRetailer("R"),
|
|
1097
|
+
},
|
|
1098
|
+
}));
|
|
1099
|
+
setShowGenericModal(true);
|
|
1100
|
+
}
|
|
1101
|
+
} else {
|
|
1087
1102
|
validateAll("R");
|
|
1088
1103
|
setModalViewError(true);
|
|
1089
|
-
} else {
|
|
1090
|
-
setDataGenericModal((prev) => ({
|
|
1091
|
-
...prev,
|
|
1092
|
-
button2: {
|
|
1093
|
-
name: "Continuar",
|
|
1094
|
-
action: () => evaluationToRetailer("R"),
|
|
1095
|
-
},
|
|
1096
|
-
}));
|
|
1097
|
-
setShowGenericModal(true);
|
|
1098
1104
|
}
|
|
1099
|
-
} else {
|
|
1100
|
-
validateAll("R");
|
|
1101
|
-
setModalViewError(true);
|
|
1102
1105
|
}
|
|
1103
1106
|
}}
|
|
1104
1107
|
approve={() => {
|
|
@@ -1115,21 +1118,23 @@ export const ProviderProductEdition = ({
|
|
|
1115
1118
|
},
|
|
1116
1119
|
}));
|
|
1117
1120
|
setShowGenericModal(true);
|
|
1118
|
-
} else
|
|
1119
|
-
if (
|
|
1120
|
-
|
|
1121
|
+
} else {
|
|
1122
|
+
if (user.is_retailer) {
|
|
1123
|
+
if (product.id_order || product.orderId) {
|
|
1124
|
+
sendEvaluation("A");
|
|
1125
|
+
} else {
|
|
1126
|
+
setDataGenericModal((prev) => ({
|
|
1127
|
+
...prev,
|
|
1128
|
+
button2: {
|
|
1129
|
+
name: "Continuar",
|
|
1130
|
+
action: () => evaluationToRetailer("A"),
|
|
1131
|
+
},
|
|
1132
|
+
}));
|
|
1133
|
+
setShowGenericModal(true);
|
|
1134
|
+
}
|
|
1121
1135
|
} else {
|
|
1122
|
-
|
|
1123
|
-
...prev,
|
|
1124
|
-
button2: {
|
|
1125
|
-
name: "Continuar",
|
|
1126
|
-
action: () => evaluationToRetailer("A"),
|
|
1127
|
-
},
|
|
1128
|
-
}));
|
|
1129
|
-
setShowGenericModal(true);
|
|
1136
|
+
sendEvaluation("A");
|
|
1130
1137
|
}
|
|
1131
|
-
} else {
|
|
1132
|
-
sendEvaluation("A");
|
|
1133
1138
|
}
|
|
1134
1139
|
}}
|
|
1135
1140
|
reject={() => {
|
|
@@ -1139,23 +1144,25 @@ export const ProviderProductEdition = ({
|
|
|
1139
1144
|
(!product.id_order || !product.orderId)
|
|
1140
1145
|
) {
|
|
1141
1146
|
return;
|
|
1142
|
-
} else
|
|
1143
|
-
if (
|
|
1147
|
+
} else {
|
|
1148
|
+
if (user.is_retailer) {
|
|
1149
|
+
if (product.id_order || product.orderId) {
|
|
1150
|
+
sendEvaluation("R");
|
|
1151
|
+
setModalViewError(true);
|
|
1152
|
+
} else {
|
|
1153
|
+
setDataGenericModal((prev) => ({
|
|
1154
|
+
...prev,
|
|
1155
|
+
button2: {
|
|
1156
|
+
name: "Continuar",
|
|
1157
|
+
action: () => evaluationToRetailer("R"),
|
|
1158
|
+
},
|
|
1159
|
+
}));
|
|
1160
|
+
setShowGenericModal(true);
|
|
1161
|
+
}
|
|
1162
|
+
} else {
|
|
1144
1163
|
sendEvaluation("R");
|
|
1145
1164
|
setModalViewError(true);
|
|
1146
|
-
} else {
|
|
1147
|
-
setDataGenericModal((prev) => ({
|
|
1148
|
-
...prev,
|
|
1149
|
-
button2: {
|
|
1150
|
-
name: "Continuar",
|
|
1151
|
-
action: () => evaluationToRetailer("R"),
|
|
1152
|
-
},
|
|
1153
|
-
}));
|
|
1154
|
-
setShowGenericModal(true);
|
|
1155
1165
|
}
|
|
1156
|
-
} else {
|
|
1157
|
-
sendEvaluation("R");
|
|
1158
|
-
setModalViewError(true);
|
|
1159
1166
|
}
|
|
1160
1167
|
}}
|
|
1161
1168
|
/>
|
|
@@ -1306,21 +1313,20 @@ export const ProviderProductEdition = ({
|
|
|
1306
1313
|
/>
|
|
1307
1314
|
</div>
|
|
1308
1315
|
)}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
/> */}
|
|
1316
|
+
<Button
|
|
1317
|
+
buttonType={
|
|
1318
|
+
evaluationComplete(activeTab) &&
|
|
1319
|
+
(productEdit.product.id_order || productEdit.product.orderId)
|
|
1320
|
+
? "general-green-button"
|
|
1321
|
+
: "general-button-disabled"
|
|
1322
|
+
}
|
|
1323
|
+
label={"Enviar evaluación"}
|
|
1324
|
+
onClick={() => {
|
|
1325
|
+
//setModalSent(true);
|
|
1326
|
+
sendEvaluation();
|
|
1327
|
+
setMessage(`¡Evaluación de ${activeTab} completada!`);
|
|
1328
|
+
}}
|
|
1329
|
+
/>
|
|
1324
1330
|
</div>
|
|
1325
1331
|
) : revision ? null : (
|
|
1326
1332
|
<div className="required-inputs-message">
|