contentoh-components-library 21.1.59 → 21.1.62

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.
Files changed (32) hide show
  1. package/dist/components/atoms/GeneralInput/index.js +0 -1
  2. package/dist/components/atoms/InputFormatter/index.js +3 -3
  3. package/dist/components/molecules/HeaderTop/index.js +4 -1
  4. package/dist/components/molecules/RetailerSelector/index.js +31 -0
  5. package/dist/components/molecules/StatusAsignationInfo/index.js +3 -2
  6. package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
  7. package/dist/components/organisms/FullTabsMenu/index.js +3 -1
  8. package/dist/components/organisms/ImageDataTable/index.js +3 -6
  9. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +115 -65
  10. package/dist/components/pages/ProviderProductEdition/index.js +333 -382
  11. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +63 -110
  12. package/dist/components/pages/RetailerProductEdition/index.js +217 -225
  13. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  14. package/dist/global-files/data.js +9 -10
  15. package/dist/index.js +13 -0
  16. package/package.json +1 -1
  17. package/src/components/atoms/GeneralInput/index.js +0 -1
  18. package/src/components/atoms/InputFormatter/index.js +6 -3
  19. package/src/components/molecules/HeaderTop/index.js +6 -1
  20. package/src/components/molecules/RetailerSelector/index.js +12 -0
  21. package/src/components/molecules/StatusAsignationInfo/index.js +3 -2
  22. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  23. package/src/components/organisms/FullTabsMenu/index.js +2 -0
  24. package/src/components/organisms/ImageDataTable/index.js +2 -5
  25. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +133 -71
  26. package/src/components/pages/ProviderProductEdition/index.js +208 -222
  27. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +59 -111
  28. package/src/components/pages/RetailerProductEdition/index.js +173 -148
  29. package/src/components/pages/RetailerProductEdition/styles.js +1 -1
  30. package/src/global-files/data.js +9 -10
  31. package/src/index.js +1 -0
  32. package/src/components/atoms/StatusTag/StatusTag.stories.js +0 -28
@@ -177,7 +177,6 @@ export const ProviderProductEdition = ({
177
177
  const isRetailer = user?.is_retailer;
178
178
  const [loading, setLoading] = useState(true);
179
179
  const [statusArray, setStatusArray] = useState([]);
180
- console.log(retailerStatus, "retailerStatus");
181
180
 
182
181
  const originProp = location?.state?.origin;
183
182
  const [origin, setOrigin] = useState({
@@ -209,9 +208,6 @@ export const ProviderProductEdition = ({
209
208
  const [modalViewTextArea, setModalViewTextArea] = useState(false);
210
209
  const [socketType, setSocketType] = useState(null);
211
210
  const [saving, setSaving] = useState(loading);
212
- const [retailerStatus, setRetailerStatus] = useState(
213
- product.statusByRetailer
214
- );
215
211
 
216
212
  useEffect(() => {
217
213
  checkAll && setSelectedImages(images.values);
@@ -237,8 +233,11 @@ export const ProviderProductEdition = ({
237
233
  );
238
234
  }
239
235
 
240
- // setActiveRetailer(product?.retailers[0]);
241
- setImages({ action: "init", init: services[2] });
236
+ //setActiveRetailer(product?.retailers[0]);
237
+ setImages({
238
+ action: "init",
239
+ init: services[2],
240
+ });
242
241
  if (services[2]?.values?.length > 0) setActiveImage(0);
243
242
 
244
243
  getPercentage({ data: [product] }).then((res) => setPercentages(res));
@@ -257,11 +256,10 @@ export const ProviderProductEdition = ({
257
256
  }&end=true`
258
257
  );
259
258
  const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
260
- const retailerResponse = parsedResponse?.map((srv) => srv.id_retailer);
261
259
  let retailers = product.retailers || product.retailersAvailable;
262
- let active = retailers?.find((retailer) =>
263
- retailerResponse.includes(retailer.id)
264
- );
260
+ let active = retailers?.filter((retailer) =>
261
+ parsedResponse?.map((srv) => srv.id_retailer).includes(retailer.id)
262
+ )[0];
265
263
  !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
266
264
  setServicesData(parsedResponse);
267
265
  }
@@ -282,15 +280,15 @@ export const ProviderProductEdition = ({
282
280
  if (revision && currentService === "AP") return true;
283
281
  } else {
284
282
  const { product } = productEdit;
285
- const isRequestWithoutContentoh =
286
- orgn === "RequestWithoutContentoh" &&
287
- (["R", "CA"].includes(currentService) ||
288
- (currentService === "RCA" &&
289
- (!product.id_order || !product.orderId)));
290
- const isRequestWithContentoh =
291
- orgn === "RequestWithContentoh" && currentService === "AA";
292
- const isContentoh = orgn === "Contentoh" && currentService === "AA";
293
- if (isContentoh || isRequestWithoutContentoh || isRequestWithContentoh)
283
+ if (
284
+ orgn === "Contentoh" ||
285
+ (["RECEIVED", "IN_PROGRESS"].includes(currentService) &&
286
+ orgn === "RequestWithoutContentoh") ||
287
+ (currentService === "AA" && orgn === "RequestWithContentoh") ||
288
+ (currentService === "RC" &&
289
+ orgn === "RequestWithoutContentoh" &&
290
+ (!product.id_order || !product.orderId))
291
+ )
294
292
  return true;
295
293
  }
296
294
  }
@@ -307,26 +305,26 @@ export const ProviderProductEdition = ({
307
305
  setInCart(arr.some((e) => e.articleId === product.id_article));
308
306
  };
309
307
 
310
- useEffect(() => {
308
+ useEffect(async () => {
311
309
  sessionStorage.setItem("user", JSON.stringify(user));
312
310
  loadData();
313
311
  getCart();
314
- fetchUsers(token).then((res) => setUserGroups(res));
312
+ setUserGroups(await fetchUsers(token));
315
313
  let arr = [];
316
- // ?? Que sentido tiene verificar los roles de colaborador en la app de proveedor
317
314
  switch (user.id_role) {
318
315
  case 7:
319
316
  case 8:
320
- arr = ["CA", "RC", "RA"];
317
+ arr = ["IN_PROGRESS", "RF", "RA"];
321
318
  break;
322
319
  case 4:
323
320
  case 5:
324
- arr = ["RC", "AC", "AA", "AP", "ACA"];
321
+ arr = ["RF", "AF", "AA", "AP", "AC"];
325
322
  break;
326
323
  case 6:
327
- arr = ["RP", "RCA", "AC"];
324
+ arr = ["RP", "RC", "AF"];
328
325
  break;
329
326
  default:
327
+ arr = [];
330
328
  break;
331
329
  }
332
330
  setStatusArray(arr);
@@ -344,9 +342,9 @@ export const ProviderProductEdition = ({
344
342
  const productTemp = product;
345
343
  const retailers = productTemp?.retailersAvailable || productTemp?.retailers;
346
344
  retailers?.forEach((retailer) => {
347
- retailer["percentage"] = percentages?.find(
345
+ retailer["percentage"] = percentages?.filter(
348
346
  (percent) => retailer?.id === percent?.id_retailer
349
- )?.percentage;
347
+ )[0]?.percentage;
350
348
  });
351
349
 
352
350
  setProduct(productTemp);
@@ -422,7 +420,7 @@ export const ProviderProductEdition = ({
422
420
  };
423
421
  if (product?.orderId) dataObject["orderId"] = product?.orderId;
424
422
  try {
425
- const res = await axios.put(
423
+ await axios.put(
426
424
  `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?description=true&version=${version}`,
427
425
  dataObject,
428
426
  {
@@ -431,10 +429,8 @@ export const ProviderProductEdition = ({
431
429
  },
432
430
  }
433
431
  );
434
- if (res.data.statusCode === 200) {
435
- setMessage("Descripciones guardadas con éxito");
436
- await loadData();
437
- }
432
+ setMessage("Descripciones guardadas con éxito");
433
+ loadData();
438
434
  } catch (error) {
439
435
  console.log(error);
440
436
  }
@@ -457,10 +453,8 @@ export const ProviderProductEdition = ({
457
453
  },
458
454
  }
459
455
  );
460
- if (res.data.statusCode === 200) {
461
- setMessage("Fichas técnicas guardadas");
462
- await loadData();
463
- }
456
+ setMessage("Fichas técnicas guardadas");
457
+ loadData();
464
458
  } catch (error) {
465
459
  console.log(error);
466
460
  }
@@ -558,7 +552,7 @@ export const ProviderProductEdition = ({
558
552
  return e;
559
553
  });
560
554
  try {
561
- const res = await axios.put(
555
+ await axios.put(
562
556
  `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
563
557
  dataImages,
564
558
  {
@@ -567,11 +561,9 @@ export const ProviderProductEdition = ({
567
561
  },
568
562
  }
569
563
  );
570
- if (res.data.statusCode === 200) {
571
- setMessage("Imágenes guardadas con éxito");
572
- sessionStorage.removeItem("imagesList");
573
- await loadData();
574
- }
564
+ setMessage("Imágenes guardadas con éxito");
565
+ sessionStorage.removeItem("imagesList");
566
+ loadData();
575
567
  } catch (error) {
576
568
  console.log(error);
577
569
  }
@@ -673,12 +665,12 @@ export const ProviderProductEdition = ({
673
665
  },
674
666
  ],
675
667
  concept: concept,
676
- userId: assignationId,
668
+ [`${assignationType}Id`]: assignationId,
677
669
  };
678
- await axios({
670
+ axios({
679
671
  method: "post",
680
672
  url: process.env.REACT_APP_ASSIGNATIONS_ENDPOINT,
681
- data,
673
+ data: data,
682
674
  headers: {
683
675
  Authorization: token,
684
676
  },
@@ -696,7 +688,7 @@ export const ProviderProductEdition = ({
696
688
  serv = serv.filter((f) => f.id_retailer === activeRetailer.id);
697
689
  }
698
690
  const statusArray =
699
- user.is_retailer === 1 ? ["ACA", "RCA"] : ["AP", "RP", "ACA"];
691
+ user.is_retailer === 1 ? ["AC", "RC"] : ["AP", "RP", "AC"];
700
692
  return (
701
693
  serv.length > 0 && serv.every((item) => statusArray.includes(item.status))
702
694
  );
@@ -799,7 +791,7 @@ export const ProviderProductEdition = ({
799
791
  const { datasheet_status, description_status, images_status } = product;
800
792
  const completionStates =
801
793
  user.is_retailer === 1
802
- ? ["ACA", "Evaluated", "NS"]
794
+ ? ["AC", "Evaluated", "NS"]
803
795
  : ["AP", "Evaluated", "NS"];
804
796
  const dsEvaluated = completionStates.includes(datasheet_status);
805
797
  const descsEvaluated = completionStates.includes(description_status);
@@ -812,69 +804,54 @@ export const ProviderProductEdition = ({
812
804
 
813
805
  const sendEvaluation = async (result) => {
814
806
  setLoading(true);
815
- const concept = getConcept(activeTab);
816
- const productTemp = product;
817
- const articleId = productTemp.id_article;
818
- const orderId = productTemp.id_order ?? productTemp.orderId;
819
- const sectionStatusKey = `${getConcept(activeTab)}_status`;
820
- const evalStatus = product[sectionStatusKey] || product?.version_status;
821
- let data = { articleId, orderId, concept, evalStatus };
807
+ let data = {};
822
808
  const retailerId = activeRetailer?.id;
823
- let res;
824
- try {
825
- if (result) {
826
- data.result = result;
827
- data.retailerId = retailerId;
828
- res = await axios.put(
829
- `${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
830
- data,
831
- {
832
- headers: {
833
- Authorization: token,
834
- },
835
- }
836
- );
837
- const newStatuses = JSON.parse(res.data.body);
838
- const orderStatus = newStatuses.newOrderStatus;
839
- const serviceStatus =
840
- newStatuses.newServiceStatus[articleId][
841
- `${getConcept(activeTab)}Status`
842
- ];
843
-
844
- const newProductEdit = productEdit;
845
- newProductEdit.product[sectionStatusKey] = serviceStatus;
846
- setProductEdit(newProductEdit);
847
- showSurvey &&
848
- showSurvey(!user.is_retailer && orderStatus[orderId] === "AP");
849
- } else {
850
- res = await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
851
- headers: {
852
- Authorization: token,
853
- },
854
- });
855
- }
856
- if (res.data.statusCode === 200) {
857
- const { newArticleStatus, newServiceStatus, newStatus } = JSON.parse(
858
- res.data.body
859
- );
860
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
861
- const retailerStatusCopy = { ...retailerStatus };
862
- retailerStatusCopy[activeRetailer.id][concept] = newStatus;
863
- setRetailerStatus(retailerStatusCopy);
864
- productTemp.statusByRetailer = retailerStatusCopy;
865
- let status;
866
- if (newServiceStatus) {
867
- status = newServiceStatus[articleId][`${concept}Status`];
868
- productTemp[`${concept}_status`] = status;
869
- }
870
- setProduct(productTemp);
871
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
872
- setOrigin((prev) => ({ ...prev, [concept]: status }));
873
- }
874
- } catch (err) {
875
- console.log(err);
809
+ if (result) {
810
+ data = {
811
+ articleId: product.id_article,
812
+ orderId: product.id_order ?? product.orderId,
813
+ concept: getConcept(activeTab),
814
+ result: result,
815
+ retailerId,
816
+ };
817
+ await axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
818
+ headers: {
819
+ Authorization: token,
820
+ },
821
+ });
822
+ } else {
823
+ const productTemp = product;
824
+ const concept = getConcept(activeTab);
825
+ productTemp[`${concept}_status`] = "Evaluated";
826
+ data = {
827
+ articleId: product.id_article,
828
+ orderId: product.id_order ?? product.orderId,
829
+ concept,
830
+ };
831
+ axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
832
+ headers: {
833
+ Authorization: token,
834
+ },
835
+ });
836
+ setProduct(productTemp);
837
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
838
+ setProductEdit({
839
+ ArticleId: productTemp.id_article,
840
+ idCategory: productTemp.article.id_category,
841
+ product: productTemp,
842
+ });
843
+ sessionStorage.setItem(
844
+ "productEdit",
845
+ JSON.stringify({
846
+ ArticleId: productTemp.id_article,
847
+ idCategory: productTemp.article.id_category,
848
+ product: productTemp,
849
+ })
850
+ );
851
+ setOrigin((prev) => ({ ...prev, [concept]: "Evaluated" }));
876
852
  }
877
853
  loadData();
854
+ showSurvey && showSurvey(confirmStatusComplete());
878
855
  };
879
856
 
880
857
  const validateAll = async (result) => {
@@ -920,24 +897,13 @@ export const ProviderProductEdition = ({
920
897
 
921
898
  await Promise.all(sendAll);
922
899
  const productTemp = product;
923
- productTemp.article_status = `${result}CA`;
900
+ productTemp.article_status = `${result}C`;
924
901
  productTemp.datasheet_status =
925
- productTemp.datasheet_status === "NA" ? "NA" : `${result}CA`;
902
+ productTemp.datasheet_status === "NA" ? "NA" : `${result}C`;
926
903
  productTemp.description_status =
927
- productTemp.description_status === "NA" ? "NA" : `${result}CA`;
904
+ productTemp.description_status === "NA" ? "NA" : `${result}C`;
928
905
  productTemp.images_status =
929
- productTemp.images_status === "NA" ? "NA" : `${result}CA`;
930
-
931
- const retailerStatusCopy = { ...retailerStatus };
932
- Object.keys(retailerStatusCopy).forEach((key) => {
933
- conceptArray.forEach((concept) => {
934
- if (retailerStatusCopy[key][concept]) {
935
- retailerStatusCopy[key][concept] = `${result}CA`;
936
- }
937
- });
938
- });
939
- setRetailerStatus(retailerStatusCopy);
940
- productTemp.statusByRetailer = retailerStatusCopy;
906
+ productTemp.images_status === "NA" ? "NA" : `${result}C`;
941
907
  setProduct(productTemp);
942
908
  sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
943
909
  setProductEdit({
@@ -954,7 +920,7 @@ export const ProviderProductEdition = ({
954
920
  })
955
921
  );
956
922
 
957
- await loadData();
923
+ loadData();
958
924
  } catch (error) {
959
925
  console.log(error);
960
926
  }
@@ -975,7 +941,7 @@ export const ProviderProductEdition = ({
975
941
  },
976
942
  });
977
943
  const prod = productEdit;
978
- const statusComplete = user.is_retailer ? `${result}CA` : `${result}P`;
944
+ const statusComplete = user.is_retailer ? `${result}C` : `${result}P`;
979
945
  prod.product.datasheet_status = statusComplete;
980
946
  prod.product.description_status = statusComplete;
981
947
  prod.product.images_status = statusComplete;
@@ -984,22 +950,24 @@ export const ProviderProductEdition = ({
984
950
  sessionStorage.setItem("productEdit", JSON.stringify(prod));
985
951
  setProduct(prod);
986
952
  setShowGenericModal && setShowGenericModal(false);
987
- await loadData();
953
+ loadData();
988
954
  };
989
955
 
990
956
  const getSectionStatus = () => {
991
957
  const concept = getConcept(activeTab);
992
- return ["AA", "AP", "R", "CA", "RCA"].includes(
958
+ return ["AA", "AP", "RECEIVED", "IN_PROGRESS", "RC"].includes(
993
959
  productEdit.product[`${concept}_status`]
994
960
  );
995
961
  };
996
962
 
997
963
  const enableActions = (versionStatus) => {
998
964
  try {
999
- if (user.is_retailer) return false;
965
+ const userIsRetailer = user.is_retailer;
966
+
967
+ if (userIsRetailer) return false;
1000
968
 
1001
969
  if (versionStatus) {
1002
- return ["AP", "ACA", "RCA", null].includes(versionStatus);
970
+ return ["AP", "AC", "RC", null].includes(versionStatus);
1003
971
  }
1004
972
  return true;
1005
973
  } catch (err) {
@@ -1089,21 +1057,23 @@ export const ProviderProductEdition = ({
1089
1057
  },
1090
1058
  }));
1091
1059
  setShowGenericModal(true);
1092
- } else if (user.is_retailer) {
1093
- if (product.id_order || product.orderId) {
1094
- validateAll("A");
1060
+ } else {
1061
+ if (user.is_retailer) {
1062
+ if (product.id_order || product.orderId) {
1063
+ validateAll("A");
1064
+ } else {
1065
+ setDataGenericModal((prev) => ({
1066
+ ...prev,
1067
+ button2: {
1068
+ name: "Continuar",
1069
+ action: () => evaluationToRetailer("A"),
1070
+ },
1071
+ }));
1072
+ setShowGenericModal(true);
1073
+ }
1095
1074
  } else {
1096
- setDataGenericModal((prev) => ({
1097
- ...prev,
1098
- button2: {
1099
- name: "Continuar",
1100
- action: () => evaluationToRetailer("A"),
1101
- },
1102
- }));
1103
- setShowGenericModal(true);
1075
+ validateAll("A");
1104
1076
  }
1105
- } else {
1106
- validateAll("A");
1107
1077
  }
1108
1078
  }}
1109
1079
  rejectAll={() => {
@@ -1113,23 +1083,25 @@ export const ProviderProductEdition = ({
1113
1083
  (!product.id_order || !product.orderId)
1114
1084
  ) {
1115
1085
  return;
1116
- } else if (user.is_retailer) {
1117
- if (product.id_order || product.orderId) {
1086
+ } else {
1087
+ if (user.is_retailer) {
1088
+ if (product.id_order || product.orderId) {
1089
+ validateAll("R");
1090
+ setModalViewError(true);
1091
+ } else {
1092
+ setDataGenericModal((prev) => ({
1093
+ ...prev,
1094
+ button2: {
1095
+ name: "Continuar",
1096
+ action: () => evaluationToRetailer("R"),
1097
+ },
1098
+ }));
1099
+ setShowGenericModal(true);
1100
+ }
1101
+ } else {
1118
1102
  validateAll("R");
1119
1103
  setModalViewError(true);
1120
- } else {
1121
- setDataGenericModal((prev) => ({
1122
- ...prev,
1123
- button2: {
1124
- name: "Continuar",
1125
- action: () => evaluationToRetailer("R"),
1126
- },
1127
- }));
1128
- setShowGenericModal(true);
1129
1104
  }
1130
- } else {
1131
- validateAll("R");
1132
- setModalViewError(true);
1133
1105
  }
1134
1106
  }}
1135
1107
  approve={() => {
@@ -1146,21 +1118,23 @@ export const ProviderProductEdition = ({
1146
1118
  },
1147
1119
  }));
1148
1120
  setShowGenericModal(true);
1149
- } else if (user.is_retailer) {
1150
- if (product.id_order || product.orderId) {
1151
- sendEvaluation("A");
1121
+ } else {
1122
+ if (user.is_retailer) {
1123
+ if (product.id_order || product.orderId) {
1124
+ sendEvaluation("A");
1125
+ } else {
1126
+ setDataGenericModal((prev) => ({
1127
+ ...prev,
1128
+ button2: {
1129
+ name: "Continuar",
1130
+ action: () => evaluationToRetailer("A"),
1131
+ },
1132
+ }));
1133
+ setShowGenericModal(true);
1134
+ }
1152
1135
  } else {
1153
- setDataGenericModal((prev) => ({
1154
- ...prev,
1155
- button2: {
1156
- name: "Continuar",
1157
- action: () => evaluationToRetailer("A"),
1158
- },
1159
- }));
1160
- setShowGenericModal(true);
1136
+ sendEvaluation("A");
1161
1137
  }
1162
- } else {
1163
- sendEvaluation("A");
1164
1138
  }
1165
1139
  }}
1166
1140
  reject={() => {
@@ -1170,33 +1144,33 @@ export const ProviderProductEdition = ({
1170
1144
  (!product.id_order || !product.orderId)
1171
1145
  ) {
1172
1146
  return;
1173
- } else if (user.is_retailer) {
1174
- if (product.id_order || product.orderId) {
1147
+ } else {
1148
+ if (user.is_retailer) {
1149
+ if (product.id_order || product.orderId) {
1150
+ sendEvaluation("R");
1151
+ setModalViewError(true);
1152
+ } else {
1153
+ setDataGenericModal((prev) => ({
1154
+ ...prev,
1155
+ button2: {
1156
+ name: "Continuar",
1157
+ action: () => evaluationToRetailer("R"),
1158
+ },
1159
+ }));
1160
+ setShowGenericModal(true);
1161
+ }
1162
+ } else {
1175
1163
  sendEvaluation("R");
1176
1164
  setModalViewError(true);
1177
- } else {
1178
- setDataGenericModal((prev) => ({
1179
- ...prev,
1180
- button2: {
1181
- name: "Continuar",
1182
- action: () => evaluationToRetailer("R"),
1183
- },
1184
- }));
1185
- setShowGenericModal(true);
1186
1165
  }
1187
- } else {
1188
- sendEvaluation("R");
1189
- setModalViewError(true);
1190
1166
  }
1191
1167
  }}
1192
1168
  />
1193
1169
  <FullTabsMenu
1194
1170
  tabsSections={tabsSections}
1195
1171
  status={
1196
- activeRetailer.id && retailerStatus
1197
- ? retailerStatus[activeRetailer?.id][getConcept(activeTab)] ||
1198
- "NS"
1199
- : "-"
1172
+ product[`${getConcept(activeTab)}_status`] ||
1173
+ product?.version_status
1200
1174
  }
1201
1175
  activeTab={activeTab}
1202
1176
  setActiveTab={setActiveTab}
@@ -1339,44 +1313,56 @@ export const ProviderProductEdition = ({
1339
1313
  />
1340
1314
  </div>
1341
1315
  )}
1316
+ <Button
1317
+ buttonType={
1318
+ evaluationComplete(activeTab) &&
1319
+ (productEdit.product.id_order || productEdit.product.orderId)
1320
+ ? "general-green-button"
1321
+ : "general-button-disabled"
1322
+ }
1323
+ label={"Enviar evaluación"}
1324
+ onClick={() => {
1325
+ //setModalSent(true);
1326
+ sendEvaluation();
1327
+ setMessage(`¡Evaluación de ${activeTab} completada!`);
1328
+ }}
1329
+ />
1342
1330
  </div>
1343
- ) : (
1344
- !revision && (
1345
- <div className="required-inputs-message">
1346
- <div>
1347
- <p>
1348
- Los atributos son requeridos por las plataformas de las
1349
- cadenas, es muy importante completar los campos requeridos
1350
- ya que pueden rechazar el producto por falta de información.
1351
- </p>
1352
- </div>
1353
- {inCart ? (
1354
- <button type="button">
1355
- <Link to="/checkout">
1356
- <p>Articulo en carrito</p>
1357
- <p>Ir a checkout</p>
1358
- </Link>
1359
- </button>
1360
- ) : (
1361
- <>
1362
- <SliderToolTip
1363
- infoIcon={InfoIcon}
1364
- slidefront={slidefront}
1365
- iconSize={"big-image"}
1366
- slidePosition={"top-slide"}
1367
- />
1368
- <Button
1369
- onClick={() => {
1370
- setShowContentohRequestModal &&
1371
- setShowContentohRequestModal(true);
1372
- }}
1373
- buttonType="general-default-button"
1374
- label="Enviar a Content-oh!"
1375
- />
1376
- </>
1377
- )}
1331
+ ) : revision ? null : (
1332
+ <div className="required-inputs-message">
1333
+ <div>
1334
+ <p>
1335
+ Los atributos son requeridos por las plataformas de las
1336
+ cadenas, es muy importante completar los campos requeridos ya
1337
+ que pueden rechazar el producto por falta de información.
1338
+ </p>
1378
1339
  </div>
1379
- )
1340
+ {inCart ? (
1341
+ <button type="button">
1342
+ <Link to="/checkout">
1343
+ <p>Articulo en carrito</p>
1344
+ <p>Ir a checkout</p>
1345
+ </Link>
1346
+ </button>
1347
+ ) : (
1348
+ <>
1349
+ <SliderToolTip
1350
+ infoIcon={InfoIcon}
1351
+ slidefront={slidefront}
1352
+ iconSize={"big-image"}
1353
+ slidePosition={"top-slide"}
1354
+ ></SliderToolTip>
1355
+ <Button
1356
+ onClick={() => {
1357
+ setShowContentohRequestModal &&
1358
+ setShowContentohRequestModal(true);
1359
+ }}
1360
+ buttonType="general-default-button"
1361
+ label="Enviar a Content-oh!"
1362
+ />
1363
+ </>
1364
+ )}
1365
+ </div>
1380
1366
  )}
1381
1367
  </div>
1382
1368
  </div>