-
Notifications
You must be signed in to change notification settings - Fork 337
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
Conversation
Hey @ackernaut, would you mind reviewing the UI, please? |
@@ -33,15 +28,16 @@ interface Props { | |||
const AddTeamDialogViewerFragment = graphql` | |||
fragment AddTeamDialog_viewer on User { | |||
...AdhocTeamMultiSelect_viewer | |||
organizations { | |||
organization(orgId: $orgId) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Yes, I can review! |
Thank you! And tagging in Georg to review the code 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not test
packages/client/modules/newTeam/components/NewTeamForm/NewTeamForm.tsx
Outdated
Show resolved
Hide resolved
packages/client/modules/newTeam/components/NewTeamForm/NewTeamForm.tsx
Outdated
Show resolved
Hide resolved
packages/client/modules/newTeam/components/NewTeamForm/NewTeamForm.tsx
Outdated
Show resolved
Hide resolved
@@ -33,15 +28,16 @@ interface Props { | |||
const AddTeamDialogViewerFragment = graphql` | |||
fragment AddTeamDialog_viewer on User { | |||
...AdhocTeamMultiSelect_viewer | |||
organizations { | |||
organization(orgId: $orgId) { |
There was a problem hiding this comment.
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[]) => { |
There was a problem hiding this comment.
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
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 |
Fix #11016
When creating a team, users can decide whether the team is public/private.
In org settings, go to teams, and click "Add team" to open this modal:

To test