]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8579 Pagination fails on project code page
authorStas Vilchik <vilchiks@gmail.com>
Mon, 16 Jan 2017 09:13:42 +0000 (10:13 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 16 Jan 2017 09:13:42 +0000 (10:13 +0100)
server/sonar-web/src/main/js/apps/code/bucket.js
server/sonar-web/src/main/js/apps/code/utils.js

index 66989f22cbf8d756df41e08e5ddb328608d1e19b..e0cabfbb276bb206985e03bad33a0ce77b090a3c 100644 (file)
@@ -29,8 +29,8 @@ export function getComponent (componentKey) {
   return bucket[componentKey];
 }
 
-export function addComponentChildren (componentKey, children, total) {
-  childrenBucket[componentKey] = { children, total };
+export function addComponentChildren (componentKey, children, total, page) {
+  childrenBucket[componentKey] = { children, total, page };
 }
 
 export function getComponentChildren (componentKey) {
index a4b74f38e33238899687a4375c67cd8446206f46..533c549bc78d42be496a76e52147e32d8ef95fc6 100644 (file)
@@ -142,7 +142,8 @@ export function retrieveComponentChildren (componentKey, isView) {
   if (existing) {
     return Promise.resolve({
       components: existing.children,
-      total: existing.total
+      total: existing.total,
+      page: existing.page
     });
   }
 
@@ -152,7 +153,7 @@ export function retrieveComponentChildren (componentKey, isView) {
       .then(prepareChildren)
       .then(expandRootDir(metrics))
       .then(r => {
-        addComponentChildren(componentKey, r.components, r.total);
+        addComponentChildren(componentKey, r.components, r.total, r.page);
         storeChildrenBase(r.components);
         storeChildrenBreadcrumbs(componentKey, r.components);
         return r;
@@ -201,7 +202,7 @@ export function loadMoreChildren (componentKey, page, isView) {
       .then(prepareChildren)
       .then(expandRootDir(metrics))
       .then(r => {
-        addComponentChildren(componentKey, r.components, r.total);
+        addComponentChildren(componentKey, r.components, r.total, r.page);
         storeChildrenBase(r.components);
         storeChildrenBreadcrumbs(componentKey, r.components);
         return r;