contentoh-components-library 21.1.40 → 21.1.44
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/organisms/FullProductNameHeader/index.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +87 -119
- package/dist/components/pages/ProviderProductEdition/index.js +328 -380
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -86
- package/dist/components/pages/RetailerProductEdition/index.js +201 -214
- 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/StatusAsignationInfo/index.js +1 -1
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +92 -116
- package/src/components/pages/ProviderProductEdition/index.js +208 -218
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +38 -87
- package/src/components/pages/RetailerProductEdition/index.js +168 -143
- package/src/global-files/data.js +9 -10
- package/src/index.js +1 -0
|
@@ -208,9 +208,6 @@ export const ProviderProductEdition = ({
|
|
|
208
208
|
const [modalViewTextArea, setModalViewTextArea] = useState(false);
|
|
209
209
|
const [socketType, setSocketType] = useState(null);
|
|
210
210
|
const [saving, setSaving] = useState(loading);
|
|
211
|
-
const [retailerStatus, setRetailerStatus] = useState(
|
|
212
|
-
product.statusByRetailer
|
|
213
|
-
);
|
|
214
211
|
|
|
215
212
|
useEffect(() => {
|
|
216
213
|
checkAll && setSelectedImages(images.values);
|
|
@@ -236,8 +233,11 @@ export const ProviderProductEdition = ({
|
|
|
236
233
|
);
|
|
237
234
|
}
|
|
238
235
|
|
|
239
|
-
//
|
|
240
|
-
setImages({
|
|
236
|
+
//setActiveRetailer(product?.retailers[0]);
|
|
237
|
+
setImages({
|
|
238
|
+
action: "init",
|
|
239
|
+
init: services[2],
|
|
240
|
+
});
|
|
241
241
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
242
242
|
|
|
243
243
|
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
@@ -256,11 +256,10 @@ export const ProviderProductEdition = ({
|
|
|
256
256
|
}&end=true`
|
|
257
257
|
);
|
|
258
258
|
const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
|
|
259
|
-
const retailerResponse = parsedResponse?.map((srv) => srv.id_retailer);
|
|
260
259
|
let retailers = product.retailers || product.retailersAvailable;
|
|
261
|
-
let active = retailers?.
|
|
262
|
-
|
|
263
|
-
);
|
|
260
|
+
let active = retailers?.filter((retailer) =>
|
|
261
|
+
parsedResponse?.map((srv) => srv.id_retailer).includes(retailer.id)
|
|
262
|
+
)[0];
|
|
264
263
|
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
265
264
|
setServicesData(parsedResponse);
|
|
266
265
|
}
|
|
@@ -281,15 +280,15 @@ export const ProviderProductEdition = ({
|
|
|
281
280
|
if (revision && currentService === "AP") return true;
|
|
282
281
|
} else {
|
|
283
282
|
const { product } = productEdit;
|
|
284
|
-
|
|
285
|
-
orgn === "
|
|
286
|
-
(["
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
+
)
|
|
293
292
|
return true;
|
|
294
293
|
}
|
|
295
294
|
}
|
|
@@ -306,26 +305,26 @@ export const ProviderProductEdition = ({
|
|
|
306
305
|
setInCart(arr.some((e) => e.articleId === product.id_article));
|
|
307
306
|
};
|
|
308
307
|
|
|
309
|
-
useEffect(() => {
|
|
308
|
+
useEffect(async () => {
|
|
310
309
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
311
310
|
loadData();
|
|
312
311
|
getCart();
|
|
313
|
-
fetchUsers(token)
|
|
312
|
+
setUserGroups(await fetchUsers(token));
|
|
314
313
|
let arr = [];
|
|
315
|
-
// ?? Que sentido tiene verificar los roles de colaborador en la app de proveedor
|
|
316
314
|
switch (user.id_role) {
|
|
317
315
|
case 7:
|
|
318
316
|
case 8:
|
|
319
|
-
arr = ["
|
|
317
|
+
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
320
318
|
break;
|
|
321
319
|
case 4:
|
|
322
320
|
case 5:
|
|
323
|
-
arr = ["
|
|
321
|
+
arr = ["RF", "AF", "AA", "AP", "AC"];
|
|
324
322
|
break;
|
|
325
323
|
case 6:
|
|
326
|
-
arr = ["RP", "
|
|
324
|
+
arr = ["RP", "RC", "AF"];
|
|
327
325
|
break;
|
|
328
326
|
default:
|
|
327
|
+
arr = [];
|
|
329
328
|
break;
|
|
330
329
|
}
|
|
331
330
|
setStatusArray(arr);
|
|
@@ -343,9 +342,9 @@ export const ProviderProductEdition = ({
|
|
|
343
342
|
const productTemp = product;
|
|
344
343
|
const retailers = productTemp?.retailersAvailable || productTemp?.retailers;
|
|
345
344
|
retailers?.forEach((retailer) => {
|
|
346
|
-
retailer["percentage"] = percentages?.
|
|
345
|
+
retailer["percentage"] = percentages?.filter(
|
|
347
346
|
(percent) => retailer?.id === percent?.id_retailer
|
|
348
|
-
)?.percentage;
|
|
347
|
+
)[0]?.percentage;
|
|
349
348
|
});
|
|
350
349
|
|
|
351
350
|
setProduct(productTemp);
|
|
@@ -421,7 +420,7 @@ export const ProviderProductEdition = ({
|
|
|
421
420
|
};
|
|
422
421
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
423
422
|
try {
|
|
424
|
-
|
|
423
|
+
await axios.put(
|
|
425
424
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
|
|
426
425
|
dataObject,
|
|
427
426
|
{
|
|
@@ -430,10 +429,8 @@ export const ProviderProductEdition = ({
|
|
|
430
429
|
},
|
|
431
430
|
}
|
|
432
431
|
);
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
await loadData();
|
|
436
|
-
}
|
|
432
|
+
setMessage("Descripciones guardadas con éxito");
|
|
433
|
+
loadData();
|
|
437
434
|
} catch (error) {
|
|
438
435
|
console.log(error);
|
|
439
436
|
}
|
|
@@ -456,10 +453,8 @@ export const ProviderProductEdition = ({
|
|
|
456
453
|
},
|
|
457
454
|
}
|
|
458
455
|
);
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
await loadData();
|
|
462
|
-
}
|
|
456
|
+
setMessage("Fichas técnicas guardadas");
|
|
457
|
+
loadData();
|
|
463
458
|
} catch (error) {
|
|
464
459
|
console.log(error);
|
|
465
460
|
}
|
|
@@ -557,7 +552,7 @@ export const ProviderProductEdition = ({
|
|
|
557
552
|
return e;
|
|
558
553
|
});
|
|
559
554
|
try {
|
|
560
|
-
|
|
555
|
+
await axios.put(
|
|
561
556
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
|
|
562
557
|
dataImages,
|
|
563
558
|
{
|
|
@@ -566,11 +561,9 @@ export const ProviderProductEdition = ({
|
|
|
566
561
|
},
|
|
567
562
|
}
|
|
568
563
|
);
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
await loadData();
|
|
573
|
-
}
|
|
564
|
+
setMessage("Imágenes guardadas con éxito");
|
|
565
|
+
sessionStorage.removeItem("imagesList");
|
|
566
|
+
loadData();
|
|
574
567
|
} catch (error) {
|
|
575
568
|
console.log(error);
|
|
576
569
|
}
|
|
@@ -672,12 +665,12 @@ export const ProviderProductEdition = ({
|
|
|
672
665
|
},
|
|
673
666
|
],
|
|
674
667
|
concept: concept,
|
|
675
|
-
|
|
668
|
+
[`${assignationType}Id`]: assignationId,
|
|
676
669
|
};
|
|
677
|
-
|
|
670
|
+
axios({
|
|
678
671
|
method: "post",
|
|
679
672
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
680
|
-
data,
|
|
673
|
+
data: data,
|
|
681
674
|
headers: {
|
|
682
675
|
Authorization: token,
|
|
683
676
|
},
|
|
@@ -695,7 +688,7 @@ export const ProviderProductEdition = ({
|
|
|
695
688
|
serv = serv.filter((f) => f.id_retailer === activeRetailer.id);
|
|
696
689
|
}
|
|
697
690
|
const statusArray =
|
|
698
|
-
user.is_retailer === 1 ? ["
|
|
691
|
+
user.is_retailer === 1 ? ["AC", "RC"] : ["AP", "RP", "AC"];
|
|
699
692
|
return (
|
|
700
693
|
serv.length > 0 && serv.every((item) => statusArray.includes(item.status))
|
|
701
694
|
);
|
|
@@ -798,7 +791,7 @@ export const ProviderProductEdition = ({
|
|
|
798
791
|
const { datasheet_status, description_status, images_status } = product;
|
|
799
792
|
const completionStates =
|
|
800
793
|
user.is_retailer === 1
|
|
801
|
-
? ["
|
|
794
|
+
? ["AC", "Evaluated", "NS"]
|
|
802
795
|
: ["AP", "Evaluated", "NS"];
|
|
803
796
|
const dsEvaluated = completionStates.includes(datasheet_status);
|
|
804
797
|
const descsEvaluated = completionStates.includes(description_status);
|
|
@@ -811,66 +804,54 @@ export const ProviderProductEdition = ({
|
|
|
811
804
|
|
|
812
805
|
const sendEvaluation = async (result) => {
|
|
813
806
|
setLoading(true);
|
|
814
|
-
|
|
815
|
-
const productTemp = product;
|
|
816
|
-
const articleId = productTemp.id_article;
|
|
817
|
-
const orderId = productTemp.id_order ?? productTemp.orderId;
|
|
818
|
-
const evalStatus =
|
|
819
|
-
product[`${getConcept(activeTab)}_status`] || product?.version_status;
|
|
820
|
-
let data = { articleId, orderId, concept, evalStatus };
|
|
807
|
+
let data = {};
|
|
821
808
|
const retailerId = activeRetailer?.id;
|
|
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
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
productTemp.
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
861
|
-
const newProductEdit = {
|
|
862
|
-
ArticleId: articleId,
|
|
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,
|
|
863
847
|
idCategory: productTemp.article.id_category,
|
|
864
848
|
product: productTemp,
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
setOrigin((prev) => ({ ...prev, [concept]: status }));
|
|
869
|
-
await loadData();
|
|
870
|
-
}
|
|
871
|
-
} catch (err) {
|
|
872
|
-
console.log(err);
|
|
849
|
+
})
|
|
850
|
+
);
|
|
851
|
+
setOrigin((prev) => ({ ...prev, [concept]: "Evaluated" }));
|
|
873
852
|
}
|
|
853
|
+
loadData();
|
|
854
|
+
showSurvey && showSurvey(confirmStatusComplete());
|
|
874
855
|
};
|
|
875
856
|
|
|
876
857
|
const validateAll = async (result) => {
|
|
@@ -916,24 +897,13 @@ export const ProviderProductEdition = ({
|
|
|
916
897
|
|
|
917
898
|
await Promise.all(sendAll);
|
|
918
899
|
const productTemp = product;
|
|
919
|
-
productTemp.article_status = `${result}
|
|
900
|
+
productTemp.article_status = `${result}C`;
|
|
920
901
|
productTemp.datasheet_status =
|
|
921
|
-
productTemp.datasheet_status === "NA" ? "NA" : `${result}
|
|
902
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}C`;
|
|
922
903
|
productTemp.description_status =
|
|
923
|
-
productTemp.description_status === "NA" ? "NA" : `${result}
|
|
904
|
+
productTemp.description_status === "NA" ? "NA" : `${result}C`;
|
|
924
905
|
productTemp.images_status =
|
|
925
|
-
productTemp.images_status === "NA" ? "NA" : `${result}
|
|
926
|
-
|
|
927
|
-
const retailerStatusCopy = { ...retailerStatus };
|
|
928
|
-
Object.keys(retailerStatusCopy).forEach((key) => {
|
|
929
|
-
conceptArray.forEach((concept) => {
|
|
930
|
-
if (retailerStatusCopy[key][concept]) {
|
|
931
|
-
retailerStatusCopy[key][concept] = `${result}CA`;
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
});
|
|
935
|
-
setRetailerStatus(retailerStatusCopy);
|
|
936
|
-
productTemp.statusByRetailer = retailerStatusCopy;
|
|
906
|
+
productTemp.images_status === "NA" ? "NA" : `${result}C`;
|
|
937
907
|
setProduct(productTemp);
|
|
938
908
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
939
909
|
setProductEdit({
|
|
@@ -950,7 +920,7 @@ export const ProviderProductEdition = ({
|
|
|
950
920
|
})
|
|
951
921
|
);
|
|
952
922
|
|
|
953
|
-
|
|
923
|
+
loadData();
|
|
954
924
|
} catch (error) {
|
|
955
925
|
console.log(error);
|
|
956
926
|
}
|
|
@@ -971,7 +941,7 @@ export const ProviderProductEdition = ({
|
|
|
971
941
|
},
|
|
972
942
|
});
|
|
973
943
|
const prod = productEdit;
|
|
974
|
-
const statusComplete = user.is_retailer ? `${result}
|
|
944
|
+
const statusComplete = user.is_retailer ? `${result}C` : `${result}P`;
|
|
975
945
|
prod.product.datasheet_status = statusComplete;
|
|
976
946
|
prod.product.description_status = statusComplete;
|
|
977
947
|
prod.product.images_status = statusComplete;
|
|
@@ -980,22 +950,24 @@ export const ProviderProductEdition = ({
|
|
|
980
950
|
sessionStorage.setItem("productEdit", JSON.stringify(prod));
|
|
981
951
|
setProduct(prod);
|
|
982
952
|
setShowGenericModal && setShowGenericModal(false);
|
|
983
|
-
|
|
953
|
+
loadData();
|
|
984
954
|
};
|
|
985
955
|
|
|
986
956
|
const getSectionStatus = () => {
|
|
987
957
|
const concept = getConcept(activeTab);
|
|
988
|
-
return ["AA", "AP", "
|
|
958
|
+
return ["AA", "AP", "RECEIVED", "IN_PROGRESS", "RC"].includes(
|
|
989
959
|
productEdit.product[`${concept}_status`]
|
|
990
960
|
);
|
|
991
961
|
};
|
|
992
962
|
|
|
993
963
|
const enableActions = (versionStatus) => {
|
|
994
964
|
try {
|
|
995
|
-
|
|
965
|
+
const userIsRetailer = user.is_retailer;
|
|
966
|
+
|
|
967
|
+
if (userIsRetailer) return false;
|
|
996
968
|
|
|
997
969
|
if (versionStatus) {
|
|
998
|
-
return ["AP", "
|
|
970
|
+
return ["AP", "AC", "RC", null].includes(versionStatus);
|
|
999
971
|
}
|
|
1000
972
|
return true;
|
|
1001
973
|
} catch (err) {
|
|
@@ -1085,21 +1057,23 @@ export const ProviderProductEdition = ({
|
|
|
1085
1057
|
},
|
|
1086
1058
|
}));
|
|
1087
1059
|
setShowGenericModal(true);
|
|
1088
|
-
} else
|
|
1089
|
-
if (
|
|
1090
|
-
|
|
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
|
+
}
|
|
1091
1074
|
} else {
|
|
1092
|
-
|
|
1093
|
-
...prev,
|
|
1094
|
-
button2: {
|
|
1095
|
-
name: "Continuar",
|
|
1096
|
-
action: () => evaluationToRetailer("A"),
|
|
1097
|
-
},
|
|
1098
|
-
}));
|
|
1099
|
-
setShowGenericModal(true);
|
|
1075
|
+
validateAll("A");
|
|
1100
1076
|
}
|
|
1101
|
-
} else {
|
|
1102
|
-
validateAll("A");
|
|
1103
1077
|
}
|
|
1104
1078
|
}}
|
|
1105
1079
|
rejectAll={() => {
|
|
@@ -1109,23 +1083,25 @@ export const ProviderProductEdition = ({
|
|
|
1109
1083
|
(!product.id_order || !product.orderId)
|
|
1110
1084
|
) {
|
|
1111
1085
|
return;
|
|
1112
|
-
} else
|
|
1113
|
-
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 {
|
|
1114
1102
|
validateAll("R");
|
|
1115
1103
|
setModalViewError(true);
|
|
1116
|
-
} else {
|
|
1117
|
-
setDataGenericModal((prev) => ({
|
|
1118
|
-
...prev,
|
|
1119
|
-
button2: {
|
|
1120
|
-
name: "Continuar",
|
|
1121
|
-
action: () => evaluationToRetailer("R"),
|
|
1122
|
-
},
|
|
1123
|
-
}));
|
|
1124
|
-
setShowGenericModal(true);
|
|
1125
1104
|
}
|
|
1126
|
-
} else {
|
|
1127
|
-
validateAll("R");
|
|
1128
|
-
setModalViewError(true);
|
|
1129
1105
|
}
|
|
1130
1106
|
}}
|
|
1131
1107
|
approve={() => {
|
|
@@ -1142,21 +1118,23 @@ export const ProviderProductEdition = ({
|
|
|
1142
1118
|
},
|
|
1143
1119
|
}));
|
|
1144
1120
|
setShowGenericModal(true);
|
|
1145
|
-
} else
|
|
1146
|
-
if (
|
|
1147
|
-
|
|
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
|
+
}
|
|
1148
1135
|
} else {
|
|
1149
|
-
|
|
1150
|
-
...prev,
|
|
1151
|
-
button2: {
|
|
1152
|
-
name: "Continuar",
|
|
1153
|
-
action: () => evaluationToRetailer("A"),
|
|
1154
|
-
},
|
|
1155
|
-
}));
|
|
1156
|
-
setShowGenericModal(true);
|
|
1136
|
+
sendEvaluation("A");
|
|
1157
1137
|
}
|
|
1158
|
-
} else {
|
|
1159
|
-
sendEvaluation("A");
|
|
1160
1138
|
}
|
|
1161
1139
|
}}
|
|
1162
1140
|
reject={() => {
|
|
@@ -1166,33 +1144,33 @@ export const ProviderProductEdition = ({
|
|
|
1166
1144
|
(!product.id_order || !product.orderId)
|
|
1167
1145
|
) {
|
|
1168
1146
|
return;
|
|
1169
|
-
} else
|
|
1170
|
-
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 {
|
|
1171
1163
|
sendEvaluation("R");
|
|
1172
1164
|
setModalViewError(true);
|
|
1173
|
-
} else {
|
|
1174
|
-
setDataGenericModal((prev) => ({
|
|
1175
|
-
...prev,
|
|
1176
|
-
button2: {
|
|
1177
|
-
name: "Continuar",
|
|
1178
|
-
action: () => evaluationToRetailer("R"),
|
|
1179
|
-
},
|
|
1180
|
-
}));
|
|
1181
|
-
setShowGenericModal(true);
|
|
1182
1165
|
}
|
|
1183
|
-
} else {
|
|
1184
|
-
sendEvaluation("R");
|
|
1185
|
-
setModalViewError(true);
|
|
1186
1166
|
}
|
|
1187
1167
|
}}
|
|
1188
1168
|
/>
|
|
1189
1169
|
<FullTabsMenu
|
|
1190
1170
|
tabsSections={tabsSections}
|
|
1191
1171
|
status={
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
"NS"
|
|
1195
|
-
: "-"
|
|
1172
|
+
product[`${getConcept(activeTab)}_status`] ||
|
|
1173
|
+
product?.version_status
|
|
1196
1174
|
}
|
|
1197
1175
|
activeTab={activeTab}
|
|
1198
1176
|
setActiveTab={setActiveTab}
|
|
@@ -1335,44 +1313,56 @@ export const ProviderProductEdition = ({
|
|
|
1335
1313
|
/>
|
|
1336
1314
|
</div>
|
|
1337
1315
|
)}
|
|
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
|
+
/>
|
|
1338
1330
|
</div>
|
|
1339
|
-
) : (
|
|
1340
|
-
|
|
1341
|
-
<div
|
|
1342
|
-
<
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
</p>
|
|
1348
|
-
</div>
|
|
1349
|
-
{inCart ? (
|
|
1350
|
-
<button type="button">
|
|
1351
|
-
<Link to="/checkout">
|
|
1352
|
-
<p>Articulo en carrito</p>
|
|
1353
|
-
<p>Ir a checkout</p>
|
|
1354
|
-
</Link>
|
|
1355
|
-
</button>
|
|
1356
|
-
) : (
|
|
1357
|
-
<>
|
|
1358
|
-
<SliderToolTip
|
|
1359
|
-
infoIcon={InfoIcon}
|
|
1360
|
-
slidefront={slidefront}
|
|
1361
|
-
iconSize={"big-image"}
|
|
1362
|
-
slidePosition={"top-slide"}
|
|
1363
|
-
/>
|
|
1364
|
-
<Button
|
|
1365
|
-
onClick={() => {
|
|
1366
|
-
setShowContentohRequestModal &&
|
|
1367
|
-
setShowContentohRequestModal(true);
|
|
1368
|
-
}}
|
|
1369
|
-
buttonType="general-default-button"
|
|
1370
|
-
label="Enviar a Content-oh!"
|
|
1371
|
-
/>
|
|
1372
|
-
</>
|
|
1373
|
-
)}
|
|
1331
|
+
) : revision ? null : (
|
|
1332
|
+
<div className="required-inputs-message">
|
|
1333
|
+
<div>
|
|
1334
|
+
<p>
|
|
1335
|
+
Los atributos son requeridos por las plataformas de las
|
|
1336
|
+
cadenas, es muy importante completar los campos requeridos ya
|
|
1337
|
+
que pueden rechazar el producto por falta de información.
|
|
1338
|
+
</p>
|
|
1374
1339
|
</div>
|
|
1375
|
-
|
|
1340
|
+
{inCart ? (
|
|
1341
|
+
<button type="button">
|
|
1342
|
+
<Link to="/checkout">
|
|
1343
|
+
<p>Articulo en carrito</p>
|
|
1344
|
+
<p>Ir a checkout</p>
|
|
1345
|
+
</Link>
|
|
1346
|
+
</button>
|
|
1347
|
+
) : (
|
|
1348
|
+
<>
|
|
1349
|
+
<SliderToolTip
|
|
1350
|
+
infoIcon={InfoIcon}
|
|
1351
|
+
slidefront={slidefront}
|
|
1352
|
+
iconSize={"big-image"}
|
|
1353
|
+
slidePosition={"top-slide"}
|
|
1354
|
+
></SliderToolTip>
|
|
1355
|
+
<Button
|
|
1356
|
+
onClick={() => {
|
|
1357
|
+
setShowContentohRequestModal &&
|
|
1358
|
+
setShowContentohRequestModal(true);
|
|
1359
|
+
}}
|
|
1360
|
+
buttonType="general-default-button"
|
|
1361
|
+
label="Enviar a Content-oh!"
|
|
1362
|
+
/>
|
|
1363
|
+
</>
|
|
1364
|
+
)}
|
|
1365
|
+
</div>
|
|
1376
1366
|
)}
|
|
1377
1367
|
</div>
|
|
1378
1368
|
</div>
|
|
@@ -1451,4 +1441,4 @@ export const ProviderProductEdition = ({
|
|
|
1451
1441
|
)}
|
|
1452
1442
|
</Container>
|
|
1453
1443
|
);
|
|
1454
|
-
};
|
|
1444
|
+
};
|