@@ -73,6 +73,8 @@ interface NodeTypesConfig {
73
73
hasRestClients ?: boolean ;
74
74
restConfig ?: RestConfig ;
75
75
isGrpcServer ?: boolean ;
76
+ isGrpcServerNoSQLDB ?: boolean ;
77
+ isGrpcServerSQLDB ?: boolean ;
76
78
hasGrpcClients ?: boolean ;
77
79
grpcConfig ?: GrpcConfig ;
78
80
isWsServer ?: boolean ;
@@ -176,6 +178,8 @@ export const NewNodeProperties = (props: NewNodePropertiesProps) => {
176
178
hasRestClients : nodeTypesConfig . hasRestClients || false ,
177
179
restConfig : nodeTypesConfig . restConfig || getEmptyRestConfig ( ) ,
178
180
isGrpcServer : nodeTypesConfig . isGrpcServer || false ,
181
+ isGrpcServerSQLDB : nodeTypesConfig . isGrpcServerSQLDB || false ,
182
+ isGrpcServerNoSQLDB : nodeTypesConfig . isGrpcServerNoSQLDB || false ,
179
183
hasGrpcClients : nodeTypesConfig . hasGrpcClients || false ,
180
184
grpcConfig : nodeTypesConfig . grpcConfig || getEmptyGrpcConfig ( ) ,
181
185
isWsServer : nodeTypesConfig . isWsServer || false ,
@@ -358,6 +362,8 @@ export const NewNodeProperties = (props: NewNodePropertiesProps) => {
358
362
} ,
359
363
language : '' ,
360
364
isGrpcServer : false ,
365
+ isGrpcServerNoSQLDB : false ,
366
+ isGrpcServerSQLDB : false ,
361
367
isRestServer : false ,
362
368
isRestServerNoSQLDB : false ,
363
369
isRestServerSQLDB : false ,
@@ -426,6 +432,26 @@ export const NewNodeProperties = (props: NewNodePropertiesProps) => {
426
432
} ) ;
427
433
} ;
428
434
435
+ const handleIsGrpcServerSQLDBChange = ( event : ChangeEvent < HTMLInputElement > ) => {
436
+ const grpcConfig : GrpcConfig = payload . grpcConfig ;
437
+ grpcConfig . server . noSQLDB = '' ;
438
+ setPayload ( {
439
+ ...payload ,
440
+ isGrpcServerSQLDB : event . target . checked ,
441
+ grpcConfig,
442
+ } ) ;
443
+ } ;
444
+
445
+ const handleIsGrpcServerNoSQLDBChange = ( event : ChangeEvent < HTMLInputElement > ) => {
446
+ const grpcConfig : GrpcConfig = payload . grpcConfig ;
447
+ grpcConfig . server . sqlDB = '' ;
448
+ setPayload ( {
449
+ ...payload ,
450
+ isGrpcServerNoSQLDB : event . target . checked ,
451
+ grpcConfig
452
+ } ) ;
453
+ } ;
454
+
429
455
const handleIsRestServerSQLDBChange = ( event : ChangeEvent < HTMLInputElement > ) => {
430
456
const restConfig : RestConfig = payload . restConfig ;
431
457
restConfig . server . noSQLDB = '' ;
@@ -677,7 +703,7 @@ export const NewNodeProperties = (props: NewNodePropertiesProps) => {
677
703
</ TextField > ;
678
704
}
679
705
}
680
- return ''
706
+ return '' ;
681
707
} ;
682
708
683
709
const getRestServerSQLDBContent = ( ) => {
@@ -1067,7 +1093,9 @@ export const NewNodeProperties = (props: NewNodePropertiesProps) => {
1067
1093
{ getGrpcTemplateContent ( ) }
1068
1094
{ getGrpcFrameworkContent ( ) }
1069
1095
{ getGrpcServerPortContent ( ) }
1096
+ { getGrpcServerSQLDBCheck ( ) }
1070
1097
{ getGrpcServerSQLDBContent ( ) }
1098
+ { getGrpcServerNoSQLDBCheck ( ) }
1071
1099
{ getGrpcServerNoSQLDBContent ( ) }
1072
1100
{ getGrpcServerResourcesContent ( ) }
1073
1101
</ React . Fragment > ;
@@ -1170,6 +1198,34 @@ export const NewNodeProperties = (props: NewNodePropertiesProps) => {
1170
1198
return [ ] ;
1171
1199
} ;
1172
1200
1201
+ const getGrpcServerSQLDBCheck = ( ) => {
1202
+ return < React . Fragment >
1203
+ < FormControlLabel
1204
+ label = "SQL DB"
1205
+ control = { < Checkbox
1206
+ id = "isGrpcServerSQLDB"
1207
+ disabled = { payload . isGrpcServerNoSQLDB }
1208
+ size = "medium" checked = { payload . isGrpcServerSQLDB }
1209
+ onChange = { handleIsGrpcServerSQLDBChange }
1210
+ /> }
1211
+ />
1212
+ </ React . Fragment > ;
1213
+ } ;
1214
+
1215
+ const getGrpcServerNoSQLDBCheck = ( ) => {
1216
+ return < React . Fragment >
1217
+ < FormControlLabel
1218
+ label = "NoSQL DB"
1219
+ control = { < Checkbox
1220
+ id = "isGrpcServerNoSQLDB"
1221
+ disabled = { payload . isGrpcServerSQLDB }
1222
+ size = "medium" checked = { payload . isGrpcServerNoSQLDB }
1223
+ onChange = { handleIsGrpcServerNoSQLDBChange }
1224
+ /> }
1225
+ />
1226
+ </ React . Fragment > ;
1227
+ } ;
1228
+
1173
1229
const getRestServerSQLDBCheck = ( ) => {
1174
1230
return < React . Fragment >
1175
1231
< FormControlLabel
0 commit comments