Skip to content

ui: Fetch all records in list* API and allow searching in dropdowns#5276

Closed
davidjumani wants to merge 5 commits intoapache:mainfrom
shapeblue:fix-ui-list-api
Closed

ui: Fetch all records in list* API and allow searching in dropdowns#5276
davidjumani wants to merge 5 commits intoapache:mainfrom
shapeblue:fix-ui-list-api

Conversation

@davidjumani
Copy link
Contributor

@davidjumani davidjumani commented Aug 4, 2021

Description

Fixes #3121, also #5338

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)
  • 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
  • Trivial

How Has This Been Tested?

TODO

@davidjumani
Copy link
Contributor Author

davidjumani commented Aug 4, 2021

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

@davidjumani
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@davidjumani davidjumani changed the title ui: Fetching all records in list* API ui: Fetch all records in list* API and allow searching in dropdowns Aug 4, 2021
@davidjumani
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@yadvr
Copy link
Member

yadvr commented Aug 4, 2021

Wouldn't it make the UI slow?

@davidjumani
Copy link
Contributor Author

davidjumani commented Aug 5, 2021

@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

Comment on lines +45 to +53
const pagesize = 10
let page = 1
let items = []
let done = false
let response = null

while (!done) {
args.page = page
args.pagesize = pagesize
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copy link
Contributor Author

@davidjumani davidjumani Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link

@utchoang utchoang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems ok as long as the number of API calls is not too many times it will slow down the system

@davidjumani
Copy link
Contributor Author

@blueorangutan ui

@davidjumani davidjumani added this to the 4.16.0.0 milestone Aug 23, 2021
@davidjumani
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@nvazquez nvazquez linked an issue Aug 25, 2021 that may be closed by this pull request
@davidjumani
Copy link
Contributor Author

@blueorangutan ui

@davidjumani davidjumani marked this pull request as ready for review August 26, 2021 05:12
@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link

@utchoang utchoang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI LGTM!

@davidjumani
Copy link
Contributor Author

Closing to separate into distinct PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

default.ui.page.size changed to 200 not working Paging isn't fully implemented in WebUI

6 participants