contentoh-components-library 21.4.16 → 21.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.development +1 -5
- package/.env.production +1 -3
- package/dist/components/atoms/Avatar/index.js +2 -3
- package/dist/components/atoms/Card/index.js +5 -46
- package/dist/components/atoms/Card/styles.js +1 -3
- package/dist/components/atoms/CheckBox/index.js +2 -7
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +120 -88
- package/dist/components/pages/ProviderProductEdition/index.js +200 -216
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +52 -56
- package/dist/components/pages/RetailerProductEdition/index.js +300 -318
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/index.js +52 -247
- package/package.json +1 -4
- package/src/components/atoms/Avatar/index.js +2 -8
- package/src/components/atoms/Card/index.js +2 -35
- package/src/components/atoms/Card/styles.js +5 -41
- package/src/components/atoms/CheckBox/index.js +1 -4
- package/src/components/atoms/CheckBox/styles.js +0 -2
- package/src/components/atoms/InputFormatter/styles.js +1 -2
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/TagAndInput/index.js +8 -10
- package/src/components/organisms/Chat/Chat.stories.js +7 -27
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
- package/src/components/organisms/Chat/ContentChat/index.js +12 -88
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +4 -46
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +127 -95
- package/src/components/pages/ProviderProductEdition/index.js +129 -135
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +52 -55
- package/src/components/pages/RetailerProductEdition/index.js +136 -124
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/index.js +0 -16
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
- package/src/components/atoms/ImageCarousel/index.js +0 -103
- package/src/components/atoms/ImageCarousel/styles.js +0 -79
- package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
- package/src/components/atoms/PercentTag/index.js +0 -9
- package/src/components/atoms/PercentTag/styles.js +0 -69
- package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
- package/src/components/atoms/RatingStars/index.js +0 -31
- package/src/components/atoms/RatingStars/styles.js +0 -28
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
- package/src/components/atoms/RetailerCatalog/index.js +0 -49
- package/src/components/atoms/RetailerCatalog/styles.js +0 -30
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
- package/src/components/atoms/RetailerOption/index.js +0 -53
- package/src/components/atoms/RetailerOption/styles.js +0 -41
- package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
- package/src/components/atoms/RetailersList/index.js +0 -20
- package/src/components/atoms/RetailersList/styles.js +0 -19
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
- package/src/components/atoms/UserCatalog/index.js +0 -100
- package/src/components/atoms/UserCatalog/styles.js +0 -24
- package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
- package/src/components/atoms/UserOption/index.js +0 -95
- package/src/components/atoms/UserOption/styles.js +0 -61
- package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
- package/src/components/atoms/UserSelector/index.js +0 -86
- package/src/components/atoms/UserSelector/styles.js +0 -55
- package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
- package/src/components/molecules/GridItem/index.js +0 -105
- package/src/components/molecules/GridItem/styles.js +0 -104
- package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
- package/src/components/molecules/HeaderItem/index.js +0 -26
- package/src/components/molecules/HeaderItem/styles.js +0 -27
- package/src/components/molecules/RowItem/ColumnItem.js +0 -9
- package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
- package/src/components/molecules/RowItem/index.js +0 -45
- package/src/components/molecules/RowItem/styles.js +0 -40
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
- package/src/components/molecules/StripeCardForm/index.js +0 -42
- package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
- package/src/components/molecules/StripeCardForm/styles.js +0 -73
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
- package/src/components/molecules/StripeCardSelector/index.js +0 -44
- package/src/components/molecules/StripeCardSelector/styles.js +0 -4
- package/src/components/molecules/StripeCardSelector/utils.js +0 -17
- package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
- package/src/components/organisms/GridProducts/index.js +0 -50
- package/src/components/organisms/GridProducts/styles.js +0 -14
- package/src/components/organisms/GridProducts/utils.js +0 -111
- package/src/components/organisms/PanelLayout/PanelLayout.stories.js +0 -63
- package/src/components/organisms/PanelLayout/index.js +0 -11
- package/src/components/organisms/PanelLayout/styles.js +0 -33
- package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
- package/src/components/organisms/SideModal/index.js +0 -50
- package/src/components/organisms/SideModal/styles.js +0 -30
|
@@ -37,7 +37,7 @@ var _GalleryElement = require("../../molecules/GalleryElement");
|
|
|
37
37
|
|
|
38
38
|
var _fileSaver = require("file-saver");
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _data = require("../../../global-files/data");
|
|
41
41
|
|
|
42
42
|
var _GalleryHeader = require("../../molecules/GalleryHeader");
|
|
43
43
|
|
|
@@ -61,6 +61,8 @@ var _index = require("../../molecules/TagAndInput/index");
|
|
|
61
61
|
|
|
62
62
|
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
63
63
|
|
|
64
|
+
var _Commentary = require("../../atoms/Commentary");
|
|
65
|
+
|
|
64
66
|
var _GenericModal = require("../../atoms/GenericModal");
|
|
65
67
|
|
|
66
68
|
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
@@ -69,16 +71,14 @@ var _Loading = require("../../atoms/Loading");
|
|
|
69
71
|
|
|
70
72
|
var _genericModalCheck = _interopRequireDefault(require("../../../assets/images/genericModal/genericModalCheck.svg"));
|
|
71
73
|
|
|
74
|
+
var _errorModal = _interopRequireDefault(require("../../../assets/images/genericModal/errorModal.svg"));
|
|
75
|
+
|
|
72
76
|
var _VersionSelector = require("../../organisms/VersionSelector");
|
|
73
77
|
|
|
74
78
|
var _customHooks = require("../../../global-files/customHooks");
|
|
75
79
|
|
|
76
80
|
var _utils = require("./utils");
|
|
77
81
|
|
|
78
|
-
var _Modal = require("../../organisms/Modal");
|
|
79
|
-
|
|
80
|
-
var _ButtonV = require("../../atoms/ButtonV2");
|
|
81
|
-
|
|
82
82
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
83
83
|
|
|
84
84
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -202,7 +202,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
205
|
-
var _product$retailers, _location$state,
|
|
205
|
+
var _product$retailers, _location$state, _product$services2, _datasheets$, _datasheets$$data, _product$article18, _comment$message;
|
|
206
206
|
|
|
207
207
|
var tabsSections = _ref.tabsSections,
|
|
208
208
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -252,11 +252,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
252
252
|
showModal = _useState14[0],
|
|
253
253
|
setShowModal = _useState14[1];
|
|
254
254
|
|
|
255
|
-
var _useState15 = (0, _react.useState)(false),
|
|
256
|
-
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
257
|
-
showRejectModal = _useState16[0],
|
|
258
|
-
setShowRejectModal = _useState16[1];
|
|
259
|
-
|
|
260
255
|
var _useDropzone = (0, _reactDropzone.useDropzone)({
|
|
261
256
|
accept: "image/*",
|
|
262
257
|
noKeyboard: true,
|
|
@@ -301,149 +296,149 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
301
296
|
getRootProps = _useDropzone.getRootProps,
|
|
302
297
|
getInputProps = _useDropzone.getInputProps;
|
|
303
298
|
|
|
299
|
+
var _useState15 = (0, _react.useState)([]),
|
|
300
|
+
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
301
|
+
updatedDatasheets = _useState16[0],
|
|
302
|
+
setUpdatedDatasheets = _useState16[1];
|
|
303
|
+
|
|
304
304
|
var _useState17 = (0, _react.useState)([]),
|
|
305
305
|
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
updatedDescriptions = _useState18[0],
|
|
307
|
+
setUpdatedDescriptions = _useState18[1];
|
|
308
308
|
|
|
309
|
-
var _useState19 = (0, _react.useState)(
|
|
309
|
+
var _useState19 = (0, _react.useState)(false),
|
|
310
310
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
imagesUploaded = _useState20[0],
|
|
312
|
+
setImagesUploaded = _useState20[1];
|
|
313
313
|
|
|
314
|
-
var _useState21 = (0, _react.useState)(
|
|
314
|
+
var _useState21 = (0, _react.useState)(),
|
|
315
315
|
_useState22 = (0, _slicedToArray2.default)(_useState21, 2),
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
var _useState23 = (0, _react.useState)(),
|
|
320
|
-
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
321
|
-
dataImages = _useState24[0],
|
|
322
|
-
setDataImages = _useState24[1];
|
|
316
|
+
dataImages = _useState22[0],
|
|
317
|
+
setDataImages = _useState22[1];
|
|
323
318
|
|
|
324
|
-
var
|
|
319
|
+
var _useState23 = (0, _react.useState)(new Array(product === null || product === void 0 ? void 0 : (_product$retailers = product.retailers) === null || _product$retailers === void 0 ? void 0 : _product$retailers.length).fill({
|
|
325
320
|
percentage: 0
|
|
326
321
|
})),
|
|
327
|
-
|
|
328
|
-
percentages =
|
|
329
|
-
setPercentages =
|
|
322
|
+
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
323
|
+
percentages = _useState24[0],
|
|
324
|
+
setPercentages = _useState24[1]; // const [percentages, setPercentages] = useState([{ retailers: {} }]);
|
|
330
325
|
|
|
331
326
|
|
|
332
|
-
var
|
|
327
|
+
var _useState25 = (0, _react.useState)(0),
|
|
328
|
+
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
329
|
+
activePercentage = _useState26[0],
|
|
330
|
+
setActivePercentage = _useState26[1];
|
|
331
|
+
|
|
332
|
+
var _useState27 = (0, _react.useState)({}),
|
|
333
333
|
_useState28 = (0, _slicedToArray2.default)(_useState27, 2),
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
activeRetailer = _useState28[0],
|
|
335
|
+
setActiveRetailer = _useState28[1];
|
|
336
336
|
|
|
337
|
-
var _useState29 = (0, _react.useState)(
|
|
337
|
+
var _useState29 = (0, _react.useState)([]),
|
|
338
338
|
_useState30 = (0, _slicedToArray2.default)(_useState29, 2),
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
services = _useState30[0],
|
|
340
|
+
setServices = _useState30[1];
|
|
341
341
|
|
|
342
342
|
var _useState31 = (0, _react.useState)([]),
|
|
343
343
|
_useState32 = (0, _slicedToArray2.default)(_useState31, 2),
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
servicesData = _useState32[0],
|
|
345
|
+
setServicesData = _useState32[1];
|
|
346
346
|
|
|
347
|
-
var _useState33 = (0, _react.useState)(
|
|
347
|
+
var _useState33 = (0, _react.useState)(""),
|
|
348
348
|
_useState34 = (0, _slicedToArray2.default)(_useState33, 2),
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
message = _useState34[0],
|
|
350
|
+
setMessage = _useState34[1];
|
|
351
351
|
|
|
352
|
-
var _useState35 = (0, _react.useState)(""),
|
|
352
|
+
var _useState35 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
|
|
353
353
|
_useState36 = (0, _slicedToArray2.default)(_useState35, 2),
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
product = _useState36[0],
|
|
355
|
+
setProduct = _useState36[1];
|
|
356
356
|
|
|
357
|
-
var _useState37 = (0, _react.useState)(
|
|
357
|
+
var _useState37 = (0, _react.useState)(null),
|
|
358
358
|
_useState38 = (0, _slicedToArray2.default)(_useState37, 2),
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
icon = _useState38[0],
|
|
360
|
+
setIcon = _useState38[1];
|
|
361
361
|
|
|
362
|
-
var _useState39 = (0, _react.useState)(null),
|
|
362
|
+
var _useState39 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
|
|
363
363
|
_useState40 = (0, _slicedToArray2.default)(_useState39, 2),
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
version = _useState40[0],
|
|
365
|
+
setVersion = _useState40[1];
|
|
366
366
|
|
|
367
|
-
var _useState41 = (0, _react.useState)(
|
|
367
|
+
var _useState41 = (0, _react.useState)({}),
|
|
368
368
|
_useState42 = (0, _slicedToArray2.default)(_useState41, 2),
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
comments = _useState42[0],
|
|
370
|
+
setComments = _useState42[1];
|
|
371
371
|
|
|
372
|
-
var _useState43 = (0, _react.useState)(
|
|
372
|
+
var _useState43 = (0, _react.useState)(""),
|
|
373
373
|
_useState44 = (0, _slicedToArray2.default)(_useState43, 2),
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
var _useState45 = (0, _react.useState)(""),
|
|
378
|
-
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
379
|
-
comment = _useState46[0],
|
|
380
|
-
setComment = _useState46[1];
|
|
374
|
+
comment = _useState44[0],
|
|
375
|
+
setComment = _useState44[1];
|
|
381
376
|
|
|
382
|
-
var
|
|
377
|
+
var _useState45 = (0, _react.useState)({
|
|
383
378
|
"Ficha técnica": 0,
|
|
384
379
|
Descripción: 0,
|
|
385
380
|
Imágenes: 0
|
|
386
381
|
}),
|
|
382
|
+
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
383
|
+
requiredNull = _useState46[0],
|
|
384
|
+
setRequiredNull = _useState46[1];
|
|
385
|
+
|
|
386
|
+
var _useState47 = (0, _react.useState)(false),
|
|
387
387
|
_useState48 = (0, _slicedToArray2.default)(_useState47, 2),
|
|
388
|
-
|
|
389
|
-
|
|
388
|
+
crossComment = _useState48[0],
|
|
389
|
+
setCrossComment = _useState48[1];
|
|
390
390
|
|
|
391
|
-
var _useState49 = (0, _react.useState)(
|
|
391
|
+
var _useState49 = (0, _react.useState)([]),
|
|
392
392
|
_useState50 = (0, _slicedToArray2.default)(_useState49, 2),
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
userGroups = _useState50[0],
|
|
394
|
+
setUserGroups = _useState50[1];
|
|
395
395
|
|
|
396
|
-
var _useState51 = (0, _react.useState)(
|
|
396
|
+
var _useState51 = (0, _react.useState)({}),
|
|
397
397
|
_useState52 = (0, _slicedToArray2.default)(_useState51, 2),
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
assig = _useState52[0],
|
|
399
|
+
setAssig = _useState52[1];
|
|
400
400
|
|
|
401
|
-
var _useState53 = (0, _react.useState)(
|
|
401
|
+
var _useState53 = (0, _react.useState)([]),
|
|
402
402
|
_useState54 = (0, _slicedToArray2.default)(_useState53, 2),
|
|
403
|
-
|
|
404
|
-
|
|
403
|
+
selectedImages = _useState54[0],
|
|
404
|
+
setSelectedImages = _useState54[1];
|
|
405
405
|
|
|
406
406
|
var _useState55 = (0, _react.useState)([]),
|
|
407
407
|
_useState56 = (0, _slicedToArray2.default)(_useState55, 2),
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
componentsArray = _useState56[0],
|
|
409
|
+
setComponentsArray = _useState56[1];
|
|
410
410
|
|
|
411
|
-
var _useState57 = (0, _react.useState)(
|
|
411
|
+
var _useState57 = (0, _react.useState)(false),
|
|
412
412
|
_useState58 = (0, _slicedToArray2.default)(_useState57, 2),
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
var _useState59 = (0, _react.useState)(false),
|
|
417
|
-
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
418
|
-
checkAll = _useState60[0],
|
|
419
|
-
setCheckAll = _useState60[1];
|
|
413
|
+
checkAll = _useState58[0],
|
|
414
|
+
setCheckAll = _useState58[1];
|
|
420
415
|
|
|
421
416
|
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
422
417
|
|
|
423
|
-
var
|
|
418
|
+
var _useState59 = (0, _react.useState)(true),
|
|
419
|
+
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
420
|
+
loading = _useState60[0],
|
|
421
|
+
setLoading = _useState60[1];
|
|
422
|
+
|
|
423
|
+
var _useState61 = (0, _react.useState)("-"),
|
|
424
424
|
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
retailerStatus = _useState62[0],
|
|
426
|
+
setRetailerStatus = _useState62[1];
|
|
427
427
|
|
|
428
|
-
var _useState63 = (0, _react.useState)(
|
|
428
|
+
var _useState63 = (0, _react.useState)([]),
|
|
429
429
|
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
statusArray = _useState64[0],
|
|
431
|
+
setStatusArray = _useState64[1];
|
|
432
432
|
|
|
433
|
-
var _useState65 = (0, _react.useState)(
|
|
433
|
+
var _useState65 = (0, _react.useState)(null),
|
|
434
434
|
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
socketType = _useState66[0],
|
|
436
|
+
setSocketType = _useState66[1];
|
|
437
437
|
|
|
438
|
-
var _useState67 = (0, _react.useState)(
|
|
438
|
+
var _useState67 = (0, _react.useState)(loading),
|
|
439
439
|
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
var _useState69 = (0, _react.useState)(loading),
|
|
444
|
-
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
445
|
-
saving = _useState70[0],
|
|
446
|
-
setSaving = _useState70[1];
|
|
440
|
+
saving = _useState68[0],
|
|
441
|
+
setSaving = _useState68[1];
|
|
447
442
|
|
|
448
443
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
449
444
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
@@ -452,55 +447,35 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
452
447
|
|
|
453
448
|
var shotThd = [58, 59, 60, 61].includes(activeRetailer.id);
|
|
454
449
|
|
|
455
|
-
var
|
|
450
|
+
var _useState69 = (0, _react.useState)(null),
|
|
451
|
+
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
452
|
+
auditableVersion = _useState70[0],
|
|
453
|
+
setAuditableVersion = _useState70[1];
|
|
454
|
+
|
|
455
|
+
var _useState71 = (0, _react.useState)([]),
|
|
456
456
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
auditServices = _useState72[0],
|
|
458
|
+
setAuditServices = _useState72[1];
|
|
459
459
|
|
|
460
460
|
var _useState73 = (0, _react.useState)([]),
|
|
461
461
|
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
462
|
-
|
|
463
|
-
|
|
462
|
+
auditDatasheets = _useState74[0],
|
|
463
|
+
setAuditDatasheets = _useState74[1];
|
|
464
464
|
|
|
465
465
|
var _useState75 = (0, _react.useState)([]),
|
|
466
466
|
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
auditDescriptions = _useState76[0],
|
|
468
|
+
setAuditDescriptions = _useState76[1];
|
|
469
469
|
|
|
470
470
|
var _useState77 = (0, _react.useState)([]),
|
|
471
471
|
_useState78 = (0, _slicedToArray2.default)(_useState77, 2),
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
auditImages = _useState78[0],
|
|
473
|
+
setAuditImages = _useState78[1];
|
|
474
474
|
|
|
475
|
-
var _useState79 = (0, _react.useState)(
|
|
475
|
+
var _useState79 = (0, _react.useState)(false),
|
|
476
476
|
_useState80 = (0, _slicedToArray2.default)(_useState79, 2),
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
var _useState81 = (0, _react.useState)(false),
|
|
481
|
-
_useState82 = (0, _slicedToArray2.default)(_useState81, 2),
|
|
482
|
-
compare = _useState82[0],
|
|
483
|
-
setCompare = _useState82[1];
|
|
484
|
-
|
|
485
|
-
var _useState83 = (0, _react.useState)(false),
|
|
486
|
-
_useState84 = (0, _slicedToArray2.default)(_useState83, 2),
|
|
487
|
-
valRejAll = _useState84[0],
|
|
488
|
-
setValRejAll = _useState84[1];
|
|
489
|
-
|
|
490
|
-
var _useState85 = (0, _react.useState)([]),
|
|
491
|
-
_useState86 = (0, _slicedToArray2.default)(_useState85, 2),
|
|
492
|
-
desc = _useState86[0],
|
|
493
|
-
setDesc = _useState86[1];
|
|
494
|
-
|
|
495
|
-
var _useState87 = (0, _react.useState)([]),
|
|
496
|
-
_useState88 = (0, _slicedToArray2.default)(_useState87, 2),
|
|
497
|
-
fich = _useState88[0],
|
|
498
|
-
setFich = _useState88[1];
|
|
499
|
-
|
|
500
|
-
var _useState89 = (0, _react.useState)([]),
|
|
501
|
-
_useState90 = (0, _slicedToArray2.default)(_useState89, 2),
|
|
502
|
-
imag = _useState90[0],
|
|
503
|
-
setImag = _useState90[1];
|
|
477
|
+
compare = _useState80[0],
|
|
478
|
+
setCompare = _useState80[1];
|
|
504
479
|
|
|
505
480
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
506
481
|
var _ref3, id_article;
|
|
@@ -541,7 +516,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
541
516
|
}
|
|
542
517
|
|
|
543
518
|
_context2.next = 3;
|
|
544
|
-
return (0,
|
|
519
|
+
return (0, _data.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article, product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category), auditableVersion.version);
|
|
545
520
|
|
|
546
521
|
case 3:
|
|
547
522
|
_auditServices = _context2.sent;
|
|
@@ -581,7 +556,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
581
556
|
case 0:
|
|
582
557
|
_context3.prev = 0;
|
|
583
558
|
_context3.next = 3;
|
|
584
|
-
return (0,
|
|
559
|
+
return (0, _data.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article, product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article6 = product.article) === null || _product$article6 === void 0 ? void 0 : _product$article6.id_category), version);
|
|
585
560
|
|
|
586
561
|
case 3:
|
|
587
562
|
_services = _context3.sent;
|
|
@@ -598,7 +573,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
598
573
|
init: _services[2]
|
|
599
574
|
});
|
|
600
575
|
if (((_services$ = _services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
|
|
601
|
-
(0,
|
|
576
|
+
(0, _data.getPercentage)({
|
|
602
577
|
data: [product]
|
|
603
578
|
}).then(function (res) {
|
|
604
579
|
return setPercentages(res[0]);
|
|
@@ -723,7 +698,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
723
698
|
getComments();
|
|
724
699
|
_context6.t0 = setUserGroups;
|
|
725
700
|
_context6.next = 6;
|
|
726
|
-
return (0,
|
|
701
|
+
return (0, _data.fetchUsers)(token);
|
|
727
702
|
|
|
728
703
|
case 6:
|
|
729
704
|
_context6.t1 = _context6.sent;
|
|
@@ -891,7 +866,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
891
866
|
});
|
|
892
867
|
|
|
893
868
|
if (!(dataClean.length > 0)) {
|
|
894
|
-
_context7.next =
|
|
869
|
+
_context7.next = 25;
|
|
895
870
|
break;
|
|
896
871
|
}
|
|
897
872
|
|
|
@@ -915,7 +890,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
915
890
|
res = _context7.sent;
|
|
916
891
|
|
|
917
892
|
if (!(res.data.statusCode === 200)) {
|
|
918
|
-
_context7.next =
|
|
893
|
+
_context7.next = 20;
|
|
919
894
|
break;
|
|
920
895
|
}
|
|
921
896
|
|
|
@@ -924,26 +899,25 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
924
899
|
if (newStatus) productTemp.description_status = newStatus;
|
|
925
900
|
setProduct(productTemp);
|
|
926
901
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
927
|
-
setUpdatedDescriptions([]);
|
|
928
902
|
setMessage("Descripciones guardadas con éxito");
|
|
929
|
-
_context7.next =
|
|
903
|
+
_context7.next = 20;
|
|
930
904
|
return loadData();
|
|
931
905
|
|
|
932
|
-
case
|
|
933
|
-
_context7.next =
|
|
906
|
+
case 20:
|
|
907
|
+
_context7.next = 25;
|
|
934
908
|
break;
|
|
935
909
|
|
|
936
|
-
case
|
|
937
|
-
_context7.prev =
|
|
910
|
+
case 22:
|
|
911
|
+
_context7.prev = 22;
|
|
938
912
|
_context7.t0 = _context7["catch"](7);
|
|
939
913
|
console.log(_context7.t0);
|
|
940
914
|
|
|
941
|
-
case
|
|
915
|
+
case 25:
|
|
942
916
|
case "end":
|
|
943
917
|
return _context7.stop();
|
|
944
918
|
}
|
|
945
919
|
}
|
|
946
|
-
}, _callee7, null, [[7,
|
|
920
|
+
}, _callee7, null, [[7, 22]]);
|
|
947
921
|
}));
|
|
948
922
|
|
|
949
923
|
return function saveDescriptions() {
|
|
@@ -964,7 +938,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
964
938
|
});
|
|
965
939
|
|
|
966
940
|
if (!(dataClean.length > 0)) {
|
|
967
|
-
_context8.next =
|
|
941
|
+
_context8.next = 25;
|
|
968
942
|
break;
|
|
969
943
|
}
|
|
970
944
|
|
|
@@ -988,7 +962,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
988
962
|
res = _context8.sent;
|
|
989
963
|
|
|
990
964
|
if (!(res.data.statusCode === 200)) {
|
|
991
|
-
_context8.next =
|
|
965
|
+
_context8.next = 20;
|
|
992
966
|
break;
|
|
993
967
|
}
|
|
994
968
|
|
|
@@ -997,26 +971,25 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
997
971
|
if (newStatus) productTemp.datasheet_status = newStatus;
|
|
998
972
|
setProduct(productTemp);
|
|
999
973
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1000
|
-
setUpdatedDatasheets([]);
|
|
1001
974
|
setMessage("Fichas técnicas guardadas");
|
|
1002
|
-
_context8.next =
|
|
975
|
+
_context8.next = 20;
|
|
1003
976
|
return loadData();
|
|
1004
977
|
|
|
1005
|
-
case
|
|
1006
|
-
_context8.next =
|
|
978
|
+
case 20:
|
|
979
|
+
_context8.next = 25;
|
|
1007
980
|
break;
|
|
1008
981
|
|
|
1009
|
-
case
|
|
1010
|
-
_context8.prev =
|
|
982
|
+
case 22:
|
|
983
|
+
_context8.prev = 22;
|
|
1011
984
|
_context8.t0 = _context8["catch"](7);
|
|
1012
985
|
console.log(_context8.t0);
|
|
1013
986
|
|
|
1014
|
-
case
|
|
987
|
+
case 25:
|
|
1015
988
|
case "end":
|
|
1016
989
|
return _context8.stop();
|
|
1017
990
|
}
|
|
1018
991
|
}
|
|
1019
|
-
}, _callee8, null, [[7,
|
|
992
|
+
}, _callee8, null, [[7, 22]]);
|
|
1020
993
|
}));
|
|
1021
994
|
|
|
1022
995
|
return function saveDatasheets() {
|
|
@@ -1040,7 +1013,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1040
1013
|
};
|
|
1041
1014
|
});
|
|
1042
1015
|
setSocketType(imageInputs);
|
|
1043
|
-
console.log(images);
|
|
1044
1016
|
}, [images]);
|
|
1045
1017
|
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
1046
1018
|
var _images$values3, _images$attrForImgs, _product$article14, _data$articleData, _data$articleData2, _data$updateImages;
|
|
@@ -1168,7 +1140,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1168
1140
|
switch (_context10.prev = _context10.next) {
|
|
1169
1141
|
case 0:
|
|
1170
1142
|
if (!imagesUploaded) {
|
|
1171
|
-
_context10.next =
|
|
1143
|
+
_context10.next = 22;
|
|
1172
1144
|
break;
|
|
1173
1145
|
}
|
|
1174
1146
|
|
|
@@ -1192,7 +1164,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1192
1164
|
res = _context10.sent;
|
|
1193
1165
|
|
|
1194
1166
|
if (!(res.data.statusCode === 200)) {
|
|
1195
|
-
_context10.next =
|
|
1167
|
+
_context10.next = 17;
|
|
1196
1168
|
break;
|
|
1197
1169
|
}
|
|
1198
1170
|
|
|
@@ -1202,27 +1174,26 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1202
1174
|
if (newStatus) productTemp.images_status = newStatus;
|
|
1203
1175
|
setProduct(productTemp);
|
|
1204
1176
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1205
|
-
setImages({});
|
|
1206
1177
|
setMessage("Imágenes guardadas con éxito");
|
|
1207
1178
|
sessionStorage.removeItem("imagesList");
|
|
1208
|
-
_context10.next =
|
|
1179
|
+
_context10.next = 17;
|
|
1209
1180
|
return loadData();
|
|
1210
1181
|
|
|
1211
|
-
case
|
|
1212
|
-
_context10.next =
|
|
1182
|
+
case 17:
|
|
1183
|
+
_context10.next = 22;
|
|
1213
1184
|
break;
|
|
1214
1185
|
|
|
1215
|
-
case
|
|
1216
|
-
_context10.prev =
|
|
1186
|
+
case 19:
|
|
1187
|
+
_context10.prev = 19;
|
|
1217
1188
|
_context10.t0 = _context10["catch"](2);
|
|
1218
1189
|
console.log(_context10.t0);
|
|
1219
1190
|
|
|
1220
|
-
case
|
|
1191
|
+
case 22:
|
|
1221
1192
|
case "end":
|
|
1222
1193
|
return _context10.stop();
|
|
1223
1194
|
}
|
|
1224
1195
|
}
|
|
1225
|
-
}, _callee10, null, [[2,
|
|
1196
|
+
}, _callee10, null, [[2, 19]]);
|
|
1226
1197
|
})), [dataImages, imagesUploaded]);
|
|
1227
1198
|
|
|
1228
1199
|
var evaluationFinished = function evaluationFinished(userId, tab, statusArray) {
|
|
@@ -1347,7 +1318,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1347
1318
|
|
|
1348
1319
|
var sendToFacilitator = /*#__PURE__*/function () {
|
|
1349
1320
|
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
|
|
1350
|
-
var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus
|
|
1321
|
+
var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
|
|
1351
1322
|
|
|
1352
1323
|
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1353
1324
|
while (1) {
|
|
@@ -1410,59 +1381,39 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1410
1381
|
|
|
1411
1382
|
case 21:
|
|
1412
1383
|
if (!(res.data.statusCode === 200)) {
|
|
1413
|
-
_context11.next =
|
|
1384
|
+
_context11.next = 30;
|
|
1414
1385
|
break;
|
|
1415
1386
|
}
|
|
1416
1387
|
|
|
1417
1388
|
_JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
|
|
1418
|
-
messageToChat = (0, _utils.createMessage)(product.retailers, activeRetailer.id, evalStatus, newStatus, activeTab);
|
|
1419
|
-
_data = {
|
|
1420
|
-
paramsBody: {
|
|
1421
|
-
id: product.article.id_article,
|
|
1422
|
-
version: version,
|
|
1423
|
-
items: [{
|
|
1424
|
-
type: "status",
|
|
1425
|
-
value: messageToChat
|
|
1426
|
-
}],
|
|
1427
|
-
retailerId: activeRetailer.id,
|
|
1428
|
-
status: product.status
|
|
1429
|
-
},
|
|
1430
|
-
paramsHeader: {
|
|
1431
|
-
Authorization: token
|
|
1432
|
-
}
|
|
1433
|
-
};
|
|
1434
|
-
_context11.next = 27;
|
|
1435
|
-
return (0, _utils.sendMessage)(_data);
|
|
1436
|
-
|
|
1437
|
-
case 27:
|
|
1438
1389
|
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
1439
1390
|
productTemp["".concat(concept, "_status")] = newStatus;
|
|
1440
|
-
_context11.next =
|
|
1391
|
+
_context11.next = 27;
|
|
1441
1392
|
return loadData();
|
|
1442
1393
|
|
|
1443
|
-
case
|
|
1394
|
+
case 27:
|
|
1444
1395
|
if (_message) setMessage(_message);
|
|
1445
1396
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1446
1397
|
setProduct(productTemp);
|
|
1447
1398
|
|
|
1448
|
-
case
|
|
1449
|
-
_context11.next =
|
|
1399
|
+
case 30:
|
|
1400
|
+
_context11.next = 35;
|
|
1450
1401
|
break;
|
|
1451
1402
|
|
|
1452
|
-
case
|
|
1453
|
-
_context11.prev =
|
|
1403
|
+
case 32:
|
|
1404
|
+
_context11.prev = 32;
|
|
1454
1405
|
_context11.t0 = _context11["catch"](1);
|
|
1455
1406
|
console.log(_context11.t0);
|
|
1456
1407
|
|
|
1457
|
-
case
|
|
1408
|
+
case 35:
|
|
1458
1409
|
setLoading(false);
|
|
1459
1410
|
|
|
1460
|
-
case
|
|
1411
|
+
case 36:
|
|
1461
1412
|
case "end":
|
|
1462
1413
|
return _context11.stop();
|
|
1463
1414
|
}
|
|
1464
1415
|
}
|
|
1465
|
-
}, _callee11, null, [[1,
|
|
1416
|
+
}, _callee11, null, [[1, 32]]);
|
|
1466
1417
|
}));
|
|
1467
1418
|
|
|
1468
1419
|
return function sendToFacilitator(_x) {
|
|
@@ -1497,33 +1448,55 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1497
1448
|
};
|
|
1498
1449
|
|
|
1499
1450
|
var createComment = /*#__PURE__*/function () {
|
|
1500
|
-
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1501
|
-
var
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
_args12 = arguments;
|
|
1451
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(e, body, tab) {
|
|
1452
|
+
var _product$article16;
|
|
1453
|
+
|
|
1454
|
+
var concept, data;
|
|
1505
1455
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1506
1456
|
while (1) {
|
|
1507
1457
|
switch (_context12.prev = _context12.next) {
|
|
1508
1458
|
case 0:
|
|
1509
|
-
|
|
1510
|
-
|
|
1459
|
+
concept = "";
|
|
1460
|
+
_context12.t0 = activeTab;
|
|
1461
|
+
_context12.next = _context12.t0 === "Ficha técnica" ? 4 : _context12.t0 === "Imágenes" ? 6 : 8;
|
|
1462
|
+
break;
|
|
1463
|
+
|
|
1464
|
+
case 4:
|
|
1465
|
+
concept = "datasheet";
|
|
1466
|
+
return _context12.abrupt("break", 10);
|
|
1467
|
+
|
|
1468
|
+
case 6:
|
|
1469
|
+
concept = "images";
|
|
1470
|
+
return _context12.abrupt("break", 10);
|
|
1471
|
+
|
|
1472
|
+
case 8:
|
|
1473
|
+
concept = "description";
|
|
1474
|
+
return _context12.abrupt("break", 10);
|
|
1475
|
+
|
|
1476
|
+
case 10:
|
|
1511
1477
|
data = {
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1478
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article16 = product.article) === null || _product$article16 === void 0 ? void 0 : _product$article16.id_article,
|
|
1479
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1480
|
+
message: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, ""),
|
|
1481
|
+
concept: concept,
|
|
1482
|
+
version: version
|
|
1483
|
+
};
|
|
1484
|
+
_context12.next = 13;
|
|
1485
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1486
|
+
headers: {
|
|
1520
1487
|
Authorization: token
|
|
1521
1488
|
}
|
|
1522
|
-
};
|
|
1489
|
+
});
|
|
1490
|
+
|
|
1491
|
+
case 13:
|
|
1492
|
+
_context12.next = 15;
|
|
1493
|
+
return getComments(tab);
|
|
1494
|
+
|
|
1495
|
+
case 15:
|
|
1523
1496
|
setMessage("");
|
|
1524
|
-
|
|
1497
|
+
setComponentsArray([]);
|
|
1525
1498
|
|
|
1526
|
-
case
|
|
1499
|
+
case 17:
|
|
1527
1500
|
case "end":
|
|
1528
1501
|
return _context12.stop();
|
|
1529
1502
|
}
|
|
@@ -1531,7 +1504,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1531
1504
|
}, _callee12);
|
|
1532
1505
|
}));
|
|
1533
1506
|
|
|
1534
|
-
return function createComment() {
|
|
1507
|
+
return function createComment(_x2, _x3, _x4) {
|
|
1535
1508
|
return _ref15.apply(this, arguments);
|
|
1536
1509
|
};
|
|
1537
1510
|
}();
|
|
@@ -1646,7 +1619,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1646
1619
|
|
|
1647
1620
|
var setAssignation = /*#__PURE__*/function () {
|
|
1648
1621
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
|
|
1649
|
-
var _product$
|
|
1622
|
+
var _product$article17;
|
|
1650
1623
|
|
|
1651
1624
|
var concept, productTemp, data;
|
|
1652
1625
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
@@ -1676,7 +1649,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1676
1649
|
data = {
|
|
1677
1650
|
articleList: [{
|
|
1678
1651
|
orderId: product.orderId,
|
|
1679
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
1652
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article17 = product.article) === null || _product$article17 === void 0 ? void 0 : _product$article17.id_article
|
|
1680
1653
|
}],
|
|
1681
1654
|
concept: concept,
|
|
1682
1655
|
userId: assignationId
|
|
@@ -1703,7 +1676,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1703
1676
|
}, _callee14);
|
|
1704
1677
|
}));
|
|
1705
1678
|
|
|
1706
|
-
return function setAssignation(
|
|
1679
|
+
return function setAssignation(_x5, _x6) {
|
|
1707
1680
|
return _ref17.apply(this, arguments);
|
|
1708
1681
|
};
|
|
1709
1682
|
}();
|
|
@@ -1805,7 +1778,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1805
1778
|
};
|
|
1806
1779
|
|
|
1807
1780
|
(0, _react.useEffect)(function () {
|
|
1808
|
-
console.log(servicesData, "servicesData");
|
|
1809
1781
|
var status = getRetailerStatus(servicesData, activeTab);
|
|
1810
1782
|
setRetailerStatus(status);
|
|
1811
1783
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1818,7 +1790,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1818
1790
|
|
|
1819
1791
|
var validateAll = /*#__PURE__*/function () {
|
|
1820
1792
|
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(result) {
|
|
1821
|
-
var evaluationArray, conceptArray,
|
|
1793
|
+
var evaluationArray, conceptArray, productTemp;
|
|
1822
1794
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1823
1795
|
while (1) {
|
|
1824
1796
|
switch (_context15.prev = _context15.next) {
|
|
@@ -1844,7 +1816,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1844
1816
|
return _context15.abrupt("break", 13);
|
|
1845
1817
|
|
|
1846
1818
|
case 13:
|
|
1847
|
-
messages = [];
|
|
1848
1819
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1849
1820
|
if (conceptArray.includes(ret.service)) {
|
|
1850
1821
|
var _product$id_order;
|
|
@@ -1857,16 +1828,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1857
1828
|
evalStatus: ret.status,
|
|
1858
1829
|
retailerId: ret.id_retailer
|
|
1859
1830
|
};
|
|
1860
|
-
|
|
1861
|
-
if (product["".concat(ret.service, "_status")] !== "NS") {
|
|
1862
|
-
var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
|
|
1863
|
-
|
|
1864
|
-
messages.push(createComment([{
|
|
1865
|
-
type: "status",
|
|
1866
|
-
value: _message2
|
|
1867
|
-
}], ret.id_retailer));
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
1831
|
evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1871
1832
|
headers: {
|
|
1872
1833
|
Authorization: token
|
|
@@ -1874,43 +1835,38 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1874
1835
|
}));
|
|
1875
1836
|
}
|
|
1876
1837
|
});
|
|
1877
|
-
_context15.next =
|
|
1838
|
+
_context15.next = 16;
|
|
1878
1839
|
return Promise.all(evaluationArray);
|
|
1879
1840
|
|
|
1880
|
-
case
|
|
1841
|
+
case 16:
|
|
1881
1842
|
productTemp = product;
|
|
1882
1843
|
productTemp.status = "".concat(result, "A");
|
|
1883
|
-
productTemp.datasheet_status = productTemp.datasheet_status === "
|
|
1884
|
-
productTemp.description_status = productTemp.description_status === "
|
|
1885
|
-
productTemp.images_status = productTemp.images_status === "
|
|
1844
|
+
productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "A");
|
|
1845
|
+
productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result, "A");
|
|
1846
|
+
productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "A");
|
|
1886
1847
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1887
1848
|
setProduct(productTemp);
|
|
1888
|
-
_context15.next =
|
|
1889
|
-
return Promise.all(messages);
|
|
1890
|
-
|
|
1891
|
-
case 26:
|
|
1892
|
-
messagesResponse = _context15.sent;
|
|
1893
|
-
_context15.next = 29;
|
|
1849
|
+
_context15.next = 25;
|
|
1894
1850
|
return loadData();
|
|
1895
1851
|
|
|
1896
|
-
case
|
|
1897
|
-
_context15.next =
|
|
1852
|
+
case 25:
|
|
1853
|
+
_context15.next = 30;
|
|
1898
1854
|
break;
|
|
1899
1855
|
|
|
1900
|
-
case
|
|
1901
|
-
_context15.prev =
|
|
1856
|
+
case 27:
|
|
1857
|
+
_context15.prev = 27;
|
|
1902
1858
|
_context15.t1 = _context15["catch"](0);
|
|
1903
1859
|
console.log(_context15.t1);
|
|
1904
1860
|
|
|
1905
|
-
case
|
|
1861
|
+
case 30:
|
|
1906
1862
|
case "end":
|
|
1907
1863
|
return _context15.stop();
|
|
1908
1864
|
}
|
|
1909
1865
|
}
|
|
1910
|
-
}, _callee15, null, [[0,
|
|
1866
|
+
}, _callee15, null, [[0, 27]]);
|
|
1911
1867
|
}));
|
|
1912
1868
|
|
|
1913
|
-
return function validateAll(
|
|
1869
|
+
return function validateAll(_x7) {
|
|
1914
1870
|
return _ref18.apply(this, arguments);
|
|
1915
1871
|
};
|
|
1916
1872
|
}();
|
|
@@ -1923,10 +1879,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1923
1879
|
setCompare: setCompare,
|
|
1924
1880
|
isAuditor: [1, 6].includes(user.id_role),
|
|
1925
1881
|
withChat: location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.withChat,
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
token: token,
|
|
1929
|
-
activeRetailer: activeRetailer
|
|
1882
|
+
productSelected: productSelected,
|
|
1883
|
+
token: token
|
|
1930
1884
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1931
1885
|
className: "data-container",
|
|
1932
1886
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -1968,7 +1922,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1968
1922
|
sendToFacilitator("A");
|
|
1969
1923
|
},
|
|
1970
1924
|
reject: function reject() {
|
|
1971
|
-
|
|
1925
|
+
sendToFacilitator("R");
|
|
1926
|
+
setMessage("Rechazado");
|
|
1927
|
+
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1928
|
+
src: _errorModal.default
|
|
1929
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1930
|
+
text: "Agrega tu comentarios para enviar el rechazo",
|
|
1931
|
+
headerType: "input-name-header",
|
|
1932
|
+
color: "white"
|
|
1933
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1934
|
+
label: "Caja de Comentario",
|
|
1935
|
+
inputType: "textarea",
|
|
1936
|
+
inputId: "modal-commentary-box",
|
|
1937
|
+
index: 0,
|
|
1938
|
+
color: "white"
|
|
1939
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1940
|
+
buttonType: "general-default-button",
|
|
1941
|
+
label: "Enviar comentario",
|
|
1942
|
+
onClick: function onClick(e) {
|
|
1943
|
+
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1944
|
+
}
|
|
1945
|
+
})]);
|
|
1972
1946
|
},
|
|
1973
1947
|
showApproveRejectAll: approveRejectAllButtons() && (auditorAssigned() || userAssigned()),
|
|
1974
1948
|
showValidationButtons: approveRejectButtons() && (auditorAssigned() || userAssigned()),
|
|
@@ -1976,8 +1950,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1976
1950
|
return validateAll("A");
|
|
1977
1951
|
},
|
|
1978
1952
|
rejectAll: function rejectAll() {
|
|
1979
|
-
|
|
1980
|
-
|
|
1953
|
+
validateAll("R");
|
|
1954
|
+
setMessage("Rechazado");
|
|
1955
|
+
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1956
|
+
src: _errorModal.default
|
|
1957
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1958
|
+
text: "Agrega tu comentarios para enviar el rechazo",
|
|
1959
|
+
headerType: "input-name-header",
|
|
1960
|
+
color: "white"
|
|
1961
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1962
|
+
label: "Caja de Comentario",
|
|
1963
|
+
inputType: "textarea",
|
|
1964
|
+
inputId: "modal-commentary-box",
|
|
1965
|
+
index: 0,
|
|
1966
|
+
color: "white"
|
|
1967
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1968
|
+
buttonType: "general-default-button",
|
|
1969
|
+
label: "Enviar comentario",
|
|
1970
|
+
onClick: function onClick(e) {
|
|
1971
|
+
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1972
|
+
}
|
|
1973
|
+
})]);
|
|
1981
1974
|
}
|
|
1982
1975
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1983
1976
|
tabsSections: tabsSections,
|
|
@@ -1992,12 +1985,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1992
1985
|
isRetailer: isRetailer,
|
|
1993
1986
|
showSaveButton: auditorAssigned() || userAssigned(),
|
|
1994
1987
|
version: version,
|
|
1995
|
-
desc: desc,
|
|
1996
|
-
setDesc: setDesc,
|
|
1997
|
-
fich: fich,
|
|
1998
|
-
setFich: setFich,
|
|
1999
|
-
imag: imag,
|
|
2000
|
-
setImag: setImag,
|
|
2001
1988
|
updatedDescriptions: updatedDescriptions,
|
|
2002
1989
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2003
1990
|
updatedDatasheets: updatedDatasheets,
|
|
@@ -2055,7 +2042,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2055
2042
|
auditInputGroup: auditDescriptions[0],
|
|
2056
2043
|
updatedDescriptions: updatedDescriptions,
|
|
2057
2044
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2058
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
2045
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article18 = product.article) === null || _product$article18 === void 0 ? void 0 : _product$article18.id_article,
|
|
2059
2046
|
version: version,
|
|
2060
2047
|
dinamicHeight: true,
|
|
2061
2048
|
compare: compare
|
|
@@ -2076,15 +2063,57 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2076
2063
|
headerType: "input-name-header"
|
|
2077
2064
|
}))]
|
|
2078
2065
|
})
|
|
2079
|
-
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.
|
|
2066
|
+
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2080
2067
|
className: "commentary-box",
|
|
2081
|
-
children: [
|
|
2068
|
+
children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2069
|
+
className: "commentary",
|
|
2070
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2071
|
+
label: "Caja de Comentario",
|
|
2072
|
+
inputType: "textarea",
|
|
2073
|
+
inputCols: 80,
|
|
2074
|
+
inputRows: 4,
|
|
2075
|
+
inputId: "commentary-box",
|
|
2076
|
+
index: 0
|
|
2077
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2078
|
+
className: "buttons-box",
|
|
2079
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2080
|
+
buttonType: "general-transparent-button",
|
|
2081
|
+
label: "Enviar comentario",
|
|
2082
|
+
onClick: function onClick(e) {
|
|
2083
|
+
return createComment(e, document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2084
|
+
}
|
|
2085
|
+
})
|
|
2086
|
+
})]
|
|
2087
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2088
|
+
className: "feedback-box",
|
|
2089
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2090
|
+
comment: comment === null || comment === void 0 ? void 0 : (_comment$message = comment.message) === null || _comment$message === void 0 ? void 0 : _comment$message.replace(/<.*?\/?>/gm, ""),
|
|
2091
|
+
reviewed: crossComment
|
|
2092
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2093
|
+
buttonType: "circular-button accept-button",
|
|
2094
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2095
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2096
|
+
while (1) {
|
|
2097
|
+
switch (_context16.prev = _context16.next) {
|
|
2098
|
+
case 0:
|
|
2099
|
+
setCrossComment(true);
|
|
2100
|
+
commentRevised();
|
|
2101
|
+
|
|
2102
|
+
case 2:
|
|
2103
|
+
case "end":
|
|
2104
|
+
return _context16.stop();
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
}, _callee16);
|
|
2108
|
+
}))
|
|
2109
|
+
})]
|
|
2110
|
+
}), [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2082
2111
|
buttonType: evaluationFinished(user.id_role, activeTab, statusArray) && requiredNull[activeTab] === 0 ? "general-green-button" : "general-button-disabled",
|
|
2083
2112
|
label: "Enviar evaluación",
|
|
2084
2113
|
onClick: function onClick() {
|
|
2085
2114
|
return sendToFacilitator();
|
|
2086
2115
|
}
|
|
2087
|
-
})
|
|
2116
|
+
})]
|
|
2088
2117
|
})]
|
|
2089
2118
|
})]
|
|
2090
2119
|
}), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
|
|
@@ -2113,53 +2142,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2113
2142
|
currentVersion: version,
|
|
2114
2143
|
setShowVersionSelector: setShowVersionSelector,
|
|
2115
2144
|
jwt: token
|
|
2116
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2117
|
-
title: "Agregar mensaje de rechazo para ".concat(activeTab === null || activeTab === void 0 ? void 0 : activeTab.toLowerCase()),
|
|
2118
|
-
show: showRejectModal,
|
|
2119
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2120
|
-
inputType: "textarea",
|
|
2121
|
-
inputId: "modal-message-box",
|
|
2122
|
-
index: 0,
|
|
2123
|
-
color: "white"
|
|
2124
|
-
}),
|
|
2125
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2126
|
-
type: "white",
|
|
2127
|
-
label: "Cancelar",
|
|
2128
|
-
size: 12,
|
|
2129
|
-
onClick: function onClick() {
|
|
2130
|
-
setShowRejectModal(false);
|
|
2131
|
-
}
|
|
2132
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2133
|
-
type: "pink",
|
|
2134
|
-
label: "Aceptar",
|
|
2135
|
-
size: 12,
|
|
2136
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2137
|
-
var body, messages;
|
|
2138
|
-
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2139
|
-
while (1) {
|
|
2140
|
-
switch (_context16.prev = _context16.next) {
|
|
2141
|
-
case 0:
|
|
2142
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2143
|
-
messages = [{
|
|
2144
|
-
type: "message",
|
|
2145
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2146
|
-
}];
|
|
2147
|
-
_context16.next = 4;
|
|
2148
|
-
return createComment(messages, activeRetailer.id);
|
|
2149
|
-
|
|
2150
|
-
case 4:
|
|
2151
|
-
valRejAll ? validateAll("R") : sendToFacilitator("R");
|
|
2152
|
-
setMessage("Rechazado");
|
|
2153
|
-
setShowRejectModal(false);
|
|
2154
|
-
|
|
2155
|
-
case 7:
|
|
2156
|
-
case "end":
|
|
2157
|
-
return _context16.stop();
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2160
|
-
}, _callee16);
|
|
2161
|
-
}))
|
|
2162
|
-
}, "btn-Aceptar")]
|
|
2163
2145
|
})]
|
|
2164
2146
|
});
|
|
2165
2147
|
};
|