contentoh-components-library 21.3.32 → 21.3.34

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.
Files changed (35) hide show
  1. package/dist/components/atoms/CustomSelectItem/index.js +1 -1
  2. package/dist/components/atoms/InputText/index.js +1 -1
  3. package/dist/components/atoms/ProductPercentCard/index.js +1 -1
  4. package/dist/components/atoms/Select/index.js +1 -1
  5. package/dist/components/molecules/ButtonDownloadFile/index.js +1 -1
  6. package/dist/components/molecules/CarouselImagesLogin/index.js +2 -2
  7. package/dist/components/molecules/ImageTooltip/index.js +7 -21
  8. package/dist/components/molecules/ProductNameHeader/index.js +0 -1
  9. package/dist/components/molecules/SelectV2/index.js +1 -1
  10. package/dist/components/organisms/Chat/Chat.stories.js +6 -5
  11. package/dist/components/organisms/Chat/ChatLists/index.js +2 -2
  12. package/dist/components/organisms/Chat/ContentChat/index.js +85 -49
  13. package/dist/components/organisms/Chat/Footer/index.js +21 -22
  14. package/dist/components/organisms/Chat/index.js +1 -1
  15. package/dist/components/organisms/FullProductNameHeader/index.js +7 -1
  16. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +87 -241
  17. package/dist/global-files/handle_http.js +33 -31
  18. package/package.json +5 -5
  19. package/src/components/atoms/CustomSelectItem/index.js +2 -1
  20. package/src/components/atoms/InputText/index.js +1 -1
  21. package/src/components/atoms/ProductPercentCard/index.js +2 -2
  22. package/src/components/atoms/Select/index.js +1 -1
  23. package/src/components/molecules/ButtonDownloadFile/index.js +1 -1
  24. package/src/components/molecules/CarouselImagesLogin/index.js +2 -2
  25. package/src/components/molecules/ImageTooltip/index.js +7 -17
  26. package/src/components/molecules/ProductNameHeader/index.js +0 -1
  27. package/src/components/molecules/SelectV2/index.js +1 -1
  28. package/src/components/organisms/Chat/Chat.stories.js +5 -4
  29. package/src/components/organisms/Chat/ChatLists/index.js +2 -2
  30. package/src/components/organisms/Chat/ContentChat/index.js +35 -28
  31. package/src/components/organisms/Chat/Footer/index.js +4 -8
  32. package/src/components/organisms/Chat/index.js +1 -1
  33. package/src/components/organisms/FullProductNameHeader/index.js +8 -3
  34. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +97 -265
  35. package/src/global-files/handle_http.js +11 -13
@@ -55,7 +55,7 @@ var CustomSelectItem = function CustomSelectItem(_ref) {
55
55
  var oneDimensionArray = function oneDimensionArray(arr) {
56
56
  var array = [];
57
57
  arr.forEach(function (element) {
58
- if ((0, _typeof2.default)(element) == "object") array.push.apply(array, (0, _toConsumableArray2.default)(oneDimensionArray(element)));else array.push(element);
58
+ if ((0, _typeof2.default)(element) === "object") array.push.apply(array, (0, _toConsumableArray2.default)(oneDimensionArray(element)));else array.push(element);
59
59
  });
60
60
  return array;
61
61
  };
@@ -53,7 +53,7 @@ var InputText = function InputText(props) {
53
53
  return onChangeText && onChangeText(event.target.value);
54
54
  },
55
55
  onKeyDown: function onKeyDown(event) {
56
- if (event.key == "Enter" && !event.shiftKey) {
56
+ if (event.key === "Enter" && !event.shiftKey) {
57
57
  event.preventDefault();
58
58
  onEnter && onEnter(event);
59
59
  }
@@ -36,7 +36,7 @@ var ProductPercentCard = function ProductPercentCard(_ref) {
36
36
  alt: ""
37
37
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
38
38
  className: "span",
39
- children: [percent == "NaN" ? 0 : percent, "%"]
39
+ children: [percent === "NaN" ? 0 : percent, "%"]
40
40
  })]
41
41
  })]
42
42
  });
@@ -28,7 +28,7 @@ function Select(props) {
28
28
  ,
29
29
  value: item.value ? item.value : item // selected={
30
30
  // item.value
31
- // ? item.value == props.valueSelected && "selected"
31
+ // ? item.value === props.valueSelected && "selected"
32
32
  // : item === props.valueSelected && "selected"
33
33
  // }
34
34
  ,
@@ -74,7 +74,7 @@ var ButtonDownloadFile = function ButtonDownloadFile(props) {
74
74
  case 4:
75
75
  responseFile = _context.sent;
76
76
 
77
- if (!(responseFile.status != 200)) {
77
+ if (!(responseFile.status !== 200)) {
78
78
  _context.next = 9;
79
79
  break;
80
80
  }
@@ -42,7 +42,7 @@ var CarouselImagesLogin = function CarouselImagesLogin(_ref) {
42
42
  var slideshow = function slideshow() {
43
43
  img2.src = images[i];
44
44
  var circulo_actual = Array.from(circulos).find(function (el) {
45
- return el.id == i;
45
+ return el.id === i;
46
46
  });
47
47
  Array.from(circulos).forEach(function (cir) {
48
48
  return cir.classList.remove("resaltado");
@@ -52,7 +52,7 @@ var CarouselImagesLogin = function CarouselImagesLogin(_ref) {
52
52
  img2.classList.add("active");
53
53
  i++;
54
54
 
55
- if (i == images.length) {
55
+ if (i === images.length) {
56
56
  i = 0;
57
57
  }
58
58
 
@@ -23,7 +23,6 @@ var _jsxRuntime = require("react/jsx-runtime");
23
23
 
24
24
  var ImageTooltip = function ImageTooltip(props) {
25
25
  var className = props.className,
26
- width = props.width,
27
26
  sizeLoading = props.sizeLoading,
28
27
  colorLoading = props.colorLoading,
29
28
  classNameLoading = props.classNameLoading,
@@ -39,19 +38,6 @@ var ImageTooltip = function ImageTooltip(props) {
39
38
  imgLoad = _useState2[0],
40
39
  setImgLoad = _useState2[1];
41
40
 
42
- var _useState3 = (0, _react.useState)(false),
43
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
44
- loading = _useState4[0],
45
- setLoading = _useState4[1];
46
- /* solo para hacer pruebas en modo dev
47
- useEffect(() => {
48
- setTimeout(() => {
49
- setLoading(false);
50
- }, 5000);
51
- }, []);
52
- */
53
-
54
-
55
41
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Tooltip.Tooltip, {
56
42
  position: position !== null && position !== void 0 ? position : "topCenter",
57
43
  addArrow: false,
@@ -59,8 +45,8 @@ var ImageTooltip = function ImageTooltip(props) {
59
45
  followCursor: false,
60
46
  className: className,
61
47
  classNameTooltip: classNameTooltip,
62
- componentTooltip: imgLoad !== undefined && !loading && componentTooltip,
63
- children: [src && (imgLoad === undefined || loading) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ContainerLoading, {
48
+ componentTooltip: imgLoad !== undefined && componentTooltip,
49
+ children: [src && imgLoad === undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ContainerLoading, {
64
50
  className: classNameLoading,
65
51
  sizeLoading: sizeLoading,
66
52
  colorLoading: colorLoading,
@@ -68,16 +54,16 @@ var ImageTooltip = function ImageTooltip(props) {
68
54
  pulse: true,
69
55
  icon: _freeSolidSvgIcons.faSpinner
70
56
  })
71
- }), (!src || imgLoad === false && !loading) && componentDefault, /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Img, {
57
+ }), (!src || imgLoad === false) && componentDefault, /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Img, {
72
58
  className: classNameImg,
73
- src: src,
74
- onLoad: function onLoad(event) {
59
+ src: "".concat(src, "?").concat(new Date().getMilliseconds()),
60
+ onLoad: function onLoad() {
75
61
  return setImgLoad(true);
76
62
  },
77
- onError: function onError(event) {
63
+ onError: function onError() {
78
64
  return setImgLoad(false);
79
65
  },
80
- show: imgLoad === true && !loading
66
+ show: imgLoad === true
81
67
  })]
82
68
  });
83
69
  };
@@ -20,7 +20,6 @@ var _jsxRuntime = require("react/jsx-runtime");
20
20
  var ProductNameHeader = function ProductNameHeader(_ref) {
21
21
  var productName = _ref.productName,
22
22
  statusType = _ref.statusType,
23
- percent = _ref.percent,
24
23
  priority = _ref.priority,
25
24
  date = _ref.date,
26
25
  percentRequired = _ref.percentRequired;
@@ -158,7 +158,7 @@ var SelectV2 = function SelectV2(props) {
158
158
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
159
159
  var item = _step.value;
160
160
 
161
- if (item.value == selectedItemsCopy[0]) {
161
+ if (item.value === selectedItemsCopy[0]) {
162
162
  labelItem = item.label;
163
163
  break;
164
164
  }
@@ -149,14 +149,15 @@ chatTicket_userTECH.args = {
149
149
  chatContainerType: "fixed",
150
150
  chatData: {
151
151
  id: 130,
152
- ticketOwnerUserId: 49,
153
- ticketCompany: 817,
154
- statusTicket: "IN_PROGRESS",
152
+ ticketOwnerUserId: 194,
153
+ ticketCompany: undefined,
154
+ statusTicket: "PENDING",
155
155
  currentUser: {
156
- token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI5M2FkOTM5Yy04MzJjLTQ4NWItOWUzMS0yN2MxNzBjMDk1NWEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2OTY2MjU5MiwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2Njk2NjYxOTIsImlhdCI6MTY2OTY2MjU5MiwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.hhdlQk-ljHpyZPRoG02YcvPow8jpm9coZfmEuZ29vIVX7bX5k05Ss3FkaT0dYNr2qEvqZHHqH61oJvx4xr2i6z2c3xEZxyJZFR-Cc_skhH0UwGXbCH9up5PW1aipY5rL45E42R7GKSGmB5Z-B7vxe2NcL-ZojYZkXNZ7Gx_lM8Vpq-XsFLJ4nCJlH7vx9D4SkREN3lLfYIIgqNrxJ_wqfqvcqexwRJfnr76ZqCuDR4dTWsES2Lf5D8Wa_wkQAjQNdzP7ai28l9fRyCSwkTxvamdJkx7p-tssOL5pAnCsKkD22UN-09c1bhuGrgfKWUV4awbptfjvHS7TSq0bWiv4gQ",
156
+ token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJlYTRlZmQ1Zi1mYTg4LTRjNDEtYTM3Ny02MWVkNmY0YTMyOTciLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MDA1Njg2NSwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2ODAwNjA0NjUsImlhdCI6MTY4MDA1Njg2NSwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.oRuv3LkdvctEMUjmeGw0-XefzV_Aoh1O2hFMik4RxpkkCUeP1O7AjA7lJI6sgoqa9Nwa2fCPRXk6ufi84UbgxGEgkupQmAvXTHQCw_uwCUVAZitlNGXSBl-VSisMuXSnckxdZQ1MvLV5BgLmiw4mu6HxKDN-Uw0xc7yL_yDtGu3NWxoO0Cm2zbej8jYLE9DV9wG297bjfzVQ7hzpEfEcB52I5Tg6nF2VDTx-8_m4mVVrpisbV5uBoYokbFyyOFVLZzUU7Je5uHukscHS5dje9IMTY8DE5S8xUWJubHjf_ktcy7Y2-F2cG5dI5oSdrBNU-wNNW5-OtRLgclSJLmbPCw",
157
157
  id: 28,
158
158
  companyId: 1,
159
159
  isUserTech: true
160
160
  }
161
- }
161
+ },
162
+ classNameContainerFixed: "chatTicket"
162
163
  };
@@ -80,14 +80,14 @@ var ChatLists = function ChatLists(props) {
80
80
  })]
81
81
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
82
82
  className: "container-indicators",
83
- children: currentCompanyId == companyId && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
83
+ children: currentCompanyId === companyId && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
84
84
  className: "label-ownCompany",
85
85
  children: "Interno"
86
86
  })
87
87
  })]
88
88
  }, "itemChat-" + companyId); // checar si es chat abierto
89
89
 
90
- if (company.statusChat == "closed") jsxClosedChats.push(itemChat);else jsxOpenChats.push(itemChat);
90
+ if (company.statusChat === "closed") jsxClosedChats.push(itemChat);else jsxOpenChats.push(itemChat);
91
91
  };
92
92
 
93
93
  for (var _i = 0, _Object$keys = Object.keys(companies); _i < _Object$keys.length; _i++) {
@@ -199,8 +199,8 @@ var ContentChat = function ContentChat(props) {
199
199
  }, [dataChat, showPopUpChat]); // comenzar temporizador del update de 20s
200
200
 
201
201
  (0, _react.useEffect)(function () {
202
- //return; -- descomentarizar para hacer pruebas sin update
203
- if (startUpdate == 0) return;
202
+ // return; // -- descomentarizar para hacer pruebas sin update
203
+ if (startUpdate === 0) return;
204
204
  var processID = setTimeout(function () {
205
205
  setRunUpdate(function (prev) {
206
206
  return prev + 1;
@@ -214,9 +214,9 @@ var ContentChat = function ContentChat(props) {
214
214
 
215
215
  (0, _react.useEffect)(function () {
216
216
  if (chatType === "merchant_product") {
217
- if (singleChat.items) getUpdateLatestMerchantProduct();else getInitialMerchantProduct();
217
+ if (singleChat.items) getUpdateLatestMerchantProduct(true);else getInitialMerchantProduct();
218
218
  } else if (chatType === "order_product") {
219
- if (companies) getUpdateLatestOrderProduct();else getInitialOrderProduct();
219
+ if (companies) getUpdateLatestOrderProduct(true);else getInitialOrderProduct();
220
220
  } else {
221
221
  if (singleChat.items) getUpdateLatestTicket(true);else getInitialTicket();
222
222
  }
@@ -262,6 +262,9 @@ var ContentChat = function ContentChat(props) {
262
262
 
263
263
  case 9:
264
264
  // success
265
+ setStartUpdate(function (prev) {
266
+ return prev + 1;
267
+ });
265
268
  setCurrentUser({
266
269
  id: response.body.data.currentUserId,
267
270
  companyId: response.body.data.currentCompanyId
@@ -277,7 +280,7 @@ var ContentChat = function ContentChat(props) {
277
280
  });
278
281
  setIsLoading(false);
279
282
 
280
- case 15:
283
+ case 16:
281
284
  case "end":
282
285
  return _context.stop();
283
286
  }
@@ -656,25 +659,34 @@ var ContentChat = function ContentChat(props) {
656
659
 
657
660
  var getUpdateLatestMerchantProduct = /*#__PURE__*/function () {
658
661
  var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
659
- var paramsQuery, response, newSingleChat;
662
+ var fromUpdate,
663
+ paramsQuery,
664
+ paramsHeaders,
665
+ response,
666
+ newSingleChat,
667
+ _args7 = arguments;
660
668
  return _regenerator.default.wrap(function _callee7$(_context7) {
661
669
  while (1) {
662
670
  switch (_context7.prev = _context7.next) {
663
671
  case 0:
672
+ fromUpdate = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : false;
664
673
  paramsQuery = {
665
674
  getType: "updateLatest",
666
675
  id: JSON.stringify(dataChat.id),
667
676
  version: JSON.stringify(dataChat.version),
668
677
  date: encodeURIComponent(lastUpdateDate)
669
678
  };
670
- _context7.next = 3;
671
- return (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery);
679
+ paramsHeaders = {
680
+ Authorization: dataChat.userToken
681
+ };
682
+ _context7.next = 5;
683
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery, paramsHeaders);
672
684
 
673
- case 3:
685
+ case 5:
674
686
  response = _context7.sent;
675
687
 
676
688
  if (response.body) {
677
- _context7.next = 7;
689
+ _context7.next = 9;
678
690
  break;
679
691
  }
680
692
 
@@ -684,17 +696,20 @@ var ContentChat = function ContentChat(props) {
684
696
  });
685
697
  return _context7.abrupt("return");
686
698
 
687
- case 7:
699
+ case 9:
688
700
  // success
701
+ setStartUpdate(function (prev) {
702
+ return prev + 1;
703
+ });
689
704
  setLastUpdateDate(response.body.data.lastUpdateDate); // actualizar la lista de los users
690
705
 
691
706
  updateAllUsers(response.body.users); // actualizar los items del chat
692
707
 
693
708
  newSingleChat = (0, _objectSpread3.default)({}, singleChat);
694
- newSingleChat.items = addNewItemsChat(newSingleChat.items, response.body.items);
709
+ newSingleChat.items = addNewItemsChat(newSingleChat.items, response.body.items, fromUpdate);
695
710
  setSingleChat(newSingleChat);
696
711
 
697
- case 12:
712
+ case 15:
698
713
  case "end":
699
714
  return _context7.stop();
700
715
  }
@@ -709,11 +724,16 @@ var ContentChat = function ContentChat(props) {
709
724
 
710
725
  var getUpdateLatestOrderProduct = /*#__PURE__*/function () {
711
726
  var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
712
- var paramsQuery, response, companiesList;
727
+ var fromUpdate,
728
+ paramsQuery,
729
+ response,
730
+ companiesList,
731
+ _args8 = arguments;
713
732
  return _regenerator.default.wrap(function _callee8$(_context8) {
714
733
  while (1) {
715
734
  switch (_context8.prev = _context8.next) {
716
735
  case 0:
736
+ fromUpdate = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : false;
717
737
  paramsQuery = {
718
738
  getType: "updateLatest",
719
739
  id: JSON.stringify(dataChat.id),
@@ -725,14 +745,14 @@ var ContentChat = function ContentChat(props) {
725
745
  othersCompanyId: encodeURIComponent(JSON.stringify(Object.keys(companies))),
726
746
  date: encodeURIComponent(lastUpdateDate)
727
747
  };
728
- _context8.next = 3;
748
+ _context8.next = 4;
729
749
  return (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery);
730
750
 
731
- case 3:
751
+ case 4:
732
752
  response = _context8.sent;
733
753
 
734
754
  if (response.body) {
735
- _context8.next = 7;
755
+ _context8.next = 8;
736
756
  break;
737
757
  }
738
758
 
@@ -742,9 +762,12 @@ var ContentChat = function ContentChat(props) {
742
762
  });
743
763
  return _context8.abrupt("return");
744
764
 
745
- case 7:
765
+ case 8:
746
766
  // success
747
- // cuando cambie la lista de chats por un cambio de version o estatus
767
+ setStartUpdate(function (prev) {
768
+ return prev + 1;
769
+ }); // cuando cambie la lista de chats por un cambio de version o estatus
770
+
748
771
  if (response.body.data.status) {
749
772
  setIsLoading(true);
750
773
  setTimeout(function () {
@@ -791,12 +814,12 @@ var ContentChat = function ContentChat(props) {
791
814
 
792
815
  companiesList = (0, _objectSpread3.default)({}, companies);
793
816
  Object.keys(response.body.companies).forEach(function (companyId) {
794
- companiesList[companyId].items = addNewItemsChat(companiesList[companyId].items, response.body.companies[companyId].items);
817
+ companiesList[companyId].items = addNewItemsChat(companiesList[companyId].items, response.body.companies[companyId].items, fromUpdate);
795
818
  });
796
819
  setCompanies(companiesList);
797
820
  }
798
821
 
799
- case 8:
822
+ case 10:
800
823
  case "end":
801
824
  return _context8.stop();
802
825
  }
@@ -1104,7 +1127,10 @@ var ContentChat = function ContentChat(props) {
1104
1127
  var createItemsMerchantProduct = /*#__PURE__*/function () {
1105
1128
  var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
1106
1129
  var items,
1130
+ id,
1131
+ version,
1107
1132
  paramsBody,
1133
+ paramsHeaders,
1108
1134
  response,
1109
1135
  _args11 = arguments;
1110
1136
  return _regenerator.default.wrap(function _callee11$(_context11) {
@@ -1112,20 +1138,23 @@ var ContentChat = function ContentChat(props) {
1112
1138
  switch (_context11.prev = _context11.next) {
1113
1139
  case 0:
1114
1140
  items = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : [];
1141
+ id = dataChat.id, version = dataChat.version;
1115
1142
  paramsBody = {
1116
- id: JSON.stringify(dataChat.id),
1117
- version: JSON.stringify(dataChat.version),
1118
- userId: JSON.stringify(currentUser.id),
1119
- items: JSON.stringify(items)
1143
+ id: id,
1144
+ version: version,
1145
+ items: items
1146
+ };
1147
+ paramsHeaders = {
1148
+ Authorization: dataChat.userToken
1120
1149
  };
1121
- _context11.next = 4;
1122
- return (0, _handle_http.fetchPOST)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsBody);
1150
+ _context11.next = 6;
1151
+ return (0, _handle_http.fetchPOST)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsBody, paramsHeaders);
1123
1152
 
1124
- case 4:
1153
+ case 6:
1125
1154
  response = _context11.sent;
1126
1155
 
1127
1156
  if (response.body) {
1128
- _context11.next = 7;
1157
+ _context11.next = 9;
1129
1158
  break;
1130
1159
  }
1131
1160
 
@@ -1134,7 +1163,7 @@ var ContentChat = function ContentChat(props) {
1134
1163
  errorDetail: response.errorDetail
1135
1164
  });
1136
1165
 
1137
- case 7:
1166
+ case 9:
1138
1167
  case "end":
1139
1168
  return _context11.stop();
1140
1169
  }
@@ -1151,6 +1180,7 @@ var ContentChat = function ContentChat(props) {
1151
1180
  var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
1152
1181
  var items,
1153
1182
  paramsBody,
1183
+ paramsHeaders,
1154
1184
  response,
1155
1185
  _args12 = arguments;
1156
1186
  return _regenerator.default.wrap(function _callee12$(_context12) {
@@ -1159,22 +1189,24 @@ var ContentChat = function ContentChat(props) {
1159
1189
  case 0:
1160
1190
  items = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : [];
1161
1191
  paramsBody = {
1162
- id: JSON.stringify(dataChat.id),
1163
- version: JSON.stringify(currentArticle.version),
1164
- userId: JSON.stringify(currentUser.id),
1165
- items: JSON.stringify(items),
1166
- orderId: JSON.stringify(dataChat.orderId),
1167
- sentCompanyId: JSON.stringify(currentUser.companyId),
1168
- receivedCompanyId: JSON.stringify(activeCompanyId)
1192
+ id: dataChat.id,
1193
+ version: currentArticle.version,
1194
+ items: items,
1195
+ orderId: dataChat.orderId,
1196
+ sentCompanyId: currentUser.companyId,
1197
+ receivedCompanyId: activeCompanyId
1198
+ };
1199
+ paramsHeaders = {
1200
+ Authorization: dataChat.userToken
1169
1201
  };
1170
- _context12.next = 4;
1171
- return (0, _handle_http.fetchPOST)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsBody);
1202
+ _context12.next = 5;
1203
+ return (0, _handle_http.fetchPOST)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsBody, paramsHeaders);
1172
1204
 
1173
- case 4:
1205
+ case 5:
1174
1206
  response = _context12.sent;
1175
1207
 
1176
1208
  if (response.body) {
1177
- _context12.next = 7;
1209
+ _context12.next = 8;
1178
1210
  break;
1179
1211
  }
1180
1212
 
@@ -1183,7 +1215,7 @@ var ContentChat = function ContentChat(props) {
1183
1215
  errorDetail: response.errorDetail
1184
1216
  });
1185
1217
 
1186
- case 7:
1218
+ case 8:
1187
1219
  case "end":
1188
1220
  return _context12.stop();
1189
1221
  }
@@ -1200,6 +1232,7 @@ var ContentChat = function ContentChat(props) {
1200
1232
  var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
1201
1233
  var items,
1202
1234
  paramsBody,
1235
+ paramsHeaders,
1203
1236
  response,
1204
1237
  _args13 = arguments;
1205
1238
  return _regenerator.default.wrap(function _callee13$(_context13) {
@@ -1212,14 +1245,17 @@ var ContentChat = function ContentChat(props) {
1212
1245
  userId: JSON.stringify(dataChat.currentUser.id),
1213
1246
  items: JSON.stringify(items)
1214
1247
  };
1215
- _context13.next = 4;
1216
- return (0, _handle_http.fetchPOST)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsBody);
1248
+ paramsHeaders = {
1249
+ Authorization: dataChat.userToken
1250
+ };
1251
+ _context13.next = 5;
1252
+ return (0, _handle_http.fetchPOST)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsBody, paramsHeaders);
1217
1253
 
1218
- case 4:
1254
+ case 5:
1219
1255
  response = _context13.sent;
1220
1256
 
1221
1257
  if (response.body) {
1222
- _context13.next = 7;
1258
+ _context13.next = 8;
1223
1259
  break;
1224
1260
  }
1225
1261
 
@@ -1228,7 +1264,7 @@ var ContentChat = function ContentChat(props) {
1228
1264
  errorDetail: response.errorDetail
1229
1265
  });
1230
1266
 
1231
- case 7:
1267
+ case 8:
1232
1268
  case "end":
1233
1269
  return _context13.stop();
1234
1270
  }
@@ -1320,8 +1356,8 @@ var ContentChat = function ContentChat(props) {
1320
1356
  }
1321
1357
 
1322
1358
  return Object.values(itemsId).sort(function (a, b) {
1323
- if (a.id < b.id) return 1;
1324
- if (a.id > b.id) return -1;
1359
+ if (a.id > b.id) return 1;
1360
+ if (a.id < b.id) return -1;
1325
1361
  return 0;
1326
1362
  });
1327
1363
  };
@@ -27,8 +27,6 @@ var _uuid = require("uuid");
27
27
 
28
28
  var _Image = require("../../../atoms/Image");
29
29
 
30
- var _ImageTooltip = require("../../../molecules/ImageTooltip");
31
-
32
30
  var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
33
31
 
34
32
  var _CustomIcon = require("../../../atoms/CustomIcon");
@@ -170,7 +168,7 @@ var Footer = function Footer(props) {
170
168
  switch (_context.prev = _context.next) {
171
169
  case 0:
172
170
  if (!createItemsChat) {
173
- _context.next = 87;
171
+ _context.next = 88;
174
172
  break;
175
173
  }
176
174
 
@@ -273,7 +271,7 @@ var Footer = function Footer(props) {
273
271
 
274
272
 
275
273
  customFiles.push({
276
- itemType: file.type.split("/")[0] == "image" ? "img" : "file",
274
+ itemType: file.type.split("/")[0] === "image" ? "img" : "file",
277
275
  key: fileKey,
278
276
  errorOwn: errorMessage
279
277
  });
@@ -320,12 +318,13 @@ var Footer = function Footer(props) {
320
318
  customFiles[index].uploaded = true;
321
319
  }
322
320
  });
323
- _context.next = 58;
321
+ _context.next = 59;
324
322
  break;
325
323
 
326
324
  case 53:
327
325
  _context.prev = 53;
328
326
  _context.t2 = _context["catch"](7);
327
+ console.log(_context.t2);
329
328
  disableSecondaryContainer(false);
330
329
  setModalAlert({
331
330
  show: true,
@@ -335,21 +334,21 @@ var Footer = function Footer(props) {
335
334
  });
336
335
  return _context.abrupt("return");
337
336
 
338
- case 58:
337
+ case 59:
339
338
  // obtener las keys de los files subidos
340
339
  items = [];
341
340
  index = 0;
342
341
 
343
- case 60:
342
+ case 61:
344
343
  if (!(index < customFiles.length)) {
345
- _context.next = 73;
344
+ _context.next = 74;
346
345
  break;
347
346
  }
348
347
 
349
348
  _file = customFiles[index];
350
349
 
351
350
  if (!_file.uploaded) {
352
- _context.next = 70;
351
+ _context.next = 71;
353
352
  break;
354
353
  }
355
354
 
@@ -359,14 +358,14 @@ var Footer = function Footer(props) {
359
358
  }; // caso imagen -> obtener width y height
360
359
 
361
360
  if (!(_file.itemType === "img")) {
362
- _context.next = 69;
361
+ _context.next = 70;
363
362
  break;
364
363
  }
365
364
 
366
- _context.next = 67;
365
+ _context.next = 68;
367
366
  return (0, _utils.getImageSize)(files[index]);
368
367
 
369
- case 67:
368
+ case 68:
370
369
  imgSize = _context.sent;
371
370
 
372
371
  if (imgSize) {
@@ -374,31 +373,31 @@ var Footer = function Footer(props) {
374
373
  valueItem.height = imgSize.height;
375
374
  }
376
375
 
377
- case 69:
376
+ case 70:
378
377
  items.push({
379
378
  type: _file.itemType,
380
379
  value: JSON.stringify(valueItem)
381
380
  });
382
381
 
383
- case 70:
382
+ case 71:
384
383
  index++;
385
- _context.next = 60;
384
+ _context.next = 61;
386
385
  break;
387
386
 
388
- case 73:
387
+ case 74:
389
388
  if (!items.length) {
390
- _context.next = 81;
389
+ _context.next = 82;
391
390
  break;
392
391
  }
393
392
 
394
- _context.next = 76;
393
+ _context.next = 77;
395
394
  return createItemsChat(items);
396
395
 
397
- case 76:
396
+ case 77:
398
397
  responseError = _context.sent;
399
398
 
400
399
  if (!responseError) {
401
- _context.next = 81;
400
+ _context.next = 82;
402
401
  break;
403
402
  }
404
403
 
@@ -411,7 +410,7 @@ var Footer = function Footer(props) {
411
410
  disableSecondaryContainer(false);
412
411
  return _context.abrupt("return");
413
412
 
414
- case 81:
413
+ case 82:
415
414
  // obtener los errores de los files no subidos a AWS
416
415
  failedFiles = [];
417
416
  errorDetailFiles = "";
@@ -440,7 +439,7 @@ var Footer = function Footer(props) {
440
439
  disableSecondaryContainer(false);
441
440
  setFilesPreview(failedFiles);
442
441
 
443
- case 87:
442
+ case 88:
444
443
  case "end":
445
444
  return _context.stop();
446
445
  }
@@ -186,7 +186,7 @@ var Chat = function Chat(props) {
186
186
 
187
187
  var isUserTech = currentUser.isUserTech;
188
188
 
189
- if (isUserTech && currentUser.id == ticketOwnerUserId) {
189
+ if (isUserTech && currentUser.id === ticketOwnerUserId) {
190
190
  isUserTech = false;
191
191
  }
192
192