contentoh-components-library 21.3.54 → 21.3.55

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 (60) hide show
  1. package/.env.development +0 -2
  2. package/dist/assets/fonts/roboto/LICENSE.txt +202 -0
  3. package/dist/components/atoms/ButtonV2/styles.js +1 -1
  4. package/dist/components/atoms/Status/styles.js +1 -1
  5. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +23 -18
  6. package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +4 -4
  7. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  8. package/dist/components/molecules/HeaderTop/index.js +11 -68
  9. package/dist/components/organisms/Chat/Chat.stories.js +1 -21
  10. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  11. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  12. package/dist/components/organisms/Chat/ContentChat/index.js +191 -343
  13. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  14. package/dist/components/organisms/Chat/index.js +3 -48
  15. package/dist/components/organisms/DashboardMetric/dashboardMetricUtils.js +0 -27
  16. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  17. package/dist/components/organisms/GlobalModal/styles.js +1 -1
  18. package/dist/components/organisms/OrderDetail/styles.js +1 -1
  19. package/dist/components/organisms/OrderDetail/utils/Table/styles.js +1 -1
  20. package/dist/components/pages/Dashboard/Dashboard.stories.js +50 -31
  21. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +81 -198
  22. package/dist/components/pages/ProviderProductEdition/index.js +429 -725
  23. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  24. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +139 -86
  25. package/dist/components/pages/RetailerProductEdition/index.js +279 -268
  26. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  27. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  28. package/dist/index.js +0 -13
  29. package/package.json +6 -7
  30. package/src/components/atoms/ButtonV2/styles.js +1 -1
  31. package/src/components/atoms/Status/styles.js +0 -4
  32. package/src/components/atoms/VerticalSideMenuMainPage/index.js +22 -18
  33. package/src/components/atoms/VerticalSideMenuMainPage/styles.js +4 -3
  34. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  35. package/src/components/molecules/HeaderTop/index.js +6 -52
  36. package/src/components/organisms/Chat/Chat.stories.js +0 -21
  37. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  38. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
  39. package/src/components/organisms/Chat/ContentChat/index.js +6 -81
  40. package/src/components/organisms/Chat/Footer/index.js +0 -11
  41. package/src/components/organisms/Chat/index.js +3 -47
  42. package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +1 -18
  43. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  44. package/src/components/organisms/GlobalModal/styles.js +0 -10
  45. package/src/components/organisms/OrderDetail/index.js +0 -1
  46. package/src/components/organisms/OrderDetail/styles.js +1 -1
  47. package/src/components/organisms/OrderDetail/utils/Table/styles.js +1 -0
  48. package/src/components/pages/Dashboard/Dashboard.stories.js +55 -31
  49. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +88 -214
  50. package/src/components/pages/ProviderProductEdition/index.js +160 -323
  51. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  52. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +146 -89
  53. package/src/components/pages/RetailerProductEdition/index.js +138 -112
  54. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  55. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  56. package/src/index.js +0 -1
  57. package/src/components/organisms/TableResizable/TableResizable.stories.js +0 -17
  58. package/src/components/organisms/TableResizable/index.js +0 -119
  59. package/src/components/organisms/TableResizable/styles.js +0 -133
  60. package/src/components/organisms/TableResizable/utils.js +0 -46
@@ -13,7 +13,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
14
  var _templateObject;
15
15
 
16
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n flex: 1;\n overflow: auto;\n\n .data-container {\n display: flex;\n flex: 0%;\n height: calc(100% - ", "px);\n .image-data-panel {\n width: 340px;\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .product-information {\n width: calc(100% - 341px);\n display: flex;\n flex-direction: column;\n\n .services-information-container {\n height: 100%;\n overflow: auto;\n }\n\n .image-services {\n aside {\n display: grid;\n grid-template-columns: repeat(auto-fill, 179px);\n column-gap: 15px;\n row-gap: 15px;\n padding: 20px;\n }\n }\n\n .commentary-box {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n padding: 10px;\n padding-left: 0;\n\n .commentary {\n display: flex;\n align-items: flex-end;\n\n .input-container {\n width: 500px;\n\n .quill {\n height: 100px;\n }\n\n & + * {\n margin-left: 5px;\n }\n }\n\n .buttons-box {\n display: flex;\n width: 210px;\n flex-wrap: wrap;\n\n .general-transparent-button {\n & + * {\n margin-top: 5px;\n }\n }\n\n .general-transparent-button,\n .general-green-button,\n .general-button-disabled {\n width: fit-content;\n min-width: 201px;\n height: 40px;\n }\n }\n }\n }\n\n .feedback-box {\n display: flex;\n }\n }\n }\n #modal-message-box {\n width: 400px;\n height: 100px;\n }\n .container {\n width: 100%;\n height: 100%;\n .dropzone {\n height: 100%;\n width: 100%;\n }\n }\n"])), function (_ref) {
16
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n flex: 1;\n overflow: auto;\n\n .data-container {\n display: flex;\n flex: 0%;\n height: calc(100% - ", "px);\n .image-data-panel {\n width: 340px;\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .product-information {\n width: calc(100% - 341px);\n display: flex;\n flex-direction: column;\n\n .services-information-container {\n height: 100%;\n overflow: auto;\n }\n\n .image-services {\n aside {\n display: grid;\n grid-template-columns: repeat(auto-fill, 179px);\n column-gap: 15px;\n row-gap: 15px;\n padding: 20px;\n }\n }\n\n .commentary-box {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n padding: 10px;\n padding-left: 0;\n\n .commentary {\n display: flex;\n align-items: flex-end;\n\n .input-container {\n width: 500px;\n\n .quill {\n height: 100px;\n }\n\n & + * {\n margin-left: 5px;\n }\n }\n\n .buttons-box {\n display: flex;\n width: 210px;\n flex-wrap: wrap;\n\n .general-transparent-button {\n & + * {\n margin-top: 5px;\n }\n }\n\n .general-transparent-button,\n .general-green-button,\n .general-button-disabled {\n width: fit-content;\n min-width: 201px;\n height: 40px;\n }\n }\n }\n }\n\n .feedback-box {\n display: flex;\n }\n }\n }\n .container {\n width: 100%;\n height: 100%;\n .dropzone {\n height: 100%;\n width: 100%;\n }\n }\n"])), function (_ref) {
17
17
  var headerTop = _ref.headerTop;
18
18
  return headerTop;
19
19
  });
@@ -5,18 +5,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.translateService = exports.sendMessage = exports.getInputsData = exports.getAuditVersion = exports.createMessage = void 0;
8
+ exports.getInputsData = exports.getAuditVersion = void 0;
9
9
 
10
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
11
 
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
13
-
14
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
15
13
 
16
14
  var _axios = _interopRequireDefault(require("axios"));
17
15
 
18
- var _handle_http = require("../../../global-files/handle_http");
19
-
20
16
  var getAuditVersion = /*#__PURE__*/function () {
21
17
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(articleId, setState, token) {
22
18
  var auditResponse;
@@ -68,59 +64,4 @@ var getInputsData = function getInputsData(services, activeRetailer, setDatashee
68
64
  }
69
65
  };
70
66
 
71
- exports.getInputsData = getInputsData;
72
-
73
- var translateService = function translateService(tab) {
74
- switch (tab) {
75
- case "description":
76
- case "Descripción":
77
- return "Descripciones";
78
-
79
- case "datasheet":
80
- case "Ficha técnica":
81
- return "Fichas técnicas";
82
-
83
- case "images":
84
- case "Imágenes":
85
- return "Imágenes";
86
- }
87
- };
88
-
89
- exports.translateService = translateService;
90
-
91
- var createMessage = function createMessage(retailers, idRetailer, oldStatus, newStatus, service) {
92
- var _ref2 = (retailers === null || retailers === void 0 ? void 0 : retailers.filter(function (ret) {
93
- return ret.id === idRetailer;
94
- })) || [],
95
- _ref3 = (0, _slicedToArray2.default)(_ref2, 1),
96
- retailer = _ref3[0];
97
-
98
- return "".concat(translateService(service), " de ").concat(retailer.name, " |").concat(oldStatus, "| a |").concat(newStatus);
99
- };
100
-
101
- exports.createMessage = createMessage;
102
-
103
- var sendMessage = /*#__PURE__*/function () {
104
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(data) {
105
- var paramsBody, paramsHeader;
106
- return _regenerator.default.wrap(function _callee2$(_context2) {
107
- while (1) {
108
- switch (_context2.prev = _context2.next) {
109
- case 0:
110
- paramsBody = data.paramsBody, paramsHeader = data.paramsHeader;
111
- return _context2.abrupt("return", (0, _handle_http.fetchPOST)(process.env.REACT_APP_CREATE_MESSAGES, paramsBody, paramsHeader));
112
-
113
- case 2:
114
- case "end":
115
- return _context2.stop();
116
- }
117
- }
118
- }, _callee2);
119
- }));
120
-
121
- return function sendMessage(_x4) {
122
- return _ref4.apply(this, arguments);
123
- };
124
- }();
125
-
126
- exports.sendMessage = sendMessage;
67
+ exports.getInputsData = getInputsData;
package/dist/index.js CHANGED
@@ -979,19 +979,6 @@ Object.keys(_RangeCalendar).forEach(function (key) {
979
979
  });
980
980
  });
981
981
 
982
- var _TableResizable = require("./components/organisms/TableResizable");
983
-
984
- Object.keys(_TableResizable).forEach(function (key) {
985
- if (key === "default" || key === "__esModule") return;
986
- if (key in exports && exports[key] === _TableResizable[key]) return;
987
- Object.defineProperty(exports, key, {
988
- enumerable: true,
989
- get: function get() {
990
- return _TableResizable[key];
991
- }
992
- });
993
- });
994
-
995
982
  var _ChangePasswordLogin = require("./components/pages/ChangePasswordLogin");
996
983
 
997
984
  Object.keys(_ChangePasswordLogin).forEach(function (key) {
package/package.json CHANGED
@@ -1,20 +1,19 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.3.54",
3
+ "version": "21.3.55",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
7
7
  "@aws-amplify/ui-react": "^2.17.0",
8
8
  "@babel/runtime": "^7.17.2",
9
- "@emotion/react": "^11.10.6",
10
- "@emotion/styled": "^11.10.6",
9
+ "@emotion/react": "^11.10.5",
10
+ "@emotion/styled": "^11.10.5",
11
11
  "@fortawesome/fontawesome-svg-core": "^6.2.0",
12
12
  "@fortawesome/free-regular-svg-icons": "^6.2.0",
13
13
  "@fortawesome/free-solid-svg-icons": "^6.2.0",
14
14
  "@fortawesome/react-fontawesome": "^0.2.0",
15
- "@mui/icons-material": "^5.11.16",
16
- "@mui/material": "^5.12.0",
17
- "@mui/styled-engine-sc": "^5.12.0",
15
+ "@mui/material": "^5.11.1",
16
+ "@mui/styled-engine-sc": "^5.10.6",
18
17
  "@storybook/addon-postcss": "^2.0.0",
19
18
  "@testing-library/jest-dom": "^5.11.4",
20
19
  "@testing-library/react": "^11.1.0",
@@ -44,7 +43,7 @@
44
43
  "react-scroll": "^1.8.8",
45
44
  "react-transition-group": "^4.4.5",
46
45
  "storybook-addon-external-links": "^2.0.3",
47
- "styled-components": "^5.3.9",
46
+ "styled-components": "^5.3.3",
48
47
  "swiper": "^8.4.4",
49
48
  "uuid": "^8.3.2",
50
49
  "web-vitals": "^1.0.1"
@@ -94,7 +94,7 @@ export const Container = styled.div`
94
94
  }
95
95
  &.pink {
96
96
  background-color: #e33aa9;
97
- color: red;
97
+ color: white;
98
98
  border-color: #e33aa9;
99
99
  &:hover {
100
100
  background-color: #b42983;
@@ -23,7 +23,6 @@ export const Container = styled.div`
23
23
 
24
24
  &.status-R,
25
25
  &.status-AS,
26
- &.status-SAC,
27
26
  &.status-PA {
28
27
  background-color: ${GlobalColors.reception};
29
28
  }
@@ -31,7 +30,6 @@ export const Container = styled.div`
31
30
  &.status-AA,
32
31
  &.status-AP,
33
32
  &.status-AC,
34
- &.status-AAC,
35
33
  &.status-ACA {
36
34
  background-color: ${GlobalColors.finished};
37
35
  }
@@ -39,7 +37,6 @@ export const Container = styled.div`
39
37
  &.status-RA,
40
38
  &.status-RC,
41
39
  &.status-RP,
42
- &.status-RAC,
43
40
  &.status-RCA {
44
41
  background-color: ${GlobalColors.rejected_status};
45
42
  }
@@ -50,7 +47,6 @@ export const Container = styled.div`
50
47
  background-color: ${GlobalColors.s4};
51
48
  }
52
49
 
53
- &.status-FAP,
54
50
  &.status-Ex {
55
51
  background-color: ${GlobalColors.exported};
56
52
  }
@@ -1,5 +1,3 @@
1
- import React, { useState } from "react";
2
- import { BrowserRouter as Router } from "react-router-dom";
3
1
  import {
4
2
  Container,
5
3
  NavLinkOption,
@@ -8,12 +6,14 @@ import {
8
6
  } from "./styles";
9
7
  import iconLogoContentoh from "../../../assets/images/verticalSideMenuMainPage/iconLogoContentoh.svg";
10
8
  import iconLogo from "../../../assets/images/verticalSideMenuMainPage/iconLogo.svg";
9
+ import React, { useState } from "react";
10
+ import { BrowserRouter as Router } from "react-router-dom";
11
11
 
12
12
  export const VerticalSideMenuMainPage = ({
13
13
  menuoption = [],
14
14
  containerdash,
15
15
  }) => {
16
- const [trueBar, setTrueBar] = useState(false);
16
+ const [trueBar, setTrueBar] = useState();
17
17
  return (
18
18
  <Router>
19
19
  <ContainerPrincipal>
@@ -27,25 +27,29 @@ export const VerticalSideMenuMainPage = ({
27
27
  src={trueBar ? iconLogoContentoh : iconLogo}
28
28
  alt="Logo"
29
29
  className="logo"
30
- />
30
+ ></img>
31
31
  <div className="option">
32
32
  {menuoption.map((item, index) => (
33
- <div key={index} className="option-div">
34
- <NavLinkOption to={item.path} bar={trueBar.toString()}>
33
+ <div key={index} bar={trueBar} className="option-div">
34
+ <NavLinkOption to={item.path} bar={trueBar}>
35
35
  <img src={item.icon} alt={item.title}></img>
36
- {trueBar ? <p>{item.title}</p> : null}
36
+ {trueBar && <p>{item.title}</p>}
37
37
  </NavLinkOption>
38
- {item?.suboption?.map((subitem, index) => (
39
- <div className="sub-option" key={index}>
40
- <NavLinkOption
41
- to={subitem.path}
42
- className="sub-option-link"
43
- bar={trueBar.toString()}
44
- >
45
- {trueBar ? subitem.title : null}
46
- </NavLinkOption>
47
- </div>
48
- ))}
38
+ {item.suboption !== undefined && (
39
+ <>
40
+ {item?.suboption?.map((subitem) => (
41
+ <div className="sub-option">
42
+ <NavLinkOption
43
+ to={subitem.path}
44
+ className="sub-option-link"
45
+ bar={trueBar}
46
+ >
47
+ {trueBar && <p>{subitem.title}</p>}
48
+ </NavLinkOption>
49
+ </div>
50
+ ))}
51
+ </>
52
+ )}
49
53
  </div>
50
54
  ))}
51
55
  </div>
@@ -9,7 +9,7 @@ export const Container = styled.div`
9
9
  flex-direction: column;
10
10
  justify-content: space-between;
11
11
  overflow: none;
12
- width: ${({ bar }) => (bar ? "240px" : "66px")};
12
+ width: ${({ bar }) => (bar ? 240 : 66)}px;
13
13
  background: linear-gradient(180deg, #e33aa9 0%, #3b1366 100%);
14
14
  scrollbar-width: none;
15
15
  display: flex;
@@ -65,7 +65,7 @@ export const NavLinkOption = styled(NavLink)`
65
65
  color: ${({ bar }) => (bar ? "#fafafa" : "transparent")};
66
66
  text-decoration: none;
67
67
  cursor: pointer;
68
- padding: ${({ bar }) => (bar ? "0 22px" : "0 8px")};
68
+ padding: ${({ bar }) => (bar ? "0 22" : "0 8")}px;
69
69
  &:hover {
70
70
  background: rgba(255, 255, 255, 0.2);
71
71
  color: #fafafa;
@@ -94,6 +94,7 @@ export const NavLinkOption = styled(NavLink)`
94
94
  border-radius: 0;
95
95
  transition: color 0.3s linear;
96
96
  color: ${({ bar }) => (bar ? "#f0eef2" : "transparent")};
97
+ padding-top: 14px;
97
98
  height: 25px;
98
99
  margin: 0;
99
100
  padding-left: 12px;
@@ -105,7 +106,7 @@ export const NavLinkOption = styled(NavLink)`
105
106
  height: 10px;
106
107
  background-color: white;
107
108
  position: absolute;
108
- top: 13;
109
+ bottom: 0;
109
110
  left: -6px;
110
111
  }
111
112
  &.active {
@@ -27,7 +27,7 @@ export const CarouselImagesLogin = ({
27
27
  img2.src = images[i];
28
28
  const circulo_actual = Array.from(circulos).find((el) => el.id === i);
29
29
  Array.from(circulos).forEach((cir) => cir.classList.remove("resaltado"));
30
- circulo_actual?.classList.add("resaltado");
30
+ circulo_actual.classList.add("resaltado");
31
31
  img1.classList.add("right");
32
32
  img2.classList.add("active");
33
33
  i++;
@@ -4,13 +4,10 @@ import { Button } from "../../atoms/GeneralButton/index";
4
4
  import { useEffect, useRef } from "react";
5
5
  import { Chat } from "../../organisms/Chat";
6
6
  import auditIcon from "../../../../src/assets/images/generalButton/Icono AB.svg";
7
- import { useState } from "react";
8
- import { render } from "@testing-library/react";
9
7
 
10
8
  export const HeaderTop = ({
11
9
  setHeaderTop,
12
10
  withChat,
13
- chatType,
14
11
  productSelected,
15
12
  token,
16
13
  auditableVersion,
@@ -19,51 +16,16 @@ export const HeaderTop = ({
19
16
  activeRetailer,
20
17
  }) => {
21
18
  const headerTop = useRef();
22
- const [chat, setChat] = useState(null);
23
- const [chatData, setChatData] = useState(null);
24
-
25
- useEffect(() => {
26
- if (activeRetailer.id && productSelected && token.length) {
27
- setChatData({
28
- id: productSelected?.article?.id_article || productSelected?.id_article,
29
- version: productSelected?.version,
30
- retailerId: activeRetailer?.id,
31
- status: productSelected?.status,
32
- userToken: token,
33
- });
34
- }
35
- }, [activeRetailer, productSelected, token]);
36
-
37
- useEffect(() => {
38
- if (chatType) renderChat(chatType);
39
- }, [chatData, chatType]);
40
19
 
41
20
  useEffect(() => {
42
21
  setHeaderTop && setHeaderTop(headerTop.current.clientHeight);
43
22
  }, []);
44
23
 
45
- const renderChat = (chatType) => {
46
- switch (chatType) {
47
- case "product_status":
48
- chatData &&
49
- setChat(
50
- <Chat
51
- chatType="product_status"
52
- chatContainerType="popUp"
53
- chatData={{
54
- id: chatData?.id,
55
- version: chatData?.version,
56
- retailerId: chatData?.retailerId,
57
- status: chatData?.status,
58
- userToken: chatData?.userToken,
59
- }}
60
- size={18}
61
- activeRetailer={activeRetailer}
62
- />
63
- );
64
- break;
65
- default:
66
- setChat(
24
+ return (
25
+ <Container ref={headerTop}>
26
+ <ScreenHeader text="Edición de producto" />
27
+ <div className="buttons-container">
28
+ {withChat && (
67
29
  <Chat
68
30
  chatType="merchant_product"
69
31
  chatContainerType="popUp"
@@ -75,16 +37,8 @@ export const HeaderTop = ({
75
37
  size={18}
76
38
  activeRetailer={activeRetailer}
77
39
  />
78
- );
79
- break;
80
- }
81
- };
40
+ )}
82
41
 
83
- return (
84
- <Container ref={headerTop}>
85
- <ScreenHeader text="Edición de producto" />
86
- <div className="buttons-container">
87
- {withChat && chat}
88
42
  {isAuditor && auditableVersion && (
89
43
  <Button
90
44
  buttonType="general-white-button circular-button"
@@ -162,24 +162,3 @@ chatTicket_userTECH.args = {
162
162
  },
163
163
  classNameContainerFixed: "chatTicket",
164
164
  };
165
-
166
- // ejemplo del chat para los cambios de status del producto.
167
- export const chatProduct_status = Template.bind({});
168
- chatProduct_status.args = {
169
- chatType: "product_status",
170
- chatContainerType: "popUp",
171
- chatData: {
172
- id: 37414,
173
- version: 7,
174
- retailerId: 70,
175
- status: "AA",
176
- orderId: 15189,
177
- userToken:
178
- "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJhOWFhMDQ4Zi05YzRjLTQxODMtYWUzMS03OWVjNjBhY2NjZGYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MzU4ODM4OSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY4MzU5MTk4OSwiaWF0IjoxNjgzNTg4Mzg5LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.k9FQfRR02XC3WWfOzWhrbJGmp69AmCHJEIrgtXKhIwC69trdphSm1AKkZnDJMsEdkpUgjF_zAOsa_xYRxO6goXy7WXVc_p7N-yFHlkhZrRyn3LEFKaLzD8vVqlWx4kgfSERm7KhI1AxPmrA-lw8eF6Axvqn3PvuszAw89_WhPOcnOt8vU0MxAVhLgS8oM6vyHFmHEHWQ2FnSYYed9sEvAxGh_B44aIgWeDteQGeGdYhsm6rUcxgkrskywZJp9FW5VgYXuDcC5NpvomMMRy_v95UV897JzCHl__sK2Z9ahm0eczVN3tAc0GbKnlN96ZrGTQ_nmNHbuMDPQBPXH5HXZQ",
179
- currentUser: {
180
- id: 37,
181
- companyId: 2,
182
- isUserTech: false,
183
- },
184
- },
185
- };
@@ -22,7 +22,6 @@ import { Tooltip } from "../../../atoms/Tooltip";
22
22
  import { Slide, Zoom } from "@mui/material";
23
23
  import { useRef } from "react";
24
24
  import { ImagePreview } from "../../../atoms/ImagePreview";
25
- import { Status } from "../../../atoms/Status";
26
25
  import { isUserTech } from "../../../../global-files/handle_userTech";
27
26
  import { container } from "aws-amplify";
28
27
 
@@ -56,10 +55,7 @@ export const ContainerItems = (props) => {
56
55
 
57
56
  useEffect(() => {
58
57
  if (!items) return;
59
- if (
60
- ["merchant_product", "order_product", "product_status"].includes(chatType)
61
- )
62
- renderItems();
58
+ if (["merchant_product", "order_product"].includes(chatType)) renderItems();
63
59
  else if (chatType === "ticket") renderItemsTicket();
64
60
  else setCustomItems([]);
65
61
  }, [items]);
@@ -134,16 +130,6 @@ export const ContainerItems = (props) => {
134
130
  return <label className="item-statusTicket">{item.value}</label>;
135
131
  };
136
132
 
137
- const renderStatusItem = (item) => {
138
- const splitText = item.value.split("|");
139
- let message = [];
140
- splitText.forEach((text, i) => {
141
- if (i === 1 || i === 3) message.push(<Status statusType={text} />);
142
- else message.push(text);
143
- });
144
- return <label className="item-statusItem">{message}</label>;
145
- };
146
-
147
133
  const renderStatusTicketNeutral = (item) => {
148
134
  return (
149
135
  <Tooltip
@@ -318,7 +304,7 @@ export const ContainerItems = (props) => {
318
304
  >
319
305
  <li
320
306
  className={
321
- (ownMessage && item.type !== "status" ? "own-message " : "") +
307
+ (ownMessage ? "own-message " : "") +
322
308
  (lastUserId === item.userId ? "sameUser" : "")
323
309
  }
324
310
  >
@@ -353,8 +339,6 @@ export const ContainerItems = (props) => {
353
339
  ? renderComment(item)
354
340
  : item.type === "img"
355
341
  ? renderImg(item)
356
- : item.type === "status"
357
- ? renderStatusItem(item)
358
342
  : item.type === "file"
359
343
  ? renderFile(item, ownMessage)
360
344
  : item.type === "statusTicket" &&
@@ -158,8 +158,7 @@ export const Container = styled.div`
158
158
  .item-message,
159
159
  .item-comment,
160
160
  .item-file,
161
- .item-statusTicket,
162
- .item-statusItem {
161
+ .item-statusTicket {
163
162
  border-radius: 10px;
164
163
  padding: 10px;
165
164
  font-family: ${FontFamily.RobotoRegular}, sans-serif;
@@ -174,17 +173,10 @@ export const Container = styled.div`
174
173
  .item-file {
175
174
  background-color: #8386ee;
176
175
  }
177
- .item-statusTicket,
178
- .item-statusItem {
176
+ .item-statusTicket {
179
177
  background-color: #85bc5b;
180
178
  }
181
179
 
182
- .item-statusItem {
183
- display: flex;
184
- gap: 3px;
185
- align-items: center;
186
- }
187
-
188
180
  .item-message {
189
181
  &.different-company {
190
182
  border: 1px solid #e33aa9;
@@ -100,7 +100,6 @@ export const ContentChat = (props) => {
100
100
  }
101
101
  if (chatType === "merchant_product") getInitialMerchantProduct();
102
102
  else if (chatType === "order_product") getInitialOrderProduct();
103
- else if (chatType === "product_status") getInitialProductStatus();
104
103
  else getInitialTicket();
105
104
  }
106
105
  if (!showPopUpChat) {
@@ -127,8 +126,6 @@ export const ContentChat = (props) => {
127
126
  } else if (chatType === "order_product") {
128
127
  if (companies) getUpdateLatestOrderProduct(true);
129
128
  else getInitialOrderProduct();
130
- } else if (chatType === "product_status") {
131
- getInitialProductStatus();
132
129
  } else {
133
130
  if (singleChat.items) getUpdateLatestTicket(true);
134
131
  else getInitialTicket();
@@ -138,47 +135,6 @@ export const ContentChat = (props) => {
138
135
  /*=======================================================================
139
136
  PETICION GET INICIAL SEGUN EL TIPO DE CHAT
140
137
  ======================================================================= */
141
- const getInitialProductStatus = async () => {
142
- const paramsQuery = {
143
- articleData: {
144
- articleId: JSON.stringify(dataChat.id),
145
- version: JSON.stringify(dataChat.version),
146
- retailerId: JSON.stringify(dataChat.retailerId),
147
- status: dataChat.status,
148
- },
149
- };
150
- const paramsHeaders = { Authorization: dataChat.userToken };
151
- const response = await fetchGET(
152
- process.env.REACT_APP_READ_MESSAGES,
153
- paramsQuery,
154
- paramsHeaders
155
- );
156
- if (!response.body) {
157
- setErrorChat({
158
- existError: true,
159
- code: 400,
160
- message: response.message,
161
- errorDetail: response.errorDetail,
162
- });
163
- setIsLoading(false);
164
- return;
165
- }
166
- // success
167
- setStartUpdate((prev) => prev + 1);
168
- setCurrentUser({
169
- id: response.body.data.currentUserId,
170
- companyId: response.body.data.currentCompanyId,
171
- });
172
- setLastUpdateDate(response.body.data.lastUpdateDate);
173
- setAllUsers(response.body.users);
174
- setSingleChat({
175
- items: response.body.items,
176
- enabledLoadMore: response.body.items.length === 50,
177
- });
178
- setErrorChat({ existError: false });
179
- setIsLoading(false);
180
- };
181
-
182
138
  const getInitialMerchantProduct = async () => {
183
139
  const paramsQuery = {
184
140
  getType: "initial",
@@ -653,14 +609,12 @@ export const ContentChat = (props) => {
653
609
  // enviar items a la BD
654
610
  if (chatType === "merchant_product") {
655
611
  errorCreate = await createItemsMerchantProduct(items);
656
- } else if (chatType === "product_status") {
657
- errorCreate = await createItemsProductStatus(items);
658
612
  } else if (chatType === "order_product") {
659
613
  errorCreate = await createItemsOrderProduct(items);
660
614
  } else errorCreate = await createItemsTicket(items);
661
615
 
662
616
  // actualizar chat para que aparezcan los items enviados
663
- if (["merchant_product", "product_status"].includes(chatType)) {
617
+ if (chatType === "merchant_product") {
664
618
  await getUpdateLatestMerchantProduct();
665
619
  } else if (chatType === "order_product") {
666
620
  await getUpdateLatestOrderProduct();
@@ -673,10 +627,9 @@ export const ContentChat = (props) => {
673
627
  };
674
628
 
675
629
  const createItemsMerchantProduct = async (items = []) => {
676
- const { id, version, orderId } = dataChat;
630
+ const { id, version } = dataChat;
677
631
  const { id: retailerId } = activeRetailer;
678
632
  const paramsBody = { id, version, items, retailerId };
679
- if (chatType === "product_status") paramsBody["orderId"] = orderId;
680
633
  const paramsHeaders = { Authorization: dataChat.userToken };
681
634
  const response = await fetchPOST(
682
635
  process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT,
@@ -690,23 +643,6 @@ export const ContentChat = (props) => {
690
643
  };
691
644
  }
692
645
  };
693
- const createItemsProductStatus = async (items = []) => {
694
- const { id, version, orderId, status } = dataChat;
695
- const { id: retailerId } = activeRetailer;
696
- const paramsBody = { id, version, items, retailerId, orderId, status };
697
- const paramsHeaders = { Authorization: dataChat.userToken };
698
- const response = await fetchPOST(
699
- process.env.REACT_APP_CREATE_MESSAGES,
700
- paramsBody,
701
- paramsHeaders
702
- );
703
- if (!response.body) {
704
- return {
705
- message: response.message,
706
- errorDetail: response.errorDetail,
707
- };
708
- }
709
- };
710
646
 
711
647
  const createItemsOrderProduct = async (items = []) => {
712
648
  const paramsBody = {
@@ -754,11 +690,7 @@ export const ContentChat = (props) => {
754
690
  SECCION DE FUNCIONES
755
691
  ======================================================================= */
756
692
  const isSingleChat = () => {
757
- if (
758
- chatType === "merchant_product" ||
759
- chatType === "ticket" ||
760
- chatType === "product_status"
761
- ) {
693
+ if (chatType === "merchant_product" || chatType === "ticket") {
762
694
  return true;
763
695
  }
764
696
  if (companies && Object.keys(companies).length < 2) return true;
@@ -869,7 +801,7 @@ export const ContentChat = (props) => {
869
801
  // mostrar chat?
870
802
  let items;
871
803
  let enabledLoadMore;
872
- if (["merchant_product", "ticket", "product_status"].includes(chatType)) {
804
+ if (["merchant_product", "ticket"].includes(chatType)) {
873
805
  items = singleChat.items;
874
806
  enabledLoadMore = singleChat.enabledLoadMore;
875
807
  }
@@ -911,9 +843,7 @@ export const ContentChat = (props) => {
911
843
  activeCompanyId={activeCompanyId}
912
844
  ticketCompany={ticketCompany}
913
845
  currentUser={
914
- ["merchant_product", "order_product", "product_status"].includes(
915
- chatType
916
- )
846
+ ["merchant_product", "order_product"].includes(chatType)
917
847
  ? currentUser
918
848
  : dataChat.currentUser
919
849
  }
@@ -952,12 +882,6 @@ export const ContentChat = (props) => {
952
882
  ? { id: dataChat.id, version: currentArticle.version }
953
883
  : chatType === "ticket"
954
884
  ? { id: dataChat.id }
955
- : chatType === "product_status"
956
- ? {
957
- id: dataChat.id,
958
- version: dataChat.version,
959
- retailerId: dataChat.retailerId,
960
- }
961
885
  : undefined
962
886
  }
963
887
  chatCompany={getChatCompany()}
@@ -1000,6 +924,7 @@ export const ContentChat = (props) => {
1000
924
  }}
1001
925
  />
1002
926
  )}
927
+
1003
928
  {/* body */}
1004
929
  {renderBodyChat()}
1005
930
  </Container>