Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit lists to a certain number of entities #2961

Merged
merged 32 commits into from
Jan 8, 2019
Merged

Limit lists to a certain number of entities #2961

merged 32 commits into from
Jan 8, 2019

Conversation

richard-cox
Copy link
Contributor

@richard-cox richard-cox commented Sep 6, 2018

  • Allow a paginated action to define a maximum number of entities it should fetch. If this is exceeded do not depaginate response (fetch all pages in one go)
  • In the list component show a custom warning message when there are too many results
  • Allow user to reduce results by filtering server side
  • Wire in above to app wall
  • To test update GetAllApplications 'flattenPaginationMax' to 10
  • fixes Scalability: Application Wall #2895

- Allow max results value to be stored and depagination aborted if exceeded
- Show custom warning message when there are too many results
- Allow user to reduce results by filtering
- Wire in above to app wall
- To test update GetAllApplications 'flattenPaginationMax' to 10
@cfdreddbot
Copy link

Hey richard-cox!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

@codecov
Copy link

codecov bot commented Sep 6, 2018

Codecov Report

Merging #2961 into v2-master will increase coverage by 0.13%.
The diff coverage is 73.38%.

@@              Coverage Diff              @@
##           v2-master    #2961      +/-   ##
=============================================
+ Coverage      70.74%   70.87%   +0.13%     
=============================================
  Files            644      653       +9     
  Lines          28485    28862     +377     
  Branches        6464     6564     +100     
=============================================
+ Hits           20152    20457     +305     
- Misses          8333     8405      +72

@KlapTrap KlapTrap added needs attention This PR needs attention and removed ready for review labels Sep 20, 2018
@KlapTrap
Copy link
Contributor

Bug:

  1. Go to the app wall
  2. Select a Cloud Foundry that has applications in the top filter panel
  3. Select an Organisation that has applications
  4. Select an Organisation that doesn't have any applications
  5. Select the same Organisation from step 3, notice you don't get any applications in the list and are now in a broken state.

- Previous solution was to avoid app requests when we knew we already had them all (in org with all 50 apps --> select space in org --> avoid fetching all apps in space and use previous list
- There were many issues with this approach
- Fall back on making a new app request whenever the filter changes
@richard-cox richard-cox added ready for review and removed needs attention This PR needs attention labels Sep 20, 2018
@KlapTrap
Copy link
Contributor

KlapTrap commented Nov 5, 2018

@richard-cox can you merge master into this PR? I'll review once that's done.

- Bump 'maxedResults` observable down from list to data source
- Bump dependend sort and filter observables down as well
- Don't fire reset action.. which previously kicked off new fetch list request
- Now fetch list request is kicked off via filter change (only for maxed case)
- Ensure we set q params correctly when using SetParams
  - Don't update the state via obj ref (see `newParams.q = qChanges`)
  - Set should replace all of q (including removing any old values)
- NOTE - This does not solve the issue where the list is removed and shown again on filter change
  - This occurrs because the page$ observable executes the filters on the stale page list before executing again on proper page list
  - There's no clear way to block this without getting hacky (pagination section has not marked anything as busy)
@richard-cox
Copy link
Contributor Author

@KlapTrap I've fixed points 1-3. Point 4 I've addressed (it now doesn't clear the list) however there's still a visible blip when changing a filter. This is due to the page$ observable returning an empty list.. due to the filter pipeline executing using the new filter values on the old page. I could fix this but it starts to get hacky (having something in the pagination object to block the page$ observable until cleared by a successful call?). Point 5 might be quite tricky to implement. I think at this stage, given how old this PR is and the amount of stacked PRs on top, we capture this as something to address separately.

@richard-cox richard-cox added ready for review and removed needs attention This PR needs attention labels Jan 2, 2019
Copy link
Contributor

@KlapTrap KlapTrap left a comment

Choose a reason for hiding this comment

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

Something has broken the loading indicators for other lists when changing pages. If you go to the space app list and change page you'll only see the refresh button spinning and no top loading indicator. The loading indicator correctly shows on master.

@KlapTrap KlapTrap added needs attention This PR needs attention and removed ready for review labels Jan 4, 2019
- Always hide filter if maxed results is reached
- when we're maxed (and page contents are invalid) don't execute local filtering on them
@richard-cox richard-cox added ready for review and removed needs attention This PR needs attention labels Jan 4, 2019
Copy link
Contributor

@KlapTrap KlapTrap left a comment

Choose a reason for hiding this comment

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

There is another list loading indicator issue (seems related to the previous one):

  1. Go to the space application list (or any other list).
  2. Refresh the page to ensure there is no cached data.
  3. Hit the list refresh button, the top loading indicator shows rather than the refresh button spinning. It works once you've refreshed before or change page etc.
  4. This doesn't happen on master.

@KlapTrap KlapTrap added needs attention This PR needs attention and removed ready for review labels Jan 4, 2019
@richard-cox
Copy link
Contributor Author

@KlapTrap Apart from the issue above, is this alright to merge? Just wary that you're away next week

@KlapTrap
Copy link
Contributor

KlapTrap commented Jan 4, 2019

Another issue :'(. On an empty list (in my example is was a application instance list) when you hit refresh the empty list message disappears while the list fetches.

I think we need some e2e tests covering these loading combinations (using current master as reference) as they're easy to break and easy to overlook.

@KlapTrap
Copy link
Contributor

KlapTrap commented Jan 4, 2019

If you're happy after fixing these issues, feel free to merge this in while i'm away to unblock all the things.

@richard-cox
Copy link
Contributor Author

After playing a fair amount of wackamole I've created #3305 to fix the remaining loading indicator issues. It needs a bit more of a rework and we need to unblock other issues. Once we've got those merged I'll come back and fix.

@nwmac nwmac added ready for review and removed needs attention This PR needs attention labels Jan 8, 2019
Copy link
Contributor

@nwmac nwmac left a comment

Choose a reason for hiding this comment

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

LGTM

@nwmac nwmac merged commit d487933 into v2-master Jan 8, 2019
@nwmac nwmac deleted the scale-app-wall branch January 8, 2019 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scalability: Application Wall
4 participants