Skip to content

Conversation

@scttcper
Copy link
Member

@scttcper scttcper commented Oct 27, 2021

Show all teams to super admins

Switch to the useTeams hook with provideUserTeams since it handles this for us. withUserTeams currently doesn't allow for all teams.

fixes the page for users with regular users w/ no teams, they will see the "Join a Team" button.
image

@scttcper scttcper requested review from a team and davidenwang October 27, 2021 21:16
@scttcper scttcper requested a review from a team as a code owner October 27, 2021 21:16
function TeamInsightsOverview({location, router}: Props) {
const isSuperuser = isActiveSuperuser();
const organization = useOrganization();
const {teams} = useTeams({provideUserTeams: true});
Copy link
Contributor

Choose a reason for hiding this comment

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

we also provide an initiallyLoaded field which will let you know when the user teams have finished loading (only relevant if we need to execute an additional query for user teams).

Not sure if you need that to trigger a loading state

@scttcper scttcper changed the title feat(workflow): Allow superusers to view team stats of all teams feat(workflow): Allow admins to view team stats of all teams Oct 27, 2021
@scttcper scttcper enabled auto-merge (squash) October 27, 2021 23:15
@scttcper scttcper merged commit e59ce2c into master Oct 27, 2021
@scttcper scttcper deleted the scttcper/team-insights-superusers branch October 27, 2021 23:37
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants