contentoh-components-library 21.4.32 → 21.4.34
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/assets/fonts/roboto/LICENSE.txt +202 -0
- 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/SignInLogin/index.js +42 -28
- 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/Chat/styles.js +1 -1
- 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 +4 -6
- 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 +3 -7
- package/dist/components/pages/RetailerProductEdition/index.js +274 -276
- 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/SignInLogin/index.js +13 -11
- 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 -14
- 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/Chat/styles.js +0 -4
- 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 +4 -6
- 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 +2 -6
- package/src/components/pages/RetailerProductEdition/index.js +142 -111
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/index.js +0 -15
- package/src/assets/images/defaultImages/check_circle.svg +0 -10
- 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 -14
- package/src/components/molecules/StripeCardForm/index.js +0 -45
- package/src/components/molecules/StripeCardForm/paymentForm.js +0 -126
- package/src/components/molecules/StripeCardForm/styles.js +0 -84
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
- package/src/components/molecules/StripeCardSelector/index.js +0 -59
- package/src/components/molecules/StripeCardSelector/styles.js +0 -15
- 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 () => {
|
|
@@ -871,30 +859,11 @@ export const RetailerProductEdition = ({
|
|
|
871
859
|
);
|
|
872
860
|
}
|
|
873
861
|
if (res.data.statusCode === 200) {
|
|
874
|
-
const
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
activeRetailer.id,
|
|
880
|
-
evalStatus,
|
|
881
|
-
newStatus,
|
|
882
|
-
activeTab
|
|
883
|
-
);
|
|
884
|
-
|
|
885
|
-
const data = {
|
|
886
|
-
paramsBody: {
|
|
887
|
-
id: product.article.id_article,
|
|
888
|
-
version: version,
|
|
889
|
-
items: [{ type: "status", value: messageToChat }],
|
|
890
|
-
retailerId: activeRetailer.id,
|
|
891
|
-
status: product.status,
|
|
892
|
-
},
|
|
893
|
-
paramsHeader: { Authorization: token },
|
|
894
|
-
};
|
|
895
|
-
await sendMessage(data);
|
|
896
|
-
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
897
|
-
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`];
|
|
898
867
|
await loadData();
|
|
899
868
|
if (message) setMessage(message);
|
|
900
869
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
@@ -935,19 +904,35 @@ export const RetailerProductEdition = ({
|
|
|
935
904
|
return product?.article[`id_auditor`] === user.id_user;
|
|
936
905
|
};
|
|
937
906
|
|
|
938
|
-
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
|
+
}
|
|
939
921
|
const data = {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
status: product.status,
|
|
946
|
-
},
|
|
947
|
-
paramsHeader: { Authorization: token },
|
|
922
|
+
articleId: product?.article?.id_article,
|
|
923
|
+
orderId: product?.orderId,
|
|
924
|
+
message: body?.replace(/<.*?\/?>/gm, ""),
|
|
925
|
+
concept: concept,
|
|
926
|
+
version: version,
|
|
948
927
|
};
|
|
928
|
+
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
929
|
+
headers: {
|
|
930
|
+
Authorization: token,
|
|
931
|
+
},
|
|
932
|
+
});
|
|
933
|
+
await getComments(tab);
|
|
949
934
|
setMessage("");
|
|
950
|
-
|
|
935
|
+
setComponentsArray([]);
|
|
951
936
|
};
|
|
952
937
|
|
|
953
938
|
const getRequired = (services) => {
|
|
@@ -1199,7 +1184,6 @@ export const RetailerProductEdition = ({
|
|
|
1199
1184
|
};
|
|
1200
1185
|
|
|
1201
1186
|
useEffect(() => {
|
|
1202
|
-
console.log(servicesData, "servicesData");
|
|
1203
1187
|
let status = getRetailerStatus(servicesData, activeTab);
|
|
1204
1188
|
setRetailerStatus(status);
|
|
1205
1189
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1230,8 +1214,8 @@ export const RetailerProductEdition = ({
|
|
|
1230
1214
|
break;
|
|
1231
1215
|
}
|
|
1232
1216
|
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1217
|
+
const isAproved = result === "A";
|
|
1218
|
+
const retailersIds = [];
|
|
1235
1219
|
servicesData?.forEach((ret) => {
|
|
1236
1220
|
if (!retailersIds.includes(ret.id_retailer))
|
|
1237
1221
|
retailersIds.push(ret.id_retailer);
|
|
@@ -1256,19 +1240,19 @@ export const RetailerProductEdition = ({
|
|
|
1256
1240
|
})
|
|
1257
1241
|
);
|
|
1258
1242
|
});
|
|
1243
|
+
|
|
1259
1244
|
await Promise.all(evaluationArray);
|
|
1260
1245
|
|
|
1261
1246
|
const productTemp = product;
|
|
1262
1247
|
productTemp.status = `${result}A`;
|
|
1263
1248
|
productTemp.datasheet_status =
|
|
1264
|
-
productTemp.datasheet_status === "
|
|
1249
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
|
|
1265
1250
|
productTemp.description_status =
|
|
1266
|
-
productTemp.description_status === "
|
|
1251
|
+
productTemp.description_status === "NA" ? "NA" : `${result}A`;
|
|
1267
1252
|
productTemp.images_status =
|
|
1268
|
-
productTemp.images_status === "
|
|
1253
|
+
productTemp.images_status === "NA" ? "NA" : `${result}A`;
|
|
1269
1254
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1270
1255
|
setProduct(productTemp);
|
|
1271
|
-
const messagesResponse = await Promise.all(messages);
|
|
1272
1256
|
|
|
1273
1257
|
await loadData();
|
|
1274
1258
|
} catch (error) {
|
|
@@ -1284,10 +1268,8 @@ export const RetailerProductEdition = ({
|
|
|
1284
1268
|
setCompare={setCompare}
|
|
1285
1269
|
isAuditor={[1, 6].includes(user.id_role)}
|
|
1286
1270
|
withChat={location?.state?.withChat}
|
|
1287
|
-
|
|
1288
|
-
productSelected={product}
|
|
1271
|
+
productSelected={productSelected}
|
|
1289
1272
|
token={token}
|
|
1290
|
-
activeRetailer={activeRetailer}
|
|
1291
1273
|
/>
|
|
1292
1274
|
<div className="data-container">
|
|
1293
1275
|
<div className="image-data-panel">
|
|
@@ -1327,7 +1309,36 @@ export const RetailerProductEdition = ({
|
|
|
1327
1309
|
sendToFacilitator("A");
|
|
1328
1310
|
}}
|
|
1329
1311
|
reject={() => {
|
|
1330
|
-
|
|
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
|
+
]);
|
|
1331
1342
|
}}
|
|
1332
1343
|
showApproveRejectAll={
|
|
1333
1344
|
approveRejectAllButtons() && (auditorAssigned() || userAssigned())
|
|
@@ -1337,8 +1348,36 @@ export const RetailerProductEdition = ({
|
|
|
1337
1348
|
}
|
|
1338
1349
|
approveAll={() => validateAll("A")}
|
|
1339
1350
|
rejectAll={() => {
|
|
1340
|
-
|
|
1341
|
-
|
|
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
|
+
]);
|
|
1342
1381
|
}}
|
|
1343
1382
|
/>
|
|
1344
1383
|
<FullTabsMenu
|
|
@@ -1354,12 +1393,6 @@ export const RetailerProductEdition = ({
|
|
|
1354
1393
|
isRetailer={isRetailer}
|
|
1355
1394
|
showSaveButton={auditorAssigned() || userAssigned()}
|
|
1356
1395
|
version={version}
|
|
1357
|
-
desc={desc}
|
|
1358
|
-
setDesc={setDesc}
|
|
1359
|
-
fich={fich}
|
|
1360
|
-
setFich={setFich}
|
|
1361
|
-
imag={imag}
|
|
1362
|
-
setImag={setImag}
|
|
1363
1396
|
updatedDescriptions={updatedDescriptions}
|
|
1364
1397
|
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
1365
1398
|
updatedDatasheets={updatedDatasheets}
|
|
@@ -1474,6 +1507,47 @@ export const RetailerProductEdition = ({
|
|
|
1474
1507
|
{(userAssigned(activeTab) || auditorAssigned()) &&
|
|
1475
1508
|
product[`${getConcept(activeTab)}_status`] !== "NS" && (
|
|
1476
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
|
+
)}
|
|
1477
1551
|
{[7, 8].includes(user.id_role) && (
|
|
1478
1552
|
<Button
|
|
1479
1553
|
buttonType={
|
|
@@ -1531,49 +1605,6 @@ export const RetailerProductEdition = ({
|
|
|
1531
1605
|
jwt={token}
|
|
1532
1606
|
/>
|
|
1533
1607
|
)}
|
|
1534
|
-
{showRejectModal && (
|
|
1535
|
-
<Modal
|
|
1536
|
-
title={`Agregar mensaje de rechazo para ${activeTab?.toLowerCase()}`}
|
|
1537
|
-
show={showRejectModal}
|
|
1538
|
-
customComponent={
|
|
1539
|
-
<TagAndInput
|
|
1540
|
-
inputType={"textarea"}
|
|
1541
|
-
inputId={"modal-message-box"}
|
|
1542
|
-
index={0}
|
|
1543
|
-
color={"white"}
|
|
1544
|
-
/>
|
|
1545
|
-
}
|
|
1546
|
-
buttons={[
|
|
1547
|
-
<ButtonV2
|
|
1548
|
-
key={"btn-Cancelar"}
|
|
1549
|
-
type={"white"}
|
|
1550
|
-
label={"Cancelar"}
|
|
1551
|
-
size={12}
|
|
1552
|
-
onClick={() => {
|
|
1553
|
-
setShowRejectModal(false);
|
|
1554
|
-
}}
|
|
1555
|
-
/>,
|
|
1556
|
-
<ButtonV2
|
|
1557
|
-
key={"btn-Aceptar"}
|
|
1558
|
-
type={"pink"}
|
|
1559
|
-
label={"Aceptar"}
|
|
1560
|
-
size={12}
|
|
1561
|
-
onClick={async () => {
|
|
1562
|
-
const body = document.querySelector(
|
|
1563
|
-
"#modal-message-box .ql-container .ql-editor > p"
|
|
1564
|
-
).innerHTML;
|
|
1565
|
-
const messages = [
|
|
1566
|
-
{ type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
|
|
1567
|
-
];
|
|
1568
|
-
await createComment(messages, activeRetailer.id);
|
|
1569
|
-
valRejAll ? validateAll("R") : sendToFacilitator("R");
|
|
1570
|
-
setMessage("Rechazado");
|
|
1571
|
-
setShowRejectModal(false);
|
|
1572
|
-
}}
|
|
1573
|
-
/>,
|
|
1574
|
-
]}
|
|
1575
|
-
/>
|
|
1576
|
-
)}
|
|
1577
1608
|
</Container>
|
|
1578
1609
|
);
|
|
1579
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,11 +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
66
|
|
|
79
67
|
//organisms
|
|
80
68
|
export * from "./components/organisms/ChangePassword/index";
|
|
@@ -91,9 +79,6 @@ export * from "./components/organisms/Modal/index";
|
|
|
91
79
|
export * from "./components/organisms/OrderDetail/index";
|
|
92
80
|
export * from "./components/organisms/RangeCalendar";
|
|
93
81
|
export * from "./components/organisms/TableResizable";
|
|
94
|
-
export * from "./components/organisms/SideModal/index";
|
|
95
|
-
export * from "./components/organisms/GridProducts/index";
|
|
96
|
-
export * from "./components/organisms/PanelLayout";
|
|
97
82
|
|
|
98
83
|
//pages
|
|
99
84
|
export * from "./components/pages/ChangePasswordLogin";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g id="check_circle">
|
|
3
|
-
<mask id="mask0_204_774" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="14" height="14">
|
|
4
|
-
<rect id="Bounding box" width="14" height="14" fill="#D9D9D9"/>
|
|
5
|
-
</mask>
|
|
6
|
-
<g mask="url(#mask0_204_774)">
|
|
7
|
-
<path id="check_circle_2" d="M5.9675 10.185L10.92 5.2325L10.115 4.445L5.9675 8.5925L3.8675 6.4925L3.08 7.28L5.9675 10.185ZM7 14C6.04333 14 5.13917 13.8162 4.2875 13.4487C3.43583 13.0812 2.69208 12.5796 2.05625 11.9437C1.42042 11.3079 0.91875 10.5642 0.55125 9.7125C0.18375 8.86083 0 7.95667 0 7C0 6.03167 0.18375 5.12167 0.55125 4.27C0.91875 3.41833 1.42042 2.6775 2.05625 2.0475C2.69208 1.4175 3.43583 0.91875 4.2875 0.55125C5.13917 0.18375 6.04333 0 7 0C7.96833 0 8.87833 0.18375 9.73 0.55125C10.5817 0.91875 11.3225 1.4175 11.9525 2.0475C12.5825 2.6775 13.0812 3.41833 13.4487 4.27C13.8162 5.12167 14 6.03167 14 7C14 7.95667 13.8162 8.86083 13.4487 9.7125C13.0812 10.5642 12.5825 11.3079 11.9525 11.9437C11.3225 12.5796 10.5817 13.0812 9.73 13.4487C8.87833 13.8162 7.96833 14 7 14Z" fill="#8A6CAA"/>
|
|
8
|
-
</g>
|
|
9
|
-
</g>
|
|
10
|
-
</svg>
|
|
@@ -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
|
-
};
|