ZEPPELIN-2403 eslint fix

This commit is contained in:
Tinkoff DWH 2017-04-20 15:49:24 +05:00
parent fd8d27810c
commit a495137ffc
4 changed files with 34 additions and 34 deletions

View file

@ -60,21 +60,21 @@ So, copying `notebook` and `conf` directory should be enough.
### Upgrading from Zeppelin 0.7 to 0.8
- From 0.8, we recommend to use `PYSPARK_PYTHON` and `PYSPARK_DRIVER_PYTHON` instead of `zeppelin.pyspark.python` as `zeppelin.pyspark.python` only effects driver. You can use `PYSPARK_PYTHON` and `PYSPARK_DRIVER_PYTHON` as using them in spark.
- From 0.8, depending on your device, the keyboard shortcut `Ctrl-L` or `Command-L` which goes to the line somewhere user wants is not supported.
- From 0.8, depending on your device, the keyboard shortcut `Ctrl-L` or `Command-L` which goes to the line somewhere user wants is not supported.
- From 0.8, changed the format settings for interpreters (`interpreter.json`)
old format:
```
"interpreterSettings": {
"2CD8TH1XV": {
"id": "2CD8TH1XV",
"name": "spark",
"group": "spark",
"properties": {
"spark.executor.memory": "",
"zeppelin.spark.concurrentSQL": "false",
...
}
"2CD8TH1XV": {
"id": "2CD8TH1XV",
"name": "spark",
"group": "spark",
"properties": {
"spark.executor.memory": "",
"zeppelin.spark.concurrentSQL": "false",
...
}
```
new format:
```
@ -95,4 +95,5 @@ So, copying `notebook` and `conf` directory should be enough.
"widget": "checkbox"
...
}
```
```

View file

@ -36,7 +36,7 @@
"css-loader": "^0.26.1",
"eslint": "^3.19.0",
"eslint-config-google": "^0.7.1",
"eslint-config-standard": "^10.2.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-node": "^4.2.2",
"eslint-plugin-promise": "^3.5.0",

View file

@ -16,10 +16,10 @@ import { ParagraphStatus, } from '../notebook/paragraph/paragraph.status'
angular.module('zeppelinWebApp').controller('InterpreterCtrl', InterpreterCtrl)
function InterpreterCtrl ($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeout, $route) {
function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeout, $route) {
'ngInject'
var interpreterSettingsTmp = []
let interpreterSettingsTmp = []
$scope.interpreterSettings = []
$scope.availableInterpreters = {}
$scope.showAddNewSetting = false
@ -143,17 +143,17 @@ function InterpreterCtrl ($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeo
})
}
var getAvailableInterpreterPropertyWidgets = function () {
let getAvailableInterpreterPropertyWidgets = function () {
$http.get(baseUrlSrv.getRestApiBase() + '/interpreter/property/widgets')
.success(function (data, status, headers, config) {
$scope.interpreterPropertyWidgets = data.body
}).error(function (data, status, headers, config) {
console.log('Error %o %o', status, data.message)
})
console.log('Error %o %o', status, data.message)
})
}
let emptyNewProperty = function(object) {
angular.extend(object, {propertyValue: '', propertyKey: '', propertyWidget: $scope.interpreterPropertyWidgets[0]});
angular.extend(object, {propertyValue: '', propertyKey: '', propertyWidget: $scope.interpreterPropertyWidgets[0]})
}
let emptyNewDependency = function (object) {
@ -194,16 +194,16 @@ function InterpreterCtrl ($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeo
}
}
$scope.defaultValueByWidget = function(setting) {
$scope.defaultValueByWidget = function (setting) {
if (setting.propertyWidget === 'checkbox') {
setting.propertyValue = false
return
}
setting.propertyValue = ''
};
}
$scope.setPerUserOption = function(settingId, sessionOption) {
$scope.setPerUserOption = function (settingId, sessionOption) {
let option
if (settingId === undefined) {
option = $scope.newInterpreterSetting.option
@ -430,7 +430,7 @@ function InterpreterCtrl ($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeo
value: intpInfo[key].defaultValue,
description: intpInfo[key].description,
widget: intpInfo[key].widget
};
}
}
}
$scope.newInterpreterSetting.properties = properties
@ -509,7 +509,7 @@ function InterpreterCtrl ($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeo
newProperties[p] = {value: newSetting.properties[p].value, widget: newSetting.properties[p].widget, name: p}
}
request.properties = newProperties;
request.properties = newProperties
$http.post(baseUrlSrv.getRestApiBase() + '/interpreter/setting', request)
.success(function (data, status, headers, config) {
@ -580,7 +580,7 @@ function InterpreterCtrl ($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeo
$scope.newInterpreterSetting.properties[$scope.newInterpreterSetting.propertyKey] = {
value: $scope.newInterpreterSetting.propertyValue,
widget: $scope.newInterpreterSetting.propertyWidget
};
}
emptyNewProperty($scope.newInterpreterSetting)
} else {
// Add new property from edit form
@ -593,7 +593,7 @@ function InterpreterCtrl ($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeo
setting.properties[setting.propertyKey] = {value: setting.propertyValue, widget: setting.propertyWidget}
emptyNewProperty(setting);
emptyNewProperty(setting)
}
}

View file

@ -12,21 +12,20 @@
* limitations under the License.
*/
angular.module('zeppelinWebApp').directive('widgetNumber', numericOnly);
angular.module('zeppelinWebApp').directive('widgetNumber', numericOnly)
function numericOnly() {
return {
require: 'ngModel',
link: function (scope, element, attrs, modelCtrl) {
modelCtrl.$parsers.push(function (inputValue) {
var transformedInput = inputValue ? inputValue.replace(/[^\d.-]/g, '') : null;
let transformedInput = inputValue ? inputValue.replace(/[^\d.-]/g, '') : null
if (transformedInput !== inputValue) {
modelCtrl.$setViewValue(transformedInput);
modelCtrl.$render();
modelCtrl.$setViewValue(transformedInput)
modelCtrl.$render()
}
return transformedInput;
});
return transformedInput
})
}
};
}
}