contentoh-components-library 21.3.83 → 21.3.85

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.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -23,7 +23,8 @@ var GeneralInput = function GeneralInput(_ref) {
23
23
  var inputType = _ref.inputType,
24
24
  inputId = _ref.inputId,
25
25
  inputName = _ref.inputName,
26
- inputValue = _ref.inputValue,
26
+ _ref$inputValue = _ref.inputValue,
27
+ inputValue = _ref$inputValue === void 0 ? "" : _ref$inputValue,
27
28
  inputPlaceholder = _ref.inputPlaceholder,
28
29
  validateInput = _ref.validateInput,
29
30
  position = _ref.position,
@@ -66,7 +67,6 @@ var GeneralInput = function GeneralInput(_ref) {
66
67
  var generalValue;
67
68
 
68
69
  if ((optionList === null || optionList === void 0 ? void 0 : optionList.length) > 0) {
69
- var index = evt.target.selectedIndex;
70
70
  var valueSelected = evt.target.value;
71
71
  generalValue = valueSelected;
72
72
  setTextValue({
@@ -80,27 +80,31 @@ var GeneralInput = function GeneralInput(_ref) {
80
80
  }
81
81
 
82
82
  var dataSave = updatedDatasheets === null || updatedDatasheets === void 0 ? void 0 : updatedDatasheets.slice();
83
- if (dataSave.length === 0) dataSave.push({
84
- articleId: articleId,
85
- versionId: version,
86
- attributeId: inputId,
87
- value: generalValue
88
- });else if (dataSave.some(function (e) {
89
- return e.attributeId === inputId;
90
- })) {
91
- dataSave.forEach(function (e) {
92
- if (e.attributeId === inputId) {
93
- e.value = generalValue;
94
- }
83
+
84
+ if ((dataSave === null || dataSave === void 0 ? void 0 : dataSave.length) > 0) {
85
+ var index = dataSave.findIndex(function (e) {
86
+ return e.attributeId === inputId;
95
87
  });
88
+
89
+ if (index !== -1) {
90
+ if (generalValue !== inputValue) dataSave[index].value = generalValue;else dataSave.splice(index, 1);
91
+ } else {
92
+ dataSave.push({
93
+ articleId: articleId,
94
+ attributeId: inputId,
95
+ value: generalValue
96
+ });
97
+ }
96
98
  } else {
97
- dataSave.push({
98
- articleId: articleId,
99
- versionId: version,
100
- attributeId: inputId,
101
- value: generalValue
102
- });
99
+ if (generalValue !== inputValue) {
100
+ dataSave.push({
101
+ articleId: articleId,
102
+ attributeId: inputId,
103
+ value: generalValue
104
+ });
105
+ }
103
106
  }
107
+
104
108
  setUpdatedDatasheets(dataSave);
105
109
  } else {
106
110
  setTextValue({
@@ -26,8 +26,6 @@ var InputFormatter = function InputFormatter(_ref) {
26
26
  articleId = _ref.articleId,
27
27
  updatedDescriptions = _ref.updatedDescriptions,
28
28
  setUpdatedDescriptions = _ref.setUpdatedDescriptions,
29
- addTextAreaToArray = _ref.addTextAreaToArray,
30
- name = _ref.name,
31
29
  isRequired = _ref.isRequired,
32
30
  maxChar = _ref.maxChar;
33
31
 
@@ -77,7 +75,7 @@ var InputFormatter = function InputFormatter(_ref) {
77
75
  return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "").replace(/\&nbsp;/gm, " ").replace(/\&amp;/gm, "&");
78
76
  };
79
77
 
80
- var _onChange = function onChange(valueInput, delta, user, h) {
78
+ var _onChange = function onChange(valueInput, h) {
81
79
  var value = "";
82
80
 
83
81
  try {
@@ -104,14 +102,12 @@ var InputFormatter = function InputFormatter(_ref) {
104
102
  var dataSave = updatedDescriptions === null || updatedDescriptions === void 0 ? void 0 : updatedDescriptions.slice();
105
103
 
106
104
  if ((dataSave === null || dataSave === void 0 ? void 0 : dataSave.length) > 0) {
107
- if (dataSave.filter(function (e) {
105
+ var index = dataSave.findIndex(function (e) {
108
106
  return e.attributeId === idInput;
109
- }).length > 0) {
110
- dataSave.forEach(function (e) {
111
- if (e.attributeId === idInput) {
112
- e.value = value;
113
- }
114
- });
107
+ });
108
+
109
+ if (index !== -1) {
110
+ if (value !== mainValue) dataSave[index].value = value;else dataSave.splice(index, 1);
115
111
  } else {
116
112
  dataSave.push({
117
113
  articleId: articleId,
@@ -120,11 +116,13 @@ var InputFormatter = function InputFormatter(_ref) {
120
116
  });
121
117
  }
122
118
  } else {
123
- dataSave.push({
124
- articleId: articleId,
125
- attributeId: idInput,
126
- value: value
127
- });
119
+ if (value !== mainValue) {
120
+ dataSave.push({
121
+ articleId: articleId,
122
+ attributeId: idInput,
123
+ value: value
124
+ });
125
+ }
128
126
  }
129
127
 
130
128
  setUpdatedDescriptions(dataSave);
@@ -174,7 +172,7 @@ var InputFormatter = function InputFormatter(_ref) {
174
172
  }
175
173
  },
176
174
  onChange: function onChange(valueInput, user, range, h) {
177
- _onChange(valueInput, user, range, h);
175
+ return _onChange(valueInput, h);
178
176
  },
179
177
  onChangeSelection: getSelection
180
178
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-family: ", ";\n color: ", ";\n font-size: 14px;\n line-height: 21px;\n border-bottom: 2px solid ", ";\n width: 149px;\n padding-bottom: 5px;\n transition: 0.1s all;\n\n &.active {\n font-size: 18px;\n border-bottom: 2px solid ", ";\n }\n\n & + * {\n margin-left: 10px;\n }\n"])), _variables.FontFamily.Raleway_500, _variables.GlobalColors.s5, _variables.GlobalColors.s3, _variables.GlobalColors.magenta_s2);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-family: ", ";\n color: ", ";\n font-size: 14px;\n line-height: 21px;\n border-bottom: 2px solid ", ";\n width: 149px;\n padding-bottom: 5px;\n transition: 0.1s all;\n cursor: pointer;\n\n &.active {\n font-size: 18px;\n border-bottom: 2px solid ", ";\n }\n\n & + * {\n margin-left: 10px;\n }\n"])), _variables.FontFamily.Raleway_500, _variables.GlobalColors.s5, _variables.GlobalColors.s3, _variables.GlobalColors.magenta_s2);
19
19
 
20
20
  exports.Container = Container;
@@ -27,18 +27,9 @@ var TabsMenu = function TabsMenu(_ref) {
27
27
  setImagesSection = _ref.setImagesSection,
28
28
  setActiveTab = _ref.setActiveTab,
29
29
  activeTab = _ref.activeTab,
30
- desc = _ref.desc,
31
- setDesc = _ref.setDesc,
32
- fich = _ref.fich,
33
- setFich = _ref.setFich,
34
- imag = _ref.imag,
35
- setImag = _ref.setImag,
36
30
  updatedDescriptions = _ref.updatedDescriptions,
37
31
  updatedDatasheets = _ref.updatedDatasheets,
38
- selectedImages = _ref.selectedImages,
39
- setUpdatedDescriptions = _ref.setUpdatedDescriptions,
40
- setUpdatedDatasheets = _ref.setUpdatedDatasheets,
41
- setSelectedImages = _ref.setSelectedImages;
32
+ images = _ref.images;
42
33
 
43
34
  var _useState = (0, _react.useState)(tabsSections),
44
35
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -50,30 +41,20 @@ var TabsMenu = function TabsMenu(_ref) {
50
41
  modal = _useState4[0],
51
42
  setModal = _useState4[1];
52
43
 
53
- var _useState5 = (0, _react.useState)(true),
44
+ var _useState5 = (0, _react.useState)(""),
54
45
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
55
- isFirstExecution = _useState6[0],
56
- setIsFirstExecution = _useState6[1];
46
+ cancelAccept = _useState6[0],
47
+ setCancelAccept = _useState6[1];
57
48
 
58
- var _useState7 = (0, _react.useState)(''),
49
+ var _useState7 = (0, _react.useState)(""),
59
50
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
60
- detectaTab = _useState8[0],
61
- setDetectaTab = _useState8[1];
51
+ llave = _useState8[0],
52
+ setLlave = _useState8[1];
62
53
 
63
- var _useState9 = (0, _react.useState)(''),
54
+ var _useState9 = (0, _react.useState)(),
64
55
  _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
65
- cancelAccept = _useState10[0],
66
- setCancelAccept = _useState10[1];
67
-
68
- var _useState11 = (0, _react.useState)(''),
69
- _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
70
- llave = _useState12[0],
71
- setLlave = _useState12[1];
72
-
73
- var _useState13 = (0, _react.useState)(),
74
- _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
75
- objeto = _useState14[0],
76
- setObjeto = _useState14[1];
56
+ objeto = _useState10[0],
57
+ setObjeto = _useState10[1];
77
58
 
78
59
  var activeSection = function activeSection(key) {
79
60
  var array = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -81,38 +62,31 @@ var TabsMenu = function TabsMenu(_ref) {
81
62
  setImagesSection(key === "Imágenes");
82
63
  Object.keys(array).forEach(function (section) {
83
64
  tempArray[section] = section === key;
84
-
85
- if (section === key) {
86
- setUpdatedDatasheets([]);
87
- setUpdatedDescriptions([]);
88
- setSelectedImages([]);
89
- setDesc([]);
90
- setFich([]);
91
- setImag([]);
92
- return setActiveTab(key);
93
- }
94
-
95
- ;
65
+ if (section === key) return setActiveTab(key);
96
66
  });
97
67
  setSections(tempArray);
98
68
  };
99
69
 
100
70
  (0, _react.useEffect)(function () {
101
- if (cancelAccept === 'Aceptar' & llave !== '') {
102
- setCancelAccept('');
71
+ if (cancelAccept === "Aceptar" & llave !== "") {
72
+ setCancelAccept("");
103
73
  setModal(false);
104
74
  activeSection(llave, objeto);
105
- } else if (cancelAccept === 'Cancelar' & llave !== '') {
75
+ } else if (cancelAccept === "Cancelar" & llave !== "") {
106
76
  setModal(false);
107
- setCancelAccept('');
77
+ setCancelAccept("");
108
78
  }
109
79
  }, [cancelAccept]);
110
80
 
111
- function detectClickFunction(e, key, sections) {
81
+ var detectClickFunction = function detectClickFunction(e, key, sections) {
82
+ var _images$values, _images$values$filter;
83
+
112
84
  var targetIsTheCurrentTab = e.target.innerHTML === activeTab;
113
85
  var descriptionsWereUpdated = updatedDescriptions.length > 0;
114
86
  var datasheetWereUpdated = updatedDatasheets.length > 0;
115
- var imagesWereUpdated = selectedImages.length > 0;
87
+ var imagesWereUpdated = (images === null || images === void 0 ? void 0 : (_images$values = images.values) === null || _images$values === void 0 ? void 0 : (_images$values$filter = _images$values.filter(function (f) {
88
+ return !f.id;
89
+ })) === null || _images$values$filter === void 0 ? void 0 : _images$values$filter.length) > 0;
116
90
  var dataWereUpdated = descriptionsWereUpdated || datasheetWereUpdated || imagesWereUpdated;
117
91
 
118
92
  if (!targetIsTheCurrentTab && !dataWereUpdated) {
@@ -124,7 +98,7 @@ var TabsMenu = function TabsMenu(_ref) {
124
98
  setLlave(key);
125
99
  setObjeto(sections);
126
100
  }
127
- }
101
+ };
128
102
 
129
103
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
130
104
  children: [activeTab && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
@@ -11,8 +11,6 @@ var _index = require("../../atoms/ScreenHeader/index");
11
11
 
12
12
  var _index2 = require("../../atoms/GeneralInput/index");
13
13
 
14
- var _react = require("react");
15
-
16
14
  var _jsxRuntime = require("react/jsx-runtime");
17
15
 
18
16
  var TagAndInput = function TagAndInput(_ref) {
@@ -54,7 +52,7 @@ var TagAndInput = function TagAndInput(_ref) {
54
52
  }), showTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
55
53
  className: "tooltip",
56
54
  children: label
57
- })]
55
+ }), " ", inputId]
58
56
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.GeneralInput, {
59
57
  inputId: inputId,
60
58
  inputType: inputType,
@@ -419,9 +419,11 @@ var ContentChat = function ContentChat(props) {
419
419
  isUserTech: (_dataChat$currentUser3 = dataChat.currentUser) === null || _dataChat$currentUser3 === void 0 ? void 0 : _dataChat$currentUser3.isUserTech
420
420
  };
421
421
  paramsQuery = {
422
- id: JSON.stringify(dataChat.id),
422
+ //id: JSON.stringify(dataChat.id),
423
+ id: dataChat.id,
423
424
  getType: "initial",
424
- currentUser: (0, _utils.encodeUriJson)(dataUser),
425
+ //currentUser: encodeUriJson(dataUser),
426
+ currentUser: encodeURIComponent(JSON.stringify(dataUser)),
425
427
  currentItemsFront: (0, _utils.encodeUriJson)(getItemsIdSingleChat())
426
428
  };
427
429
  _context3.next = 5;
@@ -36,12 +36,7 @@ var FullTabsMenu = function FullTabsMenu(_ref) {
36
36
  canAssign = _ref.canAssign,
37
37
  version = _ref.version,
38
38
  setShowVersionSelector = _ref.setShowVersionSelector,
39
- desc = _ref.desc,
40
- setDesc = _ref.setDesc,
41
- fich = _ref.fich,
42
- setFich = _ref.setFich,
43
- imag = _ref.imag,
44
- setImag = _ref.setImag,
39
+ images = _ref.images,
45
40
  updatedDescriptions = _ref.updatedDescriptions,
46
41
  updatedDatasheets = _ref.updatedDatasheets,
47
42
  selectedImages = _ref.selectedImages,
@@ -60,12 +55,7 @@ var FullTabsMenu = function FullTabsMenu(_ref) {
60
55
  setImagesSection: setImagesSection,
61
56
  setActiveTab: setActiveTab,
62
57
  activeTab: activeTab,
63
- desc: desc,
64
- setDesc: setDesc,
65
- fich: fich,
66
- setFich: setFich,
67
- imag: imag,
68
- setImag: setImag,
58
+ images: images,
69
59
  updatedDescriptions: updatedDescriptions,
70
60
  updatedDatasheets: updatedDatasheets,
71
61
  selectedImages: selectedImages,
@@ -455,27 +455,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
455
455
  origin = _useState62[0],
456
456
  setOrigin = _useState62[1];
457
457
 
458
- var _useState63 = (0, _react.useState)([]),
458
+ var _useState63 = (0, _react.useState)(false),
459
459
  _useState64 = (0, _slicedToArray2.default)(_useState63, 2),
460
- desc = _useState64[0],
461
- setDesc = _useState64[1];
460
+ inCart = _useState64[0],
461
+ setInCart = _useState64[1];
462
462
 
463
- var _useState65 = (0, _react.useState)([]),
464
- _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
465
- fich = _useState66[0],
466
- setFich = _useState66[1];
467
-
468
- var _useState67 = (0, _react.useState)([]),
469
- _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
470
- imag = _useState68[0],
471
- setImag = _useState68[1];
472
-
473
- var _useState69 = (0, _react.useState)(false),
474
- _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
475
- inCart = _useState70[0],
476
- setInCart = _useState70[1];
477
-
478
- var _useState71 = (0, _react.useState)({
463
+ var _useState65 = (0, _react.useState)({
479
464
  message: "¿Estás seguro de continuar?",
480
465
  detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
481
466
  button1: {
@@ -490,34 +475,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
490
475
  },
491
476
  img: _defaultProfileImage.default
492
477
  }),
493
- _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
494
- dataGenericModal = _useState72[0],
495
- setDataGenericModal = _useState72[1];
478
+ _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
479
+ dataGenericModal = _useState66[0],
480
+ setDataGenericModal = _useState66[1];
496
481
 
497
- var _useState73 = (0, _react.useState)(null),
498
- _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
499
- socketType = _useState74[0],
500
- setSocketType = _useState74[1];
482
+ var _useState67 = (0, _react.useState)(null),
483
+ _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
484
+ socketType = _useState68[0],
485
+ setSocketType = _useState68[1];
501
486
 
502
- var _useState75 = (0, _react.useState)(loading),
503
- _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
504
- saving = _useState76[0],
505
- setSaving = _useState76[1];
487
+ var _useState69 = (0, _react.useState)(loading),
488
+ _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
489
+ saving = _useState70[0],
490
+ setSaving = _useState70[1];
506
491
 
507
- var _useState77 = (0, _react.useState)(product.statusByRetailer),
508
- _useState78 = (0, _slicedToArray2.default)(_useState77, 2),
509
- retailerStatus = _useState78[0],
510
- setRetailerStatus = _useState78[1];
492
+ var _useState71 = (0, _react.useState)(product.statusByRetailer),
493
+ _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
494
+ retailerStatus = _useState72[0],
495
+ setRetailerStatus = _useState72[1];
511
496
 
512
497
  var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
513
498
  _useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
514
499
  showVersionSelector = _useCloseModal2[0],
515
500
  setShowVersionSelector = _useCloseModal2[1];
516
501
 
517
- var _useState79 = (0, _react.useState)(),
518
- _useState80 = (0, _slicedToArray2.default)(_useState79, 2),
519
- globalModal = _useState80[0],
520
- setGlobalModal = _useState80[1];
502
+ var _useState73 = (0, _react.useState)(),
503
+ _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
504
+ globalModal = _useState74[0],
505
+ setGlobalModal = _useState74[1];
521
506
 
522
507
  var updateAuditStatus = /*#__PURE__*/function () {
523
508
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
@@ -2184,14 +2169,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2184
2169
  isRetailer: isRetailer,
2185
2170
  showSaveButton: enableActions(product.version_status),
2186
2171
  version: version,
2187
- desc: desc,
2188
- setDesc: setDesc,
2189
- fich: fich,
2190
- setFich: setFich,
2191
- imag: imag,
2192
- setImag: setImag,
2193
2172
  updatedDescriptions: updatedDescriptions,
2194
2173
  updatedDatasheets: updatedDatasheets,
2174
+ images: images,
2195
2175
  selectedImages: selectedImages,
2196
2176
  setUpdatedDescriptions: setUpdatedDescriptions,
2197
2177
  setUpdatedDatasheets: setUpdatedDatasheets,
@@ -477,21 +477,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
477
477
  compare = _useState80[0],
478
478
  setCompare = _useState80[1];
479
479
 
480
- var _useState81 = (0, _react.useState)([]),
481
- _useState82 = (0, _slicedToArray2.default)(_useState81, 2),
482
- desc = _useState82[0],
483
- setDesc = _useState82[1];
484
-
485
- var _useState83 = (0, _react.useState)([]),
486
- _useState84 = (0, _slicedToArray2.default)(_useState83, 2),
487
- fich = _useState84[0],
488
- setFich = _useState84[1];
489
-
490
- var _useState85 = (0, _react.useState)([]),
491
- _useState86 = (0, _slicedToArray2.default)(_useState85, 2),
492
- imag = _useState86[0],
493
- setImag = _useState86[1];
494
-
495
480
  (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
496
481
  var _ref3, id_article;
497
482
 
@@ -2000,14 +1985,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
2000
1985
  isRetailer: isRetailer,
2001
1986
  showSaveButton: auditorAssigned() || userAssigned(),
2002
1987
  version: version,
2003
- desc: desc,
2004
- setDesc: setDesc,
2005
- fich: fich,
2006
- setFich: setFich,
2007
- imag: imag,
2008
- setImag: setImag,
2009
1988
  updatedDescriptions: updatedDescriptions,
2010
1989
  updatedDatasheets: updatedDatasheets,
1990
+ images: images,
2011
1991
  selectedImages: selectedImages,
2012
1992
  setUpdatedDescriptions: setUpdatedDescriptions,
2013
1993
  setUpdatedDatasheets: setUpdatedDatasheets,
@@ -17,12 +17,13 @@ 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(function (_ref) {
20
+ return Object.entries(obj).map( //([key, value]) => `${key}=${encodeURIComponent(JSON.stringify(value))}`
21
+ function (_ref) {
21
22
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
22
23
  key = _ref2[0],
23
24
  value = _ref2[1];
24
25
 
25
- return "".concat(key, "=").concat(encodeURIComponent(JSON.stringify(value)));
26
+ return "".concat(key, "=").concat(encodeURIComponent(value));
26
27
  }).join("&");
27
28
  };
28
29
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.3.83",
3
+ "version": "21.3.85",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -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,7 +43,6 @@ export const GeneralInput = ({
43
43
  ) {
44
44
  let generalValue;
45
45
  if (optionList?.length > 0) {
46
- let index = evt.target.selectedIndex;
47
46
  let valueSelected = evt.target.value;
48
47
  generalValue = valueSelected;
49
48
  setTextValue({ value: generalValue });
@@ -56,26 +55,26 @@ export const GeneralInput = ({
56
55
  }
57
56
  let dataSave = updatedDatasheets?.slice();
58
57
 
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
- });
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
+ }
72
70
  } else {
73
- dataSave.push({
74
- articleId: articleId,
75
- versionId: version,
76
- attributeId: inputId,
77
- value: generalValue,
78
- });
71
+ if (generalValue !== inputValue) {
72
+ dataSave.push({
73
+ articleId: articleId,
74
+ attributeId: inputId,
75
+ value: generalValue,
76
+ });
77
+ }
79
78
  }
80
79
  setUpdatedDatasheets(dataSave);
81
80
  } else {
@@ -1,6 +1,6 @@
1
1
  import ReactQuill from "react-quill";
2
2
  import "react-quill/dist/quill.snow.css";
3
- import { useEffect, useState } from "react";
3
+ import { useState } from "react";
4
4
  import { Container } from "./styles";
5
5
 
6
6
  export const InputFormatter = ({
@@ -9,8 +9,6 @@ export const InputFormatter = ({
9
9
  articleId,
10
10
  updatedDescriptions,
11
11
  setUpdatedDescriptions,
12
- addTextAreaToArray,
13
- name,
14
12
  isRequired,
15
13
  maxChar,
16
14
  }) => {
@@ -44,7 +42,7 @@ export const InputFormatter = ({
44
42
  .replace(/\&amp;/gm, "&");
45
43
  };
46
44
 
47
- const onChange = (valueInput, delta, user, h) => {
45
+ const onChange = (valueInput, h) => {
48
46
  let value = "";
49
47
  try {
50
48
  if (h.getLength() - 1 <= maxLength) {
@@ -72,12 +70,10 @@ export const InputFormatter = ({
72
70
  let idInput = inputId;
73
71
  let dataSave = updatedDescriptions?.slice();
74
72
  if (dataSave?.length > 0) {
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
- });
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);
81
77
  } else {
82
78
  dataSave.push({
83
79
  articleId: articleId,
@@ -86,11 +82,13 @@ export const InputFormatter = ({
86
82
  });
87
83
  }
88
84
  } else {
89
- dataSave.push({
90
- articleId: articleId,
91
- attributeId: idInput,
92
- value: value,
93
- });
85
+ if (value !== mainValue) {
86
+ dataSave.push({
87
+ articleId: articleId,
88
+ attributeId: idInput,
89
+ value: value,
90
+ });
91
+ }
94
92
  }
95
93
  setUpdatedDescriptions(dataSave);
96
94
  }
@@ -142,9 +140,7 @@ export const InputFormatter = ({
142
140
  e.preventDefault();
143
141
  }
144
142
  }}
145
- onChange={(valueInput, user, range, h) => {
146
- onChange(valueInput, user, range, h);
147
- }}
143
+ onChange={(valueInput, user, range, h) => onChange(valueInput, h)}
148
144
  onChangeSelection={getSelection}
149
145
  />
150
146
  <p className="description-limit">
@@ -10,6 +10,7 @@ export const Container = styled.div`
10
10
  width: 149px;
11
11
  padding-bottom: 5px;
12
12
  transition: 0.1s all;
13
+ cursor: pointer;
13
14
 
14
15
  &.active {
15
16
  font-size: 18px;
@@ -2,126 +2,103 @@ import { Container } from "./styles";
2
2
  import { TabSection } from "../../atoms/TabSection";
3
3
  import { useEffect, useState } from "react";
4
4
 
5
-
6
5
  import { Modal } from "../../organisms/Modal";
7
6
  import { ButtonV2 } from "../../atoms/ButtonV2";
8
7
 
9
-
10
8
  export const TabsMenu = ({
11
9
  tabsSections = {},
12
10
  setImagesSection,
13
11
  setActiveTab,
14
12
  activeTab,
15
- desc,
16
- setDesc,
17
- fich,
18
- setFich,
19
- imag,
20
- setImag,
21
13
  updatedDescriptions,
22
14
  updatedDatasheets,
23
- selectedImages,
24
- setUpdatedDescriptions,
25
- setUpdatedDatasheets,
26
- setSelectedImages
15
+ images,
27
16
  }) => {
28
17
  const [sections, setSections] = useState(tabsSections);
29
18
 
30
-
31
- const [modal, setModal] = useState(false)
32
- const [isFirstExecution, setIsFirstExecution] = useState(true)
33
- const [detectaTab, setDetectaTab] = useState('')
34
- const [cancelAccept, setCancelAccept] = useState('')
35
- const [llave, setLlave] = useState('')
36
- const [objeto, setObjeto] = useState()
37
-
19
+ const [modal, setModal] = useState(false);
20
+ const [cancelAccept, setCancelAccept] = useState("");
21
+ const [llave, setLlave] = useState("");
22
+ const [objeto, setObjeto] = useState();
38
23
 
39
24
  const activeSection = (key, array = {}) => {
40
25
  let tempArray = {};
41
26
  setImagesSection(key === "Imágenes");
42
27
  Object.keys(array).forEach((section) => {
43
28
  tempArray[section] = section === key;
44
- if (section === key) {
45
- setUpdatedDatasheets([])
46
- setUpdatedDescriptions([])
47
- setSelectedImages([])
48
- setDesc([])
49
- setFich([])
50
- setImag([])
51
- return setActiveTab(key)
52
- };
29
+ if (section === key) return setActiveTab(key);
53
30
  });
54
31
  setSections(tempArray);
55
32
  };
56
33
 
57
- useEffect(() => {
58
- if (cancelAccept==='Aceptar' & llave!==''){
59
- setCancelAccept('')
60
- setModal(false)
61
- activeSection(llave, objeto)
62
- } else if (cancelAccept==='Cancelar' & llave!=='') {
63
- setModal(false)
64
- setCancelAccept('')
65
- }
66
- },[cancelAccept])
34
+ useEffect(() => {
35
+ if ((cancelAccept === "Aceptar") & (llave !== "")) {
36
+ setCancelAccept("");
37
+ setModal(false);
38
+ activeSection(llave, objeto);
39
+ } else if ((cancelAccept === "Cancelar") & (llave !== "")) {
40
+ setModal(false);
41
+ setCancelAccept("");
42
+ }
43
+ }, [cancelAccept]);
67
44
 
68
- function detectClickFunction (e,key,sections) {
45
+ const detectClickFunction = (e, key, sections) => {
69
46
  const targetIsTheCurrentTab = e.target.innerHTML === activeTab;
70
47
  const descriptionsWereUpdated = updatedDescriptions.length > 0;
71
48
  const datasheetWereUpdated = updatedDatasheets.length > 0;
72
- const imagesWereUpdated = selectedImages.length > 0;
73
- const dataWereUpdated = descriptionsWereUpdated || datasheetWereUpdated || imagesWereUpdated;
74
-
75
- if (!targetIsTheCurrentTab && !dataWereUpdated ){
76
- setLlave(key)
77
- setObjeto(sections)
78
- activeSection(key, sections)
79
- }
80
- else if(!targetIsTheCurrentTab && dataWereUpdated ){
81
- setModal(true)
82
- setLlave(key)
83
- setObjeto(sections)
84
-
49
+ const imagesWereUpdated = images?.values?.filter((f) => !f.id)?.length > 0;
50
+ const dataWereUpdated =
51
+ descriptionsWereUpdated || datasheetWereUpdated || imagesWereUpdated;
85
52
 
53
+ if (!targetIsTheCurrentTab && !dataWereUpdated) {
54
+ setLlave(key);
55
+ setObjeto(sections);
56
+ activeSection(key, sections);
57
+ } else if (!targetIsTheCurrentTab && dataWereUpdated) {
58
+ setModal(true);
59
+ setLlave(key);
60
+ setObjeto(sections);
86
61
  }
87
- }
62
+ };
63
+
88
64
  return (
89
65
  <>
90
- {activeTab && <Modal
91
- show={modal}
92
- title='Cambios sin Guardar'
93
- message= 'Estás cambiando de vista y aun no guardas cambios ¿Estás seguro?'
94
- buttons={ [
95
- <ButtonV2
96
- key={"btn-Cancelar"}
97
- type={"white"}
98
- label={"Cancelar"}
99
- size={12}
100
- onClick={(event) => setCancelAccept(event.target.textContent)}
101
- />,
102
- <ButtonV2
103
- key={"btn-Aceptar"}
104
- type={"pink"}
105
- label={"Aceptar"}
106
- size={12}
107
- onClick={(event) => setCancelAccept(event.target.textContent)}
108
- />,
109
- ]}
110
- />
111
- }
112
-
113
- <Container>
114
- {Object.keys(sections).map((key, index) => (
115
- <TabSection
116
- key={index}
117
- label={key}
118
- active={sections[key]}
119
- onClick={(e)=>{
120
- detectClickFunction (e, key, sections)
121
- }}
66
+ {activeTab && (
67
+ <Modal
68
+ show={modal}
69
+ title="Cambios sin Guardar"
70
+ message="Estás cambiando de vista y aun no guardas cambios ¿Estás seguro?"
71
+ buttons={[
72
+ <ButtonV2
73
+ key={"btn-Cancelar"}
74
+ type={"white"}
75
+ label={"Cancelar"}
76
+ size={12}
77
+ onClick={(event) => setCancelAccept(event.target.textContent)}
78
+ />,
79
+ <ButtonV2
80
+ key={"btn-Aceptar"}
81
+ type={"pink"}
82
+ label={"Aceptar"}
83
+ size={12}
84
+ onClick={(event) => setCancelAccept(event.target.textContent)}
85
+ />,
86
+ ]}
122
87
  />
123
- ))}
124
- </Container>
88
+ )}
89
+
90
+ <Container>
91
+ {Object.keys(sections).map((key, index) => (
92
+ <TabSection
93
+ key={index}
94
+ label={key}
95
+ active={sections[key]}
96
+ onClick={(e) => {
97
+ detectClickFunction(e, key, sections);
98
+ }}
99
+ />
100
+ ))}
101
+ </Container>
125
102
  </>
126
103
  );
127
104
  };
@@ -1,8 +1,6 @@
1
1
  import { Container } from "./styles";
2
2
  import { ScreenHeader } from "../../atoms/ScreenHeader/index";
3
3
  import { GeneralInput } from "../../atoms/GeneralInput/index";
4
- import { useEffect } from "react";
5
- import { useState } from "react";
6
4
 
7
5
  export const TagAndInput = ({
8
6
  inputType,
@@ -32,7 +30,6 @@ export const TagAndInput = ({
32
30
  showTooltip,
33
31
  auditClass,
34
32
  }) => {
35
-
36
33
  return (
37
34
  <Container
38
35
  inputType={inputType}
@@ -45,7 +42,7 @@ export const TagAndInput = ({
45
42
  headerType={"input-name-header"}
46
43
  color={color}
47
44
  />
48
- {showTooltip && <span className="tooltip">{label}</span>}
45
+ {showTooltip && <span className="tooltip">{label}</span>} {inputId}
49
46
  </div>
50
47
  <GeneralInput
51
48
  inputId={inputId}
@@ -74,5 +71,4 @@ export const TagAndInput = ({
74
71
  />
75
72
  </Container>
76
73
  );
77
-
78
74
  };
@@ -241,9 +241,11 @@ export const ContentChat = (props) => {
241
241
  isUserTech: dataChat.currentUser?.isUserTech,
242
242
  };
243
243
  const paramsQuery = {
244
- id: JSON.stringify(dataChat.id),
244
+ //id: JSON.stringify(dataChat.id),
245
+ id: dataChat.id,
245
246
  getType: "initial",
246
- currentUser: encodeUriJson(dataUser),
247
+ //currentUser: encodeUriJson(dataUser),
248
+ currentUser: encodeURIComponent(JSON.stringify(dataUser)),
247
249
  currentItemsFront: encodeUriJson(getItemsIdSingleChat()),
248
250
  };
249
251
  const response = await fetchGET(
@@ -19,19 +19,13 @@ export const FullTabsMenu = ({
19
19
  canAssign,
20
20
  version,
21
21
  setShowVersionSelector,
22
-
23
- desc,
24
- setDesc,
25
- fich,
26
- setFich,
27
- imag,
28
- setImag,
22
+ images,
29
23
  updatedDescriptions,
30
24
  updatedDatasheets,
31
25
  selectedImages,
32
26
  setUpdatedDescriptions,
33
27
  setUpdatedDatasheets,
34
- setSelectedImages
28
+ setSelectedImages,
35
29
  }) => {
36
30
  const [imagesSection, setImagesSection] = useState(false);
37
31
 
@@ -42,13 +36,7 @@ export const FullTabsMenu = ({
42
36
  setImagesSection={setImagesSection}
43
37
  setActiveTab={setActiveTab}
44
38
  activeTab={activeTab}
45
-
46
- desc={ desc }
47
- setDesc={ setDesc }
48
- fich={fich}
49
- setFich={setFich}
50
- imag={imag}
51
- setImag={setImag}
39
+ images={images}
52
40
  updatedDescriptions={updatedDescriptions}
53
41
  updatedDatasheets={updatedDatasheets}
54
42
  selectedImages={selectedImages}
@@ -74,4 +62,4 @@ export const FullTabsMenu = ({
74
62
  />
75
63
  </Container>
76
64
  );
77
- };
65
+ };
@@ -221,11 +221,6 @@ export const ProviderProductEdition = ({
221
221
  Imágenes: null,
222
222
  });
223
223
 
224
- const [desc, setDesc] = useState([])
225
- const [fich, setFich] = useState([])
226
- const [imag, setImag] = useState([])
227
-
228
-
229
224
  const [inCart, setInCart] = useState(false);
230
225
  const [dataGenericModal, setDataGenericModal] = useState({
231
226
  message: "¿Estás seguro de continuar?",
@@ -1303,6 +1298,7 @@ export const ProviderProductEdition = ({
1303
1298
  }
1304
1299
  }
1305
1300
  };
1301
+
1306
1302
  return (
1307
1303
  <Container headerTop={headerTop}>
1308
1304
  <HeaderTop
@@ -1425,20 +1421,13 @@ export const ProviderProductEdition = ({
1425
1421
  isRetailer={isRetailer}
1426
1422
  showSaveButton={enableActions(product.version_status)}
1427
1423
  version={version}
1428
-
1429
- desc={ desc }
1430
- setDesc={ setDesc }
1431
- fich={fich}
1432
- setFich={setFich}
1433
- imag={imag}
1434
- setImag={setImag}
1435
1424
  updatedDescriptions={updatedDescriptions}
1436
1425
  updatedDatasheets={updatedDatasheets}
1426
+ images={images}
1437
1427
  selectedImages={selectedImages}
1438
1428
  setUpdatedDescriptions={setUpdatedDescriptions}
1439
1429
  setUpdatedDatasheets={setUpdatedDatasheets}
1440
1430
  setSelectedImages={setSelectedImages}
1441
-
1442
1431
  setShowVersionSelector={setShowVersionSelector}
1443
1432
  onClickSave={() => {
1444
1433
  switch (activeTab) {
@@ -219,10 +219,6 @@ export const RetailerProductEdition = ({
219
219
  const [auditImages, setAuditImages] = useState([]);
220
220
  const [compare, setCompare] = useState(false);
221
221
 
222
- const [desc, setDesc] = useState([])
223
- const [fich, setFich] = useState([])
224
- const [imag, setImag] = useState([])
225
-
226
222
  useEffect(async () => {
227
223
  const { id_article } = product?.article || {};
228
224
  if (id_article)
@@ -1383,20 +1379,13 @@ export const RetailerProductEdition = ({
1383
1379
  isRetailer={isRetailer}
1384
1380
  showSaveButton={auditorAssigned() || userAssigned()}
1385
1381
  version={version}
1386
-
1387
- desc={ desc }
1388
- setDesc={ setDesc }
1389
- fich={fich}
1390
- setFich={setFich}
1391
- imag={imag}
1392
- setImag={setImag}
1393
1382
  updatedDescriptions={updatedDescriptions}
1394
1383
  updatedDatasheets={updatedDatasheets}
1384
+ images={images}
1395
1385
  selectedImages={selectedImages}
1396
1386
  setUpdatedDescriptions={setUpdatedDescriptions}
1397
1387
  setUpdatedDatasheets={setUpdatedDatasheets}
1398
1388
  setSelectedImages={setSelectedImages}
1399
-
1400
1389
  setShowVersionSelector={setShowVersionSelector}
1401
1390
  onClickSave={() => {
1402
1391
  switch (activeTab) {
@@ -1475,7 +1464,7 @@ export const RetailerProductEdition = ({
1475
1464
  version={version}
1476
1465
  dinamicHeight={true}
1477
1466
  compare={compare}
1478
- />
1467
+ />
1479
1468
  ) : (
1480
1469
  <ScreenHeader
1481
1470
  text={"No cuentas con este servicio"}
@@ -4,7 +4,8 @@ const objToQueryString = (obj) => {
4
4
  if (!Object.values(obj).length) return null;
5
5
  return Object.entries(obj)
6
6
  .map(
7
- ([key, value]) => `${key}=${encodeURIComponent(JSON.stringify(value))}`
7
+ //([key, value]) => `${key}=${encodeURIComponent(JSON.stringify(value))}`
8
+ ([key, value]) => `${key}=${encodeURIComponent(value)}`
8
9
  )
9
10
  .join("&");
10
11
  };