contentoh-components-library 21.6.59 → 21.6.61
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/dist/components/organisms/ServicesNavigation/ServiceToolbar.js +210 -0
- package/dist/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +138 -0
- package/dist/components/organisms/ServicesNavigation/ServicesRail.js +705 -0
- package/dist/components/organisms/ServicesNavigation/catalog.js +505 -0
- package/dist/components/organisms/ServicesNavigation/index.js +337 -0
- package/dist/components/organisms/ServicesNavigation/model.js +167 -0
- package/dist/components/organisms/ServicesNavigation/ui.js +371 -0
- package/dist/components/organisms/ServicesNavigation/views.js +1237 -0
- package/dist/components/organisms/ServicesWorkspace/AssigneePicker.js +459 -0
- package/dist/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +119 -0
- package/dist/components/organisms/ServicesWorkspace/demo.js +137 -0
- package/dist/components/organisms/ServicesWorkspace/index.js +813 -0
- package/dist/components/organisms/ServicesWorkspace/servicesModel.js +351 -0
- package/dist/components/organisms/ServicesWorkspace/tooltipStyles.js +37 -0
- package/dist/components/pages/CreatorsProductEdition/mocks/mockApi.js +40 -0
- package/dist/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +387 -0
- package/dist/components/pages/CreatorsProductEdition/sections/StatusChip.js +13 -4
- package/dist/components/pages/ProductEdition/ProductEdition.stories.js +148 -0
- package/dist/components/pages/ProductEdition/ProductEditionView.js +1355 -0
- package/dist/components/pages/ProductEdition/ServiceHeader.js +142 -0
- package/dist/components/pages/ProductEdition/api.js +256 -0
- package/dist/components/pages/ProductEdition/index.js +37 -0
- package/dist/components/pages/ProductEdition/permissions.js +200 -0
- package/dist/components/pages/ProductEdition/permissions.test.js +320 -0
- package/dist/components/pages/ProductEdition/sections/CatalogServicePanel.js +237 -0
- package/dist/components/pages/ProductEdition/sections/EditionTopBar.js +174 -0
- package/dist/components/pages/ProductEdition/sections/ImagePanel.js +440 -0
- package/dist/components/pages/ProductEdition/sections/ServiceTeam.js +275 -0
- package/dist/components/pages/ProductEdition/sections/ServiceTools.js +186 -0
- package/dist/components/pages/ProductEdition/services.js +233 -0
- package/dist/components/pages/ProductEdition/services.test.js +195 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +15 -2
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +2 -2
- package/dist/components/pages/RetailerProductEdition/index.js +57 -40
- package/dist/components/pages/RetailerProductEdition/utils.js +6 -2
- package/dist/index.js +13 -0
- package/package.json +1 -1
- package/src/components/organisms/ServicesNavigation/ServiceToolbar.jsx +143 -0
- package/src/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +101 -0
- package/src/components/organisms/ServicesNavigation/ServicesRail.jsx +591 -0
- package/src/components/organisms/ServicesNavigation/catalog.js +180 -0
- package/src/components/organisms/ServicesNavigation/index.jsx +232 -0
- package/src/components/organisms/ServicesNavigation/model.js +85 -0
- package/src/components/organisms/ServicesNavigation/ui.jsx +229 -0
- package/src/components/organisms/ServicesNavigation/views.jsx +705 -0
- package/src/components/organisms/ServicesWorkspace/AssigneePicker.js +348 -0
- package/src/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +61 -0
- package/src/components/organisms/ServicesWorkspace/demo.js +58 -0
- package/src/components/organisms/ServicesWorkspace/index.js +556 -0
- package/src/components/organisms/ServicesWorkspace/servicesModel.js +203 -0
- package/src/components/organisms/ServicesWorkspace/tooltipStyles.js +27 -0
- package/src/components/pages/CreatorsProductEdition/mocks/mockApi.js +17 -0
- package/src/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +175 -0
- package/src/components/pages/CreatorsProductEdition/sections/StatusChip.jsx +8 -4
- package/src/components/pages/ProductEdition/ProductEdition.stories.js +106 -0
- package/src/components/pages/ProductEdition/ProductEditionView.jsx +1142 -0
- package/src/components/pages/ProductEdition/ServiceHeader.jsx +104 -0
- package/src/components/pages/ProductEdition/api.js +84 -0
- package/src/components/pages/ProductEdition/index.js +21 -0
- package/src/components/pages/ProductEdition/permissions.js +128 -0
- package/src/components/pages/ProductEdition/permissions.test.js +249 -0
- package/src/components/pages/ProductEdition/sections/CatalogServicePanel.jsx +123 -0
- package/src/components/pages/ProductEdition/sections/EditionTopBar.jsx +134 -0
- package/src/components/pages/ProductEdition/sections/ImagePanel.jsx +342 -0
- package/src/components/pages/ProductEdition/sections/ServiceTeam.jsx +184 -0
- package/src/components/pages/ProductEdition/sections/ServiceTools.jsx +134 -0
- package/src/components/pages/ProductEdition/services.js +187 -0
- package/src/components/pages/ProductEdition/services.test.js +88 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +12 -0
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +6 -2
- package/src/components/pages/RetailerProductEdition/index.js +28 -3
- package/src/components/pages/RetailerProductEdition/utils.js +5 -0
- package/src/index.js +1 -0
- package/.claude/settings.local.json +0 -7
- 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
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
6
|
+
|
|
7
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
8
|
+
|
|
9
|
+
var _vitest = require("vitest");
|
|
10
|
+
|
|
11
|
+
var _services = require("./services");
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Lista lateral de la edición a partir de GET /product-services.
|
|
15
|
+
*
|
|
16
|
+
* npx vitest run src/components/pages/ProductEdition
|
|
17
|
+
*/
|
|
18
|
+
var person = function person(id_user, name) {
|
|
19
|
+
return {
|
|
20
|
+
id_user: id_user,
|
|
21
|
+
name: name,
|
|
22
|
+
last_name: "Prueba"
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var status = function status(status_name) {
|
|
27
|
+
var extra = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
28
|
+
return (0, _objectSpread2.default)({
|
|
29
|
+
status_name: status_name,
|
|
30
|
+
display_name: status_name,
|
|
31
|
+
color: null
|
|
32
|
+
}, extra);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var productServices = {
|
|
36
|
+
article_id: 10,
|
|
37
|
+
order_id: 500,
|
|
38
|
+
services: [{
|
|
39
|
+
service_name: "datasheet",
|
|
40
|
+
display_name: "Ficha técnica",
|
|
41
|
+
category: {
|
|
42
|
+
category_name: "texts"
|
|
43
|
+
},
|
|
44
|
+
status_flow: {
|
|
45
|
+
flow_name: "workflow",
|
|
46
|
+
flow_type: "workflow"
|
|
47
|
+
},
|
|
48
|
+
is_legacy: true,
|
|
49
|
+
status: status("PA"),
|
|
50
|
+
retailers: [{
|
|
51
|
+
id_retailer: 58,
|
|
52
|
+
status: status("PA")
|
|
53
|
+
}, {
|
|
54
|
+
id_retailer: 59,
|
|
55
|
+
status: status("RA/AS")
|
|
56
|
+
}],
|
|
57
|
+
roles: ["especialist", "facilitator", "auditor"],
|
|
58
|
+
assignees: {
|
|
59
|
+
especialist: person(426, "Textos"),
|
|
60
|
+
facilitator: person(901, "Coord"),
|
|
61
|
+
auditor: person(903, "QA")
|
|
62
|
+
},
|
|
63
|
+
actions: {
|
|
64
|
+
set_status: false,
|
|
65
|
+
assign: false
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
service_name: "productPurchase",
|
|
69
|
+
display_name: "Compra de producto",
|
|
70
|
+
icon_name: null,
|
|
71
|
+
category: {
|
|
72
|
+
category_name: "logistics"
|
|
73
|
+
},
|
|
74
|
+
status_flow: {
|
|
75
|
+
flow_name: "checkbox",
|
|
76
|
+
flow_type: "simple"
|
|
77
|
+
},
|
|
78
|
+
is_legacy: false,
|
|
79
|
+
per_retailer: false,
|
|
80
|
+
status: status("PE", {
|
|
81
|
+
display_name: "Pendiente",
|
|
82
|
+
color: "#FFAA00",
|
|
83
|
+
is_final: false
|
|
84
|
+
}),
|
|
85
|
+
retailers: [{
|
|
86
|
+
id_retailer: 0,
|
|
87
|
+
status: status("PE", {
|
|
88
|
+
display_name: "Pendiente",
|
|
89
|
+
color: "#FFAA00",
|
|
90
|
+
is_final: false
|
|
91
|
+
})
|
|
92
|
+
}],
|
|
93
|
+
status_options: [status("PE"), status("HE", {
|
|
94
|
+
is_final: true
|
|
95
|
+
})],
|
|
96
|
+
roles: ["especialist"],
|
|
97
|
+
assignees: {
|
|
98
|
+
especialist: person(426, "Textos"),
|
|
99
|
+
facilitator: null,
|
|
100
|
+
auditor: null
|
|
101
|
+
},
|
|
102
|
+
actions: {
|
|
103
|
+
set_status: true,
|
|
104
|
+
assign: true
|
|
105
|
+
}
|
|
106
|
+
}]
|
|
107
|
+
};
|
|
108
|
+
(0, _vitest.describe)("buildServicesFromApi", function () {
|
|
109
|
+
var specialist = {
|
|
110
|
+
id_user: 426,
|
|
111
|
+
id_role: 7
|
|
112
|
+
};
|
|
113
|
+
(0, _vitest.it)("toma el estatus de la cadena activa; si no está en ella, el general", function () {
|
|
114
|
+
var _buildServicesFromApi = (0, _services.buildServicesFromApi)({
|
|
115
|
+
productServices: productServices,
|
|
116
|
+
user: specialist,
|
|
117
|
+
activeRetailerId: 59
|
|
118
|
+
}),
|
|
119
|
+
_buildServicesFromApi2 = (0, _slicedToArray2.default)(_buildServicesFromApi, 2),
|
|
120
|
+
datasheet = _buildServicesFromApi2[0],
|
|
121
|
+
purchase = _buildServicesFromApi2[1];
|
|
122
|
+
|
|
123
|
+
(0, _vitest.expect)(datasheet.status).toBe("RA/AS");
|
|
124
|
+
(0, _vitest.expect)(purchase.status).toBe("PE");
|
|
125
|
+
});
|
|
126
|
+
(0, _vitest.it)("los de siempre conservan su pestaña; los del catálogo usan su bloque y la vista simple", function () {
|
|
127
|
+
var _buildServicesFromApi3 = (0, _services.buildServicesFromApi)({
|
|
128
|
+
productServices: productServices,
|
|
129
|
+
user: specialist,
|
|
130
|
+
activeRetailerId: 58
|
|
131
|
+
}),
|
|
132
|
+
_buildServicesFromApi4 = (0, _slicedToArray2.default)(_buildServicesFromApi3, 2),
|
|
133
|
+
datasheet = _buildServicesFromApi4[0],
|
|
134
|
+
purchase = _buildServicesFromApi4[1];
|
|
135
|
+
|
|
136
|
+
(0, _vitest.expect)(datasheet).toMatchObject({
|
|
137
|
+
tab: "Ficha técnica",
|
|
138
|
+
group: "texts",
|
|
139
|
+
is_catalog: false
|
|
140
|
+
});
|
|
141
|
+
(0, _vitest.expect)(purchase).toMatchObject({
|
|
142
|
+
tab: null,
|
|
143
|
+
group: "logistics",
|
|
144
|
+
view: "simple",
|
|
145
|
+
icon: "purchase",
|
|
146
|
+
status_label: "Pendiente",
|
|
147
|
+
status_color: "#FFAA00",
|
|
148
|
+
status_flow_type: "simple",
|
|
149
|
+
is_catalog: true
|
|
150
|
+
});
|
|
151
|
+
(0, _vitest.expect)(purchase.api).toBe(productServices.services[1]);
|
|
152
|
+
});
|
|
153
|
+
(0, _vitest.it)("«Míos» y «te toca» salen del equipo del servicio", function () {
|
|
154
|
+
var _buildServicesFromApi5 = (0, _services.buildServicesFromApi)({
|
|
155
|
+
productServices: productServices,
|
|
156
|
+
user: specialist,
|
|
157
|
+
activeRetailerId: 59
|
|
158
|
+
}),
|
|
159
|
+
_buildServicesFromApi6 = (0, _slicedToArray2.default)(_buildServicesFromApi5, 2),
|
|
160
|
+
datasheet = _buildServicesFromApi6[0],
|
|
161
|
+
purchase = _buildServicesFromApi6[1]; // RA/AS: le toca a la especialista asignada.
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
(0, _vitest.expect)(datasheet).toMatchObject({
|
|
165
|
+
mine: true,
|
|
166
|
+
pending: true
|
|
167
|
+
}); // Flujo simple sin terminar: le toca a su especialista.
|
|
168
|
+
|
|
169
|
+
(0, _vitest.expect)(purchase).toMatchObject({
|
|
170
|
+
mine: true,
|
|
171
|
+
pending: true
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
var _buildServicesFromApi7 = (0, _services.buildServicesFromApi)({
|
|
175
|
+
productServices: productServices,
|
|
176
|
+
user: {
|
|
177
|
+
id_user: 1
|
|
178
|
+
},
|
|
179
|
+
activeRetailerId: 59
|
|
180
|
+
}),
|
|
181
|
+
_buildServicesFromApi8 = (0, _slicedToArray2.default)(_buildServicesFromApi7, 2),
|
|
182
|
+
other = _buildServicesFromApi8[1];
|
|
183
|
+
|
|
184
|
+
(0, _vitest.expect)(other).toMatchObject({
|
|
185
|
+
mine: false,
|
|
186
|
+
pending: false
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
(0, _vitest.it)("sin respuesta del backend, lista vacía", function () {
|
|
190
|
+
(0, _vitest.expect)((0, _services.buildServicesFromApi)({
|
|
191
|
+
productServices: null,
|
|
192
|
+
user: specialist
|
|
193
|
+
})).toEqual([]);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
@@ -5,12 +5,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.RetailerProductEditionDefault = void 0;
|
|
8
|
+
exports.default = exports.RetailerProductEditionDefault = exports.ConPestanaServicios = 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
|
+
|
|
14
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
17
|
|
|
16
18
|
var _default = {
|
|
@@ -214,4 +216,15 @@ RetailerProductEditionDefault.args = {
|
|
|
214
216
|
},
|
|
215
217
|
"src": "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1778260157973"
|
|
216
218
|
}
|
|
217
|
-
};
|
|
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
|
+
});
|
package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js
CHANGED
|
@@ -346,9 +346,9 @@ var ProviderProductEditionProvider = function ProviderProductEditionProvider(_re
|
|
|
346
346
|
// Imágenes/videos recién agregados a la galería (aún sin id en BD).
|
|
347
347
|
newImages = ((_state$images_values = state.images_values) === null || _state$images_values === void 0 ? void 0 : (_state$images_values$ = _state$images_values.values) === null || _state$images_values$ === void 0 ? void 0 : _state$images_values$.filter(function (e) {
|
|
348
348
|
return !e.id;
|
|
349
|
-
})) || []; // Salir solo si no hay nada que crear ni
|
|
349
|
+
})) || []; // Salir solo si no hay nada que crear, actualizar, ni atributos de imagen pendientes.
|
|
350
350
|
|
|
351
|
-
if (!(state.updated_images_values.length === 0 && newImages.length === 0)) {
|
|
351
|
+
if (!(state.updated_images_values.length === 0 && newImages.length === 0 && state.updated_attr_for_imgs.length === 0)) {
|
|
352
352
|
_context3.next = 3;
|
|
353
353
|
break;
|
|
354
354
|
}
|
|
@@ -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
|
-
|
|
16
14
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
17
15
|
|
|
18
|
-
var _objectSpread5 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
19
|
-
|
|
20
16
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
21
17
|
|
|
22
18
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
23
19
|
|
|
24
20
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
25
21
|
|
|
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,6 +117,8 @@ 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
|
+
|
|
120
122
|
var _material = require("@mui/material");
|
|
121
123
|
|
|
122
124
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -139,11 +141,17 @@ function obtenerDuracionVideoBase64(base64Data) {
|
|
|
139
141
|
video.addEventListener("error", reject);
|
|
140
142
|
});
|
|
141
143
|
}
|
|
144
|
+
/** Pestaña con todos los servicios del producto (ver organisms/ServicesWorkspace). */
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
var SERVICES_TAB = "Servicios";
|
|
142
148
|
|
|
143
149
|
var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
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$
|
|
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$product$catego, _state$product32, _state$product33, _state$services3, _state$services3$data, _state$product34, _state$product35, _state$datasheets_inp, _state$datasheets_inp2, _state$product36, _state$images_values$3, _state$images_values14, _state$images_values15, _state$images_values16, _state$images_values17, _state$comment;
|
|
145
151
|
|
|
146
152
|
var tabsSections = _ref.tabsSections,
|
|
153
|
+
_ref$showServicesTab = _ref.showServicesTab,
|
|
154
|
+
showServicesTab = _ref$showServicesTab === void 0 ? false : _ref$showServicesTab,
|
|
147
155
|
_ref$productSelected = _ref.productSelected,
|
|
148
156
|
productSelected = _ref$productSelected === void 0 ? {} : _ref$productSelected,
|
|
149
157
|
_ref$user = _ref.user,
|
|
@@ -166,6 +174,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
166
174
|
createComment = _useProviderProductEd.createComment;
|
|
167
175
|
|
|
168
176
|
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;
|
|
169
181
|
|
|
170
182
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
171
183
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
@@ -902,7 +914,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
902
914
|
// para no reventar en Object.values(undefined).
|
|
903
915
|
|
|
904
916
|
retailerDatasheets = (_services$ = services[0]) === null || _services$ === void 0 ? void 0 : _services$[id_retailer];
|
|
905
|
-
datasheetsActiveRetailer = (0,
|
|
917
|
+
datasheetsActiveRetailer = (0, _objectSpread6.default)((0, _objectSpread6.default)({}, retailerDatasheets), {}, {
|
|
906
918
|
data: Object.values((_retailerDatasheets$d = retailerDatasheets === null || retailerDatasheets === void 0 ? void 0 : retailerDatasheets.data) !== null && _retailerDatasheets$d !== void 0 ? _retailerDatasheets$d : {})
|
|
907
919
|
});
|
|
908
920
|
descriptionsActiveRetailer = services[1].filter(function (item) {
|
|
@@ -931,7 +943,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
931
943
|
payload: {
|
|
932
944
|
datasheets: services[0],
|
|
933
945
|
descriptions: services[1],
|
|
934
|
-
images: (0,
|
|
946
|
+
images: (0, _objectSpread6.default)((0, _objectSpread6.default)({}, services[2]), {}, {
|
|
935
947
|
values: orderedValues
|
|
936
948
|
})
|
|
937
949
|
}
|
|
@@ -967,7 +979,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
967
979
|
});
|
|
968
980
|
dispatch({
|
|
969
981
|
type: "SET_IMAGES_VALUES",
|
|
970
|
-
payload: (0,
|
|
982
|
+
payload: (0, _objectSpread6.default)((0, _objectSpread6.default)({}, services[2]), {}, {
|
|
971
983
|
values: filteredValues
|
|
972
984
|
})
|
|
973
985
|
});
|
|
@@ -1401,10 +1413,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1401
1413
|
var _state$product$varian, _state$product13, _updatedProduct$varia;
|
|
1402
1414
|
|
|
1403
1415
|
if (!result) return;
|
|
1404
|
-
var updatedProduct = result.mode === "self" ? (0,
|
|
1416
|
+
var updatedProduct = result.mode === "self" ? (0, _objectSpread6.default)((0, _objectSpread6.default)({}, state.product), {}, {
|
|
1405
1417
|
parentArticleId: null,
|
|
1406
1418
|
variantsCount: 0
|
|
1407
|
-
}) : (0,
|
|
1419
|
+
}) : (0, _objectSpread6.default)((0, _objectSpread6.default)({}, state.product), {}, {
|
|
1408
1420
|
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)
|
|
1409
1421
|
});
|
|
1410
1422
|
dispatch({
|
|
@@ -1422,7 +1434,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1422
1434
|
if (guardado) {
|
|
1423
1435
|
var _updatedProduct$paren;
|
|
1424
1436
|
|
|
1425
|
-
sessionStorage.setItem("productSelected", JSON.stringify((0,
|
|
1437
|
+
sessionStorage.setItem("productSelected", JSON.stringify((0, _objectSpread6.default)((0, _objectSpread6.default)({}, guardado), {}, {
|
|
1426
1438
|
variantsCount: updatedProduct.variantsCount,
|
|
1427
1439
|
parentArticleId: (_updatedProduct$paren = updatedProduct.parentArticleId) !== null && _updatedProduct$paren !== void 0 ? _updatedProduct$paren : null
|
|
1428
1440
|
})));
|
|
@@ -1677,9 +1689,9 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1677
1689
|
var _state$product$varian2, _state$product18, _result$linked, _result$parentArticle;
|
|
1678
1690
|
|
|
1679
1691
|
if (!result) return;
|
|
1680
|
-
var updatedProduct = result.mode === "children" ? (0,
|
|
1692
|
+
var updatedProduct = result.mode === "children" ? (0, _objectSpread6.default)((0, _objectSpread6.default)({}, state.product), {}, {
|
|
1681
1693
|
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
|
|
1682
|
-
}) : (0,
|
|
1694
|
+
}) : (0, _objectSpread6.default)((0, _objectSpread6.default)({}, state.product), {}, {
|
|
1683
1695
|
parentArticleId: (_result$parentArticle = result.parentArticleId) !== null && _result$parentArticle !== void 0 ? _result$parentArticle : null,
|
|
1684
1696
|
variantsCount: 0
|
|
1685
1697
|
});
|
|
@@ -1706,7 +1718,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1706
1718
|
if (guardado) {
|
|
1707
1719
|
var _updatedProduct$paren2;
|
|
1708
1720
|
|
|
1709
|
-
sessionStorage.setItem("productSelected", JSON.stringify((0,
|
|
1721
|
+
sessionStorage.setItem("productSelected", JSON.stringify((0, _objectSpread6.default)((0, _objectSpread6.default)({}, guardado), {}, {
|
|
1710
1722
|
variantsCount: updatedProduct.variantsCount,
|
|
1711
1723
|
parentArticleId: (_updatedProduct$paren2 = updatedProduct.parentArticleId) !== null && _updatedProduct$paren2 !== void 0 ? _updatedProduct$paren2 : null
|
|
1712
1724
|
})));
|
|
@@ -1777,7 +1789,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1777
1789
|
esDescripcion = kind === "description";
|
|
1778
1790
|
_context11.prev = 4;
|
|
1779
1791
|
_context11.next = 7;
|
|
1780
|
-
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/restore"), (0,
|
|
1792
|
+
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/restore"), (0, _objectSpread6.default)({
|
|
1781
1793
|
articleId: state.product.id_article
|
|
1782
1794
|
}, esDescripcion ? {
|
|
1783
1795
|
descriptions: [Number(attributeId)]
|
|
@@ -2334,7 +2346,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2334
2346
|
var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(result) {
|
|
2335
2347
|
var _state$product$id_ord, _state$active_retaile6;
|
|
2336
2348
|
|
|
2337
|
-
var concept, articleId, orderId, sectionStatusKey, evalStatus, retailerId, data, res, message, icon, activeTab, newStatuses, serviceStatus, articleStatus, updatedStatusByRetailer, updatedProduct, specialistDone,
|
|
2349
|
+
var concept, articleId, orderId, sectionStatusKey, evalStatus, retailerId, data, res, message, icon, activeTab, newStatuses, serviceStatus, articleStatus, updatedStatusByRetailer, updatedProduct, specialistDone, _objectSpread3, _state$services_data2, _JSON$parse2, newStatus, newOrderStatus, newArticleStatus, _articleStatus, updatedStatusByRetailerForSend, _updatedProduct, updatedServicesData, sessionProduct, _objectSpread4, productInSession, updatedProductInSession;
|
|
2338
2350
|
|
|
2339
2351
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
2340
2352
|
while (1) {
|
|
@@ -2392,11 +2404,11 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2392
2404
|
}); // Actualizar el producto con los nuevos estados
|
|
2393
2405
|
|
|
2394
2406
|
updatedStatusByRetailer = state.product.statusByRetailer.map(function (item) {
|
|
2395
|
-
return item.retailer_id === retailerId && item.service === concept ? (0,
|
|
2407
|
+
return item.retailer_id === retailerId && item.service === concept ? (0, _objectSpread6.default)((0, _objectSpread6.default)({}, item), {}, {
|
|
2396
2408
|
status: serviceStatus
|
|
2397
2409
|
}) : item;
|
|
2398
2410
|
});
|
|
2399
|
-
updatedProduct = (0,
|
|
2411
|
+
updatedProduct = (0, _objectSpread6.default)((0, _objectSpread6.default)({}, state.product), {}, {
|
|
2400
2412
|
statusByRetailer: updatedStatusByRetailer,
|
|
2401
2413
|
status: (0, _product.getMinorStatusFromRetailer)(updatedStatusByRetailer)
|
|
2402
2414
|
});
|
|
@@ -2471,17 +2483,17 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2471
2483
|
|
|
2472
2484
|
updatedStatusByRetailerForSend = state.product.statusByRetailer.map(function (item) {
|
|
2473
2485
|
if (item.retailer_id === retailerId && item.service === concept) {
|
|
2474
|
-
return (0,
|
|
2486
|
+
return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, item), {}, {
|
|
2475
2487
|
status: newStatus
|
|
2476
2488
|
});
|
|
2477
2489
|
}
|
|
2478
2490
|
|
|
2479
2491
|
return item;
|
|
2480
2492
|
});
|
|
2481
|
-
_updatedProduct = (0,
|
|
2493
|
+
_updatedProduct = (0, _objectSpread6.default)((0, _objectSpread6.default)({}, state.product), {}, (_objectSpread3 = {}, (0, _defineProperty2.default)(_objectSpread3, "".concat(concept, "_status"), newStatus), (0, _defineProperty2.default)(_objectSpread3, "statusByRetailer", updatedStatusByRetailerForSend), (0, _defineProperty2.default)(_objectSpread3, "status", (0, _product.getMinorStatusFromRetailer)(updatedStatusByRetailerForSend)), _objectSpread3)); //Actualizamos el services_data en el servicio específico del retailer actual
|
|
2482
2494
|
|
|
2483
2495
|
updatedServicesData = (_state$services_data2 = state.services_data) === null || _state$services_data2 === void 0 ? void 0 : _state$services_data2.map(function (service) {
|
|
2484
|
-
return (0,
|
|
2496
|
+
return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, service), {}, {
|
|
2485
2497
|
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
|
|
2486
2498
|
});
|
|
2487
2499
|
});
|
|
@@ -2489,15 +2501,15 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2489
2501
|
|
|
2490
2502
|
if (sessionProduct) {
|
|
2491
2503
|
productInSession = JSON.parse(sessionProduct);
|
|
2492
|
-
updatedProductInSession = (0,
|
|
2504
|
+
updatedProductInSession = (0, _objectSpread6.default)((0, _objectSpread6.default)({}, productInSession), {}, (_objectSpread4 = {}, (0, _defineProperty2.default)(_objectSpread4, "".concat(concept, "_status"), newStatus), (0, _defineProperty2.default)(_objectSpread4, "statusByRetailer", state.product.statusByRetailer.map(function (item) {
|
|
2493
2505
|
if (item.retailer_id === retailerId && item.service === concept) {
|
|
2494
|
-
return (0,
|
|
2506
|
+
return (0, _objectSpread6.default)((0, _objectSpread6.default)({}, item), {}, {
|
|
2495
2507
|
status: newStatus
|
|
2496
2508
|
});
|
|
2497
2509
|
}
|
|
2498
2510
|
|
|
2499
2511
|
return item;
|
|
2500
|
-
})),
|
|
2512
|
+
})), _objectSpread4));
|
|
2501
2513
|
sessionStorage.setItem("productSelected", JSON.stringify(updatedProductInSession));
|
|
2502
2514
|
}
|
|
2503
2515
|
|
|
@@ -2649,12 +2661,12 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2649
2661
|
status = "".concat(result, "A"); // Actualizar el statusByRetailer para todos los retailers y conceptos
|
|
2650
2662
|
|
|
2651
2663
|
updatedStatusByRetailer = state.product.statusByRetailer.map(function (item) {
|
|
2652
|
-
return conceptArray.includes(item.service) ? (0,
|
|
2664
|
+
return conceptArray.includes(item.service) ? (0, _objectSpread6.default)((0, _objectSpread6.default)({}, item), {}, {
|
|
2653
2665
|
status: status
|
|
2654
2666
|
}) : item;
|
|
2655
2667
|
}); // Actualizar el producto con los nuevos estados
|
|
2656
2668
|
|
|
2657
|
-
updatedProduct = (0,
|
|
2669
|
+
updatedProduct = (0, _objectSpread6.default)((0, _objectSpread6.default)({}, state.product), {}, {
|
|
2658
2670
|
article_status: status,
|
|
2659
2671
|
status: (0, _product.getMinorStatusFromRetailer)(updatedStatusByRetailer),
|
|
2660
2672
|
datasheet_status: state.product.datasheet_status === "NA" ? "NA" : status,
|
|
@@ -2667,7 +2679,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2667
2679
|
payload: updatedProduct
|
|
2668
2680
|
});
|
|
2669
2681
|
updatedServicesData = state.services_data.map(function (service) {
|
|
2670
|
-
return conceptArray.includes(service.service) ? (0,
|
|
2682
|
+
return conceptArray.includes(service.service) ? (0, _objectSpread6.default)((0, _objectSpread6.default)({}, service), {}, {
|
|
2671
2683
|
status: status
|
|
2672
2684
|
}) : service;
|
|
2673
2685
|
});
|
|
@@ -2753,7 +2765,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2753
2765
|
});
|
|
2754
2766
|
|
|
2755
2767
|
case 4:
|
|
2756
|
-
updatedProduct = (0,
|
|
2768
|
+
updatedProduct = (0, _objectSpread6.default)((0, _objectSpread6.default)({}, state.product), {}, (0, _defineProperty2.default)({}, "id_".concat(concept, "_").concat(assignationType), assignationId));
|
|
2757
2769
|
dispatch({
|
|
2758
2770
|
type: "SET_PRODUCT",
|
|
2759
2771
|
payload: updatedProduct
|
|
@@ -3219,7 +3231,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3219
3231
|
destinos = (0, _objectWithoutProperties2.default)(propagation, _excluded);
|
|
3220
3232
|
|
|
3221
3233
|
if (esDescripcion) {
|
|
3222
|
-
saveDescriptions(token, (0,
|
|
3234
|
+
saveDescriptions(token, (0, _objectSpread6.default)((0, _objectSpread6.default)({}, destinos), {}, {
|
|
3223
3235
|
descriptions: attributes
|
|
3224
3236
|
}));
|
|
3225
3237
|
} else {
|
|
@@ -3249,7 +3261,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3249
3261
|
setVariantGroup(result);
|
|
3250
3262
|
setShowGroup(true);
|
|
3251
3263
|
}
|
|
3252
|
-
}), porDesvincular && /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnlinkVariantModal.UnlinkVariantModal, (0,
|
|
3264
|
+
}), porDesvincular && /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnlinkVariantModal.UnlinkVariantModal, (0, _objectSpread6.default)((0, _objectSpread6.default)({}, porDesvincular), {}, {
|
|
3253
3265
|
token: token,
|
|
3254
3266
|
onClose: function onClose() {
|
|
3255
3267
|
return setPorDesvincular(null);
|
|
@@ -3652,7 +3664,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3652
3664
|
showApproveRejectAll: canShowBulkEvaluationButtons() || isAuditorAssigned() || isUserAssignedToService(),
|
|
3653
3665
|
showValidationButtons: canShowSingleEvaluationButtons() && (isAuditorAssigned() || isUserAssignedToService())
|
|
3654
3666
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
3655
|
-
tabsSections:
|
|
3667
|
+
tabsSections: tabs,
|
|
3656
3668
|
status: getStatusByCurrentServiceAndRetailer(),
|
|
3657
3669
|
activeTab: state.active_tab,
|
|
3658
3670
|
isRetailer: isRetailer,
|
|
@@ -3687,7 +3699,12 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3687
3699
|
className: "services-information-container " + (imageLayout && state.active_tab === "Imágenes" ? "image-services" : ""),
|
|
3688
3700
|
id: "services-information-container",
|
|
3689
3701
|
children: state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
3690
|
-
children: [
|
|
3702
|
+
children: [isServicesTab && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ServicesWorkspace.default, {
|
|
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, {
|
|
3691
3708
|
activeSection: state.active_tab,
|
|
3692
3709
|
inputGroup: state.descriptions_inputs[0],
|
|
3693
3710
|
updatedDescriptions: state.updated_descriptions_inputs
|
|
@@ -3696,7 +3713,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3696
3713
|
,
|
|
3697
3714
|
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,
|
|
3698
3715
|
onRestoreInheritance: handleOnRestoreInheritance,
|
|
3699
|
-
articleId: (_state$
|
|
3716
|
+
articleId: (_state$product34 = state.product) === null || _state$product34 === void 0 ? void 0 : _state$product34.id_article,
|
|
3700
3717
|
version: state.product.version,
|
|
3701
3718
|
auditInputGroup: auditDescriptions[0],
|
|
3702
3719
|
setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
|
|
@@ -3705,7 +3722,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3705
3722
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
3706
3723
|
text: "No cuentas con este servicio",
|
|
3707
3724
|
headerType: "input-name-header"
|
|
3708
|
-
})), state.active_tab === "Ficha técnica" && (((_state$
|
|
3725
|
+
})), state.active_tab === "Ficha técnica" && (((_state$product35 = state.product) === null || _state$product35 === void 0 ? void 0 : _state$product35.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
3709
3726
|
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) {
|
|
3710
3727
|
var _state$services4, _state$services4$data;
|
|
3711
3728
|
|
|
@@ -3726,7 +3743,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3726
3743
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
3727
3744
|
text: "No cuentas con este servicio",
|
|
3728
3745
|
headerType: "input-name-header"
|
|
3729
|
-
})), state.active_tab === "Imágenes" && (((_state$
|
|
3746
|
+
})), state.active_tab === "Imágenes" && (((_state$product36 = state.product) === null || _state$product36 === void 0 ? void 0 : _state$product36.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
3730
3747
|
children: [enableDigitalAssets && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryTrayTabs.GalleryTrayTabs, {
|
|
3731
3748
|
activeTray: currentTray,
|
|
3732
3749
|
setActiveTray: setActiveTray,
|
|
@@ -3737,7 +3754,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3737
3754
|
style: {
|
|
3738
3755
|
position: "relative"
|
|
3739
3756
|
},
|
|
3740
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DigitalAssetsTray.DigitalAssetsTray, (0,
|
|
3757
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DigitalAssetsTray.DigitalAssetsTray, (0, _objectSpread6.default)((0, _objectSpread6.default)({}, digitalAssets), {}, {
|
|
3741
3758
|
unsaved: (0, _assets.countUnsavedAssets)(state),
|
|
3742
3759
|
gridLayout: imageLayout,
|
|
3743
3760
|
readOnly: !isAuditorAssigned() && !isUserAssignedToService(),
|
|
@@ -3757,10 +3774,10 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3757
3774
|
style: {
|
|
3758
3775
|
position: "relative"
|
|
3759
3776
|
},
|
|
3760
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0,
|
|
3777
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread6.default)((0, _objectSpread6.default)({}, getRootProps({
|
|
3761
3778
|
className: "dropzone ".concat(isDragActive ? "drag-active" : "")
|
|
3762
3779
|
})), {}, {
|
|
3763
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0,
|
|
3780
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread6.default)({}, getInputProps())), isDragActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
3764
3781
|
className: "drag-overlay",
|
|
3765
3782
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
3766
3783
|
children: "Suelta las im\xE1genes aqu\xED"
|
|
@@ -3810,7 +3827,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3810
3827
|
headerType: "input-name-header"
|
|
3811
3828
|
}))]
|
|
3812
3829
|
})
|
|
3813
|
-
}), (isUserAssignedToService(state.active_tab) || isAuditorAssigned()) && state.product["".concat((0, _utils.getConceptByTab)(state.active_tab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
3830
|
+
}), !isServicesTab && (isUserAssignedToService(state.active_tab) || isAuditorAssigned()) && state.product["".concat((0, _utils.getConceptByTab)(state.active_tab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
3814
3831
|
className: "commentary-box",
|
|
3815
3832
|
children: [!state.comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
3816
3833
|
className: "commentary",
|
|
@@ -3884,7 +3901,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
3884
3901
|
|
|
3885
3902
|
var RetailerProductEdition = function RetailerProductEdition(props) {
|
|
3886
3903
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_providerProductEdition.ProviderProductEditionProvider, {
|
|
3887
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RetailerProductEditionView, (0,
|
|
3904
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RetailerProductEditionView, (0, _objectSpread6.default)({}, props))
|
|
3888
3905
|
});
|
|
3889
3906
|
};
|
|
3890
3907
|
|
|
@@ -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, _productData$serviceS, _productData$demo_ser;
|
|
132
132
|
|
|
133
133
|
// Handle case where product might be wrapped in a product property
|
|
134
134
|
var productData = product.product || product;
|
|
@@ -194,7 +194,11 @@ 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
|
|
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
|
|
198
202
|
};
|
|
199
203
|
};
|
|
200
204
|
|
package/dist/index.js
CHANGED
|
@@ -1447,6 +1447,19 @@ 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
|
+
|
|
1450
1463
|
var _ProviderProductEdition = require("./components/pages/ProviderProductEdition");
|
|
1451
1464
|
|
|
1452
1465
|
Object.keys(_ProviderProductEdition).forEach(function (key) {
|