contentoh-components-library 21.6.57 → 21.6.59
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/components/pages/CreatorsProductEdition/CreatorsProductEditionView.js +90 -135
- package/dist/components/pages/CreatorsProductEdition/hooks/useCreatorsProductEdition.js +148 -162
- package/dist/components/pages/CreatorsProductEdition/mocks/api.fixtures.js +16 -0
- package/dist/components/pages/CreatorsProductEdition/mocks/mockApi.js +1 -0
- package/dist/components/pages/CreatorsProductEdition/sections/ImageGallery.js +433 -0
- package/dist/components/pages/CreatorsProductEdition/sections/NoticeDialog.js +155 -0
- package/dist/components/pages/CreatorsProductEdition/sections/RejectDialog.js +201 -0
- package/dist/components/pages/CreatorsProductEdition/sections/VersionDrawer.js +615 -0
- package/dist/components/pages/CreatorsProductEdition/stories/CreatorsProductEdition.stories.js +3 -31
- package/dist/components/pages/CreatorsProductEdition/stories/CreatorsProductEditionAPI.stories.js +55 -30
- package/dist/components/pages/CreatorsProductEdition/stories/products.js +923 -0
- package/dist/components/pages/CreatorsProductEdition/styles.js +27 -7
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +2 -1
- package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +325 -10
- package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.reducer.js +12 -2
- package/dist/components/pages/ProviderProductEdition/index.js +486 -231
- package/dist/index.js +13 -0
- package/package.json +1 -1
- package/src/components/pages/CreatorsProductEdition/CreatorsProductEditionView.jsx +777 -0
- package/src/components/pages/CreatorsProductEdition/constants.js +21 -0
- package/src/components/pages/CreatorsProductEdition/hooks/useCreatorsProductEdition.js +2238 -0
- package/src/components/pages/CreatorsProductEdition/index.js +19 -0
- package/src/components/pages/CreatorsProductEdition/mocks/api.fixtures.js +357 -0
- package/src/components/pages/CreatorsProductEdition/mocks/mockApi.js +144 -0
- package/src/components/pages/CreatorsProductEdition/sections/CommentBox.jsx +183 -0
- package/src/components/pages/CreatorsProductEdition/sections/ImageGallery.jsx +269 -0
- package/src/components/pages/CreatorsProductEdition/sections/ImagePanel.jsx +332 -0
- package/src/components/pages/CreatorsProductEdition/sections/ImagesSection.jsx +385 -0
- package/src/components/pages/CreatorsProductEdition/sections/NoticeDialog.jsx +111 -0
- package/src/components/pages/CreatorsProductEdition/sections/ProductHeader.jsx +305 -0
- package/src/components/pages/CreatorsProductEdition/sections/ProductMedia.jsx +101 -0
- package/src/components/pages/CreatorsProductEdition/sections/RejectDialog.jsx +125 -0
- package/src/components/pages/CreatorsProductEdition/sections/RetailerMenu.jsx +129 -0
- package/src/components/pages/CreatorsProductEdition/sections/ServiceActions.jsx +382 -0
- package/src/components/pages/CreatorsProductEdition/sections/StatusChip.jsx +37 -0
- package/src/components/pages/CreatorsProductEdition/sections/TabsBar.jsx +187 -0
- package/src/components/pages/CreatorsProductEdition/sections/VariantsPanel.jsx +311 -0
- package/src/components/pages/CreatorsProductEdition/sections/VersionDrawer.jsx +357 -0
- package/src/components/pages/CreatorsProductEdition/sections/tokens.js +63 -0
- package/src/components/pages/CreatorsProductEdition/stories/CreatorsProductEdition.stories.js +111 -0
- package/src/components/pages/CreatorsProductEdition/stories/CreatorsProductEditionAPI.stories.js +85 -0
- package/src/components/pages/CreatorsProductEdition/stories/products.js +966 -0
- package/src/components/pages/CreatorsProductEdition/styles.js +178 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +1 -0
- package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +201 -0
- package/src/components/pages/ProviderProductEdition/context/provider-product-edition.reducer.js +12 -0
- package/src/components/pages/ProviderProductEdition/index.js +228 -7
- package/src/index.js +1 -0
|
@@ -39,12 +39,8 @@ var _generateThumnail = _interopRequireDefault(require("../../RetailerProductEdi
|
|
|
39
39
|
|
|
40
40
|
var _data = require("../../../../global-files/data");
|
|
41
41
|
|
|
42
|
-
var _customHooks = require("../../../../global-files/customHooks");
|
|
43
|
-
|
|
44
42
|
var _useDigitalAssets = require("../../../../global-files/digital-assets/useDigitalAssets");
|
|
45
43
|
|
|
46
|
-
var _assets = require("../../../../global-files/digital-assets/assets.reducer");
|
|
47
|
-
|
|
48
44
|
var _GalleryTrayTabs = require("../../../molecules/GalleryTrayTabs");
|
|
49
45
|
|
|
50
46
|
var _nonPropagable = require("../../../organisms/PropagateChangesModal/non-propagable");
|
|
@@ -115,82 +111,90 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
115
111
|
createComment = _useProviderProductEd.createComment;
|
|
116
112
|
|
|
117
113
|
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
114
|
+
/*
|
|
115
|
+
El original usaba `useCloseModal("version-selector")`: cierra con cualquier
|
|
116
|
+
clic cuyo destino no esté dentro de `#version-selector`. En el diálogo de
|
|
117
|
+
nueva versión, el botón de «Versión personalizada» desaparece al cambiar de
|
|
118
|
+
paso antes de que llegue ese clic al documento, así que parecía un clic
|
|
119
|
+
fuera y se cerraba todo. El Drawer de `VersionDrawer` ya se cierra al tocar
|
|
120
|
+
fuera o con Escape.
|
|
121
|
+
*/
|
|
118
122
|
|
|
119
|
-
var
|
|
120
|
-
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
121
|
-
showVersionSelector = _useCloseModal2[0],
|
|
122
|
-
setShowVersionSelector = _useCloseModal2[1];
|
|
123
|
-
|
|
124
|
-
var _useState = (0, _react.useState)(null),
|
|
123
|
+
var _useState = (0, _react.useState)(false),
|
|
125
124
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
showVersionSelector = _useState2[0],
|
|
126
|
+
setShowVersionSelector = _useState2[1];
|
|
128
127
|
|
|
129
|
-
var _useState3 = (0, _react.useState)(
|
|
128
|
+
var _useState3 = (0, _react.useState)(null),
|
|
130
129
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
auditableVersion = _useState4[0],
|
|
131
|
+
setAuditableVersion = _useState4[1];
|
|
133
132
|
|
|
134
|
-
var _useState5 = (0, _react.useState)(
|
|
133
|
+
var _useState5 = (0, _react.useState)(0),
|
|
135
134
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
headerTop = _useState6[0],
|
|
136
|
+
setHeaderTop = _useState6[1];
|
|
138
137
|
|
|
139
|
-
var _useState7 = (0, _react.useState)(),
|
|
138
|
+
var _useState7 = (0, _react.useState)(false),
|
|
140
139
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
shotThd = _useState8[0],
|
|
141
|
+
setShotThd = _useState8[1];
|
|
143
142
|
|
|
144
|
-
var _useState9 = (0, _react.useState)(
|
|
143
|
+
var _useState9 = (0, _react.useState)(),
|
|
145
144
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
observation = _useState10[0],
|
|
146
|
+
setObservation = _useState10[1];
|
|
148
147
|
|
|
149
148
|
var _useState11 = (0, _react.useState)(false),
|
|
150
149
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
showRejectModal = _useState12[0],
|
|
151
|
+
setShowRejectModal = _useState12[1];
|
|
153
152
|
|
|
154
153
|
var _useState13 = (0, _react.useState)(false),
|
|
155
154
|
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
isObservationVisible = _useState14[0],
|
|
156
|
+
setObservationVisible = _useState14[1];
|
|
158
157
|
|
|
159
158
|
var _useState15 = (0, _react.useState)(false),
|
|
160
159
|
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
imageLayout = _useState16[0],
|
|
161
|
+
setImageLayout = _useState16[1];
|
|
163
162
|
|
|
164
|
-
var _useState17 = (0, _react.useState)(
|
|
163
|
+
var _useState17 = (0, _react.useState)(false),
|
|
165
164
|
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
crossComment = _useState18[0],
|
|
166
|
+
setCrossComment = _useState18[1];
|
|
168
167
|
|
|
169
|
-
var _useState19 = (0, _react.useState)(
|
|
168
|
+
var _useState19 = (0, _react.useState)([]),
|
|
170
169
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
statusArray = _useState20[0],
|
|
171
|
+
setStatusArray = _useState20[1];
|
|
174
172
|
|
|
175
173
|
var _useState21 = (0, _react.useState)(false),
|
|
176
174
|
_useState22 = (0, _slicedToArray2.default)(_useState21, 2),
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
rejectAll = _useState22[0],
|
|
176
|
+
setRejectAll = _useState22[1]; // Padre/hijo: mismo comportamiento que la ficha de la aplicación de clientes.
|
|
177
|
+
|
|
179
178
|
|
|
180
|
-
var _useState23 = (0, _react.useState)(
|
|
179
|
+
var _useState23 = (0, _react.useState)(false),
|
|
181
180
|
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
showLinkVariants = _useState24[0],
|
|
182
|
+
setShowLinkVariants = _useState24[1];
|
|
184
183
|
|
|
185
|
-
var _useState25 = (0, _react.useState)(
|
|
184
|
+
var _useState25 = (0, _react.useState)(null),
|
|
186
185
|
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
family = _useState26[0],
|
|
187
|
+
setFamily = _useState26[1];
|
|
189
188
|
|
|
190
|
-
var _useState27 = (0, _react.useState)(
|
|
189
|
+
var _useState27 = (0, _react.useState)(false),
|
|
191
190
|
_useState28 = (0, _slicedToArray2.default)(_useState27, 2),
|
|
192
|
-
|
|
193
|
-
|
|
191
|
+
showFamily = _useState28[0],
|
|
192
|
+
setShowFamily = _useState28[1];
|
|
193
|
+
|
|
194
|
+
var _useState29 = (0, _react.useState)(null),
|
|
195
|
+
_useState30 = (0, _slicedToArray2.default)(_useState29, 2),
|
|
196
|
+
loadingVariant = _useState30[0],
|
|
197
|
+
setLoadingVariant = _useState30[1];
|
|
194
198
|
/*
|
|
195
199
|
Agrupación de variantes. Aparte del padre/hijo a propósito: son mecanismos
|
|
196
200
|
independientes y un producto puede tener los dos. Padre/hijo es herencia;
|
|
@@ -198,69 +202,69 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
198
202
|
*/
|
|
199
203
|
|
|
200
204
|
|
|
201
|
-
var
|
|
202
|
-
_useState30 = (0, _slicedToArray2.default)(_useState29, 2),
|
|
203
|
-
variantGroup = _useState30[0],
|
|
204
|
-
setVariantGroup = _useState30[1];
|
|
205
|
-
|
|
206
|
-
var _useState31 = (0, _react.useState)(false),
|
|
205
|
+
var _useState31 = (0, _react.useState)(null),
|
|
207
206
|
_useState32 = (0, _slicedToArray2.default)(_useState31, 2),
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
variantGroup = _useState32[0],
|
|
208
|
+
setVariantGroup = _useState32[1];
|
|
210
209
|
|
|
211
210
|
var _useState33 = (0, _react.useState)(false),
|
|
212
211
|
_useState34 = (0, _slicedToArray2.default)(_useState33, 2),
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
// HIJO, que es quien lleva la relación y lo que pide la acción `unlink`.
|
|
212
|
+
showGroup = _useState34[0],
|
|
213
|
+
setShowGroup = _useState34[1];
|
|
216
214
|
|
|
217
|
-
|
|
218
|
-
var _useState35 = (0, _react.useState)(null),
|
|
215
|
+
var _useState35 = (0, _react.useState)(false),
|
|
219
216
|
_useState36 = (0, _slicedToArray2.default)(_useState35, 2),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
//
|
|
217
|
+
showGroupModal = _useState36[0],
|
|
218
|
+
setShowGroupModal = _useState36[1]; // Qué vínculo se está por romper, o null si no hay diálogo abierto. Guarda al
|
|
219
|
+
// HIJO, que es quien lleva la relación y lo que pide la acción `unlink`.
|
|
223
220
|
|
|
224
221
|
|
|
225
222
|
var _useState37 = (0, _react.useState)(null),
|
|
226
223
|
_useState38 = (0, _slicedToArray2.default)(_useState37, 2),
|
|
227
|
-
|
|
228
|
-
|
|
224
|
+
porDesvincular = _useState38[0],
|
|
225
|
+
setPorDesvincular = _useState38[1]; // Por qué un salto no se pudo hacer. Vive aparte de `family.error` porque no
|
|
226
|
+
// es un fallo al leer la familia, sino al abrir uno de sus miembros.
|
|
227
|
+
|
|
229
228
|
|
|
230
229
|
var _useState39 = (0, _react.useState)(null),
|
|
231
230
|
_useState40 = (0, _slicedToArray2.default)(_useState39, 2),
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
avisoFamilia = _useState40[0],
|
|
232
|
+
setAvisoFamilia = _useState40[1];
|
|
234
233
|
|
|
235
|
-
var _useState41 = (0, _react.useState)(
|
|
234
|
+
var _useState41 = (0, _react.useState)(null),
|
|
236
235
|
_useState42 = (0, _slicedToArray2.default)(_useState41, 2),
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
pendingPropagation = _useState42[0],
|
|
237
|
+
setPendingPropagation = _useState42[1];
|
|
239
238
|
|
|
240
|
-
var _useState43 = (0, _react.useState)(
|
|
239
|
+
var _useState43 = (0, _react.useState)(false),
|
|
241
240
|
_useState44 = (0, _slicedToArray2.default)(_useState43, 2),
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
preparandoPropagacion = _useState44[0],
|
|
242
|
+
setPreparandoPropagacion = _useState44[1];
|
|
244
243
|
|
|
245
244
|
var _useState45 = (0, _react.useState)([]),
|
|
246
245
|
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
auditServices = _useState46[0],
|
|
247
|
+
setAuditServices = _useState46[1];
|
|
249
248
|
|
|
250
249
|
var _useState47 = (0, _react.useState)([]),
|
|
251
250
|
_useState48 = (0, _slicedToArray2.default)(_useState47, 2),
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
auditDatasheets = _useState48[0],
|
|
252
|
+
setAuditDatasheets = _useState48[1];
|
|
254
253
|
|
|
255
|
-
var _useState49 = (0, _react.useState)(
|
|
254
|
+
var _useState49 = (0, _react.useState)([]),
|
|
256
255
|
_useState50 = (0, _slicedToArray2.default)(_useState49, 2),
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
auditDescriptions = _useState50[0],
|
|
257
|
+
setAuditDescriptions = _useState50[1];
|
|
259
258
|
|
|
260
259
|
var _useState51 = (0, _react.useState)(false),
|
|
261
260
|
_useState52 = (0, _slicedToArray2.default)(_useState51, 2),
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
showModal = _useState52[0],
|
|
262
|
+
setShowModal = _useState52[1];
|
|
263
|
+
|
|
264
|
+
var _useState53 = (0, _react.useState)(false),
|
|
265
|
+
_useState54 = (0, _slicedToArray2.default)(_useState53, 2),
|
|
266
|
+
compare = _useState54[0],
|
|
267
|
+
setCompare = _useState54[1];
|
|
264
268
|
|
|
265
269
|
var _useDropzone = (0, _reactDropzone.useDropzone)({
|
|
266
270
|
accept: "image/*, video/mp4",
|
|
@@ -383,7 +387,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
383
387
|
}();
|
|
384
388
|
|
|
385
389
|
reader.onerror = function (error) {
|
|
386
|
-
console.
|
|
390
|
+
console.error("dropzoneError: ", error);
|
|
387
391
|
};
|
|
388
392
|
|
|
389
393
|
reader.readAsDataURL(file);
|
|
@@ -396,10 +400,10 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
396
400
|
isDragActive = _useDropzone.isDragActive,
|
|
397
401
|
open = _useDropzone.open;
|
|
398
402
|
|
|
399
|
-
var
|
|
400
|
-
|
|
401
|
-
openChangeStatusModal =
|
|
402
|
-
setOpenChangeStatusModal =
|
|
403
|
+
var _useState55 = (0, _react.useState)(false),
|
|
404
|
+
_useState56 = (0, _slicedToArray2.default)(_useState55, 2),
|
|
405
|
+
openChangeStatusModal = _useState56[0],
|
|
406
|
+
setOpenChangeStatusModal = _useState56[1];
|
|
403
407
|
/*
|
|
404
408
|
Bandeja de activos digitales. La lista vive en el reducer de la ficha
|
|
405
409
|
(`state.assets_values`), igual que las imágenes, para que el guardado del
|
|
@@ -409,10 +413,10 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
409
413
|
*/
|
|
410
414
|
|
|
411
415
|
|
|
412
|
-
var
|
|
413
|
-
|
|
414
|
-
assetNotices =
|
|
415
|
-
setAssetNotices =
|
|
416
|
+
var _useState57 = (0, _react.useState)([]),
|
|
417
|
+
_useState58 = (0, _slicedToArray2.default)(_useState57, 2),
|
|
418
|
+
assetNotices = _useState58[0],
|
|
419
|
+
setAssetNotices = _useState58[1];
|
|
416
420
|
|
|
417
421
|
var digitalAssets = (0, _useDigitalAssets.useDigitalAssets)({
|
|
418
422
|
assets: state.assets_values,
|
|
@@ -430,10 +434,10 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
430
434
|
}
|
|
431
435
|
});
|
|
432
436
|
|
|
433
|
-
var
|
|
434
|
-
|
|
435
|
-
activeTray =
|
|
436
|
-
setActiveTray =
|
|
437
|
+
var _useState59 = (0, _react.useState)(_GalleryTrayTabs.TRAYS.IMAGES),
|
|
438
|
+
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
439
|
+
activeTray = _useState60[0],
|
|
440
|
+
setActiveTray = _useState60[1];
|
|
437
441
|
|
|
438
442
|
var currentTray = enableDigitalAssets ? activeTray : _GalleryTrayTabs.TRAYS.IMAGES;
|
|
439
443
|
/*
|
|
@@ -471,9 +475,6 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
471
475
|
_context2.prev = 0;
|
|
472
476
|
product = productSelected ? productSelected : JSON.parse(sessionStorage.getItem("productSelected"));
|
|
473
477
|
productNormalized = (0, _utils.normalizeProduct)(product);
|
|
474
|
-
console.log({
|
|
475
|
-
productNormalized: productNormalized
|
|
476
|
-
});
|
|
477
478
|
dispatch({
|
|
478
479
|
type: "SET_PRODUCT",
|
|
479
480
|
payload: productNormalized
|
|
@@ -488,10 +489,10 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
488
489
|
|
|
489
490
|
setStatusArray((0, _utils.getStatusArrayForUser)(user, productNormalized)); // Cargar usuarios y asignaciones
|
|
490
491
|
|
|
491
|
-
_context2.next =
|
|
492
|
+
_context2.next = 9;
|
|
492
493
|
return (0, _data.fetchUsers)(token);
|
|
493
494
|
|
|
494
|
-
case
|
|
495
|
+
case 9:
|
|
495
496
|
users = _context2.sent;
|
|
496
497
|
|
|
497
498
|
if (users.length > 0) {
|
|
@@ -504,30 +505,30 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
504
505
|
id_article = productNormalized.id_article;
|
|
505
506
|
|
|
506
507
|
if (!id_article) {
|
|
507
|
-
_context2.next =
|
|
508
|
+
_context2.next = 21;
|
|
508
509
|
break;
|
|
509
510
|
}
|
|
510
511
|
|
|
511
|
-
_context2.prev =
|
|
512
|
-
_context2.next =
|
|
512
|
+
_context2.prev = 13;
|
|
513
|
+
_context2.next = 16;
|
|
513
514
|
return (0, _utils.getAuditVersion)(id_article, setAuditableVersion, token);
|
|
514
515
|
|
|
515
|
-
case
|
|
516
|
-
_context2.next =
|
|
516
|
+
case 16:
|
|
517
|
+
_context2.next = 21;
|
|
517
518
|
break;
|
|
518
519
|
|
|
519
|
-
case
|
|
520
|
-
_context2.prev =
|
|
521
|
-
_context2.t0 = _context2["catch"](
|
|
520
|
+
case 18:
|
|
521
|
+
_context2.prev = 18;
|
|
522
|
+
_context2.t0 = _context2["catch"](13);
|
|
522
523
|
console.warn("No se pudo obtener la versión auditable:", _context2.t0.message);
|
|
523
524
|
|
|
524
|
-
case
|
|
525
|
+
case 21:
|
|
525
526
|
if (!(id_article && productNormalized.id_order)) {
|
|
526
|
-
_context2.next =
|
|
527
|
+
_context2.next = 27;
|
|
527
528
|
break;
|
|
528
529
|
}
|
|
529
530
|
|
|
530
|
-
_context2.next =
|
|
531
|
+
_context2.next = 24;
|
|
531
532
|
return _axios.default.get(process.env.REACT_APP_READ_OBSERVATION, {
|
|
532
533
|
params: {
|
|
533
534
|
articleId: id_article,
|
|
@@ -538,26 +539,26 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
538
539
|
}
|
|
539
540
|
});
|
|
540
541
|
|
|
541
|
-
case
|
|
542
|
+
case 24:
|
|
542
543
|
response = _context2.sent;
|
|
543
544
|
parseData = JSON.parse(response.data.body).data[0];
|
|
544
545
|
setObservation(parseData.observations);
|
|
545
546
|
|
|
546
|
-
case
|
|
547
|
-
_context2.next =
|
|
547
|
+
case 27:
|
|
548
|
+
_context2.next = 32;
|
|
548
549
|
break;
|
|
549
550
|
|
|
550
|
-
case
|
|
551
|
-
_context2.prev =
|
|
551
|
+
case 29:
|
|
552
|
+
_context2.prev = 29;
|
|
552
553
|
_context2.t1 = _context2["catch"](0);
|
|
553
|
-
console.
|
|
554
|
+
console.error("Error setting product data: ", _context2.t1);
|
|
554
555
|
|
|
555
|
-
case
|
|
556
|
+
case 32:
|
|
556
557
|
case "end":
|
|
557
558
|
return _context2.stop();
|
|
558
559
|
}
|
|
559
560
|
}
|
|
560
|
-
}, _callee2, null, [[0,
|
|
561
|
+
}, _callee2, null, [[0, 29], [13, 18]]);
|
|
561
562
|
}));
|
|
562
563
|
|
|
563
564
|
return function initializeProduct() {
|
|
@@ -772,8 +773,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
772
773
|
dispatch({
|
|
773
774
|
type: "SET_COMMENTS",
|
|
774
775
|
payload: commentsMap
|
|
775
|
-
});
|
|
776
|
-
console.log("services", services); // Ordenamiento de imágenes
|
|
776
|
+
}); // Ordenamiento de imágenes
|
|
777
777
|
|
|
778
778
|
orderMap = services[2].inputsByRetailer.flat().reduce(function (acc, item) {
|
|
779
779
|
acc[item.id_image] = item.order;
|
|
@@ -880,32 +880,32 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
880
880
|
loadAuditableData();
|
|
881
881
|
}
|
|
882
882
|
|
|
883
|
-
_context4.next =
|
|
883
|
+
_context4.next = 48;
|
|
884
884
|
break;
|
|
885
885
|
|
|
886
|
-
case
|
|
887
|
-
_context4.prev =
|
|
886
|
+
case 44:
|
|
887
|
+
_context4.prev = 44;
|
|
888
888
|
_context4.t0 = _context4["catch"](2);
|
|
889
|
-
console.
|
|
889
|
+
console.error("Error loading data: ", _context4.t0);
|
|
890
890
|
dispatch({
|
|
891
891
|
type: "SET_ERRORS",
|
|
892
892
|
payload: [_context4.t0.message]
|
|
893
893
|
});
|
|
894
894
|
|
|
895
|
-
case
|
|
896
|
-
_context4.prev =
|
|
895
|
+
case 48:
|
|
896
|
+
_context4.prev = 48;
|
|
897
897
|
dispatch({
|
|
898
898
|
type: "SET_LOADING",
|
|
899
899
|
payload: false
|
|
900
900
|
});
|
|
901
|
-
return _context4.finish(
|
|
901
|
+
return _context4.finish(48);
|
|
902
902
|
|
|
903
|
-
case
|
|
903
|
+
case 51:
|
|
904
904
|
case "end":
|
|
905
905
|
return _context4.stop();
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
|
-
}, _callee4, null, [[2,
|
|
908
|
+
}, _callee4, null, [[2, 44, 48, 51]]);
|
|
909
909
|
}));
|
|
910
910
|
|
|
911
911
|
return function loadData() {
|
|
@@ -2257,7 +2257,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
2257
2257
|
_context14.prev = 11;
|
|
2258
2258
|
|
|
2259
2259
|
if (!result) {
|
|
2260
|
-
_context14.next =
|
|
2260
|
+
_context14.next = 27;
|
|
2261
2261
|
break;
|
|
2262
2262
|
}
|
|
2263
2263
|
|
|
@@ -2274,10 +2274,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
2274
2274
|
res = _context14.sent;
|
|
2275
2275
|
newStatuses = JSON.parse(res.data.body);
|
|
2276
2276
|
serviceStatus = newStatuses.newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
2277
|
-
articleStatus = newStatuses.newArticleStatus[articleId];
|
|
2278
|
-
console.log({
|
|
2279
|
-
newStatuses: newStatuses
|
|
2280
|
-
}); // Actualizar el producto con los nuevos estados
|
|
2277
|
+
articleStatus = newStatuses.newArticleStatus[articleId]; // Actualizar el producto con los nuevos estados
|
|
2281
2278
|
|
|
2282
2279
|
updatedStatusByRetailer = state.product.statusByRetailer.map(function (item) {
|
|
2283
2280
|
return item.retailer_id === retailerId && item.service === concept ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, item), {}, {
|
|
@@ -2302,10 +2299,10 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
2302
2299
|
image: _genericModalCheck.default
|
|
2303
2300
|
}
|
|
2304
2301
|
});
|
|
2305
|
-
_context14.next =
|
|
2302
|
+
_context14.next = 32;
|
|
2306
2303
|
break;
|
|
2307
2304
|
|
|
2308
|
-
case
|
|
2305
|
+
case 27:
|
|
2309
2306
|
//Caso del botón "Enviar evaluación"
|
|
2310
2307
|
//Se construye el mensaje y se actualiza el estatus
|
|
2311
2308
|
specialistDone = ["RC", "RA", "CA"].includes(evalStatus);
|
|
@@ -2318,23 +2315,20 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
2318
2315
|
icon = _genericModalCheck.default;
|
|
2319
2316
|
}
|
|
2320
2317
|
|
|
2321
|
-
_context14.next =
|
|
2318
|
+
_context14.next = 31;
|
|
2322
2319
|
return _axios.default.put("".concat(process.env.REACT_APP_SEND_EVAL), data, {
|
|
2323
2320
|
headers: {
|
|
2324
2321
|
Authorization: token
|
|
2325
2322
|
}
|
|
2326
2323
|
});
|
|
2327
2324
|
|
|
2328
|
-
case
|
|
2325
|
+
case 31:
|
|
2329
2326
|
res = _context14.sent;
|
|
2330
2327
|
|
|
2331
|
-
case
|
|
2328
|
+
case 32:
|
|
2332
2329
|
if (res.data.statusCode === 200) {
|
|
2333
2330
|
_JSON$parse2 = JSON.parse(res.data.body), newStatus = _JSON$parse2.newStatus, newOrderStatus = _JSON$parse2.newOrderStatus, newArticleStatus = _JSON$parse2.newArticleStatus;
|
|
2334
|
-
_articleStatus = newArticleStatus[articleId];
|
|
2335
|
-
console.log({
|
|
2336
|
-
newArticleStatus: newArticleStatus
|
|
2337
|
-
}); // const retailers = state.product.categoryRetailer.map((r) => ({
|
|
2331
|
+
_articleStatus = newArticleStatus[articleId]; // const retailers = state.product.categoryRetailer.map((r) => ({
|
|
2338
2332
|
// id: r.id_retailer,
|
|
2339
2333
|
// name: r.retailerName,
|
|
2340
2334
|
// }));
|
|
@@ -2411,11 +2405,11 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
2411
2405
|
});
|
|
2412
2406
|
}
|
|
2413
2407
|
|
|
2414
|
-
_context14.next =
|
|
2408
|
+
_context14.next = 39;
|
|
2415
2409
|
break;
|
|
2416
2410
|
|
|
2417
|
-
case
|
|
2418
|
-
_context14.prev =
|
|
2411
|
+
case 35:
|
|
2412
|
+
_context14.prev = 35;
|
|
2419
2413
|
_context14.t0 = _context14["catch"](11);
|
|
2420
2414
|
console.error("Error sending evaluation:", _context14.t0);
|
|
2421
2415
|
dispatch({
|
|
@@ -2428,20 +2422,20 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
2428
2422
|
}
|
|
2429
2423
|
});
|
|
2430
2424
|
|
|
2431
|
-
case
|
|
2432
|
-
_context14.prev =
|
|
2425
|
+
case 39:
|
|
2426
|
+
_context14.prev = 39;
|
|
2433
2427
|
dispatch({
|
|
2434
2428
|
type: "SET_SAVING",
|
|
2435
2429
|
payload: false
|
|
2436
2430
|
});
|
|
2437
|
-
return _context14.finish(
|
|
2431
|
+
return _context14.finish(39);
|
|
2438
2432
|
|
|
2439
|
-
case
|
|
2433
|
+
case 42:
|
|
2440
2434
|
case "end":
|
|
2441
2435
|
return _context14.stop();
|
|
2442
2436
|
}
|
|
2443
2437
|
}
|
|
2444
|
-
}, _callee14, null, [[11,
|
|
2438
|
+
}, _callee14, null, [[11, 35, 39, 42]]);
|
|
2445
2439
|
}));
|
|
2446
2440
|
|
|
2447
2441
|
return function sendSingleEvaluation(_x4) {
|
|
@@ -2687,7 +2681,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
2687
2681
|
"Seleccionar todo" y, a partir de este, agrega o elimina todas las imágenes
|
|
2688
2682
|
del array de imágenes seleccionadas.
|
|
2689
2683
|
*/
|
|
2690
|
-
|
|
2684
|
+
// Sin uso: la selección se maneja con handleOnSetCheckAll.
|
|
2691
2685
|
};
|
|
2692
2686
|
|
|
2693
2687
|
var handleOnSubmitComment = /*#__PURE__*/function () {
|
|
@@ -2795,13 +2789,11 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
2795
2789
|
return condition6;
|
|
2796
2790
|
|
|
2797
2791
|
default:
|
|
2798
|
-
console.log("Default case - returning false");
|
|
2799
2792
|
return false;
|
|
2800
2793
|
}
|
|
2801
2794
|
};
|
|
2802
2795
|
|
|
2803
2796
|
var handleOnChangeProductVersion = function handleOnChangeProductVersion(version) {
|
|
2804
|
-
console.log("se cambia la version");
|
|
2805
2797
|
dispatch({
|
|
2806
2798
|
type: "SET_PRODUCT_VERSION",
|
|
2807
2799
|
payload: version
|
|
@@ -2809,12 +2801,6 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
2809
2801
|
loadData(true, version);
|
|
2810
2802
|
};
|
|
2811
2803
|
|
|
2812
|
-
(0, _react.useEffect)(function () {
|
|
2813
|
-
console.log({
|
|
2814
|
-
stateProduct: state.product
|
|
2815
|
-
});
|
|
2816
|
-
}, [state.product]);
|
|
2817
|
-
|
|
2818
2804
|
var handleRetryLoad = function handleRetryLoad() {
|
|
2819
2805
|
dispatch({
|
|
2820
2806
|
type: "SET_ERRORS",
|
|
@@ -530,6 +530,22 @@ var buildFixtures = function buildFixtures() {
|
|
|
530
530
|
assets: []
|
|
531
531
|
},
|
|
532
532
|
retailerWithoutInputs: []
|
|
533
|
+
}),
|
|
534
|
+
// Historial de versiones del producto (`REACT_APP_VERSIONS_ENDPOINT`).
|
|
535
|
+
versions: lambda({
|
|
536
|
+
data: [{
|
|
537
|
+
version: 1,
|
|
538
|
+
article_status: null,
|
|
539
|
+
timestamp: null
|
|
540
|
+
}, {
|
|
541
|
+
version: 2,
|
|
542
|
+
article_status: "AP",
|
|
543
|
+
timestamp: "2026-05-14T17:20:00.000Z"
|
|
544
|
+
}, {
|
|
545
|
+
version: VERSION,
|
|
546
|
+
article_status: null,
|
|
547
|
+
timestamp: "2026-08-02T15:05:00.000Z"
|
|
548
|
+
}]
|
|
533
549
|
})
|
|
534
550
|
};
|
|
535
551
|
};
|
|
@@ -124,6 +124,7 @@ var createMockAdapter = function createMockAdapter() {
|
|
|
124
124
|
if (path === "variants/family") return reply(config, fx.family);
|
|
125
125
|
if (path === "variants/group") return reply(config, fx.group);
|
|
126
126
|
if (method === "GET" && path === "services") return reply(config, fx.services);
|
|
127
|
+
if (method === "GET" && path === "versions") return reply(config, fx.versions);
|
|
127
128
|
if (path === "percentages") return reply(config, fx.percentages); // Sin versión auditable ni observación: con la API real de dev estas dos
|
|
128
129
|
// fallan por CORS, así que la pantalla ya sabe vivir sin ellas.
|
|
129
130
|
|