Skip to content

Commit

Permalink
Create a new dist version 2.2.1
Browse files Browse the repository at this point in the history
Collecting:
- Fix [UI] UI crash when closing pop-up dialogs (iguazio#315)
- Fix [Chips] Hidden chips block doesn't close (iguazio#316)
- Tests [UI] Add Initial Workflow to Enable GitHub Actions for Forked Repositories (iguazio#319)
  • Loading branch information
ilan7empest committed Sep 17, 2024
1 parent b97f006 commit 6d7cc7c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 27 deletions.
8 changes: 4 additions & 4 deletions commit_message
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@


Create a new dist version 2.2.0
Create a new dist version 2.2.1

Collecting:
- Fix [DRC] Apply ESLint & Prettier Formatting Adjustments (#312)
- Fix [Models endpoints monitoring, metrics] The 'Choose metrics' dropdown is closing unexpectedly (#311)
- Fix [Round Icon] Tooltip doesn't disappear (#313)
- Fix [UI] UI crash when closing pop-up dialogs (#315)
- Fix [Chips] Hidden chips block doesn't close (#316)
- Tests [UI] Add Initial Workflow to Enable GitHub Actions for Forked Repositories (#319)
28 changes: 15 additions & 13 deletions dist/components/PopUpDialog/PopUpDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,21 @@ const PopUpDialog = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
calculateCustomPopUpPosition();
}, [calculateCustomPopUpPosition]);
(0, _react.useEffect)(() => {
const throttledCalculatedCustomPopUpPosition = (0, _lodash.throttle)(calculateCustomPopUpPosition, 100, {
trailing: true,
leading: true
});
const popupObserver = new ResizeObserver(throttledCalculatedCustomPopUpPosition);
const popupElement = ref.current;
popupObserver.observe(popupElement);
window.addEventListener('resize', throttledCalculatedCustomPopUpPosition);
return () => {
popupObserver.unobserve(popupElement);
window.removeEventListener('resize', throttledCalculatedCustomPopUpPosition);
};
}, [calculateCustomPopUpPosition, ref]);
if (showPopUp) {
const throttledCalculatedCustomPopUpPosition = (0, _lodash.throttle)(calculateCustomPopUpPosition, 100, {
trailing: true,
leading: true
});
const popupObserver = new ResizeObserver(throttledCalculatedCustomPopUpPosition);
const popupElement = ref.current;
popupObserver.observe(popupElement);
window.addEventListener('resize', throttledCalculatedCustomPopUpPosition);
return () => {
popupObserver.unobserve(popupElement);
window.removeEventListener('resize', throttledCalculatedCustomPopUpPosition);
};
}
}, [calculateCustomPopUpPosition, ref, showPopUp]);
return showPopUp ? /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
ref: ref,
className: popUpClassNames,
Expand Down
19 changes: 10 additions & 9 deletions dist/hooks/useChipCell.hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,22 @@ const useChipCell = (isEditMode, visibleChipsMaxLength) => {
const hiddenChipsCounterRef = (0, _react.useRef)();
const hiddenChipsPopUpRef = (0, _react.useRef)();
const handleShowElements = (0, _react.useCallback)(event => {
var _hiddenChipsCounterRe2;
if (!isEditMode || isEditMode && visibleChipsMaxLength) {
var _hiddenChipsCounterRe;
if (!((_hiddenChipsCounterRe = hiddenChipsCounterRef.current) !== null && _hiddenChipsCounterRe !== void 0 && _hiddenChipsCounterRe.contains(event.target))) {
setShowHiddenChips(false);
} else {
if ((_hiddenChipsCounterRe = hiddenChipsCounterRef.current) !== null && _hiddenChipsCounterRe !== void 0 && _hiddenChipsCounterRe.contains(event.target) && !showHiddenChips) {
setShowHiddenChips(true);
} else {
setShowHiddenChips(false);
}
}
event && event.stopPropagation();
}, [isEditMode, visibleChipsMaxLength]);
event && ((_hiddenChipsCounterRe2 = hiddenChipsCounterRef.current) === null || _hiddenChipsCounterRe2 === void 0 ? void 0 : _hiddenChipsCounterRe2.contains(event.target)) && event.stopPropagation();
}, [isEditMode, showHiddenChips, visibleChipsMaxLength]);
(0, _react.useEffect)(() => {
if (showHiddenChips) {
window.addEventListener('click', handleShowElements);
return () => window.removeEventListener('click', handleShowElements);
window.addEventListener('click', handleShowElements, true);
}
return () => window.removeEventListener('click', handleShowElements, true);
}, [showHiddenChips, handleShowElements]);
const handleScroll = (0, _react.useCallback)(event => {
if (event.target.parentElement !== (hiddenChipsPopUpRef === null || hiddenChipsPopUpRef === void 0 ? void 0 : hiddenChipsPopUpRef.current)) {
Expand All @@ -68,10 +69,10 @@ const useChipCell = (isEditMode, visibleChipsMaxLength) => {
}, [handleScroll, showHiddenChips]);
const resizeChipCell = (0, _react.useCallback)(() => {
if (hiddenChipsPopUpRef !== null && hiddenChipsPopUpRef !== void 0 && hiddenChipsPopUpRef.current) {
var _hiddenChipsCounterRe2;
var _hiddenChipsCounterRe3;
const scrollableParent = (0, _getFirstScrollableParent.getFirstScrollableParent)(hiddenChipsCounterRef.current.offsetParent);
const scrollableParentRect = scrollableParent.getBoundingClientRect();
const hiddenChipsCounterRect = (_hiddenChipsCounterRe2 = hiddenChipsCounterRef.current) === null || _hiddenChipsCounterRe2 === void 0 ? void 0 : _hiddenChipsCounterRe2.getBoundingClientRect();
const hiddenChipsCounterRect = (_hiddenChipsCounterRe3 = hiddenChipsCounterRef.current) === null || _hiddenChipsCounterRe3 === void 0 ? void 0 : _hiddenChipsCounterRe3.getBoundingClientRect();

// Check if the hiddenChipsCounterRect is outside the boundaries of the scrollableParentRect or the window
if (hiddenChipsCounterRect.left < scrollableParentRect.left || hiddenChipsCounterRect.top < scrollableParentRect.top || hiddenChipsCounterRect.right > scrollableParentRect.right || hiddenChipsCounterRect.bottom > scrollableParentRect.bottom || hiddenChipsCounterRect.right > window.innerWidth || hiddenChipsCounterRect.bottom > window.innerHeight) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iguazio.dashboard-react-controls",
"version": "2.2.0",
"version": "2.2.1",
"description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down

0 comments on commit 6d7cc7c

Please sign in to comment.