@@ -69,11 +69,11 @@ angularAPP.controller('CreateConnectorCtrl', function ($scope, $rootScope, $http
6969 var validConnectorConfigKeys = [ ] ;
7070 var requiredConfigKeys = [ ] ;
7171 angular . forEach ( data . configs , function ( config ) {
72- if ( config . value . errors . length > 0 ) {
72+ if ( data . error_count && config . value . errors . length > 0 ) {
7373 errorConfigs . push ( config . value ) ;
7474 $log . info ( config . value . name + ' : ' + config . value . errors [ 0 ] ) ;
7575 }
76- if ( ( config . definition . required == true ) || ( ( config . value . name . indexOf ( "topic" ) == 0 ) && ( config . definition . documentation != "" ) ) ) {
76+ if ( ( config . definition && config . definition . required == true ) || ( ( config . value . name . indexOf ( "topic" ) == 0 ) && ( config . definition . documentation != "" ) ) ) {
7777 requiredConfigKeys . push ( config . value . name ) ;
7878 }
7979 validConnectorConfigKeys . push ( config . value . name ) ;
@@ -150,7 +150,7 @@ angularAPP.controller('CreateConnectorCtrl', function ($scope, $rootScope, $http
150150 if ( a [ a . length - 1 ] . toLowerCase ( ) . indexOf ( 'sink' ) > 0 ) {
151151 type = "Sink" ;
152152 var myElements = [ { key :'name' , value : a [ a . length - 1 ] , required : true } , { key :'connector.class' , value : pluginClass , required : true } , { key :'topics' , value : 'TopicName_' + a [ a . length - 1 ] , required : true } , { key :'tasks.max' , value : 1 , required : true } ] ;
153- } else if ( a [ a . length - 1 ] . toLowerCase ( ) . indexOf ( 'source' ) > 0 ) {
153+ } else {
154154 type = "Source" ;
155155 var myElements = [ { key :'name' , value : a [ a . length - 1 ] , required : true } , { key :'connector.class' , value : pluginClass , required : true } , { key :'tasks.max' , value : 1 , required : true } ] ;
156156 }
@@ -193,7 +193,8 @@ angularAPP.controller('CreateConnectorCtrl', function ($scope, $rootScope, $http
193193
194194 $http ( request ) . then ( function ( data ) {
195195 angular . forEach ( data . data . configs , function ( config ) {
196- if ( config . definition . name !== 'name' && config . definition . name !== 'connector.class' && config . definition . required == true ) {
196+
197+ if ( config . definition && config . definition . name !== 'name' && config . definition . name !== 'connector.class' && config . definition . required == true ) {
197198 connector . template [ 0 ] . sections [ 0 ] . elements . push ( {
198199 key : config . definition . name ,
199200 value : config . definition . default_value ? config . definition . default_value : '' ,
@@ -235,9 +236,10 @@ angularAPP.controller('CreateConnectorCtrl', function ($scope, $rootScope, $http
235236
236237 data . data . configs . forEach ( function ( config ) {
237238 definition = config . definition ;
239+ if ( definition )
238240 name = definition . name ;
239241
240- if ( angular . isUndefined ( $scope . model [ name ] ) ) {
242+ if ( definition && angular . isUndefined ( $scope . model [ name ] ) ) {
241243 optionalConfig [ name ] = model [ name ] = definition . default_value ? definition . default_value : '' ;
242244 }
243245 } ) ;
0 commit comments