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

feat: handle paging responses from apis #1042

Merged
merged 3 commits into from
Sep 24, 2020
Merged

Conversation

lorenzo-cavazzi
Copy link
Member

This went a bit further than expected, introducing a couple of related (minor) changes.

  • Introduces a method to fetch from API returning paginated data.
  • Handles up to 1000 branches and commits (the limit is in place to prevent endless fetching loops that will fail anyway due to the gateway rate limit).
  • Updates visualization where needed (project pages "overview --> commits" and "environments --> new")
  • Minor changes to the Pagination component.

fix #1037, accidentally fix #764

P.S. All my namespaces are currently full so no preview available. You can run it on telepresence or contact me and I'll create a temporary preview.

* Introduces a method to fetch from API returning paginated data.
* Handles up to 1000 branches and commits.
* Updates visualization where needed (project pages "overview --> commits" and "environments --> new")
* Minor changes to the Pagination component.

fix #1037, #764
Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

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

Code looks good! I like the solution using an async iterator a lot; very elegant.

I have a couple of requested changes due to usability. I guess they are more requested-do-not-change-and-leave-as-before. I do not think a dropdown list with 100s of options is necessary because it just will not be useful, so I think we can leave the limits as they were before.

src/api-client/index.js Outdated Show resolved Hide resolved
src/api-client/repository.js Outdated Show resolved Hide resolved
src/notebooks/Notebooks.present.js Outdated Show resolved Hide resolved
src/notebooks/Notebooks.present.js Outdated Show resolved Hide resolved
Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

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

👍 +1

@lorenzo-cavazzi lorenzo-cavazzi merged commit a5ca3ef into master Sep 24, 2020
@lorenzo-cavazzi lorenzo-cavazzi deleted the 1037-fetch-paging branch September 24, 2020 14:49
ciyer pushed a commit that referenced this pull request Sep 28, 2020
* Introduces a method to fetch from API returning paginated data.
* Handles up to 1000 branches and commits.
* Minor changes to the Pagination component, now used also in "overview --> commits".

fix #1037, #764

(cherry picked from commit a5ca3ef)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants