contentoh-components-library 21.4.45 → 21.4.46
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/molecules/BoxAttribute/index.js +2 -2
- package/dist/components/organisms/Box/index.js +44 -7
- package/dist/components/organisms/BoxOnboarding/index.js +37 -48
- package/dist/components/organisms/InputGroup/index.js +17 -19
- package/dist/components/pages/ProviderProductEdition/index.js +34 -16
- package/package.json +1 -1
- package/src/components/molecules/BoxAttribute/index.js +2 -2
- package/src/components/organisms/Box/index.js +1 -3
- package/src/components/organisms/BoxOnboarding/index.js +17 -12
- package/src/components/organisms/InputGroup/index.js +2 -2
- package/src/components/pages/ProviderProductEdition/index.js +25 -4
- package/src/components/pages/ProviderProductEdition/out.json +0 -0
- package/dist/assets/images/Icons/delete.svg +0 -8
- package/dist/assets/images/Icons/edit.svg +0 -3
- package/dist/components/molecules/ButtonsAssignation/ButtonsAssignation.stories.js +0 -34
- package/dist/components/molecules/ButtonsAssignation/index.js +0 -142
- package/dist/components/molecules/ButtonsAssignation/styles.js +0 -20
- package/dist/components/molecules/ButtonsEdition/ButtonsEdition.stories.js +0 -34
- package/dist/components/molecules/ButtonsEdition/index.js +0 -182
- package/dist/components/molecules/ButtonsEdition/styles.js +0 -24
- package/dist/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +0 -64
- package/dist/components/molecules/ProductSkuStatus/index.js +0 -36
- package/dist/components/molecules/ProductSkuStatus/styles.js +0 -18
- package/dist/components/molecules/Validation/Validation.stories.js +0 -28
- package/dist/components/molecules/Validation/index.js +0 -77
- package/dist/components/molecules/Validation/styles.js +0 -18
- package/dist/components/organisms/BarButtons/BarButtons.stories.js +0 -30
- package/dist/components/organisms/BarButtons/index.js +0 -61
- package/dist/components/organisms/BarButtons/styles.js +0 -18
- package/dist/components/pages/ProviderProductEdition1/ProviderProductEdition.stories.js +0 -222
- package/dist/components/pages/ProviderProductEdition1/index.js +0 -2339
- package/dist/components/pages/ProviderProductEdition1/styles.js +0 -23
- package/src/components/organisms/BoxOnboarding/out.json +0 -1
|
@@ -47,9 +47,9 @@ var BoxAttribute = function BoxAttribute(props) {
|
|
|
47
47
|
result["box".concat(id)] = atributos[id];
|
|
48
48
|
return result;
|
|
49
49
|
}, {}); //escucha los cambios
|
|
50
|
+
// console.log(formattedData);
|
|
51
|
+
// console.log("atributos id", atributos[props.id]);
|
|
50
52
|
|
|
51
|
-
console.log(formattedData);
|
|
52
|
-
console.log("atributos id", atributos[props.id]);
|
|
53
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
54
54
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
55
55
|
id: id,
|
|
@@ -28,7 +28,9 @@ var _BoxButtons = require("../../molecules/BoxButtons");
|
|
|
28
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
29
|
|
|
30
30
|
var Box = function Box(_ref) {
|
|
31
|
-
var onChange = _ref.onChange
|
|
31
|
+
var onChange = _ref.onChange,
|
|
32
|
+
dataInputs = _ref.dataInputs,
|
|
33
|
+
inputGroup = _ref.inputGroup;
|
|
32
34
|
|
|
33
35
|
var _useState = (0, _react.useState)(true),
|
|
34
36
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -48,9 +50,41 @@ var Box = function Box(_ref) {
|
|
|
48
50
|
boxOnboardingList = _useState6[0],
|
|
49
51
|
setBoxOnboardingList = _useState6[1];
|
|
50
52
|
|
|
53
|
+
(0, _react.useEffect)(function () {
|
|
54
|
+
console.log("dataInputs:", dataInputs);
|
|
55
|
+
console.log("inputGroup:", inputGroup);
|
|
56
|
+
var temp = {};
|
|
57
|
+
var maxBoxId = 0;
|
|
58
|
+
inputGroup.inputs.forEach(function (attrId) {
|
|
59
|
+
if (!dataInputs[attrId].box) return;
|
|
60
|
+
Object.entries(dataInputs[attrId].box).forEach(function (_ref2) {
|
|
61
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
62
|
+
boxId = _ref3[0],
|
|
63
|
+
value = _ref3[1];
|
|
64
|
+
|
|
65
|
+
if (boxId > maxBoxId) maxBoxId = boxId;
|
|
66
|
+
if (!temp[boxId]) temp[boxId] = {};
|
|
67
|
+
temp[boxId][attrId] = value;
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
var tempList = Object.values(temp);
|
|
71
|
+
|
|
72
|
+
if (tempList.length > 0) {
|
|
73
|
+
setBoxOnboardingList(tempList.map(function (value, index) {
|
|
74
|
+
return index === tempList.length - 1 ? {
|
|
75
|
+
showAdd: true,
|
|
76
|
+
value: value
|
|
77
|
+
} : {
|
|
78
|
+
value: value
|
|
79
|
+
};
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
}, []);
|
|
83
|
+
|
|
51
84
|
var handleAddBoxOnboarding = function handleAddBoxOnboarding() {
|
|
52
85
|
var newBoxOnboarding = {
|
|
53
|
-
showAdd: false
|
|
86
|
+
showAdd: false,
|
|
87
|
+
value: {}
|
|
54
88
|
};
|
|
55
89
|
setBoxOnboardingList([].concat((0, _toConsumableArray2.default)(boxOnboardingList), [newBoxOnboarding]));
|
|
56
90
|
};
|
|
@@ -71,15 +105,13 @@ var Box = function Box(_ref) {
|
|
|
71
105
|
|
|
72
106
|
(0, _react.useEffect)(function () {
|
|
73
107
|
onChange && onChange(boxOnboardingList);
|
|
74
|
-
}, [boxOnboardingList]);
|
|
75
|
-
|
|
76
|
-
console.log("onboardinglist", boxOnboardingList);
|
|
108
|
+
}, [boxOnboardingList]);
|
|
77
109
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
78
110
|
fontFamily: _variables.FontFamily.Raleway,
|
|
79
111
|
color: _variables.GlobalColors.original_magenta,
|
|
80
112
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
|
|
81
113
|
fontFamily: _variables.FontFamily.Raleway,
|
|
82
|
-
children:
|
|
114
|
+
children: inputGroup.dataGroup
|
|
83
115
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
84
116
|
className: "container-box",
|
|
85
117
|
children: boxOnboardingList.map(function (boxOnboarding, index) {
|
|
@@ -89,8 +121,12 @@ var Box = function Box(_ref) {
|
|
|
89
121
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxOnboarding.BoxOnboarding, {
|
|
90
122
|
index: index,
|
|
91
123
|
showAdd: boxOnboarding.showAdd,
|
|
124
|
+
data: boxOnboarding.value,
|
|
125
|
+
dataInputs: dataInputs,
|
|
126
|
+
inputs: inputGroup.inputs,
|
|
92
127
|
isEditEnabled: isEditEnabled,
|
|
93
128
|
onChange: function onChange(e) {
|
|
129
|
+
console.log("e in Box", e);
|
|
94
130
|
setBoxOnboardingList(function (prev) {
|
|
95
131
|
return prev.map(function (box, i) {
|
|
96
132
|
if (i != index) {
|
|
@@ -104,6 +140,7 @@ var Box = function Box(_ref) {
|
|
|
104
140
|
});
|
|
105
141
|
}
|
|
106
142
|
}, index), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxButtons.BoxButtons, {
|
|
143
|
+
index: index,
|
|
107
144
|
showAdd: boxOnboarding.showAdd,
|
|
108
145
|
onAdd: handleAddBoxOnboarding,
|
|
109
146
|
onDelete: function onDelete() {
|
|
@@ -112,7 +149,7 @@ var Box = function Box(_ref) {
|
|
|
112
149
|
isDeleteDisabled: isDeleteDisabled,
|
|
113
150
|
onToggleEdit: handleToggleEdit,
|
|
114
151
|
isEditEnabled: isEditEnabled
|
|
115
|
-
})]
|
|
152
|
+
}, index)]
|
|
116
153
|
})
|
|
117
154
|
});
|
|
118
155
|
})
|
|
@@ -17,32 +17,41 @@ var _BoxAttribute = require("../../molecules/BoxAttribute");
|
|
|
17
17
|
|
|
18
18
|
var _react = require("react");
|
|
19
19
|
|
|
20
|
+
var _lodash = require("lodash");
|
|
21
|
+
|
|
20
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
23
|
|
|
22
|
-
var BoxOnboarding = function
|
|
24
|
+
var BoxOnboarding = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
23
25
|
var panelColor = _ref.panelColor,
|
|
24
26
|
isEditEnabled = _ref.isEditEnabled,
|
|
25
27
|
index = _ref.index,
|
|
26
|
-
onChange = _ref.onChange
|
|
28
|
+
onChange = _ref.onChange,
|
|
29
|
+
data = _ref.data,
|
|
30
|
+
dataInputs = _ref.dataInputs,
|
|
31
|
+
inputs = _ref.inputs;
|
|
27
32
|
|
|
28
|
-
var _useState = (0, _react.useState)(
|
|
33
|
+
var _useState = (0, _react.useState)({}),
|
|
29
34
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
atributos = _useState2[0],
|
|
36
|
+
setAtributos = _useState2[1]; // console.log("input",inputs);
|
|
37
|
+
//console.log("atributossss BO",atributos)
|
|
38
|
+
|
|
32
39
|
|
|
33
|
-
var _useState3 = (0, _react.useState)(
|
|
34
|
-
largo: '',
|
|
35
|
-
alto: '',
|
|
36
|
-
ancho: '',
|
|
37
|
-
peso: ''
|
|
38
|
-
}),
|
|
40
|
+
var _useState3 = (0, _react.useState)(true),
|
|
39
41
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
isLoading = _useState4[0],
|
|
43
|
+
setIsLoading = _useState4[1];
|
|
42
44
|
|
|
43
45
|
(0, _react.useEffect)(function () {
|
|
46
|
+
console.log("atributos use", atributos);
|
|
44
47
|
onChange && onChange(atributos);
|
|
45
48
|
}, [atributos]);
|
|
49
|
+
(0, _react.useEffect)(function () {
|
|
50
|
+
if (isLoading && Object.keys(data).length > 0) {
|
|
51
|
+
setAtributos(data);
|
|
52
|
+
setIsLoading(false);
|
|
53
|
+
}
|
|
54
|
+
}, [data]);
|
|
46
55
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
47
56
|
panelColor: panelColor,
|
|
48
57
|
fontFamily: _variables.FontFamily.Raleway,
|
|
@@ -51,42 +60,22 @@ var BoxOnboarding = function BoxOnboarding(_ref) {
|
|
|
51
60
|
id: "contenedor-caja",
|
|
52
61
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
53
62
|
fontFamily: _variables.FontFamily.Raleway,
|
|
54
|
-
children: ["Caja ", index + 1
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
isEditEnabled: isEditEnabled,
|
|
69
|
-
atributos: atributos.alto,
|
|
70
|
-
setAtributos: setAtributos
|
|
71
|
-
}), boxAttributesActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
|
|
72
|
-
id: "ancho",
|
|
73
|
-
borderType: "rectangle",
|
|
74
|
-
className: "caja",
|
|
75
|
-
text: "Ancho",
|
|
76
|
-
isEditEnabled: isEditEnabled,
|
|
77
|
-
atributos: atributos.ancho,
|
|
78
|
-
setAtributos: setAtributos
|
|
79
|
-
}), boxAttributesActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
|
|
80
|
-
id: "peso",
|
|
81
|
-
borderType: "rectangle",
|
|
82
|
-
className: "caja",
|
|
83
|
-
text: "Peso",
|
|
84
|
-
isEditEnabled: isEditEnabled,
|
|
85
|
-
atributos: atributos.peso,
|
|
86
|
-
setAtributos: setAtributos
|
|
63
|
+
children: ["Caja ", index + 1]
|
|
64
|
+
}), inputs.map(function (attrId) {
|
|
65
|
+
var _dataInputs$attrId;
|
|
66
|
+
|
|
67
|
+
console.log("data inputsss name:", atributos);
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BoxAttribute.BoxAttribute, {
|
|
69
|
+
id: attrId,
|
|
70
|
+
borderType: "rectangle",
|
|
71
|
+
className: "caja",
|
|
72
|
+
text: (_dataInputs$attrId = dataInputs[attrId]) === null || _dataInputs$attrId === void 0 ? void 0 : _dataInputs$attrId.name,
|
|
73
|
+
isEditEnabled: isEditEnabled,
|
|
74
|
+
atributos: atributos,
|
|
75
|
+
setAtributos: setAtributos
|
|
76
|
+
}, attrId);
|
|
87
77
|
})]
|
|
88
78
|
})
|
|
89
79
|
});
|
|
90
|
-
};
|
|
91
|
-
|
|
80
|
+
}, _lodash.isEqual);
|
|
92
81
|
exports.BoxOnboarding = BoxOnboarding;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.InputGroup = void 0;
|
|
9
7
|
|
|
10
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
11
|
-
|
|
12
8
|
var _styles = require("./styles");
|
|
13
9
|
|
|
14
10
|
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
@@ -45,11 +41,10 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
45
41
|
_ref$groupData = _ref.groupData,
|
|
46
42
|
groupData = _ref$groupData === void 0 ? [] : _ref$groupData,
|
|
47
43
|
isShowbox = _ref.isShowbox,
|
|
48
|
-
index = _ref.index,
|
|
49
44
|
setUpdatedBoxData = _ref.setUpdatedBoxData;
|
|
50
|
-
console.log('groupData: ', (0, _typeof2.default)(groupData));
|
|
51
|
-
console.log('groupData: ', groupData);
|
|
52
45
|
|
|
46
|
+
// console.log("groupData: ", typeof groupData);
|
|
47
|
+
// console.log("groupData: ", groupData);
|
|
53
48
|
var inputTypeValue = function inputTypeValue(type) {
|
|
54
49
|
switch (type) {
|
|
55
50
|
case "Booleano":
|
|
@@ -66,13 +61,13 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
66
61
|
var isOnboarding = function isOnboarding() {
|
|
67
62
|
var contentBoxAttribute = groupData.find(function (_ref2) {
|
|
68
63
|
var dataGroup = _ref2.dataGroup;
|
|
69
|
-
return dataGroup ===
|
|
64
|
+
return dataGroup === "Caja";
|
|
70
65
|
});
|
|
71
66
|
|
|
72
67
|
if (contentBoxAttribute) {
|
|
73
|
-
console.log(
|
|
68
|
+
console.log("content box attribute");
|
|
74
69
|
} else {
|
|
75
|
-
console.log(
|
|
70
|
+
console.log("dont content box attribute");
|
|
76
71
|
}
|
|
77
72
|
|
|
78
73
|
return contentBoxAttribute;
|
|
@@ -80,15 +75,16 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
80
75
|
|
|
81
76
|
var isEquals = function isEquals(dataInputsVal, auditInputsVal) {
|
|
82
77
|
var result = dataInputsVal === auditInputsVal;
|
|
78
|
+
console.log("Input Val", dataInputsVal);
|
|
83
79
|
return result;
|
|
84
80
|
};
|
|
85
81
|
|
|
86
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
87
|
-
children:
|
|
82
|
+
return inputGroup.groupId !== "16" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
83
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
88
84
|
className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout",
|
|
89
85
|
children: [(inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
90
86
|
headerType: "retailer-name-header",
|
|
91
|
-
text: inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup
|
|
87
|
+
text: "".concat(inputGroup.groupId, " - ").concat(inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup)
|
|
92
88
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
93
89
|
className: "inputs-container",
|
|
94
90
|
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) {
|
|
@@ -134,12 +130,14 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
134
130
|
}, index + "-" + (input === null || input === void 0 ? void 0 : input.value) + "-" + compare);
|
|
135
131
|
})
|
|
136
132
|
})]
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
133
|
+
})
|
|
134
|
+
}) : isShowbox && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
135
|
+
className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout",
|
|
136
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.Box, {
|
|
137
|
+
inputGroup: inputGroup,
|
|
138
|
+
dataInputs: dataInputs,
|
|
139
|
+
onChange: setUpdatedBoxData
|
|
140
|
+
})
|
|
143
141
|
});
|
|
144
142
|
};
|
|
145
143
|
|
|
@@ -1219,58 +1219,75 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1219
1219
|
|
|
1220
1220
|
var saveDatasheets = /*#__PURE__*/function () {
|
|
1221
1221
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1222
|
-
var dataObject, res;
|
|
1222
|
+
var inputs, dataObject, res;
|
|
1223
1223
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1224
1224
|
while (1) {
|
|
1225
1225
|
switch (_context12.prev = _context12.next) {
|
|
1226
1226
|
case 0:
|
|
1227
|
+
inputs = function () {
|
|
1228
|
+
var fields = {};
|
|
1229
|
+
boxData.map(function (e) {
|
|
1230
|
+
return (0, _objectSpread3.default)({}, e.value);
|
|
1231
|
+
}).forEach(function (item, k) {
|
|
1232
|
+
for (var key in item) {
|
|
1233
|
+
if (!fields[key]) {
|
|
1234
|
+
fields[key] = {};
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
fields[key].box = fields[key].box || {};
|
|
1238
|
+
fields[key].box[k] = item[key];
|
|
1239
|
+
}
|
|
1240
|
+
});
|
|
1241
|
+
return fields;
|
|
1242
|
+
}();
|
|
1243
|
+
|
|
1227
1244
|
setLoading(true);
|
|
1228
1245
|
dataObject = {
|
|
1229
1246
|
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1230
1247
|
articleData: updatedDatasheets,
|
|
1231
|
-
|
|
1248
|
+
inputs: inputs
|
|
1232
1249
|
};
|
|
1233
|
-
console.log("boxData guardado",
|
|
1250
|
+
console.log("boxData guardado", dataObject);
|
|
1234
1251
|
if (product !== null && product !== void 0 && product.orderId) dataObject["orderId"] = product === null || product === void 0 ? void 0 : product.orderId;
|
|
1235
|
-
_context12.prev =
|
|
1236
|
-
_context12.next =
|
|
1252
|
+
_context12.prev = 5;
|
|
1253
|
+
_context12.next = 8;
|
|
1237
1254
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
|
|
1238
1255
|
headers: {
|
|
1239
1256
|
Authorization: token
|
|
1240
1257
|
}
|
|
1241
1258
|
});
|
|
1242
1259
|
|
|
1243
|
-
case
|
|
1260
|
+
case 8:
|
|
1244
1261
|
res = _context12.sent;
|
|
1245
1262
|
|
|
1246
1263
|
if (!(res.data.statusCode === 200)) {
|
|
1247
|
-
_context12.next =
|
|
1264
|
+
_context12.next = 14;
|
|
1248
1265
|
break;
|
|
1249
1266
|
}
|
|
1250
1267
|
|
|
1251
1268
|
setUpdatedDatasheets([]);
|
|
1252
1269
|
setMessage("Fichas técnicas guardadas");
|
|
1253
|
-
_context12.next =
|
|
1270
|
+
_context12.next = 14;
|
|
1254
1271
|
return loadData();
|
|
1255
1272
|
|
|
1256
|
-
case
|
|
1257
|
-
_context12.next =
|
|
1273
|
+
case 14:
|
|
1274
|
+
_context12.next = 19;
|
|
1258
1275
|
break;
|
|
1259
1276
|
|
|
1260
|
-
case
|
|
1261
|
-
_context12.prev =
|
|
1262
|
-
_context12.t0 = _context12["catch"](
|
|
1277
|
+
case 16:
|
|
1278
|
+
_context12.prev = 16;
|
|
1279
|
+
_context12.t0 = _context12["catch"](5);
|
|
1263
1280
|
console.log(_context12.t0);
|
|
1264
1281
|
|
|
1265
|
-
case
|
|
1282
|
+
case 19:
|
|
1266
1283
|
console.log(dataObject);
|
|
1267
1284
|
|
|
1268
|
-
case
|
|
1285
|
+
case 20:
|
|
1269
1286
|
case "end":
|
|
1270
1287
|
return _context12.stop();
|
|
1271
1288
|
}
|
|
1272
1289
|
}
|
|
1273
|
-
}, _callee12, null, [[
|
|
1290
|
+
}, _callee12, null, [[5, 16]]);
|
|
1274
1291
|
}));
|
|
1275
1292
|
|
|
1276
1293
|
return function saveDatasheets() {
|
|
@@ -2213,6 +2230,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2213
2230
|
isShowbox: true,
|
|
2214
2231
|
groupData: services[0][activeRetailer.id].data,
|
|
2215
2232
|
setUpdatedBoxData: function setUpdatedBoxData(e) {
|
|
2233
|
+
console.log("UNO", e);
|
|
2216
2234
|
setBoxData(e);
|
|
2217
2235
|
},
|
|
2218
2236
|
index: index //enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
|
package/package.json
CHANGED
|
@@ -30,8 +30,8 @@ export const BoxAttribute = (props) => {
|
|
|
30
30
|
return result;
|
|
31
31
|
}, {});
|
|
32
32
|
//escucha los cambios
|
|
33
|
-
console.log(formattedData);
|
|
34
|
-
console.log("atributos id", atributos[props.id]);
|
|
33
|
+
// console.log(formattedData);
|
|
34
|
+
// console.log("atributos id", atributos[props.id]);
|
|
35
35
|
return (
|
|
36
36
|
<>
|
|
37
37
|
<Container
|
|
@@ -3,7 +3,6 @@ import { Container } from "./styles";
|
|
|
3
3
|
import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
4
4
|
import { BoxOnboarding } from "../BoxOnboarding";
|
|
5
5
|
import { BoxButtons } from "../../molecules/BoxButtons";
|
|
6
|
-
import { useEffect } from "react";
|
|
7
6
|
|
|
8
7
|
export const Box = ({ onChange, dataInputs, inputGroup }) => {
|
|
9
8
|
const [isDeleteDisabled, setIsDeleteDisabled] = useState(true);
|
|
@@ -84,11 +83,10 @@ export const Box = ({ onChange, dataInputs, inputGroup }) => {
|
|
|
84
83
|
inputs={inputGroup.inputs}
|
|
85
84
|
isEditEnabled={isEditEnabled}
|
|
86
85
|
onChange={(e) => {
|
|
86
|
+
console.log("e in Box",e);
|
|
87
87
|
setBoxOnboardingList((prev) => {
|
|
88
88
|
return prev.map((box, i) => {
|
|
89
89
|
if (i != index) {
|
|
90
|
-
console.log("e in Box",e);
|
|
91
|
-
console.log("box in box",box);
|
|
92
90
|
return box;
|
|
93
91
|
}
|
|
94
92
|
return { ...box, value: e };
|
|
@@ -20,8 +20,10 @@ export const BoxOnboarding = memo(
|
|
|
20
20
|
const [isLoading, setIsLoading] = useState(true);
|
|
21
21
|
|
|
22
22
|
useEffect(() => {
|
|
23
|
+
console.log("atributos use", atributos)
|
|
23
24
|
onChange && onChange(atributos);
|
|
24
25
|
}, [atributos]);
|
|
26
|
+
|
|
25
27
|
|
|
26
28
|
useEffect(() => {
|
|
27
29
|
if (isLoading && Object.keys(data).length > 0) {
|
|
@@ -38,18 +40,21 @@ export const BoxOnboarding = memo(
|
|
|
38
40
|
>
|
|
39
41
|
<div id="contenedor-caja">
|
|
40
42
|
<p fontFamily={FontFamily.Raleway}>Caja {index + 1}</p>
|
|
41
|
-
{inputs.map((attrId) =>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
{inputs.map((attrId) => {
|
|
44
|
+
console.log("data inputsss name:",atributos)
|
|
45
|
+
return (
|
|
46
|
+
<BoxAttribute
|
|
47
|
+
id={attrId}
|
|
48
|
+
key={attrId}
|
|
49
|
+
borderType="rectangle"
|
|
50
|
+
className="caja"
|
|
51
|
+
text={dataInputs[attrId]?.name}
|
|
52
|
+
isEditEnabled={isEditEnabled}
|
|
53
|
+
atributos={atributos}
|
|
54
|
+
setAtributos={setAtributos}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
})}
|
|
53
58
|
|
|
54
59
|
</div>
|
|
55
60
|
</Container>
|
|
@@ -23,8 +23,8 @@ export const InputGroup = ({
|
|
|
23
23
|
isShowbox,
|
|
24
24
|
setUpdatedBoxData
|
|
25
25
|
}) => {
|
|
26
|
-
console.log("groupData: ", typeof groupData);
|
|
27
|
-
console.log("groupData: ", groupData);
|
|
26
|
+
// console.log("groupData: ", typeof groupData);
|
|
27
|
+
// console.log("groupData: ", groupData);
|
|
28
28
|
const inputTypeValue = (type) => {
|
|
29
29
|
switch (type) {
|
|
30
30
|
case "Booleano":
|
|
@@ -682,14 +682,34 @@ export const ProviderProductEdition = ({
|
|
|
682
682
|
};
|
|
683
683
|
|
|
684
684
|
const saveDatasheets = async () => {
|
|
685
|
-
|
|
685
|
+
const inputs = (() => {
|
|
686
|
+
|
|
687
|
+
let fields = {}
|
|
688
|
+
|
|
689
|
+
boxData.map(e=>({
|
|
690
|
+
...e.value,
|
|
691
|
+
})).forEach((item, k) => {
|
|
692
|
+
|
|
693
|
+
for (const key in item) {
|
|
694
|
+
if (!fields[key]) {
|
|
695
|
+
fields[key] = {};
|
|
696
|
+
}
|
|
697
|
+
fields[key].box = fields[key].box || {};
|
|
698
|
+
fields[key].box[k] = item[key];
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
})
|
|
702
|
+
|
|
703
|
+
return fields
|
|
704
|
+
|
|
705
|
+
})()
|
|
686
706
|
setLoading(true);
|
|
687
707
|
const dataObject = {
|
|
688
708
|
articleId: product?.id_article,
|
|
689
709
|
articleData: updatedDatasheets,
|
|
690
|
-
|
|
710
|
+
inputs
|
|
691
711
|
};
|
|
692
|
-
console.log("boxData guardado",
|
|
712
|
+
console.log("boxData guardado", dataObject);
|
|
693
713
|
if (product?.orderId) dataObject["orderId"] = product?.orderId;
|
|
694
714
|
try {
|
|
695
715
|
const res = await axios.put(
|
|
@@ -835,6 +855,7 @@ export const ProviderProductEdition = ({
|
|
|
835
855
|
return "images";
|
|
836
856
|
}
|
|
837
857
|
};
|
|
858
|
+
|
|
838
859
|
|
|
839
860
|
const createComment = async (messages = [], retailerId) => {
|
|
840
861
|
const data = {
|
|
@@ -1473,8 +1494,8 @@ export const ProviderProductEdition = ({
|
|
|
1473
1494
|
isShowbox={true}
|
|
1474
1495
|
groupData={services[0][activeRetailer.id].data}
|
|
1475
1496
|
setUpdatedBoxData={(e) => {
|
|
1476
|
-
setBoxData(e);
|
|
1477
1497
|
console.log("UNO",e);
|
|
1498
|
+
setBoxData(e);
|
|
1478
1499
|
}}
|
|
1479
1500
|
index={index}
|
|
1480
1501
|
//enableActions={enableActions(product.version_status)} ADD THIS VALIDATION
|
|
File without changes
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<mask id="mask0_37_469" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="14" height="14">
|
|
3
|
-
<rect width="14" height="14" fill="#D9D9D9"/>
|
|
4
|
-
</mask>
|
|
5
|
-
<g mask="url(#mask0_37_469)">
|
|
6
|
-
<path d="M4.76875 10.5194L7 8.16667L9.25 10.5194L10.1313 9.58611L7.9 7.23333L10.1313 4.88056L9.25 3.94722L7 6.3L4.76875 3.94722L3.86875 4.88056L6.11875 7.23333L3.86875 9.58611L4.76875 10.5194ZM2.89375 14C2.59375 14 2.33125 13.8833 2.10625 13.65C1.88125 13.4167 1.76875 13.1444 1.76875 12.8333V1.75H1V0.583333H4.525V0H9.475V0.583333H13V1.75H12.2313V12.8333C12.2313 13.1444 12.1188 13.4167 11.8938 13.65C11.6688 13.8833 11.4062 14 11.1063 14H2.89375ZM11.1063 1.75H2.89375V12.8333H11.1063V1.75Z" fill="#B64545"/>
|
|
7
|
-
</g>
|
|
8
|
-
</svg>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M1.14598 12.854H1.98636L10.4475 4.39291L9.60709 3.55252L1.14598 12.0136V12.854ZM12.8731 3.57162L10.4284 1.12688L11.2306 0.324693C11.447 0.108231 11.7144 0 12.0327 0C12.3511 0 12.6185 0.108231 12.8349 0.324693L13.6753 1.16507C13.8918 1.38154 14 1.64893 14 1.96726C14 2.28558 13.8918 2.55298 13.6753 2.76944L12.8731 3.57162ZM12.0709 4.37381L2.44475 14H0V11.5553L9.62619 1.92906L12.0709 4.37381Z" fill="#707070"/>
|
|
3
|
-
</svg>
|
|
@@ -1,34 +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.ButtonsAssignationDefault = 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/ButtonsAssignation",
|
|
18
|
-
component: _index.ButtonsAssignation
|
|
19
|
-
};
|
|
20
|
-
exports.default = _default;
|
|
21
|
-
|
|
22
|
-
var Template = function Template(args) {
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ButtonsAssignation, (0, _objectSpread2.default)({}, args));
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
var ButtonsAssignationDefault = Template.bind({});
|
|
27
|
-
exports.ButtonsAssignationDefault = ButtonsAssignationDefault;
|
|
28
|
-
ButtonsAssignationDefault.args = {
|
|
29
|
-
status: "AA",
|
|
30
|
-
image: {
|
|
31
|
-
src: "https://image.shutterstock.com/image-illustration/3d-render-generic-drug-pills-260nw-709112806.jpg"
|
|
32
|
-
},
|
|
33
|
-
imagesSection: true
|
|
34
|
-
};
|