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(team-store): Support user teams state in TeamStore #28957

Merged
merged 2 commits into from
Sep 29, 2021

Conversation

davidenwang
Copy link
Contributor

Augment the team store with state relating to whether or not the user's teams are loaded. This will be useful to avoid continually refetching the user's teams.

},

loadInitialData(items, hasMore = null) {
this.initialized = true;
this.state = {
teams: items.sort((a, b) => a.slug.localeCompare(b.slug)),
// TODO(davidenwang): Replace with a more reliable way of knowing when we have loaded all teams
loadedUserTeams: items.length < MAX_TEAMS,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

loadInitialData is called on app startup (from loadTeamsAndProjects) and will fetch up to 100 teams. If we receive less than 100 teams it means that we have not hit that 100 team pagination limit and therefore have all the organization's teams which means we have the user's teams in there somewhere as well.

@davidenwang davidenwang marked this pull request as ready for review September 29, 2021 19:20
@davidenwang davidenwang requested review from a team September 29, 2021 19:20
Copy link
Member

@evanpurkhiser evanpurkhiser left a comment

Choose a reason for hiding this comment

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

I like this

@davidenwang davidenwang merged commit 8f6d023 into master Sep 29, 2021
@davidenwang davidenwang deleted the davidenwang/user-teams-in-store branch September 29, 2021 20:42
vuluongj20 pushed a commit that referenced this pull request Sep 30, 2021
Augment the team store with state relating to whether or not the user's teams are loaded. This will be useful to avoid continually refetching the user's teams.
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 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.

2 participants