-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ref(ui): Change from withTeams to <Teams> for team key transactions #29223
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
ref(ui): Change from withTeams to <Teams> for team key transactions #29223
Conversation
size-limit report
|
static/app/views/performance/transactionSummary/teamKeyTransactionButton.tsx
Outdated
Show resolved
Hide resolved
static/app/views/performance/transactionSummary/teamKeyTransactionButton.tsx
Outdated
Show resolved
Hide resolved
Zylphrex
left a comment
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.
Does the useTeams hook handle super users the same way? Previously, just filtering for isMember ignores super users privileges so we had to check isActiveSuperuser() as well.
| } | ||
|
|
||
| export const PerformanceLanding = withTeams(_PerformanceLanding); | ||
| export const PerformanceLanding = _PerformanceLanding; |
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.
Nit: We can rename _PerformanceLanding to PerformanceLanding and directly export it now
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.
sounds good i'll refactor. Also, dang thanks for pointing out the superuser logic. We actually do fetch all teams if you're a superuser, but in the hook we're filtering it down to just teams where isMember is true. fixing here: #29294
66f1c02 to
b5bc68b
Compare
b5bc68b to
75830ae
Compare
Due to how we fetch teams on the frontend we only load up to 100 into the TeamStore at app start. Only a handful of orgs have over 100 teams, but it still poses a problem for using certain features such as team key transactions. To fix this, we replace
withTeamsin favor of theTeamsutility which handles fetching the correct teams and propagating changes back to the store to prevent duplicate fetching.This PR replaces instances of withTeams in team key transactions with
Teamswhilst preserving the functionality. In some cases we have to add a loading spinner in the event that we don't have the user team's loaded in the team store.