Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.6 e6020e605 -> 0b532cda3


[ZEPPELIN-1047] Add filter to handle upper case

### What is this PR for?
The notebook filter in navbar does not filter the results of note if note name 
is given in upper case .

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

### Todos

### What is the Jira issue?
[ZEPPELIN-1047](https://issues.apache.org/jira/browse/ZEPPELIN-1047)

### How should this be tested?
1.Open the notebook filter under navbar -> Notebook menu.
2.Search for any note by giving name in upper case.
3.You should be able to search all the note book names irrespective of case.

### Screenshots (if appropriate)

**BEFORE:**
http://g.recordit.co/jqo7DYXStI.gif

**AFTER:**
http://g.recordit.co/uuCT79uEti.gif

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

Author: suvam97 <[email protected]>

Closes #1066 from suvam97/ZEPPELIN-1047 and squashes the following commits:

6bbbdf1 [suvam97] Merge branch 'master' of https://github.com/apache/zeppelin 
into ZEPPELIN-1047
86477e3 [suvam97] Merge branch 'master' of https://github.com/apache/zeppelin 
into ZEPPELIN-1047
5352f27 [suvam97] Removed notebookFilter function
5f176cb [suvam97] Add filter to hamdle upper case

(cherry picked from commit 330d1da3133aa062532d73f06b609e64cd0dccdd)
Signed-off-by: Mina Lee <[email protected]>


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

Branch: refs/heads/branch-0.6
Commit: 0b532cda3028a5a5785e181d47cad9f91864867a
Parents: e6020e6
Author: suvam97 <[email protected]>
Authored: Fri Jun 24 02:21:28 2016 -0700
Committer: Mina Lee <[email protected]>
Committed: Fri Jun 24 22:47:59 2016 -0700

----------------------------------------------------------------------
 .../src/components/navbar/navbar.controller.js  | 37 --------------------
 zeppelin-web/src/components/navbar/navbar.html  |  3 +-
 2 files changed, 1 insertion(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0b532cda/zeppelin-web/src/components/navbar/navbar.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/navbar/navbar.controller.js 
b/zeppelin-web/src/components/navbar/navbar.controller.js
index 1620934..f13681e 100644
--- a/zeppelin-web/src/components/navbar/navbar.controller.js
+++ b/zeppelin-web/src/components/navbar/navbar.controller.js
@@ -15,43 +15,6 @@
 'use strict';
 
 angular.module('zeppelinWebApp')
-.filter('notebookFilter', function() {
-  return function (notebooks, searchText)
-  {
-    if (!searchText) {
-      return notebooks;
-    }
-
-    var filteringNote = function(notebooks, filteredNotes) {
-      _.each(notebooks, function(notebook) {
-
-        if (notebook.name.toLowerCase().indexOf(searchText) !== -1) {
-          filteredNotes.push(notebook);
-          return notebook;
-        }
-
-        if (notebook.children) {
-          filteringNote(notebook.children, filteredNotes);
-        }
-      });
-    };
-
-    return _.filter(notebooks, function(notebook) {
-      if (notebook.children) {
-        var filteredNotes = [];
-        filteringNote(notebook.children, filteredNotes);
-
-        if (filteredNotes.length > 0) {
-          return filteredNotes;
-        }
-      }
-
-      if (notebook.name.toLowerCase().indexOf(searchText) !== -1) {
-        return notebook;
-      }
-    });
-  };
-})
 .controller('NavCtrl', function($scope, $rootScope, $http, $routeParams,
     $location, notebookListDataFactory, baseUrlSrv, websocketMsgSrv, 
arrayOrderingSrv, searchService) {
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0b532cda/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 9ba2cb1..cfe1559 100644
--- a/zeppelin-web/src/components/navbar/navbar.html
+++ b/zeppelin-web/src/components/navbar/navbar.html
@@ -44,8 +44,7 @@ limitations under the License.
             <li class="divider"></li>
             <div id="notebook-list" class="scrollbar-container">
               <li class="filter-names" 
ng-include="'components/filterNoteNames/filter-note-names.html'"></li>
-              <li ng-repeat="note in navbar.notes.root.children 
|notebookFilter:query track by $index"
-                  ng-class="{'active' : navbar.isActive(note.id)}" 
ng-include="'notebook_list_renderer.html'"></li>
+              <li ng-repeat="note in navbar.notes.root.children | filter:query 
| orderBy:home.arrayOrderingSrv.notebookListOrdering track by $index" 
ng-class="{'active' : navbar.isActive(note.id)}" 
ng-include="'notebook_list_renderer.html'"></li>
             </div>
           </ul>
         </li>

Reply via email to