File tree Expand file tree Collapse file tree 5 files changed +39
-25
lines changed
Expand file tree Collapse file tree 5 files changed +39
-25
lines changed Original file line number Diff line number Diff line change 1- import { FC } from 'react' ;
1+ import React , { FC } from 'react' ;
2+ import { Node } from 'react-flow-renderer' ;
23import './index.less' ;
34export interface IPipelineInitNode {
4- label : string | Element ;
5+ label : React . ReactNode ;
6+ enable : boolean ;
57 selected ?: boolean ;
68 selectable ?: boolean ;
79 [ key : string ] : any ;
810}
911export interface IPipelineInitNodeProps {
1012 nodes : IPipelineInitNode [ ] ;
11- onClick ?: ( node : IPipelineInitNode ) => void ;
13+ onClick ?: ( node : Node < any > ) => void ;
1214}
1315export declare const PipelineInitNode : FC < IPipelineInitNodeProps > ;
Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ var getData = function getData(nodes) {
152152 } ,
153153 draggable : false ,
154154 connectable : false ,
155+ className : '' . concat ( _node . className , ' ' ) . concat ( _node . enable ? 'enable' : '' ) ,
155156 } ,
156157 _node ,
157158 ) ;
@@ -182,8 +183,6 @@ var getData = function getData(nodes) {
182183 lastNode = nodeObj ;
183184 }
184185
185- console . log ( 'newNodes' , newNodes ) ;
186- console . log ( 'newEdges' , newEdges ) ;
187186 return {
188187 newNodes : newNodes ,
189188 newEdges : newEdges ,
@@ -206,8 +205,6 @@ export var PipelineInitNode = function PipelineInitNode(props) {
206205
207206 useEffect (
208207 function ( ) {
209- console . log ( 'originNodes' , originNodes ) ;
210-
211208 var _getData = getData ( originNodes ) ,
212209 newNodes = _getData . newNodes ,
213210 newEdges = _getData . newEdges ;
Original file line number Diff line number Diff line change 11.serverless-cd-pipeline-init-container {
22 min-height : 200px ;
3- .react-flow__node.circle {
4- display : flex ;
5- align-items : center ;
6- justify-content : center ;
7- width : 60px ;
8- height : 60px ;
9- color : white ;
10- font-weight : 700 ;
11- background : #2b6cb0 ;
12- border-radius : 50% ;
13- cursor : unset ;
14- }
15- .react-flow__node-default.selectable.selected {
16- color : #0070cc ;
17- border-color : #0070cc ;
18- box-shadow : 0 0 0 0.5px #0070cc !important ;
3+ .react-flow__node {
4+ & .circle {
5+ display : flex ;
6+ align-items : center ;
7+ justify-content : center ;
8+ width : 60px ;
9+ height : 60px ;
10+ color : white ;
11+ font-weight : 700 ;
12+ background : #2b6cb0 ;
13+ border : 1px solid #1a192b ;
14+ border-radius : 50% ;
15+ cursor : unset ;
16+ & .selected {
17+ color : white ;
18+ background : #2b6cb0 ;
19+ border : 1px solid #1a192b ;
20+ box-shadow : unset !important ;
21+ }
22+ }
23+ border : 1px solid #ccc ;
24+ & .enable {
25+ border : 1px solid #0070cc ;
26+ }
27+ & .selected {
28+ font-weight : bold ;
29+ background : #ebf4fb ;
30+ border : 1px solid #0070cc ;
31+ box-shadow : 0 0 0 0.5px #0070cc !important ;
32+ }
1933 }
2034 .react-flow__attribution {
2135 display : none ;
Original file line number Diff line number Diff line change 1+ import { ReactNode } from 'react' ;
12import { Node } from 'react-flow-renderer' ;
23export declare enum IPipelineProcessNodeStatus {
34 PENDING = 'pending' ,
@@ -14,7 +15,7 @@ export declare enum IPipelineProcessNodeStatusColor {
1415 warn = 'rgb(255, 164, 61)' ,
1516}
1617export interface IPipelineProcessNode {
17- label : string | Element ;
18+ label : ReactNode ;
1819 status ?: `${IPipelineProcessNodeStatus } `;
1920 selected ?: boolean ;
2021 selectable ?: boolean ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @serverless-cd/ui" ,
3- "version" : " 0.0.2 " ,
3+ "version" : " 0.0.3 " ,
44 "scripts" : {
55 "start" : " dumi dev" ,
66 "docs:build" : " dumi build" ,
You can’t perform that action at this time.
0 commit comments