contentoh-components-library 21.3.82 → 21.3.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/.env.development +0 -5
  2. package/.env.production +0 -3
  3. package/dist/components/atoms/ButtonV2/styles.js +1 -1
  4. package/dist/components/atoms/Card/index.js +5 -46
  5. package/dist/components/atoms/Card/styles.js +1 -3
  6. package/dist/components/atoms/CheckBox/index.js +2 -4
  7. package/dist/components/atoms/GeneralInput/index.js +20 -24
  8. package/dist/components/atoms/InputFormatter/index.js +16 -14
  9. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  10. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  11. package/dist/components/molecules/HeaderTop/index.js +11 -68
  12. package/dist/components/molecules/TabsMenu/index.js +48 -22
  13. package/dist/components/molecules/TagAndInput/index.js +3 -1
  14. package/dist/components/organisms/Chat/Chat.stories.js +8 -27
  15. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  16. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  17. package/dist/components/organisms/Chat/ContentChat/index.js +208 -359
  18. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  19. package/dist/components/organisms/Chat/index.js +4 -49
  20. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  21. package/dist/components/organisms/FullTabsMenu/index.js +12 -2
  22. package/dist/components/organisms/Modal/styles.js +1 -1
  23. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +96 -171
  24. package/dist/components/pages/ProviderProductEdition/index.js +196 -189
  25. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  26. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +28 -40
  27. package/dist/components/pages/RetailerProductEdition/index.js +290 -262
  28. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  29. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  30. package/dist/global-files/handle_http.js +2 -3
  31. package/dist/index.js +12 -51
  32. package/package.json +1 -3
  33. package/src/components/atoms/ButtonV2/styles.js +1 -1
  34. package/src/components/atoms/Card/index.js +2 -35
  35. package/src/components/atoms/Card/styles.js +5 -41
  36. package/src/components/atoms/CheckBox/index.js +0 -2
  37. package/src/components/atoms/GeneralInput/index.js +21 -20
  38. package/src/components/atoms/InputFormatter/index.js +18 -14
  39. package/src/components/atoms/InputFormatter/styles.js +1 -2
  40. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  41. package/src/components/molecules/HeaderTop/index.js +6 -52
  42. package/src/components/molecules/TabsMenu/index.js +88 -65
  43. package/src/components/molecules/TagAndInput/index.js +12 -10
  44. package/src/components/organisms/Chat/Chat.stories.js +7 -27
  45. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  46. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
  47. package/src/components/organisms/Chat/ContentChat/index.js +23 -97
  48. package/src/components/organisms/Chat/Footer/index.js +0 -11
  49. package/src/components/organisms/Chat/index.js +4 -46
  50. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  51. package/src/components/organisms/FullTabsMenu/index.js +16 -4
  52. package/src/components/organisms/Modal/styles.js +1 -4
  53. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +98 -181
  54. package/src/components/pages/ProviderProductEdition/index.js +142 -134
  55. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  56. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +26 -38
  57. package/src/components/pages/RetailerProductEdition/index.js +148 -111
  58. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  59. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  60. package/src/global-files/handle_http.js +1 -2
  61. package/src/index.js +0 -3
  62. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
  63. package/src/components/molecules/StripeCardForm/index.js +0 -42
  64. package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
  65. package/src/components/molecules/StripeCardForm/styles.js +0 -73
  66. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
  67. package/src/components/molecules/StripeCardSelector/index.js +0 -44
  68. package/src/components/molecules/StripeCardSelector/styles.js +0 -4
  69. package/src/components/molecules/StripeCardSelector/utils.js +0 -17
  70. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  71. package/src/components/organisms/SideModal/index.js +0 -50
  72. package/src/components/organisms/SideModal/styles.js +0 -30
@@ -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;
@@ -17,13 +17,12 @@ var _axios = _interopRequireDefault(require("axios"));
17
17
 
18
18
  var objToQueryString = function objToQueryString(obj) {
19
19
  if (!Object.values(obj).length) return null;
20
- return Object.entries(obj).map( //([key, value]) => `${key}=${encodeURIComponent(JSON.stringify(value))}`
21
- function (_ref) {
20
+ return Object.entries(obj).map(function (_ref) {
22
21
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
23
22
  key = _ref2[0],
24
23
  value = _ref2[1];
25
24
 
26
- return "".concat(key, "=").concat(encodeURIComponent(value));
25
+ return "".concat(key, "=").concat(encodeURIComponent(JSON.stringify(value)));
27
26
  }).join("&");
28
27
  };
29
28
  /**
package/dist/index.js CHANGED
@@ -810,7 +810,7 @@ Object.keys(_index61).forEach(function (key) {
810
810
  });
811
811
  });
812
812
 
813
- var _index62 = require("./components/molecules/StripeCardForm/index");
813
+ var _index62 = require("./components/organisms/ChangePassword/index");
814
814
 
815
815
  Object.keys(_index62).forEach(function (key) {
816
816
  if (key === "default" || key === "__esModule") return;
@@ -823,7 +823,7 @@ Object.keys(_index62).forEach(function (key) {
823
823
  });
824
824
  });
825
825
 
826
- var _index63 = require("./components/molecules/StripeCardSelector/index");
826
+ var _index63 = require("./components/organisms/Fullplan/index");
827
827
 
828
828
  Object.keys(_index63).forEach(function (key) {
829
829
  if (key === "default" || key === "__esModule") return;
@@ -836,7 +836,7 @@ Object.keys(_index63).forEach(function (key) {
836
836
  });
837
837
  });
838
838
 
839
- var _index64 = require("./components/organisms/ChangePassword/index");
839
+ var _index64 = require("./components/organisms/FullProductNameHeader/index");
840
840
 
841
841
  Object.keys(_index64).forEach(function (key) {
842
842
  if (key === "default" || key === "__esModule") return;
@@ -849,7 +849,7 @@ Object.keys(_index64).forEach(function (key) {
849
849
  });
850
850
  });
851
851
 
852
- var _index65 = require("./components/organisms/Fullplan/index");
852
+ var _index65 = require("./components/organisms/FullTabsMenu/index");
853
853
 
854
854
  Object.keys(_index65).forEach(function (key) {
855
855
  if (key === "default" || key === "__esModule") return;
@@ -862,7 +862,7 @@ Object.keys(_index65).forEach(function (key) {
862
862
  });
863
863
  });
864
864
 
865
- var _index66 = require("./components/organisms/FullProductNameHeader/index");
865
+ var _index66 = require("./components/organisms/ImageDataTable/index");
866
866
 
867
867
  Object.keys(_index66).forEach(function (key) {
868
868
  if (key === "default" || key === "__esModule") return;
@@ -875,7 +875,7 @@ Object.keys(_index66).forEach(function (key) {
875
875
  });
876
876
  });
877
877
 
878
- var _index67 = require("./components/organisms/FullTabsMenu/index");
878
+ var _index67 = require("./components/organisms/ImagePreviewer/index");
879
879
 
880
880
  Object.keys(_index67).forEach(function (key) {
881
881
  if (key === "default" || key === "__esModule") return;
@@ -888,7 +888,7 @@ Object.keys(_index67).forEach(function (key) {
888
888
  });
889
889
  });
890
890
 
891
- var _index68 = require("./components/organisms/ImageDataTable/index");
891
+ var _index68 = require("./components/organisms/ImagesGroup/index");
892
892
 
893
893
  Object.keys(_index68).forEach(function (key) {
894
894
  if (key === "default" || key === "__esModule") return;
@@ -901,7 +901,7 @@ Object.keys(_index68).forEach(function (key) {
901
901
  });
902
902
  });
903
903
 
904
- var _index69 = require("./components/organisms/ImagePreviewer/index");
904
+ var _index69 = require("./components/organisms/InputGroup/index");
905
905
 
906
906
  Object.keys(_index69).forEach(function (key) {
907
907
  if (key === "default" || key === "__esModule") return;
@@ -914,7 +914,7 @@ Object.keys(_index69).forEach(function (key) {
914
914
  });
915
915
  });
916
916
 
917
- var _index70 = require("./components/organisms/ImagesGroup/index");
917
+ var _index70 = require("./components/organisms/ProductImageModal/index");
918
918
 
919
919
  Object.keys(_index70).forEach(function (key) {
920
920
  if (key === "default" || key === "__esModule") return;
@@ -927,7 +927,7 @@ Object.keys(_index70).forEach(function (key) {
927
927
  });
928
928
  });
929
929
 
930
- var _index71 = require("./components/organisms/InputGroup/index");
930
+ var _index71 = require("./components/organisms/Chat/index");
931
931
 
932
932
  Object.keys(_index71).forEach(function (key) {
933
933
  if (key === "default" || key === "__esModule") return;
@@ -940,7 +940,7 @@ Object.keys(_index71).forEach(function (key) {
940
940
  });
941
941
  });
942
942
 
943
- var _index72 = require("./components/organisms/ProductImageModal/index");
943
+ var _index72 = require("./components/organisms/Modal/index");
944
944
 
945
945
  Object.keys(_index72).forEach(function (key) {
946
946
  if (key === "default" || key === "__esModule") return;
@@ -953,7 +953,7 @@ Object.keys(_index72).forEach(function (key) {
953
953
  });
954
954
  });
955
955
 
956
- var _index73 = require("./components/organisms/Chat/index");
956
+ var _index73 = require("./components/organisms/OrderDetail/index");
957
957
 
958
958
  Object.keys(_index73).forEach(function (key) {
959
959
  if (key === "default" || key === "__esModule") return;
@@ -966,32 +966,6 @@ Object.keys(_index73).forEach(function (key) {
966
966
  });
967
967
  });
968
968
 
969
- var _index74 = require("./components/organisms/Modal/index");
970
-
971
- Object.keys(_index74).forEach(function (key) {
972
- if (key === "default" || key === "__esModule") return;
973
- if (key in exports && exports[key] === _index74[key]) return;
974
- Object.defineProperty(exports, key, {
975
- enumerable: true,
976
- get: function get() {
977
- return _index74[key];
978
- }
979
- });
980
- });
981
-
982
- var _index75 = require("./components/organisms/OrderDetail/index");
983
-
984
- Object.keys(_index75).forEach(function (key) {
985
- if (key === "default" || key === "__esModule") return;
986
- if (key in exports && exports[key] === _index75[key]) return;
987
- Object.defineProperty(exports, key, {
988
- enumerable: true,
989
- get: function get() {
990
- return _index75[key];
991
- }
992
- });
993
- });
994
-
995
969
  var _RangeCalendar = require("./components/organisms/RangeCalendar");
996
970
 
997
971
  Object.keys(_RangeCalendar).forEach(function (key) {
@@ -1018,19 +992,6 @@ Object.keys(_TableResizable).forEach(function (key) {
1018
992
  });
1019
993
  });
1020
994
 
1021
- var _index76 = require("./components/organisms/SideModal/index");
1022
-
1023
- Object.keys(_index76).forEach(function (key) {
1024
- if (key === "default" || key === "__esModule") return;
1025
- if (key in exports && exports[key] === _index76[key]) return;
1026
- Object.defineProperty(exports, key, {
1027
- enumerable: true,
1028
- get: function get() {
1029
- return _index76[key];
1030
- }
1031
- });
1032
- });
1033
-
1034
995
  var _ChangePasswordLogin = require("./components/pages/ChangePasswordLogin");
1035
996
 
1036
997
  Object.keys(_ChangePasswordLogin).forEach(function (key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.3.82",
3
+ "version": "21.3.83",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -16,8 +16,6 @@
16
16
  "@mui/material": "^5.12.0",
17
17
  "@mui/styled-engine-sc": "^5.12.0",
18
18
  "@storybook/addon-postcss": "^2.0.0",
19
- "@stripe/react-stripe-js": "^2.1.1",
20
- "@stripe/stripe-js": "^1.54.1",
21
19
  "@testing-library/jest-dom": "^5.11.4",
22
20
  "@testing-library/react": "^11.1.0",
23
21
  "@testing-library/user-event": "^12.1.10",
@@ -94,7 +94,7 @@ export const Container = styled.div`
94
94
  }
95
95
  &.pink {
96
96
  background-color: #e33aa9;
97
- color: white;
97
+ color: red;
98
98
  border-color: #e33aa9;
99
99
  &:hover {
100
100
  background-color: #b42983;
@@ -1,42 +1,9 @@
1
1
  import { Container } from "./styles";
2
- import { CheckBox } from "../CheckBox";
3
- import { CardCvcElement, useStripe } from "@stripe/react-stripe-js";
4
-
5
- export const Card = ({
6
- card = {},
7
- selectedCard,
8
- setSelectedCard,
9
- setCard,
10
- setStripe,
11
- }) => {
12
- const stripe = useStripe();
13
-
14
- const handleOnChange = (e, cardId) => {
15
- if (e.target.checked) {
16
- setCard && setCard({ ...card, isNew: 0 });
17
- setStripe && setStripe(stripe);
18
- setSelectedCard && setSelectedCard(cardId);
19
- } else {
20
- setSelectedCard && setSelectedCard("");
21
- setCard && setCard(null);
22
- }
23
- };
24
2
 
3
+ export const Card = ({ cardIcon, altText }) => {
25
4
  return (
26
5
  <Container>
27
- <div className="card-details">
28
- <CheckBox
29
- id={card.id}
30
- label={
31
- <>
32
- <span className="brand-card">{card.brand}</span>
33
- <span>{`**** **** **** ${card.last4}`}</span>
34
- </>
35
- }
36
- checked={selectedCard === card.id}
37
- onChange={(e) => handleOnChange(e, card.id)}
38
- />
39
- </div>
6
+ <img src={cardIcon} alt={altText} />
40
7
  </Container>
41
8
  );
42
9
  };
@@ -1,44 +1,8 @@
1
1
  import styled from "styled-components";
2
- import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
2
 
4
3
  export const Container = styled.div`
5
- display: flex;
6
- cursor: pointer;
7
-
8
- .card-details {
9
- label {
10
- cursor: pointer;
11
- height: 25px;
12
- p {
13
- margin-left: 40px;
14
- span {
15
- & + * {
16
- margin-left: 20px;
17
- }
18
- }
19
- }
20
- }
21
- & + * {
22
- margin-left: 20px;
23
- }
24
- }
25
-
26
- .cvc-input {
27
- display: flex;
28
- align-items: center;
29
- color: ${GlobalColors.s4};
30
- font-family: ${FontFamily.AvenirNext};
31
- font-size: 13px;
32
-
33
- .card-input {
34
- border: 1px solid #f0f0f0 !important;
35
- border-radius: 5px;
36
- padding: 3px;
37
- width: 50px;
38
- }
39
- }
40
-
41
- & + * {
42
- margin-top: 15px;
43
- }
44
- `;
4
+ img {
5
+ width: 100%;
6
+ margin:auto;
7
+ }
8
+ `;
@@ -7,7 +7,6 @@ export const CheckBox = ({
7
7
  isFilter,
8
8
  defaultChecked,
9
9
  disabled = false,
10
- checked,
11
10
  }) => {
12
11
  return (
13
12
  <Container key={`check-${id}`}>
@@ -18,7 +17,6 @@ export const CheckBox = ({
18
17
  onChange={onChange}
19
18
  defaultChecked={defaultChecked}
20
19
  disabled={disabled}
21
- checked={checked}
22
20
  />
23
21
  <label htmlFor={id}>
24
22
  {label && <p className={isFilter && "filter-text"}>{label}</p>}
@@ -7,7 +7,7 @@ export const GeneralInput = ({
7
7
  inputType,
8
8
  inputId,
9
9
  inputName,
10
- inputValue = "",
10
+ inputValue,
11
11
  inputPlaceholder,
12
12
  validateInput,
13
13
  position,
@@ -43,6 +43,7 @@ export const GeneralInput = ({
43
43
  ) {
44
44
  let generalValue;
45
45
  if (optionList?.length > 0) {
46
+ let index = evt.target.selectedIndex;
46
47
  let valueSelected = evt.target.value;
47
48
  generalValue = valueSelected;
48
49
  setTextValue({ value: generalValue });
@@ -55,26 +56,26 @@ export const GeneralInput = ({
55
56
  }
56
57
  let dataSave = updatedDatasheets?.slice();
57
58
 
58
- if (dataSave?.length > 0) {
59
- const index = dataSave.findIndex((e) => e.attributeId === inputId);
60
- if (index !== -1) {
61
- if (generalValue !== inputValue) dataSave[index].value = generalValue;
62
- else dataSave.splice(index, 1);
63
- } else {
64
- dataSave.push({
65
- articleId: articleId,
66
- attributeId: inputId,
67
- value: generalValue,
68
- });
69
- }
59
+ if (dataSave.length === 0)
60
+ dataSave.push({
61
+ articleId: articleId,
62
+ versionId: version,
63
+ attributeId: inputId,
64
+ value: generalValue,
65
+ });
66
+ else if (dataSave.some((e) => e.attributeId === inputId)) {
67
+ dataSave.forEach((e) => {
68
+ if (e.attributeId === inputId) {
69
+ e.value = generalValue;
70
+ }
71
+ });
70
72
  } else {
71
- if (generalValue !== inputValue) {
72
- dataSave.push({
73
- articleId: articleId,
74
- attributeId: inputId,
75
- value: generalValue,
76
- });
77
- }
73
+ dataSave.push({
74
+ articleId: articleId,
75
+ versionId: version,
76
+ attributeId: inputId,
77
+ value: generalValue,
78
+ });
78
79
  }
79
80
  setUpdatedDatasheets(dataSave);
80
81
  } else {
@@ -1,6 +1,6 @@
1
1
  import ReactQuill from "react-quill";
2
2
  import "react-quill/dist/quill.snow.css";
3
- import { useState } from "react";
3
+ import { useEffect, useState } from "react";
4
4
  import { Container } from "./styles";
5
5
 
6
6
  export const InputFormatter = ({
@@ -9,6 +9,8 @@ export const InputFormatter = ({
9
9
  articleId,
10
10
  updatedDescriptions,
11
11
  setUpdatedDescriptions,
12
+ addTextAreaToArray,
13
+ name,
12
14
  isRequired,
13
15
  maxChar,
14
16
  }) => {
@@ -42,7 +44,7 @@ export const InputFormatter = ({
42
44
  .replace(/\&amp;/gm, "&");
43
45
  };
44
46
 
45
- const onChange = (valueInput, h) => {
47
+ const onChange = (valueInput, delta, user, h) => {
46
48
  let value = "";
47
49
  try {
48
50
  if (h.getLength() - 1 <= maxLength) {
@@ -70,10 +72,12 @@ export const InputFormatter = ({
70
72
  let idInput = inputId;
71
73
  let dataSave = updatedDescriptions?.slice();
72
74
  if (dataSave?.length > 0) {
73
- const index = dataSave.findIndex((e) => e.attributeId === idInput);
74
- if (index !== -1) {
75
- if (value !== mainValue) dataSave[index].value = value;
76
- else dataSave.splice(index, 1);
75
+ if (dataSave.filter((e) => e.attributeId === idInput).length > 0) {
76
+ dataSave.forEach((e) => {
77
+ if (e.attributeId === idInput) {
78
+ e.value = value;
79
+ }
80
+ });
77
81
  } else {
78
82
  dataSave.push({
79
83
  articleId: articleId,
@@ -82,13 +86,11 @@ export const InputFormatter = ({
82
86
  });
83
87
  }
84
88
  } else {
85
- if (value !== mainValue) {
86
- dataSave.push({
87
- articleId: articleId,
88
- attributeId: idInput,
89
- value: value,
90
- });
91
- }
89
+ dataSave.push({
90
+ articleId: articleId,
91
+ attributeId: idInput,
92
+ value: value,
93
+ });
92
94
  }
93
95
  setUpdatedDescriptions(dataSave);
94
96
  }
@@ -140,7 +142,9 @@ export const InputFormatter = ({
140
142
  e.preventDefault();
141
143
  }
142
144
  }}
143
- onChange={(valueInput, user, range, h) => onChange(valueInput, h)}
145
+ onChange={(valueInput, user, range, h) => {
146
+ onChange(valueInput, user, range, h);
147
+ }}
144
148
  onChangeSelection={getSelection}
145
149
  />
146
150
  <p className="description-limit">
@@ -37,6 +37,5 @@ export const Container = styled.div`
37
37
  font-family: ${FontFamily.AvenirNext};
38
38
  color: ${GlobalColors.deep_gray};
39
39
  text-align: right;
40
- margin-top: 5px;
41
40
  }
42
- `;
41
+ `;
@@ -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"