contentoh-components-library 21.5.97 → 21.5.98

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.
@@ -508,7 +508,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
508
508
 
509
509
  var getStatusByCurrentServiceAndRetailer = function getStatusByCurrentServiceAndRetailer() {
510
510
  var statusByRetailer = state.product.statusByRetailer;
511
- if (!statusByRetailer) return "-";
511
+ if (!statusByRetailer || Object.keys(statusByRetailer).length === 0) return "-";
512
512
  var currentService = (0, _utils.getConceptByTab)(state.active_tab);
513
513
  var currentRetailer = state.active_retailer.id_retailer;
514
514
  var currentStatus = statusByRetailer[currentRetailer][currentService] || "N/S";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.5.97",
3
+ "version": "21.5.98",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -295,7 +295,7 @@ const ProviderProductEditionView = ({
295
295
  dispatch({
296
296
  type: "SET_ACTIVE_PERCENTAGES",
297
297
  payload: percentages.find(
298
- ({ id_retailer: rId }) => rId === id_retailer
298
+ ({ id_retailer: rId }) => rId === id_retailer,
299
299
  ),
300
300
  });
301
301
  } catch (error) {
@@ -315,7 +315,7 @@ const ProviderProductEditionView = ({
315
315
  state.product?.percentages,
316
316
  state.product?.version,
317
317
  state.active_retailer,
318
- token
318
+ token,
319
319
  ]);
320
320
 
321
321
  // Actualizador de campos del ui para que coincidan con el retailer activo
@@ -412,14 +412,11 @@ const ProviderProductEditionView = ({
412
412
  const hasNoOrder = !state.product.id_order && !state.product.orderId;
413
413
 
414
414
  const condition =
415
- (
416
- originTab === "RequestWithoutContentoh" && (
417
- ["R", "CA"].includes(currentStatus) || (currentStatus === "RCA" && hasNoOrder)
418
- )
419
- ) ||
420
- (
421
- ["RequestWithContentoh", "Contentoh"].includes(originTab) && currentStatus === "AA"
422
- )
415
+ (originTab === "RequestWithoutContentoh" &&
416
+ (["R", "CA"].includes(currentStatus) ||
417
+ (currentStatus === "RCA" && hasNoOrder))) ||
418
+ (["RequestWithContentoh", "Contentoh"].includes(originTab) &&
419
+ currentStatus === "AA");
423
420
 
424
421
  return condition;
425
422
  } catch (error) {
@@ -441,7 +438,8 @@ const ProviderProductEditionView = ({
441
438
 
442
439
  const getStatusByCurrentServiceAndRetailer = () => {
443
440
  const { statusByRetailer } = state.product;
444
- if (!statusByRetailer) return "-";
441
+ if (!statusByRetailer || Object.keys(statusByRetailer).length === 0)
442
+ return "-";
445
443
 
446
444
  const currentService = getConceptByTab(state.active_tab);
447
445
  const currentRetailer = state.active_retailer.id_retailer;
@@ -730,7 +728,6 @@ const ProviderProductEditionView = ({
730
728
  const newStatuses = JSON.parse(res.data.body);
731
729
  const serviceStatus =
732
730
  newStatuses.newServiceStatus[articleId][`${concept}Status`];
733
-
734
731
 
735
732
  // Actualizar el producto con los nuevos estados
736
733
  const updatedProduct = {
@@ -983,7 +980,7 @@ const ProviderProductEditionView = ({
983
980
  headers: {
984
981
  Authorization: token,
985
982
  },
986
- })
983
+ }),
987
984
  );
988
985
  });
989
986
 
@@ -1028,7 +1025,7 @@ const ProviderProductEditionView = ({
1028
1025
  ArticleId: updatedProduct.id_article,
1029
1026
  idCategory: updatedProduct.id_category,
1030
1027
  product: updatedProduct,
1031
- })
1028
+ }),
1032
1029
  );
1033
1030
 
1034
1031
  // Mostrar modal de éxito
@@ -1094,10 +1091,7 @@ const ProviderProductEditionView = ({
1094
1091
  if (state.loading || !state.services || !state.product) return <Loading />;
1095
1092
 
1096
1093
  return (
1097
- <AiProductEditionProvider
1098
- isCreatorsEdition={false}
1099
- state={state}
1100
- >
1094
+ <AiProductEditionProvider isCreatorsEdition={false} state={state}>
1101
1095
  <Container headerTop={headerTop}>
1102
1096
  {showVersionSelector && (
1103
1097
  <VersionSelector