contentoh-components-library 21.4.122 → 21.4.123
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/pages/MultipleEdition/MultipleEdition.stories.js +2 -1
- package/dist/components/pages/MultipleEdition/index.js +67 -30
- package/dist/components/pages/MultipleEdition/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/utils.js +289 -29
- package/package.json +1 -1
- package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +2 -1
- package/src/components/pages/MultipleEdition/components/ImageUploader.js +62 -0
- package/src/components/pages/MultipleEdition/components/ImageUploaderStyles.js +29 -0
- package/src/components/pages/MultipleEdition/components/ImageVisor.js +143 -0
- package/src/components/pages/MultipleEdition/components/styles.js +106 -0
- package/src/components/pages/MultipleEdition/index.js +56 -12
- package/src/components/pages/MultipleEdition/styles.js +31 -1
- package/src/components/pages/MultipleEdition/utils.js +368 -21
|
@@ -29,6 +29,7 @@ MultipleEditionDefault.args = {
|
|
|
29
29
|
articles: [118471, 120898],
|
|
30
30
|
//[216, 238, 239],
|
|
31
31
|
versions: [1, 1],
|
|
32
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
32
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxZmFjNjY2Ny1hMDMzLTQ1NjAtOWU5ZC01MTQwMDc2MmI2MWYiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRx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dEnXkFC0WYcUMWMRUc6K6vgOvmCCQhzOr-uW-2nsLBGjBb7Tj_okViYvT0Lupo5Z0Z9Xc20oOWnVmrSuaYa1-b4AjOjEOnETA9usnRa6blOVOkHqi5fX8u11ejczINxNBtoizMPOQROuzuuPTvHrl17ae8JkNoxVCJe5ZdfRrUN1lwUXnOZim7QhNg8YR_uvPs_EJRIwfw",
|
|
33
34
|
|
|
34
35
|
};
|
|
@@ -7,7 +7,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.MultipleEdition = void 0;
|
|
11
11
|
|
|
12
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
13
|
|
|
@@ -47,7 +47,7 @@ var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
|
47
47
|
|
|
48
48
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var MultipleEdition = function MultipleEdition(_ref) {
|
|
51
51
|
var articles = _ref.articles,
|
|
52
52
|
versions = _ref.versions,
|
|
53
53
|
onClose = _ref.onClose,
|
|
@@ -72,20 +72,30 @@ var MEdition = function MEdition(_ref) {
|
|
|
72
72
|
attributesReviewed = _useState6[0],
|
|
73
73
|
setAttributesReviewed = _useState6[1];
|
|
74
74
|
|
|
75
|
-
var _useState7 = (0, _react.useState)(
|
|
75
|
+
var _useState7 = (0, _react.useState)([]),
|
|
76
76
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
descriptionsReviewed = _useState8[0],
|
|
78
|
+
setDescriptionsReviewed = _useState8[1];
|
|
79
79
|
|
|
80
|
-
var _useState9 = (0, _react.useState)(
|
|
80
|
+
var _useState9 = (0, _react.useState)([]),
|
|
81
81
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
imagesReviewed = _useState10[0],
|
|
83
|
+
setImagesReviewed = _useState10[1];
|
|
84
84
|
|
|
85
|
-
var _useState11 = (0, _react.useState)(
|
|
85
|
+
var _useState11 = (0, _react.useState)(false),
|
|
86
86
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
showRejectModal = _useState12[0],
|
|
88
|
+
setShowRejectModal = _useState12[1];
|
|
89
|
+
|
|
90
|
+
var _useState13 = (0, _react.useState)(false),
|
|
91
|
+
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
92
|
+
showValidationPanel = _useState14[0],
|
|
93
|
+
setShowValidationPanel = _useState14[1];
|
|
94
|
+
|
|
95
|
+
var _useState15 = (0, _react.useState)(""),
|
|
96
|
+
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
97
|
+
message = _useState16[0],
|
|
98
|
+
setMessage = _useState16[1];
|
|
89
99
|
|
|
90
100
|
var closeValidationPanel = function closeValidationPanel(e) {
|
|
91
101
|
if (!e.target.closest("#validation-panel") || e.target.closest(".validation-option") && showValidationPanel) {
|
|
@@ -94,13 +104,13 @@ var MEdition = function MEdition(_ref) {
|
|
|
94
104
|
}
|
|
95
105
|
};
|
|
96
106
|
|
|
97
|
-
var
|
|
107
|
+
var _useState17 = (0, _react.useState)({
|
|
98
108
|
columns: [],
|
|
99
109
|
data: []
|
|
100
110
|
}),
|
|
101
|
-
|
|
102
|
-
currentData =
|
|
103
|
-
setCurrentData =
|
|
111
|
+
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
112
|
+
currentData = _useState18[0],
|
|
113
|
+
setCurrentData = _useState18[1];
|
|
104
114
|
|
|
105
115
|
var _useReducer = (0, _react.useReducer)(_utils.dataReducer, {
|
|
106
116
|
description: {
|
|
@@ -117,10 +127,10 @@ var MEdition = function MEdition(_ref) {
|
|
|
117
127
|
dataServices = _useReducer2[0],
|
|
118
128
|
setDataServices = _useReducer2[1];
|
|
119
129
|
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
modalFromTable =
|
|
123
|
-
setModalFromTable =
|
|
130
|
+
var _useState19 = (0, _react.useState)(),
|
|
131
|
+
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
132
|
+
modalFromTable = _useState20[0],
|
|
133
|
+
setModalFromTable = _useState20[1];
|
|
124
134
|
|
|
125
135
|
var _useReducer3 = (0, _react.useReducer)(_utils.modalReducer, {
|
|
126
136
|
showModal: false
|
|
@@ -137,7 +147,7 @@ var MEdition = function MEdition(_ref) {
|
|
|
137
147
|
callbackToInitData();
|
|
138
148
|
}, []);
|
|
139
149
|
(0, _react.useEffect)(function () {
|
|
140
|
-
var _setDataColumns = (0, _utils.setDataColumns)(section, dataServices[section], token, setModalFromTable, setDataServices, setModal, setShowValidationPanel, setAttributeSelected, setShowRejectModal, setAttributesReviewed, setMessage, showValidationPanel, attributeSelected, attributesReviewed),
|
|
150
|
+
var _setDataColumns = (0, _utils.setDataColumns)(section, dataServices[section], token, setModalFromTable, setDataServices, setModal, setShowValidationPanel, setAttributeSelected, setShowRejectModal, setAttributesReviewed, setMessage, showValidationPanel, attributeSelected, attributesReviewed, descriptionsReviewed, imagesReviewed),
|
|
141
151
|
_setDataColumns2 = (0, _slicedToArray2.default)(_setDataColumns, 2),
|
|
142
152
|
columns = _setDataColumns2[0],
|
|
143
153
|
data = _setDataColumns2[1];
|
|
@@ -146,7 +156,7 @@ var MEdition = function MEdition(_ref) {
|
|
|
146
156
|
columns: columns,
|
|
147
157
|
data: data
|
|
148
158
|
});
|
|
149
|
-
}, [section, dataServices, attributeSelected, showValidationPanel, attributesReviewed]);
|
|
159
|
+
}, [section, dataServices, attributeSelected, showValidationPanel, attributesReviewed, descriptionsReviewed, imagesReviewed]);
|
|
150
160
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
151
161
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
152
162
|
className: "tabs",
|
|
@@ -205,17 +215,44 @@ var MEdition = function MEdition(_ref) {
|
|
|
205
215
|
type: "comment",
|
|
206
216
|
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
207
217
|
}];
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
218
|
+
|
|
219
|
+
if (section == "description" || section == "datasheet") {
|
|
220
|
+
if (section == "datasheet") {
|
|
221
|
+
index = attributesReviewed.findIndex(function (e) {
|
|
222
|
+
return e.articleId === attributeSelected.articleId && e.attributeId === attributeSelected.attributeId && e.versionId === attributeSelected.versionId;
|
|
223
|
+
});
|
|
224
|
+
attributesReviewed[index].isApproved = false;
|
|
225
|
+
attributesReviewed[index].isReviewed = true;
|
|
226
|
+
attributesReviewed[index].comment = comment[0].value;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (section == "description") {
|
|
230
|
+
index = descriptionsReviewed.findIndex(function (e) {
|
|
231
|
+
return e.articleId === attributeSelected.articleId && e.attributeId === attributeSelected.attributeId && e.versionId === attributeSelected.versionId;
|
|
232
|
+
});
|
|
233
|
+
descriptionsReviewed[index].isApproved = false;
|
|
234
|
+
descriptionsReviewed[index].isReviewed = true;
|
|
235
|
+
descriptionsReviewed[index].comment = comment[0].value;
|
|
236
|
+
console.log(descriptionsReviewed[index]);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
document.getElementById("button_" + attributeSelected.articleId + "_" + attributeSelected.attributeId + "_" + attributeSelected.versionId).src = _rejectIcon.default;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (section == "images") {
|
|
243
|
+
index = imagesReviewed.findIndex(function (e) {
|
|
244
|
+
return e.articleId === attributeSelected.articleId && e.imageId === attributeSelected.attributeId && e.versionId === attributeSelected.versionId;
|
|
245
|
+
});
|
|
246
|
+
imagesReviewed[index].isApproved = false;
|
|
247
|
+
imagesReviewed[index].isReviewed = true;
|
|
248
|
+
imagesReviewed[index].comment = comment[0].value;
|
|
249
|
+
console.log(imagesReviewed[index]);
|
|
250
|
+
}
|
|
251
|
+
|
|
213
252
|
document.getElementById("button_" + attributeSelected.articleId + "_" + attributeSelected.attributeId + "_" + attributeSelected.versionId).src = _rejectIcon.default;
|
|
214
|
-
attributesReviewed[index].comment = comment[0].value;
|
|
215
|
-
console.log(attributesReviewed[index]);
|
|
216
253
|
setShowRejectModal(false);
|
|
217
254
|
|
|
218
|
-
case
|
|
255
|
+
case 6:
|
|
219
256
|
case "end":
|
|
220
257
|
return _context.stop();
|
|
221
258
|
}
|
|
@@ -240,4 +277,4 @@ var MEdition = function MEdition(_ref) {
|
|
|
240
277
|
});
|
|
241
278
|
};
|
|
242
279
|
|
|
243
|
-
exports.
|
|
280
|
+
exports.MultipleEdition = MultipleEdition;
|
|
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: grid;\n grid-template-columns: 75% 25%;\n grid-template-rows: 75px 1fr;\n grid-template-areas:\n \"tabs action_buttons\"\n \"table table\";\n margin: 0 30px;\n body{\n font-family: Roboto;\n }\n\n .tabs {\n grid-area: tabs;\n display: flex;\n align-items: center;\n gap: 0 10px;\n }\n .action_buttons {\n grid-area: action_buttons;\n display: flex;\n align-items: center;\n justify-content: end;\n gap: 0 10px;\n & > * {\n cursor: pointer;\n }\n }\n .table {\n grid-area: table;\n background: red;\n height: 100%;\n font-family: Raleway;\n }\n \n .buttons-container{\n background: white;\n width: max-content;\n padding: 8px;\n border: 1px solid ", ";\n box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);\n border-radius: 3px;\n position: absolute;\n top: -10%;\n z-index: 100;\n }\n\n .validation-option {\n width:
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: grid;\n grid-template-columns: 75% 25%;\n grid-template-rows: 75px 1fr;\n grid-template-areas:\n \"tabs action_buttons\"\n \"table table\";\n margin: 0 30px;\n body{\n font-family: Roboto;\n }\n\n .tabs {\n grid-area: tabs;\n display: flex;\n align-items: center;\n gap: 0 10px;\n }\n .action_buttons {\n grid-area: action_buttons;\n display: flex;\n align-items: center;\n justify-content: end;\n gap: 0 10px;\n & > * {\n cursor: pointer;\n }\n }\n .table {\n grid-area: table;\n background: red;\n height: 100%;\n font-family: Raleway;\n }\n \n .buttons-container{\n background: white;\n width: max-content;\n padding: 8px;\n border: 1px solid ", ";\n box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);\n border-radius: 3px;\n position: absolute;\n top: -10%;\n left: 50px;\n z-index: 100;\n }\n\n .validation-button{\n width: 30px;\n height: 20px;\n display: flex;\n align-items: center;\n border: none;\n cursor: pointer;\n color: black;\n font-weight: 400;\n font-size: 13px;\n line-height: 18px;\n background-color: white;\n\n img {\n & + p {\n margin-left: 7px;\n }\n }\n\n &:hover {\n border-radius: 10px;\n }\n\n & + * {\n margin-top: 8px;\n }\n }\n\n .validation-option {\n width: 82px;\n height: 20px;\n display: flex;\n align-items: center;\n border: none;\n cursor: pointer;\n color: black;\n font-weight: 400;\n font-size: 13px;\n line-height: 18px;\n background-color: white;\n left: 7px;\n\n img {\n & + p {\n margin-left: 7px;\n }\n }\n\n &:hover {\n border-radius: 10px;\n }\n\n & + * {\n margin-top: 8px;\n }\n }\n\n td{\n margin:0;\n }\n \n textarea {\n width: 100%;\n border: 1px solid\n ", ";\n\n font-family: ", ";\n color: ", ";\n font-weight: normal;\n font-size: 12px;\n line-height: 15px;\n padding: 10px;\n outline: none;\n border-radius: 2px;\n resize: none;\n\n &:focus {\n border: 1px solid ", ";\n }\n }\n\n input{\n \n }\n"])), _variables.GlobalColors.s3, function (_ref) {
|
|
19
19
|
var isRequired = _ref.isRequired;
|
|
20
20
|
return isRequired ? "red" : "".concat(_variables.GlobalColors.s2);
|
|
21
21
|
}, _variables.FontFamily.AvenirNext, _variables.GlobalColors.deep_gray, _variables.GlobalColors.magenta_s2);
|
|
@@ -250,7 +250,7 @@ function _initData() {
|
|
|
250
250
|
return _initData.apply(this, arguments);
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
function setDataColumns(section, dataService, token, setModalFromTable, setDataServices, setModal, setShowValidationPanel, setAttributeSelected, setShowRejectModal, setAttributesReviewed, setMessage, showValidationPanel, attributeSelected, attributesReviewed) {
|
|
253
|
+
function setDataColumns(section, dataService, token, setModalFromTable, setDataServices, setModal, setShowValidationPanel, setAttributeSelected, setShowRejectModal, setAttributesReviewed, setMessage, showValidationPanel, attributeSelected, attributesReviewed, descriptionsReviewed, imagesReviewed) {
|
|
254
254
|
var data = dataService.data,
|
|
255
255
|
rules = dataService.rules;
|
|
256
256
|
var columns = [].concat(columnsBase);
|
|
@@ -293,8 +293,13 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
293
293
|
columns.push({
|
|
294
294
|
Header: "Cadena",
|
|
295
295
|
accessor: "retailer".concat(ret.id),
|
|
296
|
-
width: "100px"
|
|
297
|
-
|
|
296
|
+
width: "100px"
|
|
297
|
+
});
|
|
298
|
+
columns.push({
|
|
299
|
+
Header: "",
|
|
300
|
+
accessor: "retailer".concat(ret.id, "-save"),
|
|
301
|
+
width: "60px",
|
|
302
|
+
style: styleSaveButtonCol
|
|
298
303
|
});
|
|
299
304
|
}
|
|
300
305
|
|
|
@@ -307,13 +312,56 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
307
312
|
columns.push({
|
|
308
313
|
Header: rules[imgId],
|
|
309
314
|
accessor: "img".concat(imgId),
|
|
310
|
-
width: "
|
|
315
|
+
width: "170px",
|
|
311
316
|
style: styleData
|
|
312
317
|
});
|
|
313
318
|
}
|
|
314
319
|
});
|
|
320
|
+
var saveAvailable = imagesReviewed.filter(function (e) {
|
|
321
|
+
return e.articleId === item.id;
|
|
322
|
+
}).every(function (e) {
|
|
323
|
+
return e.isReviewed === true;
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
if (imagesReviewed.filter(function (e) {
|
|
327
|
+
return e.articleId === item.id;
|
|
328
|
+
}).length == 0) {
|
|
329
|
+
saveAvailable = false;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
currentData["retailer".concat(ret.id, "-save")] = /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
333
|
+
onClick: function onClick() {
|
|
334
|
+
var articlesImagesUpdateBody = [];
|
|
335
|
+
var articleImages = imagesReviewed.filter(function (e) {
|
|
336
|
+
return e.articleId === item.id && e.versionId === item.version;
|
|
337
|
+
});
|
|
338
|
+
articleImages.forEach(function (articleImage) {
|
|
339
|
+
articlesImagesUpdateBody.push({
|
|
340
|
+
articleId: articleImage.articleId,
|
|
341
|
+
versionId: articleImage.versionId,
|
|
342
|
+
attributeId: articleImage.imageId,
|
|
343
|
+
value: articleImage.srcdb,
|
|
344
|
+
isApproved: articleImage.isApproved,
|
|
345
|
+
comment: articleImage.comment
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
console.log(articlesImagesUpdateBody);
|
|
349
|
+
updateArticleData(item.version, item.id, articlesImagesUpdateBody, token, setMessage, section);
|
|
350
|
+
},
|
|
351
|
+
className: "validation-option",
|
|
352
|
+
disabled: !saveAvailable,
|
|
353
|
+
children: [saveAvailable && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
354
|
+
src: _saveWhite.default,
|
|
355
|
+
alt: "guardar"
|
|
356
|
+
}), " ", !saveAvailable && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
357
|
+
src: _saveWhiteGray.default,
|
|
358
|
+
alt: "guardar"
|
|
359
|
+
}), " "]
|
|
360
|
+
});
|
|
361
|
+
console.log(images);
|
|
315
362
|
Object.values(images).forEach(function (_ref) {
|
|
316
363
|
var value = _ref.value,
|
|
364
|
+
isApproved = _ref.isApproved,
|
|
317
365
|
imageId = _ref.imageId;
|
|
318
366
|
var props = {
|
|
319
367
|
name: rules[imageId],
|
|
@@ -325,7 +373,78 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
325
373
|
setModal: setModal,
|
|
326
374
|
token: token
|
|
327
375
|
};
|
|
328
|
-
|
|
376
|
+
if (!imagesReviewed.find(function (e) {
|
|
377
|
+
return e.articleId == item.id && e.imageId == imageId && e.versionId == item.version;
|
|
378
|
+
})) imagesReviewed.push({
|
|
379
|
+
articleId: item.id,
|
|
380
|
+
imageId: imageId,
|
|
381
|
+
versionId: item.version,
|
|
382
|
+
isApproved: isApproved ? isApproved : false,
|
|
383
|
+
isReviewed: isApproved != null ? true : false,
|
|
384
|
+
comment: "",
|
|
385
|
+
srcdb: value ? value.src : ""
|
|
386
|
+
});
|
|
387
|
+
var index = imagesReviewed.findIndex(function (e) {
|
|
388
|
+
return e.articleId === item.id && e.imageId === imageId && e.versionId === item.version;
|
|
389
|
+
});
|
|
390
|
+
currentData["img".concat(imageId)] = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
391
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
392
|
+
onClick: function onClick() {
|
|
393
|
+
setShowValidationPanel(true);
|
|
394
|
+
setAttributeSelected({
|
|
395
|
+
articleId: item.id,
|
|
396
|
+
attributeId: imageId,
|
|
397
|
+
versionId: item.version
|
|
398
|
+
});
|
|
399
|
+
},
|
|
400
|
+
className: "validation-button",
|
|
401
|
+
children: [imagesReviewed[index].isReviewed && imagesReviewed[index].isApproved && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
402
|
+
id: "button_" + item.id + "_" + imageId + "_" + item.version,
|
|
403
|
+
src: _acceptIcon.default,
|
|
404
|
+
alt: "accept button"
|
|
405
|
+
}), " ", imagesReviewed[index].isReviewed && !imagesReviewed[index].isApproved && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
406
|
+
id: "button_" + item.id + "_" + imageId + "_" + item.version,
|
|
407
|
+
src: _rejectIcon.default,
|
|
408
|
+
alt: "reject button"
|
|
409
|
+
}), " ", !imagesReviewed[index].isReviewed && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
410
|
+
id: "button_" + item.id + "_" + imageId + "_" + item.version,
|
|
411
|
+
src: _rejectIcon.default,
|
|
412
|
+
alt: "reject button"
|
|
413
|
+
})]
|
|
414
|
+
}), " ", showValidationPanel && attributeSelected.articleId === item.id && attributeSelected.attributeId === imageId && attributeSelected.versionId === item.version && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
415
|
+
className: "buttons-container",
|
|
416
|
+
style: {
|
|
417
|
+
left: "70px"
|
|
418
|
+
},
|
|
419
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
420
|
+
onClick: function onClick() {
|
|
421
|
+
imagesReviewed[index].isApproved = true;
|
|
422
|
+
imagesReviewed[index].isReviewed = true; //document.getElementById(item.id+'_'+des.attributeId+'_'+item.version).style.borderColor="#71DE56";
|
|
423
|
+
|
|
424
|
+
setShowValidationPanel(false);
|
|
425
|
+
},
|
|
426
|
+
className: "validation-option",
|
|
427
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
428
|
+
src: _acceptIcon.default,
|
|
429
|
+
alt: "accept button"
|
|
430
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
431
|
+
children: " Validar "
|
|
432
|
+
}), " "]
|
|
433
|
+
}), " ", /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
434
|
+
onClick: function onClick() {
|
|
435
|
+
setShowValidationPanel(false);
|
|
436
|
+
setShowRejectModal(true);
|
|
437
|
+
},
|
|
438
|
+
className: "validation-option",
|
|
439
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
440
|
+
src: _rejectIcon.default,
|
|
441
|
+
alt: "reject button"
|
|
442
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
443
|
+
children: " Rechazar "
|
|
444
|
+
}), " "]
|
|
445
|
+
}), " "]
|
|
446
|
+
}), " ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageVisor.ImageVisor, (0, _objectSpread3.default)({}, props))]
|
|
447
|
+
});
|
|
329
448
|
});
|
|
330
449
|
});
|
|
331
450
|
}
|
|
@@ -379,7 +498,7 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
379
498
|
comment: articleAttribute.comment
|
|
380
499
|
});
|
|
381
500
|
});
|
|
382
|
-
updateArticleData(item.version, item.id, articlesAtributesUpdateBody, token, setMessage);
|
|
501
|
+
updateArticleData(item.version, item.id, articlesAtributesUpdateBody, token, setMessage, section);
|
|
383
502
|
},
|
|
384
503
|
className: "validation-option",
|
|
385
504
|
disabled: !saveAvailable,
|
|
@@ -431,7 +550,7 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
431
550
|
versionId: item.version
|
|
432
551
|
});
|
|
433
552
|
},
|
|
434
|
-
className: "validation-
|
|
553
|
+
className: "validation-button",
|
|
435
554
|
children: [attributesReviewed[index].isReviewed && attributesReviewed[index].isApproved && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
436
555
|
id: "button_" + item.id + "_" + des.attributeId + "_" + item.version,
|
|
437
556
|
src: _acceptIcon.default,
|
|
@@ -447,6 +566,9 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
447
566
|
})]
|
|
448
567
|
}), " ", showValidationPanel && attributeSelected.articleId === item.id && attributeSelected.attributeId === des.attributeId && attributeSelected.versionId === item.version && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
449
568
|
className: "buttons-container",
|
|
569
|
+
style: {
|
|
570
|
+
left: "35px"
|
|
571
|
+
},
|
|
450
572
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
451
573
|
onClick: function onClick() {
|
|
452
574
|
attributesReviewed[index].isApproved = true;
|
|
@@ -487,9 +609,26 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
487
609
|
columns.push({
|
|
488
610
|
Header: "Cadena",
|
|
489
611
|
accessor: "retailer".concat(ret.id),
|
|
490
|
-
width: "100px"
|
|
491
|
-
style: styleRetailer
|
|
612
|
+
width: "100px"
|
|
492
613
|
});
|
|
614
|
+
columns.push({
|
|
615
|
+
Header: "",
|
|
616
|
+
accessor: "retailer".concat(ret.id, "-save"),
|
|
617
|
+
width: "60px",
|
|
618
|
+
style: styleSaveButtonCol
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
var saveAvailable = descriptionsReviewed.filter(function (e) {
|
|
623
|
+
return e.articleId === item.id;
|
|
624
|
+
}).every(function (e) {
|
|
625
|
+
return e.isReviewed === true;
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
if (descriptionsReviewed.filter(function (e) {
|
|
629
|
+
return e.articleId === item.id;
|
|
630
|
+
}).length == 0) {
|
|
631
|
+
saveAvailable = false;
|
|
493
632
|
}
|
|
494
633
|
|
|
495
634
|
currentData["retailer".concat(ret.id)] = /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
@@ -506,16 +645,115 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
506
645
|
});
|
|
507
646
|
}
|
|
508
647
|
});
|
|
648
|
+
currentData["retailer".concat(ret.id, "-save")] = /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
649
|
+
onClick: function onClick() {
|
|
650
|
+
var articlesDescriptionsUpdateBody = [];
|
|
651
|
+
var articleDescriptions = descriptionsReviewed.filter(function (e) {
|
|
652
|
+
return e.articleId === item.id && e.versionId === item.version;
|
|
653
|
+
});
|
|
654
|
+
articleDescriptions.forEach(function (articleDescription) {
|
|
655
|
+
var value = document.getElementById(articleDescription.articleId + "_" + articleDescription.attributeId + "_" + articleDescription.versionId).value;
|
|
656
|
+
articlesDescriptionsUpdateBody.push({
|
|
657
|
+
articleId: articleDescription.articleId,
|
|
658
|
+
versionId: articleDescription.versionId,
|
|
659
|
+
attributeId: articleDescription.attributeId,
|
|
660
|
+
value: value ? value : "",
|
|
661
|
+
isApproved: articleDescription.isApproved,
|
|
662
|
+
comment: articleDescription.comment
|
|
663
|
+
});
|
|
664
|
+
});
|
|
665
|
+
updateArticleData(item.version, item.id, articlesDescriptionsUpdateBody, token, setMessage, section);
|
|
666
|
+
},
|
|
667
|
+
className: "validation-option",
|
|
668
|
+
disabled: !saveAvailable,
|
|
669
|
+
children: [saveAvailable && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
670
|
+
src: _saveWhite.default,
|
|
671
|
+
alt: "guardar"
|
|
672
|
+
}), " ", !saveAvailable && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
673
|
+
src: _saveWhiteGray.default,
|
|
674
|
+
alt: "guardar"
|
|
675
|
+
}), " "]
|
|
676
|
+
});
|
|
509
677
|
Object.values(item.descriptions).forEach(function (des) {
|
|
678
|
+
console.log(des);
|
|
510
679
|
var props = {
|
|
511
680
|
name: rules[des.attributeId],
|
|
681
|
+
id: item.id + "_" + des.attributeId + "_" + item.version,
|
|
512
682
|
value: des.value,
|
|
513
683
|
cols: 30,
|
|
514
684
|
rows: 2,
|
|
515
|
-
|
|
685
|
+
readonly: true
|
|
516
686
|
};
|
|
687
|
+
if (!descriptionsReviewed.find(function (e) {
|
|
688
|
+
return e.articleId == item.id && e.attributeId == des.attributeId && e.versionId == item.version;
|
|
689
|
+
})) descriptionsReviewed.push({
|
|
690
|
+
articleId: item.id,
|
|
691
|
+
attributeId: des.attributeId,
|
|
692
|
+
versionId: item.version,
|
|
693
|
+
isApproved: des.isApproved ? des.isApproved : false,
|
|
694
|
+
isReviewed: des.isApproved != null ? true : false,
|
|
695
|
+
comment: ""
|
|
696
|
+
});
|
|
697
|
+
var index = descriptionsReviewed.findIndex(function (e) {
|
|
698
|
+
return e.articleId === item.id && e.attributeId === des.attributeId && e.versionId === item.version;
|
|
699
|
+
});
|
|
517
700
|
currentData["".concat(des.attributeId)] = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
518
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
701
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
702
|
+
onClick: function onClick() {
|
|
703
|
+
setShowValidationPanel(true);
|
|
704
|
+
setAttributeSelected({
|
|
705
|
+
articleId: item.id,
|
|
706
|
+
attributeId: des.attributeId,
|
|
707
|
+
versionId: item.version
|
|
708
|
+
});
|
|
709
|
+
},
|
|
710
|
+
className: "validation-button",
|
|
711
|
+
children: [descriptionsReviewed[index].isReviewed && descriptionsReviewed[index].isApproved && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
712
|
+
id: "button_" + item.id + "_" + des.attributeId + "_" + item.version,
|
|
713
|
+
src: _acceptIcon.default,
|
|
714
|
+
alt: "accept button"
|
|
715
|
+
}), " ", descriptionsReviewed[index].isReviewed && !descriptionsReviewed[index].isApproved && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
716
|
+
id: "button_" + item.id + "_" + des.attributeId + "_" + item.version,
|
|
717
|
+
src: _rejectIcon.default,
|
|
718
|
+
alt: "reject button"
|
|
719
|
+
}), " ", typeof des.isApproved === "undefined" && !descriptionsReviewed[index].isReviewed && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
720
|
+
id: "button_" + item.id + "_" + des.attributeId + "_" + item.version,
|
|
721
|
+
src: _rejectIcon.default,
|
|
722
|
+
alt: "reject button"
|
|
723
|
+
})]
|
|
724
|
+
}), " ", showValidationPanel && attributeSelected.articleId === item.id && attributeSelected.attributeId === des.attributeId && attributeSelected.versionId === item.version && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
725
|
+
className: "buttons-container",
|
|
726
|
+
style: {
|
|
727
|
+
left: "35px"
|
|
728
|
+
},
|
|
729
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
730
|
+
onClick: function onClick() {
|
|
731
|
+
descriptionsReviewed[index].isApproved = true;
|
|
732
|
+
descriptionsReviewed[index].isReviewed = true; //document.getElementById(item.id+'_'+des.attributeId+'_'+item.version).style.borderColor="#71DE56";
|
|
733
|
+
|
|
734
|
+
setShowValidationPanel(false);
|
|
735
|
+
},
|
|
736
|
+
className: "validation-option",
|
|
737
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
738
|
+
src: _acceptIcon.default,
|
|
739
|
+
alt: "accept button"
|
|
740
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
741
|
+
children: " Validar "
|
|
742
|
+
}), " "]
|
|
743
|
+
}), " ", /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
744
|
+
onClick: function onClick() {
|
|
745
|
+
setShowValidationPanel(false);
|
|
746
|
+
setShowRejectModal(true);
|
|
747
|
+
},
|
|
748
|
+
className: "validation-option",
|
|
749
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
750
|
+
src: _rejectIcon.default,
|
|
751
|
+
alt: "reject button"
|
|
752
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
753
|
+
children: " Rechazar "
|
|
754
|
+
}), " "]
|
|
755
|
+
}), " "]
|
|
756
|
+
}), " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", (0, _objectSpread3.default)((0, _objectSpread3.default)({}, props), {}, {
|
|
519
757
|
children: " "
|
|
520
758
|
})), " "]
|
|
521
759
|
});
|
|
@@ -618,7 +856,7 @@ function modalReducer(state, action) {
|
|
|
618
856
|
return state;
|
|
619
857
|
}
|
|
620
858
|
|
|
621
|
-
function updateArticleData(_x9, _x10, _x11, _x12, _x13) {
|
|
859
|
+
function updateArticleData(_x9, _x10, _x11, _x12, _x13, _x14) {
|
|
622
860
|
return _updateArticleData.apply(this, arguments);
|
|
623
861
|
}
|
|
624
862
|
/**
|
|
@@ -652,46 +890,68 @@ function updateArticleData(_x9, _x10, _x11, _x12, _x13) {
|
|
|
652
890
|
|
|
653
891
|
|
|
654
892
|
function _updateArticleData() {
|
|
655
|
-
_updateArticleData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(version, articleId, attributes, token, setMessage) {
|
|
893
|
+
_updateArticleData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(version, articleId, attributes, token, setMessage, section) {
|
|
656
894
|
var body, params, res;
|
|
657
895
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
658
896
|
while (1) {
|
|
659
897
|
switch (_context5.prev = _context5.next) {
|
|
660
898
|
case 0:
|
|
661
|
-
body = {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
899
|
+
body = {};
|
|
900
|
+
params = "";
|
|
901
|
+
|
|
902
|
+
if (section != "images") {
|
|
903
|
+
body = {
|
|
904
|
+
articleId: articleId,
|
|
905
|
+
articleData: attributes
|
|
906
|
+
};
|
|
907
|
+
params = "?".concat(section, "=true&version=").concat(version);
|
|
908
|
+
} else {
|
|
909
|
+
body = {
|
|
910
|
+
articleId: articleId,
|
|
911
|
+
onboardingImagesData: attributes
|
|
912
|
+
};
|
|
913
|
+
params = "?image=true&version=".concat(version);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
console.log(params);
|
|
917
|
+
console.log(body);
|
|
918
|
+
_context5.prev = 5;
|
|
919
|
+
_context5.next = 8;
|
|
668
920
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT) + params, body, {
|
|
669
921
|
headers: {
|
|
670
922
|
Authorization: token
|
|
671
923
|
}
|
|
672
924
|
});
|
|
673
925
|
|
|
674
|
-
case
|
|
926
|
+
case 8:
|
|
675
927
|
res = _context5.sent;
|
|
676
928
|
|
|
677
|
-
if (res.data.statusCode === 200) {
|
|
678
|
-
setMessage("
|
|
929
|
+
if (res.data.statusCode === 200 && section == "description") {
|
|
930
|
+
setMessage("Descripciones de los productos guardados con éxito");
|
|
679
931
|
}
|
|
680
932
|
|
|
681
|
-
|
|
933
|
+
if (res.data.statusCode === 200 && section == "datasheet") {
|
|
934
|
+
setMessage("Atributos de los productos guardados con éxito");
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
if (res.data.statusCode === 200 && section == "images") {
|
|
938
|
+
setMessage("Imágenes de los productos guardados con éxito");
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
_context5.next = 17;
|
|
682
942
|
break;
|
|
683
943
|
|
|
684
|
-
case
|
|
685
|
-
_context5.prev =
|
|
686
|
-
_context5.t0 = _context5["catch"](
|
|
944
|
+
case 14:
|
|
945
|
+
_context5.prev = 14;
|
|
946
|
+
_context5.t0 = _context5["catch"](5);
|
|
687
947
|
console.log(_context5.t0);
|
|
688
948
|
|
|
689
|
-
case
|
|
949
|
+
case 17:
|
|
690
950
|
case "end":
|
|
691
951
|
return _context5.stop();
|
|
692
952
|
}
|
|
693
953
|
}
|
|
694
|
-
}, _callee5, null, [[
|
|
954
|
+
}, _callee5, null, [[5, 14]]);
|
|
695
955
|
}));
|
|
696
956
|
return _updateArticleData.apply(this, arguments);
|
|
697
957
|
}
|