Skip to content

Commit

Permalink
elyra-ai#2244 Dragging Bottom Panel beyond its max height hides Right…
Browse files Browse the repository at this point in the history
… Flyout Buttons (elyra-ai#2245)

Signed-off-by: srikant <[email protected]>
  • Loading branch information
srikant-ch5 authored Nov 27, 2024
1 parent f89a7fd commit 4fb8bd0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import PropTypes from "prop-types";
import { connect } from "react-redux";
import Logger from "../logging/canvas-logger.js";

const MARGIN_TOP = 100;
// Margin must be equal to or greater than the toolbar height
// plus the minimum allowed height for the canvas which is 150px.
const MARGIN_TOP = 200;
const MIN_HEIGHT = 75;

class CanvasBottomPanel extends React.Component {
Expand Down Expand Up @@ -61,13 +63,13 @@ class CanvasBottomPanel extends React.Component {
// Returns a new height for the bottom panel limited by the need to enforce
// a minimum and maximum height.
limitHeight(ht) {
const canvasContainer = document.getElementById(this.props.containingDivId);
const containingDiv = document.getElementById(this.props.containingDivId);
let height = ht;

// canvasContainer may not be available in some test situations
if (canvasContainer) {
const canvasHeight = canvasContainer.getBoundingClientRect().height;
const maxHeight = canvasHeight - MARGIN_TOP;
// containingDiv may not be available in some test situations
if (containingDiv) {
const containingDivHt = containingDiv.getBoundingClientRect().height;
const maxHeight = containingDivHt - MARGIN_TOP;
height = Math.min(Math.max(height, MIN_HEIGHT), maxHeight);
}
return height;
Expand Down
4 changes: 2 additions & 2 deletions canvas_modules/harness/cypress/e2e/canvas/bottom-panel.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ describe("Testing bottom panel", function() {
it("Testing bottom panel max height", function() {
// Test bottom panel does not exceed max-size successfully
cy.moveBottomPanelDivider(50);
cy.verifyBottomPanelHeight(650);
cy.verifyBottomPanelHeight(550);
});

it("Testing bottom panel max height with rightFlyout open", function() {
// Test bottom panel does not exceed max-size successfully with the right flyout open
cy.setCanvasConfig({ "selectedShowRightFlyout": true });
cy.moveBottomPanelDivider(50);
cy.verifyBottomPanelHeight(650.1281127929688);
cy.verifyBottomPanelHeight(550.1281127929688);
cy.verifyBottomPanelWidth(1028);
});

Expand Down

0 comments on commit 4fb8bd0

Please sign in to comment.