contentoh-components-library 21.4.22 → 21.4.24
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/.env.development +2 -5
- package/.env.production +1 -3
- package/dist/components/atoms/Avatar/index.js +2 -3
- package/dist/components/atoms/Card/index.js +5 -46
- package/dist/components/atoms/Card/styles.js +1 -3
- package/dist/components/atoms/CheckBox/index.js +2 -7
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/atoms/SliderToolTip/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +116 -60
- package/dist/components/pages/ProviderProductEdition/index.js +142 -117
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -8
- package/dist/components/pages/RetailerProductEdition/index.js +308 -316
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/index.js +52 -247
- package/package.json +1 -4
- package/src/components/atoms/Avatar/index.js +2 -8
- package/src/components/atoms/Card/index.js +2 -35
- package/src/components/atoms/Card/styles.js +5 -41
- package/src/components/atoms/CheckBox/index.js +1 -4
- package/src/components/atoms/CheckBox/styles.js +0 -2
- package/src/components/atoms/InputFormatter/styles.js +1 -2
- package/src/components/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/TagAndInput/index.js +8 -10
- package/src/components/organisms/Chat/Chat.stories.js +7 -27
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
- package/src/components/organisms/Chat/ContentChat/index.js +12 -88
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +4 -46
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +116 -66
- package/src/components/pages/ProviderProductEdition/index.js +129 -97
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +3 -7
- package/src/components/pages/RetailerProductEdition/index.js +184 -158
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/index.js +0 -16
- package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -90
- package/dist/components/atoms/ImageCarousel/index.js +0 -120
- package/dist/components/atoms/ImageCarousel/styles.js +0 -18
- package/dist/components/atoms/PercentTag/PercentTag.stories.js +0 -31
- package/dist/components/atoms/PercentTag/index.js +0 -23
- package/dist/components/atoms/PercentTag/styles.js +0 -22
- package/dist/components/atoms/RatingStars/RatingStars.stories.js +0 -30
- package/dist/components/atoms/RatingStars/index.js +0 -53
- package/dist/components/atoms/RatingStars/styles.js +0 -18
- package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -48
- package/dist/components/atoms/RetailerCatalog/index.js +0 -69
- package/dist/components/atoms/RetailerCatalog/styles.js +0 -20
- package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +0 -33
- package/dist/components/atoms/RetailerOption/index.js +0 -62
- package/dist/components/atoms/RetailerOption/styles.js +0 -20
- package/dist/components/atoms/RetailersList/RetailersList.stories.js +0 -45
- package/dist/components/atoms/RetailersList/index.js +0 -46
- package/dist/components/atoms/RetailersList/styles.js +0 -18
- package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +0 -73
- package/dist/components/atoms/UserCatalog/index.js +0 -101
- package/dist/components/atoms/UserCatalog/styles.js +0 -18
- package/dist/components/atoms/UserOption/UserOption.stories.js +0 -40
- package/dist/components/atoms/UserOption/index.js +0 -130
- package/dist/components/atoms/UserOption/styles.js +0 -20
- package/dist/components/atoms/UserSelector/UserSelector.stories.js +0 -40
- package/dist/components/atoms/UserSelector/index.js +0 -98
- package/dist/components/atoms/UserSelector/styles.js +0 -32
- package/dist/components/molecules/GridItem/GridItem.stories.js +0 -123
- package/dist/components/molecules/GridItem/index.js +0 -152
- package/dist/components/molecules/GridItem/styles.js +0 -20
- package/dist/components/molecules/HeaderItem/ColumnItem.js +0 -23
- package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +0 -70
- package/dist/components/molecules/HeaderItem/index.js +0 -42
- package/dist/components/molecules/HeaderItem/styles.js +0 -30
- package/dist/components/molecules/RowItem/ColumnItem.js +0 -23
- package/dist/components/molecules/RowItem/RowItem.stories.js +0 -5242
- package/dist/components/molecules/RowItem/index.js +0 -58
- package/dist/components/molecules/RowItem/styles.js +0 -30
- package/dist/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -31
- package/dist/components/molecules/StripeCardForm/index.js +0 -87
- package/dist/components/molecules/StripeCardForm/paymentForm.js +0 -191
- package/dist/components/molecules/StripeCardForm/styles.js +0 -24
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -30
- package/dist/components/molecules/StripeCardSelector/index.js +0 -107
- package/dist/components/molecules/StripeCardSelector/styles.js +0 -19
- package/dist/components/molecules/StripeCardSelector/utils.js +0 -56
- package/dist/components/organisms/GridProducts/GridProducts.stories.js +0 -5097
- package/dist/components/organisms/GridProducts/index.js +0 -63
- package/dist/components/organisms/GridProducts/styles.js +0 -18
- package/dist/components/organisms/GridProducts/utils.js +0 -149
- package/dist/components/organisms/PanelLayout/PanelLayout.stories.js +0 -87
- package/dist/components/organisms/PanelLayout/index.js +0 -29
- package/dist/components/organisms/PanelLayout/styles.js +0 -32
- package/dist/components/organisms/SideModal/SideModal.stories.js +0 -42
- package/dist/components/organisms/SideModal/index.js +0 -72
- package/dist/components/organisms/SideModal/styles.js +0 -18
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
- package/src/components/atoms/ImageCarousel/index.js +0 -103
- package/src/components/atoms/ImageCarousel/styles.js +0 -79
- package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
- package/src/components/atoms/PercentTag/index.js +0 -9
- package/src/components/atoms/PercentTag/styles.js +0 -69
- package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
- package/src/components/atoms/RatingStars/index.js +0 -31
- package/src/components/atoms/RatingStars/styles.js +0 -28
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
- package/src/components/atoms/RetailerCatalog/index.js +0 -49
- package/src/components/atoms/RetailerCatalog/styles.js +0 -30
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
- package/src/components/atoms/RetailerOption/index.js +0 -53
- package/src/components/atoms/RetailerOption/styles.js +0 -41
- package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
- package/src/components/atoms/RetailersList/index.js +0 -20
- package/src/components/atoms/RetailersList/styles.js +0 -19
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
- package/src/components/atoms/UserCatalog/index.js +0 -100
- package/src/components/atoms/UserCatalog/styles.js +0 -24
- package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
- package/src/components/atoms/UserOption/index.js +0 -95
- package/src/components/atoms/UserOption/styles.js +0 -61
- package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
- package/src/components/atoms/UserSelector/index.js +0 -86
- package/src/components/atoms/UserSelector/styles.js +0 -55
- package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
- package/src/components/molecules/GridItem/index.js +0 -105
- package/src/components/molecules/GridItem/styles.js +0 -104
- package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
- package/src/components/molecules/HeaderItem/index.js +0 -26
- package/src/components/molecules/HeaderItem/styles.js +0 -27
- package/src/components/molecules/RowItem/ColumnItem.js +0 -9
- package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
- package/src/components/molecules/RowItem/index.js +0 -45
- package/src/components/molecules/RowItem/styles.js +0 -40
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
- package/src/components/molecules/StripeCardForm/index.js +0 -42
- package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
- package/src/components/molecules/StripeCardForm/styles.js +0 -73
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
- package/src/components/molecules/StripeCardSelector/index.js +0 -44
- package/src/components/molecules/StripeCardSelector/styles.js +0 -4
- package/src/components/molecules/StripeCardSelector/utils.js +0 -17
- package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
- package/src/components/organisms/GridProducts/index.js +0 -50
- package/src/components/organisms/GridProducts/styles.js +0 -14
- package/src/components/organisms/GridProducts/utils.js +0 -111
- package/src/components/organisms/PanelLayout/PanelLayout.stories.js +0 -63
- package/src/components/organisms/PanelLayout/index.js +0 -11
- package/src/components/organisms/PanelLayout/styles.js +0 -39
- package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
- package/src/components/organisms/SideModal/index.js +0 -50
- package/src/components/organisms/SideModal/styles.js +0 -30
|
@@ -24,20 +24,15 @@ import descriptionSent from "../../../assets/images/modalsSVGs/descriptionSent.s
|
|
|
24
24
|
import imagesSent from "../../../assets/images/modalsSVGs/uploadingImages.svg";
|
|
25
25
|
import { TagAndInput } from "../../molecules/TagAndInput/index";
|
|
26
26
|
import { Button } from "../../atoms/GeneralButton";
|
|
27
|
+
import { Commentary } from "../../atoms/Commentary";
|
|
27
28
|
import { GenericModal } from "../../atoms/GenericModal";
|
|
28
29
|
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
29
30
|
import { Loading } from "../../atoms/Loading";
|
|
30
31
|
import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
|
|
32
|
+
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
31
33
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
32
34
|
import { useCloseModal } from "../../../global-files/customHooks";
|
|
33
|
-
import {
|
|
34
|
-
getAuditVersion,
|
|
35
|
-
getInputsData,
|
|
36
|
-
createMessage,
|
|
37
|
-
sendMessage,
|
|
38
|
-
} from "./utils";
|
|
39
|
-
import { Modal } from "../../organisms/Modal";
|
|
40
|
-
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
35
|
+
import { getAuditVersion, getInputsData } from "./utils";
|
|
41
36
|
|
|
42
37
|
const reducerImages = (state, action) => {
|
|
43
38
|
let { values, attrForImgs, inputsByRetailer } = state;
|
|
@@ -137,7 +132,6 @@ export const RetailerProductEdition = ({
|
|
|
137
132
|
const [datasheets, setDatasheets] = useState([]);
|
|
138
133
|
const [images, setImages] = useReducer(reducerImages, {});
|
|
139
134
|
const [showModal, setShowModal] = useState(false);
|
|
140
|
-
const [showRejectModal, setShowRejectModal] = useState(false);
|
|
141
135
|
const { getRootProps, getInputProps } = useDropzone({
|
|
142
136
|
accept: "image/*",
|
|
143
137
|
noKeyboard: true,
|
|
@@ -224,11 +218,6 @@ export const RetailerProductEdition = ({
|
|
|
224
218
|
const [auditDescriptions, setAuditDescriptions] = useState([]);
|
|
225
219
|
const [auditImages, setAuditImages] = useState([]);
|
|
226
220
|
const [compare, setCompare] = useState(false);
|
|
227
|
-
const [valRejAll, setValRejAll] = useState(false);
|
|
228
|
-
|
|
229
|
-
const [desc, setDesc] = useState([]);
|
|
230
|
-
const [fich, setFich] = useState([]);
|
|
231
|
-
const [imag, setImag] = useState([]);
|
|
232
221
|
|
|
233
222
|
useEffect(async () => {
|
|
234
223
|
const { id_article } = product?.article || {};
|
|
@@ -572,7 +561,6 @@ export const RetailerProductEdition = ({
|
|
|
572
561
|
active: images?.values?.some((value) => value?.image_id === e?.id),
|
|
573
562
|
}));
|
|
574
563
|
setSocketType(imageInputs);
|
|
575
|
-
console.log(images);
|
|
576
564
|
}, [images]);
|
|
577
565
|
|
|
578
566
|
const updateImages = useCallback(async () => {
|
|
@@ -828,26 +816,27 @@ export const RetailerProductEdition = ({
|
|
|
828
816
|
const articleId = product.article.id_article;
|
|
829
817
|
const orderId = product.orderId;
|
|
830
818
|
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
819
|
+
const body = {
|
|
820
|
+
orderArticleRetailers: [
|
|
821
|
+
{ orderId, articleId, retailersIds: [activeRetailer.id] },
|
|
822
|
+
],
|
|
823
|
+
isAproved: false,
|
|
824
|
+
service: concept,
|
|
837
825
|
};
|
|
838
826
|
let res;
|
|
839
827
|
let message;
|
|
840
828
|
if (result) {
|
|
841
|
-
|
|
842
|
-
res = await axios.
|
|
843
|
-
`${process.env.
|
|
844
|
-
|
|
829
|
+
body.isAproved = result === "A";
|
|
830
|
+
res = await axios.post(
|
|
831
|
+
`${process.env.REACT_APP_EVALUATION_REFACTOR}`,
|
|
832
|
+
body,
|
|
845
833
|
{
|
|
846
834
|
headers: {
|
|
847
835
|
Authorization: token,
|
|
848
836
|
},
|
|
849
837
|
}
|
|
850
838
|
);
|
|
839
|
+
console.log(JSON.parse(res.data.body), "res");
|
|
851
840
|
getServices();
|
|
852
841
|
} else {
|
|
853
842
|
const specialistDone = ["RC", "RA", "CA"].includes(evalStatus);
|
|
@@ -859,37 +848,22 @@ export const RetailerProductEdition = ({
|
|
|
859
848
|
message = "Evaluación enviada";
|
|
860
849
|
getSectionIcon();
|
|
861
850
|
}
|
|
862
|
-
res = await axios.
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
851
|
+
res = await axios.post(
|
|
852
|
+
`${process.env.REACT_APP_EVALUATION_REFACTOR}`,
|
|
853
|
+
body,
|
|
854
|
+
{
|
|
855
|
+
headers: {
|
|
856
|
+
Authorization: token,
|
|
857
|
+
},
|
|
858
|
+
}
|
|
859
|
+
);
|
|
867
860
|
}
|
|
868
861
|
if (res.data.statusCode === 200) {
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
activeRetailer.id,
|
|
875
|
-
evalStatus,
|
|
876
|
-
newStatus,
|
|
877
|
-
activeTab
|
|
878
|
-
);
|
|
879
|
-
|
|
880
|
-
const data = {
|
|
881
|
-
paramsBody: {
|
|
882
|
-
id: product.article.id_article,
|
|
883
|
-
version: version,
|
|
884
|
-
items: [{ type: "status", value: messageToChat }],
|
|
885
|
-
retailerId: activeRetailer.id,
|
|
886
|
-
status: product.status,
|
|
887
|
-
},
|
|
888
|
-
paramsHeader: { Authorization: token },
|
|
889
|
-
};
|
|
890
|
-
await sendMessage(data);
|
|
891
|
-
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
892
|
-
productTemp[`${concept}_status`] = newStatus;
|
|
862
|
+
const response = JSON.parse(res.data.body)?.successfulData;
|
|
863
|
+
const statusObject =
|
|
864
|
+
response[`${orderId}-${articleId}-${activeRetailer.id}`];
|
|
865
|
+
productTemp.status = statusObject["generalStatus"];
|
|
866
|
+
productTemp[`${concept}_status`] = statusObject[`${concept}Status`];
|
|
893
867
|
await loadData();
|
|
894
868
|
if (message) setMessage(message);
|
|
895
869
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
@@ -930,19 +904,35 @@ export const RetailerProductEdition = ({
|
|
|
930
904
|
return product?.article[`id_auditor`] === user.id_user;
|
|
931
905
|
};
|
|
932
906
|
|
|
933
|
-
const createComment = async (
|
|
907
|
+
const createComment = async (e, body, tab) => {
|
|
908
|
+
let concept = "";
|
|
909
|
+
switch (activeTab) {
|
|
910
|
+
case "Ficha técnica":
|
|
911
|
+
concept = "datasheet";
|
|
912
|
+
break;
|
|
913
|
+
case "Imágenes":
|
|
914
|
+
concept = "images";
|
|
915
|
+
break;
|
|
916
|
+
|
|
917
|
+
default:
|
|
918
|
+
concept = "description";
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
934
921
|
const data = {
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
status: product.status,
|
|
941
|
-
},
|
|
942
|
-
paramsHeader: { Authorization: token },
|
|
922
|
+
articleId: product?.article?.id_article,
|
|
923
|
+
orderId: product?.orderId,
|
|
924
|
+
message: body?.replace(/<.*?\/?>/gm, ""),
|
|
925
|
+
concept: concept,
|
|
926
|
+
version: version,
|
|
943
927
|
};
|
|
928
|
+
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
929
|
+
headers: {
|
|
930
|
+
Authorization: token,
|
|
931
|
+
},
|
|
932
|
+
});
|
|
933
|
+
await getComments(tab);
|
|
944
934
|
setMessage("");
|
|
945
|
-
|
|
935
|
+
setComponentsArray([]);
|
|
946
936
|
};
|
|
947
937
|
|
|
948
938
|
const getRequired = (services) => {
|
|
@@ -1194,7 +1184,6 @@ export const RetailerProductEdition = ({
|
|
|
1194
1184
|
};
|
|
1195
1185
|
|
|
1196
1186
|
useEffect(() => {
|
|
1197
|
-
console.log(servicesData, "servicesData");
|
|
1198
1187
|
let status = getRetailerStatus(servicesData, activeTab);
|
|
1199
1188
|
setRetailerStatus(status);
|
|
1200
1189
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1211,7 +1200,7 @@ export const RetailerProductEdition = ({
|
|
|
1211
1200
|
try {
|
|
1212
1201
|
setLoading(true);
|
|
1213
1202
|
const evaluationArray = [];
|
|
1214
|
-
let conceptArray = [];
|
|
1203
|
+
let conceptArray = ["description", "datasheet", "images"];
|
|
1215
1204
|
switch (user.id_role) {
|
|
1216
1205
|
case 4:
|
|
1217
1206
|
conceptArray = ["description", "datasheet"];
|
|
@@ -1225,55 +1214,45 @@ export const RetailerProductEdition = ({
|
|
|
1225
1214
|
break;
|
|
1226
1215
|
}
|
|
1227
1216
|
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1217
|
+
const isAproved = result === "A";
|
|
1218
|
+
const retailersIds = [];
|
|
1230
1219
|
servicesData?.forEach((ret) => {
|
|
1231
|
-
if (
|
|
1232
|
-
|
|
1233
|
-
|
|
1220
|
+
if (!retailersIds.includes(ret.id_retailer))
|
|
1221
|
+
retailersIds.push(ret.id_retailer);
|
|
1222
|
+
});
|
|
1223
|
+
const body = {
|
|
1224
|
+
orderArticleRetailers: [
|
|
1225
|
+
{
|
|
1234
1226
|
orderId: product.id_order ?? product.orderId,
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
[{ type: "status", value: message }],
|
|
1251
|
-
ret.id_retailer
|
|
1252
|
-
)
|
|
1253
|
-
);
|
|
1254
|
-
}
|
|
1255
|
-
evaluationArray.push(
|
|
1256
|
-
axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
1257
|
-
headers: {
|
|
1258
|
-
Authorization: token,
|
|
1259
|
-
},
|
|
1260
|
-
})
|
|
1261
|
-
);
|
|
1262
|
-
}
|
|
1227
|
+
articleId: product.article.id_article,
|
|
1228
|
+
retailersIds,
|
|
1229
|
+
},
|
|
1230
|
+
],
|
|
1231
|
+
isAproved,
|
|
1232
|
+
};
|
|
1233
|
+
conceptArray.forEach((concept) => {
|
|
1234
|
+
body.service = concept;
|
|
1235
|
+
evaluationArray.push(
|
|
1236
|
+
axios.post(`${process.env.REACT_APP_EVALUATION_REFACTOR}`, body, {
|
|
1237
|
+
headers: {
|
|
1238
|
+
Authorization: token,
|
|
1239
|
+
},
|
|
1240
|
+
})
|
|
1241
|
+
);
|
|
1263
1242
|
});
|
|
1243
|
+
|
|
1264
1244
|
await Promise.all(evaluationArray);
|
|
1265
1245
|
|
|
1266
1246
|
const productTemp = product;
|
|
1267
1247
|
productTemp.status = `${result}A`;
|
|
1268
1248
|
productTemp.datasheet_status =
|
|
1269
|
-
productTemp.datasheet_status === "
|
|
1249
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
|
|
1270
1250
|
productTemp.description_status =
|
|
1271
|
-
productTemp.description_status === "
|
|
1251
|
+
productTemp.description_status === "NA" ? "NA" : `${result}A`;
|
|
1272
1252
|
productTemp.images_status =
|
|
1273
|
-
productTemp.images_status === "
|
|
1253
|
+
productTemp.images_status === "NA" ? "NA" : `${result}A`;
|
|
1274
1254
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1275
1255
|
setProduct(productTemp);
|
|
1276
|
-
const messagesResponse = await Promise.all(messages);
|
|
1277
1256
|
|
|
1278
1257
|
await loadData();
|
|
1279
1258
|
} catch (error) {
|
|
@@ -1289,10 +1268,8 @@ export const RetailerProductEdition = ({
|
|
|
1289
1268
|
setCompare={setCompare}
|
|
1290
1269
|
isAuditor={[1, 6].includes(user.id_role)}
|
|
1291
1270
|
withChat={location?.state?.withChat}
|
|
1292
|
-
|
|
1293
|
-
productSelected={product}
|
|
1271
|
+
productSelected={productSelected}
|
|
1294
1272
|
token={token}
|
|
1295
|
-
activeRetailer={activeRetailer}
|
|
1296
1273
|
/>
|
|
1297
1274
|
<div className="data-container">
|
|
1298
1275
|
<div className="image-data-panel">
|
|
@@ -1332,7 +1309,36 @@ export const RetailerProductEdition = ({
|
|
|
1332
1309
|
sendToFacilitator("A");
|
|
1333
1310
|
}}
|
|
1334
1311
|
reject={() => {
|
|
1335
|
-
|
|
1312
|
+
sendToFacilitator("R");
|
|
1313
|
+
setMessage("Rechazado");
|
|
1314
|
+
setComponentsArray([
|
|
1315
|
+
<img src={errorModal} />,
|
|
1316
|
+
<ScreenHeader
|
|
1317
|
+
text={"Agrega tu comentarios para enviar el rechazo"}
|
|
1318
|
+
headerType={"input-name-header"}
|
|
1319
|
+
color={"white"}
|
|
1320
|
+
/>,
|
|
1321
|
+
<TagAndInput
|
|
1322
|
+
label={"Caja de Comentario"}
|
|
1323
|
+
inputType={"textarea"}
|
|
1324
|
+
inputId={"modal-commentary-box"}
|
|
1325
|
+
index={0}
|
|
1326
|
+
color={"white"}
|
|
1327
|
+
/>,
|
|
1328
|
+
<Button
|
|
1329
|
+
buttonType={"general-default-button"}
|
|
1330
|
+
label={"Enviar comentario"}
|
|
1331
|
+
onClick={(e) =>
|
|
1332
|
+
createComment(
|
|
1333
|
+
e,
|
|
1334
|
+
document.querySelector(
|
|
1335
|
+
"#modal-commentary-box .ql-container .ql-editor > p"
|
|
1336
|
+
).innerHTML,
|
|
1337
|
+
activeTab
|
|
1338
|
+
)
|
|
1339
|
+
}
|
|
1340
|
+
/>,
|
|
1341
|
+
]);
|
|
1336
1342
|
}}
|
|
1337
1343
|
showApproveRejectAll={
|
|
1338
1344
|
approveRejectAllButtons() && (auditorAssigned() || userAssigned())
|
|
@@ -1342,8 +1348,36 @@ export const RetailerProductEdition = ({
|
|
|
1342
1348
|
}
|
|
1343
1349
|
approveAll={() => validateAll("A")}
|
|
1344
1350
|
rejectAll={() => {
|
|
1345
|
-
|
|
1346
|
-
|
|
1351
|
+
validateAll("R");
|
|
1352
|
+
setMessage("Rechazado");
|
|
1353
|
+
setComponentsArray([
|
|
1354
|
+
<img src={errorModal} />,
|
|
1355
|
+
<ScreenHeader
|
|
1356
|
+
text={"Agrega tu comentarios para enviar el rechazo"}
|
|
1357
|
+
headerType={"input-name-header"}
|
|
1358
|
+
color={"white"}
|
|
1359
|
+
/>,
|
|
1360
|
+
<TagAndInput
|
|
1361
|
+
label={"Caja de Comentario"}
|
|
1362
|
+
inputType={"textarea"}
|
|
1363
|
+
inputId={"modal-commentary-box"}
|
|
1364
|
+
index={0}
|
|
1365
|
+
color={"white"}
|
|
1366
|
+
/>,
|
|
1367
|
+
<Button
|
|
1368
|
+
buttonType={"general-default-button"}
|
|
1369
|
+
label={"Enviar comentario"}
|
|
1370
|
+
onClick={(e) =>
|
|
1371
|
+
createComment(
|
|
1372
|
+
e,
|
|
1373
|
+
document.querySelector(
|
|
1374
|
+
"#modal-commentary-box .ql-container .ql-editor > p"
|
|
1375
|
+
).innerHTML,
|
|
1376
|
+
activeTab
|
|
1377
|
+
)
|
|
1378
|
+
}
|
|
1379
|
+
/>,
|
|
1380
|
+
]);
|
|
1347
1381
|
}}
|
|
1348
1382
|
/>
|
|
1349
1383
|
<FullTabsMenu
|
|
@@ -1359,12 +1393,6 @@ export const RetailerProductEdition = ({
|
|
|
1359
1393
|
isRetailer={isRetailer}
|
|
1360
1394
|
showSaveButton={auditorAssigned() || userAssigned()}
|
|
1361
1395
|
version={version}
|
|
1362
|
-
desc={desc}
|
|
1363
|
-
setDesc={setDesc}
|
|
1364
|
-
fich={fich}
|
|
1365
|
-
setFich={setFich}
|
|
1366
|
-
imag={imag}
|
|
1367
|
-
setImag={setImag}
|
|
1368
1396
|
updatedDescriptions={updatedDescriptions}
|
|
1369
1397
|
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
1370
1398
|
updatedDatasheets={updatedDatasheets}
|
|
@@ -1479,6 +1507,47 @@ export const RetailerProductEdition = ({
|
|
|
1479
1507
|
{(userAssigned(activeTab) || auditorAssigned()) &&
|
|
1480
1508
|
product[`${getConcept(activeTab)}_status`] !== "NS" && (
|
|
1481
1509
|
<div className="commentary-box">
|
|
1510
|
+
{!comment ? (
|
|
1511
|
+
<div className="commentary">
|
|
1512
|
+
<TagAndInput
|
|
1513
|
+
label={"Caja de Comentario"}
|
|
1514
|
+
inputType={"textarea"}
|
|
1515
|
+
inputCols={80}
|
|
1516
|
+
inputRows={4}
|
|
1517
|
+
inputId={"commentary-box"}
|
|
1518
|
+
index={0}
|
|
1519
|
+
/>
|
|
1520
|
+
<div className="buttons-box">
|
|
1521
|
+
<Button
|
|
1522
|
+
buttonType={"general-transparent-button"}
|
|
1523
|
+
label={"Enviar comentario"}
|
|
1524
|
+
onClick={(e) =>
|
|
1525
|
+
createComment(
|
|
1526
|
+
e,
|
|
1527
|
+
document.querySelector(
|
|
1528
|
+
"#commentary-box .ql-container .ql-editor > p"
|
|
1529
|
+
).innerHTML,
|
|
1530
|
+
activeTab
|
|
1531
|
+
)
|
|
1532
|
+
}
|
|
1533
|
+
/>
|
|
1534
|
+
</div>
|
|
1535
|
+
</div>
|
|
1536
|
+
) : (
|
|
1537
|
+
<div className="feedback-box">
|
|
1538
|
+
<Commentary
|
|
1539
|
+
comment={comment?.message?.replace(/<.*?\/?>/gm, "")}
|
|
1540
|
+
reviewed={crossComment}
|
|
1541
|
+
/>
|
|
1542
|
+
<Button
|
|
1543
|
+
buttonType={"circular-button accept-button"}
|
|
1544
|
+
onClick={async () => {
|
|
1545
|
+
setCrossComment(true);
|
|
1546
|
+
commentRevised();
|
|
1547
|
+
}}
|
|
1548
|
+
/>
|
|
1549
|
+
</div>
|
|
1550
|
+
)}
|
|
1482
1551
|
{[7, 8].includes(user.id_role) && (
|
|
1483
1552
|
<Button
|
|
1484
1553
|
buttonType={
|
|
@@ -1536,49 +1605,6 @@ export const RetailerProductEdition = ({
|
|
|
1536
1605
|
jwt={token}
|
|
1537
1606
|
/>
|
|
1538
1607
|
)}
|
|
1539
|
-
{showRejectModal && (
|
|
1540
|
-
<Modal
|
|
1541
|
-
title={`Agregar mensaje de rechazo para ${activeTab?.toLowerCase()}`}
|
|
1542
|
-
show={showRejectModal}
|
|
1543
|
-
customComponent={
|
|
1544
|
-
<TagAndInput
|
|
1545
|
-
inputType={"textarea"}
|
|
1546
|
-
inputId={"modal-message-box"}
|
|
1547
|
-
index={0}
|
|
1548
|
-
color={"white"}
|
|
1549
|
-
/>
|
|
1550
|
-
}
|
|
1551
|
-
buttons={[
|
|
1552
|
-
<ButtonV2
|
|
1553
|
-
key={"btn-Cancelar"}
|
|
1554
|
-
type={"white"}
|
|
1555
|
-
label={"Cancelar"}
|
|
1556
|
-
size={12}
|
|
1557
|
-
onClick={() => {
|
|
1558
|
-
setShowRejectModal(false);
|
|
1559
|
-
}}
|
|
1560
|
-
/>,
|
|
1561
|
-
<ButtonV2
|
|
1562
|
-
key={"btn-Aceptar"}
|
|
1563
|
-
type={"pink"}
|
|
1564
|
-
label={"Aceptar"}
|
|
1565
|
-
size={12}
|
|
1566
|
-
onClick={async () => {
|
|
1567
|
-
const body = document.querySelector(
|
|
1568
|
-
"#modal-message-box .ql-container .ql-editor > p"
|
|
1569
|
-
).innerHTML;
|
|
1570
|
-
const messages = [
|
|
1571
|
-
{ type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
|
|
1572
|
-
];
|
|
1573
|
-
await createComment(messages, activeRetailer.id);
|
|
1574
|
-
valRejAll ? validateAll("R") : sendToFacilitator("R");
|
|
1575
|
-
setMessage("Rechazado");
|
|
1576
|
-
setShowRejectModal(false);
|
|
1577
|
-
}}
|
|
1578
|
-
/>,
|
|
1579
|
-
]}
|
|
1580
|
-
/>
|
|
1581
|
-
)}
|
|
1582
1608
|
</Container>
|
|
1583
1609
|
);
|
|
1584
1610
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
-
import { fetchPOST } from "../../../global-files/handle_http";
|
|
3
2
|
|
|
4
3
|
export const getAuditVersion = async (articleId, setState, token) => {
|
|
5
4
|
const auditResponse = await axios.get(
|
|
@@ -33,39 +32,3 @@ export const getInputsData = (
|
|
|
33
32
|
setDescriptionState(descriptions);
|
|
34
33
|
}
|
|
35
34
|
};
|
|
36
|
-
|
|
37
|
-
export const translateService = (tab) => {
|
|
38
|
-
switch (tab) {
|
|
39
|
-
case "description":
|
|
40
|
-
case "Descripción":
|
|
41
|
-
return "Descripciones";
|
|
42
|
-
case "datasheet":
|
|
43
|
-
case "Ficha técnica":
|
|
44
|
-
return "Fichas técnicas";
|
|
45
|
-
case "images":
|
|
46
|
-
case "Imágenes":
|
|
47
|
-
return "Imágenes";
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const createMessage = (
|
|
52
|
-
retailers,
|
|
53
|
-
idRetailer,
|
|
54
|
-
oldStatus,
|
|
55
|
-
newStatus,
|
|
56
|
-
service
|
|
57
|
-
) => {
|
|
58
|
-
const [retailer] = retailers?.filter((ret) => ret.id === idRetailer) || [];
|
|
59
|
-
return `${translateService(service)} de ${
|
|
60
|
-
retailer.name
|
|
61
|
-
} |${oldStatus}| a |${newStatus}`;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const sendMessage = async (data) => {
|
|
65
|
-
const { paramsBody, paramsHeader } = data;
|
|
66
|
-
return fetchPOST(
|
|
67
|
-
process.env.REACT_APP_CREATE_MESSAGES,
|
|
68
|
-
paramsBody,
|
|
69
|
-
paramsHeader
|
|
70
|
-
);
|
|
71
|
-
};
|
package/src/index.js
CHANGED
|
@@ -33,13 +33,6 @@ export * from "./components/atoms/ImagePreview/index";
|
|
|
33
33
|
export * from "./components/atoms/InputText/index";
|
|
34
34
|
export * from "./components/atoms/NotFound/index";
|
|
35
35
|
export * from "./components/atoms/Tooltip/index";
|
|
36
|
-
export * from "./components/atoms/UserOption/index";
|
|
37
|
-
export * from "./components/atoms/UserCatalog/index";
|
|
38
|
-
export * from "./components/atoms/UserSelector/index";
|
|
39
|
-
export * from "./components/atoms/ImageCarousel/index";
|
|
40
|
-
export * from "./components/atoms/RetailersList/index";
|
|
41
|
-
export * from "./components/atoms/RetailerOption/index";
|
|
42
|
-
export * from "./components/atoms/RetailerCatalog/index";
|
|
43
36
|
|
|
44
37
|
//molecules
|
|
45
38
|
export * from "./components/molecules/AvatarAndValidation/index";
|
|
@@ -70,12 +63,6 @@ export * from "./components/molecules/ButtonDownloadFile/index";
|
|
|
70
63
|
export * from "./components/molecules/ImageTooltip/index";
|
|
71
64
|
export * from "./components/molecules/SelectV2/index";
|
|
72
65
|
export * from "./components/molecules/Dropdown/index";
|
|
73
|
-
export * from "./components/molecules/StripeCardForm/index";
|
|
74
|
-
export * from "./components/molecules/StripeCardSelector/index";
|
|
75
|
-
export * from "./components/molecules/GridItem/index";
|
|
76
|
-
export * from "./components/molecules/HeaderItem/index";
|
|
77
|
-
export * from "./components/molecules/RowItem/index";
|
|
78
|
-
export * from "./components/molecules/RetailerSelector/index";
|
|
79
66
|
|
|
80
67
|
//organisms
|
|
81
68
|
export * from "./components/organisms/ChangePassword/index";
|
|
@@ -92,9 +79,6 @@ export * from "./components/organisms/Modal/index";
|
|
|
92
79
|
export * from "./components/organisms/OrderDetail/index";
|
|
93
80
|
export * from "./components/organisms/RangeCalendar";
|
|
94
81
|
export * from "./components/organisms/TableResizable";
|
|
95
|
-
export * from "./components/organisms/SideModal/index";
|
|
96
|
-
export * from "./components/organisms/GridProducts/index";
|
|
97
|
-
export * from "./components/organisms/PanelLayout";
|
|
98
82
|
|
|
99
83
|
//pages
|
|
100
84
|
export * from "./components/pages/ChangePasswordLogin";
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = exports.ImageCarouselDefault = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _ = require(".");
|
|
13
|
-
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
16
|
-
var _default = {
|
|
17
|
-
title: "Components/atoms/ImageCarousel",
|
|
18
|
-
component: _.ImageCarousel
|
|
19
|
-
};
|
|
20
|
-
exports.default = _default;
|
|
21
|
-
|
|
22
|
-
var Template = function Template(args) {
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ImageCarousel, (0, _objectSpread2.default)({}, args));
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
var ImageCarouselDefault = Template.bind({});
|
|
27
|
-
exports.ImageCarouselDefault = ImageCarouselDefault;
|
|
28
|
-
ImageCarouselDefault.args = {
|
|
29
|
-
imageArray: [{
|
|
30
|
-
id: 35596,
|
|
31
|
-
status: null,
|
|
32
|
-
image_id: 1,
|
|
33
|
-
packing_type: "3",
|
|
34
|
-
image_type: "1",
|
|
35
|
-
article_id: "38443",
|
|
36
|
-
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMS1kNDQ2ZjIwNy0wYTkzLTQyNzgtYWZjNi01MTY2ZjIyY2EzNDMucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
|
|
37
|
-
timestamp: "2023-05-30T03:01:12.000Z",
|
|
38
|
-
id_version: 15,
|
|
39
|
-
width: null,
|
|
40
|
-
height: null,
|
|
41
|
-
scene_type: null,
|
|
42
|
-
image_shot_type: null,
|
|
43
|
-
last_modified: "2023-06-05T23:49:49.000Z",
|
|
44
|
-
name: "Central (Frente Comercial)",
|
|
45
|
-
version: 15,
|
|
46
|
-
ext: "png",
|
|
47
|
-
uuid: "d446f207-0a93-4278-afc6-5166f22ca343",
|
|
48
|
-
srcDB: "id-38443/15/1-d446f207-0a93-4278-afc6-5166f22ca343.png"
|
|
49
|
-
}, {
|
|
50
|
-
id: 35597,
|
|
51
|
-
status: null,
|
|
52
|
-
image_id: 3,
|
|
53
|
-
packing_type: "3",
|
|
54
|
-
image_type: "1",
|
|
55
|
-
article_id: "38443",
|
|
56
|
-
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMy0yOTZkMzU3ZC00OTUzLTRiMzktYjFjMy04YWZmZDI2NDgwMWIucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
|
|
57
|
-
timestamp: "2023-05-30T03:01:12.000Z",
|
|
58
|
-
id_version: 15,
|
|
59
|
-
width: null,
|
|
60
|
-
height: null,
|
|
61
|
-
scene_type: null,
|
|
62
|
-
image_shot_type: null,
|
|
63
|
-
last_modified: "2023-06-05T23:49:49.000Z",
|
|
64
|
-
name: "Trasera (Back)",
|
|
65
|
-
version: 15,
|
|
66
|
-
ext: "png",
|
|
67
|
-
uuid: "296d357d-4953-4b39-b1c3-8affd264801b",
|
|
68
|
-
srcDB: "id-38443/15/3-296d357d-4953-4b39-b1c3-8affd264801b.png"
|
|
69
|
-
}, {
|
|
70
|
-
id: 35598,
|
|
71
|
-
status: null,
|
|
72
|
-
image_id: 16,
|
|
73
|
-
packing_type: "3",
|
|
74
|
-
image_type: "1",
|
|
75
|
-
article_id: "38443",
|
|
76
|
-
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMTYtOGMzNDIzM2YtZTRiMC00MjU0LWFlYzUtZjEyN2ZiYjhkYmVkLnBuZyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MTAwMCwiaGVpZ2h0IjoxMDAwLCJmaXQiOiJjb250YWluIiwiYmFja2dyb3VuZCI6eyJyIjoyNTUsImciOjI1NSwiYiI6MjU1LCJhbHBoYSI6MX19fX0=",
|
|
77
|
-
timestamp: "2023-05-30T03:01:12.000Z",
|
|
78
|
-
id_version: 15,
|
|
79
|
-
width: null,
|
|
80
|
-
height: null,
|
|
81
|
-
scene_type: null,
|
|
82
|
-
image_shot_type: null,
|
|
83
|
-
last_modified: "2023-06-05T23:49:49.000Z",
|
|
84
|
-
name: "Detalle / Características 1",
|
|
85
|
-
version: 15,
|
|
86
|
-
ext: "png",
|
|
87
|
-
uuid: "8c34233f-e4b0-4254-aec5-f127fbb8dbed",
|
|
88
|
-
srcDB: "id-38443/15/16-8c34233f-e4b0-4254-aec5-f127fbb8dbed.png"
|
|
89
|
-
}]
|
|
90
|
-
};
|