File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
ui/src/components/diagram-maker/edge-properties Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,21 @@ export const NewEdgeProperties = (props: NewEdgePropertiesProps) => {
101
101
102
102
const clientTypesConfig : ClientTypesConfig = getClientTypesConfig ( srcNodeConfig , srcNodeState , destNodeState ) ;
103
103
104
+ const getDefaultName = ( ) => {
105
+ return srcNodeState ?. consumerData ?. name + "-to-" + destNodeState ?. consumerData ?. name ;
106
+ } ;
107
+
108
+ const getName = ( ) => {
109
+ const name = currentEdgeState ?. consumerData ?. name ;
110
+ // name captured as undefined when destNode wasn't added properties with may include `undefined` in name.
111
+ if ( name && ! name . includes ( "undefined" ) ) {
112
+ return name ;
113
+ }
114
+ return getDefaultName ( ) ;
115
+ } ;
116
+
104
117
const [ payload , setPayload ] = React . useState ( {
105
- name : currentEdgeState ?. consumerData ?. name !== undefined ? currentEdgeState ?. consumerData ?. name : "" ,
118
+ name : getName ( ) ,
106
119
isRestServer : clientTypesConfig . isRestServer || false ,
107
120
restServerPort : clientTypesConfig . restServerPort ,
108
121
isGrpcServer : clientTypesConfig . isGrpcServer || false ,
You can’t perform that action at this time.
0 commit comments