Skip to content

Commit 5710fc6

Browse files
committed
fixing jshint errors
1 parent 8ad99a7 commit 5710fc6

File tree

1 file changed

+35
-33
lines changed

1 file changed

+35
-33
lines changed

quick-start/src/main/resources/static/app/services/modalService.js

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
.controller('loadDataModalController', LoadDataModalController)
99
.controller('entityModalController', EntityModalController)
1010
.controller('flowModalController', FlowModalController);
11-
11+
1212
function GetByFieldAndValue() {
1313
return function(field, value, collection) {
1414
var i=0, len=collection.length;
@@ -91,15 +91,15 @@
9191
$scope.mlcpInitialCommand = '';
9292
$scope.mlcpCommand = '';
9393
$scope.groups = [];
94-
94+
9595
$scope.ok = function() {
9696
$uibModalInstance.close($scope.loadDataForm);
9797
};
9898

9999
$scope.cancel = function() {
100100
$uibModalInstance.dismiss();
101101
};
102-
102+
103103
$scope.download = function() {
104104
$scope.loading = true;
105105
DataHub.downloadMlcpOptionsFile($scope.loadDataForm)
@@ -153,7 +153,7 @@
153153
$scope.loadTree(data, node);
154154
});
155155
};
156-
156+
157157
$scope.loadTree = function(data, node) {
158158
if (node == null) { // jshint ignore:line
159159
//initialize root
@@ -163,7 +163,7 @@
163163
}
164164
$scope.showInputPathTreeBrowser = true;
165165
};
166-
166+
167167
$scope.searchPathThenHideTree = function(basePath, node) {
168168
DataHub.searchPath(basePath).success(function(data) {
169169
$scope.loadTree(data, node);
@@ -172,16 +172,16 @@
172172
$scope.showInputPathTreeBrowser = false;
173173
});
174174
};
175-
175+
176176
$scope.dataForTheTree = [];
177-
177+
178178
$scope.searchPathThenHideTree($scope.loadDataForm.inputPath);
179179
$scope.mlcpInitialCommand = constructInitialMlcpCommand(DataHub);
180-
180+
181181
$scope.updateMlcpCommand = function() {
182182
$scope.mlcpCommand = updateMlcpCommand($scope.mlcpInitialCommand, $scope.loadDataForm, $scope.groups);
183183
};
184-
184+
185185
$scope.loadSettings = function() {
186186
DataHub.getJsonFile('/json/inputOptions.json')
187187
.success(function(data) {
@@ -197,50 +197,51 @@
197197
$scope.updateMlcpCommand();
198198
});
199199
};
200-
200+
201201
$scope.loadSettings();
202-
202+
203203
$scope.isText = function(type) {
204204
if(type === 'string' || type === 'comma-list' || type === 'number' || type === 'character') {
205205
return true;
206206
} else {
207207
return false;
208208
}
209209
};
210-
210+
211211
$scope.hideInputPathTreeBrowser = function() {
212212
$scope.showInputPathTreeBrowser = false;
213213
};
214-
214+
215215
$scope.showBasedOnCategoryAndInputFileType = function(category, inputFileType) {
216216
return showBasedOnCategoryAndInputFileType(category, inputFileType);
217217
};
218-
218+
219219
$scope.showIfHasNoFilterFieldOrWithSpecifiedValue = function(field,value,collection) {
220220
if(angular.isUndefined(field) || $filter('GetByFieldAndValue')(field,value,collection)) {
221221
return true;
222222
}
223223
return false;
224224
};
225-
225+
226226
$scope.makeDefaultValueReadOnlyIfApplicable = function($event) {
227227
var elem = $event.currentTarget;
228-
var readOnlyLengthData = elem.getAttribute("data-read-only-length");
228+
var readOnlyLengthData = elem.getAttribute('data-read-only-length');
229229
if(readOnlyLengthData) {
230-
var readOnlyLength = parseInt(readOnlyLengthData);
231-
if (($event.which != 37 && ($event.which != 39))
232-
&& ((elem.selectionStart < readOnlyLength)
233-
|| ((elem.selectionStart === readOnlyLength) && ($event.which === 8)))) {
230+
var readOnlyLength = parseInt(readOnlyLengthData);
231+
if (($event.which !== 37 && ($event.which !== 39)) &&
232+
((elem.selectionStart < readOnlyLength) ||
233+
((elem.selectionStart === readOnlyLength) &&
234+
($event.which === 8)))) {
234235
$event.preventDefault();
235-
return false;
236-
}
236+
return false;
237+
}
237238
}
238239
};
239240
}
240-
241+
241242
/*
242-
* update $scope.groups and add a ReadOnlyLength
243-
* for options with default value to disable removal of default value
243+
* update $scope.groups and add a ReadOnlyLength
244+
* for options with default value to disable removal of default value
244245
* for options with type 'comma-list', set it to the length of the default value
245246
* for options with type 'string', set it to -1 which means it should be readonly
246247
*/
@@ -250,14 +251,15 @@
250251
if(setting.Value) {
251252
if(setting.Type === 'comma-list') {
252253
setting.ReadOnlyLength = setting.Value.length;
253-
} else if(setting.Type === 'string') {
254+
}
255+
else if(setting.Type === 'string') {
254256
setting.ReadOnlyLength = -1;
255-
}
257+
}
256258
}
257259
});
258260
});
259261
}
260-
262+
261263
function updateGroupsBasedOnPreviousSettings(groups, otherOptions) {
262264
if(otherOptions !== null) {
263265
var optionsMap = $.parseJSON(otherOptions);
@@ -271,7 +273,7 @@
271273
});
272274
}
273275
}
274-
276+
275277
function showBasedOnCategoryAndInputFileType(category, inputFileType) {
276278
if(category === 'Delimited text options' && inputFileType !== 'delimited_text') {
277279
return false;
@@ -280,7 +282,7 @@
280282
}
281283
return true;
282284
}
283-
285+
284286
function constructInitialMlcpCommand(DataHub) {
285287
var mlcpCommand = 'mlcp';
286288
var mlcpExtension = '.sh';
@@ -294,13 +296,13 @@
294296
mlcpCommand += ' -password ' + DataHub.status.mlPassword;
295297
return mlcpCommand;
296298
}
297-
299+
298300
function updateMlcpCommand(initialMlcpCommand, loadDataForm, groups) {
299301
var mlcpCommand = initialMlcpCommand;
300302
mlcpCommand += ' -input_file_path ' + loadDataForm.inputPath;
301303
mlcpCommand += ' -input_file_type ' + loadDataForm.inputFileType;
302304
mlcpCommand += ' -output_uri_replace "' + loadDataForm.inputPath + ',\'\'"';
303-
305+
304306
var otherOptions = [];
305307
$.each(groups, function(i, group) {
306308
if(showBasedOnCategoryAndInputFileType(group.category, loadDataForm.inputFileType)) {
@@ -316,7 +318,7 @@
316318
});
317319
}
318320
});
319-
321+
320322
loadDataForm.otherOptions = otherOptions.length > 0 ? JSON.stringify(otherOptions) : null;
321323
return mlcpCommand;
322324
}

0 commit comments

Comments
 (0)