-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pipelines): Handle collapsed groups better (#186)
- Loading branch information
1 parent
9d21ab6
commit 8c5ae7a
Showing
21 changed files
with
983 additions
and
239 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
33 changes: 18 additions & 15 deletions
33
packages/demo-app-ts/src/demos/pipelineGroupsDemo/DemoTaskEdge.tsx
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,24 +1,27 @@ | ||
import * as React from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import { Edge, EdgeTerminalType, GraphElement, TaskEdge } from '@patternfly/react-topology'; | ||
import { | ||
DEFAULT_SPACER_NODE_TYPE, | ||
Edge, | ||
EdgeTerminalType, | ||
GraphElement, | ||
TaskEdge | ||
} from '@patternfly/react-topology'; | ||
|
||
interface DemoTaskEdgeProps { | ||
element: GraphElement; | ||
} | ||
|
||
const DemoTaskEdge: React.FunctionComponent<DemoTaskEdgeProps> = ({ element, ...props }) => { | ||
|
||
const isDependency = (element as Edge).getTarget().getData()?.isDependency; | ||
|
||
return ( | ||
<TaskEdge | ||
element={element as Edge} | ||
endTerminalType={ | ||
isDependency ? EdgeTerminalType.directional : EdgeTerminalType.none | ||
} | ||
{...props} | ||
/> | ||
); | ||
}; | ||
const DemoTaskEdge: React.FunctionComponent<DemoTaskEdgeProps> = ({ element, ...props }) => ( | ||
<TaskEdge | ||
element={element as Edge} | ||
endTerminalType={ | ||
(element as Edge).getTarget().getType() !== DEFAULT_SPACER_NODE_TYPE | ||
? EdgeTerminalType.directional | ||
: undefined | ||
} | ||
{...props} | ||
/> | ||
); | ||
|
||
export default observer(DemoTaskEdge); |
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
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.