contentoh-components-library 21.4.20 → 21.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.development +5 -2
- package/.env.production +3 -1
- 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/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/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/organisms/PanelLayout/PanelLayout.stories.js +87 -0
- package/dist/components/organisms/PanelLayout/index.js +29 -0
- package/dist/components/organisms/PanelLayout/styles.js +32 -0
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +60 -116
- 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 +8 -4
- package/dist/components/pages/RetailerProductEdition/index.js +316 -308
- 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/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/StripeCardForm/StripeCardForm.stories.js +13 -0
- package/src/components/molecules/StripeCardForm/index.js +42 -0
- package/src/components/molecules/StripeCardForm/paymentForm.js +124 -0
- package/src/components/molecules/StripeCardForm/styles.js +73 -0
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -0
- package/src/components/molecules/StripeCardSelector/index.js +44 -0
- package/src/components/molecules/StripeCardSelector/styles.js +4 -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 +10 -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/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 +66 -116
- 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 +7 -3
- package/src/components/pages/RetailerProductEdition/index.js +158 -184
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/index.js +16 -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 () => {
|
|
@@ -816,27 +828,26 @@ export const RetailerProductEdition = ({
|
|
|
816
828
|
const articleId = product.article.id_article;
|
|
817
829
|
const orderId = product.orderId;
|
|
818
830
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
831
|
+
let data = {
|
|
832
|
+
articleId,
|
|
833
|
+
orderId,
|
|
834
|
+
concept,
|
|
835
|
+
evalStatus,
|
|
836
|
+
retailerId: activeRetailer.id,
|
|
825
837
|
};
|
|
826
838
|
let res;
|
|
827
839
|
let message;
|
|
828
840
|
if (result) {
|
|
829
|
-
|
|
830
|
-
res = await axios.
|
|
831
|
-
`${process.env.
|
|
832
|
-
|
|
841
|
+
data.result = result;
|
|
842
|
+
res = await axios.put(
|
|
843
|
+
`${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
|
|
844
|
+
data,
|
|
833
845
|
{
|
|
834
846
|
headers: {
|
|
835
847
|
Authorization: token,
|
|
836
848
|
},
|
|
837
849
|
}
|
|
838
850
|
);
|
|
839
|
-
console.log(JSON.parse(res.data.body), "res");
|
|
840
851
|
getServices();
|
|
841
852
|
} else {
|
|
842
853
|
const specialistDone = ["RC", "RA", "CA"].includes(evalStatus);
|
|
@@ -848,22 +859,37 @@ export const RetailerProductEdition = ({
|
|
|
848
859
|
message = "Evaluación enviada";
|
|
849
860
|
getSectionIcon();
|
|
850
861
|
}
|
|
851
|
-
res = await axios.
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
Authorization: token,
|
|
857
|
-
},
|
|
858
|
-
}
|
|
859
|
-
);
|
|
862
|
+
res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
863
|
+
headers: {
|
|
864
|
+
Authorization: token,
|
|
865
|
+
},
|
|
866
|
+
});
|
|
860
867
|
}
|
|
861
868
|
if (res.data.statusCode === 200) {
|
|
862
|
-
const
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
869
|
+
const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
|
|
870
|
+
res.data.body
|
|
871
|
+
);
|
|
872
|
+
const messageToChat = createMessage(
|
|
873
|
+
product.retailers,
|
|
874
|
+
activeRetailer.id,
|
|
875
|
+
evalStatus,
|
|
876
|
+
newStatus,
|
|
877
|
+
activeTab
|
|
878
|
+
);
|
|
879
|
+
|
|
880
|
+
const data = {
|
|
881
|
+
paramsBody: {
|
|
882
|
+
id: product.article.id_article,
|
|
883
|
+
version: version,
|
|
884
|
+
items: [{ type: "status", value: messageToChat }],
|
|
885
|
+
retailerId: activeRetailer.id,
|
|
886
|
+
status: product.status,
|
|
887
|
+
},
|
|
888
|
+
paramsHeader: { Authorization: token },
|
|
889
|
+
};
|
|
890
|
+
await sendMessage(data);
|
|
891
|
+
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
892
|
+
productTemp[`${concept}_status`] = newStatus;
|
|
867
893
|
await loadData();
|
|
868
894
|
if (message) setMessage(message);
|
|
869
895
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
@@ -904,35 +930,19 @@ export const RetailerProductEdition = ({
|
|
|
904
930
|
return product?.article[`id_auditor`] === user.id_user;
|
|
905
931
|
};
|
|
906
932
|
|
|
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
|
-
}
|
|
933
|
+
const createComment = async (messages = [], retailerId) => {
|
|
921
934
|
const data = {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
929
|
-
headers: {
|
|
930
|
-
Authorization: token,
|
|
935
|
+
paramsBody: {
|
|
936
|
+
id: product.article.id_article,
|
|
937
|
+
version: version,
|
|
938
|
+
items: messages,
|
|
939
|
+
retailerId: retailerId,
|
|
940
|
+
status: product.status,
|
|
931
941
|
},
|
|
932
|
-
|
|
933
|
-
|
|
942
|
+
paramsHeader: { Authorization: token },
|
|
943
|
+
};
|
|
934
944
|
setMessage("");
|
|
935
|
-
|
|
945
|
+
return sendMessage(data);
|
|
936
946
|
};
|
|
937
947
|
|
|
938
948
|
const getRequired = (services) => {
|
|
@@ -1184,6 +1194,7 @@ export const RetailerProductEdition = ({
|
|
|
1184
1194
|
};
|
|
1185
1195
|
|
|
1186
1196
|
useEffect(() => {
|
|
1197
|
+
console.log(servicesData, "servicesData");
|
|
1187
1198
|
let status = getRetailerStatus(servicesData, activeTab);
|
|
1188
1199
|
setRetailerStatus(status);
|
|
1189
1200
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1200,7 +1211,7 @@ export const RetailerProductEdition = ({
|
|
|
1200
1211
|
try {
|
|
1201
1212
|
setLoading(true);
|
|
1202
1213
|
const evaluationArray = [];
|
|
1203
|
-
let conceptArray = [
|
|
1214
|
+
let conceptArray = [];
|
|
1204
1215
|
switch (user.id_role) {
|
|
1205
1216
|
case 4:
|
|
1206
1217
|
conceptArray = ["description", "datasheet"];
|
|
@@ -1214,45 +1225,55 @@ export const RetailerProductEdition = ({
|
|
|
1214
1225
|
break;
|
|
1215
1226
|
}
|
|
1216
1227
|
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1228
|
+
const messages = [];
|
|
1229
|
+
|
|
1219
1230
|
servicesData?.forEach((ret) => {
|
|
1220
|
-
if (
|
|
1221
|
-
|
|
1222
|
-
});
|
|
1223
|
-
const body = {
|
|
1224
|
-
orderArticleRetailers: [
|
|
1225
|
-
{
|
|
1226
|
-
orderId: product.id_order ?? product.orderId,
|
|
1231
|
+
if (conceptArray.includes(ret.service)) {
|
|
1232
|
+
let data = {
|
|
1227
1233
|
articleId: product.article.id_article,
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1234
|
+
orderId: product.id_order ?? product.orderId,
|
|
1235
|
+
concept: ret.service,
|
|
1236
|
+
result: result,
|
|
1237
|
+
evalStatus: ret.status,
|
|
1238
|
+
retailerId: ret.id_retailer,
|
|
1239
|
+
};
|
|
1240
|
+
if (product[`${ret.service}_status`] !== "NS") {
|
|
1241
|
+
const message = createMessage(
|
|
1242
|
+
product.retailers,
|
|
1243
|
+
ret.id_retailer,
|
|
1244
|
+
product[`${ret.service}_status`],
|
|
1245
|
+
`${result}A`,
|
|
1246
|
+
ret.service
|
|
1247
|
+
);
|
|
1248
|
+
messages.push(
|
|
1249
|
+
createComment(
|
|
1250
|
+
[{ type: "status", value: message }],
|
|
1251
|
+
ret.id_retailer
|
|
1252
|
+
)
|
|
1253
|
+
);
|
|
1254
|
+
}
|
|
1255
|
+
evaluationArray.push(
|
|
1256
|
+
axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
1257
|
+
headers: {
|
|
1258
|
+
Authorization: token,
|
|
1259
|
+
},
|
|
1260
|
+
})
|
|
1261
|
+
);
|
|
1262
|
+
}
|
|
1242
1263
|
});
|
|
1243
|
-
|
|
1244
1264
|
await Promise.all(evaluationArray);
|
|
1245
1265
|
|
|
1246
1266
|
const productTemp = product;
|
|
1247
1267
|
productTemp.status = `${result}A`;
|
|
1248
1268
|
productTemp.datasheet_status =
|
|
1249
|
-
productTemp.datasheet_status === "
|
|
1269
|
+
productTemp.datasheet_status === "NS" ? "NS" : `${result}A`;
|
|
1250
1270
|
productTemp.description_status =
|
|
1251
|
-
productTemp.description_status === "
|
|
1271
|
+
productTemp.description_status === "NS" ? "NS" : `${result}A`;
|
|
1252
1272
|
productTemp.images_status =
|
|
1253
|
-
productTemp.images_status === "
|
|
1273
|
+
productTemp.images_status === "NS" ? "NS" : `${result}A`;
|
|
1254
1274
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1255
1275
|
setProduct(productTemp);
|
|
1276
|
+
const messagesResponse = await Promise.all(messages);
|
|
1256
1277
|
|
|
1257
1278
|
await loadData();
|
|
1258
1279
|
} catch (error) {
|
|
@@ -1268,8 +1289,10 @@ export const RetailerProductEdition = ({
|
|
|
1268
1289
|
setCompare={setCompare}
|
|
1269
1290
|
isAuditor={[1, 6].includes(user.id_role)}
|
|
1270
1291
|
withChat={location?.state?.withChat}
|
|
1271
|
-
|
|
1292
|
+
chatType={location?.state?.chatType}
|
|
1293
|
+
productSelected={product}
|
|
1272
1294
|
token={token}
|
|
1295
|
+
activeRetailer={activeRetailer}
|
|
1273
1296
|
/>
|
|
1274
1297
|
<div className="data-container">
|
|
1275
1298
|
<div className="image-data-panel">
|
|
@@ -1309,36 +1332,7 @@ export const RetailerProductEdition = ({
|
|
|
1309
1332
|
sendToFacilitator("A");
|
|
1310
1333
|
}}
|
|
1311
1334
|
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
|
-
]);
|
|
1335
|
+
setShowRejectModal(true);
|
|
1342
1336
|
}}
|
|
1343
1337
|
showApproveRejectAll={
|
|
1344
1338
|
approveRejectAllButtons() && (auditorAssigned() || userAssigned())
|
|
@@ -1348,36 +1342,8 @@ export const RetailerProductEdition = ({
|
|
|
1348
1342
|
}
|
|
1349
1343
|
approveAll={() => validateAll("A")}
|
|
1350
1344
|
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
|
-
]);
|
|
1345
|
+
setShowRejectModal(true);
|
|
1346
|
+
setValRejAll(true);
|
|
1381
1347
|
}}
|
|
1382
1348
|
/>
|
|
1383
1349
|
<FullTabsMenu
|
|
@@ -1393,6 +1359,12 @@ export const RetailerProductEdition = ({
|
|
|
1393
1359
|
isRetailer={isRetailer}
|
|
1394
1360
|
showSaveButton={auditorAssigned() || userAssigned()}
|
|
1395
1361
|
version={version}
|
|
1362
|
+
desc={desc}
|
|
1363
|
+
setDesc={setDesc}
|
|
1364
|
+
fich={fich}
|
|
1365
|
+
setFich={setFich}
|
|
1366
|
+
imag={imag}
|
|
1367
|
+
setImag={setImag}
|
|
1396
1368
|
updatedDescriptions={updatedDescriptions}
|
|
1397
1369
|
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
1398
1370
|
updatedDatasheets={updatedDatasheets}
|
|
@@ -1507,47 +1479,6 @@ export const RetailerProductEdition = ({
|
|
|
1507
1479
|
{(userAssigned(activeTab) || auditorAssigned()) &&
|
|
1508
1480
|
product[`${getConcept(activeTab)}_status`] !== "NS" && (
|
|
1509
1481
|
<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
1482
|
{[7, 8].includes(user.id_role) && (
|
|
1552
1483
|
<Button
|
|
1553
1484
|
buttonType={
|
|
@@ -1605,6 +1536,49 @@ export const RetailerProductEdition = ({
|
|
|
1605
1536
|
jwt={token}
|
|
1606
1537
|
/>
|
|
1607
1538
|
)}
|
|
1539
|
+
{showRejectModal && (
|
|
1540
|
+
<Modal
|
|
1541
|
+
title={`Agregar mensaje de rechazo para ${activeTab?.toLowerCase()}`}
|
|
1542
|
+
show={showRejectModal}
|
|
1543
|
+
customComponent={
|
|
1544
|
+
<TagAndInput
|
|
1545
|
+
inputType={"textarea"}
|
|
1546
|
+
inputId={"modal-message-box"}
|
|
1547
|
+
index={0}
|
|
1548
|
+
color={"white"}
|
|
1549
|
+
/>
|
|
1550
|
+
}
|
|
1551
|
+
buttons={[
|
|
1552
|
+
<ButtonV2
|
|
1553
|
+
key={"btn-Cancelar"}
|
|
1554
|
+
type={"white"}
|
|
1555
|
+
label={"Cancelar"}
|
|
1556
|
+
size={12}
|
|
1557
|
+
onClick={() => {
|
|
1558
|
+
setShowRejectModal(false);
|
|
1559
|
+
}}
|
|
1560
|
+
/>,
|
|
1561
|
+
<ButtonV2
|
|
1562
|
+
key={"btn-Aceptar"}
|
|
1563
|
+
type={"pink"}
|
|
1564
|
+
label={"Aceptar"}
|
|
1565
|
+
size={12}
|
|
1566
|
+
onClick={async () => {
|
|
1567
|
+
const body = document.querySelector(
|
|
1568
|
+
"#modal-message-box .ql-container .ql-editor > p"
|
|
1569
|
+
).innerHTML;
|
|
1570
|
+
const messages = [
|
|
1571
|
+
{ type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
|
|
1572
|
+
];
|
|
1573
|
+
await createComment(messages, activeRetailer.id);
|
|
1574
|
+
valRejAll ? validateAll("R") : sendToFacilitator("R");
|
|
1575
|
+
setMessage("Rechazado");
|
|
1576
|
+
setShowRejectModal(false);
|
|
1577
|
+
}}
|
|
1578
|
+
/>,
|
|
1579
|
+
]}
|
|
1580
|
+
/>
|
|
1581
|
+
)}
|
|
1608
1582
|
</Container>
|
|
1609
1583
|
);
|
|
1610
1584
|
};
|
|
@@ -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,12 @@ 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";
|
|
78
|
+
export * from "./components/molecules/RetailerSelector/index";
|
|
66
79
|
|
|
67
80
|
//organisms
|
|
68
81
|
export * from "./components/organisms/ChangePassword/index";
|
|
@@ -79,6 +92,9 @@ export * from "./components/organisms/Modal/index";
|
|
|
79
92
|
export * from "./components/organisms/OrderDetail/index";
|
|
80
93
|
export * from "./components/organisms/RangeCalendar";
|
|
81
94
|
export * from "./components/organisms/TableResizable";
|
|
95
|
+
export * from "./components/organisms/SideModal/index";
|
|
96
|
+
export * from "./components/organisms/GridProducts/index";
|
|
97
|
+
export * from "./components/organisms/PanelLayout";
|
|
82
98
|
|
|
83
99
|
//pages
|
|
84
100
|
export * from "./components/pages/ChangePasswordLogin";
|