Repository: incubator-zeppelin Updated Branches: refs/heads/master 94c7375ae -> 3f87f448a
Fix Interpreter Group in Zeppelin-web After #56 Interpreter creation was broken. (There was the new group.name interpreter feature to handle) This PR handles it. Author: Damien Corneau <[email protected]> Closes #138 from corneadoug/fix/interpreterDropdown and squashes the following commits: 076fc2b [Damien Corneau] Fix Interpreter Group in Zeppelin-web Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/3f87f448 Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/3f87f448 Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/3f87f448 Branch: refs/heads/master Commit: 3f87f448a4487c6fca96e6e36a5542823476af52 Parents: 94c7375 Author: Damien Corneau <[email protected]> Authored: Fri Jul 3 20:16:22 2015 +0900 Committer: Lee moon soo <[email protected]> Committed: Fri Jul 3 10:33:30 2015 -0700 ---------------------------------------------------------------------- zeppelin-web/bower.json | 3 ++- zeppelin-web/src/app/app.js | 1 + .../interpreter-create/interpreter-create.html | 6 +++-- .../app/interpreter/interpreter.controller.js | 23 ++++++++++++++++---- zeppelin-web/src/index.html | 1 + 5 files changed, 27 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/3f87f448/zeppelin-web/bower.json ---------------------------------------------------------------------- diff --git a/zeppelin-web/bower.json b/zeppelin-web/bower.json index 57ea00d..2ee0032 100644 --- a/zeppelin-web/bower.json +++ b/zeppelin-web/bower.json @@ -24,7 +24,8 @@ "angular-elastic-input": "~2.0.1", "angular-xeditable": "0.1.8", "highlightjs": "~8.4.0", - "lodash": "~3.9.3" + "lodash": "~3.9.3", + "angular-filter": "~0.5.4" }, "devDependencies": { "angular-mocks": "1.3.8", http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/3f87f448/zeppelin-web/src/app/app.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/app.js b/zeppelin-web/src/app/app.js index 0d163d9..6dfa8e5 100644 --- a/zeppelin-web/src/app/app.js +++ b/zeppelin-web/src/app/app.js @@ -27,6 +27,7 @@ angular.module('zeppelinWebApp', [ 'ui.sortable', 'ngTouch', 'ngDragDrop', + 'angular.filter', 'monospaced.elastic', 'puElasticInput', 'xeditable' http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/3f87f448/zeppelin-web/src/app/interpreter/interpreter-create/interpreter-create.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/interpreter/interpreter-create/interpreter-create.html b/zeppelin-web/src/app/interpreter/interpreter-create/interpreter-create.html index e7096f6..b181ed3 100644 --- a/zeppelin-web/src/app/interpreter/interpreter-create/interpreter-create.html +++ b/zeppelin-web/src/app/interpreter/interpreter-create/interpreter-create.html @@ -29,7 +29,9 @@ limitations under the License. style="width:180px"> <select class="form-control input-sm" ng-model="newInterpreterSetting.group" ng-change="newInterpreterGroupChange()"> - <option ng-repeat="(groupName, interpreterGroup) in availableInterpreters" value="{{groupName}}">{{groupName}}</option> + <option ng-repeat="availableInterpreter in availableInterpreters | unique: 'group'" value="{{availableInterpreter.group}}"> + {{availableInterpreter.group}} + </option> </select> </div> @@ -43,7 +45,7 @@ limitations under the License. </tr> <tr ng-repeat="(key, value) in newInterpreterSetting.properties"> <td>{{key}}</td> - <td><textarea msd-elastic ng-model="value.value" ng-init="value.value = value.defaultValue"></textarea></td> + <td><textarea msd-elastic ng-model="value.value"></textarea></td> <td>{{value.description}}</td> <td> <div class="btn btn-default btn-sm fa fa-remove" ng-click="removeInterpreterProperty(key)"> http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/3f87f448/zeppelin-web/src/app/interpreter/interpreter.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/interpreter/interpreter.controller.js b/zeppelin-web/src/app/interpreter/interpreter.controller.js index 499c270..a671ec9 100644 --- a/zeppelin-web/src/app/interpreter/interpreter.controller.js +++ b/zeppelin-web/src/app/interpreter/interpreter.controller.js @@ -105,7 +105,20 @@ angular.module('zeppelinWebApp').controller('InterpreterCtrl', function($scope, }; $scope.newInterpreterGroupChange = function() { - $scope.newInterpreterSetting.properties = $scope.availableInterpreters[$scope.newInterpreterSetting.group].properties; + var el = _.pluck(_.filter($scope.availableInterpreters, { 'group': $scope.newInterpreterSetting.group }), 'properties'); + + var properties = {}; + for (var i=0; i < el.length; i++) { + var intpInfo = el[i]; + for (var key in intpInfo) { + properties[key] = { + value : intpInfo[key].defaultValue, + description : intpInfo[key].description + }; + } + } + + $scope.newInterpreterSetting.properties = properties; }; $scope.restartInterpreterSetting = function(settingId) { @@ -152,7 +165,6 @@ angular.module('zeppelinWebApp').controller('InterpreterCtrl', function($scope, }); }; - $scope.resetNewInterpreterSetting = function() { $scope.newInterpreterSetting = { name : undefined, @@ -179,11 +191,14 @@ angular.module('zeppelinWebApp').controller('InterpreterCtrl', function($scope, if (!$scope.newInterpreterSetting.propertyKey || $scope.newInterpreterSetting.propertyKey === '') { return; } - $scope.newInterpreterSetting.properties[$scope.newInterpreterSetting.propertyKey] = $scope.newInterpreterSetting.propertyValue; + + $scope.newInterpreterSetting.properties[$scope.newInterpreterSetting.propertyKey] = { + value: $scope.newInterpreterSetting.propertyValue + }; emptyNewProperty($scope.newInterpreterSetting); } else { - // Add new property from create form + // Add new property from edit form var index = _.findIndex($scope.interpreterSettings, { 'id': settingId }); var setting = $scope.interpreterSettings[index]; http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/3f87f448/zeppelin-web/src/index.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/index.html b/zeppelin-web/src/index.html index 5676afa..ed0ccf4 100644 --- a/zeppelin-web/src/index.html +++ b/zeppelin-web/src/index.html @@ -100,6 +100,7 @@ limitations under the License. <script src="bower_components/angular-xeditable/dist/js/xeditable.js"></script> <script src="bower_components/highlightjs/highlight.pack.js"></script> <script src="bower_components/lodash/lodash.js"></script> + <script src="bower_components/angular-filter/dist/angular-filter.js"></script> <!-- endbower --> <!-- endbuild --> <!-- build:js({.tmp,src}) scripts/scripts.js -->
