contentoh-components-library 21.4.9 → 21.4.11
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 +5 -1
- package/.env.production +3 -1
- package/dist/components/atoms/Avatar/index.js +3 -2
- package/dist/components/atoms/Card/index.js +46 -5
- package/dist/components/atoms/Card/styles.js +3 -1
- package/dist/components/atoms/CheckBox/index.js +7 -2
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/atoms/UserCatalog/index.js +2 -2
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/GridItem/styles.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +68 -11
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- 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/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +37 -4
- package/dist/components/pages/ProviderProductEdition/index.js +188 -175
- 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 +288 -273
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
- package/dist/index.js +234 -52
- package/package.json +4 -1
- package/src/components/atoms/Avatar/index.js +8 -2
- package/src/components/atoms/Card/index.js +35 -2
- package/src/components/atoms/Card/styles.js +41 -5
- package/src/components/atoms/CheckBox/index.js +4 -1
- 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/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/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
- package/src/components/molecules/GridItem/index.js +97 -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/StripeCardForm/StripeCardForm.stories.js +13 -0
- package/src/components/molecules/StripeCardForm/index.js +42 -0
- package/src/components/molecules/StripeCardForm/paymentForm.js +124 -0
- package/src/components/molecules/StripeCardForm/styles.js +73 -0
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -0
- package/src/components/molecules/StripeCardSelector/index.js +44 -0
- package/src/components/molecules/StripeCardSelector/styles.js +4 -0
- package/src/components/molecules/StripeCardSelector/utils.js +17 -0
- package/src/components/molecules/TagAndInput/index.js +10 -8
- 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 +10 -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/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/Modal/styles.js +4 -1
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
- package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
- package/src/components/organisms/SideModal/index.js +50 -0
- package/src/components/organisms/SideModal/styles.js +30 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +40 -1
- package/src/components/pages/ProviderProductEdition/index.js +132 -129
- 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 +121 -135
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/index.js +15 -0
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
|
@@ -37,7 +37,7 @@ var _GalleryElement = require("../../molecules/GalleryElement");
|
|
|
37
37
|
|
|
38
38
|
var _fileSaver = require("file-saver");
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _data2 = require("../../../global-files/data");
|
|
41
41
|
|
|
42
42
|
var _GalleryHeader = require("../../molecules/GalleryHeader");
|
|
43
43
|
|
|
@@ -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
|
-
|
|
325
|
-
|
|
321
|
+
dataImages = _useState24[0],
|
|
322
|
+
setDataImages = _useState24[1];
|
|
326
323
|
|
|
327
|
-
var _useState25 = (0, _react.useState)(0)
|
|
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: {} }]);
|
|
330
|
+
|
|
331
331
|
|
|
332
|
-
var _useState27 = (0, _react.useState)(
|
|
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
376
|
|
|
377
|
-
var _useState45 = (0, _react.useState)(
|
|
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)({
|
|
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];
|
|
420
|
+
|
|
421
|
+
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
422
422
|
|
|
423
|
-
var _useState61 = (0, _react.useState)(
|
|
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;
|
|
@@ -516,7 +541,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
516
541
|
}
|
|
517
542
|
|
|
518
543
|
_context2.next = 3;
|
|
519
|
-
return (0,
|
|
544
|
+
return (0, _data2.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);
|
|
520
545
|
|
|
521
546
|
case 3:
|
|
522
547
|
_auditServices = _context2.sent;
|
|
@@ -556,7 +581,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
556
581
|
case 0:
|
|
557
582
|
_context3.prev = 0;
|
|
558
583
|
_context3.next = 3;
|
|
559
|
-
return (0,
|
|
584
|
+
return (0, _data2.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);
|
|
560
585
|
|
|
561
586
|
case 3:
|
|
562
587
|
_services = _context3.sent;
|
|
@@ -573,7 +598,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
573
598
|
init: _services[2]
|
|
574
599
|
});
|
|
575
600
|
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);
|
|
576
|
-
(0,
|
|
601
|
+
(0, _data2.getPercentage)({
|
|
577
602
|
data: [product]
|
|
578
603
|
}).then(function (res) {
|
|
579
604
|
return setPercentages(res[0]);
|
|
@@ -698,7 +723,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
698
723
|
getComments();
|
|
699
724
|
_context6.t0 = setUserGroups;
|
|
700
725
|
_context6.next = 6;
|
|
701
|
-
return (0,
|
|
726
|
+
return (0, _data2.fetchUsers)(token);
|
|
702
727
|
|
|
703
728
|
case 6:
|
|
704
729
|
_context6.t1 = _context6.sent;
|
|
@@ -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, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
|
|
1350
|
+
var concept, productTemp, evalStatus, articleId, orderId, data, 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) {
|
|
@@ -1384,39 +1410,59 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1384
1410
|
|
|
1385
1411
|
case 21:
|
|
1386
1412
|
if (!(res.data.statusCode === 200)) {
|
|
1387
|
-
_context11.next =
|
|
1413
|
+
_context11.next = 34;
|
|
1388
1414
|
break;
|
|
1389
1415
|
}
|
|
1390
1416
|
|
|
1391
1417
|
_JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
|
|
1418
|
+
messageToChat = (0, _utils.createMessage)(product.retailers, activeRetailer.id, evalStatus, newStatus, activeTab);
|
|
1419
|
+
_data = {
|
|
1420
|
+
paramsBody: {
|
|
1421
|
+
id: product.article.id_article,
|
|
1422
|
+
version: version,
|
|
1423
|
+
items: [{
|
|
1424
|
+
type: "status",
|
|
1425
|
+
value: messageToChat
|
|
1426
|
+
}],
|
|
1427
|
+
retailerId: activeRetailer.id,
|
|
1428
|
+
status: product.status
|
|
1429
|
+
},
|
|
1430
|
+
paramsHeader: {
|
|
1431
|
+
Authorization: token
|
|
1432
|
+
}
|
|
1433
|
+
};
|
|
1434
|
+
_context11.next = 27;
|
|
1435
|
+
return (0, _utils.sendMessage)(_data);
|
|
1436
|
+
|
|
1437
|
+
case 27:
|
|
1392
1438
|
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
1393
1439
|
productTemp["".concat(concept, "_status")] = newStatus;
|
|
1394
|
-
_context11.next =
|
|
1440
|
+
_context11.next = 31;
|
|
1395
1441
|
return loadData();
|
|
1396
1442
|
|
|
1397
|
-
case
|
|
1443
|
+
case 31:
|
|
1398
1444
|
if (_message) setMessage(_message);
|
|
1399
1445
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1400
1446
|
setProduct(productTemp);
|
|
1401
1447
|
|
|
1402
|
-
case
|
|
1403
|
-
_context11.next =
|
|
1448
|
+
case 34:
|
|
1449
|
+
_context11.next = 39;
|
|
1404
1450
|
break;
|
|
1405
1451
|
|
|
1406
|
-
case
|
|
1407
|
-
_context11.prev =
|
|
1452
|
+
case 36:
|
|
1453
|
+
_context11.prev = 36;
|
|
1408
1454
|
_context11.t0 = _context11["catch"](1);
|
|
1409
1455
|
console.log(_context11.t0);
|
|
1410
1456
|
|
|
1411
|
-
case
|
|
1457
|
+
case 39:
|
|
1412
1458
|
setLoading(false);
|
|
1413
1459
|
|
|
1414
|
-
case
|
|
1460
|
+
case 40:
|
|
1415
1461
|
case "end":
|
|
1416
1462
|
return _context11.stop();
|
|
1417
1463
|
}
|
|
1418
1464
|
}
|
|
1419
|
-
}, _callee11, null, [[1,
|
|
1465
|
+
}, _callee11, null, [[1, 36]]);
|
|
1420
1466
|
}));
|
|
1421
1467
|
|
|
1422
1468
|
return function sendToFacilitator(_x) {
|
|
@@ -1451,55 +1497,33 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1451
1497
|
};
|
|
1452
1498
|
|
|
1453
1499
|
var createComment = /*#__PURE__*/function () {
|
|
1454
|
-
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(
|
|
1455
|
-
var
|
|
1456
|
-
|
|
1457
|
-
|
|
1500
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1501
|
+
var messages,
|
|
1502
|
+
retailerId,
|
|
1503
|
+
data,
|
|
1504
|
+
_args12 = arguments;
|
|
1458
1505
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1459
1506
|
while (1) {
|
|
1460
1507
|
switch (_context12.prev = _context12.next) {
|
|
1461
1508
|
case 0:
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
_context12.next = _context12.t0 === "Ficha técnica" ? 4 : _context12.t0 === "Imágenes" ? 6 : 8;
|
|
1465
|
-
break;
|
|
1466
|
-
|
|
1467
|
-
case 4:
|
|
1468
|
-
concept = "datasheet";
|
|
1469
|
-
return _context12.abrupt("break", 10);
|
|
1470
|
-
|
|
1471
|
-
case 6:
|
|
1472
|
-
concept = "images";
|
|
1473
|
-
return _context12.abrupt("break", 10);
|
|
1474
|
-
|
|
1475
|
-
case 8:
|
|
1476
|
-
concept = "description";
|
|
1477
|
-
return _context12.abrupt("break", 10);
|
|
1478
|
-
|
|
1479
|
-
case 10:
|
|
1509
|
+
messages = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : [];
|
|
1510
|
+
retailerId = _args12.length > 1 ? _args12[1] : undefined;
|
|
1480
1511
|
data = {
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
headers: {
|
|
1512
|
+
paramsBody: {
|
|
1513
|
+
id: product.article.id_article,
|
|
1514
|
+
version: version,
|
|
1515
|
+
items: messages,
|
|
1516
|
+
retailerId: retailerId,
|
|
1517
|
+
status: product.status
|
|
1518
|
+
},
|
|
1519
|
+
paramsHeader: {
|
|
1490
1520
|
Authorization: token
|
|
1491
1521
|
}
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
case 13:
|
|
1495
|
-
_context12.next = 15;
|
|
1496
|
-
return getComments(tab);
|
|
1497
|
-
|
|
1498
|
-
case 15:
|
|
1522
|
+
};
|
|
1499
1523
|
setMessage("");
|
|
1500
|
-
|
|
1524
|
+
return _context12.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1501
1525
|
|
|
1502
|
-
case
|
|
1526
|
+
case 5:
|
|
1503
1527
|
case "end":
|
|
1504
1528
|
return _context12.stop();
|
|
1505
1529
|
}
|
|
@@ -1507,7 +1531,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1507
1531
|
}, _callee12);
|
|
1508
1532
|
}));
|
|
1509
1533
|
|
|
1510
|
-
return function createComment(
|
|
1534
|
+
return function createComment() {
|
|
1511
1535
|
return _ref15.apply(this, arguments);
|
|
1512
1536
|
};
|
|
1513
1537
|
}();
|
|
@@ -1622,7 +1646,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1622
1646
|
|
|
1623
1647
|
var setAssignation = /*#__PURE__*/function () {
|
|
1624
1648
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
|
|
1625
|
-
var _product$
|
|
1649
|
+
var _product$article16;
|
|
1626
1650
|
|
|
1627
1651
|
var concept, productTemp, data;
|
|
1628
1652
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
@@ -1652,7 +1676,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1652
1676
|
data = {
|
|
1653
1677
|
articleList: [{
|
|
1654
1678
|
orderId: product.orderId,
|
|
1655
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
1679
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article16 = product.article) === null || _product$article16 === void 0 ? void 0 : _product$article16.id_article
|
|
1656
1680
|
}],
|
|
1657
1681
|
concept: concept,
|
|
1658
1682
|
userId: assignationId
|
|
@@ -1679,7 +1703,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1679
1703
|
}, _callee14);
|
|
1680
1704
|
}));
|
|
1681
1705
|
|
|
1682
|
-
return function setAssignation(
|
|
1706
|
+
return function setAssignation(_x2, _x3) {
|
|
1683
1707
|
return _ref17.apply(this, arguments);
|
|
1684
1708
|
};
|
|
1685
1709
|
}();
|
|
@@ -1781,6 +1805,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1781
1805
|
};
|
|
1782
1806
|
|
|
1783
1807
|
(0, _react.useEffect)(function () {
|
|
1808
|
+
console.log(servicesData, "servicesData");
|
|
1784
1809
|
var status = getRetailerStatus(servicesData, activeTab);
|
|
1785
1810
|
setRetailerStatus(status);
|
|
1786
1811
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1793,7 +1818,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1793
1818
|
|
|
1794
1819
|
var validateAll = /*#__PURE__*/function () {
|
|
1795
1820
|
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(result) {
|
|
1796
|
-
var evaluationArray, conceptArray, productTemp;
|
|
1821
|
+
var evaluationArray, conceptArray, messages, productTemp, messagesResponse;
|
|
1797
1822
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1798
1823
|
while (1) {
|
|
1799
1824
|
switch (_context15.prev = _context15.next) {
|
|
@@ -1819,6 +1844,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1819
1844
|
return _context15.abrupt("break", 13);
|
|
1820
1845
|
|
|
1821
1846
|
case 13:
|
|
1847
|
+
messages = [];
|
|
1822
1848
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1823
1849
|
if (conceptArray.includes(ret.service)) {
|
|
1824
1850
|
var _product$id_order;
|
|
@@ -1831,6 +1857,16 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1831
1857
|
evalStatus: ret.status,
|
|
1832
1858
|
retailerId: ret.id_retailer
|
|
1833
1859
|
};
|
|
1860
|
+
|
|
1861
|
+
if (product["".concat(ret.service, "_status")] !== "NS") {
|
|
1862
|
+
var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
|
|
1863
|
+
|
|
1864
|
+
messages.push(createComment([{
|
|
1865
|
+
type: "status",
|
|
1866
|
+
value: _message2
|
|
1867
|
+
}], ret.id_retailer));
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1834
1870
|
evaluationArray.push(_axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1835
1871
|
headers: {
|
|
1836
1872
|
Authorization: token
|
|
@@ -1838,38 +1874,43 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1838
1874
|
}));
|
|
1839
1875
|
}
|
|
1840
1876
|
});
|
|
1841
|
-
_context15.next =
|
|
1877
|
+
_context15.next = 17;
|
|
1842
1878
|
return Promise.all(evaluationArray);
|
|
1843
1879
|
|
|
1844
|
-
case
|
|
1880
|
+
case 17:
|
|
1845
1881
|
productTemp = product;
|
|
1846
1882
|
productTemp.status = "".concat(result, "A");
|
|
1847
|
-
productTemp.datasheet_status = productTemp.datasheet_status === "
|
|
1848
|
-
productTemp.description_status = productTemp.description_status === "
|
|
1849
|
-
productTemp.images_status = productTemp.images_status === "
|
|
1883
|
+
productTemp.datasheet_status = productTemp.datasheet_status === "NS" ? "NS" : "".concat(result, "A");
|
|
1884
|
+
productTemp.description_status = productTemp.description_status === "NS" ? "NS" : "".concat(result, "A");
|
|
1885
|
+
productTemp.images_status = productTemp.images_status === "NS" ? "NS" : "".concat(result, "A");
|
|
1850
1886
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1851
1887
|
setProduct(productTemp);
|
|
1852
|
-
_context15.next =
|
|
1888
|
+
_context15.next = 26;
|
|
1889
|
+
return Promise.all(messages);
|
|
1890
|
+
|
|
1891
|
+
case 26:
|
|
1892
|
+
messagesResponse = _context15.sent;
|
|
1893
|
+
_context15.next = 29;
|
|
1853
1894
|
return loadData();
|
|
1854
1895
|
|
|
1855
|
-
case
|
|
1856
|
-
_context15.next =
|
|
1896
|
+
case 29:
|
|
1897
|
+
_context15.next = 34;
|
|
1857
1898
|
break;
|
|
1858
1899
|
|
|
1859
|
-
case
|
|
1860
|
-
_context15.prev =
|
|
1900
|
+
case 31:
|
|
1901
|
+
_context15.prev = 31;
|
|
1861
1902
|
_context15.t1 = _context15["catch"](0);
|
|
1862
1903
|
console.log(_context15.t1);
|
|
1863
1904
|
|
|
1864
|
-
case
|
|
1905
|
+
case 34:
|
|
1865
1906
|
case "end":
|
|
1866
1907
|
return _context15.stop();
|
|
1867
1908
|
}
|
|
1868
1909
|
}
|
|
1869
|
-
}, _callee15, null, [[0,
|
|
1910
|
+
}, _callee15, null, [[0, 31]]);
|
|
1870
1911
|
}));
|
|
1871
1912
|
|
|
1872
|
-
return function validateAll(
|
|
1913
|
+
return function validateAll(_x4) {
|
|
1873
1914
|
return _ref18.apply(this, arguments);
|
|
1874
1915
|
};
|
|
1875
1916
|
}();
|
|
@@ -1882,8 +1923,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1882
1923
|
setCompare: setCompare,
|
|
1883
1924
|
isAuditor: [1, 6].includes(user.id_role),
|
|
1884
1925
|
withChat: location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.withChat,
|
|
1885
|
-
|
|
1886
|
-
|
|
1926
|
+
chatType: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.chatType,
|
|
1927
|
+
productSelected: product,
|
|
1928
|
+
token: token,
|
|
1929
|
+
activeRetailer: activeRetailer
|
|
1887
1930
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1888
1931
|
className: "data-container",
|
|
1889
1932
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -1925,27 +1968,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1925
1968
|
sendToFacilitator("A");
|
|
1926
1969
|
},
|
|
1927
1970
|
reject: function reject() {
|
|
1928
|
-
|
|
1929
|
-
setMessage("Rechazado");
|
|
1930
|
-
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1931
|
-
src: _errorModal.default
|
|
1932
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1933
|
-
text: "Agrega tu comentarios para enviar el rechazo",
|
|
1934
|
-
headerType: "input-name-header",
|
|
1935
|
-
color: "white"
|
|
1936
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1937
|
-
label: "Caja de Comentario",
|
|
1938
|
-
inputType: "textarea",
|
|
1939
|
-
inputId: "modal-commentary-box",
|
|
1940
|
-
index: 0,
|
|
1941
|
-
color: "white"
|
|
1942
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1943
|
-
buttonType: "general-default-button",
|
|
1944
|
-
label: "Enviar comentario",
|
|
1945
|
-
onClick: function onClick(e) {
|
|
1946
|
-
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1947
|
-
}
|
|
1948
|
-
})]);
|
|
1971
|
+
setShowRejectModal(true);
|
|
1949
1972
|
},
|
|
1950
1973
|
showApproveRejectAll: approveRejectAllButtons() && (auditorAssigned() || userAssigned()),
|
|
1951
1974
|
showValidationButtons: approveRejectButtons() && (auditorAssigned() || userAssigned()),
|
|
@@ -1953,27 +1976,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1953
1976
|
return validateAll("A");
|
|
1954
1977
|
},
|
|
1955
1978
|
rejectAll: function rejectAll() {
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1959
|
-
src: _errorModal.default
|
|
1960
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1961
|
-
text: "Agrega tu comentarios para enviar el rechazo",
|
|
1962
|
-
headerType: "input-name-header",
|
|
1963
|
-
color: "white"
|
|
1964
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
1965
|
-
label: "Caja de Comentario",
|
|
1966
|
-
inputType: "textarea",
|
|
1967
|
-
inputId: "modal-commentary-box",
|
|
1968
|
-
index: 0,
|
|
1969
|
-
color: "white"
|
|
1970
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1971
|
-
buttonType: "general-default-button",
|
|
1972
|
-
label: "Enviar comentario",
|
|
1973
|
-
onClick: function onClick(e) {
|
|
1974
|
-
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
1975
|
-
}
|
|
1976
|
-
})]);
|
|
1979
|
+
setShowRejectModal(true);
|
|
1980
|
+
setValRejAll(true);
|
|
1977
1981
|
}
|
|
1978
1982
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1979
1983
|
tabsSections: tabsSections,
|
|
@@ -1988,6 +1992,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1988
1992
|
isRetailer: isRetailer,
|
|
1989
1993
|
showSaveButton: auditorAssigned() || userAssigned(),
|
|
1990
1994
|
version: version,
|
|
1995
|
+
desc: desc,
|
|
1996
|
+
setDesc: setDesc,
|
|
1997
|
+
fich: fich,
|
|
1998
|
+
setFich: setFich,
|
|
1999
|
+
imag: imag,
|
|
2000
|
+
setImag: setImag,
|
|
1991
2001
|
updatedDescriptions: updatedDescriptions,
|
|
1992
2002
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
1993
2003
|
updatedDatasheets: updatedDatasheets,
|
|
@@ -2045,7 +2055,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2045
2055
|
auditInputGroup: auditDescriptions[0],
|
|
2046
2056
|
updatedDescriptions: updatedDescriptions,
|
|
2047
2057
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2048
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
2058
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article17 = product.article) === null || _product$article17 === void 0 ? void 0 : _product$article17.id_article,
|
|
2049
2059
|
version: version,
|
|
2050
2060
|
dinamicHeight: true,
|
|
2051
2061
|
compare: compare
|
|
@@ -2066,57 +2076,15 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2066
2076
|
headerType: "input-name-header"
|
|
2067
2077
|
}))]
|
|
2068
2078
|
})
|
|
2069
|
-
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.
|
|
2079
|
+
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2070
2080
|
className: "commentary-box",
|
|
2071
|
-
children: [
|
|
2072
|
-
className: "commentary",
|
|
2073
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2074
|
-
label: "Caja de Comentario",
|
|
2075
|
-
inputType: "textarea",
|
|
2076
|
-
inputCols: 80,
|
|
2077
|
-
inputRows: 4,
|
|
2078
|
-
inputId: "commentary-box",
|
|
2079
|
-
index: 0
|
|
2080
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2081
|
-
className: "buttons-box",
|
|
2082
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2083
|
-
buttonType: "general-transparent-button",
|
|
2084
|
-
label: "Enviar comentario",
|
|
2085
|
-
onClick: function onClick(e) {
|
|
2086
|
-
return createComment(e, document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2087
|
-
}
|
|
2088
|
-
})
|
|
2089
|
-
})]
|
|
2090
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2091
|
-
className: "feedback-box",
|
|
2092
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2093
|
-
comment: comment === null || comment === void 0 ? void 0 : (_comment$message = comment.message) === null || _comment$message === void 0 ? void 0 : _comment$message.replace(/<.*?\/?>/gm, ""),
|
|
2094
|
-
reviewed: crossComment
|
|
2095
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2096
|
-
buttonType: "circular-button accept-button",
|
|
2097
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2098
|
-
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2099
|
-
while (1) {
|
|
2100
|
-
switch (_context16.prev = _context16.next) {
|
|
2101
|
-
case 0:
|
|
2102
|
-
setCrossComment(true);
|
|
2103
|
-
commentRevised();
|
|
2104
|
-
|
|
2105
|
-
case 2:
|
|
2106
|
-
case "end":
|
|
2107
|
-
return _context16.stop();
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
}, _callee16);
|
|
2111
|
-
}))
|
|
2112
|
-
})]
|
|
2113
|
-
}), [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2081
|
+
children: [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2114
2082
|
buttonType: evaluationFinished(user.id_role, activeTab, statusArray) && requiredNull[activeTab] === 0 ? "general-green-button" : "general-button-disabled",
|
|
2115
2083
|
label: "Enviar evaluación",
|
|
2116
2084
|
onClick: function onClick() {
|
|
2117
2085
|
return sendToFacilitator();
|
|
2118
2086
|
}
|
|
2119
|
-
})
|
|
2087
|
+
})
|
|
2120
2088
|
})]
|
|
2121
2089
|
})]
|
|
2122
2090
|
}), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
|
|
@@ -2145,6 +2113,53 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2145
2113
|
currentVersion: version,
|
|
2146
2114
|
setShowVersionSelector: setShowVersionSelector,
|
|
2147
2115
|
jwt: token
|
|
2116
|
+
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2117
|
+
title: "Agregar mensaje de rechazo para ".concat(activeTab === null || activeTab === void 0 ? void 0 : activeTab.toLowerCase()),
|
|
2118
|
+
show: showRejectModal,
|
|
2119
|
+
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2120
|
+
inputType: "textarea",
|
|
2121
|
+
inputId: "modal-message-box",
|
|
2122
|
+
index: 0,
|
|
2123
|
+
color: "white"
|
|
2124
|
+
}),
|
|
2125
|
+
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2126
|
+
type: "white",
|
|
2127
|
+
label: "Cancelar",
|
|
2128
|
+
size: 12,
|
|
2129
|
+
onClick: function onClick() {
|
|
2130
|
+
setShowRejectModal(false);
|
|
2131
|
+
}
|
|
2132
|
+
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2133
|
+
type: "pink",
|
|
2134
|
+
label: "Aceptar",
|
|
2135
|
+
size: 12,
|
|
2136
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2137
|
+
var body, messages;
|
|
2138
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2139
|
+
while (1) {
|
|
2140
|
+
switch (_context16.prev = _context16.next) {
|
|
2141
|
+
case 0:
|
|
2142
|
+
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2143
|
+
messages = [{
|
|
2144
|
+
type: "message",
|
|
2145
|
+
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2146
|
+
}];
|
|
2147
|
+
_context16.next = 4;
|
|
2148
|
+
return createComment(messages, activeRetailer.id);
|
|
2149
|
+
|
|
2150
|
+
case 4:
|
|
2151
|
+
valRejAll ? validateAll("R") : sendToFacilitator("R");
|
|
2152
|
+
setMessage("Rechazado");
|
|
2153
|
+
setShowRejectModal(false);
|
|
2154
|
+
|
|
2155
|
+
case 7:
|
|
2156
|
+
case "end":
|
|
2157
|
+
return _context16.stop();
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
}, _callee16);
|
|
2161
|
+
}))
|
|
2162
|
+
}, "btn-Aceptar")]
|
|
2148
2163
|
})]
|
|
2149
2164
|
});
|
|
2150
2165
|
};
|