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

[Teams] Fix Teams menu rendering even when there are backend errors #6041

Merged
merged 2 commits into from
Oct 5, 2021

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Oct 5, 2021

Description

In #6035 and #6037 we noticed that:

  • When a user account gets deleted, their team memberships remain active, causing errors for all other team members (now fixed in this PR ✅)

  • When getting the members of one of your teams fail, the Team menu rendering is broken (all members count stay as ..., and the tabs menu is not the Team menu but the User menu) (also fixed in this PR ✅)

Related Issue(s)

Fixes #6035
Fixes #6037

How to test

  1. Create two users, and add them to a Team
  2. Delete one of the user accounts (without manually removing them from the Team)
  3. The other user should still have a functional Teams dropdown menu, showing the Team with only 1 member (themselves)

Release Notes

[Teams] Fix Teams menu rendering even when there are backend errors

/uncc

@@ -132,6 +135,11 @@ export class UserDeletionService {
}
}

protected async deleteTeamMemberships(userId: string) {
const teams = await this.teamDb.findTeamsByUser(userId);
await Promise.all(teams.map(t => this.teamDb.removeMemberFromTeam(userId, t.id)));
Copy link
Member

Choose a reason for hiding this comment

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

👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AlexTugarev Did you mean to /lgtm this Pull Request? 😇

@JanKoehnlein
Copy link
Contributor

/schedule

@roboquat
Copy link
Contributor

roboquat commented Oct 5, 2021

@JanKoehnlein: Cannot schedule issue - issue does not belong to a team. Use /team to specify one.

In response to this:

/schedule

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@JanKoehnlein
Copy link
Contributor

/assign @jankeromnes

@JanKoehnlein
Copy link
Contributor

/team meta

@roboquat roboquat added the team: webapp Issue belongs to the WebApp team label Oct 5, 2021
@JanKoehnlein
Copy link
Contributor

/schedule
/assign @jankeromnes

@jankeromnes
Copy link
Contributor Author

@JanKoehnlein shouldn't we add only issues to groundwork, not PRs?

@JanKoehnlein
Copy link
Contributor

/assign @jankeromnes

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

UX works like a charm! 🔮

Thanks @jankeromnes for always adding steps for how to test changes in the PR description. Makes everything so much better, reduces cognitive load on the reviewer side, and allows reviewers not familiar with a product feature to easily dive into a review with more confidence. 🍊

Approving to unblock merging but holding in case @AlexTugarev wants to take another look (see #6041 (review)) or @JanKoehnlein wants to make any more changes for testing groundwork automation (see #6041 (comment)).

/hold

@roboquat
Copy link
Contributor

roboquat commented Oct 5, 2021

LGTM label has been added.

Git tree hash: 0ebb657213e2dc70a421d88d06208fa0b6497853

@AlexTugarev
Copy link
Member

works as advertised! thanks!

/approve

@roboquat
Copy link
Contributor

roboquat commented Oct 5, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlexTugarev, gtsiolis

Associated issue: #6035

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@AlexTugarev
Copy link
Member

/hold cancel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot switch between team projects Team member count is missing for some users
5 participants