-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat: Add new hook for fetching repo token list + pagination to repo token table #97095
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
Conversation
getNextPageParam: ([lastPage]) => { | ||
return lastPage.pageInfo?.hasNextPage ? lastPage.pageInfo.endCursor : undefined; | ||
}, | ||
getPreviousPageParam: ([firstPage]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question is purely for clarity: thoughts on just naming both params the same name since we only have one page at a time and lastPage
and firstPage
here are identical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure, that's a good point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the change in 66d5199 to all our endpoints
const navigation = delta === -1 ? 'prev' : 'next'; | ||
const goPrevPage = navigation === 'prev' && response.hasPreviousPage; | ||
const goNextPage = navigation === 'next' && response.hasNextPage; | ||
|
||
navigate({ | ||
pathname: path, | ||
query: { | ||
...query, | ||
cursor: goPrevPage | ||
? response.startCursor | ||
: goNextPage | ||
? response.endCursor | ||
: undefined, | ||
navigation, | ||
}, | ||
}); | ||
}, | ||
[navigate, response] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, how does the pagination cursor get stuck?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can usually replicate with some combination of hitting the back button multiple times when we're on the first page, adding a filter / sort and navigate to a forward page and generally clicking stuff really quickly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
…token table (#97095) This PR aims to create the hook for the new repo token list endpoint as well as the pagination stuff for us to swap between pages in the repo token table. We also remove the createdAt stuff from the token regen table since that doesn't exist on the codecov side. So there are a couple styling updates there to reflect that too. Follows similar conventions to #96228 Depends on #97007 Closes https://linear.app/getsentry/issue/CCMRG-1482/hook-up-list-endpoint Closes https://linear.app/getsentry/issue/CCMRG-1443/drop-column-for-token-creation-date <img width="1070" height="851" alt="Screenshot 2025-08-04 at 10 58 32 AM" src="https://github.com/user-attachments/assets/1cdac64e-2d6b-4118-aaff-6f61f1380738" /> <!-- Sentry employees and contractors can delete or ignore the following. --> ### Legal Boilerplate Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
This PR aims to create the hook for the new repo token list endpoint as well as the pagination stuff for us to swap between pages in the repo token table.
We also remove the createdAt stuff from the token regen table since that doesn't exist on the codecov side. So there are a couple styling updates there to reflect that too.
Follows similar conventions to #96228
Depends on #97007
Closes https://linear.app/getsentry/issue/CCMRG-1482/hook-up-list-endpoint
Closes https://linear.app/getsentry/issue/CCMRG-1443/drop-column-for-token-creation-date
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.