diff --git a/LICENSE b/LICENSE index 142bd4978e7..c1f6f7eb109 100644 --- a/LICENSE +++ b/LICENSE @@ -235,6 +235,7 @@ The text of each license is also included at licenses/LICENSE-[project]-[version (The MIT License) Simple line icons v1.0.0 (http://thesabbir.github.io/simple-line-icons/) - https://github.com/thesabbir/simple-line-icons/tree/1.0.0 (The MIT License) jekyll-bootstrap 0.3.0 (https://github.com/plusjade/jekyll-bootstrap) - https://github.com/plusjade/jekyll-bootstrap (The MIT License) jekyll 1.3.0 (http://jekyllrb.com/) - https://github.com/jekyll/jekyll/blob/v1.3.0/LICENSE + (The MIT License) ngInfiniteScroll 1.3.4 (https://github.com/sroze/ngInfiniteScroll) - https://github.com/sroze/ngInfiniteScroll/blob/master/LICENSE ======================================================================== MIT-style licenses diff --git a/licenses/LICENSE-ngInfiniteScroll-1.3.4 b/licenses/LICENSE-ngInfiniteScroll-1.3.4 new file mode 100644 index 00000000000..44ae2bfc404 --- /dev/null +++ b/licenses/LICENSE-ngInfiniteScroll-1.3.4 @@ -0,0 +1,22 @@ +Copyright (c) 2012 Michelle Tilley + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/zeppelin-web/bower.json b/zeppelin-web/bower.json index 2b5135f9b8e..3de9f5653a4 100644 --- a/zeppelin-web/bower.json +++ b/zeppelin-web/bower.json @@ -33,7 +33,8 @@ "select2": "^4.0.3", "MathJax": "2.7.0", "ngclipboard": "^1.1.1", - "jsdiff": "3.3.0" + "jsdiff": "3.3.0", + "ngInfiniteScroll": "^1.3.4" }, "devDependencies": { "angular-mocks": "1.5.7" diff --git a/zeppelin-web/karma.conf.js b/zeppelin-web/karma.conf.js index 8a03bec1c2f..3e573a98f17 100644 --- a/zeppelin-web/karma.conf.js +++ b/zeppelin-web/karma.conf.js @@ -87,6 +87,7 @@ module.exports = function(config) { 'bower_components/clipboard/dist/clipboard.js', 'bower_components/ngclipboard/dist/ngclipboard.js', 'bower_components/jsdiff/diff.js', + 'bower_components/ngInfiniteScroll/build/ng-infinite-scroll.js', 'bower_components/angular-mocks/angular-mocks.js', // endbower diff --git a/zeppelin-web/src/app/app.js b/zeppelin-web/src/app/app.js index d46d026858a..5a4c0161588 100644 --- a/zeppelin-web/src/app/app.js +++ b/zeppelin-web/src/app/app.js @@ -44,6 +44,7 @@ const requiredModules = [ 'ngResource', 'ngclipboard', 'angularViewportWatch', + 'infinite-scroll', 'ui.grid', 'ui.grid.exporter', 'ui.grid.edit', 'ui.grid.rowEdit', diff --git a/zeppelin-web/src/app/home/home.controller.js b/zeppelin-web/src/app/home/home.controller.js index 2cf84395558..d2823dd6f6f 100644 --- a/zeppelin-web/src/app/home/home.controller.js +++ b/zeppelin-web/src/app/home/home.controller.js @@ -24,6 +24,7 @@ function HomeCtrl ($scope, noteListFactory, websocketMsgSrv, $rootScope, arrayOr vm.websocketMsgSrv = websocketMsgSrv vm.arrayOrderingSrv = arrayOrderingSrv vm.noteActionService = noteActionService + vm.numberOfNotesDisplayed = window.innerHeight / 20 vm.notebookHome = false vm.noteCustomHome = true @@ -85,6 +86,10 @@ function HomeCtrl ($scope, noteListFactory, websocketMsgSrv, $rootScope, arrayOr } }) + $scope.loadMoreNotes = function () { + vm.numberOfNotesDisplayed += 10 + } + $scope.renameNote = function (nodeId, nodePath) { vm.noteActionService.renameNote(nodeId, nodePath) } diff --git a/zeppelin-web/src/app/home/home.html b/zeppelin-web/src/app/home/home.html index 1ab971898fd..0285754113a 100644 --- a/zeppelin-web/src/app/home/home.html +++ b/zeppelin-web/src/app/home/home.html @@ -40,16 +40,16 @@
Create new note
diff --git a/zeppelin-web/src/app/home/notebook.html b/zeppelin-web/src/app/home/notebook.html index a6f2416a691..ff1eb75f299 100644 --- a/zeppelin-web/src/app/home/notebook.html +++ b/zeppelin-web/src/app/home/notebook.html @@ -27,12 +27,12 @@
Create new note
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 850a5da1cf2..6fa1ad9c28a 100644 --- a/zeppelin-web/src/components/array-ordering/array-ordering.service.js +++ b/zeppelin-web/src/components/array-ordering/array-ordering.service.js @@ -35,8 +35,8 @@ function ArrayOrderingService(TRASH_FOLDER_ID) { } this.noteComparator = function (v1, v2) { - let note1 = v1.value - let note2 = v2.value + let note1 = v1.value || v1 + let note2 = v2.value || v2 if (note1.id === TRASH_FOLDER_ID) { return 1 diff --git a/zeppelin-web/src/components/navbar/expand-collapse/expand-collapse.directive.js b/zeppelin-web/src/components/navbar/expand-collapse/expand-collapse.directive.js index 95e068180db..e4280e865a8 100644 --- a/zeppelin-web/src/components/navbar/expand-collapse/expand-collapse.directive.js +++ b/zeppelin-web/src/components/navbar/expand-collapse/expand-collapse.directive.js @@ -21,11 +21,11 @@ function expandCollapseDirective() { restrict: 'EA', link: function (scope, element, attrs) { angular.element(element).click(function (event) { - if (angular.element(element).find('.expandable:visible').length > 1) { - angular.element(element).find('.expandable:visible').slideUp('slow') + if (angular.element(element).next('.expandable:visible').length > 1) { + angular.element(element).next('.expandable:visible').slideUp('slow') angular.element(element).find('i.fa-folder-open').toggleClass('fa-folder fa-folder-open') } else { - angular.element(element).find('.expandable').first().slideToggle('200', function () { + angular.element(element).next('.expandable').first().slideToggle('200', function () { // do not toggle trash folder if (angular.element(element).find('.fa-trash-o').length === 0) { angular.element(element).find('i').first().toggleClass('fa-folder fa-folder-open') diff --git a/zeppelin-web/src/components/navbar/navbar-note-list-elem.html b/zeppelin-web/src/components/navbar/navbar-note-list-elem.html index ad1f771f2b2..911f1f1f3e8 100644 --- a/zeppelin-web/src/components/navbar/navbar-note-list-elem.html +++ b/zeppelin-web/src/components/navbar/navbar-note-list-elem.html @@ -38,13 +38,13 @@ - + diff --git a/zeppelin-web/src/components/navbar/navbar.controller.js b/zeppelin-web/src/components/navbar/navbar.controller.js index 0ac2f18bb56..e92813b6da1 100644 --- a/zeppelin-web/src/components/navbar/navbar.controller.js +++ b/zeppelin-web/src/components/navbar/navbar.controller.js @@ -30,6 +30,7 @@ function NavCtrl ($scope, $rootScope, $http, $routeParams, $location, vm.showLoginWindow = showLoginWindow vm.TRASH_FOLDER_ID = TRASH_FOLDER_ID vm.isFilterNote = isFilterNote + vm.numberOfNotesDisplayed = 10 $scope.query = {q: ''} @@ -153,6 +154,10 @@ function NavCtrl ($scope, $rootScope, $http, $routeParams, $location, }) } + $scope.loadMoreNotes = function () { + vm.numberOfNotesDisplayed += 10 + } + $scope.calculateTooltipPlacement = function (note) { if (note !== undefined && note.name !== undefined) { let length = note.name.length diff --git a/zeppelin-web/src/components/navbar/navbar.html b/zeppelin-web/src/components/navbar/navbar.html index 597ed511e68..59d65c9936b 100644 --- a/zeppelin-web/src/components/navbar/navbar.html +++ b/zeppelin-web/src/components/navbar/navbar.html @@ -46,13 +46,13 @@
  • -
    -
  • +
  • -
    -
  • +
  • diff --git a/zeppelin-web/src/components/note-list/note-list.factory.js b/zeppelin-web/src/components/note-list/note-list.factory.js index 21abbc046d8..5e2c513821c 100644 --- a/zeppelin-web/src/components/note-list/note-list.factory.js +++ b/zeppelin-web/src/components/note-list/note-list.factory.js @@ -14,7 +14,7 @@ angular.module('zeppelinWebApp').factory('noteListFactory', NoteListFactory) -function NoteListFactory(TRASH_FOLDER_ID) { +function NoteListFactory(arrayOrderingSrv, TRASH_FOLDER_ID) { 'ngInject' const notes = { @@ -42,6 +42,7 @@ function NoteListFactory(TRASH_FOLDER_ID) { return root }, notes.root) + notes.root.children.sort(arrayOrderingSrv.noteComparator) } } diff --git a/zeppelin-web/src/components/note-list/note-list.factory.test.js b/zeppelin-web/src/components/note-list/note-list.factory.test.js index 58d5d420b5c..c16504c8785 100644 --- a/zeppelin-web/src/components/note-list/note-list.factory.test.js +++ b/zeppelin-web/src/components/note-list/note-list.factory.test.js @@ -38,38 +38,38 @@ describe('Factory: NoteList', function () { let folderList = noteList.root.children expect(folderList.length).toBe(5) - expect(folderList[0].name).toBe('A') - expect(folderList[0].id).toBe('000001') - expect(folderList[1].name).toBe('B') + expect(folderList[3].name).toBe('A') + expect(folderList[3].id).toBe('000001') + expect(folderList[4].name).toBe('B') expect(folderList[2].name).toBe('000003') - expect(folderList[3].name).toBe('C') - expect(folderList[3].id).toBe('C') - expect(folderList[3].children.length).toBe(3) - expect(folderList[3].children[0].name).toBe('CA') - expect(folderList[3].children[0].id).toBe('000004') - expect(folderList[3].children[0].children).toBeUndefined() - expect(folderList[3].children[1].name).toBe('CB') - expect(folderList[3].children[1].id).toBe('000005') - expect(folderList[3].children[1].children).toBeUndefined() - expect(folderList[3].children[2].name).toBe('CB') - expect(folderList[3].children[2].id).toBe('C/CB') - expect(folderList[3].children[2].children.length).toBe(3) - expect(folderList[3].children[2].children[0].name).toBe('CBA') - expect(folderList[3].children[2].children[0].id).toBe('000006') - expect(folderList[3].children[2].children[0].children).toBeUndefined() - expect(folderList[3].children[2].children[1].name).toBe('CBA') - expect(folderList[3].children[2].children[1].id).toBe('000007') - expect(folderList[3].children[2].children[1].children).toBeUndefined() - expect(folderList[3].children[2].children[2].name).toBe('CBB') - expect(folderList[3].children[2].children[2].id).toBe('000008') - expect(folderList[3].children[2].children[2].children).toBeUndefined() - expect(folderList[4].name).toBe('D') - expect(folderList[4].id).toBe('D') - expect(folderList[4].children.length).toBe(1) - expect(folderList[4].children[0].name).toBe('D[A') - expect(folderList[4].children[0].id).toBe('D/D[A') - expect(folderList[4].children[0].children[0].name).toBe('DA]B') - expect(folderList[4].children[0].children[0].id).toBe('000009') - expect(folderList[4].children[0].children[0].children).toBeUndefined() + expect(folderList[0].name).toBe('C') + expect(folderList[0].id).toBe('C') + expect(folderList[0].children.length).toBe(3) + expect(folderList[0].children[0].name).toBe('CA') + expect(folderList[0].children[0].id).toBe('000004') + expect(folderList[0].children[0].children).toBeUndefined() + expect(folderList[0].children[1].name).toBe('CB') + expect(folderList[0].children[1].id).toBe('000005') + expect(folderList[0].children[1].children).toBeUndefined() + expect(folderList[0].children[2].name).toBe('CB') + expect(folderList[0].children[2].id).toBe('C/CB') + expect(folderList[0].children[2].children.length).toBe(3) + expect(folderList[0].children[2].children[0].name).toBe('CBA') + expect(folderList[0].children[2].children[0].id).toBe('000006') + expect(folderList[0].children[2].children[0].children).toBeUndefined() + expect(folderList[0].children[2].children[1].name).toBe('CBA') + expect(folderList[0].children[2].children[1].id).toBe('000007') + expect(folderList[0].children[2].children[1].children).toBeUndefined() + expect(folderList[0].children[2].children[2].name).toBe('CBB') + expect(folderList[0].children[2].children[2].id).toBe('000008') + expect(folderList[0].children[2].children[2].children).toBeUndefined() + expect(folderList[1].name).toBe('D') + expect(folderList[1].id).toBe('D') + expect(folderList[1].children.length).toBe(1) + expect(folderList[1].children[0].name).toBe('D[A') + expect(folderList[1].children[0].id).toBe('D/D[A') + expect(folderList[1].children[0].children[0].name).toBe('DA]B') + expect(folderList[1].children[0].children[0].id).toBe('000009') + expect(folderList[1].children[0].children[0].children).toBeUndefined() }) }) diff --git a/zeppelin-web/src/index.html b/zeppelin-web/src/index.html index 9a126f1b437..15a5085f635 100644 --- a/zeppelin-web/src/index.html +++ b/zeppelin-web/src/index.html @@ -166,6 +166,7 @@ +