fix: indent

```
/Users/1ambda/github/apache/apache-zeppelin/zeppelin-master/zeppelin-web/src/app/visualization/builtins/visualization-scatterchart.js (7/0)
  ✖   71:7   Expected indentation of 4 spaces but found 6   indent
  ✖   75:7   Expected indentation of 4 spaces but found 6   indent
  ✖   82:6   Expected indentation of 4 spaces but found 5   indent
  ✖   83:7   Expected indentation of 7 spaces but found 6   indent
  ✖   85:7   Expected indentation of 7 spaces but found 6   indent
  ✖   87:4   Expected indentation of 2 spaces but found 3   indent
  ✖  231:12  Expected indentation of 8 spaces but found 11  indent
```
This commit is contained in:
1ambda 2017-04-15 01:09:08 +09:00
parent 40125e95c8
commit 59c3996f82
9 changed files with 84 additions and 85 deletions

View file

@ -43,7 +43,6 @@
"arrow-parens": 0,
"no-unneeded-ternary": 0,
"padded-blocks": 0,
"indent": 0,
"no-var": 0,
"space-before-function-paren": 0,
"object-curly-spacing": 0,

View file

@ -101,8 +101,8 @@ function CredentialCtrl($scope, $rootScope, $http, baseUrlSrv, ngToast) {
}
});
}).error(function(data, status, headers, config) {
console.log('Error %o %o', status, data.message);
});
console.log('Error %o %o', status, data.message);
});
};
$scope.toggleAddNewCredentialInfo = function() {

View file

@ -94,18 +94,18 @@ function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeou
$scope.interpreterSettings = data.body;
checkDownloadingDependencies();
}).error(function(data, status, headers, config) {
if (status === 401) {
ngToast.danger({
content: 'You don\'t have permission on this page',
verticalPosition: 'bottom',
timeout: '3000'
});
setTimeout(function() {
window.location.replace('/');
}, 3000);
}
console.log('Error %o %o', status, data.message);
});
if (status === 401) {
ngToast.danger({
content: 'You don\'t have permission on this page',
verticalPosition: 'bottom',
timeout: '3000'
});
setTimeout(function() {
window.location.replace('/');
}, 3000);
}
console.log('Error %o %o', status, data.message);
});
};
var checkDownloadingDependencies = function() {
@ -394,8 +394,8 @@ function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeou
var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
$scope.interpreterSettings.splice(index, 1);
}).error(function(data, status, headers, config) {
console.log('Error %o %o', status, data.message);
});
console.log('Error %o %o', status, data.message);
});
}
}
});
@ -433,7 +433,7 @@ function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeou
var errorMsg = (data !== null) ? data.message : 'Could not connect to server.';
console.log('Error %o %o', status, errorMsg);
ngToast.danger(errorMsg);
});
});
}
}
});
@ -497,9 +497,9 @@ function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeou
$scope.showAddNewSetting = false;
checkDownloadingDependencies();
}).error(function(data, status, headers, config) {
console.log('Error %o %o', status, data.message);
ngToast.danger({content: data.message, verticalPosition: 'bottom'});
});
console.log('Error %o %o', status, data.message);
ngToast.danger({content: data.message, verticalPosition: 'bottom'});
});
};
$scope.cancelInterpreterSetting = function() {
@ -644,8 +644,8 @@ function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeou
.success(function(data, status, headers, config) {
$scope.repositories = data.body;
}).error(function(data, status, headers, config) {
console.log('Error %o %o', status, data.message);
});
console.log('Error %o %o', status, data.message);
});
};
$scope.addNewRepository = function() {
@ -657,8 +657,8 @@ function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeou
$scope.resetNewRepositorySetting();
angular.element('#repoModal').modal('hide');
}).error(function(data, status, headers, config) {
console.log('Error %o %o', headers, config);
});
console.log('Error %o %o', headers, config);
});
};
$scope.removeRepository = function(repoId) {
@ -673,8 +673,8 @@ function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeou
var index = _.findIndex($scope.repositories, {'id': repoId});
$scope.repositories.splice(index, 1);
}).error(function(data, status, headers, config) {
console.log('Error %o %o', status, data.message);
});
console.log('Error %o %o', status, data.message);
});
}
}
});
@ -716,8 +716,8 @@ function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeou
}
window.open(url, '_blank');
}).error(function(data, status, headers, config) {
console.log('Error %o %o', status, data.message);
});
console.log('Error %o %o', status, data.message);
});
};
init();

View file

@ -263,9 +263,9 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope,
}
} else {
ngToast.danger({content: 'There is a problem with this Revision',
verticalPosition: 'top',
dismissOnTimeout: false
});
verticalPosition: 'top',
dismissOnTimeout: false
});
}
};
@ -737,13 +737,13 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope,
$scope.interpreterSettings[index] = data.body;
thisConfirm.close();
}).error(function(data, status, headers, config) {
thisConfirm.close();
console.log('Error %o %o', status, data.message);
BootstrapDialog.show({
title: 'Error restart interpreter.',
message: data.message
thisConfirm.close();
console.log('Error %o %o', status, data.message);
BootstrapDialog.show({
title: 'Error restart interpreter.',
message: data.message
});
});
});
return false;
}
}

View file

@ -841,10 +841,10 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
websocketMsgSrv.getEditorSetting(paragraph.id, interpreterName);
$timeout(
$scope.$on('editorSetting', function(event, data) {
if (paragraph.id === data.paragraphId) {
deferred.resolve(data);
}
if (paragraph.id === data.paragraphId) {
deferred.resolve(data);
}
}
), 1000);
return deferred.promise;
};
@ -1230,42 +1230,42 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
}
if (!$scope.asIframe) {
$scope.paragraph.config = newPara.config;
initializeDefault(newPara.config);
} else {
newPara.config.editorHide = true;
newPara.config.tableHide = false;
$scope.paragraph.config = newPara.config;
}
};
$scope.paragraph.config = newPara.config;
initializeDefault(newPara.config);
} else {
newPara.config.editorHide = true;
newPara.config.tableHide = false;
$scope.paragraph.config = newPara.config;
}
};
$scope.updateParagraph = function(oldPara, newPara, updateCallback) {
$scope.updateParagraph = function(oldPara, newPara, updateCallback) {
// 1. get status, refreshed
const statusChanged = (newPara.status !== oldPara.status);
const resultRefreshed = (newPara.dateFinished !== oldPara.dateFinished) ||
const statusChanged = (newPara.status !== oldPara.status);
const resultRefreshed = (newPara.dateFinished !== oldPara.dateFinished) ||
isEmpty(newPara.results) !== isEmpty(oldPara.results) ||
newPara.status === ParagraphStatus.ERROR ||
(newPara.status === ParagraphStatus.FINISHED && statusChanged);
// 2. update texts managed by $scope
$scope.updateAllScopeTexts(oldPara, newPara);
$scope.updateAllScopeTexts(oldPara, newPara);
// 3. execute callback to update result
updateCallback();
updateCallback();
// 4. update remaining paragraph objects
$scope.updateParagraphObjectWhenUpdated(newPara);
$scope.updateParagraphObjectWhenUpdated(newPara);
// 5. handle scroll down by key properly if new paragraph is added
if (statusChanged || resultRefreshed) {
if (statusChanged || resultRefreshed) {
// when last paragraph runs, zeppelin automatically appends new paragraph.
// this broadcast will focus to the newly inserted paragraph
const paragraphs = angular.element('div[id$="_paragraphColumn_main"]');
if (paragraphs.length >= 2 && paragraphs[paragraphs.length - 2].id.indexOf($scope.paragraph.id) === 0) {
const paragraphs = angular.element('div[id$="_paragraphColumn_main"]');
if (paragraphs.length >= 2 && paragraphs[paragraphs.length - 2].id.indexOf($scope.paragraph.id) === 0) {
// rendering output can took some time. So delay scrolling event firing for sometime.
setTimeout(() => { $rootScope.$broadcast('scrollToCursor'); }, 500);
}
}
setTimeout(() => { $rootScope.$broadcast('scrollToCursor'); }, 500);
}
}
};
/** $scope.$on */
@ -1426,8 +1426,8 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
openEditorAndCloseTable($scope.paragraph);
$timeout(
$scope.$on('updateParagraph', function(event, data) {
deferred.resolve(data);
}
deferred.resolve(data);
}
), 1000);
deferred.promise.then(function(data) {

View file

@ -805,7 +805,7 @@ function ResultCtrl($scope, $rootScope, $route, $window, $routeParams, $location
// Get suggested apps
var noteId = $route.current.pathParams.noteId;
if (!noteId) {
return;
return;
}
$http.get(baseUrlSrv.getRestApiBase() + '/helium/suggest/' + noteId + '/' + paragraph.id)
.success(function(data, status, headers, config) {

View file

@ -67,18 +67,18 @@ function NotebookReposCtrl($http, baseUrlSrv, ngToast) {
vm.notebookRepos = data.body;
console.log('ya notebookRepos %o', vm.notebookRepos);
}).error(function(data, status, headers, config) {
if (status === 401) {
ngToast.danger({
content: 'You don\'t have permission on this page',
verticalPosition: 'bottom',
timeout: '3000'
});
setTimeout(function() {
window.location.replace('/');
}, 3000);
}
console.log('Error %o %o', status, data.message);
});
if (status === 401) {
ngToast.danger({
content: 'You don\'t have permission on this page',
verticalPosition: 'bottom',
timeout: '3000'
});
setTimeout(function() {
window.location.replace('/');
}, 3000);
}
console.log('Error %o %o', status, data.message);
});
}
function _init() {

View file

@ -68,23 +68,23 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization {
chart.xAxis.tickFormat(function(d) { // TODO remove round after bump to nvd3 > 1.8.5
return self.xAxisTickFormat(Math.round(d * 1e3)/1e3, self.xLabels);
});
});
chart.yAxis.tickFormat(function(d) { // TODO remove round after bump to nvd3 > 1.8.5
return self.yAxisTickFormat(Math.round(d * 1e3)/1e3, self.yLabels);
});
});
chart.showDistX(true).showDistY(true);
// handle the problem of tooltip not showing when muliple points have same value.
};
yAxisTickFormat(d, yLabels) {
if (yLabels[d] && (isNaN(parseFloat(yLabels[d])) || !isFinite(yLabels[d]))) { // to handle string type xlabel
if (yLabels[d] && (isNaN(parseFloat(yLabels[d])) || !isFinite(yLabels[d]))) { // to handle string type xlabel
return yLabels[d];
} else {
} else {
return super.yAxisTickFormat(d);
}
}
}
}
selectDefault() {
if (!this.config.xAxis && !this.config.yAxis) {
@ -228,7 +228,7 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization {
for (var i = 0; i < d3gvalues.length - 1;) {
if ((Math.abs(d3gvalues[i]['x'] - d3gvalues[i+1]['x']) < epsilon) &&
(Math.abs(d3gvalues[i]['y'] - d3gvalues[i+1]['y']) < epsilon)) {
d3gvalues.splice(i+1, 1);
d3gvalues.splice(i+1, 1);
} else {
i++;
}

View file

@ -93,8 +93,8 @@ function NoteImportCtrl($scope, $timeout, websocketMsgSrv) {
$scope.note.errorText = 'Unable to Fetch URL';
$scope.$apply();
}}).done(function(data) {
vm.processImportJson(data);
});
vm.processImportJson(data);
});
} else {
$scope.note.errorText = 'Enter URL';
$scope.$apply();