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: can choose privacy when creating a team #11046

Merged
merged 17 commits into from
Mar 26, 2025

Conversation

nickoferrall
Copy link
Contributor

@nickoferrall nickoferrall commented Mar 21, 2025

Fix #11016

When creating a team, users can decide whether the team is public/private.

Screenshot 2025-03-21 at 17 31 37
Screenshot 2025-03-21 at 17 28 03
Screenshot 2025-03-21 at 17 27 59
Screenshot 2025-03-21 at 17 27 42
Screenshot 2025-03-21 at 17 31 56

In org settings, go to teams, and click "Add team" to open this modal:
Screenshot 2025-03-24 at 12 56 13

To test

  • If the user is creating a new team in a Starter org, the team is always public. The toggle is disabled and the text explains why.
  • If it's a Team/Enterprise org, they can make the new team public/private. The text explains what these mean.
  • If it's a new org, explain that it's public by default and they can upgrade to make it private.

@nickoferrall nickoferrall changed the title feat/11016/create team choose privacy feat: can choose privacy when creating a team Mar 21, 2025
@nickoferrall
Copy link
Contributor Author

Hey @ackernaut, would you mind reviewing the UI, please?

@nickoferrall nickoferrall requested a review from ackernaut March 21, 2025 17:39
@@ -33,15 +28,16 @@ interface Props {
const AddTeamDialogViewerFragment = graphql`
fragment AddTeamDialog_viewer on User {
...AdhocTeamMultiSelect_viewer
organizations {
organization(orgId: $orgId) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored this component to query the org rather than all organizations. This modal only appears in orgTeams which belongs to one org.

I think the component may have originally been used elsewhere for a feature that has since been removed.

Querying one org is more efficient and removes the mutualOrgIds logic which is hard to follow.

Copy link
Contributor

Choose a reason for hiding this comment

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

-1 AdhocTeamMultiSelect still selects all orgs and adds completion for users from all orgs. Are we sure we want this behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, I can update this to just query the same org, too

@@ -133,7 +111,7 @@ const AddTeamDialog = (props: Props) => {
)
}

const isValid = selectedUsers.length && teamName.trim()
const isValid = teamName.trim().length > 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes a bug in prod where you can only create a team if you invite team members. You should be able to create a team just by adding the team name.

@ackernaut
Copy link
Member

Yes, I can review!

@nickoferrall
Copy link
Contributor Author

Thank you! And tagging in Georg to review the code 🙏

Copy link
Contributor

@Dschoordsch Dschoordsch left a comment

Choose a reason for hiding this comment

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

Did not test

@@ -33,15 +28,16 @@ interface Props {
const AddTeamDialogViewerFragment = graphql`
fragment AddTeamDialog_viewer on User {
...AdhocTeamMultiSelect_viewer
organizations {
organization(orgId: $orgId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

-1 AdhocTeamMultiSelect still selects all orgs and adds completion for users from all orgs. Are we sure we want this behaviour?

const [teamNameManuallyEdited, setTeamNameManuallyEdited] = useState(false)

const MAX_TEAM_NAME_LENGTH = 50
const generateTeamName = (newUsers: Option[]) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The user can enter their team name. This led to confusing behaviour where I'd enter an email address to invite someone to the team and then the team name would be updated to the same name as the email

@nickoferrall nickoferrall requested review from Dschoordsch and removed request for Dschoordsch March 24, 2025 18:22
@ackernaut
Copy link
Member

@nickoferrall
Copy link
Contributor Author

Thanks @ackernaut ! I'll move these UI updates to a new PR as I know this one is blocking Georg.

I've created an issue here and will start work on it now: #11073

@nickoferrall nickoferrall merged commit 1a18729 into master Mar 26, 2025
6 checks passed
@nickoferrall nickoferrall deleted the feat/11016/create-team-choose-privacy branch March 26, 2025 16:59
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.

Public Teams: when creating a team, decide if it's public/private
3 participants