contentoh-components-library 21.6.61 → 21.6.62
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/.claude/settings.local.json +7 -0
- package/dist/ai/prompts/attribute.prompt.js +28 -0
- package/dist/ai/prompts/description.prompt.js +33 -0
- package/dist/ai/schemas/attribute.schema.js +35 -0
- package/dist/ai/schemas/description.schema.js +27 -0
- package/dist/components/pages/CreatorsProductEdition/CreatorsProductEditionView.js +11 -5
- package/dist/components/pages/CreatorsProductEdition/hooks/useCreatorsProductEdition.js +58 -31
- package/dist/components/pages/CreatorsProductEdition/mocks/api.fixtures.js +5 -1
- package/dist/components/pages/CreatorsProductEdition/mocks/mockApi.js +3 -40
- package/dist/components/pages/CreatorsProductEdition/sections/ImagesSection.js +18 -3
- package/dist/components/pages/CreatorsProductEdition/sections/StatusChip.js +4 -13
- package/dist/components/pages/CreatorsProductEdition/sections/TabsBar.js +10 -0
- package/dist/components/pages/CreatorsProductEdition/stories/CreatorsProductEdition.stories.js +10 -2
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +2 -15
- package/dist/components/pages/RetailerProductEdition/index.js +40 -57
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -6
- package/dist/index.js +0 -13
- package/package.json +1 -1
- package/src/components/pages/CreatorsProductEdition/CreatorsProductEditionView.jsx +22 -3
- package/src/components/pages/CreatorsProductEdition/hooks/useCreatorsProductEdition.js +36 -1
- package/src/components/pages/CreatorsProductEdition/mocks/api.fixtures.js +15 -3
- package/src/components/pages/CreatorsProductEdition/mocks/mockApi.js +8 -18
- package/src/components/pages/CreatorsProductEdition/sections/ImagesSection.jsx +24 -2
- package/src/components/pages/CreatorsProductEdition/sections/StatusChip.jsx +4 -8
- package/src/components/pages/CreatorsProductEdition/sections/TabsBar.jsx +9 -0
- package/src/components/pages/CreatorsProductEdition/stories/CreatorsProductEdition.stories.js +6 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +0 -12
- package/src/components/pages/RetailerProductEdition/index.js +3 -28
- package/src/components/pages/RetailerProductEdition/utils.js +0 -5
- package/src/index.js +0 -1
- package/dist/components/organisms/ServicesNavigation/ServiceToolbar.js +0 -210
- package/dist/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +0 -138
- package/dist/components/organisms/ServicesNavigation/ServicesRail.js +0 -705
- package/dist/components/organisms/ServicesNavigation/catalog.js +0 -505
- package/dist/components/organisms/ServicesNavigation/index.js +0 -337
- package/dist/components/organisms/ServicesNavigation/model.js +0 -167
- package/dist/components/organisms/ServicesNavigation/ui.js +0 -371
- package/dist/components/organisms/ServicesNavigation/views.js +0 -1237
- package/dist/components/organisms/ServicesWorkspace/AssigneePicker.js +0 -459
- package/dist/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +0 -119
- package/dist/components/organisms/ServicesWorkspace/demo.js +0 -137
- package/dist/components/organisms/ServicesWorkspace/index.js +0 -813
- package/dist/components/organisms/ServicesWorkspace/servicesModel.js +0 -351
- package/dist/components/organisms/ServicesWorkspace/tooltipStyles.js +0 -37
- package/dist/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +0 -387
- package/dist/components/pages/ProductEdition/ProductEdition.stories.js +0 -148
- package/dist/components/pages/ProductEdition/ProductEditionView.js +0 -1355
- package/dist/components/pages/ProductEdition/ServiceHeader.js +0 -142
- package/dist/components/pages/ProductEdition/api.js +0 -256
- package/dist/components/pages/ProductEdition/index.js +0 -37
- package/dist/components/pages/ProductEdition/permissions.js +0 -200
- package/dist/components/pages/ProductEdition/permissions.test.js +0 -320
- package/dist/components/pages/ProductEdition/sections/CatalogServicePanel.js +0 -237
- package/dist/components/pages/ProductEdition/sections/EditionTopBar.js +0 -174
- package/dist/components/pages/ProductEdition/sections/ImagePanel.js +0 -440
- package/dist/components/pages/ProductEdition/sections/ServiceTeam.js +0 -275
- package/dist/components/pages/ProductEdition/sections/ServiceTools.js +0 -186
- package/dist/components/pages/ProductEdition/services.js +0 -233
- package/dist/components/pages/ProductEdition/services.test.js +0 -195
- package/src/components/organisms/ServicesNavigation/ServiceToolbar.jsx +0 -143
- package/src/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +0 -101
- package/src/components/organisms/ServicesNavigation/ServicesRail.jsx +0 -591
- package/src/components/organisms/ServicesNavigation/catalog.js +0 -180
- package/src/components/organisms/ServicesNavigation/index.jsx +0 -232
- package/src/components/organisms/ServicesNavigation/model.js +0 -85
- package/src/components/organisms/ServicesNavigation/ui.jsx +0 -229
- package/src/components/organisms/ServicesNavigation/views.jsx +0 -705
- package/src/components/organisms/ServicesWorkspace/AssigneePicker.js +0 -348
- package/src/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +0 -61
- package/src/components/organisms/ServicesWorkspace/demo.js +0 -58
- package/src/components/organisms/ServicesWorkspace/index.js +0 -556
- package/src/components/organisms/ServicesWorkspace/servicesModel.js +0 -203
- package/src/components/organisms/ServicesWorkspace/tooltipStyles.js +0 -27
- package/src/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +0 -175
- package/src/components/pages/ProductEdition/ProductEdition.stories.js +0 -106
- package/src/components/pages/ProductEdition/ProductEditionView.jsx +0 -1142
- package/src/components/pages/ProductEdition/ServiceHeader.jsx +0 -104
- package/src/components/pages/ProductEdition/api.js +0 -84
- package/src/components/pages/ProductEdition/index.js +0 -21
- package/src/components/pages/ProductEdition/permissions.js +0 -128
- package/src/components/pages/ProductEdition/permissions.test.js +0 -249
- package/src/components/pages/ProductEdition/sections/CatalogServicePanel.jsx +0 -123
- package/src/components/pages/ProductEdition/sections/EditionTopBar.jsx +0 -134
- package/src/components/pages/ProductEdition/sections/ImagePanel.jsx +0 -342
- package/src/components/pages/ProductEdition/sections/ServiceTeam.jsx +0 -184
- package/src/components/pages/ProductEdition/sections/ServiceTools.jsx +0 -134
- package/src/components/pages/ProductEdition/services.js +0 -187
- package/src/components/pages/ProductEdition/services.test.js +0 -88
|
@@ -15,28 +15,19 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
15
|
* Etiqueta de estatus ("RA/AS", "AA"...). Mismo color y tamaño que
|
|
16
16
|
* `atoms/Status`; el nombre completo va en el tooltip. `oval` es la variante
|
|
17
17
|
* redondeada de la barra de pestañas.
|
|
18
|
-
*
|
|
19
|
-
* `label`, `color` y `title` (opcionales) reemplazan el texto, el color y el
|
|
20
|
-
* tooltip: los estatus de los flujos simples del catálogo (Pendiente, Hecho…)
|
|
21
|
-
* traen los suyos desde el backend.
|
|
22
18
|
*/
|
|
23
19
|
var StatusChip = function StatusChip(_ref) {
|
|
24
|
-
var _ref2;
|
|
25
|
-
|
|
26
20
|
var status = _ref.status,
|
|
27
21
|
_ref$oval = _ref.oval,
|
|
28
|
-
oval = _ref$oval === void 0 ? false : _ref$oval
|
|
29
|
-
|
|
30
|
-
color = _ref.color,
|
|
31
|
-
title = _ref.title;
|
|
32
|
-
var label = (_ref2 = labelProp !== null && labelProp !== void 0 ? labelProp : status) !== null && _ref2 !== void 0 ? _ref2 : "NS";
|
|
22
|
+
oval = _ref$oval === void 0 ? false : _ref$oval;
|
|
23
|
+
var label = status !== null && status !== void 0 ? status : "NS";
|
|
33
24
|
var chip = /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
34
25
|
label: label,
|
|
35
26
|
size: "small",
|
|
36
27
|
sx: {
|
|
37
28
|
height: 20,
|
|
38
29
|
borderRadius: oval ? "10px" : "3px",
|
|
39
|
-
backgroundColor:
|
|
30
|
+
backgroundColor: (0, _tokens.statusColor)(status),
|
|
40
31
|
color: _tokens.COLORS.white,
|
|
41
32
|
fontFamily: _tokens.FONTS.Lato,
|
|
42
33
|
fontSize: 12,
|
|
@@ -47,7 +38,7 @@ var StatusChip = function StatusChip(_ref) {
|
|
|
47
38
|
}
|
|
48
39
|
}
|
|
49
40
|
});
|
|
50
|
-
var name =
|
|
41
|
+
var name = (0, _tokens.statusName)(status);
|
|
51
42
|
return name ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
52
43
|
title: name,
|
|
53
44
|
arrow: true,
|
|
@@ -60,6 +60,16 @@ var tabSx = {
|
|
|
60
60
|
xs: 14,
|
|
61
61
|
sm: 18
|
|
62
62
|
}
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
/*
|
|
66
|
+
El tema de MUI de Creators pinta las pestañas de rosa al pasar el ratón
|
|
67
|
+
(`MuiTab.styleOverrides.root`). Aquí no se quiere ese realce, y la librería
|
|
68
|
+
no debe depender del tema de quien la consume: se anula explícitamente.
|
|
69
|
+
*/
|
|
70
|
+
"&:hover, &.Mui-selected:hover": {
|
|
71
|
+
color: _tokens.COLORS.s5,
|
|
72
|
+
backgroundColor: "transparent"
|
|
63
73
|
}
|
|
64
74
|
};
|
|
65
75
|
|
package/dist/components/pages/CreatorsProductEdition/stories/CreatorsProductEdition.stories.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.SinImagenes = exports.HijoDeOtro = exports.EspecialistaTextosCelular = exports.EspecialistaTextos = exports.EspecialistaImagenesCelular = exports.EspecialistaImagenes = exports.ErrorAlCargar = exports.ConVariantes = exports.AuditorQACelular = exports.AuditorQA = exports.AuditorPorEvaluar = void 0;
|
|
8
|
+
exports.default = exports.SinServicioDeImagenes = exports.SinImagenes = exports.HijoDeOtro = exports.EspecialistaTextosCelular = exports.EspecialistaTextos = exports.EspecialistaImagenesCelular = exports.EspecialistaImagenes = exports.ErrorAlCargar = exports.ConVariantes = exports.AuditorQACelular = exports.AuditorQA = exports.AuditorPorEvaluar = void 0;
|
|
9
9
|
|
|
10
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
11
|
|
|
@@ -125,7 +125,15 @@ HijoDeOtro.args = EspecialistaTextos.args;
|
|
|
125
125
|
HijoDeOtro.decorators = [(0, _mockApi.withMockApi)({
|
|
126
126
|
familia: "hijo"
|
|
127
127
|
})]; // --- Casos límite -----------------------------------------------------------
|
|
128
|
-
|
|
128
|
+
// Producto sin el servicio de imágenes contratado: la bandeja de imágenes
|
|
129
|
+
// queda deshabilitada y la de activos digitales sigue siendo utilizable.
|
|
130
|
+
|
|
131
|
+
var SinServicioDeImagenes = Template.bind({});
|
|
132
|
+
exports.SinServicioDeImagenes = SinServicioDeImagenes;
|
|
133
|
+
SinServicioDeImagenes.args = AuditorQA.args;
|
|
134
|
+
SinServicioDeImagenes.decorators = [(0, _mockApi.withMockApi)({
|
|
135
|
+
imagesService: false
|
|
136
|
+
})];
|
|
129
137
|
var SinImagenes = Template.bind({});
|
|
130
138
|
exports.SinImagenes = SinImagenes;
|
|
131
139
|
SinImagenes.args = EspecialistaImagenes.args;
|
|
@@ -5,14 +5,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.RetailerProductEditionDefault =
|
|
8
|
+
exports.default = exports.RetailerProductEditionDefault = void 0;
|
|
9
9
|
|
|
10
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
11
|
|
|
12
12
|
var _index = require("./index");
|
|
13
13
|
|
|
14
|
-
var _demo = require("../../organisms/ServicesWorkspace/demo");
|
|
15
|
-
|
|
16
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
15
|
|
|
18
16
|
var _default = {
|
|
@@ -216,15 +214,4 @@ RetailerProductEditionDefault.args = {
|
|
|
216
214
|
},
|
|
217
215
|
"src": "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1778260157973"
|
|
218
216
|
}
|
|
219
|
-
};
|
|
220
|
-
/**
|
|
221
|
-
* Con la pestaña "Servicios" (la activa Creators con `showServicesTab`) y
|
|
222
|
-
* servicios de ejemplo además de los tres de siempre.
|
|
223
|
-
*/
|
|
224
|
-
|
|
225
|
-
var ConPestanaServicios = Template.bind({});
|
|
226
|
-
exports.ConPestanaServicios = ConPestanaServicios;
|
|
227
|
-
ConPestanaServicios.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, RetailerProductEditionDefault.args), {}, {
|
|
228
|
-
showServicesTab: true,
|
|
229
|
-
productSelected: (0, _demo.withDemoServices)(RetailerProductEditionDefault.args.productSelected, 14)
|
|
230
|
-
});
|
|
217
|
+
};
|
|
@@ -11,18 +11,18 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
|
|
12
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
13
|
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
15
|
+
|
|
14
16
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
15
17
|
|
|
18
|
+
var _objectSpread5 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
19
|
+
|
|
16
20
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
17
21
|
|
|
18
22
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
19
23
|
|
|
20
24
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
21
25
|
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
23
|
-
|
|
24
|
-
var _objectSpread6 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
25
|
-
|
|
26
26
|
var _react = require("react");
|
|
27
27
|
|
|
28
28
|
var _axios = _interopRequireDefault(require("axios"));
|
|
@@ -117,8 +117,6 @@ var _AiProductEdition = require("../../../contexts/AiProductEdition");
|
|
|
117
117
|
|
|
118
118
|
var _ChangeStatusModal = _interopRequireDefault(require("../../organisms/ChangeStatusModal"));
|
|
119
119
|
|
|
120
|
-
var _ServicesWorkspace = _interopRequireDefault(require("../../organisms/ServicesWorkspace"));
|
|
121
|
-
|
|
122
120
|
var _material = require("@mui/material");
|
|
123
121
|
|
|
124
122
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -141,17 +139,11 @@ function obtenerDuracionVideoBase64(base64Data) {
|
|
|
141
139
|
video.addEventListener("error", reject);
|
|
142
140
|
});
|
|
143
141
|
}
|
|
144
|
-
/** Pestaña con todos los servicios del producto (ver organisms/ServicesWorkspace). */
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
var SERVICES_TAB = "Servicios";
|
|
148
142
|
|
|
149
143
|
var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
150
|
-
var _state$product$id_art, _state$product, _state$product11, _family$variants, _state$product12, _state$product16, _state$errors, _pendingPropagation$k, _family$variants2, _variantGroup$members3, _variantGroup$group, _state$product20, _state$product21, _state$product22, _state$active_retaile7, _state$product23, _state$product24, _state$product25, _variantGroup$group2, _location$state, _location$state2, _state$active_retaile8, _state$active_retaile9, _state$images_values$2, _state$images_values10, _state$images_values11, _state$images_values12, _state$images_values13, _state$product26, _state$active_retaile10, _family$variants3, _family$variants4, _variantGroup$members4, _variantGroup$members5, _state$active_percent, _state$active_percent2, _state$active_percent3, _state$active_retaile11, _state$active_retaile12, _state$active_retaile13, _state$
|
|
144
|
+
var _state$product$id_art, _state$product, _state$product11, _family$variants, _state$product12, _state$product16, _state$errors, _pendingPropagation$k, _family$variants2, _variantGroup$members3, _variantGroup$group, _state$product20, _state$product21, _state$product22, _state$active_retaile7, _state$product23, _state$product24, _state$product25, _variantGroup$group2, _location$state, _location$state2, _state$active_retaile8, _state$active_retaile9, _state$images_values$2, _state$images_values10, _state$images_values11, _state$images_values12, _state$images_values13, _state$product26, _state$active_retaile10, _family$variants3, _family$variants4, _variantGroup$members4, _variantGroup$members5, _state$active_percent, _state$active_percent2, _state$active_percent3, _state$active_retaile11, _state$active_retaile12, _state$active_retaile13, _state$product32, _state$services3, _state$services3$data, _state$product33, _state$product34, _state$datasheets_inp, _state$datasheets_inp2, _state$product35, _state$images_values$3, _state$images_values14, _state$images_values15, _state$images_values16, _state$images_values17, _state$comment;
|
|
151
145
|
|
|
152
146
|
var tabsSections = _ref.tabsSections,
|
|
153
|
-
_ref$showServicesTab = _ref.showServicesTab,
|
|
154
|
-
showServicesTab = _ref$showServicesTab === void 0 ? false : _ref$showServicesTab,
|
|
155
147
|
_ref$productSelected = _ref.productSelected,
|
|
156
148
|
productSelected = _ref$productSelected === void 0 ? {} : _ref$productSelected,
|
|
157
149
|
_ref$user = _ref.user,
|
|
@@ -174,10 +166,6 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
174
166
|
createComment = _useProviderProductEd.createComment;
|
|
175
167
|
|
|
176
168
|
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
177
|
-
var tabs = (0, _react.useMemo)(function () {
|
|
178
|
-
return showServicesTab ? (0, _objectSpread6.default)((0, _objectSpread6.default)({}, tabsSections), {}, (0, _defineProperty2.default)({}, SERVICES_TAB, false)) : tabsSections;
|
|
179
|
-
}, [tabsSections, showServicesTab]);
|
|
180
|
-
var isServicesTab = state.active_tab === SERVICES_TAB;
|
|
181
169
|
|
|
182
170
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
183
171
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
@@ -914,7 +902,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
914
902
|
// para no reventar en Object.values(undefined).
|
|
915
903
|
|
|
916
904
|
retailerDatasheets = (_services$ = services[0]) === null || _services$ === void 0 ? void 0 : _services$[id_retailer];
|
|
917
|
-
datasheetsActiveRetailer = (0,
|
|
905
|
+
datasheetsActiveRetailer = (0, _objectSpread5.default)((0, _objectSpread5.default)({}, retailerDatasheets), {}, {
|
|
918
906
|
data: Object.values((_retailerDatasheets$d = retailerDatasheets === null || retailerDatasheets === void 0 ? void 0 : retailerDatasheets.data) !== null && _retailerDatasheets$d !== void 0 ? _retailerDatasheets$d : {})
|
|
919
907
|
});
|
|
920
908
|
descriptionsActiveRetailer = services[1].filter(function (item) {
|
|
@@ -943,7 +931,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
943
931
|
payload: {
|
|
944
932
|
datasheets: services[0],
|
|
945
933
|
descriptions: services[1],
|
|
946
|
-
images: (0,
|
|
934
|
+
images: (0, _objectSpread5.default)((0, _objectSpread5.default)({}, services[2]), {}, {
|
|
947
935
|
values: orderedValues
|
|
948
936
|
})
|
|
949
937
|
}
|
|
@@ -979,7 +967,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
979
967
|
});
|
|
980
968
|
dispatch({
|
|
981
969
|
type: "SET_IMAGES_VALUES",
|
|
982
|
-
payload: (0,
|
|
970
|
+
payload: (0, _objectSpread5.default)((0, _objectSpread5.default)({}, services[2]), {}, {
|
|
983
971
|
values: filteredValues
|
|
984
972
|
})
|
|
985
973
|
});
|
|
@@ -1413,10 +1401,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1413
1401
|
var _state$product$varian, _state$product13, _updatedProduct$varia;
|
|
1414
1402
|
|
|
1415
1403
|
if (!result) return;
|
|
1416
|
-
var updatedProduct = result.mode === "self" ? (0,
|
|
1404
|
+
var updatedProduct = result.mode === "self" ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1417
1405
|
parentArticleId: null,
|
|
1418
1406
|
variantsCount: 0
|
|
1419
|
-
}) : (0,
|
|
1407
|
+
}) : (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1420
1408
|
variantsCount: Math.max(((_state$product$varian = (_state$product13 = state.product) === null || _state$product13 === void 0 ? void 0 : _state$product13.variantsCount) !== null && _state$product$varian !== void 0 ? _state$product$varian : 1) - 1, 0)
|
|
1421
1409
|
});
|
|
1422
1410
|
dispatch({
|
|
@@ -1434,7 +1422,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1434
1422
|
if (guardado) {
|
|
1435
1423
|
var _updatedProduct$paren;
|
|
1436
1424
|
|
|
1437
|
-
sessionStorage.setItem("productSelected", JSON.stringify((0,
|
|
1425
|
+
sessionStorage.setItem("productSelected", JSON.stringify((0, _objectSpread5.default)((0, _objectSpread5.default)({}, guardado), {}, {
|
|
1438
1426
|
variantsCount: updatedProduct.variantsCount,
|
|
1439
1427
|
parentArticleId: (_updatedProduct$paren = updatedProduct.parentArticleId) !== null && _updatedProduct$paren !== void 0 ? _updatedProduct$paren : null
|
|
1440
1428
|
})));
|
|
@@ -1689,9 +1677,9 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1689
1677
|
var _state$product$varian2, _state$product18, _result$linked, _result$parentArticle;
|
|
1690
1678
|
|
|
1691
1679
|
if (!result) return;
|
|
1692
|
-
var updatedProduct = result.mode === "children" ? (0,
|
|
1680
|
+
var updatedProduct = result.mode === "children" ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1693
1681
|
variantsCount: ((_state$product$varian2 = (_state$product18 = state.product) === null || _state$product18 === void 0 ? void 0 : _state$product18.variantsCount) !== null && _state$product$varian2 !== void 0 ? _state$product$varian2 : 0) + ((_result$linked = result.linked) !== null && _result$linked !== void 0 ? _result$linked : []).length
|
|
1694
|
-
}) : (0,
|
|
1682
|
+
}) : (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1695
1683
|
parentArticleId: (_result$parentArticle = result.parentArticleId) !== null && _result$parentArticle !== void 0 ? _result$parentArticle : null,
|
|
1696
1684
|
variantsCount: 0
|
|
1697
1685
|
});
|
|
@@ -1718,7 +1706,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1718
1706
|
if (guardado) {
|
|
1719
1707
|
var _updatedProduct$paren2;
|
|
1720
1708
|
|
|
1721
|
-
sessionStorage.setItem("productSelected", JSON.stringify((0,
|
|
1709
|
+
sessionStorage.setItem("productSelected", JSON.stringify((0, _objectSpread5.default)((0, _objectSpread5.default)({}, guardado), {}, {
|
|
1722
1710
|
variantsCount: updatedProduct.variantsCount,
|
|
1723
1711
|
parentArticleId: (_updatedProduct$paren2 = updatedProduct.parentArticleId) !== null && _updatedProduct$paren2 !== void 0 ? _updatedProduct$paren2 : null
|
|
1724
1712
|
})));
|
|
@@ -1789,7 +1777,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1789
1777
|
esDescripcion = kind === "description";
|
|
1790
1778
|
_context11.prev = 4;
|
|
1791
1779
|
_context11.next = 7;
|
|
1792
|
-
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/restore"), (0,
|
|
1780
|
+
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/restore"), (0, _objectSpread5.default)({
|
|
1793
1781
|
articleId: state.product.id_article
|
|
1794
1782
|
}, esDescripcion ? {
|
|
1795
1783
|
descriptions: [Number(attributeId)]
|
|
@@ -2346,7 +2334,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2346
2334
|
var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
|
|
2347
2335
|
var _state$product$id_ord, _state$active_retaile6;
|
|
2348
2336
|
|
|
2349
|
-
var concept, articleId, orderId, sectionStatusKey, evalStatus, retailerId, data, res, message, icon, activeTab, newStatuses, serviceStatus, articleStatus, updatedStatusByRetailer, updatedProduct, specialistDone,
|
|
2337
|
+
var concept, articleId, orderId, sectionStatusKey, evalStatus, retailerId, data, res, message, icon, activeTab, newStatuses, serviceStatus, articleStatus, updatedStatusByRetailer, updatedProduct, specialistDone, _objectSpread2, _state$services_data2, _JSON$parse2, newStatus, newOrderStatus, newArticleStatus, _articleStatus, updatedStatusByRetailerForSend, _updatedProduct, updatedServicesData, sessionProduct, _objectSpread3, productInSession, updatedProductInSession;
|
|
2350
2338
|
|
|
2351
2339
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
2352
2340
|
while (1) {
|
|
@@ -2404,11 +2392,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2404
2392
|
}); // Actualizar el producto con los nuevos estados
|
|
2405
2393
|
|
|
2406
2394
|
updatedStatusByRetailer = state.product.statusByRetailer.map(function (item) {
|
|
2407
|
-
return item.retailer_id === retailerId && item.service === concept ? (0,
|
|
2395
|
+
return item.retailer_id === retailerId && item.service === concept ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, item), {}, {
|
|
2408
2396
|
status: serviceStatus
|
|
2409
2397
|
}) : item;
|
|
2410
2398
|
});
|
|
2411
|
-
updatedProduct = (0,
|
|
2399
|
+
updatedProduct = (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
2412
2400
|
statusByRetailer: updatedStatusByRetailer,
|
|
2413
2401
|
status: (0, _product.getMinorStatusFromRetailer)(updatedStatusByRetailer)
|
|
2414
2402
|
});
|
|
@@ -2483,17 +2471,17 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2483
2471
|
|
|
2484
2472
|
updatedStatusByRetailerForSend = state.product.statusByRetailer.map(function (item) {
|
|
2485
2473
|
if (item.retailer_id === retailerId && item.service === concept) {
|
|
2486
|
-
return (0,
|
|
2474
|
+
return (0, _objectSpread5.default)((0, _objectSpread5.default)({}, item), {}, {
|
|
2487
2475
|
status: newStatus
|
|
2488
2476
|
});
|
|
2489
2477
|
}
|
|
2490
2478
|
|
|
2491
2479
|
return item;
|
|
2492
2480
|
});
|
|
2493
|
-
_updatedProduct = (0,
|
|
2481
|
+
_updatedProduct = (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, (_objectSpread2 = {}, (0, _defineProperty2.default)(_objectSpread2, "".concat(concept, "_status"), newStatus), (0, _defineProperty2.default)(_objectSpread2, "statusByRetailer", updatedStatusByRetailerForSend), (0, _defineProperty2.default)(_objectSpread2, "status", (0, _product.getMinorStatusFromRetailer)(updatedStatusByRetailerForSend)), _objectSpread2)); //Actualizamos el services_data en el servicio específico del retailer actual
|
|
2494
2482
|
|
|
2495
2483
|
updatedServicesData = (_state$services_data2 = state.services_data) === null || _state$services_data2 === void 0 ? void 0 : _state$services_data2.map(function (service) {
|
|
2496
|
-
return (0,
|
|
2484
|
+
return (0, _objectSpread5.default)((0, _objectSpread5.default)({}, service), {}, {
|
|
2497
2485
|
status: (service === null || service === void 0 ? void 0 : service.id_retailer) === retailerId && (service === null || service === void 0 ? void 0 : service.service) === concept ? newStatus : service === null || service === void 0 ? void 0 : service.status
|
|
2498
2486
|
});
|
|
2499
2487
|
});
|
|
@@ -2501,15 +2489,15 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2501
2489
|
|
|
2502
2490
|
if (sessionProduct) {
|
|
2503
2491
|
productInSession = JSON.parse(sessionProduct);
|
|
2504
|
-
updatedProductInSession = (0,
|
|
2492
|
+
updatedProductInSession = (0, _objectSpread5.default)((0, _objectSpread5.default)({}, productInSession), {}, (_objectSpread3 = {}, (0, _defineProperty2.default)(_objectSpread3, "".concat(concept, "_status"), newStatus), (0, _defineProperty2.default)(_objectSpread3, "statusByRetailer", state.product.statusByRetailer.map(function (item) {
|
|
2505
2493
|
if (item.retailer_id === retailerId && item.service === concept) {
|
|
2506
|
-
return (0,
|
|
2494
|
+
return (0, _objectSpread5.default)((0, _objectSpread5.default)({}, item), {}, {
|
|
2507
2495
|
status: newStatus
|
|
2508
2496
|
});
|
|
2509
2497
|
}
|
|
2510
2498
|
|
|
2511
2499
|
return item;
|
|
2512
|
-
})),
|
|
2500
|
+
})), _objectSpread3));
|
|
2513
2501
|
sessionStorage.setItem("productSelected", JSON.stringify(updatedProductInSession));
|
|
2514
2502
|
}
|
|
2515
2503
|
|
|
@@ -2661,12 +2649,12 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2661
2649
|
status = "".concat(result, "A"); // Actualizar el statusByRetailer para todos los retailers y conceptos
|
|
2662
2650
|
|
|
2663
2651
|
updatedStatusByRetailer = state.product.statusByRetailer.map(function (item) {
|
|
2664
|
-
return conceptArray.includes(item.service) ? (0,
|
|
2652
|
+
return conceptArray.includes(item.service) ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, item), {}, {
|
|
2665
2653
|
status: status
|
|
2666
2654
|
}) : item;
|
|
2667
2655
|
}); // Actualizar el producto con los nuevos estados
|
|
2668
2656
|
|
|
2669
|
-
updatedProduct = (0,
|
|
2657
|
+
updatedProduct = (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
2670
2658
|
article_status: status,
|
|
2671
2659
|
status: (0, _product.getMinorStatusFromRetailer)(updatedStatusByRetailer),
|
|
2672
2660
|
datasheet_status: state.product.datasheet_status === "NA" ? "NA" : status,
|
|
@@ -2679,7 +2667,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2679
2667
|
payload: updatedProduct
|
|
2680
2668
|
});
|
|
2681
2669
|
updatedServicesData = state.services_data.map(function (service) {
|
|
2682
|
-
return conceptArray.includes(service.service) ? (0,
|
|
2670
|
+
return conceptArray.includes(service.service) ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, service), {}, {
|
|
2683
2671
|
status: status
|
|
2684
2672
|
}) : service;
|
|
2685
2673
|
});
|
|
@@ -2765,7 +2753,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2765
2753
|
});
|
|
2766
2754
|
|
|
2767
2755
|
case 4:
|
|
2768
|
-
updatedProduct = (0,
|
|
2756
|
+
updatedProduct = (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, (0, _defineProperty2.default)({}, "id_".concat(concept, "_").concat(assignationType), assignationId));
|
|
2769
2757
|
dispatch({
|
|
2770
2758
|
type: "SET_PRODUCT",
|
|
2771
2759
|
payload: updatedProduct
|
|
@@ -3231,7 +3219,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3231
3219
|
destinos = (0, _objectWithoutProperties2.default)(propagation, _excluded);
|
|
3232
3220
|
|
|
3233
3221
|
if (esDescripcion) {
|
|
3234
|
-
saveDescriptions(token, (0,
|
|
3222
|
+
saveDescriptions(token, (0, _objectSpread5.default)((0, _objectSpread5.default)({}, destinos), {}, {
|
|
3235
3223
|
descriptions: attributes
|
|
3236
3224
|
}));
|
|
3237
3225
|
} else {
|
|
@@ -3261,7 +3249,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3261
3249
|
setVariantGroup(result);
|
|
3262
3250
|
setShowGroup(true);
|
|
3263
3251
|
}
|
|
3264
|
-
}), porDesvincular && /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnlinkVariantModal.UnlinkVariantModal, (0,
|
|
3252
|
+
}), porDesvincular && /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnlinkVariantModal.UnlinkVariantModal, (0, _objectSpread5.default)((0, _objectSpread5.default)({}, porDesvincular), {}, {
|
|
3265
3253
|
token: token,
|
|
3266
3254
|
onClose: function onClose() {
|
|
3267
3255
|
return setPorDesvincular(null);
|
|
@@ -3664,7 +3652,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3664
3652
|
showApproveRejectAll: canShowBulkEvaluationButtons() || isAuditorAssigned() || isUserAssignedToService(),
|
|
3665
3653
|
showValidationButtons: canShowSingleEvaluationButtons() && (isAuditorAssigned() || isUserAssignedToService())
|
|
3666
3654
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
3667
|
-
tabsSections:
|
|
3655
|
+
tabsSections: tabsSections,
|
|
3668
3656
|
status: getStatusByCurrentServiceAndRetailer(),
|
|
3669
3657
|
activeTab: state.active_tab,
|
|
3670
3658
|
isRetailer: isRetailer,
|
|
@@ -3699,12 +3687,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3699
3687
|
className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
|
|
3700
3688
|
id: "services-information-container",
|
|
3701
3689
|
children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
3702
|
-
children: [
|
|
3703
|
-
product: state.product,
|
|
3704
|
-
retailers: (_state$product$catego = (_state$product32 = state.product) === null || _state$product32 === void 0 ? void 0 : _state$product32.categoryRetailerInOrder) !== null && _state$product$catego !== void 0 ? _state$product$catego : [],
|
|
3705
|
-
canAssign: ![7, 8].includes(user.id_role),
|
|
3706
|
-
onOpenEditor: handleOnChangeActiveTab
|
|
3707
|
-
}), state.active_tab === "Descripción" && (((_state$product33 = state.product) === null || _state$product33 === void 0 ? void 0 : _state$product33.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
3690
|
+
children: [state.active_tab === "Descripción" && (((_state$product32 = state.product) === null || _state$product32 === void 0 ? void 0 : _state$product32.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
3708
3691
|
activeSection: state.active_tab,
|
|
3709
3692
|
inputGroup: state.descriptions_inputs[0],
|
|
3710
3693
|
updatedDescriptions: state.updated_descriptions_inputs
|
|
@@ -3713,7 +3696,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3713
3696
|
,
|
|
3714
3697
|
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,
|
|
3715
3698
|
onRestoreInheritance: handleOnRestoreInheritance,
|
|
3716
|
-
articleId: (_state$
|
|
3699
|
+
articleId: (_state$product33 = state.product) === null || _state$product33 === void 0 ? void 0 : _state$product33.id_article,
|
|
3717
3700
|
version: state.product.version,
|
|
3718
3701
|
auditInputGroup: auditDescriptions[0],
|
|
3719
3702
|
setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
|
|
@@ -3722,7 +3705,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3722
3705
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
3723
3706
|
text: "No cuentas con este servicio",
|
|
3724
3707
|
headerType: "input-name-header"
|
|
3725
|
-
})), state.active_tab === "Ficha técnica" && (((_state$
|
|
3708
|
+
})), state.active_tab === "Ficha técnica" && (((_state$product34 = state.product) === null || _state$product34 === void 0 ? void 0 : _state$product34.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
3726
3709
|
children: (_state$datasheets_inp = state.datasheets_inputs[0]) === null || _state$datasheets_inp === void 0 ? void 0 : (_state$datasheets_inp2 = _state$datasheets_inp.data) === null || _state$datasheets_inp2 === void 0 ? void 0 : _state$datasheets_inp2.map(function (dataGroup, index) {
|
|
3727
3710
|
var _state$services4, _state$services4$data;
|
|
3728
3711
|
|
|
@@ -3743,7 +3726,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3743
3726
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
3744
3727
|
text: "No cuentas con este servicio",
|
|
3745
3728
|
headerType: "input-name-header"
|
|
3746
|
-
})), state.active_tab === "Imágenes" && (((_state$
|
|
3729
|
+
})), state.active_tab === "Imágenes" && (((_state$product35 = state.product) === null || _state$product35 === void 0 ? void 0 : _state$product35.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
3747
3730
|
children: [enableDigitalAssets && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryTrayTabs.GalleryTrayTabs, {
|
|
3748
3731
|
activeTray: currentTray,
|
|
3749
3732
|
setActiveTray: setActiveTray,
|
|
@@ -3754,7 +3737,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3754
3737
|
style: {
|
|
3755
3738
|
position: "relative"
|
|
3756
3739
|
},
|
|
3757
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DigitalAssetsTray.DigitalAssetsTray, (0,
|
|
3740
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DigitalAssetsTray.DigitalAssetsTray, (0, _objectSpread5.default)((0, _objectSpread5.default)({}, digitalAssets), {}, {
|
|
3758
3741
|
unsaved: (0, _assets.countUnsavedAssets)(state),
|
|
3759
3742
|
gridLayout: imageLayout,
|
|
3760
3743
|
readOnly: !isAuditorAssigned() && !isUserAssignedToService(),
|
|
@@ -3774,10 +3757,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3774
3757
|
style: {
|
|
3775
3758
|
position: "relative"
|
|
3776
3759
|
},
|
|
3777
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0,
|
|
3760
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread5.default)((0, _objectSpread5.default)({}, getRootProps({
|
|
3778
3761
|
className: "dropzone ".concat(isDragActive ? "drag-active" : "")
|
|
3779
3762
|
})), {}, {
|
|
3780
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0,
|
|
3763
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread5.default)({}, getInputProps())), isDragActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
3781
3764
|
className: "drag-overlay",
|
|
3782
3765
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
3783
3766
|
children: "Suelta las im\xE1genes aqu\xED"
|
|
@@ -3827,7 +3810,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3827
3810
|
headerType: "input-name-header"
|
|
3828
3811
|
}))]
|
|
3829
3812
|
})
|
|
3830
|
-
}),
|
|
3813
|
+
}), (isUserAssignedToService(state.active_tab) || isAuditorAssigned()) && state.product["".concat((0, _utils.getConceptByTab)(state.active_tab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
3831
3814
|
className: "commentary-box",
|
|
3832
3815
|
children: [!state.comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
3833
3816
|
className: "commentary",
|
|
@@ -3901,7 +3884,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3901
3884
|
|
|
3902
3885
|
var RetailerProductEdition = function RetailerProductEdition(props) {
|
|
3903
3886
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_providerProductEdition.ProviderProductEditionProvider, {
|
|
3904
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RetailerProductEditionView, (0,
|
|
3887
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RetailerProductEditionView, (0, _objectSpread5.default)({}, props))
|
|
3905
3888
|
});
|
|
3906
3889
|
};
|
|
3907
3890
|
|
|
@@ -128,7 +128,7 @@ var sendMessage = /*#__PURE__*/function () {
|
|
|
128
128
|
exports.sendMessage = sendMessage;
|
|
129
129
|
|
|
130
130
|
var normalizeProduct = function normalizeProduct(product) {
|
|
131
|
-
var _ref5, _productData$parentAr, _ref6, _productData$parent, _ref7, _productData$variants
|
|
131
|
+
var _ref5, _productData$parentAr, _ref6, _productData$parent, _ref7, _productData$variants;
|
|
132
132
|
|
|
133
133
|
// Handle case where product might be wrapped in a product property
|
|
134
134
|
var productData = product.product || product;
|
|
@@ -194,11 +194,7 @@ var normalizeProduct = function normalizeProduct(product) {
|
|
|
194
194
|
id_images_facilitator: article.id_images_facilitator || null,
|
|
195
195
|
id_auditor: article.id_auditor || 0,
|
|
196
196
|
statusByRetailer: productData.statusByRetailer || null,
|
|
197
|
-
categoryRetailerInOrder: categoryRetailerInOrder || null
|
|
198
|
-
// Servicios para la pestaña "Servicios": estatus por servicio del listado
|
|
199
|
-
// ligero de Creators (view=summary) y, en modo demo, los de ejemplo.
|
|
200
|
-
serviceStatuses: (_productData$serviceS = productData.serviceStatuses) !== null && _productData$serviceS !== void 0 ? _productData$serviceS : null,
|
|
201
|
-
demo_services: (_productData$demo_ser = productData.demo_services) !== null && _productData$demo_ser !== void 0 ? _productData$demo_ser : null
|
|
197
|
+
categoryRetailerInOrder: categoryRetailerInOrder || null
|
|
202
198
|
};
|
|
203
199
|
};
|
|
204
200
|
|
package/dist/index.js
CHANGED
|
@@ -1447,19 +1447,6 @@ Object.keys(_CreatorsProductEdition).forEach(function (key) {
|
|
|
1447
1447
|
});
|
|
1448
1448
|
});
|
|
1449
1449
|
|
|
1450
|
-
var _ProductEdition = require("./components/pages/ProductEdition");
|
|
1451
|
-
|
|
1452
|
-
Object.keys(_ProductEdition).forEach(function (key) {
|
|
1453
|
-
if (key === "default" || key === "__esModule") return;
|
|
1454
|
-
if (key in exports && exports[key] === _ProductEdition[key]) return;
|
|
1455
|
-
Object.defineProperty(exports, key, {
|
|
1456
|
-
enumerable: true,
|
|
1457
|
-
get: function get() {
|
|
1458
|
-
return _ProductEdition[key];
|
|
1459
|
-
}
|
|
1460
|
-
});
|
|
1461
|
-
});
|
|
1462
|
-
|
|
1463
1450
|
var _ProviderProductEdition = require("./components/pages/ProviderProductEdition");
|
|
1464
1451
|
|
|
1465
1452
|
Object.keys(_ProviderProductEdition).forEach(function (key) {
|
package/package.json
CHANGED
|
@@ -67,6 +67,8 @@ export const CreatorsProductEditionView = ({
|
|
|
67
67
|
isRetailer,
|
|
68
68
|
digitalAssets,
|
|
69
69
|
currentTray,
|
|
70
|
+
hasImagesService,
|
|
71
|
+
canEditAssets,
|
|
70
72
|
assetsLoadedFor,
|
|
71
73
|
handleOnSetSelectedAssets,
|
|
72
74
|
handleOnSetAllAssetsChecked,
|
|
@@ -635,7 +637,14 @@ export const CreatorsProductEditionView = ({
|
|
|
635
637
|
: handleOnDownloadImages
|
|
636
638
|
}
|
|
637
639
|
askToDeleteImages={handleOnAskToDeleteImages}
|
|
638
|
-
|
|
640
|
+
// En la bandeja de activos el permiso es el de los activos: sin
|
|
641
|
+
// servicio de imágenes nadie está asignado a él y el botón de
|
|
642
|
+
// guardar desaparecería justo donde sí hay algo que guardar.
|
|
643
|
+
showSaveButton={
|
|
644
|
+
currentTray === TRAYS.ASSETS
|
|
645
|
+
? canEditAssets()
|
|
646
|
+
: isAuditorAssigned() || isUserAssignedToService()
|
|
647
|
+
}
|
|
639
648
|
onClickSave={handleOnClickSave}
|
|
640
649
|
// validations
|
|
641
650
|
canAssign={![7, 8].includes(user.id_role)}
|
|
@@ -699,13 +708,19 @@ export const CreatorsProductEditionView = ({
|
|
|
699
708
|
) : (
|
|
700
709
|
<NoService />
|
|
701
710
|
))}
|
|
711
|
+
{/*
|
|
712
|
+
Los activos digitales no son parte del servicio de
|
|
713
|
+
imágenes: su bandeja sigue disponible aunque el producto no
|
|
714
|
+
tenga ese servicio contratado.
|
|
715
|
+
*/}
|
|
702
716
|
{state.active_tab === "Imágenes" &&
|
|
703
|
-
(
|
|
717
|
+
(hasImagesService || enableDigitalAssets ? (
|
|
704
718
|
<ImagesSection
|
|
705
719
|
imagesValues={state.images_values}
|
|
706
720
|
selectedImages={state.selected_images}
|
|
707
721
|
imageLayout={imageLayout}
|
|
708
722
|
enableDigitalAssets={enableDigitalAssets}
|
|
723
|
+
hasImagesService={hasImagesService}
|
|
709
724
|
currentTray={currentTray}
|
|
710
725
|
setActiveTray={setActiveTray}
|
|
711
726
|
digitalAssets={digitalAssets}
|
|
@@ -713,7 +728,11 @@ export const CreatorsProductEditionView = ({
|
|
|
713
728
|
selectedAssets={state.selected_assets}
|
|
714
729
|
setSelectedAssets={handleOnSetSelectedAssets}
|
|
715
730
|
setAllAssetsChecked={handleOnSetAllAssetsChecked}
|
|
716
|
-
canEdit={
|
|
731
|
+
canEdit={
|
|
732
|
+
currentTray === TRAYS.ASSETS
|
|
733
|
+
? canEditAssets()
|
|
734
|
+
: isAuditorAssigned() || isUserAssignedToService()
|
|
735
|
+
}
|
|
717
736
|
setCheckAll={handleOnSetCheckAll}
|
|
718
737
|
setSelectedImages={handleOnSetSelectedImages}
|
|
719
738
|
onChangeCurrentImage={handleOnChangeCurrentImage}
|
|
@@ -253,7 +253,18 @@ export const useCreatorsProductEdition = ({
|
|
|
253
253
|
onUploaded: (uploaded) => registerUploadedAssets(token, uploaded),
|
|
254
254
|
});
|
|
255
255
|
const [activeTray, setActiveTray] = useState(TRAYS.IMAGES);
|
|
256
|
-
|
|
256
|
+
|
|
257
|
+
/*
|
|
258
|
+
Los activos digitales no pertenecen al servicio de imágenes: se suben
|
|
259
|
+
aunque el producto no lo tenga contratado. Sin ese servicio solo queda su
|
|
260
|
+
bandeja, así que la vista abre directamente en ella.
|
|
261
|
+
*/
|
|
262
|
+
const hasImagesService = state.product?.images_status !== "NS";
|
|
263
|
+
const currentTray = !enableDigitalAssets
|
|
264
|
+
? TRAYS.IMAGES
|
|
265
|
+
: hasImagesService
|
|
266
|
+
? activeTray
|
|
267
|
+
: TRAYS.ASSETS;
|
|
257
268
|
|
|
258
269
|
/*
|
|
259
270
|
De qué artículo se cargaron ya los activos.
|
|
@@ -704,6 +715,28 @@ export const useCreatorsProductEdition = ({
|
|
|
704
715
|
return isAssigned && validUser;
|
|
705
716
|
};
|
|
706
717
|
|
|
718
|
+
/*
|
|
719
|
+
Permiso sobre la bandeja de activos digitales.
|
|
720
|
+
|
|
721
|
+
No son parte del servicio de imágenes, así que no pueden depender de estar
|
|
722
|
+
asignado a él: sin ese servicio nadie lo está y la bandeja quedaría de solo
|
|
723
|
+
lectura. En ese caso vale la asignación a cualquier otro servicio del
|
|
724
|
+
producto.
|
|
725
|
+
*/
|
|
726
|
+
const canEditAssets = () => {
|
|
727
|
+
if (isAuditorAssigned() || isUserAssignedToService()) return true;
|
|
728
|
+
if (hasImagesService) return false;
|
|
729
|
+
|
|
730
|
+
const allowedRoles = [1, 4, 5, 6, 7, 8];
|
|
731
|
+
if (!allowedRoles.includes(user?.id_role)) return false;
|
|
732
|
+
|
|
733
|
+
return ["description", "datasheet"].some(
|
|
734
|
+
(concept) =>
|
|
735
|
+
isAssignedAs("especialist", concept) ||
|
|
736
|
+
isAssignedAs("facilitator", concept),
|
|
737
|
+
);
|
|
738
|
+
};
|
|
739
|
+
|
|
707
740
|
const canShowSingleEvaluationButtons = (action) => {
|
|
708
741
|
let concept = getConceptByTab(action || state.active_tab);
|
|
709
742
|
|
|
@@ -2105,6 +2138,8 @@ export const useCreatorsProductEdition = ({
|
|
|
2105
2138
|
isRetailer,
|
|
2106
2139
|
digitalAssets,
|
|
2107
2140
|
currentTray,
|
|
2141
|
+
hasImagesService,
|
|
2142
|
+
canEditAssets,
|
|
2108
2143
|
assetsLoadedFor,
|
|
2109
2144
|
handleOnSetSelectedAssets,
|
|
2110
2145
|
handleOnSetAllAssetsChecked,
|