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