contentoh-components-library 21.1.59 → 21.1.62
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 +0 -1
- package/dist/components/atoms/InputFormatter/index.js +3 -3
- package/dist/components/molecules/HeaderTop/index.js +4 -1
- package/dist/components/molecules/RetailerSelector/index.js +31 -0
- package/dist/components/molecules/StatusAsignationInfo/index.js +3 -2
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
- package/dist/components/organisms/FullTabsMenu/index.js +3 -1
- package/dist/components/organisms/ImageDataTable/index.js +3 -6
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +115 -65
- package/dist/components/pages/ProviderProductEdition/index.js +333 -382
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +63 -110
- package/dist/components/pages/RetailerProductEdition/index.js +217 -225
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/global-files/data.js +9 -10
- package/dist/index.js +13 -0
- package/package.json +1 -1
- package/src/components/atoms/GeneralInput/index.js +0 -1
- package/src/components/atoms/InputFormatter/index.js +6 -3
- package/src/components/molecules/HeaderTop/index.js +6 -1
- package/src/components/molecules/RetailerSelector/index.js +12 -0
- package/src/components/molecules/StatusAsignationInfo/index.js +3 -2
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/FullTabsMenu/index.js +2 -0
- package/src/components/organisms/ImageDataTable/index.js +2 -5
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +133 -71
- package/src/components/pages/ProviderProductEdition/index.js +208 -222
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +59 -111
- package/src/components/pages/RetailerProductEdition/index.js +173 -148
- package/src/components/pages/RetailerProductEdition/styles.js +1 -1
- package/src/global-files/data.js +9 -10
- package/src/index.js +1 -0
- package/src/components/atoms/StatusTag/StatusTag.stories.js +0 -28
|
@@ -177,7 +177,6 @@ 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");
|
|
181
180
|
|
|
182
181
|
const originProp = location?.state?.origin;
|
|
183
182
|
const [origin, setOrigin] = useState({
|
|
@@ -209,9 +208,6 @@ export const ProviderProductEdition = ({
|
|
|
209
208
|
const [modalViewTextArea, setModalViewTextArea] = useState(false);
|
|
210
209
|
const [socketType, setSocketType] = useState(null);
|
|
211
210
|
const [saving, setSaving] = useState(loading);
|
|
212
|
-
const [retailerStatus, setRetailerStatus] = useState(
|
|
213
|
-
product.statusByRetailer
|
|
214
|
-
);
|
|
215
211
|
|
|
216
212
|
useEffect(() => {
|
|
217
213
|
checkAll && setSelectedImages(images.values);
|
|
@@ -237,8 +233,11 @@ export const ProviderProductEdition = ({
|
|
|
237
233
|
);
|
|
238
234
|
}
|
|
239
235
|
|
|
240
|
-
//
|
|
241
|
-
setImages({
|
|
236
|
+
//setActiveRetailer(product?.retailers[0]);
|
|
237
|
+
setImages({
|
|
238
|
+
action: "init",
|
|
239
|
+
init: services[2],
|
|
240
|
+
});
|
|
242
241
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
243
242
|
|
|
244
243
|
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
@@ -257,11 +256,10 @@ export const ProviderProductEdition = ({
|
|
|
257
256
|
}&end=true`
|
|
258
257
|
);
|
|
259
258
|
const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
|
|
260
|
-
const retailerResponse = parsedResponse?.map((srv) => srv.id_retailer);
|
|
261
259
|
let retailers = product.retailers || product.retailersAvailable;
|
|
262
|
-
let active = retailers?.
|
|
263
|
-
|
|
264
|
-
);
|
|
260
|
+
let active = retailers?.filter((retailer) =>
|
|
261
|
+
parsedResponse?.map((srv) => srv.id_retailer).includes(retailer.id)
|
|
262
|
+
)[0];
|
|
265
263
|
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
266
264
|
setServicesData(parsedResponse);
|
|
267
265
|
}
|
|
@@ -282,15 +280,15 @@ export const ProviderProductEdition = ({
|
|
|
282
280
|
if (revision && currentService === "AP") return true;
|
|
283
281
|
} else {
|
|
284
282
|
const { product } = productEdit;
|
|
285
|
-
|
|
286
|
-
orgn === "
|
|
287
|
-
(["
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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
|
+
)
|
|
294
292
|
return true;
|
|
295
293
|
}
|
|
296
294
|
}
|
|
@@ -307,26 +305,26 @@ export const ProviderProductEdition = ({
|
|
|
307
305
|
setInCart(arr.some((e) => e.articleId === product.id_article));
|
|
308
306
|
};
|
|
309
307
|
|
|
310
|
-
useEffect(() => {
|
|
308
|
+
useEffect(async () => {
|
|
311
309
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
312
310
|
loadData();
|
|
313
311
|
getCart();
|
|
314
|
-
fetchUsers(token)
|
|
312
|
+
setUserGroups(await fetchUsers(token));
|
|
315
313
|
let arr = [];
|
|
316
|
-
// ?? Que sentido tiene verificar los roles de colaborador en la app de proveedor
|
|
317
314
|
switch (user.id_role) {
|
|
318
315
|
case 7:
|
|
319
316
|
case 8:
|
|
320
|
-
arr = ["
|
|
317
|
+
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
321
318
|
break;
|
|
322
319
|
case 4:
|
|
323
320
|
case 5:
|
|
324
|
-
arr = ["
|
|
321
|
+
arr = ["RF", "AF", "AA", "AP", "AC"];
|
|
325
322
|
break;
|
|
326
323
|
case 6:
|
|
327
|
-
arr = ["RP", "
|
|
324
|
+
arr = ["RP", "RC", "AF"];
|
|
328
325
|
break;
|
|
329
326
|
default:
|
|
327
|
+
arr = [];
|
|
330
328
|
break;
|
|
331
329
|
}
|
|
332
330
|
setStatusArray(arr);
|
|
@@ -344,9 +342,9 @@ export const ProviderProductEdition = ({
|
|
|
344
342
|
const productTemp = product;
|
|
345
343
|
const retailers = productTemp?.retailersAvailable || productTemp?.retailers;
|
|
346
344
|
retailers?.forEach((retailer) => {
|
|
347
|
-
retailer["percentage"] = percentages?.
|
|
345
|
+
retailer["percentage"] = percentages?.filter(
|
|
348
346
|
(percent) => retailer?.id === percent?.id_retailer
|
|
349
|
-
)?.percentage;
|
|
347
|
+
)[0]?.percentage;
|
|
350
348
|
});
|
|
351
349
|
|
|
352
350
|
setProduct(productTemp);
|
|
@@ -422,7 +420,7 @@ export const ProviderProductEdition = ({
|
|
|
422
420
|
};
|
|
423
421
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
424
422
|
try {
|
|
425
|
-
|
|
423
|
+
await axios.put(
|
|
426
424
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
|
|
427
425
|
dataObject,
|
|
428
426
|
{
|
|
@@ -431,10 +429,8 @@ export const ProviderProductEdition = ({
|
|
|
431
429
|
},
|
|
432
430
|
}
|
|
433
431
|
);
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
await loadData();
|
|
437
|
-
}
|
|
432
|
+
setMessage("Descripciones guardadas con éxito");
|
|
433
|
+
loadData();
|
|
438
434
|
} catch (error) {
|
|
439
435
|
console.log(error);
|
|
440
436
|
}
|
|
@@ -457,10 +453,8 @@ export const ProviderProductEdition = ({
|
|
|
457
453
|
},
|
|
458
454
|
}
|
|
459
455
|
);
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
await loadData();
|
|
463
|
-
}
|
|
456
|
+
setMessage("Fichas técnicas guardadas");
|
|
457
|
+
loadData();
|
|
464
458
|
} catch (error) {
|
|
465
459
|
console.log(error);
|
|
466
460
|
}
|
|
@@ -558,7 +552,7 @@ export const ProviderProductEdition = ({
|
|
|
558
552
|
return e;
|
|
559
553
|
});
|
|
560
554
|
try {
|
|
561
|
-
|
|
555
|
+
await axios.put(
|
|
562
556
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
|
|
563
557
|
dataImages,
|
|
564
558
|
{
|
|
@@ -567,11 +561,9 @@ export const ProviderProductEdition = ({
|
|
|
567
561
|
},
|
|
568
562
|
}
|
|
569
563
|
);
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
await loadData();
|
|
574
|
-
}
|
|
564
|
+
setMessage("Imágenes guardadas con éxito");
|
|
565
|
+
sessionStorage.removeItem("imagesList");
|
|
566
|
+
loadData();
|
|
575
567
|
} catch (error) {
|
|
576
568
|
console.log(error);
|
|
577
569
|
}
|
|
@@ -673,12 +665,12 @@ export const ProviderProductEdition = ({
|
|
|
673
665
|
},
|
|
674
666
|
],
|
|
675
667
|
concept: concept,
|
|
676
|
-
|
|
668
|
+
[`${assignationType}Id`]: assignationId,
|
|
677
669
|
};
|
|
678
|
-
|
|
670
|
+
axios({
|
|
679
671
|
method: "post",
|
|
680
672
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
681
|
-
data,
|
|
673
|
+
data: data,
|
|
682
674
|
headers: {
|
|
683
675
|
Authorization: token,
|
|
684
676
|
},
|
|
@@ -696,7 +688,7 @@ export const ProviderProductEdition = ({
|
|
|
696
688
|
serv = serv.filter((f) => f.id_retailer === activeRetailer.id);
|
|
697
689
|
}
|
|
698
690
|
const statusArray =
|
|
699
|
-
user.is_retailer === 1 ? ["
|
|
691
|
+
user.is_retailer === 1 ? ["AC", "RC"] : ["AP", "RP", "AC"];
|
|
700
692
|
return (
|
|
701
693
|
serv.length > 0 && serv.every((item) => statusArray.includes(item.status))
|
|
702
694
|
);
|
|
@@ -799,7 +791,7 @@ export const ProviderProductEdition = ({
|
|
|
799
791
|
const { datasheet_status, description_status, images_status } = product;
|
|
800
792
|
const completionStates =
|
|
801
793
|
user.is_retailer === 1
|
|
802
|
-
? ["
|
|
794
|
+
? ["AC", "Evaluated", "NS"]
|
|
803
795
|
: ["AP", "Evaluated", "NS"];
|
|
804
796
|
const dsEvaluated = completionStates.includes(datasheet_status);
|
|
805
797
|
const descsEvaluated = completionStates.includes(description_status);
|
|
@@ -812,69 +804,54 @@ export const ProviderProductEdition = ({
|
|
|
812
804
|
|
|
813
805
|
const sendEvaluation = async (result) => {
|
|
814
806
|
setLoading(true);
|
|
815
|
-
|
|
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 };
|
|
807
|
+
let data = {};
|
|
822
808
|
const retailerId = activeRetailer?.id;
|
|
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
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
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);
|
|
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,
|
|
847
|
+
idCategory: productTemp.article.id_category,
|
|
848
|
+
product: productTemp,
|
|
849
|
+
})
|
|
850
|
+
);
|
|
851
|
+
setOrigin((prev) => ({ ...prev, [concept]: "Evaluated" }));
|
|
876
852
|
}
|
|
877
853
|
loadData();
|
|
854
|
+
showSurvey && showSurvey(confirmStatusComplete());
|
|
878
855
|
};
|
|
879
856
|
|
|
880
857
|
const validateAll = async (result) => {
|
|
@@ -920,24 +897,13 @@ export const ProviderProductEdition = ({
|
|
|
920
897
|
|
|
921
898
|
await Promise.all(sendAll);
|
|
922
899
|
const productTemp = product;
|
|
923
|
-
productTemp.article_status = `${result}
|
|
900
|
+
productTemp.article_status = `${result}C`;
|
|
924
901
|
productTemp.datasheet_status =
|
|
925
|
-
productTemp.datasheet_status === "NA" ? "NA" : `${result}
|
|
902
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}C`;
|
|
926
903
|
productTemp.description_status =
|
|
927
|
-
productTemp.description_status === "NA" ? "NA" : `${result}
|
|
904
|
+
productTemp.description_status === "NA" ? "NA" : `${result}C`;
|
|
928
905
|
productTemp.images_status =
|
|
929
|
-
productTemp.images_status === "NA" ? "NA" : `${result}
|
|
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;
|
|
906
|
+
productTemp.images_status === "NA" ? "NA" : `${result}C`;
|
|
941
907
|
setProduct(productTemp);
|
|
942
908
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
943
909
|
setProductEdit({
|
|
@@ -954,7 +920,7 @@ export const ProviderProductEdition = ({
|
|
|
954
920
|
})
|
|
955
921
|
);
|
|
956
922
|
|
|
957
|
-
|
|
923
|
+
loadData();
|
|
958
924
|
} catch (error) {
|
|
959
925
|
console.log(error);
|
|
960
926
|
}
|
|
@@ -975,7 +941,7 @@ export const ProviderProductEdition = ({
|
|
|
975
941
|
},
|
|
976
942
|
});
|
|
977
943
|
const prod = productEdit;
|
|
978
|
-
const statusComplete = user.is_retailer ? `${result}
|
|
944
|
+
const statusComplete = user.is_retailer ? `${result}C` : `${result}P`;
|
|
979
945
|
prod.product.datasheet_status = statusComplete;
|
|
980
946
|
prod.product.description_status = statusComplete;
|
|
981
947
|
prod.product.images_status = statusComplete;
|
|
@@ -984,22 +950,24 @@ export const ProviderProductEdition = ({
|
|
|
984
950
|
sessionStorage.setItem("productEdit", JSON.stringify(prod));
|
|
985
951
|
setProduct(prod);
|
|
986
952
|
setShowGenericModal && setShowGenericModal(false);
|
|
987
|
-
|
|
953
|
+
loadData();
|
|
988
954
|
};
|
|
989
955
|
|
|
990
956
|
const getSectionStatus = () => {
|
|
991
957
|
const concept = getConcept(activeTab);
|
|
992
|
-
return ["AA", "AP", "
|
|
958
|
+
return ["AA", "AP", "RECEIVED", "IN_PROGRESS", "RC"].includes(
|
|
993
959
|
productEdit.product[`${concept}_status`]
|
|
994
960
|
);
|
|
995
961
|
};
|
|
996
962
|
|
|
997
963
|
const enableActions = (versionStatus) => {
|
|
998
964
|
try {
|
|
999
|
-
|
|
965
|
+
const userIsRetailer = user.is_retailer;
|
|
966
|
+
|
|
967
|
+
if (userIsRetailer) return false;
|
|
1000
968
|
|
|
1001
969
|
if (versionStatus) {
|
|
1002
|
-
return ["AP", "
|
|
970
|
+
return ["AP", "AC", "RC", null].includes(versionStatus);
|
|
1003
971
|
}
|
|
1004
972
|
return true;
|
|
1005
973
|
} catch (err) {
|
|
@@ -1089,21 +1057,23 @@ export const ProviderProductEdition = ({
|
|
|
1089
1057
|
},
|
|
1090
1058
|
}));
|
|
1091
1059
|
setShowGenericModal(true);
|
|
1092
|
-
} else
|
|
1093
|
-
if (
|
|
1094
|
-
|
|
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
|
+
}
|
|
1095
1074
|
} else {
|
|
1096
|
-
|
|
1097
|
-
...prev,
|
|
1098
|
-
button2: {
|
|
1099
|
-
name: "Continuar",
|
|
1100
|
-
action: () => evaluationToRetailer("A"),
|
|
1101
|
-
},
|
|
1102
|
-
}));
|
|
1103
|
-
setShowGenericModal(true);
|
|
1075
|
+
validateAll("A");
|
|
1104
1076
|
}
|
|
1105
|
-
} else {
|
|
1106
|
-
validateAll("A");
|
|
1107
1077
|
}
|
|
1108
1078
|
}}
|
|
1109
1079
|
rejectAll={() => {
|
|
@@ -1113,23 +1083,25 @@ export const ProviderProductEdition = ({
|
|
|
1113
1083
|
(!product.id_order || !product.orderId)
|
|
1114
1084
|
) {
|
|
1115
1085
|
return;
|
|
1116
|
-
} else
|
|
1117
|
-
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 {
|
|
1118
1102
|
validateAll("R");
|
|
1119
1103
|
setModalViewError(true);
|
|
1120
|
-
} else {
|
|
1121
|
-
setDataGenericModal((prev) => ({
|
|
1122
|
-
...prev,
|
|
1123
|
-
button2: {
|
|
1124
|
-
name: "Continuar",
|
|
1125
|
-
action: () => evaluationToRetailer("R"),
|
|
1126
|
-
},
|
|
1127
|
-
}));
|
|
1128
|
-
setShowGenericModal(true);
|
|
1129
1104
|
}
|
|
1130
|
-
} else {
|
|
1131
|
-
validateAll("R");
|
|
1132
|
-
setModalViewError(true);
|
|
1133
1105
|
}
|
|
1134
1106
|
}}
|
|
1135
1107
|
approve={() => {
|
|
@@ -1146,21 +1118,23 @@ export const ProviderProductEdition = ({
|
|
|
1146
1118
|
},
|
|
1147
1119
|
}));
|
|
1148
1120
|
setShowGenericModal(true);
|
|
1149
|
-
} else
|
|
1150
|
-
if (
|
|
1151
|
-
|
|
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
|
+
}
|
|
1152
1135
|
} else {
|
|
1153
|
-
|
|
1154
|
-
...prev,
|
|
1155
|
-
button2: {
|
|
1156
|
-
name: "Continuar",
|
|
1157
|
-
action: () => evaluationToRetailer("A"),
|
|
1158
|
-
},
|
|
1159
|
-
}));
|
|
1160
|
-
setShowGenericModal(true);
|
|
1136
|
+
sendEvaluation("A");
|
|
1161
1137
|
}
|
|
1162
|
-
} else {
|
|
1163
|
-
sendEvaluation("A");
|
|
1164
1138
|
}
|
|
1165
1139
|
}}
|
|
1166
1140
|
reject={() => {
|
|
@@ -1170,33 +1144,33 @@ export const ProviderProductEdition = ({
|
|
|
1170
1144
|
(!product.id_order || !product.orderId)
|
|
1171
1145
|
) {
|
|
1172
1146
|
return;
|
|
1173
|
-
} else
|
|
1174
|
-
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 {
|
|
1175
1163
|
sendEvaluation("R");
|
|
1176
1164
|
setModalViewError(true);
|
|
1177
|
-
} else {
|
|
1178
|
-
setDataGenericModal((prev) => ({
|
|
1179
|
-
...prev,
|
|
1180
|
-
button2: {
|
|
1181
|
-
name: "Continuar",
|
|
1182
|
-
action: () => evaluationToRetailer("R"),
|
|
1183
|
-
},
|
|
1184
|
-
}));
|
|
1185
|
-
setShowGenericModal(true);
|
|
1186
1165
|
}
|
|
1187
|
-
} else {
|
|
1188
|
-
sendEvaluation("R");
|
|
1189
|
-
setModalViewError(true);
|
|
1190
1166
|
}
|
|
1191
1167
|
}}
|
|
1192
1168
|
/>
|
|
1193
1169
|
<FullTabsMenu
|
|
1194
1170
|
tabsSections={tabsSections}
|
|
1195
1171
|
status={
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
"NS"
|
|
1199
|
-
: "-"
|
|
1172
|
+
product[`${getConcept(activeTab)}_status`] ||
|
|
1173
|
+
product?.version_status
|
|
1200
1174
|
}
|
|
1201
1175
|
activeTab={activeTab}
|
|
1202
1176
|
setActiveTab={setActiveTab}
|
|
@@ -1339,44 +1313,56 @@ export const ProviderProductEdition = ({
|
|
|
1339
1313
|
/>
|
|
1340
1314
|
</div>
|
|
1341
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
|
+
/>
|
|
1342
1330
|
</div>
|
|
1343
|
-
) : (
|
|
1344
|
-
|
|
1345
|
-
<div
|
|
1346
|
-
<
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
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
|
-
)}
|
|
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>
|
|
1378
1339
|
</div>
|
|
1379
|
-
|
|
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>
|
|
1380
1366
|
)}
|
|
1381
1367
|
</div>
|
|
1382
1368
|
</div>
|