contentoh-components-library 21.4.95 → 21.4.97
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/ObservationFlag/index.js +19 -25
- package/dist/components/atoms/ObservationFlag/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +6 -2
- package/dist/components/organisms/FullProductNameHeader/index.js +6 -2
- package/dist/components/pages/RetailerProductEdition/index.js +12 -1
- package/package.json +1 -1
- package/src/components/atoms/ObservationFlag/index.js +5 -5
- package/src/components/atoms/ObservationFlag/styles.js +1 -0
- package/src/components/molecules/ProductNameHeader/index.js +4 -0
- package/src/components/organisms/FullProductNameHeader/index.js +4 -0
- package/src/components/pages/RetailerProductEdition/index.js +9 -0
|
@@ -44,40 +44,34 @@ var ObservationFlag = function ObservationFlag(_ref) {
|
|
|
44
44
|
|
|
45
45
|
var observation = _ref.observation,
|
|
46
46
|
contentObservation = _ref.contentObservation,
|
|
47
|
-
dataProduct = _ref.dataProduct
|
|
48
|
-
|
|
47
|
+
dataProduct = _ref.dataProduct,
|
|
48
|
+
isObservationVisible = _ref.isObservationVisible,
|
|
49
|
+
toggleObservation = _ref.toggleObservation;
|
|
50
|
+
var PriorityFlags = (_PriorityFlags = {}, (0, _defineProperty2.default)(_PriorityFlags, "none", _noPriority.default), (0, _defineProperty2.default)(_PriorityFlags, "low", _lowPriority.default), (0, _defineProperty2.default)(_PriorityFlags, "medium", _mediumPriority.default), (0, _defineProperty2.default)(_PriorityFlags, "high", _highPriority.default), _PriorityFlags); // const [isObservationVisible, setObservationVisible] = useState(false);
|
|
49
51
|
|
|
50
|
-
var _useState = (0, _react.useState)(
|
|
52
|
+
var _useState = (0, _react.useState)(contentObservation || ""),
|
|
51
53
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
material = _useState2[0],
|
|
55
|
+
setMaterial = _useState2[1];
|
|
54
56
|
|
|
55
|
-
var _useState3 = (0, _react.useState)(
|
|
57
|
+
var _useState3 = (0, _react.useState)(observation),
|
|
56
58
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
currentObservation = _useState4[0],
|
|
60
|
+
setCurrentObservation = _useState4[1];
|
|
59
61
|
|
|
60
|
-
var _useState5 = (0, _react.useState)(
|
|
62
|
+
var _useState5 = (0, _react.useState)(false),
|
|
61
63
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
showModal = _useState6[0],
|
|
65
|
+
setShowModal = _useState6[1];
|
|
64
66
|
|
|
65
|
-
var _useState7 = (0, _react.useState)(
|
|
67
|
+
var _useState7 = (0, _react.useState)({}),
|
|
66
68
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
modalData = _useState8[0],
|
|
70
|
+
setModalData = _useState8[1];
|
|
69
71
|
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
setModalData = _useState10[1];
|
|
74
|
-
|
|
75
|
-
var textareaRef = (0, _react.useRef)(null);
|
|
76
|
-
|
|
77
|
-
var toggleObservation = function toggleObservation() {
|
|
78
|
-
console.log("VENTANA");
|
|
79
|
-
setObservationVisible(!isObservationVisible);
|
|
80
|
-
};
|
|
72
|
+
var textareaRef = (0, _react.useRef)(null); // const toggleObservation = () => {
|
|
73
|
+
// setObservationVisible(!isObservationVisible);
|
|
74
|
+
// };
|
|
81
75
|
|
|
82
76
|
(0, _react.useEffect)(function () {
|
|
83
77
|
var handleClickOutside = function handleClickOutside(event) {
|
|
@@ -17,7 +17,7 @@ var Container = _styledComponents.default.div(_templateObject || (_templateObjec
|
|
|
17
17
|
|
|
18
18
|
exports.Container = Container;
|
|
19
19
|
|
|
20
|
-
var Observation = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n /* height: 100%;\n width: 100%; */\n"])));
|
|
20
|
+
var Observation = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n /* height: 100%;\n width: 100%; */\n z-index: 10000;\n"])));
|
|
21
21
|
|
|
22
22
|
exports.Observation = Observation;
|
|
23
23
|
|
|
@@ -26,7 +26,9 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
|
26
26
|
date = _ref.date,
|
|
27
27
|
percentRequired = _ref.percentRequired,
|
|
28
28
|
productObservation = _ref.productObservation,
|
|
29
|
-
dataProduct = _ref.dataProduct
|
|
29
|
+
dataProduct = _ref.dataProduct,
|
|
30
|
+
isObservationVisible = _ref.isObservationVisible,
|
|
31
|
+
toggleObservation = _ref.toggleObservation;
|
|
30
32
|
var typeFlag = productObservation !== null && productObservation !== "" ? "high" : "low";
|
|
31
33
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
32
34
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
@@ -41,7 +43,9 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
|
41
43
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index5.ObservationFlag, {
|
|
42
44
|
observation: typeFlag,
|
|
43
45
|
contentObservation: productObservation,
|
|
44
|
-
dataProduct: dataProduct
|
|
46
|
+
dataProduct: dataProduct,
|
|
47
|
+
isObservationVisible: isObservationVisible,
|
|
48
|
+
toggleObservation: toggleObservation
|
|
45
49
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
46
50
|
headerType: "date-header",
|
|
47
51
|
text: date
|
|
@@ -35,7 +35,9 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
35
35
|
rejectAll = _ref.rejectAll,
|
|
36
36
|
servicesData = _ref.servicesData,
|
|
37
37
|
showApproveRejectAll = _ref.showApproveRejectAll,
|
|
38
|
-
productObservation = _ref.productObservation
|
|
38
|
+
productObservation = _ref.productObservation,
|
|
39
|
+
isObservationVisible = _ref.isObservationVisible,
|
|
40
|
+
toggleObservation = _ref.toggleObservation;
|
|
39
41
|
|
|
40
42
|
var _useState = (0, _react.useState)([]),
|
|
41
43
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -71,7 +73,9 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
71
73
|
priority: headerData === null || headerData === void 0 ? void 0 : headerData.prio,
|
|
72
74
|
productObservation: productObservation,
|
|
73
75
|
date: getTime((headerData === null || headerData === void 0 ? void 0 : (_headerData$article2 = headerData.article) === null || _headerData$article2 === void 0 ? void 0 : _headerData$article2.timestamp) || (headerData === null || headerData === void 0 ? void 0 : headerData.timestamp)),
|
|
74
|
-
dataProduct: headerData
|
|
76
|
+
dataProduct: headerData,
|
|
77
|
+
isObservationVisible: isObservationVisible,
|
|
78
|
+
toggleObservation: toggleObservation
|
|
75
79
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
76
80
|
className: "features-bar-container",
|
|
77
81
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FeaturesBar.FeaturesBar, {
|
|
@@ -507,6 +507,15 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
507
507
|
imag = _useState92[0],
|
|
508
508
|
setImag = _useState92[1];
|
|
509
509
|
|
|
510
|
+
var _useState93 = (0, _react.useState)(false),
|
|
511
|
+
_useState94 = (0, _slicedToArray2.default)(_useState93, 2),
|
|
512
|
+
isObservationVisible = _useState94[0],
|
|
513
|
+
setObservationVisible = _useState94[1];
|
|
514
|
+
|
|
515
|
+
var toggleObservation = function toggleObservation() {
|
|
516
|
+
setObservationVisible(!isObservationVisible);
|
|
517
|
+
};
|
|
518
|
+
|
|
510
519
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
511
520
|
var _ref3, id_article;
|
|
512
521
|
|
|
@@ -2022,7 +2031,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2022
2031
|
rejectAll: function rejectAll() {
|
|
2023
2032
|
setShowRejectModal(true);
|
|
2024
2033
|
setValRejAll(true);
|
|
2025
|
-
}
|
|
2034
|
+
},
|
|
2035
|
+
isObservationVisible: isObservationVisible,
|
|
2036
|
+
toggleObservation: toggleObservation
|
|
2026
2037
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2027
2038
|
tabsSections: tabsSections,
|
|
2028
2039
|
status: retailerStatus,
|
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ export const ObservationFlag = ({
|
|
|
13
13
|
observation,
|
|
14
14
|
contentObservation,
|
|
15
15
|
dataProduct,
|
|
16
|
+
isObservationVisible, toggleObservation,
|
|
16
17
|
}) => {
|
|
17
18
|
const PriorityFlags = {
|
|
18
19
|
["none"]: without,
|
|
@@ -21,7 +22,7 @@ export const ObservationFlag = ({
|
|
|
21
22
|
["high"]: high,
|
|
22
23
|
};
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
// const [isObservationVisible, setObservationVisible] = useState(false);
|
|
25
26
|
const [material, setMaterial] = useState(contentObservation || "");
|
|
26
27
|
const [currentObservation, setCurrentObservation] = useState(observation);
|
|
27
28
|
|
|
@@ -29,10 +30,9 @@ export const ObservationFlag = ({
|
|
|
29
30
|
const [modalData, setModalData] = useState({});
|
|
30
31
|
|
|
31
32
|
const textareaRef = useRef(null);
|
|
32
|
-
const toggleObservation = () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
33
|
+
// const toggleObservation = () => {
|
|
34
|
+
// setObservationVisible(!isObservationVisible);
|
|
35
|
+
// };
|
|
36
36
|
useEffect(() => {
|
|
37
37
|
const handleClickOutside = (event) => {
|
|
38
38
|
if (
|
|
@@ -13,6 +13,8 @@ export const ProductNameHeader = ({
|
|
|
13
13
|
percentRequired,
|
|
14
14
|
productObservation,
|
|
15
15
|
dataProduct,
|
|
16
|
+
isObservationVisible,
|
|
17
|
+
toggleObservation
|
|
16
18
|
}) => {
|
|
17
19
|
const typeFlag =
|
|
18
20
|
productObservation !== null && productObservation !== "" ? "high" : "low";
|
|
@@ -30,6 +32,8 @@ export const ProductNameHeader = ({
|
|
|
30
32
|
observation={typeFlag}
|
|
31
33
|
contentObservation={productObservation}
|
|
32
34
|
dataProduct={dataProduct}
|
|
35
|
+
isObservationVisible ={isObservationVisible}
|
|
36
|
+
toggleObservation = {toggleObservation}
|
|
33
37
|
/>
|
|
34
38
|
<ScreenHeader headerType={"date-header"} text={date} />
|
|
35
39
|
</Container>
|
|
@@ -18,6 +18,8 @@ export const FullProductNameHeader = ({
|
|
|
18
18
|
servicesData,
|
|
19
19
|
showApproveRejectAll,
|
|
20
20
|
productObservation,
|
|
21
|
+
isObservationVisible,
|
|
22
|
+
toggleObservation
|
|
21
23
|
}) => {
|
|
22
24
|
const [retailers, setRetailers] = useState([]);
|
|
23
25
|
|
|
@@ -56,6 +58,8 @@ export const FullProductNameHeader = ({
|
|
|
56
58
|
productObservation={productObservation}
|
|
57
59
|
date={getTime(headerData?.article?.timestamp || headerData?.timestamp)}
|
|
58
60
|
dataProduct={headerData}
|
|
61
|
+
isObservationVisible ={isObservationVisible}
|
|
62
|
+
toggleObservation = {toggleObservation}
|
|
59
63
|
/>
|
|
60
64
|
<div className="features-bar-container">
|
|
61
65
|
<FeaturesBar
|
|
@@ -231,6 +231,13 @@ export const RetailerProductEdition = ({
|
|
|
231
231
|
const [fich, setFich] = useState([]);
|
|
232
232
|
const [imag, setImag] = useState([]);
|
|
233
233
|
|
|
234
|
+
const [isObservationVisible, setObservationVisible] = useState(false);
|
|
235
|
+
|
|
236
|
+
const toggleObservation = () => {
|
|
237
|
+
setObservationVisible(!isObservationVisible);
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
|
|
234
241
|
useEffect(async () => {
|
|
235
242
|
const { id_article } = product?.article || {};
|
|
236
243
|
if (id_article)
|
|
@@ -1362,6 +1369,8 @@ export const RetailerProductEdition = ({
|
|
|
1362
1369
|
setShowRejectModal(true);
|
|
1363
1370
|
setValRejAll(true);
|
|
1364
1371
|
}}
|
|
1372
|
+
isObservationVisible={isObservationVisible}
|
|
1373
|
+
toggleObservation={toggleObservation}
|
|
1365
1374
|
/>
|
|
1366
1375
|
<FullTabsMenu
|
|
1367
1376
|
tabsSections={tabsSections}
|