|
29 | 29 | } |
30 | 30 | }); |
31 | 31 |
|
32 | | - $scope.errorMessage = null; |
33 | | - $scope.hasError = false; |
34 | | - |
35 | 32 | $scope.mlcp = angular.extend({ |
36 | 33 | input_file_type: 'documents', |
37 | 34 | }, mlcpOptions); |
38 | | - |
39 | | - |
| 35 | + |
40 | 36 | function ok() { |
41 | | - if(isValidInputFilePath) { |
42 | | - $uibModalInstance.close($scope.mlcp); |
43 | | - } |
44 | | - } |
45 | | - |
46 | | - function isValidInputFilePath() { |
47 | 37 | if($scope.mlcp.input_file_path) { |
48 | | - $scope.hasError = false; |
49 | | - $scope.errorMessage = null; |
50 | | - return true; |
51 | | - } else { |
52 | | - $scope.hasError = true; |
53 | | - $scope.errorMessage = 'The Location of Files to Load is required.'; |
| 38 | + $uibModalInstance.close($scope.mlcp); |
54 | 39 | } |
55 | 40 | } |
56 | 41 |
|
|
88 | 73 | function isGroupVisible(category) { |
89 | 74 | if(category === 'Delimited Text Options' && $scope.mlcp.input_file_type !== 'delimited_text') { |
90 | 75 | return false; |
91 | | - } else if(category === 'Aggregate XML Options' && $scope.mlcp.input_file_type !== 'aggregates') { |
| 76 | + } |
| 77 | + else if(category === 'Aggregate XML Options' && $scope.mlcp.input_file_type !== 'aggregates') { |
92 | 78 | return false; |
93 | 79 | } |
94 | 80 | return true; |
|
138 | 124 | addMlcpOption(options, 'input_file_path', inputFilePath, true); |
139 | 125 | addMlcpOption(options, 'input_file_type', input_file_type, true); |
140 | 126 | addMlcpOption(options, 'output_uri_replace', '"' + inputFilePath + ',\'\'"', true); |
141 | | - |
| 127 | + |
142 | 128 | angular.forEach(self.groups, function(group) { |
143 | 129 | if (isGroupVisible(group.category)) { |
144 | 130 | $.each(group.settings, function(i, setting) { |
|
155 | 141 | }); |
156 | 142 | return options; |
157 | 143 | } |
158 | | - |
| 144 | + |
159 | 145 | function addMlcpOption(options, key, value, isOtherOption) { |
160 | 146 | options.push('-' + key); |
161 | 147 | if(value) { |
|
177 | 163 | } |
178 | 164 |
|
179 | 165 | $scope.$watch('mlcp.input_file_path', function(value) { |
180 | | - if(isValidInputFilePath(value)) { |
| 166 | + if(value) { |
181 | 167 | searchPath(value); |
182 | 168 | } |
183 | 169 | }); |
|
0 commit comments