diff --git a/src/app/projects/controllers/project_list_controller.js b/src/app/projects/controllers/project_list_controller.js index 9bc627e5..ce8d902d 100644 --- a/src/app/projects/controllers/project_list_controller.js +++ b/src/app/projects/controllers/project_list_controller.js @@ -27,8 +27,6 @@ angular.module('sb.projects').controller('ProjectListController', function resetScope() { $scope.projectCount = 0; - $scope.projectOffset = 0; - $scope.projectLimit = 10; $scope.projects = []; $scope.error = {}; } @@ -50,16 +48,9 @@ angular.module('sb.projects').controller('ProjectListController', { /*q: $scope.searchQuery || ''*/}, function (result, headers) { - // Extract metadata from returned headers. - var projectCount = headers('X-List-Total') || result.length; - var projectOffset = headers('X-List-Offset') || 0; - var projectLimit = headers('X-List-Limit') || result.length; - // Successful search results, apply the results to the // scope and unset our progress flag. - $scope.projectCount = projectCount; - $scope.projectOffset = projectOffset; - $scope.projectLimit = projectLimit; + $scope.projectCount = headers('X-Total') || result.length; $scope.projects = result; $scope.isSearching = false; }, diff --git a/src/app/projects/controllers/project_story_list_controller.js b/src/app/projects/controllers/project_story_list_controller.js index 944039ac..43a05002 100644 --- a/src/app/projects/controllers/project_story_list_controller.js +++ b/src/app/projects/controllers/project_story_list_controller.js @@ -36,8 +36,6 @@ angular.module('sb.projects').controller('ProjectStoryListController', // Variables and methods available to the template... function resetScope() { $scope.storyCount = 0; - $scope.storyOffset = 0; - $scope.storyLimit = 10; $scope.stories = []; $scope.error = {}; } @@ -58,16 +56,9 @@ angular.module('sb.projects').controller('ProjectStoryListController', {project_id: id}, function (result, headers) { - // Extract metadata from returned headers. - var storyCount = headers('X-List-Total') || result.length; - var storyOffset = headers('X-List-Offset') || 0; - var storyLimit = headers('X-List-Limit') || result.length; - // Successful search results, apply the results to the // scope and unset our progress flag. - $scope.storyCount = storyCount; - $scope.storyOffset = storyOffset; - $scope.storyLimit = storyLimit; + $scope.storyCount = headers('X-Total') || result.length; $scope.stories = result; $scope.isSearching = false; }, diff --git a/src/app/services/provider/page_size.js b/src/app/services/provider/page_size.js new file mode 100644 index 00000000..2be29abf --- /dev/null +++ b/src/app/services/provider/page_size.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + + +/** + * Our globally configured page size. + */ + +angular.module('sb.services').constant('pageSize', 500); \ No newline at end of file diff --git a/src/app/services/provider/storyboard_api_signature.js b/src/app/services/provider/storyboard_api_signature.js index 22fef42a..859dbd95 100644 --- a/src/app/services/provider/storyboard_api_signature.js +++ b/src/app/services/provider/storyboard_api_signature.js @@ -21,7 +21,7 @@ * @author Michael Krotscheck */ angular.module('sb.services') - .factory('storyboardApiSignature', function () { + .factory('storyboardApiSignature', function (pageSize) { 'use strict'; return { @@ -41,7 +41,10 @@ angular.module('sb.services') 'query': { method: 'GET', isArray: true, - responseType: 'json' + responseType: 'json', + params: { + limit: pageSize + } } }; } diff --git a/src/app/stories/controllers/story_list_controller.js b/src/app/stories/controllers/story_list_controller.js index 7e3180c7..2e585723 100644 --- a/src/app/stories/controllers/story_list_controller.js +++ b/src/app/stories/controllers/story_list_controller.js @@ -29,8 +29,6 @@ angular.module('sb.story').controller('StoryListController', // Variables and methods available to the template... function resetScope() { $scope.storyCount = 0; - $scope.storyOffset = 0; - $scope.storyLimit = 10; $scope.stories = []; $scope.error = {}; } @@ -52,16 +50,9 @@ angular.module('sb.story').controller('StoryListController', {}, function (result, headers) { - // Extract metadata from returned headers. - var storyCount = headers('X-List-Total') || result.length; - var storyOffset = headers('X-List-Offset') || 0; - var storyLimit = headers('X-List-Limit') || result.length; - // Successful search results, apply the results to the // scope and unset our progress flag. - $scope.storyCount = storyCount; - $scope.storyOffset = storyOffset; - $scope.storyLimit = storyLimit; + $scope.storyCount = headers('X-Total') || result.length; $scope.stories = result; $scope.isSearching = false; },