You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mi...@apache.org on 2016/06/25 05:47:38 UTC
zeppelin git commit: [ZEPPELIN-1047] Add filter to handle upper case
Repository: zeppelin
Updated Branches:
refs/heads/master 056eee834 -> 330d1da31
[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 <su...@gmail.com>
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
Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/330d1da3
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/330d1da3
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/330d1da3
Branch: refs/heads/master
Commit: 330d1da3133aa062532d73f06b609e64cd0dccdd
Parents: 056eee8
Author: suvam97 <su...@gmail.com>
Authored: Fri Jun 24 02:21:28 2016 -0700
Committer: Mina Lee <mi...@apache.org>
Committed: Fri Jun 24 22:47:27 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/330d1da3/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/330d1da3/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>