contentoh-components-library 21.4.16 → 21.4.17
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 +1 -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/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 +120 -88
- package/dist/components/pages/ProviderProductEdition/index.js +200 -216
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +52 -56
- package/dist/components/pages/RetailerProductEdition/index.js +300 -318
- 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/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 +127 -95
- package/src/components/pages/ProviderProductEdition/index.js +129 -135
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +52 -55
- package/src/components/pages/RetailerProductEdition/index.js +136 -124
- 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/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 -33
- 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 || {};
|
|
@@ -513,7 +502,6 @@ export const RetailerProductEdition = ({
|
|
|
513
502
|
JSON.stringify(productTemp)
|
|
514
503
|
);
|
|
515
504
|
|
|
516
|
-
setUpdatedDescriptions([]);
|
|
517
505
|
setMessage("Descripciones guardadas con éxito");
|
|
518
506
|
await loadData();
|
|
519
507
|
}
|
|
@@ -554,7 +542,7 @@ export const RetailerProductEdition = ({
|
|
|
554
542
|
"productSelected",
|
|
555
543
|
JSON.stringify(productTemp)
|
|
556
544
|
);
|
|
557
|
-
|
|
545
|
+
|
|
558
546
|
setMessage("Fichas técnicas guardadas");
|
|
559
547
|
await loadData();
|
|
560
548
|
}
|
|
@@ -572,7 +560,6 @@ export const RetailerProductEdition = ({
|
|
|
572
560
|
active: images?.values?.some((value) => value?.image_id === e?.id),
|
|
573
561
|
}));
|
|
574
562
|
setSocketType(imageInputs);
|
|
575
|
-
console.log(images);
|
|
576
563
|
}, [images]);
|
|
577
564
|
|
|
578
565
|
const updateImages = useCallback(async () => {
|
|
@@ -686,7 +673,6 @@ export const RetailerProductEdition = ({
|
|
|
686
673
|
"productSelected",
|
|
687
674
|
JSON.stringify(productTemp)
|
|
688
675
|
);
|
|
689
|
-
setImages({});
|
|
690
676
|
setMessage("Imágenes guardadas con éxito");
|
|
691
677
|
sessionStorage.removeItem("imagesList");
|
|
692
678
|
await loadData();
|
|
@@ -869,25 +855,6 @@ export const RetailerProductEdition = ({
|
|
|
869
855
|
const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
|
|
870
856
|
res.data.body
|
|
871
857
|
);
|
|
872
|
-
const messageToChat = createMessage(
|
|
873
|
-
product.retailers,
|
|
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
858
|
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
892
859
|
productTemp[`${concept}_status`] = newStatus;
|
|
893
860
|
await loadData();
|
|
@@ -930,19 +897,35 @@ export const RetailerProductEdition = ({
|
|
|
930
897
|
return product?.article[`id_auditor`] === user.id_user;
|
|
931
898
|
};
|
|
932
899
|
|
|
933
|
-
const createComment = async (
|
|
900
|
+
const createComment = async (e, body, tab) => {
|
|
901
|
+
let concept = "";
|
|
902
|
+
switch (activeTab) {
|
|
903
|
+
case "Ficha técnica":
|
|
904
|
+
concept = "datasheet";
|
|
905
|
+
break;
|
|
906
|
+
case "Imágenes":
|
|
907
|
+
concept = "images";
|
|
908
|
+
break;
|
|
909
|
+
|
|
910
|
+
default:
|
|
911
|
+
concept = "description";
|
|
912
|
+
break;
|
|
913
|
+
}
|
|
934
914
|
const data = {
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
status: product.status,
|
|
941
|
-
},
|
|
942
|
-
paramsHeader: { Authorization: token },
|
|
915
|
+
articleId: product?.article?.id_article,
|
|
916
|
+
orderId: product?.orderId,
|
|
917
|
+
message: body?.replace(/<.*?\/?>/gm, ""),
|
|
918
|
+
concept: concept,
|
|
919
|
+
version: version,
|
|
943
920
|
};
|
|
921
|
+
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
922
|
+
headers: {
|
|
923
|
+
Authorization: token,
|
|
924
|
+
},
|
|
925
|
+
});
|
|
926
|
+
await getComments(tab);
|
|
944
927
|
setMessage("");
|
|
945
|
-
|
|
928
|
+
setComponentsArray([]);
|
|
946
929
|
};
|
|
947
930
|
|
|
948
931
|
const getRequired = (services) => {
|
|
@@ -1194,7 +1177,6 @@ export const RetailerProductEdition = ({
|
|
|
1194
1177
|
};
|
|
1195
1178
|
|
|
1196
1179
|
useEffect(() => {
|
|
1197
|
-
console.log(servicesData, "servicesData");
|
|
1198
1180
|
let status = getRetailerStatus(servicesData, activeTab);
|
|
1199
1181
|
setRetailerStatus(status);
|
|
1200
1182
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1225,8 +1207,6 @@ export const RetailerProductEdition = ({
|
|
|
1225
1207
|
break;
|
|
1226
1208
|
}
|
|
1227
1209
|
|
|
1228
|
-
const messages = [];
|
|
1229
|
-
|
|
1230
1210
|
servicesData?.forEach((ret) => {
|
|
1231
1211
|
if (conceptArray.includes(ret.service)) {
|
|
1232
1212
|
let data = {
|
|
@@ -1237,21 +1217,6 @@ export const RetailerProductEdition = ({
|
|
|
1237
1217
|
evalStatus: ret.status,
|
|
1238
1218
|
retailerId: ret.id_retailer,
|
|
1239
1219
|
};
|
|
1240
|
-
if (product[`${ret.service}_status`] !== "NS") {
|
|
1241
|
-
const message = createMessage(
|
|
1242
|
-
product.retailers,
|
|
1243
|
-
ret.id_retailer,
|
|
1244
|
-
product[`${ret.service}_status`],
|
|
1245
|
-
`${result}A`,
|
|
1246
|
-
ret.service
|
|
1247
|
-
);
|
|
1248
|
-
messages.push(
|
|
1249
|
-
createComment(
|
|
1250
|
-
[{ type: "status", value: message }],
|
|
1251
|
-
ret.id_retailer
|
|
1252
|
-
)
|
|
1253
|
-
);
|
|
1254
|
-
}
|
|
1255
1220
|
evaluationArray.push(
|
|
1256
1221
|
axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
1257
1222
|
headers: {
|
|
@@ -1261,19 +1226,19 @@ export const RetailerProductEdition = ({
|
|
|
1261
1226
|
);
|
|
1262
1227
|
}
|
|
1263
1228
|
});
|
|
1229
|
+
|
|
1264
1230
|
await Promise.all(evaluationArray);
|
|
1265
1231
|
|
|
1266
1232
|
const productTemp = product;
|
|
1267
1233
|
productTemp.status = `${result}A`;
|
|
1268
1234
|
productTemp.datasheet_status =
|
|
1269
|
-
productTemp.datasheet_status === "
|
|
1235
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
|
|
1270
1236
|
productTemp.description_status =
|
|
1271
|
-
productTemp.description_status === "
|
|
1237
|
+
productTemp.description_status === "NA" ? "NA" : `${result}A`;
|
|
1272
1238
|
productTemp.images_status =
|
|
1273
|
-
productTemp.images_status === "
|
|
1239
|
+
productTemp.images_status === "NA" ? "NA" : `${result}A`;
|
|
1274
1240
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1275
1241
|
setProduct(productTemp);
|
|
1276
|
-
const messagesResponse = await Promise.all(messages);
|
|
1277
1242
|
|
|
1278
1243
|
await loadData();
|
|
1279
1244
|
} catch (error) {
|
|
@@ -1289,10 +1254,8 @@ export const RetailerProductEdition = ({
|
|
|
1289
1254
|
setCompare={setCompare}
|
|
1290
1255
|
isAuditor={[1, 6].includes(user.id_role)}
|
|
1291
1256
|
withChat={location?.state?.withChat}
|
|
1292
|
-
|
|
1293
|
-
productSelected={product}
|
|
1257
|
+
productSelected={productSelected}
|
|
1294
1258
|
token={token}
|
|
1295
|
-
activeRetailer={activeRetailer}
|
|
1296
1259
|
/>
|
|
1297
1260
|
<div className="data-container">
|
|
1298
1261
|
<div className="image-data-panel">
|
|
@@ -1332,7 +1295,36 @@ export const RetailerProductEdition = ({
|
|
|
1332
1295
|
sendToFacilitator("A");
|
|
1333
1296
|
}}
|
|
1334
1297
|
reject={() => {
|
|
1335
|
-
|
|
1298
|
+
sendToFacilitator("R");
|
|
1299
|
+
setMessage("Rechazado");
|
|
1300
|
+
setComponentsArray([
|
|
1301
|
+
<img src={errorModal} />,
|
|
1302
|
+
<ScreenHeader
|
|
1303
|
+
text={"Agrega tu comentarios para enviar el rechazo"}
|
|
1304
|
+
headerType={"input-name-header"}
|
|
1305
|
+
color={"white"}
|
|
1306
|
+
/>,
|
|
1307
|
+
<TagAndInput
|
|
1308
|
+
label={"Caja de Comentario"}
|
|
1309
|
+
inputType={"textarea"}
|
|
1310
|
+
inputId={"modal-commentary-box"}
|
|
1311
|
+
index={0}
|
|
1312
|
+
color={"white"}
|
|
1313
|
+
/>,
|
|
1314
|
+
<Button
|
|
1315
|
+
buttonType={"general-default-button"}
|
|
1316
|
+
label={"Enviar comentario"}
|
|
1317
|
+
onClick={(e) =>
|
|
1318
|
+
createComment(
|
|
1319
|
+
e,
|
|
1320
|
+
document.querySelector(
|
|
1321
|
+
"#modal-commentary-box .ql-container .ql-editor > p"
|
|
1322
|
+
).innerHTML,
|
|
1323
|
+
activeTab
|
|
1324
|
+
)
|
|
1325
|
+
}
|
|
1326
|
+
/>,
|
|
1327
|
+
]);
|
|
1336
1328
|
}}
|
|
1337
1329
|
showApproveRejectAll={
|
|
1338
1330
|
approveRejectAllButtons() && (auditorAssigned() || userAssigned())
|
|
@@ -1342,8 +1334,36 @@ export const RetailerProductEdition = ({
|
|
|
1342
1334
|
}
|
|
1343
1335
|
approveAll={() => validateAll("A")}
|
|
1344
1336
|
rejectAll={() => {
|
|
1345
|
-
|
|
1346
|
-
|
|
1337
|
+
validateAll("R");
|
|
1338
|
+
setMessage("Rechazado");
|
|
1339
|
+
setComponentsArray([
|
|
1340
|
+
<img src={errorModal} />,
|
|
1341
|
+
<ScreenHeader
|
|
1342
|
+
text={"Agrega tu comentarios para enviar el rechazo"}
|
|
1343
|
+
headerType={"input-name-header"}
|
|
1344
|
+
color={"white"}
|
|
1345
|
+
/>,
|
|
1346
|
+
<TagAndInput
|
|
1347
|
+
label={"Caja de Comentario"}
|
|
1348
|
+
inputType={"textarea"}
|
|
1349
|
+
inputId={"modal-commentary-box"}
|
|
1350
|
+
index={0}
|
|
1351
|
+
color={"white"}
|
|
1352
|
+
/>,
|
|
1353
|
+
<Button
|
|
1354
|
+
buttonType={"general-default-button"}
|
|
1355
|
+
label={"Enviar comentario"}
|
|
1356
|
+
onClick={(e) =>
|
|
1357
|
+
createComment(
|
|
1358
|
+
e,
|
|
1359
|
+
document.querySelector(
|
|
1360
|
+
"#modal-commentary-box .ql-container .ql-editor > p"
|
|
1361
|
+
).innerHTML,
|
|
1362
|
+
activeTab
|
|
1363
|
+
)
|
|
1364
|
+
}
|
|
1365
|
+
/>,
|
|
1366
|
+
]);
|
|
1347
1367
|
}}
|
|
1348
1368
|
/>
|
|
1349
1369
|
<FullTabsMenu
|
|
@@ -1359,12 +1379,6 @@ export const RetailerProductEdition = ({
|
|
|
1359
1379
|
isRetailer={isRetailer}
|
|
1360
1380
|
showSaveButton={auditorAssigned() || userAssigned()}
|
|
1361
1381
|
version={version}
|
|
1362
|
-
desc={desc}
|
|
1363
|
-
setDesc={setDesc}
|
|
1364
|
-
fich={fich}
|
|
1365
|
-
setFich={setFich}
|
|
1366
|
-
imag={imag}
|
|
1367
|
-
setImag={setImag}
|
|
1368
1382
|
updatedDescriptions={updatedDescriptions}
|
|
1369
1383
|
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
1370
1384
|
updatedDatasheets={updatedDatasheets}
|
|
@@ -1479,6 +1493,47 @@ export const RetailerProductEdition = ({
|
|
|
1479
1493
|
{(userAssigned(activeTab) || auditorAssigned()) &&
|
|
1480
1494
|
product[`${getConcept(activeTab)}_status`] !== "NS" && (
|
|
1481
1495
|
<div className="commentary-box">
|
|
1496
|
+
{!comment ? (
|
|
1497
|
+
<div className="commentary">
|
|
1498
|
+
<TagAndInput
|
|
1499
|
+
label={"Caja de Comentario"}
|
|
1500
|
+
inputType={"textarea"}
|
|
1501
|
+
inputCols={80}
|
|
1502
|
+
inputRows={4}
|
|
1503
|
+
inputId={"commentary-box"}
|
|
1504
|
+
index={0}
|
|
1505
|
+
/>
|
|
1506
|
+
<div className="buttons-box">
|
|
1507
|
+
<Button
|
|
1508
|
+
buttonType={"general-transparent-button"}
|
|
1509
|
+
label={"Enviar comentario"}
|
|
1510
|
+
onClick={(e) =>
|
|
1511
|
+
createComment(
|
|
1512
|
+
e,
|
|
1513
|
+
document.querySelector(
|
|
1514
|
+
"#commentary-box .ql-container .ql-editor > p"
|
|
1515
|
+
).innerHTML,
|
|
1516
|
+
activeTab
|
|
1517
|
+
)
|
|
1518
|
+
}
|
|
1519
|
+
/>
|
|
1520
|
+
</div>
|
|
1521
|
+
</div>
|
|
1522
|
+
) : (
|
|
1523
|
+
<div className="feedback-box">
|
|
1524
|
+
<Commentary
|
|
1525
|
+
comment={comment?.message?.replace(/<.*?\/?>/gm, "")}
|
|
1526
|
+
reviewed={crossComment}
|
|
1527
|
+
/>
|
|
1528
|
+
<Button
|
|
1529
|
+
buttonType={"circular-button accept-button"}
|
|
1530
|
+
onClick={async () => {
|
|
1531
|
+
setCrossComment(true);
|
|
1532
|
+
commentRevised();
|
|
1533
|
+
}}
|
|
1534
|
+
/>
|
|
1535
|
+
</div>
|
|
1536
|
+
)}
|
|
1482
1537
|
{[7, 8].includes(user.id_role) && (
|
|
1483
1538
|
<Button
|
|
1484
1539
|
buttonType={
|
|
@@ -1536,49 +1591,6 @@ export const RetailerProductEdition = ({
|
|
|
1536
1591
|
jwt={token}
|
|
1537
1592
|
/>
|
|
1538
1593
|
)}
|
|
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
1594
|
</Container>
|
|
1583
1595
|
);
|
|
1584
1596
|
};
|
|
@@ -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,76 +0,0 @@
|
|
|
1
|
-
import { ImageCarousel } from ".";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/atoms/ImageCarousel",
|
|
5
|
-
component: ImageCarousel,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const Template = (args) => <ImageCarousel {...args} />;
|
|
9
|
-
export const ImageCarouselDefault = Template.bind({});
|
|
10
|
-
ImageCarouselDefault.args = {
|
|
11
|
-
imageArray: [
|
|
12
|
-
{
|
|
13
|
-
id: 35596,
|
|
14
|
-
status: null,
|
|
15
|
-
image_id: 1,
|
|
16
|
-
packing_type: "3",
|
|
17
|
-
image_type: "1",
|
|
18
|
-
article_id: "38443",
|
|
19
|
-
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMS1kNDQ2ZjIwNy0wYTkzLTQyNzgtYWZjNi01MTY2ZjIyY2EzNDMucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
|
|
20
|
-
timestamp: "2023-05-30T03:01:12.000Z",
|
|
21
|
-
id_version: 15,
|
|
22
|
-
width: null,
|
|
23
|
-
height: null,
|
|
24
|
-
scene_type: null,
|
|
25
|
-
image_shot_type: null,
|
|
26
|
-
last_modified: "2023-06-05T23:49:49.000Z",
|
|
27
|
-
name: "Central (Frente Comercial)",
|
|
28
|
-
version: 15,
|
|
29
|
-
ext: "png",
|
|
30
|
-
uuid: "d446f207-0a93-4278-afc6-5166f22ca343",
|
|
31
|
-
srcDB: "id-38443/15/1-d446f207-0a93-4278-afc6-5166f22ca343.png",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: 35597,
|
|
35
|
-
status: null,
|
|
36
|
-
image_id: 3,
|
|
37
|
-
packing_type: "3",
|
|
38
|
-
image_type: "1",
|
|
39
|
-
article_id: "38443",
|
|
40
|
-
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMy0yOTZkMzU3ZC00OTUzLTRiMzktYjFjMy04YWZmZDI2NDgwMWIucG5nIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAwLCJoZWlnaHQiOjEwMDAsImZpdCI6ImNvbnRhaW4iLCJiYWNrZ3JvdW5kIjp7InIiOjI1NSwiZyI6MjU1LCJiIjoyNTUsImFscGhhIjoxfX19fQ==",
|
|
41
|
-
timestamp: "2023-05-30T03:01:12.000Z",
|
|
42
|
-
id_version: 15,
|
|
43
|
-
width: null,
|
|
44
|
-
height: null,
|
|
45
|
-
scene_type: null,
|
|
46
|
-
image_shot_type: null,
|
|
47
|
-
last_modified: "2023-06-05T23:49:49.000Z",
|
|
48
|
-
name: "Trasera (Back)",
|
|
49
|
-
version: 15,
|
|
50
|
-
ext: "png",
|
|
51
|
-
uuid: "296d357d-4953-4b39-b1c3-8affd264801b",
|
|
52
|
-
srcDB: "id-38443/15/3-296d357d-4953-4b39-b1c3-8affd264801b.png",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: 35598,
|
|
56
|
-
status: null,
|
|
57
|
-
image_id: 16,
|
|
58
|
-
packing_type: "3",
|
|
59
|
-
image_type: "1",
|
|
60
|
-
article_id: "38443",
|
|
61
|
-
src: "https://d24s337exbt5zr.cloudfront.net/eyJidWNrZXQiOiJjb250ZW50LW1hbmFnZW1lbnQtaW1hZ2VzIiwia2V5IjoiaWQtMzg0NDMvMTUvMTYtOGMzNDIzM2YtZTRiMC00MjU0LWFlYzUtZjEyN2ZiYjhkYmVkLnBuZyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MTAwMCwiaGVpZ2h0IjoxMDAwLCJmaXQiOiJjb250YWluIiwiYmFja2dyb3VuZCI6eyJyIjoyNTUsImciOjI1NSwiYiI6MjU1LCJhbHBoYSI6MX19fX0=",
|
|
62
|
-
timestamp: "2023-05-30T03:01:12.000Z",
|
|
63
|
-
id_version: 15,
|
|
64
|
-
width: null,
|
|
65
|
-
height: null,
|
|
66
|
-
scene_type: null,
|
|
67
|
-
image_shot_type: null,
|
|
68
|
-
last_modified: "2023-06-05T23:49:49.000Z",
|
|
69
|
-
name: "Detalle / Características 1",
|
|
70
|
-
version: 15,
|
|
71
|
-
ext: "png",
|
|
72
|
-
uuid: "8c34233f-e4b0-4254-aec5-f127fbb8dbed",
|
|
73
|
-
srcDB: "id-38443/15/16-8c34233f-e4b0-4254-aec5-f127fbb8dbed.png",
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { Container } from "./styles";
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
3
|
-
import ReactImageFallback from "react-image-fallback";
|
|
4
|
-
import spinner from "../../../assets/images/Icons/Spinner.gif";
|
|
5
|
-
import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos";
|
|
6
|
-
import productImage from "../../../assets/images/defaultImages/defaultProductImage.png";
|
|
7
|
-
|
|
8
|
-
export const ImageCarousel = ({ imageArray = [] }) => {
|
|
9
|
-
const [currentIndex, setCurrentIndex] = useState(0);
|
|
10
|
-
const [transitioning, setTransitioning] = useState(false);
|
|
11
|
-
const [isHover, setIsHover] = useState(false);
|
|
12
|
-
|
|
13
|
-
const goToNextSlide = () => {
|
|
14
|
-
if (!transitioning) {
|
|
15
|
-
setTransitioning(true);
|
|
16
|
-
setCurrentIndex((prevIndex) => (prevIndex + 1) % imageArray.length);
|
|
17
|
-
|
|
18
|
-
setTimeout(() => {
|
|
19
|
-
setTransitioning(false);
|
|
20
|
-
}, 500); // Adjust the transition duration to match your CSS
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const goToPrevSlide = () => {
|
|
25
|
-
if (!transitioning) {
|
|
26
|
-
setTransitioning(true);
|
|
27
|
-
setCurrentIndex(
|
|
28
|
-
(prevIndex) => (prevIndex - 1 + imageArray.length) % imageArray.length
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
setTimeout(() => {
|
|
32
|
-
setTransitioning(false);
|
|
33
|
-
}, 500); // Adjust the transition duration to match your CSS
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// useEffect(() => {
|
|
38
|
-
// const delay = 0;
|
|
39
|
-
// let repeat;
|
|
40
|
-
// setTimeout(() => {
|
|
41
|
-
// repeat = setInterval(() => {
|
|
42
|
-
// if (!isHover && imageArray.length > 1) goToNextSlide();
|
|
43
|
-
// }, 10000);
|
|
44
|
-
// }, delay);
|
|
45
|
-
// return () => {
|
|
46
|
-
// clearInterval(repeat);
|
|
47
|
-
// };
|
|
48
|
-
// }, [isHover]);
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<Container
|
|
52
|
-
// onMouseEnter={() => setIsHover(true)}
|
|
53
|
-
// onMouseLeave={() => setIsHover(false)}
|
|
54
|
-
>
|
|
55
|
-
{imageArray.length > 1 && (
|
|
56
|
-
<button
|
|
57
|
-
className="prev"
|
|
58
|
-
onClick={(e) => {
|
|
59
|
-
e.stopPropagation();
|
|
60
|
-
goToPrevSlide();
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
<ArrowBackIosIcon />
|
|
64
|
-
</button>
|
|
65
|
-
)}
|
|
66
|
-
<div className="slide-container">
|
|
67
|
-
{imageArray.length ? (
|
|
68
|
-
imageArray.map((img, index) => (
|
|
69
|
-
<div
|
|
70
|
-
key={index}
|
|
71
|
-
className={`image-container slide ${
|
|
72
|
-
index === currentIndex ? "active" : ""
|
|
73
|
-
}`}
|
|
74
|
-
>
|
|
75
|
-
<ReactImageFallback
|
|
76
|
-
key={index}
|
|
77
|
-
src={`https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${img.src}`}
|
|
78
|
-
fallbackImage={spinner}
|
|
79
|
-
alt={img?.name}
|
|
80
|
-
style={{
|
|
81
|
-
transform: `translateX(-${currentIndex * 100}%)`,
|
|
82
|
-
}}
|
|
83
|
-
/>
|
|
84
|
-
</div>
|
|
85
|
-
))
|
|
86
|
-
) : (
|
|
87
|
-
<img src={productImage} alt="not image" />
|
|
88
|
-
)}
|
|
89
|
-
</div>
|
|
90
|
-
{imageArray.length > 1 && (
|
|
91
|
-
<button
|
|
92
|
-
className="next"
|
|
93
|
-
onClick={(e) => {
|
|
94
|
-
e.stopPropagation();
|
|
95
|
-
goToNextSlide();
|
|
96
|
-
}}
|
|
97
|
-
>
|
|
98
|
-
<ArrowBackIosIcon />
|
|
99
|
-
</button>
|
|
100
|
-
)}
|
|
101
|
-
</Container>
|
|
102
|
-
);
|
|
103
|
-
};
|