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

Introduce team management UI #1657

Merged
merged 26 commits into from Nov 1, 2023
Merged

Introduce team management UI #1657

merged 26 commits into from Nov 1, 2023

Conversation

msamper
Copy link
Contributor

@msamper msamper commented Sep 7, 2023

Features and Changes

Introduce a team management UI within the Team tab. Allows users to create teams within the GrowthBook UI as well as via SCIM (currently only works with Okta.) Any teams created via SCIM will need to have membership and name changes done through Okta rather than the GrowthBook UI.

Dependencies

#1762

Testing

Attempt to do CRUD operations for teams

  1. Create a team
  2. Add members to the team
  3. Modify team metadata
  4. Modify team permissions
  5. Try to delete a team with members (should error)
  6. Delete team members
  7. Try to delete a team with no members

Test features being blocked for manageByIdp teams (Name changes, membership changes)

  1. Edit a previously created team in the teams collection and set managedByIdp to true
  2. Ensure that you're unable to edit team name and team membership
  3. Ensure that you see a banner explaining what is restricted

Screenshots

Teams tab

Screenshot 2023-10-26 at 11 00 31 AM

Create Team Modal

Screenshot 2023-10-26 at 11 00 22 AM

GrowthBook Managed Team

Screenshot 2023-10-26 at 11 00 42 AM

Okta Managed Team

Screenshot 2023-10-26 at 11 01 18 AM

Add Team Members Modal

Screenshot 2023-10-26 at 11 04 56 AM

Teams page with upgrade message

Screenshot 2023-10-26 at 11 07 01 AM

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Your preview environment pr-1657-bttf has been deployed with errors.

@msamper msamper changed the title [WIP] Introduce team management UI Introduce team management UI Oct 26, 2023
@msamper msamper marked this pull request as ready for review October 26, 2023 08:13
@msamper msamper mentioned this pull request Oct 26, 2023
1 task
@msamper
Copy link
Contributor Author

msamper commented Oct 26, 2023

@mknowlton89 pointed out a bug with adding members to a team where all the requested members don't always get added. Have been able to replicate but bug is flaky so still trying to track down what may be causing it to happen sporadically.

packages/back-end/src/routers/teams/teams.controller.ts Outdated Show resolved Hide resolved
packages/back-end/src/routers/teams/teams.controller.ts Outdated Show resolved Hide resolved
members: string[];
}>({
defaultValues: {
members: data?.team.members?.map((m) => m.id) || [],
Copy link
Member

Choose a reason for hiding this comment

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

This will always be an empty array. data is not defined on initial load and I believe useForm ignores changes to defaultValues.

I think we can get rid of the useApi call completely here, right? From what I can tell, this modal is about adding new users, so we don't really care who the existing users are and should always set this to an empty string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll need to check the existing members of the team to determine what the addableMembers are so we can populate the options for the MultiSelectField but an alternative could be to pass that in from the team page as a prop instead of doing another API call here. Agree that we don't need to default members to anything other than an empty array though.

packages/front-end/pages/settings/members.tsx Outdated Show resolved Hide resolved
packages/front-end/pages/settings/team/[tid].tsx Outdated Show resolved Hide resolved
packages/front-end/services/UserContext.tsx Outdated Show resolved Hide resolved
@msamper msamper merged commit 0f83438 into main Nov 1, 2023
2 of 3 checks passed
@msamper msamper deleted the msamper/teams-frontend branch November 1, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants