contentoh-components-library 21.4.99 → 21.4.101
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 +8 -9
- package/dist/components/molecules/Phase/index.js +42 -36
- package/dist/components/molecules/ProductNameHeader/index.js +2 -3
- package/dist/components/organisms/DragAndDropPhases/index.js +41 -26
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -3
- package/dist/components/pages/RetailerProductEdition/index.js +17 -15
- package/package.json +1 -1
- package/src/components/atoms/ObservationFlag/index.js +10 -8
- package/src/components/molecules/Phase/index.js +61 -50
- package/src/components/molecules/ProductNameHeader/index.js +4 -4
- package/src/components/organisms/DragAndDropPhases/index.js +35 -18
- package/src/components/organisms/FullProductNameHeader/index.js +4 -4
- package/src/components/pages/RetailerProductEdition/index.js +18 -18
|
@@ -47,9 +47,8 @@ var ObservationFlag = function ObservationFlag(_ref) {
|
|
|
47
47
|
dataProduct = _ref.dataProduct,
|
|
48
48
|
isObservationVisible = _ref.isObservationVisible,
|
|
49
49
|
toggleObservation = _ref.toggleObservation,
|
|
50
|
-
handleClickOutside = _ref.handleClickOutside,
|
|
51
50
|
hideObservation = _ref.hideObservation;
|
|
52
|
-
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); //
|
|
51
|
+
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);
|
|
53
52
|
|
|
54
53
|
var _useState = (0, _react.useState)(contentObservation || ""),
|
|
55
54
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -86,13 +85,13 @@ var ObservationFlag = function ObservationFlag(_ref) {
|
|
|
86
85
|
return function () {
|
|
87
86
|
document.removeEventListener("click", handleClickOutside);
|
|
88
87
|
};
|
|
89
|
-
}, [isObservationVisible]);
|
|
90
|
-
(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
}, [isObservationVisible]); // useEffect(() => {
|
|
89
|
+
// document.addEventListener("click", handleClickOutside);
|
|
90
|
+
// return () => {
|
|
91
|
+
// document.removeEventListener("click", handleClickOutside);
|
|
92
|
+
// };
|
|
93
|
+
// }, [isObservationVisible, handleClickOutside]);
|
|
94
|
+
|
|
96
95
|
(0, _react.useEffect)(function () {
|
|
97
96
|
setMaterial(contentObservation || "");
|
|
98
97
|
}, [contentObservation]);
|
|
@@ -58,7 +58,11 @@ var Phase = function Phase(_ref) {
|
|
|
58
58
|
nextPhase = _ref.nextPhase,
|
|
59
59
|
groups = _ref.groups,
|
|
60
60
|
onDeletePhase = _ref.onDeletePhase,
|
|
61
|
-
token = _ref.token
|
|
61
|
+
token = _ref.token,
|
|
62
|
+
_ref$showMenu = _ref.showMenu,
|
|
63
|
+
showMenu = _ref$showMenu === void 0 ? true : _ref$showMenu,
|
|
64
|
+
_ref$showButtonChip = _ref.showButtonChip,
|
|
65
|
+
showButtonChip = _ref$showButtonChip === void 0 ? true : _ref$showButtonChip;
|
|
62
66
|
|
|
63
67
|
var _useState = (0, _react.useState)([]),
|
|
64
68
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -501,43 +505,45 @@ var Phase = function Phase(_ref) {
|
|
|
501
505
|
children: phase.phaseName
|
|
502
506
|
}, phase.phaseId);
|
|
503
507
|
})
|
|
504
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
sx: {
|
|
525
|
-
ul: {
|
|
526
|
-
paddingTop: "0px",
|
|
527
|
-
paddingBottom: "0px"
|
|
528
|
-
}
|
|
529
|
-
},
|
|
530
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
531
|
-
onClick: function onClick() {
|
|
532
|
-
return onDeletePhase(id);
|
|
508
|
+
}), showMenu && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
509
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
510
|
+
id: "basic-button",
|
|
511
|
+
"aria-controls": open ? "basic-menu" : undefined,
|
|
512
|
+
"aria-haspopup": "true",
|
|
513
|
+
"aria-expanded": open ? "true" : undefined,
|
|
514
|
+
onClick: function onClick(e) {
|
|
515
|
+
return handleClick(e);
|
|
516
|
+
},
|
|
517
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
518
|
+
src: _options.default,
|
|
519
|
+
alt: ""
|
|
520
|
+
})
|
|
521
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Menu, {
|
|
522
|
+
id: "basic-menu",
|
|
523
|
+
anchorEl: anchorEl,
|
|
524
|
+
open: open,
|
|
525
|
+
onClose: handleClose,
|
|
526
|
+
MenuListProps: {
|
|
527
|
+
"aria-labelledby": "basic-button"
|
|
533
528
|
},
|
|
534
529
|
sx: {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
530
|
+
ul: {
|
|
531
|
+
paddingTop: "0px",
|
|
532
|
+
paddingBottom: "0px"
|
|
533
|
+
}
|
|
538
534
|
},
|
|
539
|
-
children:
|
|
540
|
-
|
|
535
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
536
|
+
onClick: function onClick() {
|
|
537
|
+
return onDeletePhase(id);
|
|
538
|
+
},
|
|
539
|
+
sx: {
|
|
540
|
+
fontSize: "12px",
|
|
541
|
+
color: "#262626",
|
|
542
|
+
minHeight: "auto"
|
|
543
|
+
},
|
|
544
|
+
children: "Eliminar Fase"
|
|
545
|
+
})
|
|
546
|
+
})]
|
|
541
547
|
})]
|
|
542
548
|
})
|
|
543
549
|
})]
|
|
@@ -550,7 +556,7 @@ var Phase = function Phase(_ref) {
|
|
|
550
556
|
return handleChipDelete(phaseId, chip);
|
|
551
557
|
}
|
|
552
558
|
}, chip.id);
|
|
553
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupSelect.GroupSelect, {
|
|
559
|
+
}), showButtonChip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupSelect.GroupSelect, {
|
|
554
560
|
options: groups.filter(function (group) {
|
|
555
561
|
return group.groupActive === 0;
|
|
556
562
|
}).map(function (group) {
|
|
@@ -29,7 +29,6 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
|
29
29
|
dataProduct = _ref.dataProduct,
|
|
30
30
|
isObservationVisible = _ref.isObservationVisible,
|
|
31
31
|
toggleObservation = _ref.toggleObservation,
|
|
32
|
-
handleClickOutside = _ref.handleClickOutside,
|
|
33
32
|
hideObservation = _ref.hideObservation;
|
|
34
33
|
var typeFlag = productObservation !== null && productObservation !== "" ? "high" : "low";
|
|
35
34
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
@@ -47,8 +46,8 @@ var ProductNameHeader = function ProductNameHeader(_ref) {
|
|
|
47
46
|
contentObservation: productObservation,
|
|
48
47
|
dataProduct: dataProduct,
|
|
49
48
|
isObservationVisible: isObservationVisible,
|
|
50
|
-
toggleObservation: toggleObservation
|
|
51
|
-
|
|
49
|
+
toggleObservation: toggleObservation // handleClickOutside = {handleClickOutside}
|
|
50
|
+
,
|
|
52
51
|
hideObservation: hideObservation
|
|
53
52
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
|
|
54
53
|
headerType: "date-header",
|
|
@@ -176,41 +176,39 @@ var DragAndDropPhases = function DragAndDropPhases(_ref) {
|
|
|
176
176
|
while (1) {
|
|
177
177
|
switch (_context2.prev = _context2.next) {
|
|
178
178
|
case 0:
|
|
179
|
-
|
|
180
|
-
_context2.prev = 1;
|
|
179
|
+
_context2.prev = 0;
|
|
181
180
|
body = {
|
|
182
181
|
name: phaseName,
|
|
183
182
|
retailerGroupsIds: [],
|
|
184
183
|
nextPhaseId: null
|
|
185
184
|
};
|
|
186
|
-
_context2.next =
|
|
185
|
+
_context2.next = 4;
|
|
187
186
|
return _axios.default.post("".concat(process.env.REACT_APP_PHASES_ENDPOINT, "/create"), body, {
|
|
188
187
|
headers: {
|
|
189
188
|
Authorization: token
|
|
190
189
|
}
|
|
191
190
|
});
|
|
192
191
|
|
|
193
|
-
case
|
|
192
|
+
case 4:
|
|
194
193
|
response = _context2.sent;
|
|
195
|
-
console.log("body", body);
|
|
196
194
|
createdPhase = response.data.body;
|
|
197
195
|
console.log(createdPhase);
|
|
198
196
|
setInputValue("");
|
|
199
197
|
loadData();
|
|
200
|
-
_context2.next =
|
|
198
|
+
_context2.next = 14;
|
|
201
199
|
break;
|
|
202
200
|
|
|
203
|
-
case
|
|
204
|
-
_context2.prev =
|
|
205
|
-
_context2.t0 = _context2["catch"](
|
|
201
|
+
case 11:
|
|
202
|
+
_context2.prev = 11;
|
|
203
|
+
_context2.t0 = _context2["catch"](0);
|
|
206
204
|
console.error("Error al agregar fase:", _context2.t0);
|
|
207
205
|
|
|
208
|
-
case
|
|
206
|
+
case 14:
|
|
209
207
|
case "end":
|
|
210
208
|
return _context2.stop();
|
|
211
209
|
}
|
|
212
210
|
}
|
|
213
|
-
}, _callee2, null, [[
|
|
211
|
+
}, _callee2, null, [[0, 11]]);
|
|
214
212
|
}));
|
|
215
213
|
|
|
216
214
|
return function addPhase(_x) {
|
|
@@ -412,21 +410,38 @@ var DragAndDropPhases = function DragAndDropPhases(_ref) {
|
|
|
412
410
|
|
|
413
411
|
|
|
414
412
|
var renderPhase = function renderPhase(phase, idx) {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
413
|
+
if (phase.isInitialPhase === 1) {
|
|
414
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Phase.Phase, {
|
|
415
|
+
id: idx,
|
|
416
|
+
phaseId: phase.phaseId,
|
|
417
|
+
phases: listPhases,
|
|
418
|
+
phaseName: phase.phaseName,
|
|
419
|
+
nextPhase: phase.nextPhaseIfApproved,
|
|
420
|
+
groups: phase.groupsAssigned,
|
|
421
|
+
onDeletePhase: function onDeletePhase() {
|
|
422
|
+
return handleDeletePhase(phase.phaseId);
|
|
423
|
+
},
|
|
424
|
+
token: token,
|
|
425
|
+
showMenu: false,
|
|
426
|
+
showButtonChip: false
|
|
427
|
+
}, phase.phaseId);
|
|
428
|
+
} else {
|
|
429
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Phase.Phase, {
|
|
430
|
+
id: idx,
|
|
431
|
+
phaseId: phase.phaseId,
|
|
432
|
+
phases: listPhases,
|
|
433
|
+
phaseName: phase.phaseName,
|
|
434
|
+
nextPhase: phase.nextPhaseIfApproved,
|
|
435
|
+
groups: phase.groupsAssigned,
|
|
436
|
+
onDeletePhase: function onDeletePhase() {
|
|
437
|
+
return handleDeletePhase(phase.phaseId);
|
|
438
|
+
} // onDragStart={(e) => onDragStart(e, idx)}
|
|
439
|
+
// onDragOver={() => onDragOver(idx)}
|
|
440
|
+
// onDragEnd={onDragEnd}
|
|
441
|
+
,
|
|
442
|
+
token: token
|
|
443
|
+
}, phase.phaseId);
|
|
444
|
+
}
|
|
430
445
|
};
|
|
431
446
|
|
|
432
447
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
@@ -38,7 +38,6 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
38
38
|
productObservation = _ref.productObservation,
|
|
39
39
|
isObservationVisible = _ref.isObservationVisible,
|
|
40
40
|
toggleObservation = _ref.toggleObservation,
|
|
41
|
-
handleClickOutside = _ref.handleClickOutside,
|
|
42
41
|
hideObservation = _ref.hideObservation;
|
|
43
42
|
|
|
44
43
|
var _useState = (0, _react.useState)([]),
|
|
@@ -77,8 +76,8 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
|
|
|
77
76
|
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)),
|
|
78
77
|
dataProduct: headerData,
|
|
79
78
|
isObservationVisible: isObservationVisible,
|
|
80
|
-
toggleObservation: toggleObservation
|
|
81
|
-
|
|
79
|
+
toggleObservation: toggleObservation // handleClickOutside ={handleClickOutside}
|
|
80
|
+
,
|
|
82
81
|
hideObservation: hideObservation
|
|
83
82
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
84
83
|
className: "features-bar-container",
|
|
@@ -514,20 +514,22 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
514
514
|
|
|
515
515
|
var toggleObservation = function toggleObservation() {
|
|
516
516
|
setObservationVisible(!isObservationVisible);
|
|
517
|
-
};
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
517
|
+
}; // const handleClickOutside = (event) => {
|
|
518
|
+
// if (
|
|
519
|
+
// isObservationVisible &&
|
|
520
|
+
// !event.target.closest(".Observation") &&
|
|
521
|
+
// !event.target.closest(".Container")
|
|
522
|
+
// ) {
|
|
523
|
+
// hideObservation();
|
|
524
|
+
// }
|
|
525
|
+
// };
|
|
526
|
+
// useEffect(() => {
|
|
527
|
+
// document.addEventListener("click", handleClickOutside);
|
|
528
|
+
// return () => {
|
|
529
|
+
// document.removeEventListener("click", handleClickOutside);
|
|
530
|
+
// };
|
|
531
|
+
// }, [isObservationVisible]);
|
|
524
532
|
|
|
525
|
-
(0, _react.useEffect)(function () {
|
|
526
|
-
document.addEventListener("click", handleClickOutside);
|
|
527
|
-
return function () {
|
|
528
|
-
document.removeEventListener("click", handleClickOutside);
|
|
529
|
-
};
|
|
530
|
-
}, [isObservationVisible]);
|
|
531
533
|
|
|
532
534
|
var hideObservation = function hideObservation() {
|
|
533
535
|
setObservationVisible(false);
|
|
@@ -2050,8 +2052,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2050
2052
|
setValRejAll(true);
|
|
2051
2053
|
},
|
|
2052
2054
|
isObservationVisible: isObservationVisible,
|
|
2053
|
-
toggleObservation: toggleObservation
|
|
2054
|
-
|
|
2055
|
+
toggleObservation: toggleObservation // handleClickOutside={handleClickOutside}
|
|
2056
|
+
,
|
|
2055
2057
|
hideObservation: hideObservation
|
|
2056
2058
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2057
2059
|
tabsSections: tabsSections,
|
package/package.json
CHANGED
|
@@ -13,7 +13,9 @@ export const ObservationFlag = ({
|
|
|
13
13
|
observation,
|
|
14
14
|
contentObservation,
|
|
15
15
|
dataProduct,
|
|
16
|
-
isObservationVisible, toggleObservation,
|
|
16
|
+
isObservationVisible, toggleObservation,
|
|
17
|
+
// handleClickOutside,
|
|
18
|
+
hideObservation
|
|
17
19
|
}) => {
|
|
18
20
|
const PriorityFlags = {
|
|
19
21
|
["none"]: without,
|
|
@@ -22,7 +24,7 @@ export const ObservationFlag = ({
|
|
|
22
24
|
["high"]: high,
|
|
23
25
|
};
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
//const [isObservationVisible, setObservationVisible] = useState(false);
|
|
26
28
|
const [material, setMaterial] = useState(contentObservation || "");
|
|
27
29
|
const [currentObservation, setCurrentObservation] = useState(observation);
|
|
28
30
|
|
|
@@ -48,12 +50,12 @@ export const ObservationFlag = ({
|
|
|
48
50
|
document.removeEventListener("click", handleClickOutside);
|
|
49
51
|
};
|
|
50
52
|
}, [isObservationVisible]);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, [isObservationVisible, handleClickOutside]);
|
|
53
|
+
// useEffect(() => {
|
|
54
|
+
// document.addEventListener("click", handleClickOutside);
|
|
55
|
+
// return () => {
|
|
56
|
+
// document.removeEventListener("click", handleClickOutside);
|
|
57
|
+
// };
|
|
58
|
+
// }, [isObservationVisible, handleClickOutside]);
|
|
57
59
|
|
|
58
60
|
useEffect(() => {
|
|
59
61
|
setMaterial(contentObservation || "");
|
|
@@ -26,6 +26,8 @@ export const Phase = ({
|
|
|
26
26
|
groups,
|
|
27
27
|
onDeletePhase,
|
|
28
28
|
token,
|
|
29
|
+
showMenu=true,
|
|
30
|
+
showButtonChip=true,
|
|
29
31
|
}) => {
|
|
30
32
|
const [selectedValue, setSelectedValue] = useState([]);
|
|
31
33
|
const [chips, setChips] = useState([]);
|
|
@@ -276,20 +278,20 @@ export const Phase = ({
|
|
|
276
278
|
<div className="phase-sel">
|
|
277
279
|
<p className="text-phase">Siguiente Fase </p>
|
|
278
280
|
<Select
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
281
|
+
value={
|
|
282
|
+
selectedValue.length > 0
|
|
283
|
+
? selectedValue[0]
|
|
284
|
+
: nextPhaseState
|
|
285
|
+
? nextPhaseState
|
|
286
|
+
: ""
|
|
287
|
+
}
|
|
288
|
+
placeholder={`Fase`}
|
|
289
|
+
onChange={(e) => {
|
|
290
|
+
const selectedPhase = phases.find(
|
|
291
|
+
(phase) => phase.phaseName === e.target.value
|
|
292
|
+
);
|
|
293
|
+
setSelectedValue(selectedPhase ? [selectedPhase.phaseId] : []);
|
|
294
|
+
}}
|
|
293
295
|
sx={{
|
|
294
296
|
minWidth: "100px",
|
|
295
297
|
height: "24px",
|
|
@@ -319,37 +321,45 @@ export const Phase = ({
|
|
|
319
321
|
</MenuItem>
|
|
320
322
|
))}
|
|
321
323
|
</Select>
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
324
|
+
{showMenu && (
|
|
325
|
+
<>
|
|
326
|
+
<Button
|
|
327
|
+
id="basic-button"
|
|
328
|
+
aria-controls={open ? "basic-menu" : undefined}
|
|
329
|
+
aria-haspopup="true"
|
|
330
|
+
aria-expanded={open ? "true" : undefined}
|
|
331
|
+
onClick={(e) => handleClick(e)}
|
|
332
|
+
>
|
|
333
|
+
<img src={options} alt="" />
|
|
334
|
+
</Button>
|
|
335
|
+
<Menu
|
|
336
|
+
id="basic-menu"
|
|
337
|
+
anchorEl={anchorEl}
|
|
338
|
+
open={open}
|
|
339
|
+
onClose={handleClose}
|
|
340
|
+
MenuListProps={{
|
|
341
|
+
"aria-labelledby": "basic-button",
|
|
342
|
+
}}
|
|
343
|
+
sx={{
|
|
344
|
+
ul: {
|
|
345
|
+
paddingTop: "0px",
|
|
346
|
+
paddingBottom: "0px",
|
|
347
|
+
},
|
|
348
|
+
}}
|
|
349
|
+
>
|
|
350
|
+
<MenuItem
|
|
351
|
+
onClick={() => onDeletePhase(id)}
|
|
352
|
+
sx={{
|
|
353
|
+
fontSize: "12px",
|
|
354
|
+
color: "#262626",
|
|
355
|
+
minHeight: "auto",
|
|
356
|
+
}}
|
|
357
|
+
>
|
|
358
|
+
Eliminar Fase
|
|
359
|
+
</MenuItem>
|
|
360
|
+
</Menu>
|
|
361
|
+
</>
|
|
362
|
+
)}
|
|
353
363
|
</div>
|
|
354
364
|
</div>
|
|
355
365
|
</div>
|
|
@@ -361,8 +371,8 @@ export const Phase = ({
|
|
|
361
371
|
onDelete={() => handleChipDelete(phaseId, chip)}
|
|
362
372
|
/>
|
|
363
373
|
))}
|
|
364
|
-
|
|
365
|
-
|
|
374
|
+
|
|
375
|
+
{showButtonChip && <GroupSelect
|
|
366
376
|
options={groups
|
|
367
377
|
.filter((group) => group.groupActive === 0)
|
|
368
378
|
.map((group) => ({
|
|
@@ -377,9 +387,10 @@ export const Phase = ({
|
|
|
377
387
|
defaultOption={"Todos los grupos"}
|
|
378
388
|
parameterArray={groupsSelected}
|
|
379
389
|
setParameterArray={setGroupsSelected}
|
|
380
|
-
onClickItem={()=>{
|
|
381
|
-
handleGroupSelect()
|
|
382
|
-
|
|
390
|
+
onClickItem={() => {
|
|
391
|
+
handleGroupSelect();
|
|
392
|
+
}}
|
|
393
|
+
/>}
|
|
383
394
|
</div>
|
|
384
395
|
<Modal
|
|
385
396
|
{...modalData}
|
|
@@ -15,8 +15,8 @@ export const ProductNameHeader = ({
|
|
|
15
15
|
dataProduct,
|
|
16
16
|
isObservationVisible,
|
|
17
17
|
toggleObservation,
|
|
18
|
-
handleClickOutside,
|
|
19
|
-
|
|
18
|
+
// handleClickOutside,
|
|
19
|
+
hideObservation
|
|
20
20
|
}) => {
|
|
21
21
|
const typeFlag =
|
|
22
22
|
productObservation !== null && productObservation !== "" ? "high" : "low";
|
|
@@ -36,8 +36,8 @@ export const ProductNameHeader = ({
|
|
|
36
36
|
dataProduct={dataProduct}
|
|
37
37
|
isObservationVisible ={isObservationVisible}
|
|
38
38
|
toggleObservation = {toggleObservation}
|
|
39
|
-
handleClickOutside = {handleClickOutside}
|
|
40
|
-
|
|
39
|
+
// handleClickOutside = {handleClickOutside}
|
|
40
|
+
hideObservation={hideObservation}
|
|
41
41
|
/>
|
|
42
42
|
<ScreenHeader headerType={"date-header"} text={date} />
|
|
43
43
|
</Container>
|
|
@@ -93,7 +93,6 @@ export const DragAndDropPhases = ({ token}) => {
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
const addPhase = async(phaseName) => {
|
|
96
|
-
console.log("fase nueva", phaseName);
|
|
97
96
|
try {
|
|
98
97
|
const body = {
|
|
99
98
|
name: phaseName,
|
|
@@ -109,7 +108,6 @@ export const DragAndDropPhases = ({ token}) => {
|
|
|
109
108
|
},
|
|
110
109
|
}
|
|
111
110
|
);
|
|
112
|
-
console.log("body", body)
|
|
113
111
|
const createdPhase = response.data.body;
|
|
114
112
|
console.log(createdPhase)
|
|
115
113
|
setInputValue("");
|
|
@@ -258,22 +256,41 @@ const handleDeletePhase = (id) => {
|
|
|
258
256
|
// }, [listPhases]);
|
|
259
257
|
|
|
260
258
|
const renderPhase = (phase, idx) => {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
259
|
+
if (phase.isInitialPhase===1){
|
|
260
|
+
return (
|
|
261
|
+
<Phase
|
|
262
|
+
key={phase.phaseId}
|
|
263
|
+
id={idx}
|
|
264
|
+
phaseId={phase.phaseId}
|
|
265
|
+
phases={listPhases}
|
|
266
|
+
phaseName={phase.phaseName}
|
|
267
|
+
nextPhase={phase.nextPhaseIfApproved}
|
|
268
|
+
groups={phase.groupsAssigned}
|
|
269
|
+
onDeletePhase={() => handleDeletePhase(phase.phaseId)}
|
|
270
|
+
token={token}
|
|
271
|
+
showMenu={false}
|
|
272
|
+
showButtonChip={false}
|
|
273
|
+
/>
|
|
274
|
+
);
|
|
275
|
+
}else{
|
|
276
|
+
return (
|
|
277
|
+
<Phase
|
|
278
|
+
key={phase.phaseId}
|
|
279
|
+
id={idx}
|
|
280
|
+
phaseId={phase.phaseId}
|
|
281
|
+
phases={listPhases}
|
|
282
|
+
phaseName={phase.phaseName}
|
|
283
|
+
nextPhase={phase.nextPhaseIfApproved}
|
|
284
|
+
groups={phase.groupsAssigned}
|
|
285
|
+
onDeletePhase={() => handleDeletePhase(phase.phaseId)}
|
|
286
|
+
// onDragStart={(e) => onDragStart(e, idx)}
|
|
287
|
+
// onDragOver={() => onDragOver(idx)}
|
|
288
|
+
// onDragEnd={onDragEnd}
|
|
289
|
+
token={token}
|
|
290
|
+
/>
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
|
|
277
294
|
};
|
|
278
295
|
|
|
279
296
|
|
|
@@ -20,8 +20,8 @@ export const FullProductNameHeader = ({
|
|
|
20
20
|
productObservation,
|
|
21
21
|
isObservationVisible,
|
|
22
22
|
toggleObservation,
|
|
23
|
-
handleClickOutside,
|
|
24
|
-
|
|
23
|
+
// handleClickOutside,
|
|
24
|
+
hideObservation
|
|
25
25
|
}) => {
|
|
26
26
|
const [retailers, setRetailers] = useState([]);
|
|
27
27
|
|
|
@@ -62,8 +62,8 @@ export const FullProductNameHeader = ({
|
|
|
62
62
|
dataProduct={headerData}
|
|
63
63
|
isObservationVisible ={isObservationVisible}
|
|
64
64
|
toggleObservation = {toggleObservation}
|
|
65
|
-
handleClickOutside ={handleClickOutside}
|
|
66
|
-
|
|
65
|
+
// handleClickOutside ={handleClickOutside}
|
|
66
|
+
hideObservation={hideObservation}
|
|
67
67
|
|
|
68
68
|
/>
|
|
69
69
|
<div className="features-bar-container">
|
|
@@ -236,22 +236,22 @@ export const RetailerProductEdition = ({
|
|
|
236
236
|
const toggleObservation = () => {
|
|
237
237
|
setObservationVisible(!isObservationVisible);
|
|
238
238
|
};
|
|
239
|
-
const handleClickOutside = (event) => {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
useEffect(() => {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}, [isObservationVisible]);
|
|
239
|
+
// const handleClickOutside = (event) => {
|
|
240
|
+
// if (
|
|
241
|
+
// isObservationVisible &&
|
|
242
|
+
// !event.target.closest(".Observation") &&
|
|
243
|
+
// !event.target.closest(".Container")
|
|
244
|
+
// ) {
|
|
245
|
+
// hideObservation();
|
|
246
|
+
// }
|
|
247
|
+
// };
|
|
248
|
+
|
|
249
|
+
// useEffect(() => {
|
|
250
|
+
// document.addEventListener("click", handleClickOutside);
|
|
251
|
+
// return () => {
|
|
252
|
+
// document.removeEventListener("click", handleClickOutside);
|
|
253
|
+
// };
|
|
254
|
+
// }, [isObservationVisible]);
|
|
255
255
|
|
|
256
256
|
const hideObservation = () => {
|
|
257
257
|
setObservationVisible(false);
|
|
@@ -1390,8 +1390,8 @@ export const RetailerProductEdition = ({
|
|
|
1390
1390
|
}}
|
|
1391
1391
|
isObservationVisible={isObservationVisible}
|
|
1392
1392
|
toggleObservation={toggleObservation}
|
|
1393
|
-
handleClickOutside={handleClickOutside}
|
|
1394
|
-
|
|
1393
|
+
// handleClickOutside={handleClickOutside}
|
|
1394
|
+
hideObservation={hideObservation}
|
|
1395
1395
|
/>
|
|
1396
1396
|
<FullTabsMenu
|
|
1397
1397
|
tabsSections={tabsSections}
|