contentoh-components-library 21.4.57 → 21.4.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/dist/components/atoms/Avatar/index.js +2 -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/atoms/SliderToolTip/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/SignInLogin/index.js +28 -36
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +2 -1
- package/dist/components/molecules/TagAndInput/index.js +3 -64
- 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/Chat/styles.js +1 -1
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/InputGroup/index.js +48 -154
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/Dashboard/index.js +2 -8
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +137 -123
- package/dist/components/pages/ProviderProductEdition/index.js +258 -269
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +3 -7
- package/dist/components/pages/RetailerProductEdition/index.js +276 -278
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/global-files/data.js +8 -21
- package/dist/global-files/variables.js +1 -5
- package/dist/index.js +58 -201
- package/package.json +1 -2
- package/src/components/atoms/Avatar/index.js +2 -8
- 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/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/SignInLogin/index.js +11 -11
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +2 -1
- package/src/components/molecules/TagAndInput/index.js +8 -52
- 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 -14
- 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/Chat/styles.js +0 -4
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/InputGroup/index.js +88 -238
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
- package/src/components/pages/Dashboard/index.js +1 -6
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +145 -141
- package/src/components/pages/ProviderProductEdition/index.js +148 -145
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +2 -6
- package/src/components/pages/RetailerProductEdition/index.js +144 -115
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/global-files/data.js +6 -10
- package/src/global-files/variables.js +0 -4
- package/src/index.js +0 -11
- package/src/assets/images/Icons/info.svg +0 -8
- 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/TabSection/styles.js +0 -23
- 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/BoxAttribute/BoxAttribute.stories.js +0 -16
- package/src/components/molecules/BoxAttribute/index.js +0 -72
- package/src/components/molecules/BoxAttribute/styles.js +0 -41
- package/src/components/molecules/BoxButtons/BoxButtons.stories.js +0 -15
- package/src/components/molecules/BoxButtons/index.js +0 -32
- package/src/components/molecules/BoxButtons/styles.js +0 -43
- 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/organisms/Box/Box.stories.js +0 -17
- package/src/components/organisms/Box/index.js +0 -103
- package/src/components/organisms/Box/styles.js +0 -48
- package/src/components/organisms/BoxOnboarding/BoxOnboarding.stories.js +0 -17
- package/src/components/organisms/BoxOnboarding/index.js +0 -60
- package/src/components/organisms/BoxOnboarding/styles.js +0 -44
- 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
|
@@ -93,14 +93,6 @@ var _VersionSelector = require("../../organisms/VersionSelector");
|
|
|
93
93
|
|
|
94
94
|
var _customHooks = require("../../../global-files/customHooks");
|
|
95
95
|
|
|
96
|
-
var _utils = require("../RetailerProductEdition/utils");
|
|
97
|
-
|
|
98
|
-
var _Modal = require("../../organisms/Modal");
|
|
99
|
-
|
|
100
|
-
var _ButtonV = require("../../atoms/ButtonV2");
|
|
101
|
-
|
|
102
|
-
var _Box = require("../../organisms/Box");
|
|
103
|
-
|
|
104
96
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
105
97
|
|
|
106
98
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -214,7 +206,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
214
206
|
});
|
|
215
207
|
|
|
216
208
|
var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
217
|
-
var _product$retailers, _product$retailersAva, _location$state4, _location$state5,
|
|
209
|
+
var _product$retailers, _product$retailersAva, _location$state4, _location$state5, _datasheets$, _datasheets$$data;
|
|
218
210
|
|
|
219
211
|
var tabsSections = _ref.tabsSections,
|
|
220
212
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -272,11 +264,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
272
264
|
showModal = _useState14[0],
|
|
273
265
|
setShowModal = _useState14[1];
|
|
274
266
|
|
|
275
|
-
var _useState15 = (0, _react.useState)(),
|
|
276
|
-
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
277
|
-
boxData = _useState16[0],
|
|
278
|
-
setBoxData = _useState16[1];
|
|
279
|
-
|
|
280
267
|
var _useDropzone = (0, _reactDropzone.useDropzone)({
|
|
281
268
|
accept: "image/*",
|
|
282
269
|
noKeyboard: true,
|
|
@@ -339,146 +326,141 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
339
326
|
getRootProps = _useDropzone.getRootProps,
|
|
340
327
|
getInputProps = _useDropzone.getInputProps;
|
|
341
328
|
|
|
329
|
+
var _useState15 = (0, _react.useState)([]),
|
|
330
|
+
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
331
|
+
updatedDatasheets = _useState16[0],
|
|
332
|
+
setUpdatedDatasheets = _useState16[1];
|
|
333
|
+
|
|
342
334
|
var _useState17 = (0, _react.useState)([]),
|
|
343
335
|
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
344
|
-
|
|
345
|
-
|
|
336
|
+
updatedDescriptions = _useState18[0],
|
|
337
|
+
setUpdatedDescriptions = _useState18[1];
|
|
346
338
|
|
|
347
|
-
var _useState19 = (0, _react.useState)(
|
|
339
|
+
var _useState19 = (0, _react.useState)(false),
|
|
348
340
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
349
|
-
|
|
350
|
-
|
|
341
|
+
imagesUploaded = _useState20[0],
|
|
342
|
+
setImagesUploaded = _useState20[1];
|
|
351
343
|
|
|
352
|
-
var _useState21 = (0, _react.useState)(
|
|
344
|
+
var _useState21 = (0, _react.useState)(),
|
|
353
345
|
_useState22 = (0, _slicedToArray2.default)(_useState21, 2),
|
|
354
|
-
|
|
355
|
-
|
|
346
|
+
dataImages = _useState22[0],
|
|
347
|
+
setDataImages = _useState22[1];
|
|
356
348
|
|
|
357
|
-
var _useState23 = (0, _react.useState)()
|
|
358
|
-
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
359
|
-
dataImages = _useState24[0],
|
|
360
|
-
setDataImages = _useState24[1];
|
|
361
|
-
|
|
362
|
-
var _useState25 = (0, _react.useState)(product !== null && product !== void 0 && product.retailers ? new Array(product === null || product === void 0 ? void 0 : (_product$retailers = product.retailers) === null || _product$retailers === void 0 ? void 0 : _product$retailers.length).fill({
|
|
349
|
+
var _useState23 = (0, _react.useState)(product !== null && product !== void 0 && product.retailers ? new Array(product === null || product === void 0 ? void 0 : (_product$retailers = product.retailers) === null || _product$retailers === void 0 ? void 0 : _product$retailers.length).fill({
|
|
363
350
|
percentage: 0
|
|
364
351
|
}) : new Array(product === null || product === void 0 ? void 0 : (_product$retailersAva = product.retailersAvailable) === null || _product$retailersAva === void 0 ? void 0 : _product$retailersAva.length).fill({
|
|
365
352
|
percentage: 0
|
|
366
353
|
})),
|
|
354
|
+
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
355
|
+
percentages = _useState24[0],
|
|
356
|
+
setPercentages = _useState24[1];
|
|
357
|
+
|
|
358
|
+
var _useState25 = (0, _react.useState)(0),
|
|
367
359
|
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
368
|
-
|
|
369
|
-
|
|
360
|
+
activePercentage = _useState26[0],
|
|
361
|
+
setActivePercentage = _useState26[1];
|
|
370
362
|
|
|
371
|
-
var _useState27 = (0, _react.useState)(
|
|
363
|
+
var _useState27 = (0, _react.useState)({}),
|
|
372
364
|
_useState28 = (0, _slicedToArray2.default)(_useState27, 2),
|
|
373
|
-
|
|
374
|
-
|
|
365
|
+
activeRetailer = _useState28[0],
|
|
366
|
+
setActiveRetailer = _useState28[1];
|
|
375
367
|
|
|
376
|
-
var _useState29 = (0, _react.useState)(
|
|
368
|
+
var _useState29 = (0, _react.useState)([]),
|
|
377
369
|
_useState30 = (0, _slicedToArray2.default)(_useState29, 2),
|
|
378
|
-
|
|
379
|
-
|
|
370
|
+
services = _useState30[0],
|
|
371
|
+
setServices = _useState30[1];
|
|
380
372
|
|
|
381
373
|
var _useState31 = (0, _react.useState)([]),
|
|
382
374
|
_useState32 = (0, _slicedToArray2.default)(_useState31, 2),
|
|
383
|
-
|
|
384
|
-
|
|
375
|
+
servicesData = _useState32[0],
|
|
376
|
+
setServicesData = _useState32[1];
|
|
385
377
|
|
|
386
|
-
var _useState33 = (0, _react.useState)(
|
|
378
|
+
var _useState33 = (0, _react.useState)(""),
|
|
387
379
|
_useState34 = (0, _slicedToArray2.default)(_useState33, 2),
|
|
388
|
-
|
|
389
|
-
|
|
380
|
+
message = _useState34[0],
|
|
381
|
+
setMessage = _useState34[1];
|
|
390
382
|
|
|
391
|
-
var _useState35 = (0, _react.useState)(""),
|
|
383
|
+
var _useState35 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
|
|
392
384
|
_useState36 = (0, _slicedToArray2.default)(_useState35, 2),
|
|
393
|
-
|
|
394
|
-
|
|
385
|
+
product = _useState36[0],
|
|
386
|
+
setProduct = _useState36[1];
|
|
395
387
|
|
|
396
|
-
var _useState37 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("
|
|
388
|
+
var _useState37 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productEdit")) ? JSON.parse(sessionStorage.getItem("productEdit")) : productToEdit),
|
|
397
389
|
_useState38 = (0, _slicedToArray2.default)(_useState37, 2),
|
|
398
|
-
|
|
399
|
-
|
|
390
|
+
productEdit = _useState38[0],
|
|
391
|
+
setProductEdit = _useState38[1];
|
|
400
392
|
|
|
401
|
-
var _useState39 = (0, _react.useState)(
|
|
393
|
+
var _useState39 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
|
|
402
394
|
_useState40 = (0, _slicedToArray2.default)(_useState39, 2),
|
|
403
|
-
|
|
404
|
-
|
|
395
|
+
version = _useState40[0],
|
|
396
|
+
setVersion = _useState40[1];
|
|
405
397
|
|
|
406
|
-
var _useState41 = (0, _react.useState)(
|
|
407
|
-
_useState42 = (0, _slicedToArray2.default)(_useState41,
|
|
408
|
-
|
|
409
|
-
setVersion = _useState42[1];
|
|
398
|
+
var _useState41 = (0, _react.useState)({}),
|
|
399
|
+
_useState42 = (0, _slicedToArray2.default)(_useState41, 1),
|
|
400
|
+
comments = _useState42[0];
|
|
410
401
|
|
|
411
|
-
var _useState43 = (0, _react.useState)(
|
|
412
|
-
_useState44 = (0, _slicedToArray2.default)(_useState43,
|
|
413
|
-
|
|
402
|
+
var _useState43 = (0, _react.useState)(""),
|
|
403
|
+
_useState44 = (0, _slicedToArray2.default)(_useState43, 2),
|
|
404
|
+
comment = _useState44[0],
|
|
405
|
+
setComment = _useState44[1];
|
|
414
406
|
|
|
415
|
-
var _useState45 = (0, _react.useState)(
|
|
407
|
+
var _useState45 = (0, _react.useState)(false),
|
|
416
408
|
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
417
|
-
|
|
418
|
-
|
|
409
|
+
crossComment = _useState46[0],
|
|
410
|
+
setCrossComment = _useState46[1];
|
|
419
411
|
|
|
420
|
-
var _useState47 = (0, _react.useState)(
|
|
412
|
+
var _useState47 = (0, _react.useState)([]),
|
|
421
413
|
_useState48 = (0, _slicedToArray2.default)(_useState47, 2),
|
|
422
|
-
|
|
423
|
-
|
|
414
|
+
userGroups = _useState48[0],
|
|
415
|
+
setUserGroups = _useState48[1];
|
|
424
416
|
|
|
425
|
-
var _useState49 = (0, _react.useState)(
|
|
417
|
+
var _useState49 = (0, _react.useState)({}),
|
|
426
418
|
_useState50 = (0, _slicedToArray2.default)(_useState49, 2),
|
|
427
|
-
|
|
428
|
-
|
|
419
|
+
assig = _useState50[0],
|
|
420
|
+
setAssig = _useState50[1];
|
|
429
421
|
|
|
430
|
-
var _useState51 = (0, _react.useState)(
|
|
422
|
+
var _useState51 = (0, _react.useState)([]),
|
|
431
423
|
_useState52 = (0, _slicedToArray2.default)(_useState51, 2),
|
|
432
|
-
|
|
433
|
-
|
|
424
|
+
selectedImages = _useState52[0],
|
|
425
|
+
setSelectedImages = _useState52[1];
|
|
434
426
|
|
|
435
427
|
var _useState53 = (0, _react.useState)([]),
|
|
436
428
|
_useState54 = (0, _slicedToArray2.default)(_useState53, 2),
|
|
437
|
-
|
|
438
|
-
|
|
429
|
+
componentsArray = _useState54[0],
|
|
430
|
+
setComponentsArray = _useState54[1];
|
|
439
431
|
|
|
440
|
-
var _useState55 = (0, _react.useState)(
|
|
432
|
+
var _useState55 = (0, _react.useState)(false),
|
|
441
433
|
_useState56 = (0, _slicedToArray2.default)(_useState55, 2),
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
var _useState57 = (0, _react.useState)(false),
|
|
446
|
-
_useState58 = (0, _slicedToArray2.default)(_useState57, 2),
|
|
447
|
-
checkAll = _useState58[0],
|
|
448
|
-
setCheckAll = _useState58[1];
|
|
434
|
+
checkAll = _useState56[0],
|
|
435
|
+
setCheckAll = _useState56[1];
|
|
449
436
|
|
|
450
437
|
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
451
438
|
|
|
452
|
-
var
|
|
453
|
-
|
|
454
|
-
loading =
|
|
455
|
-
setLoading =
|
|
456
|
-
|
|
457
|
-
var _useState61 = (0, _react.useState)(false),
|
|
458
|
-
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
459
|
-
validatedAll = _useState62[0],
|
|
460
|
-
setValidatedAll = _useState62[1];
|
|
439
|
+
var _useState57 = (0, _react.useState)(true),
|
|
440
|
+
_useState58 = (0, _slicedToArray2.default)(_useState57, 2),
|
|
441
|
+
loading = _useState58[0],
|
|
442
|
+
setLoading = _useState58[1];
|
|
461
443
|
|
|
462
|
-
var
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
444
|
+
var _useState59 = (0, _react.useState)(false),
|
|
445
|
+
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
446
|
+
validatedAll = _useState60[0],
|
|
447
|
+
setValidatedAll = _useState60[1];
|
|
466
448
|
|
|
467
|
-
var
|
|
449
|
+
var _useState61 = (0, _react.useState)({
|
|
468
450
|
"Ficha técnica": null,
|
|
469
451
|
Descripción: null,
|
|
470
452
|
Imágenes: null
|
|
471
453
|
}),
|
|
472
|
-
|
|
473
|
-
origin =
|
|
474
|
-
setOrigin =
|
|
454
|
+
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
455
|
+
origin = _useState62[0],
|
|
456
|
+
setOrigin = _useState62[1];
|
|
475
457
|
|
|
476
|
-
var
|
|
477
|
-
|
|
478
|
-
inCart =
|
|
479
|
-
setInCart =
|
|
458
|
+
var _useState63 = (0, _react.useState)(false),
|
|
459
|
+
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
460
|
+
inCart = _useState64[0],
|
|
461
|
+
setInCart = _useState64[1];
|
|
480
462
|
|
|
481
|
-
var
|
|
463
|
+
var _useState65 = (0, _react.useState)({
|
|
482
464
|
message: "¿Estás seguro de continuar?",
|
|
483
465
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
484
466
|
button1: {
|
|
@@ -493,34 +475,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
493
475
|
},
|
|
494
476
|
img: _defaultProfileImage.default
|
|
495
477
|
}),
|
|
496
|
-
|
|
497
|
-
dataGenericModal =
|
|
498
|
-
setDataGenericModal =
|
|
478
|
+
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
479
|
+
dataGenericModal = _useState66[0],
|
|
480
|
+
setDataGenericModal = _useState66[1];
|
|
499
481
|
|
|
500
|
-
var
|
|
501
|
-
|
|
502
|
-
socketType =
|
|
503
|
-
setSocketType =
|
|
482
|
+
var _useState67 = (0, _react.useState)(null),
|
|
483
|
+
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
484
|
+
socketType = _useState68[0],
|
|
485
|
+
setSocketType = _useState68[1];
|
|
504
486
|
|
|
505
|
-
var
|
|
506
|
-
|
|
507
|
-
saving =
|
|
508
|
-
setSaving =
|
|
487
|
+
var _useState69 = (0, _react.useState)(loading),
|
|
488
|
+
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
489
|
+
saving = _useState70[0],
|
|
490
|
+
setSaving = _useState70[1];
|
|
509
491
|
|
|
510
|
-
var
|
|
511
|
-
|
|
512
|
-
retailerStatus =
|
|
513
|
-
setRetailerStatus =
|
|
492
|
+
var _useState71 = (0, _react.useState)(product.statusByRetailer),
|
|
493
|
+
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
494
|
+
retailerStatus = _useState72[0],
|
|
495
|
+
setRetailerStatus = _useState72[1];
|
|
514
496
|
|
|
515
497
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
516
498
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
517
499
|
showVersionSelector = _useCloseModal2[0],
|
|
518
500
|
setShowVersionSelector = _useCloseModal2[1];
|
|
519
501
|
|
|
520
|
-
var
|
|
521
|
-
|
|
522
|
-
globalModal =
|
|
523
|
-
setGlobalModal =
|
|
502
|
+
var _useState73 = (0, _react.useState)(),
|
|
503
|
+
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
504
|
+
globalModal = _useState74[0],
|
|
505
|
+
setGlobalModal = _useState74[1];
|
|
524
506
|
|
|
525
507
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
526
508
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -692,6 +674,30 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
692
674
|
});
|
|
693
675
|
|
|
694
676
|
switch (type) {
|
|
677
|
+
case "error":
|
|
678
|
+
setGlobalModal({
|
|
679
|
+
message: "".concat(activeTab, " rechazada"),
|
|
680
|
+
detail: "Agrega tu comentarios para enviar el rechazo",
|
|
681
|
+
img: _errorModal.default,
|
|
682
|
+
textArea: true,
|
|
683
|
+
button1: {
|
|
684
|
+
name: "Enviar",
|
|
685
|
+
action: function action(e) {
|
|
686
|
+
var textArea = document.querySelector("#area");
|
|
687
|
+
|
|
688
|
+
if (textArea.value) {
|
|
689
|
+
textArea.style.border = "none";
|
|
690
|
+
createComment(e, textArea.value);
|
|
691
|
+
showGlobalModal("commentsSent");
|
|
692
|
+
validatedAll ? validateAll("R") : sendEvaluation("R");
|
|
693
|
+
} else {
|
|
694
|
+
textArea.style.border = "2px solid red";
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
break;
|
|
700
|
+
|
|
695
701
|
case "generic":
|
|
696
702
|
setGlobalModal(dataGenericModal);
|
|
697
703
|
break;
|
|
@@ -893,7 +899,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
893
899
|
switch (_context8.prev = _context8.next) {
|
|
894
900
|
case 0:
|
|
895
901
|
_context8.next = 2;
|
|
896
|
-
return (0, _data.getRetailerServices)((product === null || product === void 0 ? void 0 : product.id_article) || (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.company_name) || (product === null || product === void 0 ? void 0 : product.categoryName), parseInt((product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category) || (product === null || product === void 0 ? void 0 : product.id_category)), version
|
|
902
|
+
return (0, _data.getRetailerServices)((product === null || product === void 0 ? void 0 : product.id_article) || (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.company_name) || (product === null || product === void 0 ? void 0 : product.categoryName), parseInt((product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category) || (product === null || product === void 0 ? void 0 : product.id_category)), version);
|
|
897
903
|
|
|
898
904
|
case 2:
|
|
899
905
|
services = _context8.sent;
|
|
@@ -963,7 +969,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
963
969
|
setServicesData(parsedResponse);
|
|
964
970
|
|
|
965
971
|
case 12:
|
|
966
|
-
|
|
972
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
967
973
|
|
|
968
974
|
case 13:
|
|
969
975
|
case "end":
|
|
@@ -1081,7 +1087,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1081
1087
|
}
|
|
1082
1088
|
|
|
1083
1089
|
setProduct(productTemp);
|
|
1084
|
-
|
|
1090
|
+
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1085
1091
|
}, [percentages]);
|
|
1086
1092
|
|
|
1087
1093
|
var loadInputs = function loadInputs() {
|
|
@@ -1218,74 +1224,53 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1218
1224
|
|
|
1219
1225
|
var saveDatasheets = /*#__PURE__*/function () {
|
|
1220
1226
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1221
|
-
var
|
|
1227
|
+
var dataObject, res;
|
|
1222
1228
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1223
1229
|
while (1) {
|
|
1224
1230
|
switch (_context12.prev = _context12.next) {
|
|
1225
1231
|
case 0:
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
|
|
1229
|
-
box = _ref12[1];
|
|
1230
|
-
|
|
1231
|
-
var value = box.value;
|
|
1232
|
-
var attributesIds = Object.keys(value);
|
|
1233
|
-
attributesIds.forEach(function (attributeId) {
|
|
1234
|
-
var boxId = index + 1;
|
|
1235
|
-
var valueOfAtribute = value[attributeId];
|
|
1236
|
-
parseBoxData.push({
|
|
1237
|
-
attributeId: attributeId,
|
|
1238
|
-
value: valueOfAtribute,
|
|
1239
|
-
boxId: boxId
|
|
1240
|
-
});
|
|
1241
|
-
});
|
|
1242
|
-
});
|
|
1243
|
-
dataObject = (0, _objectSpread3.default)({
|
|
1232
|
+
setLoading(true);
|
|
1233
|
+
dataObject = {
|
|
1244
1234
|
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1245
1235
|
articleData: updatedDatasheets
|
|
1246
|
-
}
|
|
1247
|
-
boxData: parseBoxData
|
|
1248
|
-
});
|
|
1236
|
+
};
|
|
1249
1237
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
1250
|
-
_context12.prev =
|
|
1251
|
-
_context12.next =
|
|
1238
|
+
_context12.prev = 3;
|
|
1239
|
+
_context12.next = 6;
|
|
1252
1240
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
|
|
1253
1241
|
headers: {
|
|
1254
1242
|
Authorization: token
|
|
1255
1243
|
}
|
|
1256
1244
|
});
|
|
1257
1245
|
|
|
1258
|
-
case
|
|
1246
|
+
case 6:
|
|
1259
1247
|
res = _context12.sent;
|
|
1260
1248
|
|
|
1261
1249
|
if (!(res.data.statusCode === 200)) {
|
|
1262
|
-
_context12.next =
|
|
1250
|
+
_context12.next = 12;
|
|
1263
1251
|
break;
|
|
1264
1252
|
}
|
|
1265
1253
|
|
|
1266
1254
|
setUpdatedDatasheets([]);
|
|
1267
1255
|
setMessage("Fichas técnicas guardadas");
|
|
1268
|
-
_context12.next =
|
|
1256
|
+
_context12.next = 12;
|
|
1269
1257
|
return loadData();
|
|
1270
1258
|
|
|
1271
|
-
case
|
|
1272
|
-
_context12.next =
|
|
1259
|
+
case 12:
|
|
1260
|
+
_context12.next = 17;
|
|
1273
1261
|
break;
|
|
1274
1262
|
|
|
1275
|
-
case
|
|
1276
|
-
_context12.prev =
|
|
1277
|
-
_context12.t0 = _context12["catch"](
|
|
1263
|
+
case 14:
|
|
1264
|
+
_context12.prev = 14;
|
|
1265
|
+
_context12.t0 = _context12["catch"](3);
|
|
1278
1266
|
console.log(_context12.t0);
|
|
1279
1267
|
|
|
1280
|
-
case
|
|
1281
|
-
console.log(dataObject);
|
|
1282
|
-
|
|
1283
|
-
case 19:
|
|
1268
|
+
case 17:
|
|
1284
1269
|
case "end":
|
|
1285
1270
|
return _context12.stop();
|
|
1286
1271
|
}
|
|
1287
1272
|
}
|
|
1288
|
-
}, _callee12, null, [[
|
|
1273
|
+
}, _callee12, null, [[3, 14]]);
|
|
1289
1274
|
}));
|
|
1290
1275
|
|
|
1291
1276
|
return function saveDatasheets() {
|
|
@@ -1484,33 +1469,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1484
1469
|
};
|
|
1485
1470
|
|
|
1486
1471
|
var createComment = /*#__PURE__*/function () {
|
|
1487
|
-
var
|
|
1488
|
-
var
|
|
1489
|
-
retailerId,
|
|
1490
|
-
data,
|
|
1491
|
-
_args15 = arguments;
|
|
1472
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
|
|
1473
|
+
var concept, data;
|
|
1492
1474
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1493
1475
|
while (1) {
|
|
1494
1476
|
switch (_context15.prev = _context15.next) {
|
|
1495
1477
|
case 0:
|
|
1496
|
-
|
|
1497
|
-
|
|
1478
|
+
concept = "";
|
|
1479
|
+
_context15.t0 = activeTab;
|
|
1480
|
+
_context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
|
|
1481
|
+
break;
|
|
1482
|
+
|
|
1483
|
+
case 4:
|
|
1484
|
+
concept = "datasheet";
|
|
1485
|
+
return _context15.abrupt("break", 10);
|
|
1486
|
+
|
|
1487
|
+
case 6:
|
|
1488
|
+
concept = "images";
|
|
1489
|
+
return _context15.abrupt("break", 10);
|
|
1490
|
+
|
|
1491
|
+
case 8:
|
|
1492
|
+
concept = "description";
|
|
1493
|
+
return _context15.abrupt("break", 10);
|
|
1494
|
+
|
|
1495
|
+
case 10:
|
|
1498
1496
|
data = {
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1497
|
+
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1498
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1499
|
+
message: body,
|
|
1500
|
+
concept: concept,
|
|
1501
|
+
version: version
|
|
1502
|
+
};
|
|
1503
|
+
_context15.next = 13;
|
|
1504
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1505
|
+
headers: {
|
|
1507
1506
|
Authorization: token
|
|
1508
1507
|
}
|
|
1509
|
-
};
|
|
1510
|
-
setMessage("");
|
|
1511
|
-
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1508
|
+
});
|
|
1512
1509
|
|
|
1513
|
-
case
|
|
1510
|
+
case 13:
|
|
1514
1511
|
case "end":
|
|
1515
1512
|
return _context15.stop();
|
|
1516
1513
|
}
|
|
@@ -1518,8 +1515,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1518
1515
|
}, _callee15);
|
|
1519
1516
|
}));
|
|
1520
1517
|
|
|
1521
|
-
return function createComment() {
|
|
1522
|
-
return
|
|
1518
|
+
return function createComment(_x4, _x5, _x6) {
|
|
1519
|
+
return _ref13.apply(this, arguments);
|
|
1523
1520
|
};
|
|
1524
1521
|
}();
|
|
1525
1522
|
|
|
@@ -1528,7 +1525,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1528
1525
|
}, [activeTab]);
|
|
1529
1526
|
|
|
1530
1527
|
var commentRevised = /*#__PURE__*/function () {
|
|
1531
|
-
var
|
|
1528
|
+
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
1532
1529
|
var data;
|
|
1533
1530
|
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
1534
1531
|
while (1) {
|
|
@@ -1556,12 +1553,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1556
1553
|
}));
|
|
1557
1554
|
|
|
1558
1555
|
return function commentRevised() {
|
|
1559
|
-
return
|
|
1556
|
+
return _ref14.apply(this, arguments);
|
|
1560
1557
|
};
|
|
1561
1558
|
}();
|
|
1562
1559
|
|
|
1563
1560
|
var setAssignation = /*#__PURE__*/function () {
|
|
1564
|
-
var
|
|
1561
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(assignationType, assignationId) {
|
|
1565
1562
|
var concept, productTemp, data;
|
|
1566
1563
|
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
1567
1564
|
while (1) {
|
|
@@ -1617,8 +1614,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1617
1614
|
}, _callee17);
|
|
1618
1615
|
}));
|
|
1619
1616
|
|
|
1620
|
-
return function setAssignation(
|
|
1621
|
-
return
|
|
1617
|
+
return function setAssignation(_x7, _x8) {
|
|
1618
|
+
return _ref15.apply(this, arguments);
|
|
1622
1619
|
};
|
|
1623
1620
|
}();
|
|
1624
1621
|
|
|
@@ -1702,7 +1699,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1702
1699
|
};
|
|
1703
1700
|
|
|
1704
1701
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
1705
|
-
var
|
|
1702
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1706
1703
|
var _productTemp$id_order2;
|
|
1707
1704
|
|
|
1708
1705
|
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, body, _JSON$parse, response, newStatuses, statusObject, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse2, _response, _statusObject, retailerStatusCopy, status;
|
|
@@ -1813,13 +1810,13 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1813
1810
|
}, _callee18, null, [[9, 35]]);
|
|
1814
1811
|
}));
|
|
1815
1812
|
|
|
1816
|
-
return function sendEvaluation(
|
|
1817
|
-
return
|
|
1813
|
+
return function sendEvaluation(_x9) {
|
|
1814
|
+
return _ref16.apply(this, arguments);
|
|
1818
1815
|
};
|
|
1819
1816
|
}();
|
|
1820
1817
|
|
|
1821
1818
|
var validateAll = /*#__PURE__*/function () {
|
|
1822
|
-
var
|
|
1819
|
+
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1823
1820
|
var _product$id_order2, evaluationArray, conceptArray, isAproved, retailersIds, body, userType, productTemp, status, retailerStatusCopy;
|
|
1824
1821
|
|
|
1825
1822
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
@@ -1904,13 +1901,13 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1904
1901
|
}, _callee19, null, [[0, 30]]);
|
|
1905
1902
|
}));
|
|
1906
1903
|
|
|
1907
|
-
return function validateAll(
|
|
1908
|
-
return
|
|
1904
|
+
return function validateAll(_x10) {
|
|
1905
|
+
return _ref17.apply(this, arguments);
|
|
1909
1906
|
};
|
|
1910
1907
|
}();
|
|
1911
1908
|
|
|
1912
1909
|
var evaluationToRetailer = /*#__PURE__*/function () {
|
|
1913
|
-
var
|
|
1910
|
+
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(result) {
|
|
1914
1911
|
var data, prod, statusComplete;
|
|
1915
1912
|
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
1916
1913
|
while (1) {
|
|
@@ -1951,8 +1948,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1951
1948
|
}, _callee20);
|
|
1952
1949
|
}));
|
|
1953
1950
|
|
|
1954
|
-
return function evaluationToRetailer(
|
|
1955
|
-
return
|
|
1951
|
+
return function evaluationToRetailer(_x11) {
|
|
1952
|
+
return _ref18.apply(this, arguments);
|
|
1956
1953
|
};
|
|
1957
1954
|
}();
|
|
1958
1955
|
|
|
@@ -1963,6 +1960,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1963
1960
|
|
|
1964
1961
|
var enableActions = function enableActions(versionStatus) {
|
|
1965
1962
|
try {
|
|
1963
|
+
if (user.is_retailer) return false;
|
|
1964
|
+
|
|
1966
1965
|
if (versionStatus) {
|
|
1967
1966
|
return ["AP", "ACA", "RCA", null].includes(versionStatus);
|
|
1968
1967
|
}
|
|
@@ -2037,7 +2036,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2037
2036
|
return;
|
|
2038
2037
|
} else if (user.is_retailer) {
|
|
2039
2038
|
if (product.id_order || product.orderId) {
|
|
2040
|
-
|
|
2039
|
+
setValidatedAll(true);
|
|
2040
|
+
showGlobalModal("error");
|
|
2041
2041
|
} else {
|
|
2042
2042
|
setDataGenericModal(function (prev) {
|
|
2043
2043
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2052,7 +2052,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2052
2052
|
showGlobalModal("generic");
|
|
2053
2053
|
}
|
|
2054
2054
|
} else {
|
|
2055
|
-
|
|
2055
|
+
setValidatedAll(true);
|
|
2056
|
+
showGlobalModal("error");
|
|
2056
2057
|
}
|
|
2057
2058
|
}
|
|
2058
2059
|
};
|
|
@@ -2062,7 +2063,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2062
2063
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2063
2064
|
setHeaderTop: setHeaderTop,
|
|
2064
2065
|
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
2065
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
2066
2066
|
productSelected: productSelected,
|
|
2067
2067
|
token: token,
|
|
2068
2068
|
activeRetailer: activeRetailer
|
|
@@ -2141,7 +2141,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2141
2141
|
} else if (user.is_retailer) {
|
|
2142
2142
|
if (product.id_order || product.orderId) {
|
|
2143
2143
|
setValidatedAll(true);
|
|
2144
|
-
|
|
2144
|
+
showGlobalModal("error");
|
|
2145
2145
|
} else {
|
|
2146
2146
|
setDataGenericModal(function (prev) {
|
|
2147
2147
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2156,15 +2156,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2156
2156
|
showGlobalModal("generic");
|
|
2157
2157
|
}
|
|
2158
2158
|
} else {
|
|
2159
|
-
setShowRejectModal(true);
|
|
2160
2159
|
setValidatedAll(true);
|
|
2160
|
+
showGlobalModal("error");
|
|
2161
2161
|
}
|
|
2162
2162
|
},
|
|
2163
2163
|
approve: function approve() {
|
|
2164
2164
|
return sendToEvaluation("A");
|
|
2165
2165
|
},
|
|
2166
2166
|
reject: function reject() {
|
|
2167
|
-
|
|
2167
|
+
return sendToEvaluation("R");
|
|
2168
2168
|
}
|
|
2169
2169
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2170
2170
|
tabsSections: tabsSections,
|
|
@@ -2213,26 +2213,17 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2213
2213
|
setSelectedImages: setSelectedImages,
|
|
2214
2214
|
checkAll: checkAll,
|
|
2215
2215
|
setCheckAll: setCheckAll
|
|
2216
|
-
}), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : product.datasheet_status) !== "NS" ?
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
activeRetailer: services[0][activeRetailer.id],
|
|
2228
|
-
groupData: services[0][activeRetailer.id].data,
|
|
2229
|
-
setUpdatedBoxData: function setUpdatedBoxData(e) {
|
|
2230
|
-
setBoxData(e);
|
|
2231
|
-
},
|
|
2232
|
-
index: index //enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
|
|
2233
|
-
|
|
2234
|
-
}, index + "-" + activeRetailer.name);
|
|
2235
|
-
})
|
|
2216
|
+
}), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : product.datasheet_status) !== "NS" ? (_datasheets$ = datasheets[0]) === null || _datasheets$ === void 0 ? void 0 : (_datasheets$$data = _datasheets$.data) === null || _datasheets$$data === void 0 ? void 0 : _datasheets$$data.map(function (dataGroup, index) {
|
|
2217
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
2218
|
+
articleId: product.id_article,
|
|
2219
|
+
version: version,
|
|
2220
|
+
activeSection: activeTab,
|
|
2221
|
+
inputGroup: dataGroup,
|
|
2222
|
+
dataInputs: datasheets[1],
|
|
2223
|
+
updatedDatasheets: updatedDatasheets,
|
|
2224
|
+
setUpdatedDatasheets: setUpdatedDatasheets //enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
|
|
2225
|
+
|
|
2226
|
+
}, index + "-" + activeRetailer.name);
|
|
2236
2227
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2237
2228
|
text: "No cuentas con este servicio",
|
|
2238
2229
|
headerType: "input-name-header"
|
|
@@ -2243,7 +2234,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2243
2234
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2244
2235
|
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
2245
2236
|
version: version,
|
|
2246
|
-
isShowbox: false,
|
|
2247
2237
|
dinamicHeight: true
|
|
2248
2238
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2249
2239
|
text: "No cuentas con este servicio",
|
|
@@ -2262,7 +2252,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2262
2252
|
headerType: "input-name-header"
|
|
2263
2253
|
}))]
|
|
2264
2254
|
})
|
|
2265
|
-
}),
|
|
2255
|
+
}), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2256
|
+
className: "commentary-box",
|
|
2257
|
+
children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2258
|
+
className: "commentary",
|
|
2259
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2260
|
+
label: "Caja de Comentario",
|
|
2261
|
+
inputType: "textarea",
|
|
2262
|
+
inputCols: 80,
|
|
2263
|
+
inputRows: 4,
|
|
2264
|
+
inputId: "commentary-box",
|
|
2265
|
+
index: 0
|
|
2266
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2267
|
+
className: "buttons-box",
|
|
2268
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2269
|
+
buttonType: "general-transparent-button",
|
|
2270
|
+
label: "Enviar comentario",
|
|
2271
|
+
onClick: function onClick(e) {
|
|
2272
|
+
return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2273
|
+
}
|
|
2274
|
+
})
|
|
2275
|
+
})]
|
|
2276
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2277
|
+
className: "feedback-box",
|
|
2278
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2279
|
+
comment: comment.message,
|
|
2280
|
+
reviewed: crossComment
|
|
2281
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2282
|
+
buttonType: "circular-button accept-button",
|
|
2283
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2284
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2285
|
+
while (1) {
|
|
2286
|
+
switch (_context21.prev = _context21.next) {
|
|
2287
|
+
case 0:
|
|
2288
|
+
setCrossComment(true);
|
|
2289
|
+
commentRevised();
|
|
2290
|
+
|
|
2291
|
+
case 2:
|
|
2292
|
+
case "end":
|
|
2293
|
+
return _context21.stop();
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
}, _callee21);
|
|
2297
|
+
}))
|
|
2298
|
+
})]
|
|
2299
|
+
})
|
|
2300
|
+
}) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2266
2301
|
className: "required-inputs-message",
|
|
2267
2302
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2268
2303
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -2322,52 +2357,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2322
2357
|
currentVersion: version,
|
|
2323
2358
|
setShowVersionSelector: setShowVersionSelector,
|
|
2324
2359
|
jwt: token
|
|
2325
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2326
|
-
title: "Agregar mensaje de rechazo",
|
|
2327
|
-
show: showRejectModal,
|
|
2328
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2329
|
-
inputType: "textarea",
|
|
2330
|
-
inputId: "modal-message-box",
|
|
2331
|
-
index: 0,
|
|
2332
|
-
color: "white"
|
|
2333
|
-
}),
|
|
2334
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2335
|
-
type: "white",
|
|
2336
|
-
label: "Cancelar",
|
|
2337
|
-
size: 12,
|
|
2338
|
-
onClick: function onClick() {
|
|
2339
|
-
setShowRejectModal(false);
|
|
2340
|
-
}
|
|
2341
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2342
|
-
type: "pink",
|
|
2343
|
-
label: "Aceptar",
|
|
2344
|
-
size: 12,
|
|
2345
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2346
|
-
var body, messages;
|
|
2347
|
-
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2348
|
-
while (1) {
|
|
2349
|
-
switch (_context21.prev = _context21.next) {
|
|
2350
|
-
case 0:
|
|
2351
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2352
|
-
messages = [{
|
|
2353
|
-
type: "message",
|
|
2354
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2355
|
-
}];
|
|
2356
|
-
_context21.next = 4;
|
|
2357
|
-
return createComment(messages, activeRetailer.id);
|
|
2358
|
-
|
|
2359
|
-
case 4:
|
|
2360
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2361
|
-
setShowRejectModal(false);
|
|
2362
|
-
|
|
2363
|
-
case 6:
|
|
2364
|
-
case "end":
|
|
2365
|
-
return _context21.stop();
|
|
2366
|
-
}
|
|
2367
|
-
}
|
|
2368
|
-
}, _callee21);
|
|
2369
|
-
}))
|
|
2370
|
-
}, "btn-Aceptar")]
|
|
2371
2360
|
})]
|
|
2372
2361
|
});
|
|
2373
2362
|
};
|