You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2017/04/20 18:15:21 UTC

zeppelin git commit: [ZEPPELIN-2420] Slow notebook listing in navbar

Repository: zeppelin
Updated Branches:
  refs/heads/master 652911abe -> 7a0cb6c7a


[ZEPPELIN-2420] Slow notebook listing in navbar

### What is this PR for?

Notebook listing is slow as you can see in the screenshot below.

The problem was,

- angular-bootstrap was updated to 2.5
- then, `dropdown-*` directives should be converted into `uib-dropdown-*`
- otherwise, changes in angular controller scope values will not affect on the directives even though events are fired. (`show.bs.dropdown`, `hide.bs.dropdown`)

```
  function initNotebookListEventListener() {
    angular.element(document).ready(function() {
      angular.element('.notebook-list-dropdown').on('show.bs.dropdown', function() {
        $scope.isDrawNavbarNoteList = true;
      });

      angular.element('.notebook-list-dropdown').on('hide.bs.dropdown', function() {
        $scope.isDrawNavbarNoteList = false;
      });
    });
```

### What type of PR is it?
[Bug Fix]

### Todos

NONE

### What is the Jira issue?

[ZEPPELIN-2420](https://issues.apache.org/jira/browse/ZEPPELIN-2420)

### How should this be tested?

1. Open navbar.
2. Notebook listing should appear immediately.

### Screenshots (if appropriate)

![](https://issues.apache.org/jira/secure/attachment/12863919/12863919_2420.gif)

### Questions:
* Does the licenses files need update? - NO
* Is there breaking changes for older versions? - NO
* Does this needs documentation? - NO

Author: 1ambda <1a...@gmail.com>

Closes #2261 from 1ambda/ZEPPELIN-2420/slow-navbar-notebook-listing and squashes the following commits:

b20b6c6 [1ambda] fix: Revert ng-show -> ng-if
4237def [1ambda] fix: Use uib-dropdown in navbar
0fccc50 [1ambda] style: reformat DOM


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/7a0cb6c7
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/7a0cb6c7
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/7a0cb6c7

Branch: refs/heads/master
Commit: 7a0cb6c7a66e2f2b6b882d1a800e6daa05fc4f8c
Parents: 652911a
Author: 1ambda <1a...@gmail.com>
Authored: Wed Apr 19 10:54:37 2017 +0900
Committer: Lee moon soo <mo...@apache.org>
Committed: Thu Apr 20 11:15:17 2017 -0700

----------------------------------------------------------------------
 zeppelin-web/src/components/navbar/navbar.html | 22 ++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7a0cb6c7/zeppelin-web/src/components/navbar/navbar.html
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/navbar/navbar.html b/zeppelin-web/src/components/navbar/navbar.html
index 890bc5c..4a1115a 100644
--- a/zeppelin-web/src/components/navbar/navbar.html
+++ b/zeppelin-web/src/components/navbar/navbar.html
@@ -25,23 +25,23 @@ limitations under the License.
 
     <div class="collapse navbar-collapse" ng-controller="NavCtrl as navbar">
       <ul class="nav navbar-nav" ng-if="ticket">
-        <li class="dropdown notebook-list-dropdown" dropdown>
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown" dropdown-toggle>Notebook <span class="caret"></span></a>
+        <li class="dropdown notebook-list-dropdown" uib-dropdown>
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown" uib-dropdown-toggle>Notebook <span class="caret"></span></a>
           <ul class="dropdown-menu" role="menu">
             <li ng-controller="NotenameCtrl as notenamectrl"><a href="" data-toggle="modal" data-target="#noteNameModal" ng-click="notenamectrl.getInterpreterSettings()"><i class="fa fa-plus"></i> Create new note</a></li>
             <li class="divider"></li>
             <div id="notebook-list" class="scrollbar-container" ng-if="isDrawNavbarNoteList">
               <li class="filter-names" ng-include="'components/filterNoteNames/filter-note-names.html'"></li>
               <div ng-if="!query.q || query.q === ''">
-              <li ng-repeat="note in navbar.notes.root.children | orderBy:navbar.arrayOrderingSrv.noteListOrdering track by note.id"
-                  ng-class="{'active' : navbar.isActive(note.id)}" ng-include="'components/navbar/navbar-noteList-elem.html'">
-              </li>
-            </div>
-            <div ng-if="query.q">
-              <li ng-repeat="note in navbar.notes.flatList | filter : query.q | orderBy:navbar.arrayOrderingSrv.noteListOrdering track by note.id"
-                  ng-class="{'active' : navbar.isActive(note.id)}" ng-include="'components/navbar/navbar-noteList-elem.html'">
-              </li>
-            </div>
+                <li ng-repeat="note in navbar.notes.root.children | orderBy:navbar.arrayOrderingSrv.noteListOrdering track by note.id"
+                    ng-class="{'active' : navbar.isActive(note.id)}" ng-include="'components/navbar/navbar-noteList-elem.html'">
+                </li>
+              </div>
+              <div ng-if="query.q">
+                <li ng-repeat="note in navbar.notes.flatList | filter : query.q | orderBy:navbar.arrayOrderingSrv.noteListOrdering track by note.id"
+                    ng-class="{'active' : navbar.isActive(note.id)}" ng-include="'components/navbar/navbar-noteList-elem.html'">
+                </li>
+              </div>
             </div>
           </ul>
         </li>