contentoh-components-library 21.5.24 → 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.
- package/dist/components/organisms/InputGroup/index.js +30 -30
- package/dist/components/pages/MultipleEdition/saveData.js +9 -19
- package/dist/components/pages/MultipleEdition/utils.js +39 -29
- package/package.json +1 -1
- package/src/components/organisms/InputGroup/index.js +62 -47
- package/src/components/pages/MultipleEdition/saveData.js +7 -6
- package/src/components/pages/MultipleEdition/utils.js +34 -19
- package/dist/assets/images/Icons/DownloadIcon copy.svg +0 -4
- package/dist/assets/images/Icons/Spinner copy.gif +0 -0
- package/dist/assets/images/Icons/info copy.svg +0 -8
- package/dist/components/organisms/ServiceDataValidator/ServiceDataValidator.stories.js +0 -99
- package/dist/components/organisms/ServiceDataValidator/index.js +0 -57
- package/dist/components/organisms/ServiceDataValidator/styles.js +0 -20
|
@@ -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,
|
|
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$
|
|
198
|
-
inputId: (_dataInputs$
|
|
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$
|
|
201
|
-
label: ((_dataInputs$
|
|
202
|
-
value: compare ? (_auditInputs$input = auditInputs[input]) === null || _auditInputs$input === void 0 ? void 0 : _auditInputs$input.value : (_dataInputs$
|
|
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$
|
|
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$
|
|
209
|
-
optionList: (_dataInputs$
|
|
210
|
-
description: (_dataInputs$
|
|
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$
|
|
214
|
-
inputId: (_dataInputs$
|
|
215
|
-
isApproved: (_dataInputs$
|
|
216
|
-
comment: (_dataInputs$
|
|
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$
|
|
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$
|
|
267
|
-
inputId: (_dataInputs$
|
|
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$
|
|
270
|
-
label: ((_dataInputs$
|
|
271
|
-
value: compare ? (_auditInputs$input2 = auditInputs[input]) === null || _auditInputs$input2 === void 0 ? void 0 : _auditInputs$input2.value : (_dataInputs$
|
|
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$
|
|
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$
|
|
278
|
-
optionList: (_dataInputs$
|
|
279
|
-
description: (_dataInputs$
|
|
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$
|
|
286
|
-
inputId: (_dataInputs$
|
|
287
|
-
isApproved: (_dataInputs$
|
|
288
|
-
comment: (_dataInputs$
|
|
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
|
|
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
|
|
51
|
+
section = params.section, data = params.data, token = params.token;
|
|
52
52
|
|
|
53
53
|
if (!(section === "images")) {
|
|
54
|
-
_context.next =
|
|
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 =
|
|
63
|
+
_context.next = 5;
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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)(
|
|
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 =
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
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
|
-
|
|
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 =
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}
|
|
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, " "]
|
package/package.json
CHANGED
|
@@ -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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
|
19
|
-
const { section, data, token
|
|
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
|
|
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
|
|
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
|
-
{
|
|
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
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
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
|
|
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
|
-
{
|
|
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>
|
|
@@ -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>
|
|
Binary file
|
|
@@ -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;
|