You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/08/04 12:22:24 UTC

[GitHub] [cloudstack] davidjumani opened a new pull request #5276: ui: Fetching all records in list* API

davidjumani opened a new pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276


   ### Description
   
   Fixes https://github.com/apache/cloudstack/issues/3121
   
   Ensures that all records are fetched for any list* API when page is not part of the parameters passed
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [x] Trivial
   
   ### How Has This Been Tested?
   TODO
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-909876963


   Closing to separate into distinct PRs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-903660624


   @davidjumani a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5276: ui: Fetching all records in list* API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892629166


   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/5276 (SL-JID-475)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #5276: ui: Fetching all records in list* API

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892613361


   Please ignore the console.log and the pagesize set to 10. Was done deliberately so that anyone reviewing can see it in action rather than creating 1000 records for any item


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892700358


   @blueorangutan ui


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892704258


   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/5276 (SL-JID-476)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani edited a comment on pull request #5276: ui: Fetching all records in list* API

Posted by GitBox <gi...@apache.org>.
davidjumani edited a comment on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892613361






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani edited a comment on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani edited a comment on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-893154573


   @rhtyd Hardly, will set the pagesize to 500 (default) so that most calls won't need to be repeated
   This won't affect listview but only forms


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-903663439


   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/5276 (SL-JID-552)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on a change in pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani commented on a change in pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#discussion_r686632426



##########
File path: ui/src/api/index.js
##########
@@ -29,14 +29,73 @@ export function api (command, args = {}, method = 'GET', data = {}) {
     })
   }
 
-  return axios({
-    params: {
-      ...args
-    },
-    url: '/',
-    method,
-    data: params || {}
-  })
+  const exemptedAPIs = ['listLdapConfigurations', 'listCapabilities', 'listIdps', 'listApis', 'listInfrastructure', 'listAndSwitchSamlAccount']
+
+  if ('page' in args || exemptedAPIs.includes(command) || !command.startsWith('list')) {
+    return axios({
+      params: {
+        ...args
+      },
+      url: '/',
+      method,
+      data: params || {}
+    })
+  }
+
+  const pagesize = 10
+  let page = 1
+  let items = []
+  let done = false
+  let response = null
+
+  while (!done) {
+    args.page = page
+    args.pagesize = pagesize

Review comment:
       10 is a placeholder now since `default.page.size` is generally 500 and it would be difficult to see it in the test env. Will change it to `default.page.size` after people test and get back




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-903608614


   @blueorangutan ui


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-903660057


   @blueorangutan ui


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-906103169


   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/5276 (SL-JID-567)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892729155


   Wouldn't it make the UI slow?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892700771


   @davidjumani a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] shwstppr commented on a change in pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
shwstppr commented on a change in pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#discussion_r685985535



##########
File path: ui/src/api/index.js
##########
@@ -29,14 +29,73 @@ export function api (command, args = {}, method = 'GET', data = {}) {
     })
   }
 
-  return axios({
-    params: {
-      ...args
-    },
-    url: '/',
-    method,
-    data: params || {}
-  })
+  const exemptedAPIs = ['listLdapConfigurations', 'listCapabilities', 'listIdps', 'listApis', 'listInfrastructure', 'listAndSwitchSamlAccount']
+
+  if ('page' in args || exemptedAPIs.includes(command) || !command.startsWith('list')) {
+    return axios({
+      params: {
+        ...args
+      },
+      url: '/',
+      method,
+      data: params || {}
+    })
+  }
+
+  const pagesize = 10
+  let page = 1
+  let items = []
+  let done = false
+  let response = null
+
+  while (!done) {
+    args.page = page
+    args.pagesize = pagesize

Review comment:
       @davidjumani do we use `default.ui.page.size` global setting in the UI?
   
   And just want to know if I have 1000 VMs in my env and I open AttachVolume form will this call listVirtualMachines API 100 times?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-909876963


   Closing to separate into distinct PRs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5276: ui: Fetching all records in list* API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892626029






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #5276: ui: Fetching all records in list* API

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892625544


   @blueorangutan ui


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892729155


   Wouldn't it make the UI slow?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-893154573


   @rhtyd Hardly, will set the pagesize to 500 (default) so that most calls won't need to be repeated


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-906100933


   @blueorangutan ui


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani closed pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani closed pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani closed pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani closed pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani edited a comment on pull request #5276: ui: Fetching all records in list* API

Posted by GitBox <gi...@apache.org>.
davidjumani edited a comment on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892613361


   Please ignore the console.log and the pagesize set to 10. Was done deliberately so that anyone reviewing can see it in action rather than creating 1000 records for any item. Will be removed once approved


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on a change in pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
davidjumani commented on a change in pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#discussion_r686632426



##########
File path: ui/src/api/index.js
##########
@@ -29,14 +29,73 @@ export function api (command, args = {}, method = 'GET', data = {}) {
     })
   }
 
-  return axios({
-    params: {
-      ...args
-    },
-    url: '/',
-    method,
-    data: params || {}
-  })
+  const exemptedAPIs = ['listLdapConfigurations', 'listCapabilities', 'listIdps', 'listApis', 'listInfrastructure', 'listAndSwitchSamlAccount']
+
+  if ('page' in args || exemptedAPIs.includes(command) || !command.startsWith('list')) {
+    return axios({
+      params: {
+        ...args
+      },
+      url: '/',
+      method,
+      data: params || {}
+    })
+  }
+
+  const pagesize = 10
+  let page = 1
+  let items = []
+  let done = false
+  let response = null
+
+  while (!done) {
+    args.page = page
+    args.pagesize = pagesize

Review comment:
       10 is a placeholder now since `default.ui.page.size` is generally 500 and it would be difficult to see it in the test env. Will change it to `default.ui.page.size` after people test and get back




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5276: ui: Fetching all records in list* API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892626029


   @davidjumani a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5276: ui: Fetch all records in list* API and allow searching in dropdowns

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-906101428


   @davidjumani a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #5276: ui: Fetching all records in list* API

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #5276:
URL: https://github.com/apache/cloudstack/pull/5276#issuecomment-892613361






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org