contentoh-components-library 21.5.23 → 21.5.26

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.
@@ -189,31 +189,31 @@ var InputGroup = function InputGroup(_ref) {
189
189
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
190
190
  className: "inputs-container",
191
191
  children: inputGroup === null || inputGroup === void 0 ? void 0 : (_inputGroup$inputs = inputGroup.inputs) === null || _inputGroup$inputs === void 0 ? void 0 : _inputGroup$inputs.map(function (input, index) {
192
- var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6, _dataInputs$input7, _auditInputs$input, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10, _dataInputs$input11, _dataInputs$input12, _dataInputs$input13, _dataInputs$input14, _dataInputs$input15, _dataInputs$input16, _dataInputs$input17, _auditInputGroup$inpu, _auditInputGroup$inpu2;
192
+ var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6, _dataInputs$input7, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10, _auditInputs$input, _dataInputs$input11, _dataInputs$input12, _dataInputs$input13, _dataInputs$input14, _dataInputs$input15, _dataInputs$input16, _dataInputs$input17, _dataInputs$input18, _dataInputs$input19, _dataInputs$input20, _auditInputGroup$inpu, _auditInputGroup$inpu2;
193
193
 
194
194
  return activeSection === "Ficha técnica" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
195
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
195
+ children: [(((_dataInputs$input = dataInputs[input]) === null || _dataInputs$input === void 0 ? void 0 : _dataInputs$input.id) != 6700 && ((_dataInputs$input2 = dataInputs[input]) === null || _dataInputs$input2 === void 0 ? void 0 : _dataInputs$input2.id) != 6701 || ((_dataInputs$input3 = dataInputs[input]) === null || _dataInputs$input3 === void 0 ? void 0 : _dataInputs$input3.isApproved) != undefined) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
196
196
  //disabled={input === 40001}
197
- disabled: (_dataInputs$input3 = dataInputs[input]) === null || _dataInputs$input3 === void 0 ? void 0 : _dataInputs$input3.isApproved,
198
- inputId: (_dataInputs$input4 = dataInputs[input]) === null || _dataInputs$input4 === void 0 ? void 0 : _dataInputs$input4.id,
197
+ disabled: (_dataInputs$input6 = dataInputs[input]) === null || _dataInputs$input6 === void 0 ? void 0 : _dataInputs$input6.isApproved,
198
+ inputId: (_dataInputs$input7 = dataInputs[input]) === null || _dataInputs$input7 === void 0 ? void 0 : _dataInputs$input7.id,
199
199
  version: version,
200
- inputType: inputTypeValue((_dataInputs$input5 = dataInputs[input]) === null || _dataInputs$input5 === void 0 ? void 0 : _dataInputs$input5.type),
201
- label: ((_dataInputs$input6 = dataInputs[input]) === null || _dataInputs$input6 === void 0 ? void 0 : _dataInputs$input6.name) + ((_dataInputs$input7 = dataInputs[input]) !== null && _dataInputs$input7 !== void 0 && _dataInputs$input7.required ? "*" : ""),
202
- value: compare ? (_auditInputs$input = auditInputs[input]) === null || _auditInputs$input === void 0 ? void 0 : _auditInputs$input.value : (_dataInputs$input8 = dataInputs[input]) === null || _dataInputs$input8 === void 0 ? void 0 : _dataInputs$input8.value,
200
+ inputType: inputTypeValue((_dataInputs$input8 = dataInputs[input]) === null || _dataInputs$input8 === void 0 ? void 0 : _dataInputs$input8.type),
201
+ label: ((_dataInputs$input9 = dataInputs[input]) === null || _dataInputs$input9 === void 0 ? void 0 : _dataInputs$input9.name) + ((_dataInputs$input10 = dataInputs[input]) !== null && _dataInputs$input10 !== void 0 && _dataInputs$input10.required ? "*" : ""),
202
+ value: compare ? (_auditInputs$input = auditInputs[input]) === null || _auditInputs$input === void 0 ? void 0 : _auditInputs$input.value : (_dataInputs$input11 = dataInputs[input]) === null || _dataInputs$input11 === void 0 ? void 0 : _dataInputs$input11.value,
203
203
  inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
204
204
  articleId: articleId,
205
- isRequired: (_dataInputs$input9 = dataInputs[input]) === null || _dataInputs$input9 === void 0 ? void 0 : _dataInputs$input9.required,
205
+ isRequired: (_dataInputs$input12 = dataInputs[input]) === null || _dataInputs$input12 === void 0 ? void 0 : _dataInputs$input12.required,
206
206
  updatedDatasheets: updatedDatasheets,
207
207
  setUpdatedDatasheets: setUpdatedDatasheets,
208
- maxChar: (_dataInputs$input10 = dataInputs[input]) !== null && _dataInputs$input10 !== void 0 && _dataInputs$input10.max_chars ? (_dataInputs$input11 = dataInputs[input]) === null || _dataInputs$input11 === void 0 ? void 0 : _dataInputs$input11.max_chars : 999,
209
- optionList: (_dataInputs$input12 = dataInputs[input]) === null || _dataInputs$input12 === void 0 ? void 0 : _dataInputs$input12.option_list,
210
- description: (_dataInputs$input13 = dataInputs[input]) === null || _dataInputs$input13 === void 0 ? void 0 : _dataInputs$input13.description,
208
+ maxChar: (_dataInputs$input13 = dataInputs[input]) !== null && _dataInputs$input13 !== void 0 && _dataInputs$input13.max_chars ? (_dataInputs$input14 = dataInputs[input]) === null || _dataInputs$input14 === void 0 ? void 0 : _dataInputs$input14.max_chars : 999,
209
+ optionList: (_dataInputs$input15 = dataInputs[input]) === null || _dataInputs$input15 === void 0 ? void 0 : _dataInputs$input15.option_list,
210
+ description: (_dataInputs$input16 = dataInputs[input]) === null || _dataInputs$input16 === void 0 ? void 0 : _dataInputs$input16.description,
211
211
  showTooltip: true,
212
212
  auditClass: compare && !isEquals(dataInputs[input].value, auditInputs[input].value) ? "audit-class" : ""
213
- }, index + "-" + ((_dataInputs$input = dataInputs[input]) === null || _dataInputs$input === void 0 ? void 0 : _dataInputs$input.value) + "-" + ((_dataInputs$input2 = dataInputs[input]) === null || _dataInputs$input2 === void 0 ? void 0 : _dataInputs$input2.id) + "-" + compare), ((_dataInputs$input14 = dataInputs[input]) === null || _dataInputs$input14 === void 0 ? void 0 : _dataInputs$input14.isApproved) === false && /*#__PURE__*/(0, _jsxRuntime.jsx)(InputReviewSection, {
214
- inputId: (_dataInputs$input15 = dataInputs[input]) === null || _dataInputs$input15 === void 0 ? void 0 : _dataInputs$input15.id,
215
- isApproved: (_dataInputs$input16 = dataInputs[input]) === null || _dataInputs$input16 === void 0 ? void 0 : _dataInputs$input16.isApproved,
216
- comment: (_dataInputs$input17 = dataInputs[input]) === null || _dataInputs$input17 === void 0 ? void 0 : _dataInputs$input17.comment,
213
+ }, index + "-" + ((_dataInputs$input4 = dataInputs[input]) === null || _dataInputs$input4 === void 0 ? void 0 : _dataInputs$input4.value) + "-" + ((_dataInputs$input5 = dataInputs[input]) === null || _dataInputs$input5 === void 0 ? void 0 : _dataInputs$input5.id) + "-" + compare), ((_dataInputs$input17 = dataInputs[input]) === null || _dataInputs$input17 === void 0 ? void 0 : _dataInputs$input17.isApproved) === false && /*#__PURE__*/(0, _jsxRuntime.jsx)(InputReviewSection, {
214
+ inputId: (_dataInputs$input18 = dataInputs[input]) === null || _dataInputs$input18 === void 0 ? void 0 : _dataInputs$input18.id,
215
+ isApproved: (_dataInputs$input19 = dataInputs[input]) === null || _dataInputs$input19 === void 0 ? void 0 : _dataInputs$input19.isApproved,
216
+ comment: (_dataInputs$input20 = dataInputs[input]) === null || _dataInputs$input20 === void 0 ? void 0 : _dataInputs$input20.comment,
217
217
  handleImgClick: handleImgClick,
218
218
  changeImageBtn: changeImageBtn,
219
219
  showDivState: showDivStates,
@@ -235,7 +235,7 @@ var InputGroup = function InputGroup(_ref) {
235
235
  label: (input === null || input === void 0 ? void 0 : input.name) + (input.required ? "*" : ""),
236
236
  value: compare ? auditInputGroup === null || auditInputGroup === void 0 ? void 0 : (_auditInputGroup$inpu = auditInputGroup.inputs[index]) === null || _auditInputGroup$inpu === void 0 ? void 0 : _auditInputGroup$inpu.value : input === null || input === void 0 ? void 0 : input.value,
237
237
  isRequired: input.required,
238
- disabled: input === null || input === void 0 ? void 0 : input.isApproved,
238
+ disabled: input.id === 44186 || input.id === 44187 ? false : input === null || input === void 0 ? void 0 : input.isApproved,
239
239
  maxChar: input.max_chars,
240
240
  inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
241
241
  updatedDescriptions: updatedDescriptions,
@@ -258,34 +258,34 @@ var InputGroup = function InputGroup(_ref) {
258
258
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
259
259
  className: "inputs-container",
260
260
  children: inputGroup === null || inputGroup === void 0 ? void 0 : (_inputGroup$inputs2 = inputGroup.inputs) === null || _inputGroup$inputs2 === void 0 ? void 0 : _inputGroup$inputs2.map(function (input, index) {
261
- var _dataInputs$input18, _dataInputs$input19, _dataInputs$input20, _dataInputs$input21, _dataInputs$input22, _dataInputs$input23, _dataInputs$input24, _auditInputs$input2, _dataInputs$input25, _dataInputs$input26, _dataInputs$input27, _dataInputs$input28, _dataInputs$input29, _dataInputs$input30, _dataInputs$input31, _dataInputs$input32, _dataInputs$input33, _dataInputs$input34, _auditInputGroup$inpu3, _auditInputGroup$inpu4;
261
+ var _dataInputs$input21, _dataInputs$input22, _dataInputs$input23, _dataInputs$input24, _dataInputs$input25, _dataInputs$input26, _dataInputs$input27, _auditInputs$input2, _dataInputs$input28, _dataInputs$input29, _dataInputs$input30, _dataInputs$input31, _dataInputs$input32, _dataInputs$input33, _dataInputs$input34, _dataInputs$input35, _dataInputs$input36, _dataInputs$input37, _auditInputGroup$inpu3, _auditInputGroup$inpu4;
262
262
 
263
263
  return activeSection === "Ficha técnica" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
264
264
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
265
265
  //disabled={input === 40001}
266
- disabled: (_dataInputs$input20 = dataInputs[input]) === null || _dataInputs$input20 === void 0 ? void 0 : _dataInputs$input20.isApproved,
267
- inputId: (_dataInputs$input21 = dataInputs[input]) === null || _dataInputs$input21 === void 0 ? void 0 : _dataInputs$input21.id,
266
+ disabled: (_dataInputs$input23 = dataInputs[input]) === null || _dataInputs$input23 === void 0 ? void 0 : _dataInputs$input23.isApproved,
267
+ inputId: (_dataInputs$input24 = dataInputs[input]) === null || _dataInputs$input24 === void 0 ? void 0 : _dataInputs$input24.id,
268
268
  version: version,
269
- inputType: inputTypeValue((_dataInputs$input22 = dataInputs[input]) === null || _dataInputs$input22 === void 0 ? void 0 : _dataInputs$input22.type),
270
- label: ((_dataInputs$input23 = dataInputs[input]) === null || _dataInputs$input23 === void 0 ? void 0 : _dataInputs$input23.name) + ((_dataInputs$input24 = dataInputs[input]) !== null && _dataInputs$input24 !== void 0 && _dataInputs$input24.required ? "*" : ""),
271
- value: compare ? (_auditInputs$input2 = auditInputs[input]) === null || _auditInputs$input2 === void 0 ? void 0 : _auditInputs$input2.value : (_dataInputs$input25 = dataInputs[input]) === null || _dataInputs$input25 === void 0 ? void 0 : _dataInputs$input25.value,
269
+ inputType: inputTypeValue((_dataInputs$input25 = dataInputs[input]) === null || _dataInputs$input25 === void 0 ? void 0 : _dataInputs$input25.type),
270
+ label: ((_dataInputs$input26 = dataInputs[input]) === null || _dataInputs$input26 === void 0 ? void 0 : _dataInputs$input26.name) + ((_dataInputs$input27 = dataInputs[input]) !== null && _dataInputs$input27 !== void 0 && _dataInputs$input27.required ? "*" : ""),
271
+ value: compare ? (_auditInputs$input2 = auditInputs[input]) === null || _auditInputs$input2 === void 0 ? void 0 : _auditInputs$input2.value : (_dataInputs$input28 = dataInputs[input]) === null || _dataInputs$input28 === void 0 ? void 0 : _dataInputs$input28.value,
272
272
  inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
273
273
  articleId: articleId,
274
- isRequired: (_dataInputs$input26 = dataInputs[input]) === null || _dataInputs$input26 === void 0 ? void 0 : _dataInputs$input26.required,
274
+ isRequired: (_dataInputs$input29 = dataInputs[input]) === null || _dataInputs$input29 === void 0 ? void 0 : _dataInputs$input29.required,
275
275
  updatedDatasheets: updatedDatasheets,
276
276
  setUpdatedDatasheets: setUpdatedDatasheets,
277
- maxChar: (_dataInputs$input27 = dataInputs[input]) !== null && _dataInputs$input27 !== void 0 && _dataInputs$input27.max_chars ? (_dataInputs$input28 = dataInputs[input]) === null || _dataInputs$input28 === void 0 ? void 0 : _dataInputs$input28.max_chars : 999,
278
- optionList: (_dataInputs$input29 = dataInputs[input]) === null || _dataInputs$input29 === void 0 ? void 0 : _dataInputs$input29.option_list,
279
- description: (_dataInputs$input30 = dataInputs[input]) === null || _dataInputs$input30 === void 0 ? void 0 : _dataInputs$input30.description,
277
+ maxChar: (_dataInputs$input30 = dataInputs[input]) !== null && _dataInputs$input30 !== void 0 && _dataInputs$input30.max_chars ? (_dataInputs$input31 = dataInputs[input]) === null || _dataInputs$input31 === void 0 ? void 0 : _dataInputs$input31.max_chars : 999,
278
+ optionList: (_dataInputs$input32 = dataInputs[input]) === null || _dataInputs$input32 === void 0 ? void 0 : _dataInputs$input32.option_list,
279
+ description: (_dataInputs$input33 = dataInputs[input]) === null || _dataInputs$input33 === void 0 ? void 0 : _dataInputs$input33.description,
280
280
  showTooltip: true,
281
281
  inputGroup: inputGroup,
282
282
  dataInputs: dataInputs,
283
283
  onChange: setUpdatedBoxData,
284
284
  auditClass: compare && !isEquals(dataInputs[input].value, auditInputs[input].value) ? "audit-class" : ""
285
- }, index + "-" + ((_dataInputs$input18 = dataInputs[input]) === null || _dataInputs$input18 === void 0 ? void 0 : _dataInputs$input18.value) + "-" + ((_dataInputs$input19 = dataInputs[input]) === null || _dataInputs$input19 === void 0 ? void 0 : _dataInputs$input19.id) + "-" + compare), ((_dataInputs$input31 = dataInputs[input]) === null || _dataInputs$input31 === void 0 ? void 0 : _dataInputs$input31.isApproved) === false && /*#__PURE__*/(0, _jsxRuntime.jsx)(InputReviewSection, {
286
- inputId: (_dataInputs$input32 = dataInputs[input]) === null || _dataInputs$input32 === void 0 ? void 0 : _dataInputs$input32.id,
287
- isApproved: (_dataInputs$input33 = dataInputs[input]) === null || _dataInputs$input33 === void 0 ? void 0 : _dataInputs$input33.isApproved,
288
- comment: (_dataInputs$input34 = dataInputs[input]) === null || _dataInputs$input34 === void 0 ? void 0 : _dataInputs$input34.comment,
285
+ }, index + "-" + ((_dataInputs$input21 = dataInputs[input]) === null || _dataInputs$input21 === void 0 ? void 0 : _dataInputs$input21.value) + "-" + ((_dataInputs$input22 = dataInputs[input]) === null || _dataInputs$input22 === void 0 ? void 0 : _dataInputs$input22.id) + "-" + compare), ((_dataInputs$input34 = dataInputs[input]) === null || _dataInputs$input34 === void 0 ? void 0 : _dataInputs$input34.isApproved) === false && /*#__PURE__*/(0, _jsxRuntime.jsx)(InputReviewSection, {
286
+ inputId: (_dataInputs$input35 = dataInputs[input]) === null || _dataInputs$input35 === void 0 ? void 0 : _dataInputs$input35.id,
287
+ isApproved: (_dataInputs$input36 = dataInputs[input]) === null || _dataInputs$input36 === void 0 ? void 0 : _dataInputs$input36.isApproved,
288
+ comment: (_dataInputs$input37 = dataInputs[input]) === null || _dataInputs$input37 === void 0 ? void 0 : _dataInputs$input37.comment,
289
289
  handleImgClick: handleImgClick,
290
290
  changeImageBtn: changeImageBtn,
291
291
  showDivState: showDivStates,
@@ -5,8 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = saveData;
9
8
  exports.deleteImage = deleteImage;
9
+ exports.saveData = saveData;
10
10
 
11
11
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
12
12
 
@@ -43,15 +43,15 @@ function saveData(_x) {
43
43
 
44
44
  function _saveData() {
45
45
  _saveData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
46
- var section, data, token, callbackToInitData, setModal;
46
+ var section, data, token;
47
47
  return _regenerator.default.wrap(function _callee$(_context) {
48
48
  while (1) {
49
49
  switch (_context.prev = _context.next) {
50
50
  case 0:
51
- section = params.section, data = params.data, token = params.token, callbackToInitData = params.callbackToInitData, setModal = params.setModal;
51
+ section = params.section, data = params.data, token = params.token;
52
52
 
53
53
  if (!(section === "images")) {
54
- _context.next = 7;
54
+ _context.next = 5;
55
55
  break;
56
56
  }
57
57
 
@@ -60,25 +60,14 @@ function _saveData() {
60
60
 
61
61
  case 4:
62
62
  if (!_context.sent) {
63
- _context.next = 7;
63
+ _context.next = 5;
64
64
  break;
65
65
  }
66
66
 
67
- callbackToInitData();
68
- setModal({
69
- type: "saved successfully",
70
- functions: {
71
- setModal: setModal
72
- },
73
- payload: {
74
- service: "imágenes"
75
- }
76
- }); // aquí va modal de que todo salío bien y actualiza la data
77
-
78
- case 7:
79
- return _context.abrupt("return", false);
67
+ case 5:
68
+ return _context.abrupt("return", true);
80
69
 
81
- case 8:
70
+ case 6:
82
71
  case "end":
83
72
  return _context.stop();
84
73
  }
@@ -103,6 +92,7 @@ function _saveImagesData() {
103
92
  articles.data.forEach(function (article) {
104
93
  var images = article.images,
105
94
  version = article.version;
95
+ console.log(images);
106
96
  var imagesToAdd = Object.values(images).filter(function (f) {
107
97
  return f.value && !f.value.src.startsWith("id-");
108
98
  });
@@ -154,7 +154,8 @@ function dataReducer(state, action) {
154
154
 
155
155
  var _action$payload = action.payload,
156
156
  articleId = _action$payload.articleId,
157
- imageId = _action$payload.imageId;
157
+ imageId = _action$payload.imageId,
158
+ token = _action$payload.token;
158
159
  var newImageData = state.images.data.slice();
159
160
  var articleIndex = newImageData.findIndex(function (f) {
160
161
  return f.id === articleId;
@@ -163,6 +164,14 @@ function dataReducer(state, action) {
163
164
  newImageData[articleIndex].images[imageId].value = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, action.payload), {}, {
164
165
  id: id
165
166
  });
167
+ var data = newImageData;
168
+ (0, _saveData.saveData)({
169
+ section: "images",
170
+ data: {
171
+ data: data
172
+ },
173
+ token: token
174
+ });
166
175
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state), {}, {
167
176
  images: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state.images), {}, {
168
177
  data: newImageData
@@ -176,7 +185,7 @@ function dataReducer(state, action) {
176
185
  var _action$payload2 = action.payload,
177
186
  _articleId = _action$payload2.articleId,
178
187
  _imageId = _action$payload2.imageId,
179
- token = _action$payload2.token;
188
+ _token = _action$payload2.token;
180
189
 
181
190
  var _newImageData = state.images.data.slice();
182
191
 
@@ -187,14 +196,13 @@ function dataReducer(state, action) {
187
196
  var _id = (_newImageData$_articl = _newImageData[_articleIndex]) === null || _newImageData$_articl === void 0 ? void 0 : (_newImageData$_articl2 = _newImageData$_articl.images[_imageId]) === null || _newImageData$_articl2 === void 0 ? void 0 : (_newImageData$_articl3 = _newImageData$_articl2.value) === null || _newImageData$_articl3 === void 0 ? void 0 : _newImageData$_articl3.id;
188
197
 
189
198
  (_newImageData$_articl4 = _newImageData[_articleIndex]) === null || _newImageData$_articl4 === void 0 ? true : (_newImageData$_articl5 = _newImageData$_articl4.images[_imageId]) === null || _newImageData$_articl5 === void 0 ? true : delete _newImageData$_articl5.value;
190
- console.log(_newImageData[_articleIndex]);
191
- var data = {
199
+ var _data = {
192
200
  articleId: _articleId,
193
201
  deleteImages: [{
194
202
  id: _id
195
203
  }]
196
204
  };
197
- (0, _saveData.deleteImage)(data, _newImageData[_articleIndex].version, token);
205
+ (0, _saveData.deleteImage)(_data, _newImageData[_articleIndex].version, _token);
198
206
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state), {}, {
199
207
  images: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state.images), {}, {
200
208
  data: _newImageData
@@ -334,17 +342,15 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
334
342
  });
335
343
  }
336
344
  });
337
- var saveAvailable = imagesReviewed.filter(function (e) {
338
- return e.articleId === item.id;
339
- }).every(function (e) {
340
- return e.isReviewed === true;
341
- });
342
-
343
- if (imagesReviewed.filter(function (e) {
344
- return e.articleId === item.id;
345
- }).length == 0) {
346
- saveAvailable = false;
347
- }
345
+ var saveAvailable = true;
346
+ /**var saveAvailable = imagesReviewed
347
+ .filter((e) => e.articleId === item.id)
348
+ .every((e) => e.isReviewed === true);
349
+ if (
350
+ imagesReviewed.filter((e) => e.articleId === item.id).length == 0
351
+ ) {
352
+ saveAvailable = false;
353
+ }**/
348
354
 
349
355
  currentData["retailer".concat(ret.id, "-save")] = /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
350
356
  onClick: function onClick() {
@@ -494,13 +500,19 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
494
500
  var articleAttributes = attributesReviewed.filter(function (e) {
495
501
  return e.articleId === item.id && e.versionId === item.version;
496
502
  });
503
+ var value;
497
504
  articleAttributes.forEach(function (articleAttribute) {
498
- var value = document.getElementById(articleAttribute.articleId + "_" + articleAttribute.attributeId + "_" + articleAttribute.versionId).value;
505
+ if (articleAttribute.attributeId == 6700 || articleAttribute.attributeId == 6701) {
506
+ value = document.getElementById(articleAttribute.articleId + "_" + articleAttribute.attributeId + "_" + articleAttribute.versionId).checked;
507
+ } else {
508
+ value = document.getElementById(articleAttribute.articleId + "_" + articleAttribute.attributeId + "_" + articleAttribute.versionId).value;
509
+ }
510
+
499
511
  articlesAtributesUpdateBody.push({
500
512
  articleId: articleAttribute.articleId,
501
513
  versionId: articleAttribute.versionId,
502
514
  attributeId: articleAttribute.attributeId,
503
- value: value ? value : "",
515
+ value: value != undefined ? value : "",
504
516
  isApproved: articleAttribute.isApproved,
505
517
  comment: articleAttribute.comment
506
518
  });
@@ -716,17 +728,15 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
716
728
  });
717
729
  }
718
730
 
719
- var saveAvailable = descriptionsReviewed.filter(function (e) {
720
- return e.articleId === item.id;
721
- }).every(function (e) {
722
- return e.isReviewed === true;
723
- });
724
-
725
- if (descriptionsReviewed.filter(function (e) {
726
- return e.articleId === item.id;
727
- }).length == 0) {
728
- saveAvailable = false;
729
- }
731
+ var saveAvailable = true;
732
+ /**var saveAvailable = descriptionsReviewed
733
+ .filter((e) => e.articleId === item.id)
734
+ .every((e) => e.isReviewed === true);
735
+ if (
736
+ descriptionsReviewed.filter((e) => e.articleId === item.id).length == 0
737
+ ) {
738
+ saveAvailable = false;
739
+ }**/
730
740
 
731
741
  currentData["retailer".concat(ret.id)] = /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
732
742
  children: [" ", ret.name, " "]
@@ -31,7 +31,7 @@ ProviderProductEditionDefault.args = {
31
31
  "Ficha técnica": true,
32
32
  Imágenes: true
33
33
  },
34
- token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI2MjM3OWU5OS01Mjk2LTRhZGQtODkyNy01YzU2ZmFjZDlkYmMiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjYyMzc5ZTk5LTUyOTYtNGFkZC04OTI3LTVjNTZmYWNkOWRiYyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI4ZmRkOWJlYS1jYTE0LTQ4MmQtYmUwNi1iMjA4YjdjMTM1MWYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcxODgyMDI2MCwibmFtZSI6IlByb3ZlZWRvciBQcnVlYmEiLCJwaG9uZV9udW1iZXIiOiIrNTI1NTM5MDA2NTcwIiwiZXhwIjoxNzE4ODIzODYwLCJpYXQiOjE3MTg4MjAyNjAsImVtYWlsIjoibGltYW43NDAyNkBtbnFsbS5jb20ifQ.j4PhSKzZ0yb_5QyXYh_vviA-zbMhJc_wE3yqFErlrPsCZsqY43hx-fvEwwOJnzqwNlPFms6kZbddaGPVu0jnGw8TmiaKtoDVOmui_db8DuWGDHLPQhPZNeoM_g5qKY8H7ZIClGSOohj_61XDrJBYQf9utcimiPGkCHET4_3mq1cSfKm9Sk_jd9q5_zblODT2gzC3SnLcD9JBxh1cj6sIL5oBCVxcwbgdAVM82xo2OL9qMCoUomRlvMTOQ7b3LjATS88ZAx4lrLuLHQjMEnYmRFYbsE4kii9JkvBYo9PE6U9F944C1W8toyELGvXjI4Lp5LjpQCr141Z-KohqXeoYww",
34
+ token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI2MjM3OWU5OS01Mjk2LTRhZGQtODkyNy01YzU2ZmFjZDlkYmMiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjYyMzc5ZTk5LTUyOTYtNGFkZC04OTI3LTVjNTZmYWNkOWRiYyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJjN2U0YjlkNy0xMDE5LTQwYzgtYTRhNy00Y2E2NDNhYWI4NmMiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcxODkxMjczOSwibmFtZSI6IlByb3ZlZWRvciBQcnVlYmEiLCJwaG9uZV9udW1iZXIiOiIrNTI1NTM5MDA2NTcwIiwiZXhwIjoxNzE4OTE2MzM5LCJpYXQiOjE3MTg5MTI3MzksImVtYWlsIjoibGltYW43NDAyNkBtbnFsbS5jb20ifQ.V31vBoxceYYzeTSG6AQaKlSHxsyvGqyjs2Rb4iX0bXc-CEVREWhrz4Nw2GfzY41dW8v5vMTEkaqGpY3uAN9aR4VTiZNSkKXX4NYnVO83q0VGZEOQmpHeHgBXM_fm7FSKBfGDuECskT30Mlb3YFbcUYbpd9SzLrRPDWRQjSzJJ8ol4mlpXBJv6qrdoMWWa2lM_A2Rw-7A9ILrygICUp5233TZkS7b7JhSWyOpqhJZCrwWxjgvTn8mdiByPB8qQv-R0haPUsEAddnoRrjfSqnMxuyfFYuoPUcokjrz-NUO7JihidkA9fxZG4yHsxhyQbwhgaEeOxm0X-BB_pOmJ8X5wg",
35
35
  articleId: 127595,
36
36
  category: "2902",
37
37
  version: 3,
@@ -1562,7 +1562,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1562
1562
  };
1563
1563
 
1564
1564
  var createComment = /*#__PURE__*/function () {
1565
- var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
1565
+ var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(body) {
1566
1566
  var concept, data;
1567
1567
  return _regenerator.default.wrap(function _callee15$(_context15) {
1568
1568
  while (1) {
@@ -1593,15 +1593,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1593
1593
  concept: concept,
1594
1594
  version: version
1595
1595
  };
1596
- console.log('comentario:', data.message);
1597
- _context15.next = 14;
1596
+ _context15.next = 13;
1598
1597
  return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1599
1598
  headers: {
1600
1599
  Authorization: token
1601
1600
  }
1602
1601
  });
1603
1602
 
1604
- case 14:
1603
+ case 13:
1605
1604
  case "end":
1606
1605
  return _context15.stop();
1607
1606
  }
@@ -1609,7 +1608,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1609
1608
  }, _callee15);
1610
1609
  }));
1611
1610
 
1612
- return function createComment(_x4, _x5, _x6) {
1611
+ return function createComment(_x4) {
1613
1612
  return _ref16.apply(this, arguments);
1614
1613
  };
1615
1614
  }();
@@ -1708,7 +1707,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1708
1707
  }, _callee17);
1709
1708
  }));
1710
1709
 
1711
- return function setAssignation(_x7, _x8) {
1710
+ return function setAssignation(_x5, _x6) {
1712
1711
  return _ref18.apply(this, arguments);
1713
1712
  };
1714
1713
  }();
@@ -1897,7 +1896,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1897
1896
  }, _callee18, null, [[9, 33]]);
1898
1897
  }));
1899
1898
 
1900
- return function sendEvaluation(_x9) {
1899
+ return function sendEvaluation(_x7) {
1901
1900
  return _ref19.apply(this, arguments);
1902
1901
  };
1903
1902
  }();
@@ -1988,7 +1987,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1988
1987
  }, _callee19, null, [[0, 27]]);
1989
1988
  }));
1990
1989
 
1991
- return function validateAll(_x10) {
1990
+ return function validateAll(_x8) {
1992
1991
  return _ref20.apply(this, arguments);
1993
1992
  };
1994
1993
  }();
@@ -2035,7 +2034,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2035
2034
  }, _callee20);
2036
2035
  }));
2037
2036
 
2038
- return function evaluationToRetailer(_x11) {
2037
+ return function evaluationToRetailer(_x9) {
2039
2038
  return _ref21.apply(this, arguments);
2040
2039
  };
2041
2040
  }();
@@ -2346,50 +2345,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2346
2345
  }))]
2347
2346
  })
2348
2347
  }), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2349
- className: "commentary-box",
2350
- children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2351
- className: "commentary",
2352
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
2353
- label: "Caja de Comentario",
2354
- inputType: "textarea",
2355
- inputCols: 80,
2356
- inputRows: 4,
2357
- inputId: "commentary-box",
2358
- index: 0
2359
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2360
- className: "buttons-box",
2361
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2362
- buttonType: "general-transparent-button",
2363
- label: "Enviar comentario",
2364
- onClick: function onClick(e) {
2365
- createComment(e, document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
2366
- }
2367
- })
2368
- })]
2369
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2370
- className: "feedback-box",
2371
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
2372
- comment: comment.message,
2373
- reviewed: crossComment
2374
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2375
- buttonType: "circular-button accept-button",
2376
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
2377
- return _regenerator.default.wrap(function _callee21$(_context21) {
2378
- while (1) {
2379
- switch (_context21.prev = _context21.next) {
2380
- case 0:
2381
- setCrossComment(true);
2382
- commentRevised();
2383
-
2384
- case 2:
2385
- case "end":
2386
- return _context21.stop();
2387
- }
2388
- }
2389
- }, _callee21);
2390
- }))
2391
- })]
2392
- })
2348
+ className: "commentary-box"
2393
2349
  }) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2394
2350
  className: "required-inputs-message",
2395
2351
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -2470,19 +2426,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2470
2426
  type: "pink",
2471
2427
  label: "Aceptar",
2472
2428
  size: 12,
2473
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
2429
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
2474
2430
  var body, messages;
2475
- return _regenerator.default.wrap(function _callee22$(_context22) {
2431
+ return _regenerator.default.wrap(function _callee21$(_context21) {
2476
2432
  while (1) {
2477
- switch (_context22.prev = _context22.next) {
2433
+ switch (_context21.prev = _context21.next) {
2478
2434
  case 0:
2479
2435
  body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
2480
2436
  messages = [{
2481
2437
  type: "message",
2482
2438
  value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
2483
2439
  }];
2484
- _context22.next = 4;
2485
- return createComment(messages, activeRetailer.id);
2440
+ _context21.next = 4;
2441
+ return createComment(messages[0].value);
2486
2442
 
2487
2443
  case 4:
2488
2444
  validatedAll ? validateAll("R") : sendToEvaluation("R");
@@ -2490,10 +2446,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2490
2446
 
2491
2447
  case 6:
2492
2448
  case "end":
2493
- return _context22.stop();
2449
+ return _context21.stop();
2494
2450
  }
2495
2451
  }
2496
- }, _callee22);
2452
+ }, _callee21);
2497
2453
  }))
2498
2454
  }, "btn-Aceptar")]
2499
2455
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.5.23",
3
+ "version": "21.5.26",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -175,53 +175,57 @@ export const InputGroup = ({
175
175
  {inputGroup?.inputs?.map((input, index) =>
176
176
  activeSection === "Ficha técnica" ? (
177
177
  <>
178
+ {((dataInputs[input]?.id!=6700 && dataInputs[input]?.id!=6701)
179
+ || dataInputs[input]?.isApproved!=undefined) && (
178
180
  <TagAndInput
179
- key={
180
- index +
181
- "-" +
182
- dataInputs[input]?.value +
183
- "-" +
184
- dataInputs[input]?.id +
185
- "-" +
186
- compare
187
- }
188
- //disabled={input === 40001}
189
- disabled={dataInputs[input]?.isApproved}
190
- inputId={dataInputs[input]?.id}
191
- version={version}
192
- inputType={inputTypeValue(dataInputs[input]?.type)}
193
- label={
194
- dataInputs[input]?.name +
195
- (dataInputs[input]?.required ? "*" : "")
196
- }
197
- value={
198
- compare
199
- ? auditInputs[input]?.value
200
- : dataInputs[input]?.value
201
- }
202
- inputPlaceHolder={input?.placeholder}
203
- articleId={articleId}
204
- isRequired={dataInputs[input]?.required}
205
- updatedDatasheets={updatedDatasheets}
206
- setUpdatedDatasheets={setUpdatedDatasheets}
207
- maxChar={
208
- dataInputs[input]?.max_chars
209
- ? dataInputs[input]?.max_chars
210
- : 999
211
- }
212
- optionList={dataInputs[input]?.option_list}
213
- description={dataInputs[input]?.description}
214
- showTooltip={true}
215
- auditClass={
216
- compare &&
217
- !isEquals(
218
- dataInputs[input].value,
219
- auditInputs[input].value
220
- )
221
- ? "audit-class"
222
- : ""
223
- }
224
- />
181
+ key={
182
+ index +
183
+ "-" +
184
+ dataInputs[input]?.value +
185
+ "-" +
186
+ dataInputs[input]?.id +
187
+ "-" +
188
+ compare
189
+ }
190
+ //disabled={input === 40001}
191
+ disabled={dataInputs[input]?.isApproved}
192
+ inputId={dataInputs[input]?.id}
193
+ version={version}
194
+ inputType={inputTypeValue(dataInputs[input]?.type)}
195
+ label={
196
+ dataInputs[input]?.name +
197
+ (dataInputs[input]?.required ? "*" : "")
198
+ }
199
+ value={
200
+ compare
201
+ ? auditInputs[input]?.value
202
+ : dataInputs[input]?.value
203
+ }
204
+ inputPlaceHolder={input?.placeholder}
205
+ articleId={articleId}
206
+ isRequired={dataInputs[input]?.required}
207
+ updatedDatasheets={updatedDatasheets}
208
+ setUpdatedDatasheets={setUpdatedDatasheets}
209
+ maxChar={
210
+ dataInputs[input]?.max_chars
211
+ ? dataInputs[input]?.max_chars
212
+ : 999
213
+ }
214
+ optionList={dataInputs[input]?.option_list}
215
+ description={dataInputs[input]?.description}
216
+ showTooltip={true}
217
+ auditClass={
218
+ compare &&
219
+ !isEquals(
220
+ dataInputs[input].value,
221
+ auditInputs[input].value
222
+ )
223
+ ? "audit-class"
224
+ : ""
225
+ }
226
+ />
227
+ )}
228
+
225
229
  {dataInputs[input]?.isApproved === false && (
226
230
  <InputReviewSection
227
231
  inputId={dataInputs[input]?.id}
@@ -247,6 +251,17 @@ export const InputGroup = ({
247
251
  imageStates={imageStates}
248
252
  />
249
253
  )}
254
+ {/*(input.id===44186||input.id===44187) && (
255
+ <InputReviewSection
256
+ inputId={input?.id}
257
+ isApproved={aprrovedInput}
258
+ comment={input?.comment}
259
+ handleImgClick={handleImgClick}
260
+ changeImageBtn={changeImageBtn}
261
+ showDivState={showDivStates}
262
+ imageStates={imageStates}
263
+ />
264
+ )*/}
250
265
  <TagAndInput
251
266
  key={index + "-" + input?.value + "-" + compare}
252
267
  inputId={input.id}
@@ -259,7 +274,7 @@ export const InputGroup = ({
259
274
  : input?.value
260
275
  }
261
276
  isRequired={input.required}
262
- disabled={input?.isApproved}
277
+ disabled={input.id===44186||input.id===44187?false:input?.isApproved}
263
278
  maxChar={input.max_chars}
264
279
  inputPlaceHolder={input?.placeholder}
265
280
  updatedDescriptions={updatedDescriptions}
@@ -15,26 +15,27 @@ const myBucket = new AWS.S3({
15
15
  region: REGION,
16
16
  });
17
17
 
18
- export default async function saveData(params) {
19
- const { section, data, token, callbackToInitData, setModal } = params;
18
+ export async function saveData(params) {
19
+ const { section, data, token } = params;
20
20
  if (section === "images") {
21
21
  if (await saveImagesData(data, token)) {
22
- callbackToInitData();
23
- setModal({
22
+ //callbackToInitData();
23
+ /**setModal({
24
24
  type: "saved successfully",
25
25
  functions: { setModal },
26
26
  payload: { service: "imágenes" },
27
- });
27
+ });**/
28
28
  // aquí va modal de que todo salío bien y actualiza la data
29
29
  }
30
30
  }
31
- return false;
31
+ return true;
32
32
  }
33
33
 
34
34
  async function saveImagesData(articles, token) {
35
35
  const imagesToUpdate = [];
36
36
  articles.data.forEach((article) => {
37
37
  const { images, version } = article;
38
+ console.log(images);
38
39
  const imagesToAdd = Object.values(images).filter(
39
40
  (f) => f.value && !f.value.src.startsWith("id-")
40
41
  );
@@ -1,7 +1,7 @@
1
1
  import axios from "axios";
2
2
  import { ImageVisor } from "../../organisms/ImageVisor";
3
3
  import { ButtonV2 } from "../../atoms/ButtonV2";
4
- import { deleteImage } from "./saveData";
4
+ import { deleteImage, saveData} from "./saveData";
5
5
  import { Container, Input, InputBase, TextField } from "@mui/material";
6
6
  import { ValidationPanel } from "../../atoms/ValidationPanel";
7
7
  import { TagAndInput } from "../../molecules/TagAndInput";
@@ -96,7 +96,7 @@ export function dataReducer(state, action) {
96
96
  return action.payload;
97
97
  }
98
98
  if (action.type === "updateImage") {
99
- const { articleId, imageId } = action.payload;
99
+ const { articleId, imageId ,token } = action.payload;
100
100
  const newImageData = state.images.data.slice();
101
101
  const articleIndex = newImageData.findIndex((f) => f.id === articleId);
102
102
  const id = newImageData[articleIndex]?.images[imageId]?.value?.id;
@@ -104,6 +104,8 @@ export function dataReducer(state, action) {
104
104
  ...action.payload,
105
105
  id,
106
106
  };
107
+ const data = newImageData;
108
+ saveData({section:"images", data: {data}, token: token});
107
109
  return {
108
110
  ...state,
109
111
  images: {
@@ -118,7 +120,6 @@ export function dataReducer(state, action) {
118
120
  const articleIndex = newImageData.findIndex((f) => f.id === articleId);
119
121
  const id = newImageData[articleIndex]?.images[imageId]?.value?.id;
120
122
  delete newImageData[articleIndex]?.images[imageId]?.value;
121
- console.log(newImageData[articleIndex]);
122
123
  const data = {
123
124
  articleId,
124
125
  deleteImages: [
@@ -264,14 +265,15 @@ export function setDataColumns(
264
265
  });
265
266
  }
266
267
  });
267
- var saveAvailable = imagesReviewed
268
+ var saveAvailable=true;
269
+ /**var saveAvailable = imagesReviewed
268
270
  .filter((e) => e.articleId === item.id)
269
271
  .every((e) => e.isReviewed === true);
270
272
  if (
271
273
  imagesReviewed.filter((e) => e.articleId === item.id).length == 0
272
274
  ) {
273
275
  saveAvailable = false;
274
- }
276
+ }**/
275
277
  currentData[`retailer${ret.id}-save`] = (
276
278
  <button
277
279
  onClick={() => {
@@ -342,7 +344,7 @@ export function setDataColumns(
342
344
  );
343
345
  currentData[`img${imageId}`] =
344
346
  <>
345
- {/* <button
347
+ {/**<button
346
348
  onClick={() => {
347
349
  setShowValidationPanel(true);
348
350
  setAttributeSelected({
@@ -427,7 +429,7 @@ export function setDataColumns(
427
429
  <p> Rechazar </p>{" "}
428
430
  </button>{" "}
429
431
  </div>
430
- )}{" "}
432
+ )}{" "}
431
433
  {comment && <div class="tooltip">
432
434
  <ImageVisor {...props}/>
433
435
  <span class="tooltiptext"><p><b>Comentarios del rechazo</b></p><p>{des.comment}</p></span>
@@ -471,19 +473,31 @@ export function setDataColumns(
471
473
  var articleAttributes = attributesReviewed.filter(
472
474
  (e) => e.articleId === item.id && e.versionId === item.version
473
475
  );
476
+ var value;
474
477
  articleAttributes.forEach((articleAttribute) => {
475
- const value = document.getElementById(
476
- articleAttribute.articleId +
477
- "_" +
478
- articleAttribute.attributeId +
479
- "_" +
480
- articleAttribute.versionId
481
- ).value;
478
+ if(articleAttribute.attributeId==6700 || articleAttribute.attributeId==6701){
479
+ value= document.getElementById(
480
+ articleAttribute.articleId +
481
+ "_" +
482
+ articleAttribute.attributeId +
483
+ "_" +
484
+ articleAttribute.versionId
485
+ ).checked;
486
+ }
487
+ else{
488
+ value = document.getElementById(
489
+ articleAttribute.articleId +
490
+ "_" +
491
+ articleAttribute.attributeId +
492
+ "_" +
493
+ articleAttribute.versionId
494
+ ).value;
495
+ }
482
496
  articlesAtributesUpdateBody.push({
483
497
  articleId: articleAttribute.articleId,
484
498
  versionId: articleAttribute.versionId,
485
499
  attributeId: articleAttribute.attributeId,
486
- value: value ? value : "",
500
+ value: value!=undefined ? value : "",
487
501
  isApproved: articleAttribute.isApproved,
488
502
  comment: articleAttribute.comment,
489
503
  });
@@ -744,14 +758,15 @@ export function setDataColumns(
744
758
  style: styleSaveButtonCol,
745
759
  });
746
760
  }
747
- var saveAvailable = descriptionsReviewed
761
+ var saveAvailable=true;
762
+ /**var saveAvailable = descriptionsReviewed
748
763
  .filter((e) => e.articleId === item.id)
749
764
  .every((e) => e.isReviewed === true);
750
765
  if (
751
766
  descriptionsReviewed.filter((e) => e.articleId === item.id).length == 0
752
767
  ) {
753
768
  saveAvailable = false;
754
- }
769
+ }**/
755
770
  currentData[`retailer${ret.id}`] = <p> {ret.name} </p>;
756
771
  ret.descriptions.forEach((descriptionId) => {
757
772
  if (!retailersAdded.attr.includes(`${descriptionId}`)) {
@@ -838,7 +853,7 @@ export function setDataColumns(
838
853
  );
839
854
  currentData[`${des.attributeId}`] = (
840
855
  <>
841
- {/* <button
856
+ {/**<button
842
857
  onClick={() => {
843
858
  setShowValidationPanel(true);
844
859
  setAttributeSelected({
@@ -922,7 +937,7 @@ export function setDataColumns(
922
937
  <p> Rechazar </p>{" "}
923
938
  </button>{" "}
924
939
  </div>
925
- )}{" "}
940
+ )}{" "}
926
941
  {des.comment && <div class="tooltip">
927
942
  <textarea {...props}></textarea>
928
943
  <span class="tooltiptext"><p><b>Comentarios del rechazo</b></p><p>{des.comment}</p></span>
@@ -16,7 +16,7 @@ ProviderProductEditionDefault.args = {
16
16
  Imágenes: true,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI2MjM3OWU5OS01Mjk2LTRhZGQtODkyNy01YzU2ZmFjZDlkYmMiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjYyMzc5ZTk5LTUyOTYtNGFkZC04OTI3LTVjNTZmYWNkOWRiYyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI4ZmRkOWJlYS1jYTE0LTQ4MmQtYmUwNi1iMjA4YjdjMTM1MWYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcxODgyMDI2MCwibmFtZSI6IlByb3ZlZWRvciBQcnVlYmEiLCJwaG9uZV9udW1iZXIiOiIrNTI1NTM5MDA2NTcwIiwiZXhwIjoxNzE4ODIzODYwLCJpYXQiOjE3MTg4MjAyNjAsImVtYWlsIjoibGltYW43NDAyNkBtbnFsbS5jb20ifQ.j4PhSKzZ0yb_5QyXYh_vviA-zbMhJc_wE3yqFErlrPsCZsqY43hx-fvEwwOJnzqwNlPFms6kZbddaGPVu0jnGw8TmiaKtoDVOmui_db8DuWGDHLPQhPZNeoM_g5qKY8H7ZIClGSOohj_61XDrJBYQf9utcimiPGkCHET4_3mq1cSfKm9Sk_jd9q5_zblODT2gzC3SnLcD9JBxh1cj6sIL5oBCVxcwbgdAVM82xo2OL9qMCoUomRlvMTOQ7b3LjATS88ZAx4lrLuLHQjMEnYmRFYbsE4kii9JkvBYo9PE6U9F944C1W8toyELGvXjI4Lp5LjpQCr141Z-KohqXeoYww",
19
+ "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI2MjM3OWU5OS01Mjk2LTRhZGQtODkyNy01YzU2ZmFjZDlkYmMiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjYyMzc5ZTk5LTUyOTYtNGFkZC04OTI3LTVjNTZmYWNkOWRiYyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJjN2U0YjlkNy0xMDE5LTQwYzgtYTRhNy00Y2E2NDNhYWI4NmMiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcxODkxMjczOSwibmFtZSI6IlByb3ZlZWRvciBQcnVlYmEiLCJwaG9uZV9udW1iZXIiOiIrNTI1NTM5MDA2NTcwIiwiZXhwIjoxNzE4OTE2MzM5LCJpYXQiOjE3MTg5MTI3MzksImVtYWlsIjoibGltYW43NDAyNkBtbnFsbS5jb20ifQ.V31vBoxceYYzeTSG6AQaKlSHxsyvGqyjs2Rb4iX0bXc-CEVREWhrz4Nw2GfzY41dW8v5vMTEkaqGpY3uAN9aR4VTiZNSkKXX4NYnVO83q0VGZEOQmpHeHgBXM_fm7FSKBfGDuECskT30Mlb3YFbcUYbpd9SzLrRPDWRQjSzJJ8ol4mlpXBJv6qrdoMWWa2lM_A2Rw-7A9ILrygICUp5233TZkS7b7JhSWyOpqhJZCrwWxjgvTn8mdiByPB8qQv-R0haPUsEAddnoRrjfSqnMxuyfFYuoPUcokjrz-NUO7JihidkA9fxZG4yHsxhyQbwhgaEeOxm0X-BB_pOmJ8X5wg",
20
20
  articleId: 127595,
21
21
  category: "2902",
22
22
  version: 3,
@@ -914,7 +914,7 @@ export const ProviderProductEdition = ({
914
914
  }
915
915
  };
916
916
 
917
- const createComment = async (e, body, tab) => {
917
+ const createComment = async (body) => {
918
918
  let concept = "";
919
919
  switch (activeTab) {
920
920
  case "Ficha técnica":
@@ -935,7 +935,6 @@ export const ProviderProductEdition = ({
935
935
  concept: concept,
936
936
  version: version,
937
937
  };
938
- console.log('comentario:', data.message);
939
938
  await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
940
939
  headers: {
941
940
  Authorization: token,
@@ -1606,7 +1605,8 @@ export const ProviderProductEdition = ({
1606
1605
  </div>
1607
1606
  {isRevision() && getSectionStatus() ? (
1608
1607
  <div className="commentary-box">
1609
- {!comment ? (
1608
+ {/* Este lo comento porque la funcionalidad se tiene en el modal al momento de rechazar el producto */}
1609
+ {/* {!comment ? (
1610
1610
  <div className="commentary">
1611
1611
  <TagAndInput
1612
1612
  label={"Caja de Comentario"}
@@ -1647,7 +1647,7 @@ export const ProviderProductEdition = ({
1647
1647
  }}
1648
1648
  />
1649
1649
  </div>
1650
- )}
1650
+ )} */}
1651
1651
  </div>
1652
1652
  ) : (
1653
1653
  !revision && (
@@ -1762,7 +1762,7 @@ export const ProviderProductEdition = ({
1762
1762
  const messages = [
1763
1763
  { type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
1764
1764
  ];
1765
- await createComment(messages, activeRetailer.id);
1765
+ await createComment(messages[0].value);
1766
1766
  validatedAll ? validateAll("R") : sendToEvaluation("R");
1767
1767
  setShowRejectModal(false);
1768
1768
  }}
@@ -1,4 +0,0 @@
1
- <svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <circle cx="15" cy="15" r="14.6316" stroke="#F0EEF2" stroke-width="0.736842"/>
3
- <path d="M20.7063 13.1113C20.2246 10.6676 18.0783 8.83301 15.5 8.83301C13.4529 8.83301 11.675 9.99467 10.7896 11.6947C8.6575 11.9213 7 13.7276 7 15.9163C7 18.2609 8.90542 20.1663 11.25 20.1663H20.4583C22.4133 20.1663 24 18.5797 24 16.6247C24 14.7547 22.5479 13.2388 20.7063 13.1113ZM19.0417 15.208L15.5 18.7497L11.9583 15.208H14.0833V12.3747H16.9167V15.208H19.0417Z" fill="#817393"/>
4
- </svg>
@@ -1,8 +0,0 @@
1
- <svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_37_379" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="8" height="8">
3
- <rect width="8" height="8" fill="#D9D9D9"/>
4
- </mask>
5
- <g mask="url(#mask0_37_379)">
6
- <path d="M3.63807 5.98825H4.40893V3.62867H3.63807V5.98825ZM3.99596 3.07403C4.124 3.07403 4.2311 3.03169 4.31727 2.947C4.40345 2.86232 4.44653 2.75738 4.44653 2.6322C4.44653 2.49463 4.40331 2.38347 4.31685 2.29871C4.2304 2.21394 4.12327 2.17156 3.99547 2.17156C3.86061 2.17156 3.75166 2.21394 3.66863 2.29871C3.58559 2.38347 3.54407 2.49307 3.54407 2.6275C3.54407 2.7566 3.58737 2.8633 3.67398 2.94759C3.7606 3.03188 3.86792 3.07403 3.99596 3.07403ZM3.9991 8C3.44212 8 2.92156 7.89633 2.43741 7.68899C1.95324 7.48165 1.52964 7.19646 1.16659 6.83341C0.803541 6.47036 0.518349 6.04696 0.311013 5.5632C0.103671 5.07943 0 4.5588 0 4.0013C0 3.44379 0.103671 2.92273 0.311013 2.4381C0.518349 1.95348 0.803049 1.53104 1.16511 1.1708C1.52718 0.810554 1.95032 0.525358 2.43455 0.315215C2.91877 0.105072 3.43989 0 3.99792 0C4.55595 0 5.07764 0.10483 5.56301 0.314491C6.04837 0.524146 6.47094 0.80868 6.83072 1.16809C7.1905 1.52751 7.47533 1.95015 7.6852 2.43603C7.89507 2.92191 8 3.44396 8 4.0022C8 4.56004 7.89493 5.08098 7.68479 5.56504C7.47464 6.04909 7.18945 6.47169 6.8292 6.83282C6.46896 7.19395 6.04646 7.47876 5.56169 7.68726C5.07694 7.89575 4.55607 8 3.9991 8ZM4 7.11633C4.86173 7.11633 5.59499 6.81435 6.19977 6.21037C6.80454 5.60639 7.10693 4.8696 7.10693 4C7.10693 3.13827 6.80513 2.40501 6.20153 1.80024C5.59793 1.19546 4.86095 0.893067 3.9906 0.893067C3.12887 0.893067 2.39561 1.19487 1.79083 1.79847C1.18606 2.40207 0.883666 3.13905 0.883666 4.0094C0.883666 4.87113 1.18565 5.60439 1.78963 6.20917C2.39361 6.81394 3.1304 7.11633 4 7.11633Z" fill="#ECDD1D"/>
7
- </g>
8
- </svg>
@@ -1,99 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = exports.ServiceDataValidatorDefault = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
-
12
- var _index = require("./index");
13
-
14
- var _jsxRuntime = require("react/jsx-runtime");
15
-
16
- var _default = {
17
- title: "Components/molecules/ServiceDataValidator",
18
- component: _index.ServiceDataValidator
19
- };
20
- exports.default = _default;
21
-
22
- var Template = function Template(args) {
23
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ServiceDataValidator, (0, _objectSpread2.default)({}, args));
24
- };
25
-
26
- var ServiceDataValidatorDefault = Template.bind({});
27
- exports.ServiceDataValidatorDefault = ServiceDataValidatorDefault;
28
- ServiceDataValidatorDefault.args = {
29
- activeRetailer: {
30
- id: 34,
31
- image: "https://content-management-images.s3.amazonaws.com/retailers/34.png",
32
- name: "San Pablo",
33
- services: ["AA", "AP", "AA"]
34
- },
35
- headerData: {
36
- "orderId": 15275,
37
- "status": "AA",
38
- "datasheet_status": "AA",
39
- "prio": "none",
40
- "version": 3,
41
- "description_status": "AA",
42
- "images_status": "AA",
43
- "brand": null,
44
- "retailerOrder": 0,
45
- "missing": {
46
- "datasheet": null,
47
- "descriptions": null,
48
- "images": null
49
- },
50
- "services": {
51
- "datasheets": 1,
52
- "descriptions": 1,
53
- "images": 1
54
- },
55
- "article": {
56
- "category": "Abarrotes|Abarrotes Secos|Frutos Secos",
57
- "company_name": "GRUPO BRAHMA",
58
- "country": "México",
59
- "id_category": "11",
60
- "id_datasheet_especialist": 54,
61
- "id_datasheet_facilitator": 52,
62
- "id_description_especialist": 54,
63
- "id_description_facilitator": 52,
64
- "id_images_especialist": 55,
65
- "id_images_facilitator": 53,
66
- "id_order": 15275,
67
- "id_article": 39485,
68
- "id_auditor": 37,
69
- "name": "Mix de nueces",
70
- "timestamp": "2023-07-14T21:03:19.000Z",
71
- "upc": "7543453453"
72
- },
73
- "retailers": [{
74
- "id": 34,
75
- "name": "San Pablo",
76
- "services": ["AA", "AP", "AA"],
77
- "image": "https://content-management-images.s3.amazonaws.com/retailers/34.png"
78
- }],
79
- "statusByRetailer": {
80
- "34": {
81
- "datasheet": "AA",
82
- "description": "AA",
83
- "images": "AA"
84
- }
85
- },
86
- "retailersAvailable": [{
87
- "id": 34,
88
- "name": "San Pablo"
89
- }],
90
- "categoryName": "Abarrotes|Abarrotes Secos|Frutos Secos",
91
- "upc": "7543453453",
92
- "id_article": 39485,
93
- "id_order": 15275
94
- },
95
- showApproveRejectAll: true,
96
- showValidationButtons: true,
97
- text: "Descripción",
98
- missingData: 1
99
- };
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ServiceDataValidator = void 0;
7
-
8
- var _styles = require("./styles");
9
-
10
- var _variables = require("../../../global-files/variables");
11
-
12
- var _react = require("react");
13
-
14
- var _Validation = require("../Validation");
15
-
16
- var _jsxRuntime = require("react/jsx-runtime");
17
-
18
- var ServiceDataValidator = function ServiceDataValidator(_ref) {
19
- var headerData = _ref.headerData,
20
- activeRetailer = _ref.activeRetailer,
21
- setActiveRetailer = _ref.setActiveRetailer,
22
- showValidationButtons = _ref.showValidationButtons,
23
- showApproveRejectAll = _ref.showApproveRejectAll,
24
- approveAll = _ref.approveAll,
25
- rejectAll = _ref.rejectAll,
26
- approve = _ref.approve,
27
- reject = _ref.reject,
28
- text = _ref.text,
29
- complete = _ref.complete,
30
- showValidation = _ref.showValidation,
31
- missingData = _ref.missingData;
32
- var headerTop = (0, _react.useRef)();
33
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
34
- fontFamily: _variables.FontFamily.Raleway,
35
- color: _variables.GlobalColors.original_magenta,
36
- ref: headerTop,
37
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
38
- className: "service-text",
39
- children: [text, ":", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
40
- className: "service-complete",
41
- children: complete ? "Completado" : "".concat(missingData, " ").concat(missingData > 1 ? 'Faltantes' : 'Faltante')
42
- })]
43
- }), showValidation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Validation.Validation, {
44
- headerData: headerData,
45
- activeRetailer: activeRetailer,
46
- setActiveRetailer: setActiveRetailer,
47
- showValidationButtons: showValidationButtons,
48
- showApproveRejectAll: showApproveRejectAll,
49
- approveAll: approveAll,
50
- rejectAll: rejectAll,
51
- approve: approve,
52
- reject: reject
53
- })]
54
- });
55
- };
56
-
57
- exports.ServiceDataValidator = ServiceDataValidator;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.Container = void 0;
9
-
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
11
-
12
- var _styledComponents = _interopRequireDefault(require("styled-components"));
13
-
14
- var _variables = require("../../../global-files/variables");
15
-
16
- var _templateObject;
17
-
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\ndisplay:flex;\npadding:7px 15px;\njustify-content: space-between;\nbackground:", ";\nwidth: auto;\nheight:34px;\nalign-items: center;\nmax-width:300px;\nborder-radius:5px;\n\n\n * + * {\n margin-left: 10px;\n }\n\n .btn-gral{\n min-width: 34px;\n min-height:34px;\n }\n .images-buttons{\n display:flex;\n }\n .service-text{\n font-family:", ", sans-serif;\n font-size:12px;\n font-weight: 500;\n color:", ";\n }\n .service-complete{\n color:", ";\n }\n"])), _variables.GlobalColors.blue_light, _variables.FontFamily.RobotoMedium, _variables.GlobalColors.gray, _variables.GlobalColors.black);
19
-
20
- exports.Container = Container;