-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflow Diagram: "edge merging" (new edge creation) (#2160)
* workflow diagram: add basic dagre layout * workflow-dialog: create dummy drag handlers * workflow diagram: create new edge * styling for interactions * workflow-diagram: update drop target validation rules * style tweak * workflow-diagram: prevent invalid edges being created Very suboptimal implementation, but it works * tidy * workfklow-diagram: fix edge positions * workflow-diagram: tweak layout to look more like it did * workflow-diagram: slightly better edge connection styling * workflow-diagram: rough experiment with bezier edges * edit: stub in path deletion button * workflow-diagram: fixes to dagre layout * workflow-diagram: tweak zoom padding * workflow-diagram: give error feedback on hover * workflow-diagram: adjust error styling * workflow-diagram: add controls with autofit toggle * workflow-diagram: tweak highlight styles * workflow-diagram: change error message * workflow-diagram: styling * workflow-diagram: remove old stuff * workflow-diagram: fix an issue where the edge icon prevented the handle getting a click * workflow-diagram: move controls to bottom left * workflow-diagram: simplify and improve error reporting * delete edges (still needs tests & permissions) * tests for edge deletion * center the buttons * handle style, cleanup assigns * remove dupe * unbreak my heart * add dagre vendor file, tidy dependencies (#2178) --------- Co-authored-by: Taylor Downs <[email protected]>
- Loading branch information
1 parent
b1117bb
commit 18d3d6b
Showing
22 changed files
with
5,022 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assets/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
|
||
import { ExclamationCircleIcon } from '@heroicons/react/24/outline'; | ||
|
||
const ErrorMessage: React.FC<React.ComponentProps<any>> = ({ children }) => { | ||
console.log(children); | ||
return ( | ||
<p className="line-clamp-2 align-left text-xs text-red-500 flex items-center"> | ||
<ExclamationCircleIcon className="mr-1 w-5" /> | ||
{children ?? 'An error occurred'} | ||
</p> | ||
); | ||
}; | ||
|
||
export default ErrorMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { Handle } from 'reactflow'; | ||
import { LinkIcon } from '@heroicons/react/24/outline'; | ||
|
||
function PathButton() { | ||
return ( | ||
<Handle | ||
type="source" | ||
style={{ | ||
position: 'relative', | ||
height: 24, | ||
width: 'auto', | ||
|
||
// These values come from tailwind but have to be set on styles to override reactflow stuff | ||
borderRadius: '0.5rem', | ||
borderWidth: '0', | ||
|
||
// override react flow stuff | ||
transform: 'translate(0,0)', | ||
left: 'auto', | ||
top: 'auto', | ||
cursor: 'pointer', | ||
}} | ||
className="transition duration-150 ease-in-out pointer-events-auto rounded-lg | ||
!bg-indigo-600 hover:!bg-indigo-500 py-1 px-2 text-[0.8125rem] font-semibold leading-5 text-white" | ||
> | ||
<LinkIcon | ||
className="inline h-4 w-4" | ||
style={{ marginTop: '-6px', pointerEvents: 'none' }} | ||
/> | ||
</Handle> | ||
); | ||
} | ||
|
||
export default PathButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
export const FIT_DURATION = 180; | ||
|
||
export const FIT_PADDING = 0.3; | ||
|
||
export const NODE_WIDTH = 180; | ||
|
||
export const NODE_HEIGHT = 40; | ||
export const FIT_PADDING = 0.2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import { EDGE_COLOR_SELECTED } from '../styles'; | ||
import { BezierEdge } from 'reactflow'; | ||
|
||
export default props => { | ||
const { fromX, fromY, toX, toY } = props; | ||
return ( | ||
<BezierEdge | ||
id="tmp" | ||
sourceX={fromX} | ||
sourceY={fromY} | ||
targetX={toX} | ||
targetY={toY} | ||
animated={true} | ||
zIndex={-1} | ||
style={{ | ||
stroke: EDGE_COLOR_SELECTED, | ||
strokeWidth: 4, | ||
strokeDasharray: '4, 4', | ||
opacity: 0.7, | ||
}} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.