Skip to content

Commit

Permalink
fix(listen): Implemented auto paging code
Browse files Browse the repository at this point in the history
All Audio Events are now loaded in a listen segment as opposed to only
the first page of results.

Implemented generic auto pager module to work with results.

Fixes #269
  • Loading branch information
atruskie committed Jun 24, 2016
1 parent 42dac1a commit 736cf3b
Show file tree
Hide file tree
Showing 9 changed files with 925 additions and 414 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ module.exports = function (grunt) {
options: {
livereload: true,
livereloadOnError: false,
spawn: true
spawn: false
},

/**
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"humanize-duration": "^3.4",
"jasmine-expect": "1.x",
"jquery-ui": "~1.11.x",
"lodash": "3.7",
"lodash": "4.0",
"momentjs": "^2.10",
"objectdiff": "https://github.com/NV/objectDiff.js.git",
"round-date": "^1.1",
Expand Down
5 changes: 3 additions & 2 deletions src/components/services/audioEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ angular
.factory(
"AudioEvent",
[
"$resource", "$http", "bawResource", "$url", "conf.paths", "QueryBuilder",
"$resource", "$http", "bawResource", "$url", "conf.paths", "QueryBuilder", "ResultPager",
"baw.models.AudioEvent",
function ($resource, $http, bawResource, $url, paths, QueryBuilder, AudioEventModel) {
function ($resource, $http, bawResource, $url, paths, QueryBuilder, resultPager, AudioEventModel) {
var baseCsvUri = paths.api.routes.audioEvent.csvAbsolute;

var csvOptions = {
Expand Down Expand Up @@ -101,6 +101,7 @@ angular
});

return $http.post(filterUrl, query.toJSON())
.then(resultPager.loadAll)
.then(x => AudioEventModel.makeFromApi(x));
};

Expand Down
Loading

0 comments on commit 736cf3b

Please sign in to comment.