-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2137 Resize Right Flyout using drag #2224
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: srikant <[email protected]>
Old PR: #2138 |
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Hi @matthoward366 Is it ok to include |
@nmgokhale can you have a look? |
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
@tomlyn Could you please let me know whether |
@@ -138,7 +138,7 @@ class CommonCanvasPanels extends React.Component { | |||
containingDivId={this.props.containingDivId} | |||
/> | |||
); | |||
const rightFlyout = (<CommonCanvasRightFlyout />); | |||
const rightFlyout = (<CommonCanvasRightFlyout containingDivId={this.props.containingDivId} canvasController={this.props.canvasController} />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this code be structured the same way as we do it for left flyout below? That is, package it in a function; return null if the panel is not open etc. I'd like the code that handles the left flyout and the code that handles the right flyout be as much as possible structured in the same way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to include isRightPanelOpen
also updated common-canvas-test.js
as the condition { showRightFlyout: false }
was failing because of the change.
setRightPanelWidth(wdth) { | ||
this.store.dispatch({ type: "SET_RIGHT_FLYOUT_CONFIG", data: { config: { panelWidth: wdth } } }); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look at the comments this is in a section for 'Bottom panel methods'. There is a section above for 'Right flyout methods' where this code should go.
Also in the 'Right flyout methods' can we add a isRightFlyoutOpen()
method to keep things consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated as per above comment.
Well if it works I suppose it's OK but it isn't the same as the way bottom panel is structured which is what I was looking for or -- as I said previously -- if the way you have written the new code is somehow better than the way bottom panel is done then we should discuss making bottom panel work the same way. I probably haven't looked at it closely enough but I'm not sure why you are using the Also, if we are going to use refs, I thought the appropriate way to create them is to use the |
Also, don't forget we will need a few Cypress tests for this new function. |
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
I have updated the code to be pretty much like
I have removed
I have included some Cypress Tests for the new function. In the build I can see the few Cypress Tests are failing which when I test in my local (even in local prod env) they are passing, so will look into this issue. |
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
…se error Signed-off-by: srikant <[email protected]>
…nable or disable drag Signed-off-by: srikant <[email protected]>
…out false Signed-off-by: srikant <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srikant-ch5 Looks good so far. I added a few comments.
canvas_modules/common-canvas/src/common-canvas/cc-right-flyout.jsx
Outdated
Show resolved
Hide resolved
@@ -420,11 +427,19 @@ class PropertiesMain extends React.Component { | |||
this.setState({ showPropertiesButtons: state }); | |||
} | |||
|
|||
updateRightFlyoutWidth(size) { | |||
const element = document.querySelector(".common-canvas .right-flyout-container"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is creating a dependency from Common Properties on Common Canvas. You could discuss with @matthoward366 @nmgokhale and @caritaou but I don't think we should be doing that. Common Properties and Common Canvas should remained decoupled, so each can always be used independently of the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nmgokhale Would appreciate your feedback on above I can see similar common properties dependancy on common canvas over here
Without enforcing width to right-flyout
in properties
it will look something like below, where the properties content width is set as per custom classnames but flyout width is not reset.
canvas_modules/common-canvas/src/common-canvas/cc-right-flyout.jsx
Outdated
Show resolved
Hide resolved
background: $layer-01; | ||
transition: all 0.2s ease-in; | ||
&:hover { | ||
flex: 0 0 $spacing-01; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for - is it necessary? I took it out and the right flyout seems to size OK. If this is needed to get Common Properties to display correctly? If so it ought to be part of the Common Properties CSS, not here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated above to include spacing-01
in right-flyout-drag
.
But the problem with above spacing is that when a common properties
Accordion
is highlighted on click there is a small gap between right flyout left border and common properties.
I tried to resolve this using common properties css but this is visible in canvas so initially I set the width to 0.5px
so that the gap isn't visible and on hover it will take up 1px
width to match with bottom panel, but I have reverted it now and kept spacing-01
for the right-flyout-drag
.
Screen.Recording.2024-11-12.at.10.42.51.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are concerned about the visual appearance of the UI after you've implemented a change you should be asking @Analuisa-Del-Rivero1 for her decision on how she wants it to appear. Unfortunately your video doesn't show what it looks like with the accordion highlighting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW It's probably best to ask question to Ana in the issue to keep all the design information discussion together in one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you could do a video (or two?) that shows both approaches and what the accordion looks like in each case and explain to her about the difficulty in hovering over the drag area ... and see what she decides.
canvas_modules/common-canvas/src/common-properties/properties-main/properties-main.jsx
Outdated
Show resolved
Hide resolved
…nor changes as per feedback Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Fixes: #2137
Developer's Certificate of Origin 1.1