contentoh-components-library 21.6.50 → 21.6.51
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/pages/ProviderProductEdition/index.js +78 -53
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +15 -330
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +2 -12
- package/dist/components/pages/RetailerProductEdition/index.js +445 -603
- 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/pages/ProviderProductEdition/index.js +36 -3
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +0 -201
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +0 -12
- package/src/components/pages/RetailerProductEdition/index.js +179 -360
- 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
|
@@ -96,7 +96,7 @@ var _AiProductEdition = require("../../../contexts/AiProductEdition");
|
|
|
96
96
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
97
97
|
|
|
98
98
|
var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
99
|
-
var
|
|
99
|
+
var _state$product, _location$state4, _state$product3, _state$product4, _state$product5, _state$product6, _state$product7, _state$product8, _state$product17, _state$product22, _family$variants2, _variantGroup$members2, _variantGroup$group, _state$product23, _state$product24, _state$product25, _state$active_retaile4, _state$product26, _state$product27, _state$product28, _variantGroup$group2, _location$state5, _location$state6, _state$active_retaile5, _state$active_retaile6, _state$images_values$2, _state$images_values10, _state$images_values11, _state$active_retaile7, _state$product29, _state$product30, _state$product31, _state$product32, _family$variants3, _family$variants4, _family$variants5, _variantGroup$members3, _variantGroup$members4, _state$active_percent, _state$active_percent2, _state$active_retaile8, _state$active_retaile9, _state$active_retaile10, _state$product38, _state$descriptions_i, _state$services2, _state$services2$data, _state$product39, _state$product40, _state$datasheets_inp, _state$datasheets_inp2, _state$datasheets_inp3, _state$product41, _state$images_values12;
|
|
100
100
|
|
|
101
101
|
var tabsSections = _ref.tabsSections,
|
|
102
102
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -176,6 +176,17 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
176
176
|
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
177
177
|
showGroupModal = _useState18[0],
|
|
178
178
|
setShowGroupModal = _useState18[1];
|
|
179
|
+
/*
|
|
180
|
+
Un hijo no se agrupa como variante (decisión de producto, 2026-09-25).
|
|
181
|
+
Agrupar declara «estos son el mismo producto en otra presentación», y un
|
|
182
|
+
hijo ya declaró de dónde deriva; tener las dos cosas lo dejaba con dos
|
|
183
|
+
respuestas distintas a la misma pregunta. El servidor lo rechaza con
|
|
184
|
+
VARIANT_GROUP_NOT_FOR_CHILD, así que ofrecer el botón aquí sería ofrecer
|
|
185
|
+
algo que siempre falla.
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
var puedeAgruparse = !((_state$product = state.product) !== null && _state$product !== void 0 && _state$product.parentArticleId);
|
|
179
190
|
|
|
180
191
|
var _useState19 = (0, _react.useState)(null),
|
|
181
192
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
@@ -360,10 +371,10 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
360
371
|
(0, _react.useEffect)(function () {
|
|
361
372
|
if (!state.product || !state.active_retailer) return;
|
|
362
373
|
console.log("Fetch services and percentages");
|
|
363
|
-
var _state$
|
|
364
|
-
id_article = _state$
|
|
365
|
-
version = _state$
|
|
366
|
-
id_order = _state$
|
|
374
|
+
var _state$product2 = state.product,
|
|
375
|
+
id_article = _state$product2.id_article,
|
|
376
|
+
version = _state$product2.version,
|
|
377
|
+
id_order = _state$product2.id_order;
|
|
367
378
|
var _state$active_retaile = state.active_retailer,
|
|
368
379
|
category = _state$active_retaile.category,
|
|
369
380
|
id_category = _state$active_retaile.id_category,
|
|
@@ -521,7 +532,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
521
532
|
}();
|
|
522
533
|
|
|
523
534
|
fetchData();
|
|
524
|
-
}, [(_state$
|
|
535
|
+
}, [(_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
536
|
|
|
526
537
|
(0, _react.useEffect)(function () {
|
|
527
538
|
if (!state.active_retailer) return;
|
|
@@ -580,9 +591,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
580
591
|
}, [state.services]); // Helper functions
|
|
581
592
|
|
|
582
593
|
var canShowValidationButtons = function canShowValidationButtons() {
|
|
583
|
-
var _state$
|
|
594
|
+
var _state$product9;
|
|
584
595
|
|
|
585
|
-
if (!((_state$
|
|
596
|
+
if (!((_state$product9 = state.product) !== null && _state$product9 !== void 0 && _state$product9.statusByRetailer)) return false;
|
|
586
597
|
|
|
587
598
|
try {
|
|
588
599
|
var currentService = (0, _utils.getConceptByTab)(state.active_tab); // const currentStatus = state.product[`${currentService}_status`];
|
|
@@ -703,9 +714,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
703
714
|
};
|
|
704
715
|
|
|
705
716
|
var handleOnClickSaveImages = function handleOnClickSaveImages() {
|
|
706
|
-
var _state$
|
|
717
|
+
var _state$product10, _state$product10$serv;
|
|
707
718
|
|
|
708
|
-
if (((_state$
|
|
719
|
+
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
720
|
updateImages();
|
|
710
721
|
}
|
|
711
722
|
};
|
|
@@ -892,7 +903,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
892
903
|
|
|
893
904
|
case "Ficha técnica":
|
|
894
905
|
{
|
|
895
|
-
var _variantGroup$members, _state$
|
|
906
|
+
var _variantGroup$members, _state$product11, _state$product12;
|
|
896
907
|
|
|
897
908
|
// Guardar un padre con hijos abre la decisión de propagar. Sin este
|
|
898
909
|
// paso el cambio se queda solo en el padre y los hijos se van
|
|
@@ -906,7 +917,21 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
906
917
|
var companeras = ((_variantGroup$members = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.members) !== null && _variantGroup$members !== void 0 ? _variantGroup$members : []).filter(function (m) {
|
|
907
918
|
return !m.isCurrent;
|
|
908
919
|
});
|
|
909
|
-
|
|
920
|
+
/*
|
|
921
|
+
Un HIJO no propaga a nadie, y hay que decirlo explícitamente.
|
|
922
|
+
Sin este corte el diálogo se abría desde la ficha de un hijo y le
|
|
923
|
+
ofrecía a sus HERMANOS como si fueran sus hijos: `family.variants`
|
|
924
|
+
mira la familia desde el padre —eso es lo correcto para navegar entre
|
|
925
|
+
hermanos— pero aquí se estaba leyendo como «los destinos de este
|
|
926
|
+
producto». El servidor resolvía los destinos por su cuenta y no
|
|
927
|
+
escribía nada, así que el usuario elegía hermanos, guardaba, y no
|
|
928
|
+
pasaba nada: un no-operativo silencioso.
|
|
929
|
+
Un hijo tampoco puede estar agrupado desde 2026-09-25, así que para
|
|
930
|
+
él no queda ningún destino posible.
|
|
931
|
+
*/
|
|
932
|
+
|
|
933
|
+
var esHijo = !!((_state$product11 = state.product) !== null && _state$product11 !== void 0 && _state$product11.parentArticleId);
|
|
934
|
+
var hayDestinos = !esHijo && (((_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.variantsCount) > 0 || companeras.length > 0);
|
|
910
935
|
var cambios = cambiosDeFichaTecnica();
|
|
911
936
|
|
|
912
937
|
if (hayDestinos && cambios.length > 0) {
|
|
@@ -973,7 +998,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
973
998
|
var loadFamily = /*#__PURE__*/function () {
|
|
974
999
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
975
1000
|
var forzar,
|
|
976
|
-
_state$
|
|
1001
|
+
_state$product13,
|
|
977
1002
|
res,
|
|
978
1003
|
_args3 = arguments;
|
|
979
1004
|
|
|
@@ -994,7 +1019,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
994
1019
|
_context3.prev = 3;
|
|
995
1020
|
_context3.next = 6;
|
|
996
1021
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/family"), {
|
|
997
|
-
articleId: (_state$
|
|
1022
|
+
articleId: (_state$product13 = state.product) === null || _state$product13 === void 0 ? void 0 : _state$product13.id_article
|
|
998
1023
|
}, {
|
|
999
1024
|
headers: {
|
|
1000
1025
|
Authorization: token
|
|
@@ -1173,14 +1198,14 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1173
1198
|
|
|
1174
1199
|
|
|
1175
1200
|
var handleOnUnlinked = function handleOnUnlinked(result) {
|
|
1176
|
-
var _state$product$varian, _state$
|
|
1201
|
+
var _state$product$varian, _state$product14, _updatedProduct$varia;
|
|
1177
1202
|
|
|
1178
1203
|
if (!result) return;
|
|
1179
1204
|
var updatedProduct = result.mode === "self" ? (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1180
1205
|
parentArticleId: null,
|
|
1181
1206
|
variantsCount: 0
|
|
1182
1207
|
}) : (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1183
|
-
variantsCount: Math.max(((_state$product$varian = (_state$
|
|
1208
|
+
variantsCount: Math.max(((_state$product$varian = (_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.variantsCount) !== null && _state$product$varian !== void 0 ? _state$product$varian : 1) - 1, 0)
|
|
1184
1209
|
});
|
|
1185
1210
|
dispatch({
|
|
1186
1211
|
type: "SET_PRODUCT",
|
|
@@ -1230,7 +1255,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1230
1255
|
var loadVariantGroup = /*#__PURE__*/function () {
|
|
1231
1256
|
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
1232
1257
|
var forzar,
|
|
1233
|
-
_state$
|
|
1258
|
+
_state$product15,
|
|
1234
1259
|
res,
|
|
1235
1260
|
data,
|
|
1236
1261
|
_args5 = arguments;
|
|
@@ -1252,7 +1277,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1252
1277
|
_context5.prev = 3;
|
|
1253
1278
|
_context5.next = 6;
|
|
1254
1279
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/group"), {
|
|
1255
|
-
articleId: (_state$
|
|
1280
|
+
articleId: (_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.id_article
|
|
1256
1281
|
}, {
|
|
1257
1282
|
headers: {
|
|
1258
1283
|
Authorization: token
|
|
@@ -1290,16 +1315,16 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1290
1315
|
}();
|
|
1291
1316
|
|
|
1292
1317
|
(0, _react.useEffect)(function () {
|
|
1293
|
-
var _state$
|
|
1318
|
+
var _state$product16;
|
|
1294
1319
|
|
|
1295
|
-
if (!((_state$
|
|
1320
|
+
if (!((_state$product16 = state.product) !== null && _state$product16 !== void 0 && _state$product16.id_article)) return;
|
|
1296
1321
|
loadVariantGroup(true); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1297
|
-
}, [(_state$
|
|
1322
|
+
}, [(_state$product17 = state.product) === null || _state$product17 === void 0 ? void 0 : _state$product17.id_article]); // Saca el producto del grupo. Los demás miembros siguen agrupados entre ellos;
|
|
1298
1323
|
// si era el último, el grupo deja de existir, porque no vive en ninguna tabla.
|
|
1299
1324
|
|
|
1300
1325
|
var handleOnLeaveGroup = /*#__PURE__*/function () {
|
|
1301
1326
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1302
|
-
var _state$
|
|
1327
|
+
var _state$product18, res;
|
|
1303
1328
|
|
|
1304
1329
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1305
1330
|
while (1) {
|
|
@@ -1308,7 +1333,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1308
1333
|
_context6.prev = 0;
|
|
1309
1334
|
_context6.next = 3;
|
|
1310
1335
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/leave"), {
|
|
1311
|
-
articleId: (_state$
|
|
1336
|
+
articleId: (_state$product18 = state.product) === null || _state$product18 === void 0 ? void 0 : _state$product18.id_article
|
|
1312
1337
|
}, {
|
|
1313
1338
|
headers: {
|
|
1314
1339
|
Authorization: token
|
|
@@ -1446,11 +1471,11 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1446
1471
|
|
|
1447
1472
|
|
|
1448
1473
|
var handleOnLinkedVariants = function handleOnLinkedVariants(result) {
|
|
1449
|
-
var _state$product$varian2, _state$
|
|
1474
|
+
var _state$product$varian2, _state$product19, _result$linked, _result$parentArticle;
|
|
1450
1475
|
|
|
1451
1476
|
if (!result) return;
|
|
1452
1477
|
var updatedProduct = result.mode === "children" ? (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1453
|
-
variantsCount: ((_state$product$varian2 = (_state$
|
|
1478
|
+
variantsCount: ((_state$product$varian2 = (_state$product19 = state.product) === null || _state$product19 === void 0 ? void 0 : _state$product19.variantsCount) !== null && _state$product$varian2 !== void 0 ? _state$product$varian2 : 0) + ((_result$linked = result.linked) !== null && _result$linked !== void 0 ? _result$linked : []).length
|
|
1454
1479
|
}) : (0, _objectSpread4.default)((0, _objectSpread4.default)({}, state.product), {}, {
|
|
1455
1480
|
parentArticleId: (_result$parentArticle = result.parentArticleId) !== null && _result$parentArticle !== void 0 ? _result$parentArticle : null,
|
|
1456
1481
|
variantsCount: 0
|
|
@@ -1509,7 +1534,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1509
1534
|
|
|
1510
1535
|
var handleOnRestoreInheritance = /*#__PURE__*/function () {
|
|
1511
1536
|
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(attributeId) {
|
|
1512
|
-
var _state$
|
|
1537
|
+
var _state$product20;
|
|
1513
1538
|
|
|
1514
1539
|
var kind,
|
|
1515
1540
|
esDescripcion,
|
|
@@ -1522,7 +1547,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1522
1547
|
case 0:
|
|
1523
1548
|
kind = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : "attribute";
|
|
1524
1549
|
|
|
1525
|
-
if (!(!attributeId || !((_state$
|
|
1550
|
+
if (!(!attributeId || !((_state$product20 = state.product) !== null && _state$product20 !== void 0 && _state$product20.id_article))) {
|
|
1526
1551
|
_context8.next = 3;
|
|
1527
1552
|
break;
|
|
1528
1553
|
}
|
|
@@ -1632,7 +1657,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1632
1657
|
|
|
1633
1658
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
1634
1659
|
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(result) {
|
|
1635
|
-
var _state$product$id_ord, _state$active_retaile3, _state$product$status, _state$product$status2, _state$
|
|
1660
|
+
var _state$product$id_ord, _state$active_retaile3, _state$product$status, _state$product$status2, _state$product21;
|
|
1636
1661
|
|
|
1637
1662
|
var concept, articleId, orderId, retailerId, evalStatus, data, _newStatuses$newStatu, _state$services_data, res, newStatuses, serviceStatus, updatedStatusByRetailer, updatedProduct, updatedServicesData;
|
|
1638
1663
|
|
|
@@ -1648,7 +1673,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
1648
1673
|
articleId = state.product.id_article;
|
|
1649
1674
|
orderId = (_state$product$id_ord = state.product.id_order) !== null && _state$product$id_ord !== void 0 ? _state$product$id_ord : state.product.orderId;
|
|
1650
1675
|
retailerId = (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer;
|
|
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$
|
|
1676
|
+
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$product21 = state.product) === null || _state$product21 === void 0 ? void 0 : _state$product21.version_status);
|
|
1652
1677
|
data = {
|
|
1653
1678
|
articleId: articleId,
|
|
1654
1679
|
orderId: orderId,
|
|
@@ -2132,7 +2157,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2132
2157
|
jwt: token
|
|
2133
2158
|
}), pendingPropagation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PropagateChangesModal.PropagateChangesModal, {
|
|
2134
2159
|
changedAttributes: pendingPropagation.cambios,
|
|
2135
|
-
variants: ((_family$variants2 = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants2 !== void 0 ? _family$variants2 : []).filter(function (v) {
|
|
2160
|
+
variants: (_state$product22 = state.product) !== null && _state$product22 !== void 0 && _state$product22.parentArticleId ? [] : ((_family$variants2 = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants2 !== void 0 ? _family$variants2 : []).filter(function (v) {
|
|
2136
2161
|
return !v.isCurrent;
|
|
2137
2162
|
}),
|
|
2138
2163
|
groupMembers: ((_variantGroup$members2 = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.members) !== null && _variantGroup$members2 !== void 0 ? _variantGroup$members2 : []).filter(function (m) {
|
|
@@ -2148,9 +2173,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2148
2173
|
saveDatasheets(token, propagation !== null && propagation !== void 0 ? propagation : undefined);
|
|
2149
2174
|
}
|
|
2150
2175
|
}), showLinkVariants && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkVariantsModal.LinkVariantsModal, {
|
|
2151
|
-
articleId: (_state$
|
|
2152
|
-
articleName: (_state$
|
|
2153
|
-
articleUpc: (_state$
|
|
2176
|
+
articleId: (_state$product23 = state.product) === null || _state$product23 === void 0 ? void 0 : _state$product23.id_article,
|
|
2177
|
+
articleName: (_state$product24 = state.product) === null || _state$product24 === void 0 ? void 0 : _state$product24.name,
|
|
2178
|
+
articleUpc: (_state$product25 = state.product) === null || _state$product25 === void 0 ? void 0 : _state$product25.upc,
|
|
2154
2179
|
activeRetailerId: (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.id_retailer,
|
|
2155
2180
|
token: token,
|
|
2156
2181
|
onClose: function onClose() {
|
|
@@ -2158,9 +2183,9 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2158
2183
|
},
|
|
2159
2184
|
onLinked: handleOnLinkedVariants
|
|
2160
2185
|
}), showGroupModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VariantGroupModal.VariantGroupModal, {
|
|
2161
|
-
articleId: (_state$
|
|
2162
|
-
articleName: (_state$
|
|
2163
|
-
articleUpc: (_state$
|
|
2186
|
+
articleId: (_state$product26 = state.product) === null || _state$product26 === void 0 ? void 0 : _state$product26.id_article,
|
|
2187
|
+
articleName: (_state$product27 = state.product) === null || _state$product27 === void 0 ? void 0 : _state$product27.name,
|
|
2188
|
+
articleUpc: (_state$product28 = state.product) === null || _state$product28 === void 0 ? void 0 : _state$product28.upc,
|
|
2164
2189
|
currentGroup: (_variantGroup$group2 = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) !== null && _variantGroup$group2 !== void 0 ? _variantGroup$group2 : null,
|
|
2165
2190
|
token: token,
|
|
2166
2191
|
onClose: function onClose() {
|
|
@@ -2319,7 +2344,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2319
2344
|
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
2345
|
assignationsImages: assig,
|
|
2321
2346
|
retailerSelected: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.id_retailer,
|
|
2322
|
-
imagesStatus: ((_state$
|
|
2347
|
+
imagesStatus: ((_state$product29 = state.product) === null || _state$product29 === void 0 ? void 0 : _state$product29.images_status) || "-",
|
|
2323
2348
|
isRetailer: isRetailer,
|
|
2324
2349
|
setShowVersionSelector: setShowVersionSelector,
|
|
2325
2350
|
version: state.product.version,
|
|
@@ -2332,7 +2357,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2332
2357
|
className: "product-information",
|
|
2333
2358
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2334
2359
|
className: "product-information",
|
|
2335
|
-
children: [!((_state$
|
|
2360
|
+
children: [!((_state$product30 = state.product) !== null && _state$product30 !== void 0 && _state$product30.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2336
2361
|
className: "variants-actions",
|
|
2337
2362
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
2338
2363
|
type: "button",
|
|
@@ -2341,7 +2366,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2341
2366
|
return setShowLinkVariants(true);
|
|
2342
2367
|
},
|
|
2343
2368
|
children: "Ligar productos"
|
|
2344
|
-
}), ((_state$
|
|
2369
|
+
}), ((_state$product31 = state.product) === null || _state$product31 === void 0 ? void 0 : _state$product31.variantsCount) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2345
2370
|
type: "button",
|
|
2346
2371
|
className: "variants-count",
|
|
2347
2372
|
"aria-expanded": showFamily,
|
|
@@ -2356,7 +2381,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2356
2381
|
children: showFamily ? " ▴" : " ▾"
|
|
2357
2382
|
})]
|
|
2358
2383
|
})]
|
|
2359
|
-
}), ((_state$
|
|
2384
|
+
}), ((_state$product32 = state.product) === null || _state$product32 === void 0 ? void 0 : _state$product32.parentArticleId) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2360
2385
|
className: "variants-actions",
|
|
2361
2386
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
2362
2387
|
type: "button",
|
|
@@ -2405,13 +2430,13 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2405
2430
|
className: "desvincular",
|
|
2406
2431
|
title: "Dejar de ser hijo de este producto",
|
|
2407
2432
|
onClick: function onClick() {
|
|
2408
|
-
var _state$
|
|
2433
|
+
var _state$product33, _state$product34, _state$product35;
|
|
2409
2434
|
|
|
2410
2435
|
return setPorDesvincular({
|
|
2411
2436
|
mode: "self",
|
|
2412
|
-
childArticleId: (_state$
|
|
2413
|
-
childName: (_state$
|
|
2414
|
-
childUpc: (_state$
|
|
2437
|
+
childArticleId: (_state$product33 = state.product) === null || _state$product33 === void 0 ? void 0 : _state$product33.id_article,
|
|
2438
|
+
childName: (_state$product34 = state.product) === null || _state$product34 === void 0 ? void 0 : _state$product34.name,
|
|
2439
|
+
childUpc: (_state$product35 = state.product) === null || _state$product35 === void 0 ? void 0 : _state$product35.upc,
|
|
2415
2440
|
parentName: family.parent.name,
|
|
2416
2441
|
parentUpc: family.parent.upc
|
|
2417
2442
|
});
|
|
@@ -2443,15 +2468,15 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2443
2468
|
className: "desvincular",
|
|
2444
2469
|
title: "Desvincular este hijo",
|
|
2445
2470
|
onClick: function onClick() {
|
|
2446
|
-
var _state$
|
|
2471
|
+
var _state$product36, _state$product37;
|
|
2447
2472
|
|
|
2448
2473
|
return setPorDesvincular({
|
|
2449
2474
|
mode: "child",
|
|
2450
2475
|
childArticleId: variant.articleId,
|
|
2451
2476
|
childName: variant.name,
|
|
2452
2477
|
childUpc: variant.upc,
|
|
2453
|
-
parentName: (_state$
|
|
2454
|
-
parentUpc: (_state$
|
|
2478
|
+
parentName: (_state$product36 = state.product) === null || _state$product36 === void 0 ? void 0 : _state$product36.name,
|
|
2479
|
+
parentUpc: (_state$product37 = state.product) === null || _state$product37 === void 0 ? void 0 : _state$product37.upc
|
|
2455
2480
|
});
|
|
2456
2481
|
},
|
|
2457
2482
|
children: "Desvincular"
|
|
@@ -2467,7 +2492,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2467
2492
|
onClick: openMultipleEdition,
|
|
2468
2493
|
children: preparandoEdicionMultiple ? "Abriendo…" : "Editar los ".concat(family.variants.length, " hijos juntos")
|
|
2469
2494
|
})]
|
|
2470
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2495
|
+
}), puedeAgruparse && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2471
2496
|
className: "variants-actions",
|
|
2472
2497
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
2473
2498
|
type: "button",
|
|
@@ -2490,7 +2515,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2490
2515
|
children: showGroup ? " ▴" : " ▾"
|
|
2491
2516
|
})]
|
|
2492
2517
|
})]
|
|
2493
|
-
}), showGroup && (variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2518
|
+
}), puedeAgruparse && showGroup && (variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2494
2519
|
className: "variants-family",
|
|
2495
2520
|
children: [((_variantGroup$members3 = variantGroup.members) !== null && _variantGroup$members3 !== void 0 ? _variantGroup$members3 : []).filter(function (miembro) {
|
|
2496
2521
|
return !miembro.isCurrent;
|
|
@@ -2578,7 +2603,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2578
2603
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2579
2604
|
className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
|
|
2580
2605
|
children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
2581
|
-
children: [state.active_tab === "Descripción" && (((_state$
|
|
2606
|
+
children: [state.active_tab === "Descripción" && (((_state$product38 = state.product) === null || _state$product38 === void 0 ? void 0 : _state$product38.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
2607
|
activeSection: state.active_tab,
|
|
2583
2608
|
inputGroup: state.descriptions_inputs[0],
|
|
2584
2609
|
updatedDescriptions: state.updated_descriptions_inputs
|
|
@@ -2589,7 +2614,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2589
2614
|
,
|
|
2590
2615
|
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,
|
|
2591
2616
|
onRestoreInheritance: handleOnRestoreInheritance,
|
|
2592
|
-
articleId: (_state$
|
|
2617
|
+
articleId: (_state$product39 = state.product) === null || _state$product39 === void 0 ? void 0 : _state$product39.id_article,
|
|
2593
2618
|
version: state.product.version,
|
|
2594
2619
|
isShowbox: false,
|
|
2595
2620
|
dinamicHeight: true,
|
|
@@ -2601,7 +2626,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2601
2626
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2602
2627
|
text: "No cuentas con este servicio",
|
|
2603
2628
|
headerType: "input-name-header"
|
|
2604
|
-
})), state.active_tab === "Ficha técnica" && (((_state$
|
|
2629
|
+
})), state.active_tab === "Ficha técnica" && (((_state$product40 = state.product) === null || _state$product40 === void 0 ? void 0 : _state$product40.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
2605
2630
|
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
2631
|
var _state$datasheets_inp4, _state$services3, _state$services3$data, _state$services$datas3;
|
|
2607
2632
|
|
|
@@ -2631,7 +2656,7 @@ var ProviderProductEditionView = function ProviderProductEditionView(_ref) {
|
|
|
2631
2656
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2632
2657
|
text: "No cuentas con este servicio",
|
|
2633
2658
|
headerType: "input-name-header"
|
|
2634
|
-
})), state.active_tab === "Imágenes" && (((_state$
|
|
2659
|
+
})), state.active_tab === "Imágenes" && (((_state$product41 = state.product) === null || _state$product41 === void 0 ? void 0 : _state$product41.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
2635
2660
|
children: [!imageLayout && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
|
|
2636
2661
|
checkAll: state.all_image_checked // Determina si el checkbox "Seleccionar todo" está marcado
|
|
2637
2662
|
,
|