contentoh-components-library 21.1.31 → 21.1.32
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/Commentary/styles.js +1 -1
- package/dist/components/atoms/GeneralInput/styles.js +3 -3
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/atoms/SliderToolTip/index.js +14 -9
- package/dist/components/atoms/SliderToolTip/styles.js +1 -1
- package/dist/components/atoms/StatusTag/index.js +2 -17
- 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 +103 -105
- package/dist/components/pages/ProviderProductEdition/index.js +349 -323
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +83 -38
- package/dist/components/pages/RetailerProductEdition/index.js +207 -196
- package/dist/global-files/data.js +10 -9
- package/package.json +1 -1
- package/src/components/atoms/Commentary/styles.js +2 -2
- package/src/components/atoms/GeneralInput/styles.js +5 -5
- package/src/components/atoms/InputFormatter/styles.js +3 -3
- package/src/components/atoms/SliderToolTip/index.js +20 -13
- package/src/components/atoms/SliderToolTip/styles.js +20 -24
- package/src/components/atoms/StatusTag/index.js +2 -12
- 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 +103 -117
- package/src/components/pages/ProviderProductEdition/index.js +165 -171
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +82 -33
- package/src/components/pages/RetailerProductEdition/index.js +137 -165
- package/src/global-files/data.js +10 -9
- package/dist/assets/fonts/avenirnext/AvenirNextLTPro-Bold.otf +0 -0
- package/dist/assets/fonts/avenirnext/AvenirNextLTPro-It.otf +0 -0
- package/dist/assets/fonts/avenirnext/AvenirNextLTPro-Regular.otf +0 -0
- package/dist/assets/fonts/lato/Lato-Bold.ttf +0 -0
- package/dist/assets/fonts/lato/Lato-Italic.ttf +0 -0
- package/dist/assets/fonts/lato/Lato-Light.ttf +0 -0
- package/dist/assets/fonts/lato/Lato-Regular.ttf +0 -0
- package/dist/assets/fonts/lato/Lato-Thin.ttf +0 -0
- package/dist/assets/fonts/lato/OFL.txt +0 -93
- package/dist/assets/fonts/raleway/Raleway-Black.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-Bold.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-ExtraBold.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-Italic.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-Medium.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-Regular.ttf +0 -0
- package/dist/assets/fonts/raleway/Raleway-SemiBold.ttf +0 -0
- package/dist/assets/images/activedFilter/removeFilter.svg +0 -3
- package/dist/assets/images/arrow/arrowIcon.svg +0 -3
- package/dist/assets/images/arrow/polygon.svg +0 -3
- package/dist/assets/images/asignationOptions/availableIcon.svg +0 -3
- package/dist/assets/images/asignationOptions/removeAsigned.svg +0 -4
- package/dist/assets/images/asignationOptions/requestToProvider.svg +0 -3
- package/dist/assets/images/asignationOptions/requestToTeam.svg +0 -3
- package/dist/assets/images/card/masterCardIcon.svg +0 -5
- package/dist/assets/images/carouselImagesLogin/login2.svg +0 -117
- package/dist/assets/images/carouselImagesLogin/login3.svg +0 -147
- package/dist/assets/images/carouselImagesLogin/loginImage.svg +0 -301
- package/dist/assets/images/checkBox/checked.svg +0 -3
- package/dist/assets/images/checkBox/unchecked.svg +0 -3
- package/dist/assets/images/componentAssigned/assignedImage1.svg +0 -9
- package/dist/assets/images/componentAssigned/assignedImage2.svg +0 -9
- package/dist/assets/images/componentAssigned/clock.svg +0 -4
- package/dist/assets/images/componentAssigned/flag.svg +0 -3
- package/dist/assets/images/defaultImages/defaultProductImage.png +0 -0
- package/dist/assets/images/defaultImages/defaultProfileImage.svg +0 -13
- package/dist/assets/images/defaultImages/defaultUpdate.png +0 -0
- package/dist/assets/images/dropDownButton/dropDownArrowButton.svg +0 -3
- package/dist/assets/images/editField/editField.svg +0 -3
- package/dist/assets/images/editField/showPassword.png +0 -0
- package/dist/assets/images/flags/highPriority.svg +0 -3
- package/dist/assets/images/flags/lowPriority.svg +0 -3
- package/dist/assets/images/flags/mediumPriority.svg +0 -3
- package/dist/assets/images/flags/noPriority.svg +0 -3
- package/dist/assets/images/generalButton/acceptIcon.svg +0 -3
- package/dist/assets/images/generalButton/closeIcon.svg +0 -4
- package/dist/assets/images/generalButton/deleteIcon.svg +0 -13
- package/dist/assets/images/generalButton/deleteIconHover.svg +0 -13
- package/dist/assets/images/generalButton/downloadIcon.svg +0 -3
- package/dist/assets/images/generalButton/gridLayout.svg +0 -3
- package/dist/assets/images/generalButton/nullIcon.svg +0 -3
- package/dist/assets/images/generalButton/openModal.svg +0 -3
- package/dist/assets/images/generalButton/rejectIcon.svg +0 -3
- package/dist/assets/images/generalButton/rowLayout.svg +0 -3
- package/dist/assets/images/generalButton/saveIcon.svg +0 -3
- package/dist/assets/images/generalButton/saveIconHover.svg +0 -3
- package/dist/assets/images/generalImage/assigned.svg +0 -14
- package/dist/assets/images/generalImage/bags.svg +0 -25
- package/dist/assets/images/generalImage/clock.svg +0 -4
- package/dist/assets/images/generalImage/flag.svg +0 -3
- package/dist/assets/images/genericModal/closeWhite.svg +0 -3
- package/dist/assets/images/genericModal/errorModal.svg +0 -3
- package/dist/assets/images/genericModal/genericModalCheck.svg +0 -3
- package/dist/assets/images/genericModal/genericModalClose.svg +0 -3
- package/dist/assets/images/genericModal/genericModalDown.svg +0 -3
- package/dist/assets/images/genericModal/genericModalUp.svg +0 -3
- package/dist/assets/images/genericModal/genericModalWarning.svg +0 -12
- package/dist/assets/images/genericModal/yellowAlert.svg +0 -12
- package/dist/assets/images/logo/logoLogin.svg +0 -15
- package/dist/assets/images/menuNotification/menuNotificationComment.svg +0 -3
- package/dist/assets/images/menuNotification/menuNotificationProduct.svg +0 -3
- package/dist/assets/images/menuProfile/logOut.svg +0 -3
- package/dist/assets/images/menuProfile/myAccount.svg +0 -3
- package/dist/assets/images/menuProfile/settings.svg +0 -3
- package/dist/assets/images/modalsSVGs/attributesSent.svg +0 -208
- package/dist/assets/images/modalsSVGs/descriptionSent.svg +0 -237
- package/dist/assets/images/modalsSVGs/providerSent.svg +0 -445
- package/dist/assets/images/modalsSVGs/uploadingImages.svg +0 -148
- package/dist/assets/images/productImage/openModal.svg +0 -3
- package/dist/assets/images/productNotification/productNotification.svg +0 -3
- package/dist/assets/images/profileHeader/profilePicture.svg +0 -9
- package/dist/assets/images/providerAndCadena/Cadena.svg +0 -188
- package/dist/assets/images/providerAndCadena/LoginContentoh.svg +0 -15
- package/dist/assets/images/providerAndCadena/Proveedor.svg +0 -231
- package/dist/assets/images/sideMenuButton/contenoh.svg +0 -5
- package/dist/assets/images/sideMenuButton/dashboard.svg +0 -5
- package/dist/assets/images/sideMenuButton/products.svg +0 -10
- package/dist/assets/images/sideMenuButton/providers.svg +0 -10
- package/dist/assets/images/sideMenuButton/tasks.svg +0 -3
- package/dist/assets/images/sliderToolTip/infoIcon.svg +0 -4
- package/dist/assets/images/sliderToolTip/slide1.svg +0 -5
- package/dist/assets/images/sliderToolTip/slide2.svg +0 -9
- 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
- package/dist/assets/images/sliderToolTip/slide3.svg +0 -9
- package/dist/assets/images/sliderToolTip/slide4.svg +0 -9
- package/dist/assets/images/sliderToolTip/slide5.svg +0 -40
- package/dist/assets/images/verticalSideMenuMainPage/closeMenu.svg +0 -4
- package/dist/assets/images/verticalSideMenuMainPage/iconFAQS.svg +0 -12
- package/dist/assets/images/verticalSideMenuMainPage/iconGroup.svg +0 -3
- package/dist/assets/images/verticalSideMenuMainPage/iconLogo.svg +0 -12
- package/dist/assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg +0 -15
- package/dist/assets/images/verticalSideMenuMainPage/iconProduct.svg +0 -3
- package/dist/assets/images/verticalSideMenuMainPage/iconSpeedometer.svg +0 -12
- package/dist/assets/images/verticalSideMenuMainPage/iconTask.svg +0 -10
- package/dist/assets/images/verticalSideMenuMainPage/openMenu.svg +0 -4
- package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +0 -36
- package/dist/components/atoms/ListCommercialRetailers/index.js +0 -64
- package/dist/components/atoms/ListCommercialRetailers/styles.js +0 -20
- package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +0 -37
- package/dist/components/atoms/MenuCommercialRetailers/index.js +0 -25
- package/dist/components/atoms/MenuCommercialRetailers/styles.js +0 -20
- package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +0 -28
- package/dist/components/atoms/MenuProductImage/index.js +0 -88
- package/dist/components/atoms/MenuProductImage/styles.js +0 -20
- package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +0 -25
- package/dist/components/molecules/ApproveRejetPanel/index.js +0 -49
- package/dist/components/molecules/ApproveRejetPanel/styles.js +0 -18
- package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +0 -28
- package/dist/components/molecules/SignInLoginCreationApp/index.js +0 -270
- package/dist/components/molecules/SignInLoginCreationApp/styles.js +0 -20
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +0 -37
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +0 -269
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +0 -20
- package/dist/global-files/fonts.css +0 -45
- package/dist/global-files/global-styles.css +0 -40
|
@@ -233,11 +233,8 @@ export const ProviderProductEdition = ({
|
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
//setActiveRetailer(product?.retailers[0]);
|
|
237
|
-
setImages({
|
|
238
|
-
action: "init",
|
|
239
|
-
init: services[2],
|
|
240
|
-
});
|
|
236
|
+
// setActiveRetailer(product?.retailers[0]);
|
|
237
|
+
setImages({ action: "init", init: services[2] });
|
|
241
238
|
if (services[2]?.values?.length > 0) setActiveImage(0);
|
|
242
239
|
|
|
243
240
|
getPercentage({ data: [product] }).then((res) => setPercentages(res));
|
|
@@ -256,10 +253,11 @@ export const ProviderProductEdition = ({
|
|
|
256
253
|
}&end=true`
|
|
257
254
|
);
|
|
258
255
|
const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
|
|
256
|
+
const retailerResponse = parsedResponse?.map((srv) => srv.id_retailer);
|
|
259
257
|
let retailers = product.retailers || product.retailersAvailable;
|
|
260
|
-
let active = retailers?.
|
|
261
|
-
|
|
262
|
-
)
|
|
258
|
+
let active = retailers?.find((retailer) =>
|
|
259
|
+
retailerResponse.includes(retailer.id)
|
|
260
|
+
);
|
|
263
261
|
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
264
262
|
setServicesData(parsedResponse);
|
|
265
263
|
}
|
|
@@ -280,15 +278,15 @@ export const ProviderProductEdition = ({
|
|
|
280
278
|
if (revision && currentService === "AP") return true;
|
|
281
279
|
} else {
|
|
282
280
|
const { product } = productEdit;
|
|
283
|
-
|
|
284
|
-
orgn === "
|
|
285
|
-
(["
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
)
|
|
281
|
+
const isRequestWithoutContentoh =
|
|
282
|
+
orgn === "RequestWithoutContentoh" &&
|
|
283
|
+
(["R", "CA"].includes(currentService) ||
|
|
284
|
+
(currentService === "RCA" &&
|
|
285
|
+
(!product.id_order || !product.orderId)));
|
|
286
|
+
const isRequestWithContentoh =
|
|
287
|
+
orgn === "RequestWithContentoh" && currentService === "AA";
|
|
288
|
+
const isContentoh = orgn === "Contentoh" && currentService === "AA";
|
|
289
|
+
if (isContentoh || isRequestWithoutContentoh || isRequestWithContentoh)
|
|
292
290
|
return true;
|
|
293
291
|
}
|
|
294
292
|
}
|
|
@@ -305,26 +303,26 @@ export const ProviderProductEdition = ({
|
|
|
305
303
|
setInCart(arr.some((e) => e.articleId === product.id_article));
|
|
306
304
|
};
|
|
307
305
|
|
|
308
|
-
useEffect(
|
|
306
|
+
useEffect(() => {
|
|
309
307
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
310
308
|
loadData();
|
|
311
309
|
getCart();
|
|
312
|
-
|
|
310
|
+
fetchUsers(token).then((res) => setUserGroups(res));
|
|
313
311
|
let arr = [];
|
|
312
|
+
// ?? Que sentido tiene verificar los roles de colaborador en la app de proveedor
|
|
314
313
|
switch (user.id_role) {
|
|
315
314
|
case 7:
|
|
316
315
|
case 8:
|
|
317
|
-
arr = ["
|
|
316
|
+
arr = ["CA", "RC", "RA"];
|
|
318
317
|
break;
|
|
319
318
|
case 4:
|
|
320
319
|
case 5:
|
|
321
|
-
arr = ["
|
|
320
|
+
arr = ["RC", "AC", "AA", "AP", "ACA"];
|
|
322
321
|
break;
|
|
323
322
|
case 6:
|
|
324
|
-
arr = ["RP", "
|
|
323
|
+
arr = ["RP", "RCA", "AC"];
|
|
325
324
|
break;
|
|
326
325
|
default:
|
|
327
|
-
arr = [];
|
|
328
326
|
break;
|
|
329
327
|
}
|
|
330
328
|
setStatusArray(arr);
|
|
@@ -342,9 +340,9 @@ export const ProviderProductEdition = ({
|
|
|
342
340
|
const productTemp = product;
|
|
343
341
|
const retailers = productTemp?.retailersAvailable || productTemp?.retailers;
|
|
344
342
|
retailers?.forEach((retailer) => {
|
|
345
|
-
retailer["percentage"] = percentages?.
|
|
343
|
+
retailer["percentage"] = percentages?.find(
|
|
346
344
|
(percent) => retailer?.id === percent?.id_retailer
|
|
347
|
-
)
|
|
345
|
+
)?.percentage;
|
|
348
346
|
});
|
|
349
347
|
|
|
350
348
|
setProduct(productTemp);
|
|
@@ -420,7 +418,7 @@ export const ProviderProductEdition = ({
|
|
|
420
418
|
};
|
|
421
419
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
422
420
|
try {
|
|
423
|
-
await axios.put(
|
|
421
|
+
const res = await axios.put(
|
|
424
422
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
|
|
425
423
|
dataObject,
|
|
426
424
|
{
|
|
@@ -429,8 +427,10 @@ export const ProviderProductEdition = ({
|
|
|
429
427
|
},
|
|
430
428
|
}
|
|
431
429
|
);
|
|
432
|
-
|
|
433
|
-
|
|
430
|
+
if (res.data.statusCode === 200) {
|
|
431
|
+
setMessage("Descripciones guardadas con éxito");
|
|
432
|
+
await loadData();
|
|
433
|
+
}
|
|
434
434
|
} catch (error) {
|
|
435
435
|
console.log(error);
|
|
436
436
|
}
|
|
@@ -453,8 +453,10 @@ export const ProviderProductEdition = ({
|
|
|
453
453
|
},
|
|
454
454
|
}
|
|
455
455
|
);
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
if (res.data.statusCode === 200) {
|
|
457
|
+
setMessage("Fichas técnicas guardadas");
|
|
458
|
+
await loadData();
|
|
459
|
+
}
|
|
458
460
|
} catch (error) {
|
|
459
461
|
console.log(error);
|
|
460
462
|
}
|
|
@@ -552,7 +554,7 @@ export const ProviderProductEdition = ({
|
|
|
552
554
|
return e;
|
|
553
555
|
});
|
|
554
556
|
try {
|
|
555
|
-
await axios.put(
|
|
557
|
+
const res = await axios.put(
|
|
556
558
|
`${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
|
|
557
559
|
dataImages,
|
|
558
560
|
{
|
|
@@ -561,9 +563,11 @@ export const ProviderProductEdition = ({
|
|
|
561
563
|
},
|
|
562
564
|
}
|
|
563
565
|
);
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
566
|
+
if (res.data.statusCode === 200) {
|
|
567
|
+
setMessage("Imágenes guardadas con éxito");
|
|
568
|
+
sessionStorage.removeItem("imagesList");
|
|
569
|
+
await loadData();
|
|
570
|
+
}
|
|
567
571
|
} catch (error) {
|
|
568
572
|
console.log(error);
|
|
569
573
|
}
|
|
@@ -665,12 +669,12 @@ export const ProviderProductEdition = ({
|
|
|
665
669
|
},
|
|
666
670
|
],
|
|
667
671
|
concept: concept,
|
|
668
|
-
|
|
672
|
+
userId: assignationId,
|
|
669
673
|
};
|
|
670
|
-
axios({
|
|
674
|
+
await axios({
|
|
671
675
|
method: "post",
|
|
672
676
|
url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
|
|
673
|
-
data
|
|
677
|
+
data,
|
|
674
678
|
headers: {
|
|
675
679
|
Authorization: token,
|
|
676
680
|
},
|
|
@@ -688,7 +692,7 @@ export const ProviderProductEdition = ({
|
|
|
688
692
|
serv = serv.filter((f) => f.id_retailer === activeRetailer.id);
|
|
689
693
|
}
|
|
690
694
|
const statusArray =
|
|
691
|
-
user.is_retailer === 1 ? ["
|
|
695
|
+
user.is_retailer === 1 ? ["ACA", "RCA"] : ["AP", "RP", "ACA"];
|
|
692
696
|
return (
|
|
693
697
|
serv.length > 0 && serv.every((item) => statusArray.includes(item.status))
|
|
694
698
|
);
|
|
@@ -791,7 +795,7 @@ export const ProviderProductEdition = ({
|
|
|
791
795
|
const { datasheet_status, description_status, images_status } = product;
|
|
792
796
|
const completionStates =
|
|
793
797
|
user.is_retailer === 1
|
|
794
|
-
? ["
|
|
798
|
+
? ["ACA", "Evaluated", "NS"]
|
|
795
799
|
: ["AP", "Evaluated", "NS"];
|
|
796
800
|
const dsEvaluated = completionStates.includes(datasheet_status);
|
|
797
801
|
const descsEvaluated = completionStates.includes(description_status);
|
|
@@ -804,54 +808,53 @@ export const ProviderProductEdition = ({
|
|
|
804
808
|
|
|
805
809
|
const sendEvaluation = async (result) => {
|
|
806
810
|
setLoading(true);
|
|
807
|
-
|
|
811
|
+
const concept = getConcept(activeTab);
|
|
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 };
|
|
808
818
|
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
|
-
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,
|
|
819
|
+
let res;
|
|
820
|
+
try {
|
|
821
|
+
if (result) {
|
|
822
|
+
data.result = result;
|
|
823
|
+
data.retailerId = retailerId;
|
|
824
|
+
res = await axios.put(
|
|
825
|
+
`${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
|
|
826
|
+
data,
|
|
827
|
+
{
|
|
828
|
+
headers: {
|
|
829
|
+
Authorization: token,
|
|
830
|
+
},
|
|
831
|
+
}
|
|
832
|
+
);
|
|
833
|
+
} else {
|
|
834
|
+
res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
835
|
+
headers: {
|
|
836
|
+
Authorization: token,
|
|
837
|
+
},
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
if (res.data.statusCode === 200) {
|
|
841
|
+
productTemp[`${concept}_status`] = "Evaluated";
|
|
842
|
+
setProduct(productTemp);
|
|
843
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
844
|
+
const newProductEdit = {
|
|
845
|
+
ArticleId: articleId,
|
|
847
846
|
idCategory: productTemp.article.id_category,
|
|
848
847
|
product: productTemp,
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
|
|
848
|
+
};
|
|
849
|
+
setProductEdit(newProductEdit);
|
|
850
|
+
sessionStorage.setItem("productEdit", JSON.stringify(newProductEdit));
|
|
851
|
+
setOrigin((prev) => ({ ...prev, [concept]: "Evaluated" }));
|
|
852
|
+
await loadData();
|
|
853
|
+
showSurvey && showSurvey(confirmStatusComplete());
|
|
854
|
+
}
|
|
855
|
+
} catch (err) {
|
|
856
|
+
console.log(err);
|
|
852
857
|
}
|
|
853
|
-
loadData();
|
|
854
|
-
showSurvey && showSurvey(confirmStatusComplete());
|
|
855
858
|
};
|
|
856
859
|
|
|
857
860
|
const validateAll = async (result) => {
|
|
@@ -897,13 +900,13 @@ export const ProviderProductEdition = ({
|
|
|
897
900
|
|
|
898
901
|
await Promise.all(sendAll);
|
|
899
902
|
const productTemp = product;
|
|
900
|
-
productTemp.article_status = `${result}
|
|
903
|
+
productTemp.article_status = `${result}CA`;
|
|
901
904
|
productTemp.datasheet_status =
|
|
902
|
-
productTemp.datasheet_status === "NA" ? "NA" : `${result}
|
|
905
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}CA`;
|
|
903
906
|
productTemp.description_status =
|
|
904
|
-
productTemp.description_status === "NA" ? "NA" : `${result}
|
|
907
|
+
productTemp.description_status === "NA" ? "NA" : `${result}CA`;
|
|
905
908
|
productTemp.images_status =
|
|
906
|
-
productTemp.images_status === "NA" ? "NA" : `${result}
|
|
909
|
+
productTemp.images_status === "NA" ? "NA" : `${result}CA`;
|
|
907
910
|
setProduct(productTemp);
|
|
908
911
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
909
912
|
setProductEdit({
|
|
@@ -920,7 +923,7 @@ export const ProviderProductEdition = ({
|
|
|
920
923
|
})
|
|
921
924
|
);
|
|
922
925
|
|
|
923
|
-
loadData();
|
|
926
|
+
await loadData();
|
|
924
927
|
} catch (error) {
|
|
925
928
|
console.log(error);
|
|
926
929
|
}
|
|
@@ -941,7 +944,7 @@ export const ProviderProductEdition = ({
|
|
|
941
944
|
},
|
|
942
945
|
});
|
|
943
946
|
const prod = productEdit;
|
|
944
|
-
const statusComplete = user.is_retailer ? `${result}
|
|
947
|
+
const statusComplete = user.is_retailer ? `${result}CA` : `${result}P`;
|
|
945
948
|
prod.product.datasheet_status = statusComplete;
|
|
946
949
|
prod.product.description_status = statusComplete;
|
|
947
950
|
prod.product.images_status = statusComplete;
|
|
@@ -950,24 +953,22 @@ export const ProviderProductEdition = ({
|
|
|
950
953
|
sessionStorage.setItem("productEdit", JSON.stringify(prod));
|
|
951
954
|
setProduct(prod);
|
|
952
955
|
setShowGenericModal && setShowGenericModal(false);
|
|
953
|
-
loadData();
|
|
956
|
+
await loadData();
|
|
954
957
|
};
|
|
955
958
|
|
|
956
959
|
const getSectionStatus = () => {
|
|
957
960
|
const concept = getConcept(activeTab);
|
|
958
|
-
return ["AA", "AP", "
|
|
961
|
+
return ["AA", "AP", "R", "CA", "RCA"].includes(
|
|
959
962
|
productEdit.product[`${concept}_status`]
|
|
960
963
|
);
|
|
961
964
|
};
|
|
962
965
|
|
|
963
966
|
const enableActions = (versionStatus) => {
|
|
964
967
|
try {
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
if (userIsRetailer) return false;
|
|
968
|
+
if (user.is_retailer) return false;
|
|
968
969
|
|
|
969
970
|
if (versionStatus) {
|
|
970
|
-
return ["AP", "
|
|
971
|
+
return ["AP", "ACA", "RCA", null].includes(versionStatus);
|
|
971
972
|
}
|
|
972
973
|
return true;
|
|
973
974
|
} catch (err) {
|
|
@@ -1057,23 +1058,21 @@ export const ProviderProductEdition = ({
|
|
|
1057
1058
|
},
|
|
1058
1059
|
}));
|
|
1059
1060
|
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 {
|
|
1061
|
+
} else if (user.is_retailer) {
|
|
1062
|
+
if (product.id_order || product.orderId) {
|
|
1075
1063
|
validateAll("A");
|
|
1064
|
+
} else {
|
|
1065
|
+
setDataGenericModal((prev) => ({
|
|
1066
|
+
...prev,
|
|
1067
|
+
button2: {
|
|
1068
|
+
name: "Continuar",
|
|
1069
|
+
action: () => evaluationToRetailer("A"),
|
|
1070
|
+
},
|
|
1071
|
+
}));
|
|
1072
|
+
setShowGenericModal(true);
|
|
1076
1073
|
}
|
|
1074
|
+
} else {
|
|
1075
|
+
validateAll("A");
|
|
1077
1076
|
}
|
|
1078
1077
|
}}
|
|
1079
1078
|
rejectAll={() => {
|
|
@@ -1083,25 +1082,23 @@ export const ProviderProductEdition = ({
|
|
|
1083
1082
|
(!product.id_order || !product.orderId)
|
|
1084
1083
|
) {
|
|
1085
1084
|
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 {
|
|
1085
|
+
} else if (user.is_retailer) {
|
|
1086
|
+
if (product.id_order || product.orderId) {
|
|
1102
1087
|
validateAll("R");
|
|
1103
1088
|
setModalViewError(true);
|
|
1089
|
+
} else {
|
|
1090
|
+
setDataGenericModal((prev) => ({
|
|
1091
|
+
...prev,
|
|
1092
|
+
button2: {
|
|
1093
|
+
name: "Continuar",
|
|
1094
|
+
action: () => evaluationToRetailer("R"),
|
|
1095
|
+
},
|
|
1096
|
+
}));
|
|
1097
|
+
setShowGenericModal(true);
|
|
1104
1098
|
}
|
|
1099
|
+
} else {
|
|
1100
|
+
validateAll("R");
|
|
1101
|
+
setModalViewError(true);
|
|
1105
1102
|
}
|
|
1106
1103
|
}}
|
|
1107
1104
|
approve={() => {
|
|
@@ -1118,23 +1115,21 @@ export const ProviderProductEdition = ({
|
|
|
1118
1115
|
},
|
|
1119
1116
|
}));
|
|
1120
1117
|
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 {
|
|
1118
|
+
} else if (user.is_retailer) {
|
|
1119
|
+
if (product.id_order || product.orderId) {
|
|
1136
1120
|
sendEvaluation("A");
|
|
1121
|
+
} else {
|
|
1122
|
+
setDataGenericModal((prev) => ({
|
|
1123
|
+
...prev,
|
|
1124
|
+
button2: {
|
|
1125
|
+
name: "Continuar",
|
|
1126
|
+
action: () => evaluationToRetailer("A"),
|
|
1127
|
+
},
|
|
1128
|
+
}));
|
|
1129
|
+
setShowGenericModal(true);
|
|
1137
1130
|
}
|
|
1131
|
+
} else {
|
|
1132
|
+
sendEvaluation("A");
|
|
1138
1133
|
}
|
|
1139
1134
|
}}
|
|
1140
1135
|
reject={() => {
|
|
@@ -1144,25 +1139,23 @@ export const ProviderProductEdition = ({
|
|
|
1144
1139
|
(!product.id_order || !product.orderId)
|
|
1145
1140
|
) {
|
|
1146
1141
|
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 {
|
|
1142
|
+
} else if (user.is_retailer) {
|
|
1143
|
+
if (product.id_order || product.orderId) {
|
|
1163
1144
|
sendEvaluation("R");
|
|
1164
1145
|
setModalViewError(true);
|
|
1146
|
+
} else {
|
|
1147
|
+
setDataGenericModal((prev) => ({
|
|
1148
|
+
...prev,
|
|
1149
|
+
button2: {
|
|
1150
|
+
name: "Continuar",
|
|
1151
|
+
action: () => evaluationToRetailer("R"),
|
|
1152
|
+
},
|
|
1153
|
+
}));
|
|
1154
|
+
setShowGenericModal(true);
|
|
1165
1155
|
}
|
|
1156
|
+
} else {
|
|
1157
|
+
sendEvaluation("R");
|
|
1158
|
+
setModalViewError(true);
|
|
1166
1159
|
}
|
|
1167
1160
|
}}
|
|
1168
1161
|
/>
|
|
@@ -1313,20 +1306,21 @@ export const ProviderProductEdition = ({
|
|
|
1313
1306
|
/>
|
|
1314
1307
|
</div>
|
|
1315
1308
|
)}
|
|
1316
|
-
<Button
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1309
|
+
{/* <Button
|
|
1310
|
+
buttonType={
|
|
1311
|
+
evaluationComplete(activeTab) &&
|
|
1312
|
+
(productEdit.product.id_order ||
|
|
1313
|
+
productEdit.product.orderId)
|
|
1314
|
+
? "general-green-button"
|
|
1315
|
+
: "general-button-disabled"
|
|
1316
|
+
}
|
|
1317
|
+
label={"Enviar evaluación"}
|
|
1318
|
+
onClick={() => {
|
|
1319
|
+
//setModalSent(true);
|
|
1320
|
+
sendEvaluation();
|
|
1321
|
+
setMessage(`¡Evaluación de ${activeTab} completada!`);
|
|
1322
|
+
}}
|
|
1323
|
+
/> */}
|
|
1330
1324
|
</div>
|
|
1331
1325
|
) : revision ? null : (
|
|
1332
1326
|
<div className="required-inputs-message">
|