contentoh-components-library 21.1.37 → 21.1.38
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 +107 -105
- package/dist/components/pages/ProviderProductEdition/index.js +324 -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 +120 -106
- package/src/components/pages/ProviderProductEdition/index.js +181 -176
- 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
- package/dist/assets/images/sliderToolTip/slide21.svg +0 -9
- package/dist/assets/images/sliderToolTip/slide22.svg +0 -9
- package/dist/assets/images/sliderToolTip/slide23.svg +0 -9
|
@@ -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,54 +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
|
-
|
|
846
|
-
|
|
847
|
-
|
|
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,
|
|
848
847
|
idCategory: productTemp.article.id_category,
|
|
849
848
|
product: productTemp,
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
setOrigin((prev) => ({ ...prev, [concept]: "Evaluated" }));
|
|
854
|
-
await loadData();
|
|
855
|
-
}
|
|
856
|
-
} catch (err) {
|
|
857
|
-
console.log(err);
|
|
849
|
+
})
|
|
850
|
+
);
|
|
851
|
+
setOrigin((prev) => ({ ...prev, [concept]: "Evaluated" }));
|
|
858
852
|
}
|
|
853
|
+
loadData();
|
|
854
|
+
showSurvey && showSurvey(confirmStatusComplete());
|
|
859
855
|
};
|
|
860
856
|
|
|
861
857
|
const validateAll = async (result) => {
|
|
@@ -901,13 +897,13 @@ export const ProviderProductEdition = ({
|
|
|
901
897
|
|
|
902
898
|
await Promise.all(sendAll);
|
|
903
899
|
const productTemp = product;
|
|
904
|
-
productTemp.article_status = `${result}
|
|
900
|
+
productTemp.article_status = `${result}C`;
|
|
905
901
|
productTemp.datasheet_status =
|
|
906
|
-
productTemp.datasheet_status === "NA" ? "NA" : `${result}
|
|
902
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}C`;
|
|
907
903
|
productTemp.description_status =
|
|
908
|
-
productTemp.description_status === "NA" ? "NA" : `${result}
|
|
904
|
+
productTemp.description_status === "NA" ? "NA" : `${result}C`;
|
|
909
905
|
productTemp.images_status =
|
|
910
|
-
productTemp.images_status === "NA" ? "NA" : `${result}
|
|
906
|
+
productTemp.images_status === "NA" ? "NA" : `${result}C`;
|
|
911
907
|
setProduct(productTemp);
|
|
912
908
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
913
909
|
setProductEdit({
|
|
@@ -924,7 +920,7 @@ export const ProviderProductEdition = ({
|
|
|
924
920
|
})
|
|
925
921
|
);
|
|
926
922
|
|
|
927
|
-
|
|
923
|
+
loadData();
|
|
928
924
|
} catch (error) {
|
|
929
925
|
console.log(error);
|
|
930
926
|
}
|
|
@@ -945,7 +941,7 @@ export const ProviderProductEdition = ({
|
|
|
945
941
|
},
|
|
946
942
|
});
|
|
947
943
|
const prod = productEdit;
|
|
948
|
-
const statusComplete = user.is_retailer ? `${result}
|
|
944
|
+
const statusComplete = user.is_retailer ? `${result}C` : `${result}P`;
|
|
949
945
|
prod.product.datasheet_status = statusComplete;
|
|
950
946
|
prod.product.description_status = statusComplete;
|
|
951
947
|
prod.product.images_status = statusComplete;
|
|
@@ -954,22 +950,24 @@ export const ProviderProductEdition = ({
|
|
|
954
950
|
sessionStorage.setItem("productEdit", JSON.stringify(prod));
|
|
955
951
|
setProduct(prod);
|
|
956
952
|
setShowGenericModal && setShowGenericModal(false);
|
|
957
|
-
|
|
953
|
+
loadData();
|
|
958
954
|
};
|
|
959
955
|
|
|
960
956
|
const getSectionStatus = () => {
|
|
961
957
|
const concept = getConcept(activeTab);
|
|
962
|
-
return ["AA", "AP", "
|
|
958
|
+
return ["AA", "AP", "RECEIVED", "IN_PROGRESS", "RC"].includes(
|
|
963
959
|
productEdit.product[`${concept}_status`]
|
|
964
960
|
);
|
|
965
961
|
};
|
|
966
962
|
|
|
967
963
|
const enableActions = (versionStatus) => {
|
|
968
964
|
try {
|
|
969
|
-
|
|
965
|
+
const userIsRetailer = user.is_retailer;
|
|
966
|
+
|
|
967
|
+
if (userIsRetailer) return false;
|
|
970
968
|
|
|
971
969
|
if (versionStatus) {
|
|
972
|
-
return ["AP", "
|
|
970
|
+
return ["AP", "AC", "RC", null].includes(versionStatus);
|
|
973
971
|
}
|
|
974
972
|
return true;
|
|
975
973
|
} catch (err) {
|
|
@@ -1059,21 +1057,23 @@ export const ProviderProductEdition = ({
|
|
|
1059
1057
|
},
|
|
1060
1058
|
}));
|
|
1061
1059
|
setShowGenericModal(true);
|
|
1062
|
-
} else
|
|
1063
|
-
if (
|
|
1064
|
-
|
|
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
|
+
}
|
|
1065
1074
|
} else {
|
|
1066
|
-
|
|
1067
|
-
...prev,
|
|
1068
|
-
button2: {
|
|
1069
|
-
name: "Continuar",
|
|
1070
|
-
action: () => evaluationToRetailer("A"),
|
|
1071
|
-
},
|
|
1072
|
-
}));
|
|
1073
|
-
setShowGenericModal(true);
|
|
1075
|
+
validateAll("A");
|
|
1074
1076
|
}
|
|
1075
|
-
} else {
|
|
1076
|
-
validateAll("A");
|
|
1077
1077
|
}
|
|
1078
1078
|
}}
|
|
1079
1079
|
rejectAll={() => {
|
|
@@ -1083,23 +1083,25 @@ export const ProviderProductEdition = ({
|
|
|
1083
1083
|
(!product.id_order || !product.orderId)
|
|
1084
1084
|
) {
|
|
1085
1085
|
return;
|
|
1086
|
-
} else
|
|
1087
|
-
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 {
|
|
1088
1102
|
validateAll("R");
|
|
1089
1103
|
setModalViewError(true);
|
|
1090
|
-
} else {
|
|
1091
|
-
setDataGenericModal((prev) => ({
|
|
1092
|
-
...prev,
|
|
1093
|
-
button2: {
|
|
1094
|
-
name: "Continuar",
|
|
1095
|
-
action: () => evaluationToRetailer("R"),
|
|
1096
|
-
},
|
|
1097
|
-
}));
|
|
1098
|
-
setShowGenericModal(true);
|
|
1099
1104
|
}
|
|
1100
|
-
} else {
|
|
1101
|
-
validateAll("R");
|
|
1102
|
-
setModalViewError(true);
|
|
1103
1105
|
}
|
|
1104
1106
|
}}
|
|
1105
1107
|
approve={() => {
|
|
@@ -1116,21 +1118,23 @@ export const ProviderProductEdition = ({
|
|
|
1116
1118
|
},
|
|
1117
1119
|
}));
|
|
1118
1120
|
setShowGenericModal(true);
|
|
1119
|
-
} else
|
|
1120
|
-
if (
|
|
1121
|
-
|
|
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
|
+
}
|
|
1122
1135
|
} else {
|
|
1123
|
-
|
|
1124
|
-
...prev,
|
|
1125
|
-
button2: {
|
|
1126
|
-
name: "Continuar",
|
|
1127
|
-
action: () => evaluationToRetailer("A"),
|
|
1128
|
-
},
|
|
1129
|
-
}));
|
|
1130
|
-
setShowGenericModal(true);
|
|
1136
|
+
sendEvaluation("A");
|
|
1131
1137
|
}
|
|
1132
|
-
} else {
|
|
1133
|
-
sendEvaluation("A");
|
|
1134
1138
|
}
|
|
1135
1139
|
}}
|
|
1136
1140
|
reject={() => {
|
|
@@ -1140,23 +1144,25 @@ export const ProviderProductEdition = ({
|
|
|
1140
1144
|
(!product.id_order || !product.orderId)
|
|
1141
1145
|
) {
|
|
1142
1146
|
return;
|
|
1143
|
-
} else
|
|
1144
|
-
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 {
|
|
1145
1163
|
sendEvaluation("R");
|
|
1146
1164
|
setModalViewError(true);
|
|
1147
|
-
} else {
|
|
1148
|
-
setDataGenericModal((prev) => ({
|
|
1149
|
-
...prev,
|
|
1150
|
-
button2: {
|
|
1151
|
-
name: "Continuar",
|
|
1152
|
-
action: () => evaluationToRetailer("R"),
|
|
1153
|
-
},
|
|
1154
|
-
}));
|
|
1155
|
-
setShowGenericModal(true);
|
|
1156
1165
|
}
|
|
1157
|
-
} else {
|
|
1158
|
-
sendEvaluation("R");
|
|
1159
|
-
setModalViewError(true);
|
|
1160
1166
|
}
|
|
1161
1167
|
}}
|
|
1162
1168
|
/>
|
|
@@ -1307,21 +1313,20 @@ export const ProviderProductEdition = ({
|
|
|
1307
1313
|
/>
|
|
1308
1314
|
</div>
|
|
1309
1315
|
)}
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
/> */}
|
|
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
|
+
/>
|
|
1325
1330
|
</div>
|
|
1326
1331
|
) : revision ? null : (
|
|
1327
1332
|
<div className="required-inputs-message">
|
|
@@ -1341,20 +1346,20 @@ export const ProviderProductEdition = ({
|
|
|
1341
1346
|
</button>
|
|
1342
1347
|
) : (
|
|
1343
1348
|
<>
|
|
1344
|
-
|
|
1349
|
+
<SliderToolTip
|
|
1345
1350
|
infoIcon={InfoIcon}
|
|
1346
1351
|
slidefront={slidefront}
|
|
1347
1352
|
iconSize={"big-image"}
|
|
1348
1353
|
slidePosition={"top-slide"}
|
|
1349
1354
|
></SliderToolTip>
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1355
|
+
<Button
|
|
1356
|
+
onClick={() => {
|
|
1357
|
+
setShowContentohRequestModal &&
|
|
1358
|
+
setShowContentohRequestModal(true);
|
|
1359
|
+
}}
|
|
1360
|
+
buttonType="general-default-button"
|
|
1361
|
+
label="Enviar a Content-oh!"
|
|
1362
|
+
/>
|
|
1358
1363
|
</>
|
|
1359
1364
|
)}
|
|
1360
1365
|
</div>
|
|
@@ -1436,4 +1441,4 @@ export const ProviderProductEdition = ({
|
|
|
1436
1441
|
)}
|
|
1437
1442
|
</Container>
|
|
1438
1443
|
);
|
|
1439
|
-
};
|
|
1444
|
+
};
|