contentoh-components-library 21.6.50 → 21.6.52
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.test +0 -1
- package/dist/components/atoms/IconFile/index.js +2 -85
- package/dist/components/atoms/IconFile/styles.js +1 -1
- package/dist/components/atoms/ProductImage/ProductImage.stories.js +2 -70
- package/dist/components/atoms/ProductImage/index.js +27 -100
- package/dist/components/atoms/ProductImage/styles.js +1 -3
- package/dist/components/molecules/EditionActiveImage/index.js +2 -4
- package/dist/components/molecules/GalleryElement/index.js +4 -13
- package/dist/components/molecules/GalleryHeader/index.js +24 -96
- package/dist/components/molecules/GalleryHeader/styles.js +1 -4
- package/dist/components/molecules/ImageSelector/index.js +0 -1
- package/dist/components/organisms/ImagePreviewer/index.js +0 -1
- package/dist/components/organisms/ProductImageModal/index.js +2 -3
- package/dist/components/organisms/PropagateChangesModal/index.js +6 -1
- package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +10 -8
- package/dist/components/pages/ProviderProductEdition/index.js +189 -72
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +25 -338
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +2 -12
- package/dist/components/pages/RetailerProductEdition/index.js +579 -631
- package/dist/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -1
- package/dist/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +145 -45
- package/dist/global-files/data.js +3 -16
- package/dist/index.js +90 -142
- package/package.json +1 -1
- package/src/components/atoms/IconFile/index.js +1 -28
- package/src/components/atoms/IconFile/styles.js +0 -8
- package/src/components/atoms/ProductImage/ProductImage.stories.js +0 -38
- package/src/components/atoms/ProductImage/index.js +20 -95
- package/src/components/atoms/ProductImage/styles.js +7 -92
- package/src/components/molecules/EditionActiveImage/index.js +2 -2
- package/src/components/molecules/GalleryElement/index.js +0 -9
- package/src/components/molecules/GalleryHeader/index.js +13 -65
- package/src/components/molecules/GalleryHeader/styles.js +1 -2
- package/src/components/molecules/ImageSelector/index.js +0 -1
- package/src/components/organisms/ImagePreviewer/index.js +0 -1
- package/src/components/organisms/ProductImageModal/index.js +0 -1
- package/src/components/organisms/PropagateChangesModal/index.js +10 -3
- package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +2 -1
- package/src/components/pages/ProviderProductEdition/index.js +111 -6
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +2 -202
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +0 -12
- package/src/components/pages/RetailerProductEdition/index.js +258 -363
- package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -1
- package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +104 -51
- package/src/global-files/data.js +2 -17
- package/src/index.js +0 -4
- package/.claude/launch.json +0 -14
- package/dist/ai/prompts/attribute.prompt.js +0 -28
- package/dist/ai/prompts/description.prompt.js +0 -33
- package/dist/ai/schemas/attribute.schema.js +0 -35
- package/dist/ai/schemas/description.schema.js +0 -27
- package/dist/components/atoms/AssetPreview/AssetPreview.stories.js +0 -118
- package/dist/components/atoms/AssetPreview/index.js +0 -150
- package/dist/components/atoms/AssetPreview/styles.js +0 -28
- package/dist/components/molecules/GalleryAssetElement/GalleryAssetElement.stories.js +0 -147
- package/dist/components/molecules/GalleryAssetElement/index.js +0 -178
- package/dist/components/molecules/GalleryAssetElement/styles.js +0 -26
- package/dist/components/molecules/GalleryTrayTabs/GalleryTrayTabs.stories.js +0 -56
- package/dist/components/molecules/GalleryTrayTabs/index.js +0 -60
- package/dist/components/molecules/GalleryTrayTabs/styles.js +0 -20
- package/dist/components/organisms/DigitalAssetsTray/DigitalAssetsTray.stories.js +0 -171
- package/dist/components/organisms/DigitalAssetsTray/index.js +0 -211
- package/dist/components/organisms/DigitalAssetsTray/styles.js +0 -22
- package/dist/global-files/digital-assets/assetTypes.js +0 -480
- package/dist/global-files/digital-assets/assets.actions.js +0 -64
- package/dist/global-files/digital-assets/assets.adapter.js +0 -304
- package/dist/global-files/digital-assets/assets.mock.js +0 -136
- package/dist/global-files/digital-assets/assets.reducer.js +0 -220
- package/dist/global-files/digital-assets/uploadAssets.js +0 -179
- package/dist/global-files/digital-assets/useDigitalAssets.js +0 -522
- package/docs/activos-digitales.md +0 -273
- package/src/components/atoms/AssetPreview/AssetPreview.stories.js +0 -78
- package/src/components/atoms/AssetPreview/index.js +0 -119
- package/src/components/atoms/AssetPreview/styles.js +0 -190
- package/src/components/molecules/GalleryAssetElement/GalleryAssetElement.stories.js +0 -102
- package/src/components/molecules/GalleryAssetElement/index.js +0 -162
- package/src/components/molecules/GalleryAssetElement/styles.js +0 -159
- package/src/components/molecules/GalleryTrayTabs/GalleryTrayTabs.stories.js +0 -32
- package/src/components/molecules/GalleryTrayTabs/index.js +0 -41
- package/src/components/molecules/GalleryTrayTabs/styles.js +0 -52
- package/src/components/organisms/DigitalAssetsTray/DigitalAssetsTray.stories.js +0 -101
- package/src/components/organisms/DigitalAssetsTray/index.js +0 -189
- package/src/components/organisms/DigitalAssetsTray/styles.js +0 -183
- package/src/global-files/digital-assets/assetTypes.js +0 -419
- package/src/global-files/digital-assets/assets.actions.js +0 -50
- package/src/global-files/digital-assets/assets.adapter.js +0 -229
- package/src/global-files/digital-assets/assets.mock.js +0 -122
- package/src/global-files/digital-assets/assets.reducer.js +0 -197
- package/src/global-files/digital-assets/uploadAssets.js +0 -109
- package/src/global-files/digital-assets/useDigitalAssets.js +0 -329
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.ProviderProductEdition = void 0;
|
|
9
9
|
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
|
+
|
|
10
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
13
|
|
|
12
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
@@ -95,8 +97,10 @@ var _AiProductEdition = require("../../../contexts/AiProductEdition");
|
|
|
95
97
|
|
|
96
98
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
97
99
|
|
|
100
|
+
var _excluded = ["attributes"];
|
|
101
|
+
|
|
98
102
|
var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
99
|
-
var
|
|
103
|
+
var _state$product, _location$state4, _state$product3, _state$product4, _state$product5, _state$product6, _state$product7, _state$product8, _state$product19, _pendingPropagation$k, _state$product24, _family$variants2, _variantGroup$members3, _variantGroup$group, _state$product25, _state$product26, _state$product27, _state$active_retaile5, _state$product28, _state$product29, _state$product30, _variantGroup$group2, _location$state5, _location$state6, _state$active_retaile6, _state$active_retaile7, _state$images_values$2, _state$images_values10, _state$images_values11, _state$active_retaile8, _state$product31, _state$product32, _state$product33, _state$product34, _family$variants3, _family$variants4, _family$variants5, _variantGroup$members4, _variantGroup$members5, _state$active_percent, _state$active_percent2, _state$active_retaile9, _state$active_retaile10, _state$active_retaile11, _state$product40, _state$descriptions_i, _state$services3, _state$services3$data, _state$product41, _state$product42, _state$datasheets_inp, _state$datasheets_inp2, _state$datasheets_inp3, _state$product43, _state$images_values12;
|
|
100
104
|
|
|
101
105
|
var tabsSections = _ref.tabsSections,
|
|
102
106
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -176,6 +180,17 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
176
180
|
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
177
181
|
showGroupModal = _useState18[0],
|
|
178
182
|
setShowGroupModal = _useState18[1];
|
|
183
|
+
/*
|
|
184
|
+
Un hijo no se agrupa como variante (decisión de producto, 2026-09-25).
|
|
185
|
+
Agrupar declara «estos son el mismo producto en otra presentación», y un
|
|
186
|
+
hijo ya declaró de dónde deriva; tener las dos cosas lo dejaba con dos
|
|
187
|
+
respuestas distintas a la misma pregunta. El servidor lo rechaza con
|
|
188
|
+
VARIANT_GROUP_NOT_FOR_CHILD, así que ofrecer el botón aquí sería ofrecer
|
|
189
|
+
algo que siempre falla.
|
|
190
|
+
*/
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
var puedeAgruparse = !((_state$product = state.product) !== null && _state$product !== void 0 && _state$product.parentArticleId);
|
|
179
194
|
|
|
180
195
|
var _useState19 = (0, _react.useState)(null),
|
|
181
196
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
@@ -360,10 +375,10 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
360
375
|
(0, _react.useEffect)(function () {
|
|
361
376
|
if (!state.product || !state.active_retailer) return;
|
|
362
377
|
console.log("Fetch services and percentages");
|
|
363
|
-
var _state$
|
|
364
|
-
id_article = _state$
|
|
365
|
-
version = _state$
|
|
366
|
-
id_order = _state$
|
|
378
|
+
var _state$product2 = state.product,
|
|
379
|
+
id_article = _state$product2.id_article,
|
|
380
|
+
version = _state$product2.version,
|
|
381
|
+
id_order = _state$product2.id_order;
|
|
367
382
|
var _state$active_retaile = state.active_retailer,
|
|
368
383
|
category = _state$active_retaile.category,
|
|
369
384
|
id_category = _state$active_retaile.id_category,
|
|
@@ -521,7 +536,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
521
536
|
}();
|
|
522
537
|
|
|
523
538
|
fetchData();
|
|
524
|
-
}, [(_state$
|
|
539
|
+
}, [(_state$product3 = state.product) === null || _state$product3 === void 0 ? void 0 : _state$product3.datasheet_status, (_state$product4 = state.product) === null || _state$product4 === void 0 ? void 0 : _state$product4.description_status, (_state$product5 = state.product) === null || _state$product5 === void 0 ? void 0 : _state$product5.images_status, (_state$product6 = state.product) === null || _state$product6 === void 0 ? void 0 : _state$product6.status, (_state$product7 = state.product) === null || _state$product7 === void 0 ? void 0 : _state$product7.percentages, (_state$product8 = state.product) === null || _state$product8 === void 0 ? void 0 : _state$product8.version, state.active_retailer, token, linkNonce]); // Actualizador de campos del ui para que coincidan con el retailer activo
|
|
525
540
|
|
|
526
541
|
(0, _react.useEffect)(function () {
|
|
527
542
|
if (!state.active_retailer) return;
|
|
@@ -580,9 +595,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
580
595
|
}, [state.services]); // Helper functions
|
|
581
596
|
|
|
582
597
|
var canShowValidationButtons = function canShowValidationButtons() {
|
|
583
|
-
var _state$
|
|
598
|
+
var _state$product9;
|
|
584
599
|
|
|
585
|
-
if (!((_state$
|
|
600
|
+
if (!((_state$product9 = state.product) !== null && _state$product9 !== void 0 && _state$product9.statusByRetailer)) return false;
|
|
586
601
|
|
|
587
602
|
try {
|
|
588
603
|
var currentService = (0, _utils.getConceptByTab)(state.active_tab); // const currentStatus = state.product[`${currentService}_status`];
|
|
@@ -703,9 +718,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
703
718
|
};
|
|
704
719
|
|
|
705
720
|
var handleOnClickSaveImages = function handleOnClickSaveImages() {
|
|
706
|
-
var _state$
|
|
721
|
+
var _state$product10, _state$product10$serv;
|
|
707
722
|
|
|
708
|
-
if (((_state$
|
|
723
|
+
if (((_state$product10 = state.product) === null || _state$product10 === void 0 ? void 0 : (_state$product10$serv = _state$product10.services) === null || _state$product10$serv === void 0 ? void 0 : _state$product10$serv.images) === 1) {
|
|
709
724
|
updateImages();
|
|
710
725
|
}
|
|
711
726
|
};
|
|
@@ -879,6 +894,45 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
879
894
|
|
|
880
895
|
return (0, _nonPropagable.soloPropagables)(cambios);
|
|
881
896
|
};
|
|
897
|
+
/*
|
|
898
|
+
Lo que se acaba de editar en la pestaña de descripciones.
|
|
899
|
+
Va aparte de `cambiosDeFichaTecnica` porque son tablas distintas y el
|
|
900
|
+
endpoint recibe una lista o la otra. Aquí NO se filtran UPC ni SKU: esos son
|
|
901
|
+
atributos de ficha técnica y no aparecen en esta pestaña.
|
|
902
|
+
*/
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
var cambiosDeDescripciones = function cambiosDeDescripciones() {
|
|
906
|
+
var _state$active_retaile3, _state$services$descr, _state$services2, _state$services2$desc, _state$updated_descri;
|
|
907
|
+
|
|
908
|
+
var retailerId = (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer;
|
|
909
|
+
var inputs = (_state$services$descr = (_state$services2 = state.services) === null || _state$services2 === void 0 ? void 0 : (_state$services2$desc = _state$services2.descriptions) === null || _state$services2$desc === void 0 ? void 0 : _state$services2$desc.inputs) !== null && _state$services$descr !== void 0 ? _state$services$descr : {};
|
|
910
|
+
return ((_state$updated_descri = state.updated_descriptions_inputs) !== null && _state$updated_descri !== void 0 ? _state$updated_descri : []).map(function (item) {
|
|
911
|
+
var _input$name2;
|
|
912
|
+
|
|
913
|
+
var input = inputs["".concat(item.attributeId, "_").concat(retailerId)];
|
|
914
|
+
return {
|
|
915
|
+
id: Number(item.attributeId),
|
|
916
|
+
name: (_input$name2 = input === null || input === void 0 ? void 0 : input.name) !== null && _input$name2 !== void 0 ? _input$name2 : "Descripci\xF3n ".concat(item.attributeId),
|
|
917
|
+
value: item.value
|
|
918
|
+
};
|
|
919
|
+
});
|
|
920
|
+
};
|
|
921
|
+
/*
|
|
922
|
+
Destinos posibles para lo que se guarde en este producto: sus hijos y sus
|
|
923
|
+
compañeras de grupo. Un hijo no propaga a nadie.
|
|
924
|
+
*/
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
var destinosPosibles = function destinosPosibles() {
|
|
928
|
+
var _state$product11, _variantGroup$members, _state$product$varian, _state$product12;
|
|
929
|
+
|
|
930
|
+
if ((_state$product11 = state.product) !== null && _state$product11 !== void 0 && _state$product11.parentArticleId) return 0;
|
|
931
|
+
var companeras = ((_variantGroup$members = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.members) !== null && _variantGroup$members !== void 0 ? _variantGroup$members : []).filter(function (m) {
|
|
932
|
+
return !m.isCurrent;
|
|
933
|
+
});
|
|
934
|
+
return ((_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) + companeras.length;
|
|
935
|
+
};
|
|
882
936
|
|
|
883
937
|
var handleOnClickSave = function handleOnClickSave() {
|
|
884
938
|
// `preparandoPropagacion` cubre la ventana entre el clic y la apertura del
|
|
@@ -887,12 +941,35 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
887
941
|
|
|
888
942
|
switch (state.active_tab) {
|
|
889
943
|
case "Descripción":
|
|
890
|
-
|
|
891
|
-
|
|
944
|
+
{
|
|
945
|
+
/*
|
|
946
|
+
Guardar una descripción en un padre también abre la decisión de
|
|
947
|
+
propagar. Sin esto, el hijo heredaba la descripción al ligarse y se
|
|
948
|
+
quedaba con la versión vieja en cuanto el padre la corregía, sin que
|
|
949
|
+
nadie lo notara.
|
|
950
|
+
*/
|
|
951
|
+
var cambiosDesc = cambiosDeDescripciones();
|
|
952
|
+
|
|
953
|
+
if (destinosPosibles() > 0 && cambiosDesc.length > 0) {
|
|
954
|
+
setPreparandoPropagacion(true);
|
|
955
|
+
loadFamily().then(function () {
|
|
956
|
+
return setPendingPropagation({
|
|
957
|
+
cambios: cambiosDesc,
|
|
958
|
+
kind: "description"
|
|
959
|
+
});
|
|
960
|
+
}).finally(function () {
|
|
961
|
+
return setPreparandoPropagacion(false);
|
|
962
|
+
});
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
saveDescriptions(token);
|
|
967
|
+
break;
|
|
968
|
+
}
|
|
892
969
|
|
|
893
970
|
case "Ficha técnica":
|
|
894
971
|
{
|
|
895
|
-
var _variantGroup$
|
|
972
|
+
var _variantGroup$members2, _state$product13, _state$product14;
|
|
896
973
|
|
|
897
974
|
// Guardar un padre con hijos abre la decisión de propagar. Sin este
|
|
898
975
|
// paso el cambio se queda solo en el padre y los hijos se van
|
|
@@ -903,10 +980,24 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
903
980
|
producto puede no tener hijos y aun así pertenecer a un grupo de
|
|
904
981
|
variantes, y ese cambio también se le puede copiar a sus compañeras.
|
|
905
982
|
*/
|
|
906
|
-
var companeras = ((_variantGroup$
|
|
983
|
+
var companeras = ((_variantGroup$members2 = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.members) !== null && _variantGroup$members2 !== void 0 ? _variantGroup$members2 : []).filter(function (m) {
|
|
907
984
|
return !m.isCurrent;
|
|
908
985
|
});
|
|
909
|
-
|
|
986
|
+
/*
|
|
987
|
+
Un HIJO no propaga a nadie, y hay que decirlo explícitamente.
|
|
988
|
+
Sin este corte el diálogo se abría desde la ficha de un hijo y le
|
|
989
|
+
ofrecía a sus HERMANOS como si fueran sus hijos: `family.variants`
|
|
990
|
+
mira la familia desde el padre —eso es lo correcto para navegar entre
|
|
991
|
+
hermanos— pero aquí se estaba leyendo como «los destinos de este
|
|
992
|
+
producto». El servidor resolvía los destinos por su cuenta y no
|
|
993
|
+
escribía nada, así que el usuario elegía hermanos, guardaba, y no
|
|
994
|
+
pasaba nada: un no-operativo silencioso.
|
|
995
|
+
Un hijo tampoco puede estar agrupado desde 2026-09-25, así que para
|
|
996
|
+
él no queda ningún destino posible.
|
|
997
|
+
*/
|
|
998
|
+
|
|
999
|
+
var esHijo = !!((_state$product13 = state.product) !== null && _state$product13 !== void 0 && _state$product13.parentArticleId);
|
|
1000
|
+
var hayDestinos = !esHijo && (((_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.variantsCount) > 0 || companeras.length > 0);
|
|
910
1001
|
var cambios = cambiosDeFichaTecnica();
|
|
911
1002
|
|
|
912
1003
|
if (hayDestinos && cambios.length > 0) {
|
|
@@ -916,7 +1007,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
916
1007
|
setPreparandoPropagacion(true);
|
|
917
1008
|
loadFamily().then(function () {
|
|
918
1009
|
return setPendingPropagation({
|
|
919
|
-
cambios: cambios
|
|
1010
|
+
cambios: cambios,
|
|
1011
|
+
kind: "datasheet"
|
|
920
1012
|
});
|
|
921
1013
|
}).finally(function () {
|
|
922
1014
|
return setPreparandoPropagacion(false);
|
|
@@ -973,7 +1065,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
973
1065
|
var loadFamily = /*#__PURE__*/function () {
|
|
974
1066
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
975
1067
|
var forzar,
|
|
976
|
-
_state$
|
|
1068
|
+
_state$product15,
|
|
977
1069
|
res,
|
|
978
1070
|
_args3 = arguments;
|
|
979
1071
|
|
|
@@ -994,7 +1086,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
994
1086
|
_context3.prev = 3;
|
|
995
1087
|
_context3.next = 6;
|
|
996
1088
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/family"), {
|
|
997
|
-
articleId: (_state$
|
|
1089
|
+
articleId: (_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.id_article
|
|
998
1090
|
}, {
|
|
999
1091
|
headers: {
|
|
1000
1092
|
Authorization: token
|
|
@@ -1173,14 +1265,14 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1173
1265
|
|
|
1174
1266
|
|
|
1175
1267
|
var handleOnUnlinked = function handleOnUnlinked(result) {
|
|
1176
|
-
var _state$product$
|
|
1268
|
+
var _state$product$varian2, _state$product16, _updatedProduct$varia;
|
|
1177
1269
|
|
|
1178
1270
|
if (!result) return;
|
|
1179
1271
|
var updatedProduct = result.mode === "self" ? (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1180
1272
|
parentArticleId: null,
|
|
1181
1273
|
variantsCount: 0
|
|
1182
1274
|
}) : (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1183
|
-
variantsCount: Math.max(((_state$product$
|
|
1275
|
+
variantsCount: Math.max(((_state$product$varian2 = (_state$product16 = state.product) === null || _state$product16 === void 0 ? void 0 : _state$product16.variantsCount) !== null && _state$product$varian2 !== void 0 ? _state$product$varian2 : 1) - 1, 0)
|
|
1184
1276
|
});
|
|
1185
1277
|
dispatch({
|
|
1186
1278
|
type: "SET_PRODUCT",
|
|
@@ -1230,7 +1322,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1230
1322
|
var loadVariantGroup = /*#__PURE__*/function () {
|
|
1231
1323
|
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
1232
1324
|
var forzar,
|
|
1233
|
-
_state$
|
|
1325
|
+
_state$product17,
|
|
1234
1326
|
res,
|
|
1235
1327
|
data,
|
|
1236
1328
|
_args5 = arguments;
|
|
@@ -1252,7 +1344,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1252
1344
|
_context5.prev = 3;
|
|
1253
1345
|
_context5.next = 6;
|
|
1254
1346
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/group"), {
|
|
1255
|
-
articleId: (_state$
|
|
1347
|
+
articleId: (_state$product17 = state.product) === null || _state$product17 === void 0 ? void 0 : _state$product17.id_article
|
|
1256
1348
|
}, {
|
|
1257
1349
|
headers: {
|
|
1258
1350
|
Authorization: token
|
|
@@ -1290,16 +1382,16 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1290
1382
|
}();
|
|
1291
1383
|
|
|
1292
1384
|
(0, _react.useEffect)(function () {
|
|
1293
|
-
var _state$
|
|
1385
|
+
var _state$product18;
|
|
1294
1386
|
|
|
1295
|
-
if (!((_state$
|
|
1387
|
+
if (!((_state$product18 = state.product) !== null && _state$product18 !== void 0 && _state$product18.id_article)) return;
|
|
1296
1388
|
loadVariantGroup(true); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1297
|
-
}, [(_state$
|
|
1389
|
+
}, [(_state$product19 = state.product) === null || _state$product19 === void 0 ? void 0 : _state$product19.id_article]); // Saca el producto del grupo. Los demás miembros siguen agrupados entre ellos;
|
|
1298
1390
|
// si era el último, el grupo deja de existir, porque no vive en ninguna tabla.
|
|
1299
1391
|
|
|
1300
1392
|
var handleOnLeaveGroup = /*#__PURE__*/function () {
|
|
1301
1393
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1302
|
-
var _state$
|
|
1394
|
+
var _state$product20, res;
|
|
1303
1395
|
|
|
1304
1396
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1305
1397
|
while (1) {
|
|
@@ -1308,7 +1400,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1308
1400
|
_context6.prev = 0;
|
|
1309
1401
|
_context6.next = 3;
|
|
1310
1402
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/leave"), {
|
|
1311
|
-
articleId: (_state$
|
|
1403
|
+
articleId: (_state$product20 = state.product) === null || _state$product20 === void 0 ? void 0 : _state$product20.id_article
|
|
1312
1404
|
}, {
|
|
1313
1405
|
headers: {
|
|
1314
1406
|
Authorization: token
|
|
@@ -1446,11 +1538,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1446
1538
|
|
|
1447
1539
|
|
|
1448
1540
|
var handleOnLinkedVariants = function handleOnLinkedVariants(result) {
|
|
1449
|
-
var _state$product$
|
|
1541
|
+
var _state$product$varian3, _state$product21, _result$linked, _result$parentArticle;
|
|
1450
1542
|
|
|
1451
1543
|
if (!result) return;
|
|
1452
1544
|
var updatedProduct = result.mode === "children" ? (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1453
|
-
variantsCount: ((_state$product$
|
|
1545
|
+
variantsCount: ((_state$product$varian3 = (_state$product21 = state.product) === null || _state$product21 === void 0 ? void 0 : _state$product21.variantsCount) !== null && _state$product$varian3 !== void 0 ? _state$product$varian3 : 0) + ((_result$linked = result.linked) !== null && _result$linked !== void 0 ? _result$linked : []).length
|
|
1454
1546
|
}) : (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1455
1547
|
parentArticleId: (_result$parentArticle = result.parentArticleId) !== null && _result$parentArticle !== void 0 ? _result$parentArticle : null,
|
|
1456
1548
|
variantsCount: 0
|
|
@@ -1509,7 +1601,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1509
1601
|
|
|
1510
1602
|
var handleOnRestoreInheritance = /*#__PURE__*/function () {
|
|
1511
1603
|
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(attributeId) {
|
|
1512
|
-
var _state$
|
|
1604
|
+
var _state$product22;
|
|
1513
1605
|
|
|
1514
1606
|
var kind,
|
|
1515
1607
|
esDescripcion,
|
|
@@ -1522,7 +1614,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1522
1614
|
case 0:
|
|
1523
1615
|
kind = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : "attribute";
|
|
1524
1616
|
|
|
1525
|
-
if (!(!attributeId || !((_state$
|
|
1617
|
+
if (!(!attributeId || !((_state$product22 = state.product) !== null && _state$product22 !== void 0 && _state$product22.id_article))) {
|
|
1526
1618
|
_context8.next = 3;
|
|
1527
1619
|
break;
|
|
1528
1620
|
}
|
|
@@ -1632,7 +1724,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1632
1724
|
|
|
1633
1725
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
1634
1726
|
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
|
|
1635
|
-
var _state$product$id_ord, _state$
|
|
1727
|
+
var _state$product$id_ord, _state$active_retaile4, _state$product$status, _state$product$status2, _state$product23;
|
|
1636
1728
|
|
|
1637
1729
|
var concept, articleId, orderId, retailerId, evalStatus, data, _newStatuses$newStatu, _state$services_data, res, newStatuses, serviceStatus, updatedStatusByRetailer, updatedProduct, updatedServicesData;
|
|
1638
1730
|
|
|
@@ -1647,8 +1739,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1647
1739
|
concept = (0, _utils.getConceptByTab)(state.active_tab);
|
|
1648
1740
|
articleId = state.product.id_article;
|
|
1649
1741
|
orderId = (_state$product$id_ord = state.product.id_order) !== null && _state$product$id_ord !== void 0 ? _state$product$id_ord : state.product.orderId;
|
|
1650
|
-
retailerId = (_state$
|
|
1651
|
-
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$
|
|
1742
|
+
retailerId = (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.id_retailer;
|
|
1743
|
+
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$product23 = state.product) === null || _state$product23 === void 0 ? void 0 : _state$product23.version_status);
|
|
1652
1744
|
data = {
|
|
1653
1745
|
articleId: articleId,
|
|
1654
1746
|
orderId: orderId,
|
|
@@ -2132,10 +2224,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2132
2224
|
jwt: token
|
|
2133
2225
|
}), pendingPropagation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PropagateChangesModal.PropagateChangesModal, {
|
|
2134
2226
|
changedAttributes: pendingPropagation.cambios,
|
|
2135
|
-
|
|
2227
|
+
kind: (_pendingPropagation$k = pendingPropagation.kind) !== null && _pendingPropagation$k !== void 0 ? _pendingPropagation$k : "datasheet",
|
|
2228
|
+
variants: (_state$product24 = state.product) !== null && _state$product24 !== void 0 && _state$product24.parentArticleId ? [] : ((_family$variants2 = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants2 !== void 0 ? _family$variants2 : []).filter(function (v) {
|
|
2136
2229
|
return !v.isCurrent;
|
|
2137
2230
|
}),
|
|
2138
|
-
groupMembers: ((_variantGroup$
|
|
2231
|
+
groupMembers: ((_variantGroup$members3 = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.members) !== null && _variantGroup$members3 !== void 0 ? _variantGroup$members3 : []).filter(function (m) {
|
|
2139
2232
|
return !m.isCurrent;
|
|
2140
2233
|
}),
|
|
2141
2234
|
groupCode: (_variantGroup$group = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) !== null && _variantGroup$group !== void 0 ? _variantGroup$group : null,
|
|
@@ -2144,23 +2237,47 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2144
2237
|
return setPendingPropagation(null);
|
|
2145
2238
|
},
|
|
2146
2239
|
onConfirm: function onConfirm(propagation) {
|
|
2240
|
+
var esDescripcion = pendingPropagation.kind === "description";
|
|
2147
2241
|
setPendingPropagation(null);
|
|
2148
|
-
|
|
2242
|
+
|
|
2243
|
+
if (!propagation) {
|
|
2244
|
+
// Guardar sin propagar: el producto se guarda solo.
|
|
2245
|
+
if (esDescripcion) saveDescriptions(token);else saveDatasheets(token);
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
/*
|
|
2249
|
+
El diálogo habla de «atributos» porque es el mismo componente
|
|
2250
|
+
para las dos pestañas. Al guardar hay que ponerlo en la lista
|
|
2251
|
+
que corresponde: el servidor recibe `attributes` o
|
|
2252
|
+
`descriptions`, nunca una por la otra.
|
|
2253
|
+
*/
|
|
2254
|
+
|
|
2255
|
+
|
|
2256
|
+
var attributes = propagation.attributes,
|
|
2257
|
+
destinos = (0, _objectWithoutProperties2.default)(propagation, _excluded);
|
|
2258
|
+
|
|
2259
|
+
if (esDescripcion) {
|
|
2260
|
+
saveDescriptions(token, (0, _objectSpread4.default)((0, _objectSpread4.default)({}, destinos), {}, {
|
|
2261
|
+
descriptions: attributes
|
|
2262
|
+
}));
|
|
2263
|
+
} else {
|
|
2264
|
+
saveDatasheets(token, propagation);
|
|
2265
|
+
}
|
|
2149
2266
|
}
|
|
2150
2267
|
}), showLinkVariants && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkVariantsModal.LinkVariantsModal, {
|
|
2151
|
-
articleId: (_state$
|
|
2152
|
-
articleName: (_state$
|
|
2153
|
-
articleUpc: (_state$
|
|
2154
|
-
activeRetailerId: (_state$
|
|
2268
|
+
articleId: (_state$product25 = state.product) === null || _state$product25 === void 0 ? void 0 : _state$product25.id_article,
|
|
2269
|
+
articleName: (_state$product26 = state.product) === null || _state$product26 === void 0 ? void 0 : _state$product26.name,
|
|
2270
|
+
articleUpc: (_state$product27 = state.product) === null || _state$product27 === void 0 ? void 0 : _state$product27.upc,
|
|
2271
|
+
activeRetailerId: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.id_retailer,
|
|
2155
2272
|
token: token,
|
|
2156
2273
|
onClose: function onClose() {
|
|
2157
2274
|
return setShowLinkVariants(false);
|
|
2158
2275
|
},
|
|
2159
2276
|
onLinked: handleOnLinkedVariants
|
|
2160
2277
|
}), showGroupModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VariantGroupModal.VariantGroupModal, {
|
|
2161
|
-
articleId: (_state$
|
|
2162
|
-
articleName: (_state$
|
|
2163
|
-
articleUpc: (_state$
|
|
2278
|
+
articleId: (_state$product28 = state.product) === null || _state$product28 === void 0 ? void 0 : _state$product28.id_article,
|
|
2279
|
+
articleName: (_state$product29 = state.product) === null || _state$product29 === void 0 ? void 0 : _state$product29.name,
|
|
2280
|
+
articleUpc: (_state$product30 = state.product) === null || _state$product30 === void 0 ? void 0 : _state$product30.upc,
|
|
2164
2281
|
currentGroup: (_variantGroup$group2 = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) !== null && _variantGroup$group2 !== void 0 ? _variantGroup$group2 : null,
|
|
2165
2282
|
token: token,
|
|
2166
2283
|
onClose: function onClose() {
|
|
@@ -2302,8 +2419,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2302
2419
|
productSelected: state.product,
|
|
2303
2420
|
token: token,
|
|
2304
2421
|
activeRetailer: {
|
|
2305
|
-
id: (_state$
|
|
2306
|
-
name: (_state$
|
|
2422
|
+
id: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
|
|
2423
|
+
name: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.retailer
|
|
2307
2424
|
}
|
|
2308
2425
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2309
2426
|
className: "data-container",
|
|
@@ -2318,8 +2435,8 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2318
2435
|
lists: state.images_values || [],
|
|
2319
2436
|
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] : {},
|
|
2320
2437
|
assignationsImages: assig,
|
|
2321
|
-
retailerSelected: (_state$
|
|
2322
|
-
imagesStatus: ((_state$
|
|
2438
|
+
retailerSelected: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.id_retailer,
|
|
2439
|
+
imagesStatus: ((_state$product31 = state.product) === null || _state$product31 === void 0 ? void 0 : _state$product31.images_status) || "-",
|
|
2323
2440
|
isRetailer: isRetailer,
|
|
2324
2441
|
setShowVersionSelector: setShowVersionSelector,
|
|
2325
2442
|
version: state.product.version,
|
|
@@ -2332,7 +2449,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2332
2449
|
className: "product-information",
|
|
2333
2450
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2334
2451
|
className: "product-information",
|
|
2335
|
-
children: [!((_state$
|
|
2452
|
+
children: [!((_state$product32 = state.product) !== null && _state$product32 !== void 0 && _state$product32.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2336
2453
|
className: "variants-actions",
|
|
2337
2454
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
2338
2455
|
type: "button",
|
|
@@ -2341,7 +2458,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2341
2458
|
return setShowLinkVariants(true);
|
|
2342
2459
|
},
|
|
2343
2460
|
children: "Ligar productos"
|
|
2344
|
-
}), ((_state$
|
|
2461
|
+
}), ((_state$product33 = state.product) === null || _state$product33 === void 0 ? void 0 : _state$product33.variantsCount) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2345
2462
|
type: "button",
|
|
2346
2463
|
className: "variants-count",
|
|
2347
2464
|
"aria-expanded": showFamily,
|
|
@@ -2356,7 +2473,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2356
2473
|
children: showFamily ? " ▴" : " ▾"
|
|
2357
2474
|
})]
|
|
2358
2475
|
})]
|
|
2359
|
-
}), ((_state$
|
|
2476
|
+
}), ((_state$product34 = state.product) === null || _state$product34 === void 0 ? void 0 : _state$product34.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2360
2477
|
className: "variants-actions",
|
|
2361
2478
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2362
2479
|
type: "button",
|
|
@@ -2405,13 +2522,13 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2405
2522
|
className: "desvincular",
|
|
2406
2523
|
title: "Dejar de ser hijo de este producto",
|
|
2407
2524
|
onClick: function onClick() {
|
|
2408
|
-
var _state$
|
|
2525
|
+
var _state$product35, _state$product36, _state$product37;
|
|
2409
2526
|
|
|
2410
2527
|
return setPorDesvincular({
|
|
2411
2528
|
mode: "self",
|
|
2412
|
-
childArticleId: (_state$
|
|
2413
|
-
childName: (_state$
|
|
2414
|
-
childUpc: (_state$
|
|
2529
|
+
childArticleId: (_state$product35 = state.product) === null || _state$product35 === void 0 ? void 0 : _state$product35.id_article,
|
|
2530
|
+
childName: (_state$product36 = state.product) === null || _state$product36 === void 0 ? void 0 : _state$product36.name,
|
|
2531
|
+
childUpc: (_state$product37 = state.product) === null || _state$product37 === void 0 ? void 0 : _state$product37.upc,
|
|
2415
2532
|
parentName: family.parent.name,
|
|
2416
2533
|
parentUpc: family.parent.upc
|
|
2417
2534
|
});
|
|
@@ -2443,15 +2560,15 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2443
2560
|
className: "desvincular",
|
|
2444
2561
|
title: "Desvincular este hijo",
|
|
2445
2562
|
onClick: function onClick() {
|
|
2446
|
-
var _state$
|
|
2563
|
+
var _state$product38, _state$product39;
|
|
2447
2564
|
|
|
2448
2565
|
return setPorDesvincular({
|
|
2449
2566
|
mode: "child",
|
|
2450
2567
|
childArticleId: variant.articleId,
|
|
2451
2568
|
childName: variant.name,
|
|
2452
2569
|
childUpc: variant.upc,
|
|
2453
|
-
parentName: (_state$
|
|
2454
|
-
parentUpc: (_state$
|
|
2570
|
+
parentName: (_state$product38 = state.product) === null || _state$product38 === void 0 ? void 0 : _state$product38.name,
|
|
2571
|
+
parentUpc: (_state$product39 = state.product) === null || _state$product39 === void 0 ? void 0 : _state$product39.upc
|
|
2455
2572
|
});
|
|
2456
2573
|
},
|
|
2457
2574
|
children: "Desvincular"
|
|
@@ -2467,7 +2584,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2467
2584
|
onClick: openMultipleEdition,
|
|
2468
2585
|
children: preparandoEdicionMultiple ? "Abriendo…" : "Editar los ".concat(family.variants.length, " hijos juntos")
|
|
2469
2586
|
})]
|
|
2470
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2587
|
+
}), puedeAgruparse && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2471
2588
|
className: "variants-actions",
|
|
2472
2589
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
2473
2590
|
type: "button",
|
|
@@ -2490,9 +2607,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2490
2607
|
children: showGroup ? " ▴" : " ▾"
|
|
2491
2608
|
})]
|
|
2492
2609
|
})]
|
|
2493
|
-
}), showGroup && (variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2610
|
+
}), puedeAgruparse && showGroup && (variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2494
2611
|
className: "variants-family",
|
|
2495
|
-
children: [((_variantGroup$
|
|
2612
|
+
children: [((_variantGroup$members4 = variantGroup.members) !== null && _variantGroup$members4 !== void 0 ? _variantGroup$members4 : []).filter(function (miembro) {
|
|
2496
2613
|
return !miembro.isCurrent;
|
|
2497
2614
|
}).map(function (miembro) {
|
|
2498
2615
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -2516,7 +2633,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2516
2633
|
})]
|
|
2517
2634
|
})
|
|
2518
2635
|
}, miembro.articleId);
|
|
2519
|
-
}), ((_variantGroup$
|
|
2636
|
+
}), ((_variantGroup$members5 = variantGroup.members) !== null && _variantGroup$members5 !== void 0 ? _variantGroup$members5 : []).filter(function (m) {
|
|
2520
2637
|
return !m.isCurrent;
|
|
2521
2638
|
}).length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
2522
2639
|
className: "loading",
|
|
@@ -2532,9 +2649,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2532
2649
|
headerData: state.product,
|
|
2533
2650
|
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,
|
|
2534
2651
|
activeRetailer: {
|
|
2535
|
-
id: (_state$
|
|
2536
|
-
name: (_state$
|
|
2537
|
-
image: (_state$
|
|
2652
|
+
id: (_state$active_retaile9 = state.active_retailer) === null || _state$active_retaile9 === void 0 ? void 0 : _state$active_retaile9.id_retailer,
|
|
2653
|
+
name: (_state$active_retaile10 = state.active_retailer) === null || _state$active_retaile10 === void 0 ? void 0 : _state$active_retaile10.retailer,
|
|
2654
|
+
image: (_state$active_retaile11 = state.active_retailer) === null || _state$active_retaile11 === void 0 ? void 0 : _state$active_retaile11.image
|
|
2538
2655
|
},
|
|
2539
2656
|
showValidationButtons: canShowValidationButtons(),
|
|
2540
2657
|
showApproveRejectAll: canShowValidationButtons(),
|
|
@@ -2578,7 +2695,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2578
2695
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2579
2696
|
className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
|
|
2580
2697
|
children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
2581
|
-
children: [state.active_tab === "Descripción" && (((_state$
|
|
2698
|
+
children: [state.active_tab === "Descripción" && (((_state$product40 = state.product) === null || _state$product40 === void 0 ? void 0 : _state$product40.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, {
|
|
2582
2699
|
activeSection: state.active_tab,
|
|
2583
2700
|
inputGroup: state.descriptions_inputs[0],
|
|
2584
2701
|
updatedDescriptions: state.updated_descriptions_inputs
|
|
@@ -2587,9 +2704,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2587
2704
|
la ficha técnica para no depender de que la
|
|
2588
2705
|
llamada de descripciones traiga el bloque. */
|
|
2589
2706
|
,
|
|
2590
|
-
variant: (_state$
|
|
2707
|
+
variant: (_state$services3 = state.services) === null || _state$services3 === void 0 ? void 0 : (_state$services3$data = _state$services3.datasheets) === null || _state$services3$data === void 0 ? void 0 : _state$services3$data.variant,
|
|
2591
2708
|
onRestoreInheritance: handleOnRestoreInheritance,
|
|
2592
|
-
articleId: (_state$
|
|
2709
|
+
articleId: (_state$product41 = state.product) === null || _state$product41 === void 0 ? void 0 : _state$product41.id_article,
|
|
2593
2710
|
version: state.product.version,
|
|
2594
2711
|
isShowbox: false,
|
|
2595
2712
|
dinamicHeight: true,
|
|
@@ -2601,9 +2718,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2601
2718
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2602
2719
|
text: "No cuentas con este servicio",
|
|
2603
2720
|
headerType: "input-name-header"
|
|
2604
|
-
})), state.active_tab === "Ficha técnica" && (((_state$
|
|
2721
|
+
})), state.active_tab === "Ficha técnica" && (((_state$product42 = state.product) === null || _state$product42 === void 0 ? void 0 : _state$product42.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
2605
2722
|
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) {
|
|
2606
|
-
var _state$datasheets_inp4, _state$
|
|
2723
|
+
var _state$datasheets_inp4, _state$services4, _state$services4$data, _state$services$datas3;
|
|
2607
2724
|
|
|
2608
2725
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
2609
2726
|
index: index,
|
|
@@ -2612,7 +2729,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2612
2729
|
activeSection: state.active_tab,
|
|
2613
2730
|
inputGroup: dataGroup,
|
|
2614
2731
|
dataInputs: (_state$datasheets_inp4 = state.datasheets_inputs[1]) !== null && _state$datasheets_inp4 !== void 0 ? _state$datasheets_inp4 : [],
|
|
2615
|
-
variant: (_state$
|
|
2732
|
+
variant: (_state$services4 = state.services) === null || _state$services4 === void 0 ? void 0 : (_state$services4$data = _state$services4.datasheets) === null || _state$services4$data === void 0 ? void 0 : _state$services4$data.variant,
|
|
2616
2733
|
onRestoreInheritance: handleOnRestoreInheritance,
|
|
2617
2734
|
activeRetailer: state.services.datasheets[state.active_retailer.id_retailer],
|
|
2618
2735
|
groupData: (_state$services$datas3 = state.services.datasheets[state.active_retailer.id_retailer]) === null || _state$services$datas3 === void 0 ? void 0 : _state$services$datas3.data,
|
|
@@ -2631,7 +2748,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2631
2748
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2632
2749
|
text: "No cuentas con este servicio",
|
|
2633
2750
|
headerType: "input-name-header"
|
|
2634
|
-
})), state.active_tab === "Imágenes" && (((_state$
|
|
2751
|
+
})), state.active_tab === "Imágenes" && (((_state$product43 = state.product) === null || _state$product43 === void 0 ? void 0 : _state$product43.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
2635
2752
|
children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
|
|
2636
2753
|
checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
|
|
2637
2754
|
,
|