contentoh-components-library 21.4.63 → 21.4.64
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 +3 -2
- 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/BoxAttribute/index.js +3 -3
- package/dist/components/molecules/BoxAttribute/styles.js +1 -1
- package/dist/components/molecules/BoxButtons/index.js +0 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +68 -11
- package/dist/components/molecules/SignInLogin/index.js +36 -28
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +1 -2
- package/dist/components/organisms/Chat/Chat.stories.js +27 -8
- package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +350 -197
- package/dist/components/organisms/Chat/Footer/index.js +48 -39
- package/dist/components/organisms/Chat/index.js +49 -4
- package/dist/components/organisms/Chat/styles.js +1 -1
- package/dist/components/organisms/DashboardMetric/index.js +12 -6
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/InputGroup/index.js +1 -10
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/Dashboard/Dashboard.stories.js +33 -36
- package/dist/components/pages/Dashboard/index.js +35 -8
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +3 -3
- package/dist/components/pages/ProviderProductEdition/index.js +120 -144
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +7 -3
- package/dist/components/pages/RetailerProductEdition/index.js +279 -277
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
- package/dist/global-files/data.js +11 -3
- package/dist/global-files/variables.js +5 -1
- package/dist/index.js +201 -58
- package/package.json +2 -1
- package/src/components/atoms/Avatar/index.js +8 -2
- package/src/components/atoms/CheckBox/styles.js +2 -0
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
- package/src/components/atoms/ImageCarousel/index.js +103 -0
- package/src/components/atoms/ImageCarousel/styles.js +79 -0
- package/src/components/atoms/InputFormatter/styles.js +2 -1
- package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
- package/src/components/atoms/PercentTag/index.js +9 -0
- package/src/components/atoms/PercentTag/styles.js +69 -0
- package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
- package/src/components/atoms/RatingStars/index.js +31 -0
- package/src/components/atoms/RatingStars/styles.js +28 -0
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
- package/src/components/atoms/RetailerCatalog/index.js +49 -0
- package/src/components/atoms/RetailerCatalog/styles.js +30 -0
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
- package/src/components/atoms/RetailerOption/index.js +53 -0
- package/src/components/atoms/RetailerOption/styles.js +41 -0
- package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
- package/src/components/atoms/RetailersList/index.js +20 -0
- package/src/components/atoms/RetailersList/styles.js +19 -0
- package/src/components/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/atoms/TabSection/styles.js +1 -1
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +67 -0
- package/src/components/atoms/UserCatalog/index.js +100 -0
- package/src/components/atoms/UserCatalog/styles.js +24 -0
- package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
- package/src/components/atoms/UserOption/index.js +95 -0
- package/src/components/atoms/UserOption/styles.js +61 -0
- package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
- package/src/components/atoms/UserSelector/index.js +86 -0
- package/src/components/atoms/UserSelector/styles.js +55 -0
- package/src/components/molecules/BoxAttribute/index.js +32 -25
- package/src/components/molecules/BoxAttribute/styles.js +1 -1
- package/src/components/molecules/BoxButtons/index.js +23 -22
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
- package/src/components/molecules/GridItem/index.js +105 -0
- package/src/components/molecules/GridItem/styles.js +104 -0
- package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
- package/src/components/molecules/HeaderItem/index.js +26 -0
- package/src/components/molecules/HeaderItem/styles.js +27 -0
- package/src/components/molecules/HeaderTop/index.js +52 -6
- package/src/components/molecules/RowItem/ColumnItem.js +9 -0
- package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
- package/src/components/molecules/RowItem/index.js +45 -0
- package/src/components/molecules/RowItem/styles.js +40 -0
- package/src/components/molecules/SignInLogin/index.js +11 -11
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +1 -2
- package/src/components/molecules/TagAndInput/index.js +6 -5
- package/src/components/organisms/Chat/Chat.stories.js +27 -7
- package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
- package/src/components/organisms/Chat/ContainerItems/styles.js +14 -2
- package/src/components/organisms/Chat/ContentChat/index.js +88 -12
- package/src/components/organisms/Chat/Footer/index.js +11 -0
- package/src/components/organisms/Chat/index.js +46 -4
- package/src/components/organisms/Chat/styles.js +4 -0
- package/src/components/organisms/DashboardMetric/index.js +6 -3
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/GridProducts/GridProducts.stories.js +5485 -0
- package/src/components/organisms/GridProducts/index.js +50 -0
- package/src/components/organisms/GridProducts/styles.js +14 -0
- package/src/components/organisms/GridProducts/utils.js +111 -0
- package/src/components/organisms/InputGroup/index.js +131 -119
- package/src/components/organisms/Modal/styles.js +4 -1
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
- package/src/components/pages/Dashboard/Dashboard.stories.js +33 -38
- package/src/components/pages/Dashboard/index.js +33 -5
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +100 -83
- package/src/components/pages/ProviderProductEdition/index.js +100 -131
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +6 -2
- package/src/components/pages/RetailerProductEdition/index.js +114 -145
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/global-files/data.js +7 -13
- package/src/global-files/variables.js +4 -0
- package/src/index.js +11 -0
|
@@ -61,8 +61,6 @@ var _index = require("../../molecules/TagAndInput/index");
|
|
|
61
61
|
|
|
62
62
|
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
63
63
|
|
|
64
|
-
var _Commentary = require("../../atoms/Commentary");
|
|
65
|
-
|
|
66
64
|
var _GenericModal = require("../../atoms/GenericModal");
|
|
67
65
|
|
|
68
66
|
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
@@ -71,14 +69,16 @@ var _Loading = require("../../atoms/Loading");
|
|
|
71
69
|
|
|
72
70
|
var _genericModalCheck = _interopRequireDefault(require("../../../assets/images/genericModal/genericModalCheck.svg"));
|
|
73
71
|
|
|
74
|
-
var _errorModal = _interopRequireDefault(require("../../../assets/images/genericModal/errorModal.svg"));
|
|
75
|
-
|
|
76
72
|
var _VersionSelector = require("../../organisms/VersionSelector");
|
|
77
73
|
|
|
78
74
|
var _customHooks = require("../../../global-files/customHooks");
|
|
79
75
|
|
|
80
76
|
var _utils = require("./utils");
|
|
81
77
|
|
|
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, _product$services2, _datasheets$, _datasheets$$data, _product$
|
|
205
|
+
var _product$retailers, _location$state, _location$state2, _product$services2, _datasheets$, _datasheets$$data, _product$article17;
|
|
206
206
|
|
|
207
207
|
var tabsSections = _ref.tabsSections,
|
|
208
208
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -252,6 +252,11 @@ 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
|
+
|
|
255
260
|
var _useDropzone = (0, _reactDropzone.useDropzone)({
|
|
256
261
|
accept: "image/*",
|
|
257
262
|
noKeyboard: true,
|
|
@@ -296,149 +301,149 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
296
301
|
getRootProps = _useDropzone.getRootProps,
|
|
297
302
|
getInputProps = _useDropzone.getInputProps;
|
|
298
303
|
|
|
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
|
+
updatedDatasheets = _useState18[0],
|
|
307
|
+
setUpdatedDatasheets = _useState18[1];
|
|
308
308
|
|
|
309
|
-
var _useState19 = (0, _react.useState)(
|
|
309
|
+
var _useState19 = (0, _react.useState)([]),
|
|
310
310
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
updatedDescriptions = _useState20[0],
|
|
312
|
+
setUpdatedDescriptions = _useState20[1];
|
|
313
313
|
|
|
314
|
-
var _useState21 = (0, _react.useState)(),
|
|
314
|
+
var _useState21 = (0, _react.useState)(false),
|
|
315
315
|
_useState22 = (0, _slicedToArray2.default)(_useState21, 2),
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
imagesUploaded = _useState22[0],
|
|
317
|
+
setImagesUploaded = _useState22[1];
|
|
318
318
|
|
|
319
|
-
var _useState23 = (0, _react.useState)(
|
|
320
|
-
percentage: 0
|
|
321
|
-
})),
|
|
319
|
+
var _useState23 = (0, _react.useState)(),
|
|
322
320
|
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
dataImages = _useState24[0],
|
|
322
|
+
setDataImages = _useState24[1];
|
|
325
323
|
|
|
326
|
-
|
|
327
|
-
|
|
324
|
+
var _useState25 = (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
|
+
percentage: 0
|
|
326
|
+
})),
|
|
328
327
|
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
329
|
-
|
|
330
|
-
|
|
328
|
+
percentages = _useState26[0],
|
|
329
|
+
setPercentages = _useState26[1]; // const [percentages, setPercentages] = useState([{ retailers: {} }]);
|
|
331
330
|
|
|
332
|
-
|
|
331
|
+
|
|
332
|
+
var _useState27 = (0, _react.useState)(0),
|
|
333
333
|
_useState28 = (0, _slicedToArray2.default)(_useState27, 2),
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
activePercentage = _useState28[0],
|
|
335
|
+
setActivePercentage = _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
|
+
activeRetailer = _useState30[0],
|
|
340
|
+
setActiveRetailer = _useState30[1];
|
|
341
341
|
|
|
342
342
|
var _useState31 = (0, _react.useState)([]),
|
|
343
343
|
_useState32 = (0, _slicedToArray2.default)(_useState31, 2),
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
services = _useState32[0],
|
|
345
|
+
setServices = _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
|
+
servicesData = _useState34[0],
|
|
350
|
+
setServicesData = _useState34[1];
|
|
351
351
|
|
|
352
|
-
var _useState35 = (0, _react.useState)(
|
|
352
|
+
var _useState35 = (0, _react.useState)(""),
|
|
353
353
|
_useState36 = (0, _slicedToArray2.default)(_useState35, 2),
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
message = _useState36[0],
|
|
355
|
+
setMessage = _useState36[1];
|
|
356
356
|
|
|
357
|
-
var _useState37 = (0, _react.useState)(
|
|
357
|
+
var _useState37 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
|
|
358
358
|
_useState38 = (0, _slicedToArray2.default)(_useState37, 2),
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
product = _useState38[0],
|
|
360
|
+
setProduct = _useState38[1];
|
|
361
361
|
|
|
362
|
-
var _useState39 = (0, _react.useState)(
|
|
362
|
+
var _useState39 = (0, _react.useState)(null),
|
|
363
363
|
_useState40 = (0, _slicedToArray2.default)(_useState39, 2),
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
icon = _useState40[0],
|
|
365
|
+
setIcon = _useState40[1];
|
|
366
366
|
|
|
367
|
-
var _useState41 = (0, _react.useState)(
|
|
367
|
+
var _useState41 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
|
|
368
368
|
_useState42 = (0, _slicedToArray2.default)(_useState41, 2),
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
version = _useState42[0],
|
|
370
|
+
setVersion = _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
|
-
|
|
374
|
+
comments = _useState44[0],
|
|
375
|
+
setComments = _useState44[1];
|
|
376
|
+
|
|
377
|
+
var _useState45 = (0, _react.useState)(""),
|
|
378
|
+
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
379
|
+
comment = _useState46[0],
|
|
380
|
+
setComment = _useState46[1];
|
|
376
381
|
|
|
377
|
-
var
|
|
382
|
+
var _useState47 = (0, _react.useState)({
|
|
378
383
|
"Ficha técnica": 0,
|
|
379
384
|
Descripción: 0,
|
|
380
385
|
Imágenes: 0
|
|
381
386
|
}),
|
|
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
|
+
requiredNull = _useState48[0],
|
|
389
|
+
setRequiredNull = _useState48[1];
|
|
390
390
|
|
|
391
|
-
var _useState49 = (0, _react.useState)(
|
|
391
|
+
var _useState49 = (0, _react.useState)(false),
|
|
392
392
|
_useState50 = (0, _slicedToArray2.default)(_useState49, 2),
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
crossComment = _useState50[0],
|
|
394
|
+
setCrossComment = _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
|
+
userGroups = _useState52[0],
|
|
399
|
+
setUserGroups = _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
|
+
assig = _useState54[0],
|
|
404
|
+
setAssig = _useState54[1];
|
|
405
405
|
|
|
406
406
|
var _useState55 = (0, _react.useState)([]),
|
|
407
407
|
_useState56 = (0, _slicedToArray2.default)(_useState55, 2),
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
selectedImages = _useState56[0],
|
|
409
|
+
setSelectedImages = _useState56[1];
|
|
410
410
|
|
|
411
|
-
var _useState57 = (0, _react.useState)(
|
|
411
|
+
var _useState57 = (0, _react.useState)([]),
|
|
412
412
|
_useState58 = (0, _slicedToArray2.default)(_useState57, 2),
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
413
|
+
componentsArray = _useState58[0],
|
|
414
|
+
setComponentsArray = _useState58[1];
|
|
417
415
|
|
|
418
|
-
var _useState59 = (0, _react.useState)(
|
|
416
|
+
var _useState59 = (0, _react.useState)(false),
|
|
419
417
|
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
420
|
-
|
|
421
|
-
|
|
418
|
+
checkAll = _useState60[0],
|
|
419
|
+
setCheckAll = _useState60[1];
|
|
422
420
|
|
|
423
|
-
var
|
|
421
|
+
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
422
|
+
|
|
423
|
+
var _useState61 = (0, _react.useState)(true),
|
|
424
424
|
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
loading = _useState62[0],
|
|
426
|
+
setLoading = _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
|
+
retailerStatus = _useState64[0],
|
|
431
|
+
setRetailerStatus = _useState64[1];
|
|
432
432
|
|
|
433
|
-
var _useState65 = (0, _react.useState)(
|
|
433
|
+
var _useState65 = (0, _react.useState)([]),
|
|
434
434
|
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
statusArray = _useState66[0],
|
|
436
|
+
setStatusArray = _useState66[1];
|
|
437
437
|
|
|
438
|
-
var _useState67 = (0, _react.useState)(
|
|
438
|
+
var _useState67 = (0, _react.useState)(null),
|
|
439
439
|
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
socketType = _useState68[0],
|
|
441
|
+
setSocketType = _useState68[1];
|
|
442
|
+
|
|
443
|
+
var _useState69 = (0, _react.useState)(loading),
|
|
444
|
+
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
445
|
+
saving = _useState70[0],
|
|
446
|
+
setSaving = _useState70[1];
|
|
442
447
|
|
|
443
448
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
444
449
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
@@ -447,35 +452,55 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
447
452
|
|
|
448
453
|
var shotThd = [58, 59, 60, 61].includes(activeRetailer.id);
|
|
449
454
|
|
|
450
|
-
var
|
|
451
|
-
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
452
|
-
auditableVersion = _useState70[0],
|
|
453
|
-
setAuditableVersion = _useState70[1];
|
|
454
|
-
|
|
455
|
-
var _useState71 = (0, _react.useState)([]),
|
|
455
|
+
var _useState71 = (0, _react.useState)(null),
|
|
456
456
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
auditableVersion = _useState72[0],
|
|
458
|
+
setAuditableVersion = _useState72[1];
|
|
459
459
|
|
|
460
460
|
var _useState73 = (0, _react.useState)([]),
|
|
461
461
|
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
462
|
-
|
|
463
|
-
|
|
462
|
+
auditServices = _useState74[0],
|
|
463
|
+
setAuditServices = _useState74[1];
|
|
464
464
|
|
|
465
465
|
var _useState75 = (0, _react.useState)([]),
|
|
466
466
|
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
auditDatasheets = _useState76[0],
|
|
468
|
+
setAuditDatasheets = _useState76[1];
|
|
469
469
|
|
|
470
470
|
var _useState77 = (0, _react.useState)([]),
|
|
471
471
|
_useState78 = (0, _slicedToArray2.default)(_useState77, 2),
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
auditDescriptions = _useState78[0],
|
|
473
|
+
setAuditDescriptions = _useState78[1];
|
|
474
474
|
|
|
475
|
-
var _useState79 = (0, _react.useState)(
|
|
475
|
+
var _useState79 = (0, _react.useState)([]),
|
|
476
476
|
_useState80 = (0, _slicedToArray2.default)(_useState79, 2),
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
auditImages = _useState80[0],
|
|
478
|
+
setAuditImages = _useState80[1];
|
|
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];
|
|
479
504
|
|
|
480
505
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
481
506
|
var _ref3, id_article;
|
|
@@ -1015,6 +1040,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1015
1040
|
};
|
|
1016
1041
|
});
|
|
1017
1042
|
setSocketType(imageInputs);
|
|
1043
|
+
console.log(images);
|
|
1018
1044
|
}, [images]);
|
|
1019
1045
|
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
1020
1046
|
var _images$values3, _images$attrForImgs, _product$article14, _data$articleData, _data$articleData2, _data$updateImages;
|
|
@@ -1321,7 +1347,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1321
1347
|
|
|
1322
1348
|
var sendToFacilitator = /*#__PURE__*/function () {
|
|
1323
1349
|
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
|
|
1324
|
-
var concept, productTemp, evalStatus, articleId, orderId, body, res, _message, specialistDone, _JSON$parse5,
|
|
1350
|
+
var concept, productTemp, evalStatus, articleId, orderId, body, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus, messageToChat, data;
|
|
1325
1351
|
|
|
1326
1352
|
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1327
1353
|
while (1) {
|
|
@@ -1351,7 +1377,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1351
1377
|
|
|
1352
1378
|
body.isAproved = result === "A";
|
|
1353
1379
|
_context11.next = 12;
|
|
1354
|
-
return _axios.default.
|
|
1380
|
+
return _axios.default.post("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), body, {
|
|
1355
1381
|
headers: {
|
|
1356
1382
|
Authorization: token
|
|
1357
1383
|
}
|
|
@@ -1376,7 +1402,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1376
1402
|
}
|
|
1377
1403
|
|
|
1378
1404
|
_context11.next = 21;
|
|
1379
|
-
return _axios.default.
|
|
1405
|
+
return _axios.default.post("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), body, {
|
|
1380
1406
|
headers: {
|
|
1381
1407
|
Authorization: token
|
|
1382
1408
|
}
|
|
@@ -1387,40 +1413,59 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1387
1413
|
|
|
1388
1414
|
case 22:
|
|
1389
1415
|
if (!(res.data.statusCode === 200)) {
|
|
1390
|
-
_context11.next =
|
|
1416
|
+
_context11.next = 35;
|
|
1391
1417
|
break;
|
|
1392
1418
|
}
|
|
1393
1419
|
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1420
|
+
_JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
|
|
1421
|
+
messageToChat = (0, _utils.createMessage)(product.retailers, activeRetailer.id, evalStatus, newStatus, activeTab);
|
|
1422
|
+
data = {
|
|
1423
|
+
paramsBody: {
|
|
1424
|
+
id: product.article.id_article,
|
|
1425
|
+
version: version,
|
|
1426
|
+
items: [{
|
|
1427
|
+
type: "status",
|
|
1428
|
+
value: messageToChat
|
|
1429
|
+
}],
|
|
1430
|
+
retailerId: activeRetailer.id,
|
|
1431
|
+
status: product.status
|
|
1432
|
+
},
|
|
1433
|
+
paramsHeader: {
|
|
1434
|
+
Authorization: token
|
|
1435
|
+
}
|
|
1436
|
+
};
|
|
1437
|
+
_context11.next = 28;
|
|
1438
|
+
return (0, _utils.sendMessage)(data);
|
|
1439
|
+
|
|
1440
|
+
case 28:
|
|
1441
|
+
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
1442
|
+
productTemp["".concat(concept, "_status")] = newStatus;
|
|
1443
|
+
_context11.next = 32;
|
|
1399
1444
|
return loadData();
|
|
1400
1445
|
|
|
1401
|
-
case
|
|
1446
|
+
case 32:
|
|
1402
1447
|
if (_message) setMessage(_message);
|
|
1403
1448
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1404
1449
|
setProduct(productTemp);
|
|
1405
1450
|
|
|
1406
|
-
case
|
|
1407
|
-
_context11.next =
|
|
1451
|
+
case 35:
|
|
1452
|
+
_context11.next = 40;
|
|
1408
1453
|
break;
|
|
1409
1454
|
|
|
1410
|
-
case
|
|
1411
|
-
_context11.prev =
|
|
1455
|
+
case 37:
|
|
1456
|
+
_context11.prev = 37;
|
|
1412
1457
|
_context11.t0 = _context11["catch"](1);
|
|
1413
1458
|
console.log(_context11.t0);
|
|
1414
1459
|
|
|
1415
|
-
case
|
|
1460
|
+
case 40:
|
|
1416
1461
|
setLoading(false);
|
|
1417
1462
|
|
|
1418
|
-
case
|
|
1463
|
+
case 41:
|
|
1419
1464
|
case "end":
|
|
1420
1465
|
return _context11.stop();
|
|
1421
1466
|
}
|
|
1422
1467
|
}
|
|
1423
|
-
}, _callee11, null, [[1,
|
|
1468
|
+
}, _callee11, null, [[1, 37]]);
|
|
1424
1469
|
}));
|
|
1425
1470
|
|
|
1426
1471
|
return function sendToFacilitator(_x) {
|
|
@@ -1455,55 +1500,33 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1455
1500
|
};
|
|
1456
1501
|
|
|
1457
1502
|
var createComment = /*#__PURE__*/function () {
|
|
1458
|
-
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(
|
|
1459
|
-
var
|
|
1460
|
-
|
|
1461
|
-
|
|
1503
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1504
|
+
var messages,
|
|
1505
|
+
retailerId,
|
|
1506
|
+
data,
|
|
1507
|
+
_args12 = arguments;
|
|
1462
1508
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1463
1509
|
while (1) {
|
|
1464
1510
|
switch (_context12.prev = _context12.next) {
|
|
1465
1511
|
case 0:
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
_context12.next = _context12.t0 === "Ficha técnica" ? 4 : _context12.t0 === "Imágenes" ? 6 : 8;
|
|
1469
|
-
break;
|
|
1470
|
-
|
|
1471
|
-
case 4:
|
|
1472
|
-
concept = "datasheet";
|
|
1473
|
-
return _context12.abrupt("break", 10);
|
|
1474
|
-
|
|
1475
|
-
case 6:
|
|
1476
|
-
concept = "images";
|
|
1477
|
-
return _context12.abrupt("break", 10);
|
|
1478
|
-
|
|
1479
|
-
case 8:
|
|
1480
|
-
concept = "description";
|
|
1481
|
-
return _context12.abrupt("break", 10);
|
|
1482
|
-
|
|
1483
|
-
case 10:
|
|
1512
|
+
messages = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : [];
|
|
1513
|
+
retailerId = _args12.length > 1 ? _args12[1] : undefined;
|
|
1484
1514
|
data = {
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
headers: {
|
|
1515
|
+
paramsBody: {
|
|
1516
|
+
id: product.article.id_article,
|
|
1517
|
+
version: version,
|
|
1518
|
+
items: messages,
|
|
1519
|
+
retailerId: retailerId,
|
|
1520
|
+
status: product.status
|
|
1521
|
+
},
|
|
1522
|
+
paramsHeader: {
|
|
1494
1523
|
Authorization: token
|
|
1495
1524
|
}
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
case 13:
|
|
1499
|
-
_context12.next = 15;
|
|
1500
|
-
return getComments(tab);
|
|
1501
|
-
|
|
1502
|
-
case 15:
|
|
1525
|
+
};
|
|
1503
1526
|
setMessage("");
|
|
1504
|
-
|
|
1527
|
+
return _context12.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1505
1528
|
|
|
1506
|
-
case
|
|
1529
|
+
case 5:
|
|
1507
1530
|
case "end":
|
|
1508
1531
|
return _context12.stop();
|
|
1509
1532
|
}
|
|
@@ -1511,7 +1534,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1511
1534
|
}, _callee12);
|
|
1512
1535
|
}));
|
|
1513
1536
|
|
|
1514
|
-
return function createComment(
|
|
1537
|
+
return function createComment() {
|
|
1515
1538
|
return _ref15.apply(this, arguments);
|
|
1516
1539
|
};
|
|
1517
1540
|
}();
|
|
@@ -1626,7 +1649,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1626
1649
|
|
|
1627
1650
|
var setAssignation = /*#__PURE__*/function () {
|
|
1628
1651
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
|
|
1629
|
-
var _product$
|
|
1652
|
+
var _product$article16;
|
|
1630
1653
|
|
|
1631
1654
|
var concept, productTemp, data;
|
|
1632
1655
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
@@ -1656,7 +1679,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1656
1679
|
data = {
|
|
1657
1680
|
articleList: [{
|
|
1658
1681
|
orderId: product.orderId,
|
|
1659
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
1682
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article16 = product.article) === null || _product$article16 === void 0 ? void 0 : _product$article16.id_article
|
|
1660
1683
|
}],
|
|
1661
1684
|
concept: concept,
|
|
1662
1685
|
userId: assignationId
|
|
@@ -1683,7 +1706,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1683
1706
|
}, _callee14);
|
|
1684
1707
|
}));
|
|
1685
1708
|
|
|
1686
|
-
return function setAssignation(
|
|
1709
|
+
return function setAssignation(_x2, _x3) {
|
|
1687
1710
|
return _ref17.apply(this, arguments);
|
|
1688
1711
|
};
|
|
1689
1712
|
}();
|
|
@@ -1785,6 +1808,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1785
1808
|
};
|
|
1786
1809
|
|
|
1787
1810
|
(0, _react.useEffect)(function () {
|
|
1811
|
+
console.log(servicesData, "servicesData");
|
|
1788
1812
|
var status = getRetailerStatus(servicesData, activeTab);
|
|
1789
1813
|
setRetailerStatus(status);
|
|
1790
1814
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1797,7 +1821,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1797
1821
|
|
|
1798
1822
|
var validateAll = /*#__PURE__*/function () {
|
|
1799
1823
|
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(result) {
|
|
1800
|
-
var _product$id_order, evaluationArray, conceptArray,
|
|
1824
|
+
var _product$id_order, evaluationArray, conceptArray, messages, body, productTemp, messagesResponse;
|
|
1801
1825
|
|
|
1802
1826
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1803
1827
|
while (1) {
|
|
@@ -1824,8 +1848,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1824
1848
|
return _context15.abrupt("break", 13);
|
|
1825
1849
|
|
|
1826
1850
|
case 13:
|
|
1827
|
-
|
|
1828
|
-
retailersIds = [];
|
|
1851
|
+
messages = [];
|
|
1829
1852
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1830
1853
|
if (!retailersIds.includes(ret.id_retailer)) retailersIds.push(ret.id_retailer);
|
|
1831
1854
|
});
|
|
@@ -1839,44 +1862,49 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1839
1862
|
};
|
|
1840
1863
|
conceptArray.forEach(function (concept) {
|
|
1841
1864
|
body.service = concept;
|
|
1842
|
-
evaluationArray.push(_axios.default.
|
|
1865
|
+
evaluationArray.push(_axios.default.post("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), body, {
|
|
1843
1866
|
headers: {
|
|
1844
1867
|
Authorization: token
|
|
1845
1868
|
}
|
|
1846
1869
|
}));
|
|
1847
1870
|
});
|
|
1848
|
-
_context15.next =
|
|
1871
|
+
_context15.next = 19;
|
|
1849
1872
|
return Promise.all(evaluationArray);
|
|
1850
1873
|
|
|
1851
|
-
case
|
|
1874
|
+
case 19:
|
|
1852
1875
|
productTemp = product;
|
|
1853
1876
|
productTemp.status = "".concat(result, "A");
|
|
1854
|
-
productTemp.datasheet_status = productTemp.datasheet_status === "
|
|
1855
|
-
productTemp.description_status = productTemp.description_status === "
|
|
1856
|
-
productTemp.images_status = productTemp.images_status === "
|
|
1877
|
+
productTemp.datasheet_status = productTemp.datasheet_status === "NS" ? "NS" : "".concat(result, "A");
|
|
1878
|
+
productTemp.description_status = productTemp.description_status === "NS" ? "NS" : "".concat(result, "A");
|
|
1879
|
+
productTemp.images_status = productTemp.images_status === "NS" ? "NS" : "".concat(result, "A");
|
|
1857
1880
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1858
1881
|
setProduct(productTemp);
|
|
1859
|
-
_context15.next =
|
|
1882
|
+
_context15.next = 28;
|
|
1883
|
+
return Promise.all(messages);
|
|
1884
|
+
|
|
1885
|
+
case 28:
|
|
1886
|
+
messagesResponse = _context15.sent;
|
|
1887
|
+
_context15.next = 31;
|
|
1860
1888
|
return loadData();
|
|
1861
1889
|
|
|
1862
|
-
case
|
|
1863
|
-
_context15.next =
|
|
1890
|
+
case 31:
|
|
1891
|
+
_context15.next = 36;
|
|
1864
1892
|
break;
|
|
1865
1893
|
|
|
1866
|
-
case
|
|
1867
|
-
_context15.prev =
|
|
1894
|
+
case 33:
|
|
1895
|
+
_context15.prev = 33;
|
|
1868
1896
|
_context15.t1 = _context15["catch"](0);
|
|
1869
1897
|
console.log(_context15.t1);
|
|
1870
1898
|
|
|
1871
|
-
case
|
|
1899
|
+
case 36:
|
|
1872
1900
|
case "end":
|
|
1873
1901
|
return _context15.stop();
|
|
1874
1902
|
}
|
|
1875
1903
|
}
|
|
1876
|
-
}, _callee15, null, [[0,
|
|
1904
|
+
}, _callee15, null, [[0, 33]]);
|
|
1877
1905
|
}));
|
|
1878
1906
|
|
|
1879
|
-
return function validateAll(
|
|
1907
|
+
return function validateAll(_x4) {
|
|
1880
1908
|
return _ref18.apply(this, arguments);
|
|
1881
1909
|
};
|
|
1882
1910
|
}();
|
|
@@ -1889,8 +1917,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1889
1917
|
setCompare: setCompare,
|
|
1890
1918
|
isAuditor: [1, 6].includes(user.id_role),
|
|
1891
1919
|
withChat: location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.withChat,
|
|
1892
|
-
|
|
1893
|
-
|
|
1920
|
+
chatType: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.chatType,
|
|
1921
|
+
productSelected: product,
|
|
1922
|
+
token: token,
|
|
1923
|
+
activeRetailer: activeRetailer
|
|
1894
1924
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1895
1925
|
className: "data-container",
|
|
1896
1926
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -1932,27 +1962,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1932
1962
|
sendToFacilitator("A");
|
|
1933
1963
|
},
|
|
1934
1964
|
reject: function reject() {
|
|
1935
|
-
|
|
1936
|
-
setMessage("Rechazado");
|
|
1937
|
-
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1938
|
-
src: _errorModal.default
|
|
1939
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1940
|
-
text: "Agrega tu comentarios para enviar el rechazo",
|
|
1941
|
-
headerType: "input-name-header",
|
|
1942
|
-
color: "white"
|
|
1943
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1944
|
-
label: "Caja de Comentario",
|
|
1945
|
-
inputType: "textarea",
|
|
1946
|
-
inputId: "modal-commentary-box",
|
|
1947
|
-
index: 0,
|
|
1948
|
-
color: "white"
|
|
1949
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1950
|
-
buttonType: "general-default-button",
|
|
1951
|
-
label: "Enviar comentario",
|
|
1952
|
-
onClick: function onClick(e) {
|
|
1953
|
-
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1954
|
-
}
|
|
1955
|
-
})]);
|
|
1965
|
+
setShowRejectModal(true);
|
|
1956
1966
|
},
|
|
1957
1967
|
showApproveRejectAll: approveRejectAllButtons() && (auditorAssigned() || userAssigned()),
|
|
1958
1968
|
showValidationButtons: approveRejectButtons() && (auditorAssigned() || userAssigned()),
|
|
@@ -1960,27 +1970,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1960
1970
|
return validateAll("A");
|
|
1961
1971
|
},
|
|
1962
1972
|
rejectAll: function rejectAll() {
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1966
|
-
src: _errorModal.default
|
|
1967
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1968
|
-
text: "Agrega tu comentarios para enviar el rechazo",
|
|
1969
|
-
headerType: "input-name-header",
|
|
1970
|
-
color: "white"
|
|
1971
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1972
|
-
label: "Caja de Comentario",
|
|
1973
|
-
inputType: "textarea",
|
|
1974
|
-
inputId: "modal-commentary-box",
|
|
1975
|
-
index: 0,
|
|
1976
|
-
color: "white"
|
|
1977
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1978
|
-
buttonType: "general-default-button",
|
|
1979
|
-
label: "Enviar comentario",
|
|
1980
|
-
onClick: function onClick(e) {
|
|
1981
|
-
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1982
|
-
}
|
|
1983
|
-
})]);
|
|
1973
|
+
setShowRejectModal(true);
|
|
1974
|
+
setValRejAll(true);
|
|
1984
1975
|
}
|
|
1985
1976
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1986
1977
|
tabsSections: tabsSections,
|
|
@@ -1995,6 +1986,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1995
1986
|
isRetailer: isRetailer,
|
|
1996
1987
|
showSaveButton: auditorAssigned() || userAssigned(),
|
|
1997
1988
|
version: version,
|
|
1989
|
+
desc: desc,
|
|
1990
|
+
setDesc: setDesc,
|
|
1991
|
+
fich: fich,
|
|
1992
|
+
setFich: setFich,
|
|
1993
|
+
imag: imag,
|
|
1994
|
+
setImag: setImag,
|
|
1998
1995
|
updatedDescriptions: updatedDescriptions,
|
|
1999
1996
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2000
1997
|
updatedDatasheets: updatedDatasheets,
|
|
@@ -2052,7 +2049,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2052
2049
|
auditInputGroup: auditDescriptions[0],
|
|
2053
2050
|
updatedDescriptions: updatedDescriptions,
|
|
2054
2051
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2055
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
2052
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article17 = product.article) === null || _product$article17 === void 0 ? void 0 : _product$article17.id_article,
|
|
2056
2053
|
version: version,
|
|
2057
2054
|
dinamicHeight: true,
|
|
2058
2055
|
compare: compare
|
|
@@ -2073,57 +2070,15 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2073
2070
|
headerType: "input-name-header"
|
|
2074
2071
|
}))]
|
|
2075
2072
|
})
|
|
2076
|
-
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.
|
|
2073
|
+
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2077
2074
|
className: "commentary-box",
|
|
2078
|
-
children: [
|
|
2079
|
-
className: "commentary",
|
|
2080
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2081
|
-
label: "Caja de Comentario",
|
|
2082
|
-
inputType: "textarea",
|
|
2083
|
-
inputCols: 80,
|
|
2084
|
-
inputRows: 4,
|
|
2085
|
-
inputId: "commentary-box",
|
|
2086
|
-
index: 0
|
|
2087
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2088
|
-
className: "buttons-box",
|
|
2089
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2090
|
-
buttonType: "general-transparent-button",
|
|
2091
|
-
label: "Enviar comentario",
|
|
2092
|
-
onClick: function onClick(e) {
|
|
2093
|
-
return createComment(e, document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2094
|
-
}
|
|
2095
|
-
})
|
|
2096
|
-
})]
|
|
2097
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2098
|
-
className: "feedback-box",
|
|
2099
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2100
|
-
comment: comment === null || comment === void 0 ? void 0 : (_comment$message = comment.message) === null || _comment$message === void 0 ? void 0 : _comment$message.replace(/<.*?\/?>/gm, ""),
|
|
2101
|
-
reviewed: crossComment
|
|
2102
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2103
|
-
buttonType: "circular-button accept-button",
|
|
2104
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2105
|
-
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2106
|
-
while (1) {
|
|
2107
|
-
switch (_context16.prev = _context16.next) {
|
|
2108
|
-
case 0:
|
|
2109
|
-
setCrossComment(true);
|
|
2110
|
-
commentRevised();
|
|
2111
|
-
|
|
2112
|
-
case 2:
|
|
2113
|
-
case "end":
|
|
2114
|
-
return _context16.stop();
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
}, _callee16);
|
|
2118
|
-
}))
|
|
2119
|
-
})]
|
|
2120
|
-
}), [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2075
|
+
children: [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2121
2076
|
buttonType: evaluationFinished(user.id_role, activeTab, statusArray) && requiredNull[activeTab] === 0 ? "general-green-button" : "general-button-disabled",
|
|
2122
2077
|
label: "Enviar evaluación",
|
|
2123
2078
|
onClick: function onClick() {
|
|
2124
2079
|
return sendToFacilitator();
|
|
2125
2080
|
}
|
|
2126
|
-
})
|
|
2081
|
+
})
|
|
2127
2082
|
})]
|
|
2128
2083
|
})]
|
|
2129
2084
|
}), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
|
|
@@ -2152,6 +2107,53 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2152
2107
|
currentVersion: version,
|
|
2153
2108
|
setShowVersionSelector: setShowVersionSelector,
|
|
2154
2109
|
jwt: token
|
|
2110
|
+
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2111
|
+
title: "Agregar mensaje de rechazo para ".concat(activeTab === null || activeTab === void 0 ? void 0 : activeTab.toLowerCase()),
|
|
2112
|
+
show: showRejectModal,
|
|
2113
|
+
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2114
|
+
inputType: "textarea",
|
|
2115
|
+
inputId: "modal-message-box",
|
|
2116
|
+
index: 0,
|
|
2117
|
+
color: "white"
|
|
2118
|
+
}),
|
|
2119
|
+
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2120
|
+
type: "white",
|
|
2121
|
+
label: "Cancelar",
|
|
2122
|
+
size: 12,
|
|
2123
|
+
onClick: function onClick() {
|
|
2124
|
+
setShowRejectModal(false);
|
|
2125
|
+
}
|
|
2126
|
+
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2127
|
+
type: "pink",
|
|
2128
|
+
label: "Aceptar",
|
|
2129
|
+
size: 12,
|
|
2130
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2131
|
+
var body, messages;
|
|
2132
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2133
|
+
while (1) {
|
|
2134
|
+
switch (_context16.prev = _context16.next) {
|
|
2135
|
+
case 0:
|
|
2136
|
+
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2137
|
+
messages = [{
|
|
2138
|
+
type: "message",
|
|
2139
|
+
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2140
|
+
}];
|
|
2141
|
+
_context16.next = 4;
|
|
2142
|
+
return createComment(messages, activeRetailer.id);
|
|
2143
|
+
|
|
2144
|
+
case 4:
|
|
2145
|
+
valRejAll ? validateAll("R") : sendToFacilitator("R");
|
|
2146
|
+
setMessage("Rechazado");
|
|
2147
|
+
setShowRejectModal(false);
|
|
2148
|
+
|
|
2149
|
+
case 7:
|
|
2150
|
+
case "end":
|
|
2151
|
+
return _context16.stop();
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
}, _callee16);
|
|
2155
|
+
}))
|
|
2156
|
+
}, "btn-Aceptar")]
|
|
2155
2157
|
})]
|
|
2156
2158
|
});
|
|
2157
2159
|
};
|