contentoh-components-library 21.3.82 → 21.3.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.development +0 -5
- package/.env.production +0 -3
- package/dist/components/atoms/ButtonV2/styles.js +1 -1
- package/dist/components/atoms/Card/index.js +5 -46
- package/dist/components/atoms/Card/styles.js +1 -3
- package/dist/components/atoms/CheckBox/index.js +2 -4
- package/dist/components/atoms/GeneralInput/index.js +20 -24
- package/dist/components/atoms/InputFormatter/index.js +16 -14
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/TabsMenu/index.js +48 -22
- package/dist/components/molecules/TagAndInput/index.js +3 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +208 -359
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/FullTabsMenu/index.js +12 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +96 -171
- package/dist/components/pages/ProviderProductEdition/index.js +196 -189
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +28 -40
- package/dist/components/pages/RetailerProductEdition/index.js +290 -262
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/global-files/handle_http.js +2 -3
- package/dist/index.js +12 -51
- package/package.json +1 -3
- package/src/components/atoms/ButtonV2/styles.js +1 -1
- package/src/components/atoms/Card/index.js +2 -35
- package/src/components/atoms/Card/styles.js +5 -41
- package/src/components/atoms/CheckBox/index.js +0 -2
- package/src/components/atoms/GeneralInput/index.js +21 -20
- package/src/components/atoms/InputFormatter/index.js +18 -14
- package/src/components/atoms/InputFormatter/styles.js +1 -2
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/TabsMenu/index.js +88 -65
- package/src/components/molecules/TagAndInput/index.js +12 -10
- package/src/components/organisms/Chat/Chat.stories.js +7 -27
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
- package/src/components/organisms/Chat/ContentChat/index.js +23 -97
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +4 -46
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/FullTabsMenu/index.js +16 -4
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +98 -181
- package/src/components/pages/ProviderProductEdition/index.js +142 -134
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +26 -38
- package/src/components/pages/RetailerProductEdition/index.js +148 -111
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/global-files/handle_http.js +1 -2
- package/src/index.js +0 -3
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
- package/src/components/molecules/StripeCardForm/index.js +0 -42
- package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
- package/src/components/molecules/StripeCardForm/styles.js +0 -73
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
- package/src/components/molecules/StripeCardSelector/index.js +0 -44
- package/src/components/molecules/StripeCardSelector/styles.js +0 -4
- package/src/components/molecules/StripeCardSelector/utils.js +0 -17
- package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
- package/src/components/organisms/SideModal/index.js +0 -50
- package/src/components/organisms/SideModal/styles.js +0 -30
|
@@ -37,7 +37,7 @@ var _GalleryElement = require("../../molecules/GalleryElement");
|
|
|
37
37
|
|
|
38
38
|
var _fileSaver = require("file-saver");
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _data = require("../../../global-files/data");
|
|
41
41
|
|
|
42
42
|
var _GalleryHeader = require("../../molecules/GalleryHeader");
|
|
43
43
|
|
|
@@ -61,6 +61,8 @@ var _index = require("../../molecules/TagAndInput/index");
|
|
|
61
61
|
|
|
62
62
|
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
63
63
|
|
|
64
|
+
var _Commentary = require("../../atoms/Commentary");
|
|
65
|
+
|
|
64
66
|
var _GenericModal = require("../../atoms/GenericModal");
|
|
65
67
|
|
|
66
68
|
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
@@ -69,16 +71,14 @@ var _Loading = require("../../atoms/Loading");
|
|
|
69
71
|
|
|
70
72
|
var _genericModalCheck = _interopRequireDefault(require("../../../assets/images/genericModal/genericModalCheck.svg"));
|
|
71
73
|
|
|
74
|
+
var _errorModal = _interopRequireDefault(require("../../../assets/images/genericModal/errorModal.svg"));
|
|
75
|
+
|
|
72
76
|
var _VersionSelector = require("../../organisms/VersionSelector");
|
|
73
77
|
|
|
74
78
|
var _customHooks = require("../../../global-files/customHooks");
|
|
75
79
|
|
|
76
80
|
var _utils = require("./utils");
|
|
77
81
|
|
|
78
|
-
var _Modal = require("../../organisms/Modal");
|
|
79
|
-
|
|
80
|
-
var _ButtonV = require("../../atoms/ButtonV2");
|
|
81
|
-
|
|
82
82
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
83
83
|
|
|
84
84
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -202,7 +202,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
205
|
-
var _product$retailers, _location$state,
|
|
205
|
+
var _product$retailers, _location$state, _product$services2, _datasheets$, _datasheets$$data, _product$article18, _comment$message;
|
|
206
206
|
|
|
207
207
|
var tabsSections = _ref.tabsSections,
|
|
208
208
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -252,11 +252,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
252
252
|
showModal = _useState14[0],
|
|
253
253
|
setShowModal = _useState14[1];
|
|
254
254
|
|
|
255
|
-
var _useState15 = (0, _react.useState)(false),
|
|
256
|
-
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
257
|
-
showRejectModal = _useState16[0],
|
|
258
|
-
setShowRejectModal = _useState16[1];
|
|
259
|
-
|
|
260
255
|
var _useDropzone = (0, _reactDropzone.useDropzone)({
|
|
261
256
|
accept: "image/*",
|
|
262
257
|
noKeyboard: true,
|
|
@@ -301,149 +296,149 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
301
296
|
getRootProps = _useDropzone.getRootProps,
|
|
302
297
|
getInputProps = _useDropzone.getInputProps;
|
|
303
298
|
|
|
299
|
+
var _useState15 = (0, _react.useState)([]),
|
|
300
|
+
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
301
|
+
updatedDatasheets = _useState16[0],
|
|
302
|
+
setUpdatedDatasheets = _useState16[1];
|
|
303
|
+
|
|
304
304
|
var _useState17 = (0, _react.useState)([]),
|
|
305
305
|
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
updatedDescriptions = _useState18[0],
|
|
307
|
+
setUpdatedDescriptions = _useState18[1];
|
|
308
308
|
|
|
309
|
-
var _useState19 = (0, _react.useState)(
|
|
309
|
+
var _useState19 = (0, _react.useState)(false),
|
|
310
310
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
imagesUploaded = _useState20[0],
|
|
312
|
+
setImagesUploaded = _useState20[1];
|
|
313
313
|
|
|
314
|
-
var _useState21 = (0, _react.useState)(
|
|
314
|
+
var _useState21 = (0, _react.useState)(),
|
|
315
315
|
_useState22 = (0, _slicedToArray2.default)(_useState21, 2),
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
dataImages = _useState22[0],
|
|
317
|
+
setDataImages = _useState22[1];
|
|
318
318
|
|
|
319
|
-
var _useState23 = (0, _react.useState)()
|
|
320
|
-
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
321
|
-
dataImages = _useState24[0],
|
|
322
|
-
setDataImages = _useState24[1];
|
|
323
|
-
|
|
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({
|
|
319
|
+
var _useState23 = (0, _react.useState)(new Array(product === null || product === void 0 ? void 0 : (_product$retailers = product.retailers) === null || _product$retailers === void 0 ? void 0 : _product$retailers.length).fill({
|
|
325
320
|
percentage: 0
|
|
326
321
|
})),
|
|
327
|
-
|
|
328
|
-
percentages =
|
|
329
|
-
setPercentages =
|
|
322
|
+
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
323
|
+
percentages = _useState24[0],
|
|
324
|
+
setPercentages = _useState24[1]; // const [percentages, setPercentages] = useState([{ retailers: {} }]);
|
|
325
|
+
|
|
330
326
|
|
|
327
|
+
var _useState25 = (0, _react.useState)(0),
|
|
328
|
+
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
329
|
+
activePercentage = _useState26[0],
|
|
330
|
+
setActivePercentage = _useState26[1];
|
|
331
331
|
|
|
332
|
-
var _useState27 = (0, _react.useState)(
|
|
332
|
+
var _useState27 = (0, _react.useState)({}),
|
|
333
333
|
_useState28 = (0, _slicedToArray2.default)(_useState27, 2),
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
activeRetailer = _useState28[0],
|
|
335
|
+
setActiveRetailer = _useState28[1];
|
|
336
336
|
|
|
337
|
-
var _useState29 = (0, _react.useState)(
|
|
337
|
+
var _useState29 = (0, _react.useState)([]),
|
|
338
338
|
_useState30 = (0, _slicedToArray2.default)(_useState29, 2),
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
services = _useState30[0],
|
|
340
|
+
setServices = _useState30[1];
|
|
341
341
|
|
|
342
342
|
var _useState31 = (0, _react.useState)([]),
|
|
343
343
|
_useState32 = (0, _slicedToArray2.default)(_useState31, 2),
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
servicesData = _useState32[0],
|
|
345
|
+
setServicesData = _useState32[1];
|
|
346
346
|
|
|
347
|
-
var _useState33 = (0, _react.useState)(
|
|
347
|
+
var _useState33 = (0, _react.useState)(""),
|
|
348
348
|
_useState34 = (0, _slicedToArray2.default)(_useState33, 2),
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
message = _useState34[0],
|
|
350
|
+
setMessage = _useState34[1];
|
|
351
351
|
|
|
352
|
-
var _useState35 = (0, _react.useState)(""),
|
|
352
|
+
var _useState35 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
|
|
353
353
|
_useState36 = (0, _slicedToArray2.default)(_useState35, 2),
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
product = _useState36[0],
|
|
355
|
+
setProduct = _useState36[1];
|
|
356
356
|
|
|
357
|
-
var _useState37 = (0, _react.useState)(
|
|
357
|
+
var _useState37 = (0, _react.useState)(null),
|
|
358
358
|
_useState38 = (0, _slicedToArray2.default)(_useState37, 2),
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
icon = _useState38[0],
|
|
360
|
+
setIcon = _useState38[1];
|
|
361
361
|
|
|
362
|
-
var _useState39 = (0, _react.useState)(null),
|
|
362
|
+
var _useState39 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
|
|
363
363
|
_useState40 = (0, _slicedToArray2.default)(_useState39, 2),
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
version = _useState40[0],
|
|
365
|
+
setVersion = _useState40[1];
|
|
366
366
|
|
|
367
|
-
var _useState41 = (0, _react.useState)(
|
|
367
|
+
var _useState41 = (0, _react.useState)({}),
|
|
368
368
|
_useState42 = (0, _slicedToArray2.default)(_useState41, 2),
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
comments = _useState42[0],
|
|
370
|
+
setComments = _useState42[1];
|
|
371
371
|
|
|
372
|
-
var _useState43 = (0, _react.useState)(
|
|
372
|
+
var _useState43 = (0, _react.useState)(""),
|
|
373
373
|
_useState44 = (0, _slicedToArray2.default)(_useState43, 2),
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
comment = _useState44[0],
|
|
375
|
+
setComment = _useState44[1];
|
|
376
376
|
|
|
377
|
-
var _useState45 = (0, _react.useState)(
|
|
378
|
-
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
379
|
-
comment = _useState46[0],
|
|
380
|
-
setComment = _useState46[1];
|
|
381
|
-
|
|
382
|
-
var _useState47 = (0, _react.useState)({
|
|
377
|
+
var _useState45 = (0, _react.useState)({
|
|
383
378
|
"Ficha técnica": 0,
|
|
384
379
|
Descripción: 0,
|
|
385
380
|
Imágenes: 0
|
|
386
381
|
}),
|
|
382
|
+
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
383
|
+
requiredNull = _useState46[0],
|
|
384
|
+
setRequiredNull = _useState46[1];
|
|
385
|
+
|
|
386
|
+
var _useState47 = (0, _react.useState)(false),
|
|
387
387
|
_useState48 = (0, _slicedToArray2.default)(_useState47, 2),
|
|
388
|
-
|
|
389
|
-
|
|
388
|
+
crossComment = _useState48[0],
|
|
389
|
+
setCrossComment = _useState48[1];
|
|
390
390
|
|
|
391
|
-
var _useState49 = (0, _react.useState)(
|
|
391
|
+
var _useState49 = (0, _react.useState)([]),
|
|
392
392
|
_useState50 = (0, _slicedToArray2.default)(_useState49, 2),
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
userGroups = _useState50[0],
|
|
394
|
+
setUserGroups = _useState50[1];
|
|
395
395
|
|
|
396
|
-
var _useState51 = (0, _react.useState)(
|
|
396
|
+
var _useState51 = (0, _react.useState)({}),
|
|
397
397
|
_useState52 = (0, _slicedToArray2.default)(_useState51, 2),
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
assig = _useState52[0],
|
|
399
|
+
setAssig = _useState52[1];
|
|
400
400
|
|
|
401
|
-
var _useState53 = (0, _react.useState)(
|
|
401
|
+
var _useState53 = (0, _react.useState)([]),
|
|
402
402
|
_useState54 = (0, _slicedToArray2.default)(_useState53, 2),
|
|
403
|
-
|
|
404
|
-
|
|
403
|
+
selectedImages = _useState54[0],
|
|
404
|
+
setSelectedImages = _useState54[1];
|
|
405
405
|
|
|
406
406
|
var _useState55 = (0, _react.useState)([]),
|
|
407
407
|
_useState56 = (0, _slicedToArray2.default)(_useState55, 2),
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
componentsArray = _useState56[0],
|
|
409
|
+
setComponentsArray = _useState56[1];
|
|
410
410
|
|
|
411
|
-
var _useState57 = (0, _react.useState)(
|
|
411
|
+
var _useState57 = (0, _react.useState)(false),
|
|
412
412
|
_useState58 = (0, _slicedToArray2.default)(_useState57, 2),
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
var _useState59 = (0, _react.useState)(false),
|
|
417
|
-
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
418
|
-
checkAll = _useState60[0],
|
|
419
|
-
setCheckAll = _useState60[1];
|
|
413
|
+
checkAll = _useState58[0],
|
|
414
|
+
setCheckAll = _useState58[1];
|
|
420
415
|
|
|
421
416
|
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
422
417
|
|
|
423
|
-
var
|
|
418
|
+
var _useState59 = (0, _react.useState)(true),
|
|
419
|
+
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
420
|
+
loading = _useState60[0],
|
|
421
|
+
setLoading = _useState60[1];
|
|
422
|
+
|
|
423
|
+
var _useState61 = (0, _react.useState)("-"),
|
|
424
424
|
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
retailerStatus = _useState62[0],
|
|
426
|
+
setRetailerStatus = _useState62[1];
|
|
427
427
|
|
|
428
|
-
var _useState63 = (0, _react.useState)(
|
|
428
|
+
var _useState63 = (0, _react.useState)([]),
|
|
429
429
|
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
statusArray = _useState64[0],
|
|
431
|
+
setStatusArray = _useState64[1];
|
|
432
432
|
|
|
433
|
-
var _useState65 = (0, _react.useState)(
|
|
433
|
+
var _useState65 = (0, _react.useState)(null),
|
|
434
434
|
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
socketType = _useState66[0],
|
|
436
|
+
setSocketType = _useState66[1];
|
|
437
437
|
|
|
438
|
-
var _useState67 = (0, _react.useState)(
|
|
438
|
+
var _useState67 = (0, _react.useState)(loading),
|
|
439
439
|
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
var _useState69 = (0, _react.useState)(loading),
|
|
444
|
-
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
445
|
-
saving = _useState70[0],
|
|
446
|
-
setSaving = _useState70[1];
|
|
440
|
+
saving = _useState68[0],
|
|
441
|
+
setSaving = _useState68[1];
|
|
447
442
|
|
|
448
443
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
449
444
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
@@ -452,40 +447,50 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
452
447
|
|
|
453
448
|
var shotThd = [58, 59, 60, 61].includes(activeRetailer.id);
|
|
454
449
|
|
|
455
|
-
var
|
|
450
|
+
var _useState69 = (0, _react.useState)(null),
|
|
451
|
+
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
452
|
+
auditableVersion = _useState70[0],
|
|
453
|
+
setAuditableVersion = _useState70[1];
|
|
454
|
+
|
|
455
|
+
var _useState71 = (0, _react.useState)([]),
|
|
456
456
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
auditServices = _useState72[0],
|
|
458
|
+
setAuditServices = _useState72[1];
|
|
459
459
|
|
|
460
460
|
var _useState73 = (0, _react.useState)([]),
|
|
461
461
|
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
462
|
-
|
|
463
|
-
|
|
462
|
+
auditDatasheets = _useState74[0],
|
|
463
|
+
setAuditDatasheets = _useState74[1];
|
|
464
464
|
|
|
465
465
|
var _useState75 = (0, _react.useState)([]),
|
|
466
466
|
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
auditDescriptions = _useState76[0],
|
|
468
|
+
setAuditDescriptions = _useState76[1];
|
|
469
469
|
|
|
470
470
|
var _useState77 = (0, _react.useState)([]),
|
|
471
471
|
_useState78 = (0, _slicedToArray2.default)(_useState77, 2),
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
auditImages = _useState78[0],
|
|
473
|
+
setAuditImages = _useState78[1];
|
|
474
474
|
|
|
475
|
-
var _useState79 = (0, _react.useState)(
|
|
475
|
+
var _useState79 = (0, _react.useState)(false),
|
|
476
476
|
_useState80 = (0, _slicedToArray2.default)(_useState79, 2),
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
compare = _useState80[0],
|
|
478
|
+
setCompare = _useState80[1];
|
|
479
479
|
|
|
480
|
-
var _useState81 = (0, _react.useState)(
|
|
480
|
+
var _useState81 = (0, _react.useState)([]),
|
|
481
481
|
_useState82 = (0, _slicedToArray2.default)(_useState81, 2),
|
|
482
|
-
|
|
483
|
-
|
|
482
|
+
desc = _useState82[0],
|
|
483
|
+
setDesc = _useState82[1];
|
|
484
484
|
|
|
485
|
-
var _useState83 = (0, _react.useState)(
|
|
485
|
+
var _useState83 = (0, _react.useState)([]),
|
|
486
486
|
_useState84 = (0, _slicedToArray2.default)(_useState83, 2),
|
|
487
|
-
|
|
488
|
-
|
|
487
|
+
fich = _useState84[0],
|
|
488
|
+
setFich = _useState84[1];
|
|
489
|
+
|
|
490
|
+
var _useState85 = (0, _react.useState)([]),
|
|
491
|
+
_useState86 = (0, _slicedToArray2.default)(_useState85, 2),
|
|
492
|
+
imag = _useState86[0],
|
|
493
|
+
setImag = _useState86[1];
|
|
489
494
|
|
|
490
495
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
491
496
|
var _ref3, id_article;
|
|
@@ -526,7 +531,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
526
531
|
}
|
|
527
532
|
|
|
528
533
|
_context2.next = 3;
|
|
529
|
-
return (0,
|
|
534
|
+
return (0, _data.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article, product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category), auditableVersion.version);
|
|
530
535
|
|
|
531
536
|
case 3:
|
|
532
537
|
_auditServices = _context2.sent;
|
|
@@ -566,7 +571,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
566
571
|
case 0:
|
|
567
572
|
_context3.prev = 0;
|
|
568
573
|
_context3.next = 3;
|
|
569
|
-
return (0,
|
|
574
|
+
return (0, _data.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article, product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article6 = product.article) === null || _product$article6 === void 0 ? void 0 : _product$article6.id_category), version);
|
|
570
575
|
|
|
571
576
|
case 3:
|
|
572
577
|
_services = _context3.sent;
|
|
@@ -583,7 +588,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
583
588
|
init: _services[2]
|
|
584
589
|
});
|
|
585
590
|
if (((_services$ = _services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
|
|
586
|
-
(0,
|
|
591
|
+
(0, _data.getPercentage)({
|
|
587
592
|
data: [product]
|
|
588
593
|
}).then(function (res) {
|
|
589
594
|
return setPercentages(res[0]);
|
|
@@ -708,7 +713,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
708
713
|
getComments();
|
|
709
714
|
_context6.t0 = setUserGroups;
|
|
710
715
|
_context6.next = 6;
|
|
711
|
-
return (0,
|
|
716
|
+
return (0, _data.fetchUsers)(token);
|
|
712
717
|
|
|
713
718
|
case 6:
|
|
714
719
|
_context6.t1 = _context6.sent;
|
|
@@ -1328,7 +1333,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1328
1333
|
|
|
1329
1334
|
var sendToFacilitator = /*#__PURE__*/function () {
|
|
1330
1335
|
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
|
|
1331
|
-
var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus
|
|
1336
|
+
var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
|
|
1332
1337
|
|
|
1333
1338
|
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1334
1339
|
while (1) {
|
|
@@ -1391,59 +1396,39 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1391
1396
|
|
|
1392
1397
|
case 21:
|
|
1393
1398
|
if (!(res.data.statusCode === 200)) {
|
|
1394
|
-
_context11.next =
|
|
1399
|
+
_context11.next = 30;
|
|
1395
1400
|
break;
|
|
1396
1401
|
}
|
|
1397
1402
|
|
|
1398
1403
|
_JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
|
|
1399
|
-
messageToChat = (0, _utils.createMessage)(product.retailers, activeRetailer.id, evalStatus, newStatus, activeTab);
|
|
1400
|
-
_data = {
|
|
1401
|
-
paramsBody: {
|
|
1402
|
-
id: product.article.id_article,
|
|
1403
|
-
version: version,
|
|
1404
|
-
items: [{
|
|
1405
|
-
type: "status",
|
|
1406
|
-
value: messageToChat
|
|
1407
|
-
}],
|
|
1408
|
-
retailerId: activeRetailer.id,
|
|
1409
|
-
status: product.status
|
|
1410
|
-
},
|
|
1411
|
-
paramsHeader: {
|
|
1412
|
-
Authorization: token
|
|
1413
|
-
}
|
|
1414
|
-
};
|
|
1415
|
-
_context11.next = 27;
|
|
1416
|
-
return (0, _utils.sendMessage)(_data);
|
|
1417
|
-
|
|
1418
|
-
case 27:
|
|
1419
1404
|
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
1420
1405
|
productTemp["".concat(concept, "_status")] = newStatus;
|
|
1421
|
-
_context11.next =
|
|
1406
|
+
_context11.next = 27;
|
|
1422
1407
|
return loadData();
|
|
1423
1408
|
|
|
1424
|
-
case
|
|
1409
|
+
case 27:
|
|
1425
1410
|
if (_message) setMessage(_message);
|
|
1426
1411
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1427
1412
|
setProduct(productTemp);
|
|
1428
1413
|
|
|
1429
|
-
case
|
|
1430
|
-
_context11.next =
|
|
1414
|
+
case 30:
|
|
1415
|
+
_context11.next = 35;
|
|
1431
1416
|
break;
|
|
1432
1417
|
|
|
1433
|
-
case
|
|
1434
|
-
_context11.prev =
|
|
1418
|
+
case 32:
|
|
1419
|
+
_context11.prev = 32;
|
|
1435
1420
|
_context11.t0 = _context11["catch"](1);
|
|
1436
1421
|
console.log(_context11.t0);
|
|
1437
1422
|
|
|
1438
|
-
case
|
|
1423
|
+
case 35:
|
|
1439
1424
|
setLoading(false);
|
|
1440
1425
|
|
|
1441
|
-
case
|
|
1426
|
+
case 36:
|
|
1442
1427
|
case "end":
|
|
1443
1428
|
return _context11.stop();
|
|
1444
1429
|
}
|
|
1445
1430
|
}
|
|
1446
|
-
}, _callee11, null, [[1,
|
|
1431
|
+
}, _callee11, null, [[1, 32]]);
|
|
1447
1432
|
}));
|
|
1448
1433
|
|
|
1449
1434
|
return function sendToFacilitator(_x) {
|
|
@@ -1478,33 +1463,55 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1478
1463
|
};
|
|
1479
1464
|
|
|
1480
1465
|
var createComment = /*#__PURE__*/function () {
|
|
1481
|
-
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1482
|
-
var
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
_args12 = arguments;
|
|
1466
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(e, body, tab) {
|
|
1467
|
+
var _product$article16;
|
|
1468
|
+
|
|
1469
|
+
var concept, data;
|
|
1486
1470
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1487
1471
|
while (1) {
|
|
1488
1472
|
switch (_context12.prev = _context12.next) {
|
|
1489
1473
|
case 0:
|
|
1490
|
-
|
|
1491
|
-
|
|
1474
|
+
concept = "";
|
|
1475
|
+
_context12.t0 = activeTab;
|
|
1476
|
+
_context12.next = _context12.t0 === "Ficha técnica" ? 4 : _context12.t0 === "Imágenes" ? 6 : 8;
|
|
1477
|
+
break;
|
|
1478
|
+
|
|
1479
|
+
case 4:
|
|
1480
|
+
concept = "datasheet";
|
|
1481
|
+
return _context12.abrupt("break", 10);
|
|
1482
|
+
|
|
1483
|
+
case 6:
|
|
1484
|
+
concept = "images";
|
|
1485
|
+
return _context12.abrupt("break", 10);
|
|
1486
|
+
|
|
1487
|
+
case 8:
|
|
1488
|
+
concept = "description";
|
|
1489
|
+
return _context12.abrupt("break", 10);
|
|
1490
|
+
|
|
1491
|
+
case 10:
|
|
1492
1492
|
data = {
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1493
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article16 = product.article) === null || _product$article16 === void 0 ? void 0 : _product$article16.id_article,
|
|
1494
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1495
|
+
message: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, ""),
|
|
1496
|
+
concept: concept,
|
|
1497
|
+
version: version
|
|
1498
|
+
};
|
|
1499
|
+
_context12.next = 13;
|
|
1500
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1501
|
+
headers: {
|
|
1501
1502
|
Authorization: token
|
|
1502
1503
|
}
|
|
1503
|
-
};
|
|
1504
|
+
});
|
|
1505
|
+
|
|
1506
|
+
case 13:
|
|
1507
|
+
_context12.next = 15;
|
|
1508
|
+
return getComments(tab);
|
|
1509
|
+
|
|
1510
|
+
case 15:
|
|
1504
1511
|
setMessage("");
|
|
1505
|
-
|
|
1512
|
+
setComponentsArray([]);
|
|
1506
1513
|
|
|
1507
|
-
case
|
|
1514
|
+
case 17:
|
|
1508
1515
|
case "end":
|
|
1509
1516
|
return _context12.stop();
|
|
1510
1517
|
}
|
|
@@ -1512,7 +1519,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1512
1519
|
}, _callee12);
|
|
1513
1520
|
}));
|
|
1514
1521
|
|
|
1515
|
-
return function createComment() {
|
|
1522
|
+
return function createComment(_x2, _x3, _x4) {
|
|
1516
1523
|
return _ref15.apply(this, arguments);
|
|
1517
1524
|
};
|
|
1518
1525
|
}();
|
|
@@ -1627,7 +1634,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1627
1634
|
|
|
1628
1635
|
var setAssignation = /*#__PURE__*/function () {
|
|
1629
1636
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
|
|
1630
|
-
var _product$
|
|
1637
|
+
var _product$article17;
|
|
1631
1638
|
|
|
1632
1639
|
var concept, productTemp, data;
|
|
1633
1640
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
@@ -1657,7 +1664,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1657
1664
|
data = {
|
|
1658
1665
|
articleList: [{
|
|
1659
1666
|
orderId: product.orderId,
|
|
1660
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
1667
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article17 = product.article) === null || _product$article17 === void 0 ? void 0 : _product$article17.id_article
|
|
1661
1668
|
}],
|
|
1662
1669
|
concept: concept,
|
|
1663
1670
|
userId: assignationId
|
|
@@ -1684,7 +1691,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1684
1691
|
}, _callee14);
|
|
1685
1692
|
}));
|
|
1686
1693
|
|
|
1687
|
-
return function setAssignation(
|
|
1694
|
+
return function setAssignation(_x5, _x6) {
|
|
1688
1695
|
return _ref17.apply(this, arguments);
|
|
1689
1696
|
};
|
|
1690
1697
|
}();
|
|
@@ -1798,7 +1805,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1798
1805
|
|
|
1799
1806
|
var validateAll = /*#__PURE__*/function () {
|
|
1800
1807
|
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(result) {
|
|
1801
|
-
var evaluationArray, conceptArray,
|
|
1808
|
+
var evaluationArray, conceptArray, productTemp;
|
|
1802
1809
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1803
1810
|
while (1) {
|
|
1804
1811
|
switch (_context15.prev = _context15.next) {
|
|
@@ -1824,7 +1831,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1824
1831
|
return _context15.abrupt("break", 13);
|
|
1825
1832
|
|
|
1826
1833
|
case 13:
|
|
1827
|
-
messages = [];
|
|
1828
1834
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1829
1835
|
if (conceptArray.includes(ret.service)) {
|
|
1830
1836
|
var _product$id_order;
|
|
@@ -1837,16 +1843,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1837
1843
|
evalStatus: ret.status,
|
|
1838
1844
|
retailerId: ret.id_retailer
|
|
1839
1845
|
};
|
|
1840
|
-
|
|
1841
|
-
if (product["".concat(ret.service, "_status")] !== "NS") {
|
|
1842
|
-
var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
|
|
1843
|
-
|
|
1844
|
-
messages.push(createComment([{
|
|
1845
|
-
type: "status",
|
|
1846
|
-
value: _message2
|
|
1847
|
-
}], ret.id_retailer));
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
1846
|
evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1851
1847
|
headers: {
|
|
1852
1848
|
Authorization: token
|
|
@@ -1854,43 +1850,38 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1854
1850
|
}));
|
|
1855
1851
|
}
|
|
1856
1852
|
});
|
|
1857
|
-
_context15.next =
|
|
1853
|
+
_context15.next = 16;
|
|
1858
1854
|
return Promise.all(evaluationArray);
|
|
1859
1855
|
|
|
1860
|
-
case
|
|
1856
|
+
case 16:
|
|
1861
1857
|
productTemp = product;
|
|
1862
1858
|
productTemp.status = "".concat(result, "A");
|
|
1863
|
-
productTemp.datasheet_status = productTemp.datasheet_status === "
|
|
1864
|
-
productTemp.description_status = productTemp.description_status === "
|
|
1865
|
-
productTemp.images_status = productTemp.images_status === "
|
|
1859
|
+
productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : "".concat(result, "A");
|
|
1860
|
+
productTemp.description_status = productTemp.description_status === "NA" ? "NA" : "".concat(result, "A");
|
|
1861
|
+
productTemp.images_status = productTemp.images_status === "NA" ? "NA" : "".concat(result, "A");
|
|
1866
1862
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1867
1863
|
setProduct(productTemp);
|
|
1868
|
-
_context15.next =
|
|
1869
|
-
return Promise.all(messages);
|
|
1870
|
-
|
|
1871
|
-
case 26:
|
|
1872
|
-
messagesResponse = _context15.sent;
|
|
1873
|
-
_context15.next = 29;
|
|
1864
|
+
_context15.next = 25;
|
|
1874
1865
|
return loadData();
|
|
1875
1866
|
|
|
1876
|
-
case
|
|
1877
|
-
_context15.next =
|
|
1867
|
+
case 25:
|
|
1868
|
+
_context15.next = 30;
|
|
1878
1869
|
break;
|
|
1879
1870
|
|
|
1880
|
-
case
|
|
1881
|
-
_context15.prev =
|
|
1871
|
+
case 27:
|
|
1872
|
+
_context15.prev = 27;
|
|
1882
1873
|
_context15.t1 = _context15["catch"](0);
|
|
1883
1874
|
console.log(_context15.t1);
|
|
1884
1875
|
|
|
1885
|
-
case
|
|
1876
|
+
case 30:
|
|
1886
1877
|
case "end":
|
|
1887
1878
|
return _context15.stop();
|
|
1888
1879
|
}
|
|
1889
1880
|
}
|
|
1890
|
-
}, _callee15, null, [[0,
|
|
1881
|
+
}, _callee15, null, [[0, 27]]);
|
|
1891
1882
|
}));
|
|
1892
1883
|
|
|
1893
|
-
return function validateAll(
|
|
1884
|
+
return function validateAll(_x7) {
|
|
1894
1885
|
return _ref18.apply(this, arguments);
|
|
1895
1886
|
};
|
|
1896
1887
|
}();
|
|
@@ -1903,10 +1894,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1903
1894
|
setCompare: setCompare,
|
|
1904
1895
|
isAuditor: [1, 6].includes(user.id_role),
|
|
1905
1896
|
withChat: location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.withChat,
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
token: token,
|
|
1909
|
-
activeRetailer: activeRetailer
|
|
1897
|
+
productSelected: productSelected,
|
|
1898
|
+
token: token
|
|
1910
1899
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1911
1900
|
className: "data-container",
|
|
1912
1901
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -1948,7 +1937,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1948
1937
|
sendToFacilitator("A");
|
|
1949
1938
|
},
|
|
1950
1939
|
reject: function reject() {
|
|
1951
|
-
|
|
1940
|
+
sendToFacilitator("R");
|
|
1941
|
+
setMessage("Rechazado");
|
|
1942
|
+
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1943
|
+
src: _errorModal.default
|
|
1944
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1945
|
+
text: "Agrega tu comentarios para enviar el rechazo",
|
|
1946
|
+
headerType: "input-name-header",
|
|
1947
|
+
color: "white"
|
|
1948
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1949
|
+
label: "Caja de Comentario",
|
|
1950
|
+
inputType: "textarea",
|
|
1951
|
+
inputId: "modal-commentary-box",
|
|
1952
|
+
index: 0,
|
|
1953
|
+
color: "white"
|
|
1954
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1955
|
+
buttonType: "general-default-button",
|
|
1956
|
+
label: "Enviar comentario",
|
|
1957
|
+
onClick: function onClick(e) {
|
|
1958
|
+
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1959
|
+
}
|
|
1960
|
+
})]);
|
|
1952
1961
|
},
|
|
1953
1962
|
showApproveRejectAll: approveRejectAllButtons() && (auditorAssigned() || userAssigned()),
|
|
1954
1963
|
showValidationButtons: approveRejectButtons() && (auditorAssigned() || userAssigned()),
|
|
@@ -1956,8 +1965,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1956
1965
|
return validateAll("A");
|
|
1957
1966
|
},
|
|
1958
1967
|
rejectAll: function rejectAll() {
|
|
1959
|
-
|
|
1960
|
-
|
|
1968
|
+
validateAll("R");
|
|
1969
|
+
setMessage("Rechazado");
|
|
1970
|
+
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1971
|
+
src: _errorModal.default
|
|
1972
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1973
|
+
text: "Agrega tu comentarios para enviar el rechazo",
|
|
1974
|
+
headerType: "input-name-header",
|
|
1975
|
+
color: "white"
|
|
1976
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1977
|
+
label: "Caja de Comentario",
|
|
1978
|
+
inputType: "textarea",
|
|
1979
|
+
inputId: "modal-commentary-box",
|
|
1980
|
+
index: 0,
|
|
1981
|
+
color: "white"
|
|
1982
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1983
|
+
buttonType: "general-default-button",
|
|
1984
|
+
label: "Enviar comentario",
|
|
1985
|
+
onClick: function onClick(e) {
|
|
1986
|
+
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1987
|
+
}
|
|
1988
|
+
})]);
|
|
1961
1989
|
}
|
|
1962
1990
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1963
1991
|
tabsSections: tabsSections,
|
|
@@ -1972,9 +2000,14 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1972
2000
|
isRetailer: isRetailer,
|
|
1973
2001
|
showSaveButton: auditorAssigned() || userAssigned(),
|
|
1974
2002
|
version: version,
|
|
2003
|
+
desc: desc,
|
|
2004
|
+
setDesc: setDesc,
|
|
2005
|
+
fich: fich,
|
|
2006
|
+
setFich: setFich,
|
|
2007
|
+
imag: imag,
|
|
2008
|
+
setImag: setImag,
|
|
1975
2009
|
updatedDescriptions: updatedDescriptions,
|
|
1976
2010
|
updatedDatasheets: updatedDatasheets,
|
|
1977
|
-
images: images,
|
|
1978
2011
|
selectedImages: selectedImages,
|
|
1979
2012
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
1980
2013
|
setUpdatedDatasheets: setUpdatedDatasheets,
|
|
@@ -2028,7 +2061,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2028
2061
|
auditInputGroup: auditDescriptions[0],
|
|
2029
2062
|
updatedDescriptions: updatedDescriptions,
|
|
2030
2063
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2031
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
2064
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article18 = product.article) === null || _product$article18 === void 0 ? void 0 : _product$article18.id_article,
|
|
2032
2065
|
version: version,
|
|
2033
2066
|
dinamicHeight: true,
|
|
2034
2067
|
compare: compare
|
|
@@ -2049,15 +2082,57 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2049
2082
|
headerType: "input-name-header"
|
|
2050
2083
|
}))]
|
|
2051
2084
|
})
|
|
2052
|
-
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.
|
|
2085
|
+
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2053
2086
|
className: "commentary-box",
|
|
2054
|
-
children: [
|
|
2087
|
+
children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2088
|
+
className: "commentary",
|
|
2089
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2090
|
+
label: "Caja de Comentario",
|
|
2091
|
+
inputType: "textarea",
|
|
2092
|
+
inputCols: 80,
|
|
2093
|
+
inputRows: 4,
|
|
2094
|
+
inputId: "commentary-box",
|
|
2095
|
+
index: 0
|
|
2096
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2097
|
+
className: "buttons-box",
|
|
2098
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2099
|
+
buttonType: "general-transparent-button",
|
|
2100
|
+
label: "Enviar comentario",
|
|
2101
|
+
onClick: function onClick(e) {
|
|
2102
|
+
return createComment(e, document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2103
|
+
}
|
|
2104
|
+
})
|
|
2105
|
+
})]
|
|
2106
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2107
|
+
className: "feedback-box",
|
|
2108
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2109
|
+
comment: comment === null || comment === void 0 ? void 0 : (_comment$message = comment.message) === null || _comment$message === void 0 ? void 0 : _comment$message.replace(/<.*?\/?>/gm, ""),
|
|
2110
|
+
reviewed: crossComment
|
|
2111
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2112
|
+
buttonType: "circular-button accept-button",
|
|
2113
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2114
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2115
|
+
while (1) {
|
|
2116
|
+
switch (_context16.prev = _context16.next) {
|
|
2117
|
+
case 0:
|
|
2118
|
+
setCrossComment(true);
|
|
2119
|
+
commentRevised();
|
|
2120
|
+
|
|
2121
|
+
case 2:
|
|
2122
|
+
case "end":
|
|
2123
|
+
return _context16.stop();
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
}, _callee16);
|
|
2127
|
+
}))
|
|
2128
|
+
})]
|
|
2129
|
+
}), [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2055
2130
|
buttonType: evaluationFinished(user.id_role, activeTab, statusArray) && requiredNull[activeTab] === 0 ? "general-green-button" : "general-button-disabled",
|
|
2056
2131
|
label: "Enviar evaluación",
|
|
2057
2132
|
onClick: function onClick() {
|
|
2058
2133
|
return sendToFacilitator();
|
|
2059
2134
|
}
|
|
2060
|
-
})
|
|
2135
|
+
})]
|
|
2061
2136
|
})]
|
|
2062
2137
|
})]
|
|
2063
2138
|
}), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
|
|
@@ -2086,53 +2161,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2086
2161
|
currentVersion: version,
|
|
2087
2162
|
setShowVersionSelector: setShowVersionSelector,
|
|
2088
2163
|
jwt: token
|
|
2089
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2090
|
-
title: "Agregar mensaje de rechazo para ".concat(activeTab === null || activeTab === void 0 ? void 0 : activeTab.toLowerCase()),
|
|
2091
|
-
show: showRejectModal,
|
|
2092
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2093
|
-
inputType: "textarea",
|
|
2094
|
-
inputId: "modal-message-box",
|
|
2095
|
-
index: 0,
|
|
2096
|
-
color: "white"
|
|
2097
|
-
}),
|
|
2098
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2099
|
-
type: "white",
|
|
2100
|
-
label: "Cancelar",
|
|
2101
|
-
size: 12,
|
|
2102
|
-
onClick: function onClick() {
|
|
2103
|
-
setShowRejectModal(false);
|
|
2104
|
-
}
|
|
2105
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2106
|
-
type: "pink",
|
|
2107
|
-
label: "Aceptar",
|
|
2108
|
-
size: 12,
|
|
2109
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2110
|
-
var body, messages;
|
|
2111
|
-
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2112
|
-
while (1) {
|
|
2113
|
-
switch (_context16.prev = _context16.next) {
|
|
2114
|
-
case 0:
|
|
2115
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2116
|
-
messages = [{
|
|
2117
|
-
type: "message",
|
|
2118
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2119
|
-
}];
|
|
2120
|
-
_context16.next = 4;
|
|
2121
|
-
return createComment(messages, activeRetailer.id);
|
|
2122
|
-
|
|
2123
|
-
case 4:
|
|
2124
|
-
valRejAll ? validateAll("R") : sendToFacilitator("R");
|
|
2125
|
-
setMessage("Rechazado");
|
|
2126
|
-
setShowRejectModal(false);
|
|
2127
|
-
|
|
2128
|
-
case 7:
|
|
2129
|
-
case "end":
|
|
2130
|
-
return _context16.stop();
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
}, _callee16);
|
|
2134
|
-
}))
|
|
2135
|
-
}, "btn-Aceptar")]
|
|
2136
2164
|
})]
|
|
2137
2165
|
});
|
|
2138
2166
|
};
|