contentoh-components-library 21.1.56 → 21.1.60

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