@@ -31,15 +31,28 @@ angularAPP.controller('CreateConnectorCtrl', function ($scope, $rootScope, $http
3131 $scope . isDisabledTab = function ( index ) { return ( index == $scope . selectedTabIndex ) ? 'false' : 'true' ; }
3232
3333
34+ $scope . aceLoaded = function ( _editor ) {
35+ console . log ( "Ace for create-connector loaded" ) ;
36+ $scope . editor = _editor ;
37+ $scope . editor . $blockScrolling = Infinity ;
38+ $scope . acePropertyFileSession = _editor . getSession ( ) ;
39+ var lines = 15 ; //$scope.connectorDetails.connectorDetailsInString.split("\n").length;
40+ _editor . setOptions ( {
41+ minLines : lines ,
42+ maxLines : lines ,
43+ highlightActiveLine : false
44+ } ) ;
45+ } ;
46+
3447
3548 //If user changes config from the editor
3649 $scope . $watch ( 'formValuesPerSection' , function ( ) {
3750 if ( $scope . formValuesPerSection ) {
38- console . log ( 'test' , $scope . formValuesPerSection )
51+ // console.log('test', $scope.formValuesPerSection)
3952 $scope . formValuesPerSection = $scope . formValuesPerSection . replace ( "\r" , "" ) ;
40- console . log ( 'test' , $scope . formValuesPerSection )
53+ // console.log('test', $scope.formValuesPerSection)
4154 var flatValuesArray = $scope . formValuesPerSection . split ( "\n" ) ;
42- $scope . curlCommand = NewConnectorFactory . getCurlCommand ( flatValuesArray ) ;
55+ validateConnectorFn ( ) ;
4356 }
4457 } ) ;
4558
@@ -93,6 +106,7 @@ angularAPP.controller('CreateConnectorCtrl', function ($scope, $rootScope, $http
93106 } ) ;
94107 if ( errorConfigs == 0 ) {
95108 $scope . validConfig = constants . VIEW_MESSAGE_CONNECTOR_VALID ;
109+ $scope . curlCommand = NewConnectorFactory . getCurlCommand ( flatValuesArray ) ;
96110 deferred . resolve ( constants . VIEW_MESSAGE_CONNECTOR_VALID ) ;
97111 } else {
98112 deferred . reject ( errorConfigs ) ;
@@ -134,6 +148,7 @@ angularAPP.controller('CreateConnectorCtrl', function ($scope, $rootScope, $http
134148 $rootScope . newConnectorChanges = true ;
135149 } ) ;
136150 } , function ( data , reason ) {
151+ $scope . validConfig = "Please fix the below issues" ;
137152 console . log ( "I can NOT post the connector - as validation errors exist" ) ;
138153 } ) ;
139154
0 commit comments