contentoh-components-library 21.4.29 → 21.4.30
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 +2 -3
- package/dist/components/atoms/Card/index.js +5 -46
- package/dist/components/atoms/Card/styles.js +1 -3
- package/dist/components/atoms/CheckBox/index.js +2 -7
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/atoms/SliderToolTip/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- package/dist/components/organisms/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/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/.env.development +0 -39
- package/.env.production +0 -36
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
- package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -90
- package/dist/components/atoms/ImageCarousel/index.js +0 -120
- package/dist/components/atoms/ImageCarousel/styles.js +0 -18
- package/dist/components/atoms/PercentTag/PercentTag.stories.js +0 -31
- package/dist/components/atoms/PercentTag/index.js +0 -23
- package/dist/components/atoms/PercentTag/styles.js +0 -22
- package/dist/components/atoms/RatingStars/RatingStars.stories.js +0 -30
- package/dist/components/atoms/RatingStars/index.js +0 -53
- package/dist/components/atoms/RatingStars/styles.js +0 -18
- package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -48
- package/dist/components/atoms/RetailerCatalog/index.js +0 -69
- package/dist/components/atoms/RetailerCatalog/styles.js +0 -20
- package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +0 -33
- package/dist/components/atoms/RetailerOption/index.js +0 -62
- package/dist/components/atoms/RetailerOption/styles.js +0 -20
- package/dist/components/atoms/RetailersList/RetailersList.stories.js +0 -45
- package/dist/components/atoms/RetailersList/index.js +0 -46
- package/dist/components/atoms/RetailersList/styles.js +0 -18
- package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +0 -73
- package/dist/components/atoms/UserCatalog/index.js +0 -101
- package/dist/components/atoms/UserCatalog/styles.js +0 -18
- package/dist/components/atoms/UserOption/UserOption.stories.js +0 -40
- package/dist/components/atoms/UserOption/index.js +0 -130
- package/dist/components/atoms/UserOption/styles.js +0 -20
- package/dist/components/atoms/UserSelector/UserSelector.stories.js +0 -40
- package/dist/components/atoms/UserSelector/index.js +0 -98
- package/dist/components/atoms/UserSelector/styles.js +0 -32
- package/dist/components/molecules/GridItem/GridItem.stories.js +0 -123
- package/dist/components/molecules/GridItem/index.js +0 -152
- package/dist/components/molecules/GridItem/styles.js +0 -20
- package/dist/components/molecules/HeaderItem/ColumnItem.js +0 -23
- package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +0 -70
- package/dist/components/molecules/HeaderItem/index.js +0 -42
- package/dist/components/molecules/HeaderItem/styles.js +0 -30
- package/dist/components/molecules/RowItem/ColumnItem.js +0 -23
- package/dist/components/molecules/RowItem/RowItem.stories.js +0 -5242
- package/dist/components/molecules/RowItem/index.js +0 -58
- package/dist/components/molecules/RowItem/styles.js +0 -30
- package/dist/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -32
- package/dist/components/molecules/StripeCardForm/index.js +0 -94
- package/dist/components/molecules/StripeCardForm/paymentForm.js +0 -194
- package/dist/components/molecules/StripeCardForm/styles.js +0 -27
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -30
- package/dist/components/molecules/StripeCardSelector/index.js +0 -120
- package/dist/components/molecules/StripeCardSelector/styles.js +0 -22
- package/dist/components/molecules/StripeCardSelector/utils.js +0 -56
- package/dist/components/organisms/GridProducts/GridProducts.stories.js +0 -5097
- package/dist/components/organisms/GridProducts/index.js +0 -63
- package/dist/components/organisms/GridProducts/styles.js +0 -18
- package/dist/components/organisms/GridProducts/utils.js +0 -149
- package/dist/components/organisms/PanelLayout/PanelLayout.stories.js +0 -87
- package/dist/components/organisms/PanelLayout/index.js +0 -29
- package/dist/components/organisms/PanelLayout/styles.js +0 -32
- package/dist/components/organisms/SideModal/SideModal.stories.js +0 -42
- package/dist/components/organisms/SideModal/index.js +0 -72
- package/dist/components/organisms/SideModal/styles.js +0 -18
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
- package/src/components/atoms/ImageCarousel/index.js +0 -103
- package/src/components/atoms/ImageCarousel/styles.js +0 -79
- package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
- package/src/components/atoms/PercentTag/index.js +0 -9
- package/src/components/atoms/PercentTag/styles.js +0 -69
- package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
- package/src/components/atoms/RatingStars/index.js +0 -31
- package/src/components/atoms/RatingStars/styles.js +0 -28
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
- package/src/components/atoms/RetailerCatalog/index.js +0 -49
- package/src/components/atoms/RetailerCatalog/styles.js +0 -30
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
- package/src/components/atoms/RetailerOption/index.js +0 -53
- package/src/components/atoms/RetailerOption/styles.js +0 -41
- package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
- package/src/components/atoms/RetailersList/index.js +0 -20
- package/src/components/atoms/RetailersList/styles.js +0 -19
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
- package/src/components/atoms/UserCatalog/index.js +0 -100
- package/src/components/atoms/UserCatalog/styles.js +0 -24
- package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
- package/src/components/atoms/UserOption/index.js +0 -95
- package/src/components/atoms/UserOption/styles.js +0 -61
- package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
- package/src/components/atoms/UserSelector/index.js +0 -86
- package/src/components/atoms/UserSelector/styles.js +0 -55
- package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
- package/src/components/molecules/GridItem/index.js +0 -105
- package/src/components/molecules/GridItem/styles.js +0 -104
- package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
- package/src/components/molecules/HeaderItem/index.js +0 -26
- package/src/components/molecules/HeaderItem/styles.js +0 -27
- package/src/components/molecules/RowItem/ColumnItem.js +0 -9
- package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
- package/src/components/molecules/RowItem/index.js +0 -45
- package/src/components/molecules/RowItem/styles.js +0 -40
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -14
- package/src/components/molecules/StripeCardForm/index.js +0 -45
- package/src/components/molecules/StripeCardForm/paymentForm.js +0 -125
- package/src/components/molecules/StripeCardForm/styles.js +0 -74
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
- package/src/components/molecules/StripeCardSelector/index.js +0 -57
- package/src/components/molecules/StripeCardSelector/styles.js +0 -6
- 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";
|
package/.env.development
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
REACT_APP_ARTICLE_DATA_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/articles-data
|
|
2
|
-
REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/articles-data/datasheets
|
|
3
|
-
REACT_APP_ARTICLE_DATA_DESCRIPTION_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/articles-data/descriptions
|
|
4
|
-
REACT_APP_ARTICLE_DATA_IMAGES_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/articles-data/images
|
|
5
|
-
REACT_APP_ARTICLE_DATA_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/articles-data
|
|
6
|
-
REACT_APP_VALID_EXPORT_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/valid-export
|
|
7
|
-
REACT_APP_SERVICES_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/services
|
|
8
|
-
REACT_APP_EVALUATION_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/evaluations
|
|
9
|
-
REACT_APP_SEND_EVAL = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/eval-status
|
|
10
|
-
REACT_APP_COMMENTS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/comments
|
|
11
|
-
REACT_APP_USER_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/users
|
|
12
|
-
REACT_APP_ASSIGNATIONS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/assignations
|
|
13
|
-
REACT_APP_TASKS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/tasks
|
|
14
|
-
REACT_APP_USER_TASKS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/user-tasks
|
|
15
|
-
REACT_APP_CART = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/cart
|
|
16
|
-
REACT_APP_RETAILER_REQUEST = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/retailers-request
|
|
17
|
-
REACT_APP_VERSIONS_ENDPOINT = https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/versions
|
|
18
|
-
REACT_APP_RETAILER_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/retailers
|
|
19
|
-
REACT_APP_READ_ORDERS_BY_STATUS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/read-orders-by-status
|
|
20
|
-
REACT_APP_CATEGORY_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/categories
|
|
21
|
-
REACT_APP_READ_PROVIDERS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/providers
|
|
22
|
-
REACT_APP_PENDING_INVITATIONS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/pending-invitations
|
|
23
|
-
REACT_APP_PRODUCTS_CHAT_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/products-chat
|
|
24
|
-
REACT_APP_TICKETS_CHAT_ENDPOINT=https://ocqbzaa4a2.execute-api.us-east-1.amazonaws.com/dev/ticket-chat
|
|
25
|
-
REACT_APP_GET_AUDIT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/version-manager
|
|
26
|
-
REACT_APP_READ_MESSAGES=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/read-messages
|
|
27
|
-
REACT_APP_CREATE_MESSAGES=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/create-messages
|
|
28
|
-
REACT_APP_CARDS_ENDPOINT=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/cards
|
|
29
|
-
REACT_APP_PAYMENTS=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/payments
|
|
30
|
-
REACT_APP_EVALUATION_REFACTOR=https://fc069ovhuk.execute-api.us-east-1.amazonaws.com/dev/refactor-change-status
|
|
31
|
-
|
|
32
|
-
REACT_APP_IMAGES_ENDPOINT=https://content-management-images.s3.amazonaws.com
|
|
33
|
-
REACT_APP_IMAGES_BUCKET=content-management-images
|
|
34
|
-
REACT_APP_IMAGES_PROFILE_BUCKET=content-management-profile
|
|
35
|
-
REACT_APP_KUTS3=AKIA5CPHLQTTS22HCGHW
|
|
36
|
-
REACT_APP_AKUTS3=RSpwEaM0fsLEgN7BJzRyCKqyU0lNExTsPUvxyNXm
|
|
37
|
-
REACT_APP_USER_POOL_ID=us-east-1_XMZQdqkGj
|
|
38
|
-
REACT_APP_USER_POOL_WEB_CLIENT_ID=5ac8tpgs6gbsq13frvrpieep40
|
|
39
|
-
REACT_APP_KEY_STRIPE=pk_test_51J0bb0HCkqMP7wBlGPoEHU6bVLszHT5qHa1uPZp4ThgaMFYbvOAcKfI8q1fsWhbiO02Zn78lgYwuElcwfrA9rnaF00fA4q5zcs
|
package/.env.production
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
REACT_APP_ARTICLE_DATA_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/articles-data
|
|
2
|
-
REACT_APP_ARTICLE_DATA_DATASHEET_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/articles-data/datasheets
|
|
3
|
-
REACT_APP_ARTICLE_DATA_DESCRIPTION_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/articles-data/descriptions
|
|
4
|
-
REACT_APP_ARTICLE_DATA_IMAGES_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/articles-data/images
|
|
5
|
-
REACT_APP_ARTICLE_DATA_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/articles-data
|
|
6
|
-
REACT_APP_VALID_EXPORT_ENDPOINT = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/valid-export
|
|
7
|
-
REACT_APP_SERVICES_ENDPOINT = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/services
|
|
8
|
-
REACT_APP_EVALUATION_ENDPOINT = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/evaluations
|
|
9
|
-
REACT_APP_SEND_EVAL = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/eval-status
|
|
10
|
-
REACT_APP_COMMENTS_ENDPOINT = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/comments
|
|
11
|
-
REACT_APP_USER_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/users
|
|
12
|
-
REACT_APP_ASSIGNATIONS_ENDPOINT = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/assignations
|
|
13
|
-
REACT_APP_TASKS_ENDPOINT = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/tasks
|
|
14
|
-
REACT_APP_USER_TASKS_ENDPOINT = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/user-tasks
|
|
15
|
-
REACT_APP_CART = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/cart
|
|
16
|
-
REACT_APP_RETAILER_REQUEST = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/retailers-request
|
|
17
|
-
REACT_APP_VERSIONS_ENDPOINT = https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/versions
|
|
18
|
-
REACT_APP_RETAILER_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/retailers
|
|
19
|
-
REACT_APP_READ_ORDERS_BY_STATUS=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/read-orders-by-status
|
|
20
|
-
REACT_APP_CATEGORY_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/categories
|
|
21
|
-
REACT_APP_READ_PROVIDERS=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/providers
|
|
22
|
-
REACT_APP_PENDING_INVITATIONS=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/pending-invitations
|
|
23
|
-
REACT_APP_PRODUCTS_CHAT_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/products-chat
|
|
24
|
-
REACT_APP_TICKETS_CHAT_ENDPOINT=https://0g5ugr1kzl.execute-api.us-east-1.amazonaws.com/prod/ticket-chat
|
|
25
|
-
REACT_APP_GET_AUDIT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/version-manager
|
|
26
|
-
REACT_APP_CARDS_ENDPOINT=https://3v43slee1m.execute-api.us-east-1.amazonaws.com/prod/cards
|
|
27
|
-
|
|
28
|
-
REACT_APP_IMAGES_ENDPOINT=https://content-management-images.s3.amazonaws.com
|
|
29
|
-
REACT_APP_IMAGES_BUCKET=content-management-images-prod
|
|
30
|
-
REACT_APP_IMAGES_PROFILE_BUCKET=content-management-profile-prod
|
|
31
|
-
REACT_APP_KUTS3=AKIA5CPHLQTTS22HCGHW
|
|
32
|
-
REACT_APP_AKUTS3=RSpwEaM0fsLEgN7BJzRyCKqyU0lNExTsPUvxyNXm
|
|
33
|
-
REACT_APP_USER_POOL_ID=us-east-1_XMZQdqkGj
|
|
34
|
-
REACT_APP_USER_POOL_WEB_CLIENT_ID=5ac8tpgs6gbsq13frvrpieep40
|
|
35
|
-
|
|
36
|
-
REACT_APP_KEY_STRIPE=pk_live_51J0bb0HCkqMP7wBlz50UUsw9MCwMrIUKyRVE5tTBLMLm4Tz44FWckOfeJ41kj3NEyX6EvPqti1kMFSWrP7SFj6UX00dJ2D3xsm
|