contentoh-components-library 21.3.79 → 21.3.80

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,44 +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
- }; //! ==========================================Daniel===========================================
68
+ };
99
69
 
100
-
101
- {
102
- /*=============================================================================
103
- UseEffect para poder recolectar la info
104
- ==============================================================================*/
105
- }
106
70
  (0, _react.useEffect)(function () {
107
- if (cancelAccept === 'Aceptar' & llave !== '') {
108
- setCancelAccept('');
71
+ if (cancelAccept === "Aceptar" & llave !== "") {
72
+ setCancelAccept("");
109
73
  setModal(false);
110
74
  activeSection(llave, objeto);
111
- } else if (cancelAccept === 'Cancelar' & llave !== '') {
75
+ } else if (cancelAccept === "Cancelar" & llave !== "") {
112
76
  setModal(false);
113
- setCancelAccept('');
77
+ setCancelAccept("");
114
78
  }
115
79
  }, [cancelAccept]);
116
80
 
117
- function detectClickFunction(e, key, sections) {
81
+ var detectClickFunction = function detectClickFunction(e, key, sections) {
82
+ var _images$values, _images$values$filter;
83
+
118
84
  var targetIsTheCurrentTab = e.target.innerHTML === activeTab;
119
85
  var descriptionsWereUpdated = updatedDescriptions.length > 0;
120
86
  var datasheetWereUpdated = updatedDatasheets.length > 0;
121
- 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;
122
90
  var dataWereUpdated = descriptionsWereUpdated || datasheetWereUpdated || imagesWereUpdated;
123
91
 
124
92
  if (!targetIsTheCurrentTab && !dataWereUpdated) {
@@ -130,8 +98,7 @@ var TabsMenu = function TabsMenu(_ref) {
130
98
  setLlave(key);
131
99
  setObjeto(sections);
132
100
  }
133
- } //! ==========================================Daniel===========================================
134
-
101
+ };
135
102
 
136
103
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
137
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) {
@@ -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,
@@ -17,8 +17,6 @@ var _ScreenHeader = require("../../atoms/ScreenHeader");
17
17
 
18
18
  var _LabelToInput = _interopRequireDefault(require("../../atoms/LabelToInput"));
19
19
 
20
- var _react = require("react");
21
-
22
20
  var _jsxRuntime = require("react/jsx-runtime");
23
21
 
24
22
  var ImageDataTable = function ImageDataTable(_ref) {
@@ -464,35 +464,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
464
464
  }),
465
465
  _useState64 = (0, _slicedToArray2.default)(_useState63, 2),
466
466
  origin = _useState64[0],
467
- setOrigin = _useState64[1]; //! ==========================================Daniel===========================================
467
+ setOrigin = _useState64[1];
468
468
 
469
- /* ====================================== Cambios =================================*/
470
-
471
-
472
- var _useState65 = (0, _react.useState)([]),
469
+ var _useState65 = (0, _react.useState)(false),
473
470
  _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
474
- desc = _useState66[0],
475
- setDesc = _useState66[1];
476
-
477
- var _useState67 = (0, _react.useState)([]),
478
- _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
479
- fich = _useState68[0],
480
- setFich = _useState68[1];
481
-
482
- var _useState69 = (0, _react.useState)([]),
483
- _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
484
- imag = _useState70[0],
485
- setImag = _useState70[1];
486
- /* ------------------------------------- Cambios ----------------------------------*/
487
- //! ==========================================Daniel===========================================
488
-
489
-
490
- var _useState71 = (0, _react.useState)(false),
491
- _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
492
- inCart = _useState72[0],
493
- setInCart = _useState72[1];
471
+ inCart = _useState66[0],
472
+ setInCart = _useState66[1];
494
473
 
495
- var _useState73 = (0, _react.useState)({
474
+ var _useState67 = (0, _react.useState)({
496
475
  message: "¿Estás seguro de continuar?",
497
476
  detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
498
477
  button1: {
@@ -507,34 +486,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
507
486
  },
508
487
  img: _defaultProfileImage.default
509
488
  }),
510
- _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
511
- dataGenericModal = _useState74[0],
512
- setDataGenericModal = _useState74[1];
489
+ _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
490
+ dataGenericModal = _useState68[0],
491
+ setDataGenericModal = _useState68[1];
513
492
 
514
- var _useState75 = (0, _react.useState)(null),
515
- _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
516
- socketType = _useState76[0],
517
- setSocketType = _useState76[1];
493
+ var _useState69 = (0, _react.useState)(null),
494
+ _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
495
+ socketType = _useState70[0],
496
+ setSocketType = _useState70[1];
518
497
 
519
- var _useState77 = (0, _react.useState)(loading),
520
- _useState78 = (0, _slicedToArray2.default)(_useState77, 2),
521
- saving = _useState78[0],
522
- setSaving = _useState78[1];
498
+ var _useState71 = (0, _react.useState)(loading),
499
+ _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
500
+ saving = _useState72[0],
501
+ setSaving = _useState72[1];
523
502
 
524
- var _useState79 = (0, _react.useState)(product.statusByRetailer),
525
- _useState80 = (0, _slicedToArray2.default)(_useState79, 2),
526
- retailerStatus = _useState80[0],
527
- setRetailerStatus = _useState80[1];
503
+ var _useState73 = (0, _react.useState)(product.statusByRetailer),
504
+ _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
505
+ retailerStatus = _useState74[0],
506
+ setRetailerStatus = _useState74[1];
528
507
 
529
508
  var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
530
509
  _useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
531
510
  showVersionSelector = _useCloseModal2[0],
532
511
  setShowVersionSelector = _useCloseModal2[1];
533
512
 
534
- var _useState81 = (0, _react.useState)(),
535
- _useState82 = (0, _slicedToArray2.default)(_useState81, 2),
536
- globalModal = _useState82[0],
537
- setGlobalModal = _useState82[1];
513
+ var _useState75 = (0, _react.useState)(),
514
+ _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
515
+ globalModal = _useState76[0],
516
+ setGlobalModal = _useState76[1];
538
517
 
539
518
  var updateAuditStatus = /*#__PURE__*/function () {
540
519
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
@@ -2019,6 +1998,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2019
1998
  }];
2020
1999
 
2021
2000
  var sendToEvaluation = function sendToEvaluation(result) {
2001
+ console.log({
2002
+ result: result
2003
+ });
2004
+
2022
2005
  if (result === "A") {
2023
2006
  if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
2024
2007
  setDataGenericModal(function (prev) {
@@ -2052,7 +2035,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2052
2035
  sendEvaluation("A");
2053
2036
  }
2054
2037
  } else {
2055
- if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
2038
+ if (origin === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
2056
2039
  return;
2057
2040
  } else if (user.is_retailer) {
2058
2041
  if (product.id_order || product.orderId) {
@@ -2122,7 +2105,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2122
2105
  servicesData: servicesData ? servicesData : null,
2123
2106
  showApproveRejectAll: isRevision() && getSectionStatus(),
2124
2107
  approveAll: function approveAll() {
2125
- if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
2108
+ if (origin === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
2126
2109
  setDataGenericModal(function (prev) {
2127
2110
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
2128
2111
  button2: {
@@ -2155,7 +2138,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2155
2138
  }
2156
2139
  },
2157
2140
  rejectAll: function rejectAll() {
2158
- if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
2141
+ if (origin === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
2159
2142
  return;
2160
2143
  } else if (user.is_retailer) {
2161
2144
  if (product.id_order || product.orderId) {
@@ -2198,14 +2181,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2198
2181
  isRetailer: isRetailer,
2199
2182
  showSaveButton: enableActions(product.version_status),
2200
2183
  version: version,
2201
- desc: desc,
2202
- setDesc: setDesc,
2203
- fich: fich,
2204
- setFich: setFich,
2205
- imag: imag,
2206
- setImag: setImag,
2207
2184
  updatedDescriptions: updatedDescriptions,
2208
2185
  updatedDatasheets: updatedDatasheets,
2186
+ images: images,
2209
2187
  selectedImages: selectedImages,
2210
2188
  setUpdatedDescriptions: setUpdatedDescriptions,
2211
2189
  setUpdatedDatasheets: setUpdatedDatasheets,