-
Notifications
You must be signed in to change notification settings - Fork 18
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
[ENG-1354, 1415] Fixes bottom sidesheet and ReactFlow alignment issues #267
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@aqueducthq/common", | ||
"author": "Aqueduct <[email protected]", | ||
"version": "0.0.11", | ||
"version": "0.0.11-rc0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"alias": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import React, { useEffect } from 'react'; | ||
import ReactFlow, { | ||
Edge, | ||
Node as ReactFlowNode, | ||
useReactFlow, | ||
} from 'react-flow-renderer'; | ||
|
@@ -19,23 +18,23 @@ type ReactFlowCanvasProps = { | |
event: React.MouseEvent, | ||
element: ReactFlowNode<ReactFlowNodeData> | ||
) => void; | ||
nodes: ReactFlowNode<ReactFlowNodeData>[]; | ||
edges: Edge[]; | ||
}; | ||
|
||
const ReactFlowCanvas: React.FC<ReactFlowCanvasProps> = ({ | ||
onPaneClicked, | ||
switchSideSheet, | ||
nodes, | ||
edges, | ||
}) => { | ||
const openSideSheetState = useSelector( | ||
(state: RootState) => state.openSideSheetReducer | ||
); | ||
const { fitView } = useReactFlow(); | ||
const dagPositionState = useSelector( | ||
(state: RootState) => state.workflowReducer.selectedDagPosition | ||
); | ||
|
||
const { fitView, viewportInitialized } = useReactFlow(); | ||
useEffect(() => { | ||
fitView(); | ||
}, []); | ||
}, [dagPositionState]); | ||
|
||
useEffect(() => { | ||
// NOTE(vikram): There's a timeout here because there seems to be a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. timeout still needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is still necessary. This has to do with a race condition between the CSS transition for the |
||
|
@@ -48,8 +47,8 @@ const ReactFlowCanvas: React.FC<ReactFlowCanvasProps> = ({ | |
return ( | ||
<ReactFlow | ||
onPaneClick={onPaneClicked} | ||
nodes={nodes} | ||
edges={edges} | ||
nodes={dagPositionState.result?.nodes} | ||
edges={dagPositionState.result?.edges} | ||
onNodeClick={switchSideSheet} | ||
nodeTypes={nodeTypes} | ||
connectionLineStyle={connectionLineStyle} | ||
|
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.
Not super urgent, but we'll need to add this to the EnterpriseMenuSidebar as well. we use different components on enterprise and OSS