contentoh-components-library 21.6.27 → 21.6.28

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.
@@ -67,6 +67,8 @@ var _InputGroup = require("../../organisms/InputGroup");
67
67
 
68
68
  var _LinkVariantsModal = require("../../organisms/LinkVariantsModal");
69
69
 
70
+ var _PropagateChangesModal = require("../../organisms/PropagateChangesModal");
71
+
70
72
  var _api = require("../../organisms/LinkVariantsModal/api");
71
73
 
72
74
  var _ProductImageModal = require("../../organisms/ProductImageModal");
@@ -88,7 +90,7 @@ var _AiProductEdition = require("../../../contexts/AiProductEdition");
88
90
  var _jsxRuntime = require("react/jsx-runtime");
89
91
 
90
92
  var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
91
- var _location$state4, _state$product2, _state$product3, _state$product4, _state$product5, _state$product6, _state$product7, _state$product14, _state$product15, _state$product16, _state$active_retaile3, _location$state5, _location$state6, _state$active_retaile4, _state$active_retaile5, _state$images_values$2, _state$images_values10, _state$images_values11, _state$active_retaile6, _state$product17, _state$product18, _state$product19, _state$product20, _family$variants, _family$variants2, _state$active_percent, _state$active_percent2, _state$active_retaile7, _state$active_retaile8, _state$active_retaile9, _state$product21, _state$descriptions_i, _state$product22, _state$product23, _state$datasheets_inp, _state$datasheets_inp2, _state$datasheets_inp3, _state$product24, _state$images_values12;
93
+ var _location$state4, _state$product2, _state$product3, _state$product4, _state$product5, _state$product6, _state$product7, _family$variants, _state$product15, _state$product16, _state$product17, _state$active_retaile4, _location$state5, _location$state6, _state$active_retaile5, _state$active_retaile6, _state$images_values$2, _state$images_values10, _state$images_values11, _state$active_retaile7, _state$product18, _state$product19, _state$product20, _state$product21, _family$variants2, _family$variants3, _state$active_percent, _state$active_percent2, _state$active_retaile8, _state$active_retaile9, _state$active_retaile10, _state$product22, _state$descriptions_i, _state$product23, _state$product24, _state$datasheets_inp, _state$datasheets_inp2, _state$datasheets_inp3, _state$product25, _state$images_values12;
92
94
 
93
95
  var tabsSections = _ref.tabsSections,
94
96
  _ref$productSelected = _ref.productSelected,
@@ -148,39 +150,49 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
148
150
  loadingVariant = _useState12[0],
149
151
  setLoadingVariant = _useState12[1];
150
152
 
151
- var _useState13 = (0, _react.useState)(false),
153
+ var _useState13 = (0, _react.useState)(null),
152
154
  _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
153
- showRejectModal = _useState14[0],
154
- setShowRejectModal = _useState14[1];
155
+ pendingPropagation = _useState14[0],
156
+ setPendingPropagation = _useState14[1];
155
157
 
156
- var _useState15 = (0, _react.useState)(0),
158
+ var _useState15 = (0, _react.useState)(false),
157
159
  _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
158
- headerTop = _useState16[0],
159
- setHeaderTop = _useState16[1];
160
+ preparandoPropagacion = _useState16[0],
161
+ setPreparandoPropagacion = _useState16[1];
160
162
 
161
- var _useState17 = (0, _react.useState)({}),
163
+ var _useState17 = (0, _react.useState)(false),
162
164
  _useState18 = (0, _slicedToArray2.default)(_useState17, 2),
163
- assig = _useState18[0],
164
- setAssig = _useState18[1];
165
+ showRejectModal = _useState18[0],
166
+ setShowRejectModal = _useState18[1];
165
167
 
166
- var _useState19 = (0, _react.useState)(false),
168
+ var _useState19 = (0, _react.useState)(0),
167
169
  _useState20 = (0, _slicedToArray2.default)(_useState19, 2),
168
- imageLayout = _useState20[0],
169
- setImageLayout = _useState20[1];
170
+ headerTop = _useState20[0],
171
+ setHeaderTop = _useState20[1];
170
172
 
171
- var _useState21 = (0, _react.useState)(false),
173
+ var _useState21 = (0, _react.useState)({}),
172
174
  _useState22 = (0, _slicedToArray2.default)(_useState21, 2),
173
- rejectAll = _useState22[0],
174
- setRejectAll = _useState22[1];
175
+ assig = _useState22[0],
176
+ setAssig = _useState22[1];
177
+
178
+ var _useState23 = (0, _react.useState)(false),
179
+ _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
180
+ imageLayout = _useState24[0],
181
+ setImageLayout = _useState24[1];
175
182
 
176
- var _useState23 = (0, _react.useState)({
183
+ var _useState25 = (0, _react.useState)(false),
184
+ _useState26 = (0, _slicedToArray2.default)(_useState25, 2),
185
+ rejectAll = _useState26[0],
186
+ setRejectAll = _useState26[1];
187
+
188
+ var _useState27 = (0, _react.useState)({
177
189
  "Ficha técnica": null,
178
190
  Descripción: null,
179
191
  Imágenes: null
180
192
  }),
181
- _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
182
- origin = _useState24[0],
183
- setOrigin = _useState24[1];
193
+ _useState28 = (0, _slicedToArray2.default)(_useState27, 2),
194
+ origin = _useState28[0],
195
+ setOrigin = _useState28[1];
184
196
 
185
197
  var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
186
198
  _useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
@@ -790,9 +802,35 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
790
802
  }
791
803
  });
792
804
  };
805
+ /*
806
+ Los atributos que se acaban de tocar, con el nombre que ve el usuario.
807
+ `updated_datasheets_inputs` trae { attributeId, value } y nada más, así que el
808
+ nombre se busca en los inputs de la cadena activa: un diálogo que preguntara
809
+ por "el atributo 1023" no serviría para decidir nada.
810
+ */
811
+
812
+
813
+ var cambiosDeFichaTecnica = function cambiosDeFichaTecnica() {
814
+ var _state$active_retaile2, _state$services$datas, _state$services, _state$services$datas2, _state$updated_datash;
815
+
816
+ var retailerId = (_state$active_retaile2 = state.active_retailer) === null || _state$active_retaile2 === void 0 ? void 0 : _state$active_retaile2.id_retailer;
817
+ var inputs = (_state$services$datas = (_state$services = state.services) === null || _state$services === void 0 ? void 0 : (_state$services$datas2 = _state$services.datasheets) === null || _state$services$datas2 === void 0 ? void 0 : _state$services$datas2.inputs) !== null && _state$services$datas !== void 0 ? _state$services$datas : {};
818
+ return ((_state$updated_datash = state.updated_datasheets_inputs) !== null && _state$updated_datash !== void 0 ? _state$updated_datash : []).map(function (item) {
819
+ var _input$name;
820
+
821
+ var input = inputs["".concat(item.attributeId, "_").concat(retailerId)];
822
+ return {
823
+ id: Number(item.attributeId),
824
+ name: (_input$name = input === null || input === void 0 ? void 0 : input.name) !== null && _input$name !== void 0 ? _input$name : "Atributo ".concat(item.attributeId),
825
+ value: item.value
826
+ };
827
+ });
828
+ };
793
829
 
794
830
  var handleOnClickSave = function handleOnClickSave() {
795
- if (state.saving) return;
831
+ // `preparandoPropagacion` cubre la ventana entre el clic y la apertura del
832
+ // diálogo: sin esto, dos clics seguidos lanzan dos consultas de familia.
833
+ if (state.saving || preparandoPropagacion) return;
796
834
 
797
835
  switch (state.active_tab) {
798
836
  case "Descripción":
@@ -800,8 +838,33 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
800
838
  break;
801
839
 
802
840
  case "Ficha técnica":
803
- saveDatasheets(token);
804
- break;
841
+ {
842
+ var _state$product10;
843
+
844
+ // Guardar un padre con variantes abre la decisión de propagar. Sin este
845
+ // paso el cambio se queda solo en el padre y las variantes se van
846
+ // separando de él sin que nadie lo note.
847
+ var esPadre = ((_state$product10 = state.product) === null || _state$product10 === void 0 ? void 0 : _state$product10.variantsCount) > 0;
848
+ var cambios = cambiosDeFichaTecnica();
849
+
850
+ if (esPadre && cambios.length > 0) {
851
+ // Se espera a tener la familia antes de abrir: si no, el diálogo
852
+ // aparece diciendo "0 variantes" hasta que llega la respuesta, que es
853
+ // justo lo contrario de lo que va a preguntar.
854
+ setPreparandoPropagacion(true);
855
+ loadFamily().then(function () {
856
+ return setPendingPropagation({
857
+ cambios: cambios
858
+ });
859
+ }).finally(function () {
860
+ return setPreparandoPropagacion(false);
861
+ });
862
+ return;
863
+ }
864
+
865
+ saveDatasheets(token);
866
+ break;
867
+ }
805
868
 
806
869
  case "Imágenes":
807
870
  updateImages(token);
@@ -847,7 +910,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
847
910
 
848
911
  var loadFamily = /*#__PURE__*/function () {
849
912
  var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
850
- var _state$product10, res;
913
+ var _state$product11, res;
851
914
 
852
915
  return _regenerator.default.wrap(function _callee3$(_context3) {
853
916
  while (1) {
@@ -858,13 +921,13 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
858
921
  break;
859
922
  }
860
923
 
861
- return _context3.abrupt("return");
924
+ return _context3.abrupt("return", family);
862
925
 
863
926
  case 2:
864
927
  _context3.prev = 2;
865
928
  _context3.next = 5;
866
929
  return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/family"), {
867
- articleId: (_state$product10 = state.product) === null || _state$product10 === void 0 ? void 0 : _state$product10.id_article
930
+ articleId: (_state$product11 = state.product) === null || _state$product11 === void 0 ? void 0 : _state$product11.id_article
868
931
  }, {
869
932
  headers: {
870
933
  Authorization: token
@@ -997,11 +1060,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
997
1060
 
998
1061
 
999
1062
  var handleOnLinkedVariants = function handleOnLinkedVariants(result) {
1000
- var _state$product$varian, _state$product11, _result$linked, _result$parentArticle;
1063
+ var _state$product$varian, _state$product12, _result$linked, _result$parentArticle;
1001
1064
 
1002
1065
  if (!result) return;
1003
1066
  var updatedProduct = result.mode === "children" ? (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
1004
- variantsCount: ((_state$product$varian = (_state$product11 = state.product) === null || _state$product11 === void 0 ? void 0 : _state$product11.variantsCount) !== null && _state$product$varian !== void 0 ? _state$product$varian : 0) + ((_result$linked = result.linked) !== null && _result$linked !== void 0 ? _result$linked : []).length
1067
+ variantsCount: ((_state$product$varian = (_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.variantsCount) !== null && _state$product$varian !== void 0 ? _state$product$varian : 0) + ((_result$linked = result.linked) !== null && _result$linked !== void 0 ? _result$linked : []).length
1005
1068
  }) : (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
1006
1069
  parentArticleId: (_result$parentArticle = result.parentArticleId) !== null && _result$parentArticle !== void 0 ? _result$parentArticle : null,
1007
1070
  variantsCount: 0
@@ -1043,14 +1106,14 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1043
1106
 
1044
1107
  var handleOnRestoreInheritance = /*#__PURE__*/function () {
1045
1108
  var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(attributeId) {
1046
- var _state$product12;
1109
+ var _state$product13;
1047
1110
 
1048
1111
  var res, data;
1049
1112
  return _regenerator.default.wrap(function _callee5$(_context5) {
1050
1113
  while (1) {
1051
1114
  switch (_context5.prev = _context5.next) {
1052
1115
  case 0:
1053
- if (!(!attributeId || !((_state$product12 = state.product) !== null && _state$product12 !== void 0 && _state$product12.id_article))) {
1116
+ if (!(!attributeId || !((_state$product13 = state.product) !== null && _state$product13 !== void 0 && _state$product13.id_article))) {
1054
1117
  _context5.next = 2;
1055
1118
  break;
1056
1119
  }
@@ -1137,7 +1200,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1137
1200
 
1138
1201
  var sendEvaluation = /*#__PURE__*/function () {
1139
1202
  var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(result) {
1140
- var _state$product$id_ord, _state$active_retaile2, _state$product$status, _state$product$status2, _state$product13;
1203
+ var _state$product$id_ord, _state$active_retaile3, _state$product$status, _state$product$status2, _state$product14;
1141
1204
 
1142
1205
  var concept, articleId, orderId, retailerId, evalStatus, data, _newStatuses$newStatu, _state$services_data, res, newStatuses, serviceStatus, updatedStatusByRetailer, updatedProduct, updatedServicesData;
1143
1206
 
@@ -1152,8 +1215,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1152
1215
  concept = (0, _utils.getConceptByTab)(state.active_tab);
1153
1216
  articleId = state.product.id_article;
1154
1217
  orderId = (_state$product$id_ord = state.product.id_order) !== null && _state$product$id_ord !== void 0 ? _state$product$id_ord : state.product.orderId;
1155
- retailerId = (_state$active_retaile2 = state.active_retailer) === null || _state$active_retaile2 === void 0 ? void 0 : _state$active_retaile2.id_retailer;
1156
- evalStatus = ((_state$product$status = state.product.statusByRetailer) === null || _state$product$status === void 0 ? void 0 : (_state$product$status2 = _state$product$status[retailerId]) === null || _state$product$status2 === void 0 ? void 0 : _state$product$status2[concept]) || state.product["".concat(concept, "_status")] || ((_state$product13 = state.product) === null || _state$product13 === void 0 ? void 0 : _state$product13.version_status);
1218
+ retailerId = (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer;
1219
+ evalStatus = ((_state$product$status = state.product.statusByRetailer) === null || _state$product$status === void 0 ? void 0 : (_state$product$status2 = _state$product$status[retailerId]) === null || _state$product$status2 === void 0 ? void 0 : _state$product$status2[concept]) || state.product["".concat(concept, "_status")] || ((_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.version_status);
1157
1220
  data = {
1158
1221
  articleId: articleId,
1159
1222
  orderId: orderId,
@@ -1635,11 +1698,24 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1635
1698
  currentVersion: state.product.version,
1636
1699
  setShowVersionSelector: setShowVersionSelector,
1637
1700
  jwt: token
1701
+ }), pendingPropagation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PropagateChangesModal.PropagateChangesModal, {
1702
+ changedAttributes: pendingPropagation.cambios,
1703
+ variants: ((_family$variants = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants !== void 0 ? _family$variants : []).filter(function (v) {
1704
+ return !v.isCurrent;
1705
+ }),
1706
+ saving: state.saving,
1707
+ onCancel: function onCancel() {
1708
+ return setPendingPropagation(null);
1709
+ },
1710
+ onConfirm: function onConfirm(propagation) {
1711
+ setPendingPropagation(null);
1712
+ saveDatasheets(token, propagation !== null && propagation !== void 0 ? propagation : undefined);
1713
+ }
1638
1714
  }), showLinkVariants && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkVariantsModal.LinkVariantsModal, {
1639
- articleId: (_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.id_article,
1640
- articleName: (_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.name,
1641
- articleUpc: (_state$product16 = state.product) === null || _state$product16 === void 0 ? void 0 : _state$product16.upc,
1642
- activeRetailerId: (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer,
1715
+ articleId: (_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.id_article,
1716
+ articleName: (_state$product16 = state.product) === null || _state$product16 === void 0 ? void 0 : _state$product16.name,
1717
+ articleUpc: (_state$product17 = state.product) === null || _state$product17 === void 0 ? void 0 : _state$product17.upc,
1718
+ activeRetailerId: (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.id_retailer,
1643
1719
  token: token,
1644
1720
  onClose: function onClose() {
1645
1721
  return setShowLinkVariants(false);
@@ -1771,8 +1847,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1771
1847
  productSelected: state.product,
1772
1848
  token: token,
1773
1849
  activeRetailer: {
1774
- id: (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.id_retailer,
1775
- name: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.retailer
1850
+ id: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
1851
+ name: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.retailer
1776
1852
  }
1777
1853
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1778
1854
  className: "data-container",
@@ -1787,8 +1863,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1787
1863
  lists: state.images_values || [],
1788
1864
  activeImage: (_state$images_values10 = state.images_values) !== null && _state$images_values10 !== void 0 && _state$images_values10.values ? (_state$images_values11 = state.images_values) === null || _state$images_values11 === void 0 ? void 0 : _state$images_values11.values[state.current_image] : {},
1789
1865
  assignationsImages: assig,
1790
- retailerSelected: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
1791
- imagesStatus: ((_state$product17 = state.product) === null || _state$product17 === void 0 ? void 0 : _state$product17.images_status) || "-",
1866
+ retailerSelected: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.id_retailer,
1867
+ imagesStatus: ((_state$product18 = state.product) === null || _state$product18 === void 0 ? void 0 : _state$product18.images_status) || "-",
1792
1868
  isRetailer: isRetailer,
1793
1869
  setShowVersionSelector: setShowVersionSelector,
1794
1870
  version: state.product.version,
@@ -1801,7 +1877,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1801
1877
  className: "product-information",
1802
1878
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1803
1879
  className: "product-information",
1804
- children: [!((_state$product18 = state.product) !== null && _state$product18 !== void 0 && _state$product18.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1880
+ children: [!((_state$product19 = state.product) !== null && _state$product19 !== void 0 && _state$product19.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1805
1881
  className: "variants-actions",
1806
1882
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
1807
1883
  type: "button",
@@ -1810,7 +1886,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1810
1886
  return setShowLinkVariants(true);
1811
1887
  },
1812
1888
  children: "Ligar productos"
1813
- }), ((_state$product19 = state.product) === null || _state$product19 === void 0 ? void 0 : _state$product19.variantsCount) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
1889
+ }), ((_state$product20 = state.product) === null || _state$product20 === void 0 ? void 0 : _state$product20.variantsCount) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
1814
1890
  type: "button",
1815
1891
  className: "variants-count",
1816
1892
  "aria-expanded": showFamily,
@@ -1825,7 +1901,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1825
1901
  children: showFamily ? " ▴" : " ▾"
1826
1902
  })]
1827
1903
  })]
1828
- }), ((_state$product20 = state.product) === null || _state$product20 === void 0 ? void 0 : _state$product20.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1904
+ }), ((_state$product21 = state.product) === null || _state$product21 === void 0 ? void 0 : _state$product21.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1829
1905
  className: "variants-actions",
1830
1906
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
1831
1907
  type: "button",
@@ -1867,7 +1943,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1867
1943
  className: "upc",
1868
1944
  children: family.parent.upc
1869
1945
  })]
1870
- }), family === null || family === void 0 ? void 0 : (_family$variants = family.variants) === null || _family$variants === void 0 ? void 0 : _family$variants.map(function (variant) {
1946
+ }), family === null || family === void 0 ? void 0 : (_family$variants2 = family.variants) === null || _family$variants2 === void 0 ? void 0 : _family$variants2.map(function (variant) {
1871
1947
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
1872
1948
  type: "button",
1873
1949
  className: "family-row".concat(variant.isCurrent ? " current" : ""),
@@ -1886,7 +1962,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1886
1962
  children: variant.upc
1887
1963
  })]
1888
1964
  }, variant.articleId);
1889
- }), family && !family.error && !((_family$variants2 = family.variants) !== null && _family$variants2 !== void 0 && _family$variants2.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1965
+ }), family && !family.error && !((_family$variants3 = family.variants) !== null && _family$variants3 !== void 0 && _family$variants3.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1890
1966
  className: "loading",
1891
1967
  children: "Este producto no tiene variantes."
1892
1968
  })]
@@ -1894,9 +1970,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1894
1970
  headerData: state.product,
1895
1971
  percent: (_state$active_percent = state.active_percentage) === null || _state$active_percent === void 0 ? void 0 : (_state$active_percent2 = _state$active_percent.percentagesGeneral) === null || _state$active_percent2 === void 0 ? void 0 : _state$active_percent2.required,
1896
1972
  activeRetailer: {
1897
- id: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.id_retailer,
1898
- name: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.retailer,
1899
- image: (_state$active_retaile9 = state.active_retailer) === null || _state$active_retaile9 === void 0 ? void 0 : _state$active_retaile9.image
1973
+ id: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.id_retailer,
1974
+ name: (_state$active_retaile9 = state.active_retailer) === null || _state$active_retaile9 === void 0 ? void 0 : _state$active_retaile9.retailer,
1975
+ image: (_state$active_retaile10 = state.active_retailer) === null || _state$active_retaile10 === void 0 ? void 0 : _state$active_retaile10.image
1900
1976
  },
1901
1977
  showValidationButtons: canShowValidationButtons(),
1902
1978
  showApproveRejectAll: canShowValidationButtons(),
@@ -1940,11 +2016,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1940
2016
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1941
2017
  className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
1942
2018
  children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1943
- children: [state.active_tab === "Descripción" && (((_state$product21 = state.product) === null || _state$product21 === void 0 ? void 0 : _state$product21.description_status) !== "NS" ? (_state$descriptions_i = state.descriptions_inputs) !== null && _state$descriptions_i !== void 0 && _state$descriptions_i[0] ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
2019
+ children: [state.active_tab === "Descripción" && (((_state$product22 = state.product) === null || _state$product22 === void 0 ? void 0 : _state$product22.description_status) !== "NS" ? (_state$descriptions_i = state.descriptions_inputs) !== null && _state$descriptions_i !== void 0 && _state$descriptions_i[0] ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1944
2020
  activeSection: state.active_tab,
1945
2021
  inputGroup: state.descriptions_inputs[0],
1946
2022
  updatedDescriptions: state.updated_descriptions_inputs,
1947
- articleId: (_state$product22 = state.product) === null || _state$product22 === void 0 ? void 0 : _state$product22.id_article,
2023
+ articleId: (_state$product23 = state.product) === null || _state$product23 === void 0 ? void 0 : _state$product23.id_article,
1948
2024
  version: state.product.version,
1949
2025
  isShowbox: false,
1950
2026
  dinamicHeight: true,
@@ -1956,9 +2032,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1956
2032
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1957
2033
  text: "No cuentas con este servicio",
1958
2034
  headerType: "input-name-header"
1959
- })), state.active_tab === "Ficha técnica" && (((_state$product23 = state.product) === null || _state$product23 === void 0 ? void 0 : _state$product23.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
2035
+ })), state.active_tab === "Ficha técnica" && (((_state$product24 = state.product) === null || _state$product24 === void 0 ? void 0 : _state$product24.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
1960
2036
  children: ((_state$datasheets_inp = state.datasheets_inputs) === null || _state$datasheets_inp === void 0 ? void 0 : (_state$datasheets_inp2 = _state$datasheets_inp[0]) === null || _state$datasheets_inp2 === void 0 ? void 0 : (_state$datasheets_inp3 = _state$datasheets_inp2.data) === null || _state$datasheets_inp3 === void 0 ? void 0 : _state$datasheets_inp3.length) > 0 ? state.datasheets_inputs[0].data.map(function (dataGroup, index) {
1961
- var _state$datasheets_inp4, _state$services, _state$services$datas, _state$services$datas2;
2037
+ var _state$datasheets_inp4, _state$services2, _state$services2$data, _state$services$datas3;
1962
2038
 
1963
2039
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1964
2040
  index: index,
@@ -1967,10 +2043,10 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1967
2043
  activeSection: state.active_tab,
1968
2044
  inputGroup: dataGroup,
1969
2045
  dataInputs: (_state$datasheets_inp4 = state.datasheets_inputs[1]) !== null && _state$datasheets_inp4 !== void 0 ? _state$datasheets_inp4 : [],
1970
- variant: (_state$services = state.services) === null || _state$services === void 0 ? void 0 : (_state$services$datas = _state$services.datasheets) === null || _state$services$datas === void 0 ? void 0 : _state$services$datas.variant,
2046
+ variant: (_state$services2 = state.services) === null || _state$services2 === void 0 ? void 0 : (_state$services2$data = _state$services2.datasheets) === null || _state$services2$data === void 0 ? void 0 : _state$services2$data.variant,
1971
2047
  onRestoreInheritance: handleOnRestoreInheritance,
1972
2048
  activeRetailer: state.services.datasheets[state.active_retailer.id_retailer],
1973
- groupData: (_state$services$datas2 = state.services.datasheets[state.active_retailer.id_retailer]) === null || _state$services$datas2 === void 0 ? void 0 : _state$services$datas2.data,
2049
+ groupData: (_state$services$datas3 = state.services.datasheets[state.active_retailer.id_retailer]) === null || _state$services$datas3 === void 0 ? void 0 : _state$services$datas3.data,
1974
2050
  updatedDatasheets: state.updated_datasheets_inputs,
1975
2051
  setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
1976
2052
  isShowbox: true,
@@ -1986,7 +2062,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
1986
2062
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1987
2063
  text: "No cuentas con este servicio",
1988
2064
  headerType: "input-name-header"
1989
- })), state.active_tab === "Imágenes" && (((_state$product24 = state.product) === null || _state$product24 === void 0 ? void 0 : _state$product24.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
2065
+ })), state.active_tab === "Imágenes" && (((_state$product25 = state.product) === null || _state$product25 === void 0 ? void 0 : _state$product25.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1990
2066
  children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
1991
2067
  checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
1992
2068
  ,
package/dist/index.js CHANGED
@@ -1109,7 +1109,7 @@ Object.keys(_index84).forEach(function (key) {
1109
1109
  });
1110
1110
  });
1111
1111
 
1112
- var _index85 = require("./components/organisms/ProductImageModal/index");
1112
+ var _index85 = require("./components/organisms/PropagateChangesModal/index");
1113
1113
 
1114
1114
  Object.keys(_index85).forEach(function (key) {
1115
1115
  if (key === "default" || key === "__esModule") return;
@@ -1122,7 +1122,7 @@ Object.keys(_index85).forEach(function (key) {
1122
1122
  });
1123
1123
  });
1124
1124
 
1125
- var _index86 = require("./components/organisms/Chat/index");
1125
+ var _index86 = require("./components/organisms/ProductImageModal/index");
1126
1126
 
1127
1127
  Object.keys(_index86).forEach(function (key) {
1128
1128
  if (key === "default" || key === "__esModule") return;
@@ -1135,7 +1135,7 @@ Object.keys(_index86).forEach(function (key) {
1135
1135
  });
1136
1136
  });
1137
1137
 
1138
- var _index87 = require("./components/organisms/Modal/index");
1138
+ var _index87 = require("./components/organisms/Chat/index");
1139
1139
 
1140
1140
  Object.keys(_index87).forEach(function (key) {
1141
1141
  if (key === "default" || key === "__esModule") return;
@@ -1148,7 +1148,7 @@ Object.keys(_index87).forEach(function (key) {
1148
1148
  });
1149
1149
  });
1150
1150
 
1151
- var _index88 = require("./components/organisms/OrderDetail/index");
1151
+ var _index88 = require("./components/organisms/Modal/index");
1152
1152
 
1153
1153
  Object.keys(_index88).forEach(function (key) {
1154
1154
  if (key === "default" || key === "__esModule") return;
@@ -1161,6 +1161,19 @@ Object.keys(_index88).forEach(function (key) {
1161
1161
  });
1162
1162
  });
1163
1163
 
1164
+ var _index89 = require("./components/organisms/OrderDetail/index");
1165
+
1166
+ Object.keys(_index89).forEach(function (key) {
1167
+ if (key === "default" || key === "__esModule") return;
1168
+ if (key in exports && exports[key] === _index89[key]) return;
1169
+ Object.defineProperty(exports, key, {
1170
+ enumerable: true,
1171
+ get: function get() {
1172
+ return _index89[key];
1173
+ }
1174
+ });
1175
+ });
1176
+
1164
1177
  var _RangeCalendar = require("./components/organisms/RangeCalendar");
1165
1178
 
1166
1179
  Object.keys(_RangeCalendar).forEach(function (key) {
@@ -1187,28 +1200,28 @@ Object.keys(_TableResizable).forEach(function (key) {
1187
1200
  });
1188
1201
  });
1189
1202
 
1190
- var _index89 = require("./components/organisms/SideModal/index");
1203
+ var _index90 = require("./components/organisms/SideModal/index");
1191
1204
 
1192
- Object.keys(_index89).forEach(function (key) {
1205
+ Object.keys(_index90).forEach(function (key) {
1193
1206
  if (key === "default" || key === "__esModule") return;
1194
- if (key in exports && exports[key] === _index89[key]) return;
1207
+ if (key in exports && exports[key] === _index90[key]) return;
1195
1208
  Object.defineProperty(exports, key, {
1196
1209
  enumerable: true,
1197
1210
  get: function get() {
1198
- return _index89[key];
1211
+ return _index90[key];
1199
1212
  }
1200
1213
  });
1201
1214
  });
1202
1215
 
1203
- var _index90 = require("./components/organisms/GridProducts/index");
1216
+ var _index91 = require("./components/organisms/GridProducts/index");
1204
1217
 
1205
- Object.keys(_index90).forEach(function (key) {
1218
+ Object.keys(_index91).forEach(function (key) {
1206
1219
  if (key === "default" || key === "__esModule") return;
1207
- if (key in exports && exports[key] === _index90[key]) return;
1220
+ if (key in exports && exports[key] === _index91[key]) return;
1208
1221
  Object.defineProperty(exports, key, {
1209
1222
  enumerable: true,
1210
1223
  get: function get() {
1211
- return _index90[key];
1224
+ return _index91[key];
1212
1225
  }
1213
1226
  });
1214
1227
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.6.27",
3
+ "version": "21.6.28",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",