-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PipelineGraph and Pipeline Studio visual view integration (#532)
* pipeline-graph-v3 * add size example * context menu example * update pnpm-lock.yaml * move pipeline-edit to pages-v2 * fix broken imports * cleanup * fix; rename types * remove obsolete code * multiple improvements * feat: add v2 route for pipeline studio * prettier css changes --------- Co-authored-by: Abhinav Rastogi <abhinav.rastogi@harness.io>
- Loading branch information
1 parent
ea5937d
commit 347c15d
Showing
137 changed files
with
5,585 additions
and
650 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
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
14 changes: 14 additions & 0 deletions
14
.../pages-v2/pipeline/pipeline-edit/components/graph-implementation/canvas/canvas-button.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export function CanvasButton(props: React.PropsWithChildren<{ onClick: () => void }>) { | ||
const { children, onClick } = props | ||
|
||
return ( | ||
<div | ||
role="button" | ||
tabIndex={0} | ||
onClick={onClick} | ||
className="flex size-8 items-center justify-center border bg-muted text-primary" | ||
> | ||
{children} | ||
</div> | ||
) | ||
} |
20 changes: 20 additions & 0 deletions
20
...ages-v2/pipeline/pipeline-edit/components/graph-implementation/canvas/canvas-controls.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { useCanvasContext } from '@harnessio/pipeline-graph' | ||
|
||
import { CanvasButton } from './canvas-button' | ||
|
||
export function CanvasControls() { | ||
const { fit } = useCanvasContext() | ||
|
||
return ( | ||
<div className="absolute bottom-2 left-2 flex flex-col gap-y-2"> | ||
{/* TODO: uncomment increase/decrease once its fixed in pipeline-graph */} | ||
{/* | ||
<CanvasButton onClick={() => increase()}>+</CanvasButton> | ||
<CanvasButton onClick={() => decrease()}>-</CanvasButton> | ||
*/} | ||
<CanvasButton onClick={() => fit()}> | ||
<div className="size-3 border border-primary"></div> | ||
</CanvasButton> | ||
</div> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
...src/pages-v2/pipeline/pipeline-edit/components/graph-implementation/content-node-types.ts
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,11 @@ | ||
export enum ContentNodeTypes { | ||
add = 'add', | ||
start = 'start', | ||
end = 'end', | ||
step = 'step', | ||
approval = 'approval', | ||
parallel = 'parallel', | ||
serial = 'serial', | ||
stage = 'stage', | ||
form = 'form' | ||
} |
39 changes: 39 additions & 0 deletions
39
...ss/src/pages-v2/pipeline/pipeline-edit/components/graph-implementation/nodes/add-node.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Icon } from '@harnessio/canary' | ||
import { LeafNodeInternalType } from '@harnessio/pipeline-graph' | ||
import { Button } from '@harnessio/ui/components' | ||
|
||
import { useNodeContext } from '../../../context/NodeContextMenuProvider' | ||
import { CommonNodeDataType } from '../types/nodes' | ||
|
||
export interface AddNodeDataType extends CommonNodeDataType {} | ||
|
||
export function AddNode(props: { node: LeafNodeInternalType<AddNodeDataType> }) { | ||
const { node } = props | ||
const { data } = node | ||
|
||
const { handleAddIn } = useNodeContext() | ||
|
||
return ( | ||
<div | ||
className="flex size-full items-center justify-center rounded-full border border-borders-6 bg-primary-foreground" | ||
// TODO | ||
style={{ | ||
border: '1px solid #454545', | ||
background: 'linear-gradient(-47deg, rgba(152, 150, 172, 0.05) 0%, rgba(177, 177, 177, 0.15) 100%)' | ||
}} | ||
> | ||
<Button | ||
className="self-center rounded-full p-3" | ||
style={{ alignSelf: 'center' }} | ||
variant="outline" | ||
size="lg" | ||
onMouseDown={e => e.stopPropagation()} | ||
onClick={e => { | ||
handleAddIn(data, e.currentTarget) | ||
}} | ||
> | ||
<Icon name="plus" size={15} /> | ||
</Button> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.