contentoh-components-library 21.5.19 → 21.5.21
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/atoms/UserSelector/UserSelector.stories.js +1 -1
- package/dist/components/atoms/UserSelector/index.js +4 -2
- package/dist/components/molecules/RowItem/styles.js +1 -1
- package/dist/components/molecules/StatusAsignationInfo/FinancedCompanies.js +1 -1
- package/dist/components/organisms/GridProducts/GridProducts.stories.js +102 -615
- package/dist/components/organisms/GridProducts/index.js +2 -2
- package/dist/components/organisms/InputGroup/index.js +30 -30
- package/dist/components/organisms/Table/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/MultipleEdition.stories.js +1 -1
- package/dist/components/pages/MultipleEdition/saveData.js +19 -9
- package/dist/components/pages/MultipleEdition/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/utils.js +153 -61
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +75 -72
- package/dist/components/pages/RetailerProductEdition/index.js +63 -19
- package/package.json +1 -1
- package/src/components/atoms/UserSelector/UserSelector.stories.js +1 -1
- package/src/components/atoms/UserSelector/index.js +7 -1
- package/src/components/molecules/RowItem/styles.js +1 -0
- package/src/components/molecules/StatusAsignationInfo/FinancedCompanies.js +43 -501
- package/src/components/molecules/StatusAsignationInfo/index.js +2 -3
- package/src/components/organisms/GridProducts/GridProducts.stories.js +107 -682
- package/src/components/organisms/GridProducts/index.js +2 -2
- package/src/components/organisms/InputGroup/index.js +47 -62
- package/src/components/organisms/Table/styles.js +5 -1
- package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +1 -1
- package/src/components/pages/MultipleEdition/saveData.js +6 -7
- package/src/components/pages/MultipleEdition/styles.js +1 -7
- package/src/components/pages/MultipleEdition/utils.js +24 -47
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +79 -72
- package/src/components/pages/RetailerProductEdition/index.js +93 -29
|
@@ -30,7 +30,7 @@ var GridProducts = function GridProducts(_ref) {
|
|
|
30
30
|
chkCheckedAll = _ref.chkCheckedAll,
|
|
31
31
|
onGridClick = _ref.onGridClick;
|
|
32
32
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
33
|
-
children:
|
|
33
|
+
children: gridView ? products === null || products === void 0 ? void 0 : products.map(function (_ref2, i) {
|
|
34
34
|
var gridElement = _ref2.gridElement,
|
|
35
35
|
product = _ref2.product,
|
|
36
36
|
id = _ref2.id;
|
|
@@ -40,7 +40,7 @@ var GridProducts = function GridProducts(_ref) {
|
|
|
40
40
|
product: product,
|
|
41
41
|
gridElement: gridElement,
|
|
42
42
|
chkOnChange: chkOnChange,
|
|
43
|
-
onGridClick: onGridClick,
|
|
43
|
+
onGridClick: gridView ? null : onGridClick,
|
|
44
44
|
selected: selected,
|
|
45
45
|
chkChecked: chkChecked
|
|
46
46
|
}, i);
|
|
@@ -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, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10,
|
|
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;
|
|
193
193
|
|
|
194
194
|
return activeSection === "Ficha técnica" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
195
|
-
children: [
|
|
195
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
|
|
196
196
|
//disabled={input === 40001}
|
|
197
|
-
disabled: (_dataInputs$
|
|
198
|
-
inputId: (_dataInputs$
|
|
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,
|
|
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$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,
|
|
203
203
|
inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
|
|
204
204
|
articleId: articleId,
|
|
205
|
-
isRequired: (_dataInputs$
|
|
205
|
+
isRequired: (_dataInputs$input9 = dataInputs[input]) === null || _dataInputs$input9 === void 0 ? void 0 : _dataInputs$input9.required,
|
|
206
206
|
updatedDatasheets: updatedDatasheets,
|
|
207
207
|
setUpdatedDatasheets: setUpdatedDatasheets,
|
|
208
|
-
maxChar: (_dataInputs$
|
|
209
|
-
optionList: (_dataInputs$
|
|
210
|
-
description: (_dataInputs$
|
|
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,
|
|
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$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,
|
|
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
|
|
238
|
+
disabled: 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$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;
|
|
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$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,
|
|
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$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,
|
|
272
272
|
inputPlaceHolder: input === null || input === void 0 ? void 0 : input.placeholder,
|
|
273
273
|
articleId: articleId,
|
|
274
|
-
isRequired: (_dataInputs$
|
|
274
|
+
isRequired: (_dataInputs$input26 = dataInputs[input]) === null || _dataInputs$input26 === void 0 ? void 0 : _dataInputs$input26.required,
|
|
275
275
|
updatedDatasheets: updatedDatasheets,
|
|
276
276
|
setUpdatedDatasheets: setUpdatedDatasheets,
|
|
277
|
-
maxChar: (_dataInputs$
|
|
278
|
-
optionList: (_dataInputs$
|
|
279
|
-
description: (_dataInputs$
|
|
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,
|
|
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$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,
|
|
289
289
|
handleImgClick: handleImgClick,
|
|
290
290
|
changeImageBtn: changeImageBtn,
|
|
291
291
|
showDivState: showDivStates,
|
|
@@ -15,7 +15,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
15
15
|
|
|
16
16
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: #fff;\n box-sizing: border-box;\n height: 100%;\n overflow-x: auto;\n width: 100%;\n margin-right: 30px;\n .checkbox_fixed {\n left: 0px;\n position: sticky;\n z-index: 5;\n }\n\n .custom-table {\n border-collapse: collapse;\n box-sizing: border-box;\n width: 100%;\n & > thead {\n top: 0;\n height: 45px;\n position: sticky;\n z-index:
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: #fff;\n box-sizing: border-box;\n height: 100%;\n overflow-x: auto;\n width: 100%;\n margin-right: 30px;\n .checkbox_fixed {\n left: 0px;\n position: sticky;\n z-index: 5;\n }\n\n .custom-table {\n border-collapse: collapse;\n box-sizing: border-box;\n width: 100%;\n & > thead {\n top: 0;\n height: 45px;\n position: sticky;\n z-index: 6;\n & > tr {\n background-color: #f7f7fc;\n border-radius: 5px 5px 0px 0px;\n height: 45px;\n }\n }\n & > tbody {\n position:absolute;\n z-index:7;\n }\n & > tbody > tr {\n height: 70px;\n &:last-child {\n border-radius: 0px 0px 5px 5px;\n }\n }\n }\n\n .custom-table th,\n .custom-table td {\n padding: 8px;\n border: 0;\n }\n\n .custom-table th {\n border-radius: 5px 0 0 5px;\n border: 0;\n color: var(--black-main, #262626);\n font-family: Roboto;\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n text-align: left;\n }\n\n .custom-table tr {\n background: var(--white-main, #fff);\n border-bottom: 1px solid var(--grey-light, #f0f0f0);\n border-left: 1px solid var(--grey-light, #f0f0f0);\n border-right: 1px solid var(--grey-light, #f0f0f0);\n & > td {\n color: var(--grey-main, #707070);\n font-family: Roboto;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n gap:5px;\n }\n display: flex;\n align-items: center;\n ", "\n }\n"])), function (_ref) {
|
|
19
19
|
var withCheckbox = _ref.withCheckbox;
|
|
20
20
|
return withCheckbox && "padding-left: 10px;";
|
|
21
21
|
});
|
|
@@ -30,6 +30,6 @@ MultipleEditionDefault.args = {
|
|
|
30
30
|
//[216, 238, 239],
|
|
31
31
|
versions: [1],
|
|
32
32
|
//token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxZmFjNjY2Ny1hMDMzLTQ1NjAtOWU5ZC01MTQwMDc2MmI2MWYiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjFmYWM2NjY3LWEwMzMtNDU2MC05ZTlkLTUxNDAwNzYyYjYxZiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJjM2FlNjRiMC0yNDcxLTQ1MmQtOGExYi04OGFkNWIxNjRjOWQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZ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34
|
|
|
35
35
|
};
|
|
@@ -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;
|
|
8
9
|
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, callbackToInitData, setModal;
|
|
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, callbackToInitData = params.callbackToInitData, setModal = params.setModal;
|
|
52
52
|
|
|
53
53
|
if (!(section === "images")) {
|
|
54
|
-
_context.next =
|
|
54
|
+
_context.next = 7;
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -60,14 +60,25 @@ function _saveData() {
|
|
|
60
60
|
|
|
61
61
|
case 4:
|
|
62
62
|
if (!_context.sent) {
|
|
63
|
-
_context.next =
|
|
63
|
+
_context.next = 7;
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
69
77
|
|
|
70
|
-
case
|
|
78
|
+
case 7:
|
|
79
|
+
return _context.abrupt("return", false);
|
|
80
|
+
|
|
81
|
+
case 8:
|
|
71
82
|
case "end":
|
|
72
83
|
return _context.stop();
|
|
73
84
|
}
|
|
@@ -92,7 +103,6 @@ function _saveImagesData() {
|
|
|
92
103
|
articles.data.forEach(function (article) {
|
|
93
104
|
var images = article.images,
|
|
94
105
|
version = article.version;
|
|
95
|
-
console.log(images);
|
|
96
106
|
var imagesToAdd = Object.values(images).filter(function (f) {
|
|
97
107
|
return f.value && !f.value.src.startsWith("id-");
|
|
98
108
|
});
|
|
@@ -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 display: flex;\n flex-direction: column;\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: 0;\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 margin-right:5px;\n img {\n & + p {\n margin-left: 7px;\n }\n }\n\n &:hover {\n border-radius: 10px;\n }\n }\n\n .validation-option {\n display: flex;\n width: 82px;\n height: 20px;\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
|
|
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 display: flex;\n flex-direction: column;\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: 0;\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 margin-right:5px;\n img {\n & + p {\n margin-left: 7px;\n }\n }\n\n &:hover {\n border-radius: 10px;\n }\n }\n\n .validation-option {\n display: flex;\n width: 82px;\n height: 20px;\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: 5px;\n resize: none;\n\n &:focus {\n border: 1px solid ", ";\n }\n }\n\n .general-input {\n width: 100%;\n height:27px;\n max-height:100px;\n }\n\n .select-edition-multiple {\n padding: 5px 10px;\n border-radius: 5px;\n gap: 10px;\n border:1px solid ", ";\n border-width: 1px 2px 1px 1px;\n outline: none;\n border-image: initial;\n width: 100%;\n min-height:27px;\n cursor: pointer;\n color: ", ";\n font-size: 12px;\n line-height: 21px;\n overflow:hidden; \n white-space:nowrap; \n text-overflow:ellipsis;\n :focus{\n border:1px solid ", ";\n }\n }\n\n .tooltip {\n position: relative;\n display: inline-block;\n }\n \n .tooltiptext {\n visibility: hidden;\n width: 200px;\n background-color: #ffffff;\n color: #000000;\n text-align: center;\n border-radius: 6px;\n position: absolute;\n z-index: 6!important;\n bottom: 100%;\n left: 20%;\n margin-left: -80px;\n opacity: 0;\n transition: opacity 0.3s;\n box-shadow: 0px 2px 4px 0px #00000040;\n font-family: Roboto;\n font-size: 12px;\n padding: 10px;\n text-align: justify;\n }\n \n\n \n .tooltip:hover .tooltiptext {\n visibility: visible;\n opacity: 1;\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, _variables.GlobalColors.gray_light, _variables.GlobalColors.deep_gray, _variables.GlobalColors.magenta_s2);
|
|
@@ -154,8 +154,7 @@ function dataReducer(state, action) {
|
|
|
154
154
|
|
|
155
155
|
var _action$payload = action.payload,
|
|
156
156
|
articleId = _action$payload.articleId,
|
|
157
|
-
imageId = _action$payload.imageId
|
|
158
|
-
token = _action$payload.token;
|
|
157
|
+
imageId = _action$payload.imageId;
|
|
159
158
|
var newImageData = state.images.data.slice();
|
|
160
159
|
var articleIndex = newImageData.findIndex(function (f) {
|
|
161
160
|
return f.id === articleId;
|
|
@@ -164,14 +163,6 @@ function dataReducer(state, action) {
|
|
|
164
163
|
newImageData[articleIndex].images[imageId].value = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, action.payload), {}, {
|
|
165
164
|
id: id
|
|
166
165
|
});
|
|
167
|
-
var data = newImageData;
|
|
168
|
-
(0, _saveData.saveData)({
|
|
169
|
-
section: "images",
|
|
170
|
-
data: {
|
|
171
|
-
data: data
|
|
172
|
-
},
|
|
173
|
-
token: token
|
|
174
|
-
});
|
|
175
166
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state), {}, {
|
|
176
167
|
images: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state.images), {}, {
|
|
177
168
|
data: newImageData
|
|
@@ -185,7 +176,7 @@ function dataReducer(state, action) {
|
|
|
185
176
|
var _action$payload2 = action.payload,
|
|
186
177
|
_articleId = _action$payload2.articleId,
|
|
187
178
|
_imageId = _action$payload2.imageId,
|
|
188
|
-
|
|
179
|
+
token = _action$payload2.token;
|
|
189
180
|
|
|
190
181
|
var _newImageData = state.images.data.slice();
|
|
191
182
|
|
|
@@ -196,13 +187,14 @@ function dataReducer(state, action) {
|
|
|
196
187
|
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;
|
|
197
188
|
|
|
198
189
|
(_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;
|
|
199
|
-
|
|
190
|
+
console.log(_newImageData[_articleIndex]);
|
|
191
|
+
var data = {
|
|
200
192
|
articleId: _articleId,
|
|
201
193
|
deleteImages: [{
|
|
202
194
|
id: _id
|
|
203
195
|
}]
|
|
204
196
|
};
|
|
205
|
-
(0, _saveData.deleteImage)(
|
|
197
|
+
(0, _saveData.deleteImage)(data, _newImageData[_articleIndex].version, token);
|
|
206
198
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state), {}, {
|
|
207
199
|
images: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state.images), {}, {
|
|
208
200
|
data: _newImageData
|
|
@@ -286,13 +278,6 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
286
278
|
display: "flex",
|
|
287
279
|
justifyContent: "center"
|
|
288
280
|
};
|
|
289
|
-
var styleApprovalAttributes = {
|
|
290
|
-
textAlign: "center",
|
|
291
|
-
display: "flex",
|
|
292
|
-
justifyContent: "center",
|
|
293
|
-
border: "1px solid #ECDD1D",
|
|
294
|
-
background: "#ECDD1D"
|
|
295
|
-
};
|
|
296
281
|
var retailersAdded = {
|
|
297
282
|
id: [],
|
|
298
283
|
attr: []
|
|
@@ -342,15 +327,17 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
342
327
|
});
|
|
343
328
|
}
|
|
344
329
|
});
|
|
345
|
-
var saveAvailable =
|
|
346
|
-
|
|
347
|
-
.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
) {
|
|
352
|
-
|
|
353
|
-
}
|
|
330
|
+
var saveAvailable = imagesReviewed.filter(function (e) {
|
|
331
|
+
return e.articleId === item.id;
|
|
332
|
+
}).every(function (e) {
|
|
333
|
+
return e.isReviewed === true;
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
if (imagesReviewed.filter(function (e) {
|
|
337
|
+
return e.articleId === item.id;
|
|
338
|
+
}).length == 0) {
|
|
339
|
+
saveAvailable = false;
|
|
340
|
+
}
|
|
354
341
|
|
|
355
342
|
currentData["retailer".concat(ret.id, "-save")] = /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
356
343
|
onClick: function onClick() {
|
|
@@ -410,7 +397,62 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
410
397
|
return e.articleId === item.id && e.imageId === imageId && e.versionId === item.version;
|
|
411
398
|
});
|
|
412
399
|
currentData["img".concat(imageId)] = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
413
|
-
children: [
|
|
400
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
401
|
+
onClick: function onClick() {
|
|
402
|
+
setShowValidationPanel(true);
|
|
403
|
+
setAttributeSelected({
|
|
404
|
+
articleId: item.id,
|
|
405
|
+
attributeId: imageId,
|
|
406
|
+
versionId: item.version
|
|
407
|
+
});
|
|
408
|
+
},
|
|
409
|
+
className: "validation-button",
|
|
410
|
+
children: [imagesReviewed[index].isReviewed && imagesReviewed[index].isApproved && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
411
|
+
id: "button_" + item.id + "_" + imageId + "_" + item.version,
|
|
412
|
+
src: _acceptIcon.default,
|
|
413
|
+
alt: "accept button"
|
|
414
|
+
}), " ", imagesReviewed[index].isReviewed && !imagesReviewed[index].isApproved && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
415
|
+
id: "button_" + item.id + "_" + imageId + "_" + item.version,
|
|
416
|
+
src: _rejectIcon.default,
|
|
417
|
+
alt: "reject button"
|
|
418
|
+
}), " ", !imagesReviewed[index].isReviewed && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
419
|
+
id: "button_" + item.id + "_" + imageId + "_" + item.version,
|
|
420
|
+
src: _rejectIcon.default,
|
|
421
|
+
alt: "reject button"
|
|
422
|
+
})]
|
|
423
|
+
}), " ", showValidationPanel && attributeSelected.articleId === item.id && attributeSelected.attributeId === imageId && attributeSelected.versionId === item.version && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
424
|
+
className: "buttons-container",
|
|
425
|
+
style: {
|
|
426
|
+
left: "70px"
|
|
427
|
+
},
|
|
428
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
429
|
+
onClick: function onClick() {
|
|
430
|
+
imagesReviewed[index].isApproved = true;
|
|
431
|
+
imagesReviewed[index].isReviewed = true; //document.getElementById(item.id+'_'+des.attributeId+'_'+item.version).style.borderColor="#71DE56";
|
|
432
|
+
|
|
433
|
+
setShowValidationPanel(false);
|
|
434
|
+
},
|
|
435
|
+
className: "validation-option",
|
|
436
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
437
|
+
src: _acceptIcon.default,
|
|
438
|
+
alt: "accept button"
|
|
439
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
440
|
+
children: " Validar "
|
|
441
|
+
}), " "]
|
|
442
|
+
}), " ", /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
443
|
+
onClick: function onClick() {
|
|
444
|
+
setShowValidationPanel(false);
|
|
445
|
+
setShowRejectModal(true);
|
|
446
|
+
},
|
|
447
|
+
className: "validation-option",
|
|
448
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
449
|
+
src: _rejectIcon.default,
|
|
450
|
+
alt: "reject button"
|
|
451
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
452
|
+
children: " Rechazar "
|
|
453
|
+
}), " "]
|
|
454
|
+
}), " "]
|
|
455
|
+
}), " ", comment && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
414
456
|
class: "tooltip",
|
|
415
457
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageVisor.ImageVisor, (0, _objectSpread3.default)({}, props)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
416
458
|
class: "tooltiptext",
|
|
@@ -468,19 +510,13 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
468
510
|
var articleAttributes = attributesReviewed.filter(function (e) {
|
|
469
511
|
return e.articleId === item.id && e.versionId === item.version;
|
|
470
512
|
});
|
|
471
|
-
var value;
|
|
472
513
|
articleAttributes.forEach(function (articleAttribute) {
|
|
473
|
-
|
|
474
|
-
value = document.getElementById(articleAttribute.articleId + "_" + articleAttribute.attributeId + "_" + articleAttribute.versionId).checked;
|
|
475
|
-
} else {
|
|
476
|
-
value = document.getElementById(articleAttribute.articleId + "_" + articleAttribute.attributeId + "_" + articleAttribute.versionId).value;
|
|
477
|
-
}
|
|
478
|
-
|
|
514
|
+
var value = document.getElementById(articleAttribute.articleId + "_" + articleAttribute.attributeId + "_" + articleAttribute.versionId).value;
|
|
479
515
|
articlesAtributesUpdateBody.push({
|
|
480
516
|
articleId: articleAttribute.articleId,
|
|
481
517
|
versionId: articleAttribute.versionId,
|
|
482
518
|
attributeId: articleAttribute.attributeId,
|
|
483
|
-
value: value
|
|
519
|
+
value: value ? value : "",
|
|
484
520
|
isApproved: articleAttribute.isApproved,
|
|
485
521
|
comment: articleAttribute.comment
|
|
486
522
|
});
|
|
@@ -504,7 +540,7 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
504
540
|
Header: rules[attributeId].name,
|
|
505
541
|
accessor: "".concat(attributeId + "-" + ret.id),
|
|
506
542
|
width: "200px",
|
|
507
|
-
style:
|
|
543
|
+
style: styleData,
|
|
508
544
|
description: rules[attributeId].description
|
|
509
545
|
});
|
|
510
546
|
}
|
|
@@ -602,19 +638,19 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
602
638
|
id: "button_" + item.id + "_" + des.attributeId + "_" + item.version,
|
|
603
639
|
src: _acceptIcon.default,
|
|
604
640
|
alt: "accept button"
|
|
605
|
-
}), attributesReviewed[index].isReviewed && !attributesReviewed[index].isApproved &&
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
641
|
+
}), attributesReviewed[index].isReviewed && !attributesReviewed[index].isApproved && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
|
|
642
|
+
position: "topCenter",
|
|
643
|
+
componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
644
|
+
children: "Debes aprobar o rechazar para continuar"
|
|
645
|
+
}),
|
|
646
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
647
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
648
|
+
id: "button_" + item.id + "_" + des.attributeId + "_" + item.version,
|
|
649
|
+
src: _nullIcon.default,
|
|
650
|
+
alt: "null button"
|
|
651
|
+
})
|
|
614
652
|
})
|
|
615
|
-
})
|
|
616
|
-
/*</Tooltip>*/
|
|
617
|
-
, typeof des.isApproved === "undefined" && !attributesReviewed[index].isReviewed && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
|
|
653
|
+
}), typeof des.isApproved === "undefined" && !attributesReviewed[index].isReviewed && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
|
|
618
654
|
position: "topCenter",
|
|
619
655
|
componentTooltip: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
620
656
|
children: "Debes aprobar o rechazar para continuar"
|
|
@@ -696,15 +732,17 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
696
732
|
});
|
|
697
733
|
}
|
|
698
734
|
|
|
699
|
-
var saveAvailable =
|
|
700
|
-
|
|
701
|
-
.
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
) {
|
|
706
|
-
|
|
707
|
-
}
|
|
735
|
+
var saveAvailable = descriptionsReviewed.filter(function (e) {
|
|
736
|
+
return e.articleId === item.id;
|
|
737
|
+
}).every(function (e) {
|
|
738
|
+
return e.isReviewed === true;
|
|
739
|
+
});
|
|
740
|
+
|
|
741
|
+
if (descriptionsReviewed.filter(function (e) {
|
|
742
|
+
return e.articleId === item.id;
|
|
743
|
+
}).length == 0) {
|
|
744
|
+
saveAvailable = false;
|
|
745
|
+
}
|
|
708
746
|
|
|
709
747
|
currentData["retailer".concat(ret.id)] = /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
710
748
|
children: [" ", ret.name, " "]
|
|
@@ -772,7 +810,61 @@ function setDataColumns(section, dataService, token, setModalFromTable, setDataS
|
|
|
772
810
|
return e.articleId === item.id && e.attributeId === des.attributeId && e.versionId === item.version;
|
|
773
811
|
});
|
|
774
812
|
currentData["".concat(des.attributeId)] = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
775
|
-
children: [
|
|
813
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
814
|
+
onClick: function onClick() {
|
|
815
|
+
setShowValidationPanel(true);
|
|
816
|
+
setAttributeSelected({
|
|
817
|
+
articleId: item.id,
|
|
818
|
+
attributeId: des.attributeId,
|
|
819
|
+
versionId: item.version
|
|
820
|
+
});
|
|
821
|
+
},
|
|
822
|
+
className: "validation-button",
|
|
823
|
+
children: [descriptionsReviewed[index].isReviewed && descriptionsReviewed[index].isApproved && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
824
|
+
id: "button_" + item.id + "_" + des.attributeId + "_" + item.version,
|
|
825
|
+
src: _acceptIcon.default,
|
|
826
|
+
alt: "accept button"
|
|
827
|
+
}), " ", descriptionsReviewed[index].isReviewed && !descriptionsReviewed[index].isApproved && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
828
|
+
id: "button_" + item.id + "_" + des.attributeId + "_" + item.version,
|
|
829
|
+
src: _rejectIcon.default,
|
|
830
|
+
alt: "reject button"
|
|
831
|
+
}), " ", typeof des.isApproved === "undefined" && !descriptionsReviewed[index].isReviewed && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
832
|
+
id: "button_" + item.id + "_" + des.attributeId + "_" + item.version,
|
|
833
|
+
src: _rejectIcon.default,
|
|
834
|
+
alt: "reject button"
|
|
835
|
+
})]
|
|
836
|
+
}), " ", showValidationPanel && attributeSelected.articleId === item.id && attributeSelected.attributeId === des.attributeId && attributeSelected.versionId === item.version && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
837
|
+
className: "buttons-container",
|
|
838
|
+
style: {
|
|
839
|
+
left: "35px"
|
|
840
|
+
},
|
|
841
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
842
|
+
onClick: function onClick() {
|
|
843
|
+
descriptionsReviewed[index].isApproved = true;
|
|
844
|
+
descriptionsReviewed[index].isReviewed = true;
|
|
845
|
+
setShowValidationPanel(false);
|
|
846
|
+
},
|
|
847
|
+
className: "validation-option",
|
|
848
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
849
|
+
src: _acceptIcon.default,
|
|
850
|
+
alt: "accept button"
|
|
851
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
852
|
+
children: " Validar "
|
|
853
|
+
}), " "]
|
|
854
|
+
}), " ", /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
855
|
+
onClick: function onClick() {
|
|
856
|
+
setShowValidationPanel(false);
|
|
857
|
+
setShowRejectModal(true);
|
|
858
|
+
},
|
|
859
|
+
className: "validation-option",
|
|
860
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
861
|
+
src: _rejectIcon.default,
|
|
862
|
+
alt: "reject button"
|
|
863
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
864
|
+
children: " Rechazar "
|
|
865
|
+
}), " "]
|
|
866
|
+
}), " "]
|
|
867
|
+
}), " ", des.comment && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
776
868
|
class: "tooltip",
|
|
777
869
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", (0, _objectSpread3.default)({}, props)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
778
870
|
class: "tooltiptext",
|