This is an automated email from the ASF dual-hosted git repository. zjffdu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push: new e590e4c [ZEPPELIN-4411] Added current notebook location and name to ui header e590e4c is described below commit e590e4c1facd902ba1a44d894da9d9da528e12ea Author: amakaur <amandeep.k...@applovin.com> AuthorDate: Wed Oct 30 17:18:40 2019 -0700 [ZEPPELIN-4411] Added current notebook location and name to ui header This makes it easier to find the notebook since multiple notebooks can have same name under different path ### What is this PR for? This makes it easier to know which notebook you're currently running and the location of the notebook. ### What type of PR is it? Feature ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-4411 ### How should this be tested? - Create a notebook under a directory - location of the notebook and name will be on the top ### Screenshots (if appropriate)  ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: amakaur <amandeep.k...@applovin.com> Closes #3500 from amakaur/add_notebook_location_ui and squashes the following commits: 579db9df7 [amakaur] Added current notebook location and name to ui header to know where the open notebook is located --- zeppelin-web/src/app/app.controller.js | 6 ++++++ zeppelin-web/src/app/home/home.controller.js | 4 ++++ zeppelin-web/src/app/notebook/notebook-actionBar.html | 2 +- .../src/components/array-ordering/array-ordering.service.js | 8 ++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/zeppelin-web/src/app/app.controller.js b/zeppelin-web/src/app/app.controller.js index 904fbd7..9558ab0 100644 --- a/zeppelin-web/src/app/app.controller.js +++ b/zeppelin-web/src/app/app.controller.js @@ -50,6 +50,12 @@ function MainCtrl($scope, $rootScope, $window, arrayOrderingSrv) { } }; + $rootScope.notePath = function(note) { + if (!_.isEmpty(note)) { + return arrayOrderingSrv.getNotePath(note); + } + }; + BootstrapDialog.defaultOptions.onshown = function() { angular.element('#' + this.id).find('.btn:last').focus(); }; diff --git a/zeppelin-web/src/app/home/home.controller.js b/zeppelin-web/src/app/home/home.controller.js index a7a8924..98038b2 100644 --- a/zeppelin-web/src/app/home/home.controller.js +++ b/zeppelin-web/src/app/home/home.controller.js @@ -150,6 +150,10 @@ function HomeCtrl($scope, noteListFactory, websocketMsgSrv, $rootScope, arrayOrd return arrayOrderingSrv.getNoteName(note); }; + $scope.getNotePath = function(note) { + return arrayOrderingSrv.getNotePath(note); + }; + $scope.noteComparator = function(note1, note2) { return arrayOrderingSrv.noteComparator(note1, note2); }; diff --git a/zeppelin-web/src/app/notebook/notebook-actionBar.html b/zeppelin-web/src/app/notebook/notebook-actionBar.html index 668697b..b2f98e5 100644 --- a/zeppelin-web/src/app/notebook/notebook-actionBar.html +++ b/zeppelin-web/src/app/notebook/notebook-actionBar.html @@ -24,7 +24,7 @@ limitations under the License. tooltip-placement="bottom" uib-tooltip={{noteName(note)}} ng-click="input.showEditor = !revisionView; input.value = note.name" - ng-show="!input.showEditor"><span>{{noteName(note)}}</span></p> + ng-show="!input.showEditor"><span>{{notePath(note)}}</span></p> </div> <div style="float: left; padding-bottom: 10px"> <span class="labelBtn btn-group"> diff --git a/zeppelin-web/src/components/array-ordering/array-ordering.service.js b/zeppelin-web/src/components/array-ordering/array-ordering.service.js index 1f275e6..7bf01e9 100644 --- a/zeppelin-web/src/components/array-ordering/array-ordering.service.js +++ b/zeppelin-web/src/components/array-ordering/array-ordering.service.js @@ -59,4 +59,12 @@ function ArrayOrderingService(TRASH_FOLDER_ID) { return noteName1.localeCompare(noteName2); }; + + this.getNotePath = function(note) { + if (note.path === undefined || note.path.trim() === '') { + return 'Note ' + note.id; + } else { + return note.path; + } + }; }