contentoh-components-library 21.4.35 → 21.4.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/Avatar/index.js +3 -2
- package/dist/components/atoms/Card/index.js +46 -5
- package/dist/components/atoms/Card/styles.js +3 -1
- package/dist/components/atoms/CheckBox/index.js +7 -2
- 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 +68 -11
- package/dist/components/molecules/SignInLogin/index.js +16 -21
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +27 -8
- package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +350 -197
- package/dist/components/organisms/Chat/Footer/index.js +48 -39
- package/dist/components/organisms/Chat/index.js +49 -4
- 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 +6 -4
- package/dist/components/pages/ProviderProductEdition/index.js +117 -142
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +7 -3
- package/dist/components/pages/RetailerProductEdition/index.js +276 -274
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
- package/dist/index.js +247 -52
- package/package.json +4 -1
- package/src/assets/images/defaultImages/check_circle.svg +10 -0
- package/src/components/atoms/Avatar/index.js +8 -2
- package/src/components/atoms/Card/index.js +35 -2
- package/src/components/atoms/Card/styles.js +41 -5
- package/src/components/atoms/CheckBox/index.js +4 -1
- package/src/components/atoms/CheckBox/styles.js +2 -0
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
- package/src/components/atoms/ImageCarousel/index.js +103 -0
- package/src/components/atoms/ImageCarousel/styles.js +79 -0
- package/src/components/atoms/InputFormatter/styles.js +2 -1
- package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
- package/src/components/atoms/PercentTag/index.js +9 -0
- package/src/components/atoms/PercentTag/styles.js +69 -0
- package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
- package/src/components/atoms/RatingStars/index.js +31 -0
- package/src/components/atoms/RatingStars/styles.js +28 -0
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
- package/src/components/atoms/RetailerCatalog/index.js +49 -0
- package/src/components/atoms/RetailerCatalog/styles.js +30 -0
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
- package/src/components/atoms/RetailerOption/index.js +53 -0
- package/src/components/atoms/RetailerOption/styles.js +41 -0
- package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
- package/src/components/atoms/RetailersList/index.js +20 -0
- package/src/components/atoms/RetailersList/styles.js +19 -0
- package/src/components/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +67 -0
- package/src/components/atoms/UserCatalog/index.js +100 -0
- package/src/components/atoms/UserCatalog/styles.js +24 -0
- package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
- package/src/components/atoms/UserOption/index.js +95 -0
- package/src/components/atoms/UserOption/styles.js +61 -0
- package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
- package/src/components/atoms/UserSelector/index.js +86 -0
- package/src/components/atoms/UserSelector/styles.js +55 -0
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
- package/src/components/molecules/GridItem/index.js +105 -0
- package/src/components/molecules/GridItem/styles.js +104 -0
- package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
- package/src/components/molecules/HeaderItem/index.js +26 -0
- package/src/components/molecules/HeaderItem/styles.js +27 -0
- package/src/components/molecules/HeaderTop/index.js +52 -6
- package/src/components/molecules/RowItem/ColumnItem.js +9 -0
- package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
- package/src/components/molecules/RowItem/index.js +45 -0
- package/src/components/molecules/RowItem/styles.js +40 -0
- package/src/components/molecules/SignInLogin/index.js +1 -3
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +14 -0
- package/src/components/molecules/StripeCardForm/index.js +45 -0
- package/src/components/molecules/StripeCardForm/paymentForm.js +126 -0
- package/src/components/molecules/StripeCardForm/styles.js +84 -0
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -0
- package/src/components/molecules/StripeCardSelector/index.js +59 -0
- package/src/components/molecules/StripeCardSelector/styles.js +15 -0
- package/src/components/molecules/StripeCardSelector/utils.js +17 -0
- package/src/components/molecules/TagAndInput/index.js +10 -8
- package/src/components/organisms/Chat/Chat.stories.js +27 -7
- package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
- package/src/components/organisms/Chat/ContainerItems/styles.js +14 -2
- package/src/components/organisms/Chat/ContentChat/index.js +88 -12
- package/src/components/organisms/Chat/Footer/index.js +11 -0
- package/src/components/organisms/Chat/index.js +46 -4
- package/src/components/organisms/Chat/styles.js +4 -0
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/GridProducts/GridProducts.stories.js +5485 -0
- package/src/components/organisms/GridProducts/index.js +50 -0
- package/src/components/organisms/GridProducts/styles.js +14 -0
- package/src/components/organisms/GridProducts/utils.js +111 -0
- package/src/components/organisms/Modal/styles.js +4 -1
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
- package/src/components/organisms/PanelLayout/PanelLayout.stories.js +63 -0
- package/src/components/organisms/PanelLayout/index.js +11 -0
- package/src/components/organisms/PanelLayout/styles.js +39 -0
- package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
- package/src/components/organisms/SideModal/index.js +50 -0
- package/src/components/organisms/SideModal/styles.js +30 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +6 -4
- package/src/components/pages/ProviderProductEdition/index.js +97 -129
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +6 -2
- package/src/components/pages/RetailerProductEdition/index.js +111 -142
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/index.js +15 -0
|
@@ -24,15 +24,20 @@ 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";
|
|
28
27
|
import { GenericModal } from "../../atoms/GenericModal";
|
|
29
28
|
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
30
29
|
import { Loading } from "../../atoms/Loading";
|
|
31
30
|
import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
|
|
32
|
-
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
33
31
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
34
32
|
import { useCloseModal } from "../../../global-files/customHooks";
|
|
35
|
-
import {
|
|
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";
|
|
36
41
|
|
|
37
42
|
const reducerImages = (state, action) => {
|
|
38
43
|
let { values, attrForImgs, inputsByRetailer } = state;
|
|
@@ -132,6 +137,7 @@ export const RetailerProductEdition = ({
|
|
|
132
137
|
const [datasheets, setDatasheets] = useState([]);
|
|
133
138
|
const [images, setImages] = useReducer(reducerImages, {});
|
|
134
139
|
const [showModal, setShowModal] = useState(false);
|
|
140
|
+
const [showRejectModal, setShowRejectModal] = useState(false);
|
|
135
141
|
const { getRootProps, getInputProps } = useDropzone({
|
|
136
142
|
accept: "image/*",
|
|
137
143
|
noKeyboard: true,
|
|
@@ -218,6 +224,11 @@ export const RetailerProductEdition = ({
|
|
|
218
224
|
const [auditDescriptions, setAuditDescriptions] = useState([]);
|
|
219
225
|
const [auditImages, setAuditImages] = useState([]);
|
|
220
226
|
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([]);
|
|
221
232
|
|
|
222
233
|
useEffect(async () => {
|
|
223
234
|
const { id_article } = product?.article || {};
|
|
@@ -561,6 +572,7 @@ export const RetailerProductEdition = ({
|
|
|
561
572
|
active: images?.values?.some((value) => value?.image_id === e?.id),
|
|
562
573
|
}));
|
|
563
574
|
setSocketType(imageInputs);
|
|
575
|
+
console.log(images);
|
|
564
576
|
}, [images]);
|
|
565
577
|
|
|
566
578
|
const updateImages = useCallback(async () => {
|
|
@@ -859,11 +871,30 @@ export const RetailerProductEdition = ({
|
|
|
859
871
|
);
|
|
860
872
|
}
|
|
861
873
|
if (res.data.statusCode === 200) {
|
|
862
|
-
const
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
874
|
+
const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
|
|
875
|
+
res.data.body
|
|
876
|
+
);
|
|
877
|
+
const messageToChat = createMessage(
|
|
878
|
+
product.retailers,
|
|
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;
|
|
867
898
|
await loadData();
|
|
868
899
|
if (message) setMessage(message);
|
|
869
900
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
@@ -904,35 +935,19 @@ export const RetailerProductEdition = ({
|
|
|
904
935
|
return product?.article[`id_auditor`] === user.id_user;
|
|
905
936
|
};
|
|
906
937
|
|
|
907
|
-
const createComment = async (
|
|
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
|
-
}
|
|
938
|
+
const createComment = async (messages = [], retailerId) => {
|
|
921
939
|
const data = {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
929
|
-
headers: {
|
|
930
|
-
Authorization: token,
|
|
940
|
+
paramsBody: {
|
|
941
|
+
id: product.article.id_article,
|
|
942
|
+
version: version,
|
|
943
|
+
items: messages,
|
|
944
|
+
retailerId: retailerId,
|
|
945
|
+
status: product.status,
|
|
931
946
|
},
|
|
932
|
-
|
|
933
|
-
|
|
947
|
+
paramsHeader: { Authorization: token },
|
|
948
|
+
};
|
|
934
949
|
setMessage("");
|
|
935
|
-
|
|
950
|
+
return sendMessage(data);
|
|
936
951
|
};
|
|
937
952
|
|
|
938
953
|
const getRequired = (services) => {
|
|
@@ -1184,6 +1199,7 @@ export const RetailerProductEdition = ({
|
|
|
1184
1199
|
};
|
|
1185
1200
|
|
|
1186
1201
|
useEffect(() => {
|
|
1202
|
+
console.log(servicesData, "servicesData");
|
|
1187
1203
|
let status = getRetailerStatus(servicesData, activeTab);
|
|
1188
1204
|
setRetailerStatus(status);
|
|
1189
1205
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1214,8 +1230,8 @@ export const RetailerProductEdition = ({
|
|
|
1214
1230
|
break;
|
|
1215
1231
|
}
|
|
1216
1232
|
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1233
|
+
const messages = [];
|
|
1234
|
+
|
|
1219
1235
|
servicesData?.forEach((ret) => {
|
|
1220
1236
|
if (!retailersIds.includes(ret.id_retailer))
|
|
1221
1237
|
retailersIds.push(ret.id_retailer);
|
|
@@ -1240,19 +1256,19 @@ export const RetailerProductEdition = ({
|
|
|
1240
1256
|
})
|
|
1241
1257
|
);
|
|
1242
1258
|
});
|
|
1243
|
-
|
|
1244
1259
|
await Promise.all(evaluationArray);
|
|
1245
1260
|
|
|
1246
1261
|
const productTemp = product;
|
|
1247
1262
|
productTemp.status = `${result}A`;
|
|
1248
1263
|
productTemp.datasheet_status =
|
|
1249
|
-
productTemp.datasheet_status === "
|
|
1264
|
+
productTemp.datasheet_status === "NS" ? "NS" : `${result}A`;
|
|
1250
1265
|
productTemp.description_status =
|
|
1251
|
-
productTemp.description_status === "
|
|
1266
|
+
productTemp.description_status === "NS" ? "NS" : `${result}A`;
|
|
1252
1267
|
productTemp.images_status =
|
|
1253
|
-
productTemp.images_status === "
|
|
1268
|
+
productTemp.images_status === "NS" ? "NS" : `${result}A`;
|
|
1254
1269
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1255
1270
|
setProduct(productTemp);
|
|
1271
|
+
const messagesResponse = await Promise.all(messages);
|
|
1256
1272
|
|
|
1257
1273
|
await loadData();
|
|
1258
1274
|
} catch (error) {
|
|
@@ -1268,8 +1284,10 @@ export const RetailerProductEdition = ({
|
|
|
1268
1284
|
setCompare={setCompare}
|
|
1269
1285
|
isAuditor={[1, 6].includes(user.id_role)}
|
|
1270
1286
|
withChat={location?.state?.withChat}
|
|
1271
|
-
|
|
1287
|
+
chatType={location?.state?.chatType}
|
|
1288
|
+
productSelected={product}
|
|
1272
1289
|
token={token}
|
|
1290
|
+
activeRetailer={activeRetailer}
|
|
1273
1291
|
/>
|
|
1274
1292
|
<div className="data-container">
|
|
1275
1293
|
<div className="image-data-panel">
|
|
@@ -1309,36 +1327,7 @@ export const RetailerProductEdition = ({
|
|
|
1309
1327
|
sendToFacilitator("A");
|
|
1310
1328
|
}}
|
|
1311
1329
|
reject={() => {
|
|
1312
|
-
|
|
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
|
-
]);
|
|
1330
|
+
setShowRejectModal(true);
|
|
1342
1331
|
}}
|
|
1343
1332
|
showApproveRejectAll={
|
|
1344
1333
|
approveRejectAllButtons() && (auditorAssigned() || userAssigned())
|
|
@@ -1348,36 +1337,8 @@ export const RetailerProductEdition = ({
|
|
|
1348
1337
|
}
|
|
1349
1338
|
approveAll={() => validateAll("A")}
|
|
1350
1339
|
rejectAll={() => {
|
|
1351
|
-
|
|
1352
|
-
|
|
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
|
-
]);
|
|
1340
|
+
setShowRejectModal(true);
|
|
1341
|
+
setValRejAll(true);
|
|
1381
1342
|
}}
|
|
1382
1343
|
/>
|
|
1383
1344
|
<FullTabsMenu
|
|
@@ -1393,6 +1354,12 @@ export const RetailerProductEdition = ({
|
|
|
1393
1354
|
isRetailer={isRetailer}
|
|
1394
1355
|
showSaveButton={auditorAssigned() || userAssigned()}
|
|
1395
1356
|
version={version}
|
|
1357
|
+
desc={desc}
|
|
1358
|
+
setDesc={setDesc}
|
|
1359
|
+
fich={fich}
|
|
1360
|
+
setFich={setFich}
|
|
1361
|
+
imag={imag}
|
|
1362
|
+
setImag={setImag}
|
|
1396
1363
|
updatedDescriptions={updatedDescriptions}
|
|
1397
1364
|
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
1398
1365
|
updatedDatasheets={updatedDatasheets}
|
|
@@ -1507,47 +1474,6 @@ export const RetailerProductEdition = ({
|
|
|
1507
1474
|
{(userAssigned(activeTab) || auditorAssigned()) &&
|
|
1508
1475
|
product[`${getConcept(activeTab)}_status`] !== "NS" && (
|
|
1509
1476
|
<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
|
-
)}
|
|
1551
1477
|
{[7, 8].includes(user.id_role) && (
|
|
1552
1478
|
<Button
|
|
1553
1479
|
buttonType={
|
|
@@ -1605,6 +1531,49 @@ export const RetailerProductEdition = ({
|
|
|
1605
1531
|
jwt={token}
|
|
1606
1532
|
/>
|
|
1607
1533
|
)}
|
|
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
|
+
)}
|
|
1608
1577
|
</Container>
|
|
1609
1578
|
);
|
|
1610
1579
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
+
import { fetchPOST } from "../../../global-files/handle_http";
|
|
2
3
|
|
|
3
4
|
export const getAuditVersion = async (articleId, setState, token) => {
|
|
4
5
|
const auditResponse = await axios.get(
|
|
@@ -32,3 +33,39 @@ export const getInputsData = (
|
|
|
32
33
|
setDescriptionState(descriptions);
|
|
33
34
|
}
|
|
34
35
|
};
|
|
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,6 +33,13 @@ 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";
|
|
36
43
|
|
|
37
44
|
//molecules
|
|
38
45
|
export * from "./components/molecules/AvatarAndValidation/index";
|
|
@@ -63,6 +70,11 @@ export * from "./components/molecules/ButtonDownloadFile/index";
|
|
|
63
70
|
export * from "./components/molecules/ImageTooltip/index";
|
|
64
71
|
export * from "./components/molecules/SelectV2/index";
|
|
65
72
|
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";
|
|
66
78
|
|
|
67
79
|
//organisms
|
|
68
80
|
export * from "./components/organisms/ChangePassword/index";
|
|
@@ -79,6 +91,9 @@ export * from "./components/organisms/Modal/index";
|
|
|
79
91
|
export * from "./components/organisms/OrderDetail/index";
|
|
80
92
|
export * from "./components/organisms/RangeCalendar";
|
|
81
93
|
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";
|
|
82
97
|
|
|
83
98
|
//pages
|
|
84
99
|
export * from "./components/pages/ChangePasswordLogin";
|