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(ad-hoc): Add create team dialog #8846

Merged
merged 71 commits into from
Oct 5, 2023
Merged

feat(ad-hoc): Add create team dialog #8846

merged 71 commits into from
Oct 5, 2023

Conversation

igorlesnenko
Copy link
Contributor

@igorlesnenko igorlesnenko commented Sep 19, 2023

Fixes #8827
image

Not included:

  • Email invites expires warning

How to test:

  • add adHocTeam user-level feature flag
  • go to any meeting in activity library, open teams dropdown
  • create a team from teams dropdown by clicking "add team"
  • see that after creating a team it is automatically selected, invites are sent and you can successfully
  • test with different set of users and custom emails
  • See if you selected users from different orgs an org selection dropdown appears showing all potential orgs correctly
  • See if you entered only custom emails, org selection dropdown appears and you can select any of your org

@igorlesnenko
Copy link
Contributor Author

@tghanken can you please advise what events do I need to add here?

Copy link
Contributor

@nickoferrall nickoferrall left a comment

Choose a reason for hiding this comment

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

I noticed this little bug while testing: https://www.loom.com/share/90dd014360bc44ce8d28312134d5a808

@igorlesnenko
Copy link
Contributor Author

@nickoferrall that is interesting bug, I iterate viewerOrganizations to show items in dropdown. I think that for some reason you have 2 orgs with same id returned by

  fragment AddTeamDialog_viewer on User {
    ...AdhocTeamMultiSelect_viewer
    organizations {
      id
      name
    }
  }

Not sure that is expected behaviour of the app. Is it possible that some of the DB data is wrong and you have yourself added to the org twice?

Copy link
Contributor

@tghanken tghanken left a comment

Choose a reason for hiding this comment

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

We should try to keep the analytics here in line with what we did for 1:1 teams, there are two places that I see to add events in.

packages/client/components/AddTeamDialog.tsx Show resolved Hide resolved
Copy link
Contributor

@tghanken tghanken left a comment

Choose a reason for hiding this comment

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

Here's my other comment, I missed hitting add to review the first time 😮‍💨

Copy link
Contributor

@nickoferrall nickoferrall left a comment

Choose a reason for hiding this comment

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

Two small changes and then it LGTM!

packages/client/components/AddTeamDialog.tsx Outdated Show resolved Hide resolved
packages/client/components/AddTeamDialog.tsx Outdated Show resolved Hide resolved
)}
</fieldset>

{showOrgPicker && (
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 I think the org picker should always be visible so the height of the modal doesn't change when you select an item. It would also be reassuring for me that I've selected the right team from the right org

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If org picker will be always visible it will show one single org in most of cases. Would this be ok? Tagging @acressall for this design question

Copy link
Contributor

Choose a reason for hiding this comment

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

I actually don't mind the small height change. I suspect that a lot of users aren't aware of the concept of orgs, and it could be especially confusing in this context, so I only want to bring it up when we actually need the information

packages/client/ui/Input/Input.tsx Show resolved Hide resolved
<input
type={type}
className={twMerge(
'flex h-11 w-full rounded border-2 border-slate-300 bg-transparent px-2 py-1 text-sm font-semibold focus:outline-none focus-visible:border-sky-500 disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-slate-600',
Copy link
Contributor

Choose a reason for hiding this comment

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

-1 on focus, this new input is blue, but the rest of our inputs go from grey to black. Also, the font is bolder in this input vs others.

Screenshot 2023-09-28 at 17 23 58

Screenshot 2023-09-28 at 17 22 10

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made a new input to be matched with new select and multi select components we introduced previously. Not sure if I need to change it to match our old components, tagging @acressall for this question

Copy link
Contributor

Choose a reason for hiding this comment

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

The design team has been working add focus states, and they are all sky 500, so this is good!

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the weight is incorrect though, in the designs the label is semibold, but the placeholder and input are regular

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated:

image

<SecondaryButton onClick={onClose} size='small'>
Cancel
</SecondaryButton>
<PrimaryButton size='small' onClick={handleAddTeam} disabled={submitting || !isValid}>
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 I'd prefer the buttons to be a bit larger as they feel slightly small to me:

Screenshot 2023-09-28 at 17 01 24

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made bigger

image


<fieldset className={fieldsetStyles}>
<label className={labelStyles}>Team name</label>
<Input
Copy link
Contributor

Choose a reason for hiding this comment

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

-1 we're enforcing a team name length limit of 50 characters, but not giving users feedback that that will happen. So if I create a team with 55 characters, the last 5 characters get removed without me knowing.

We could add maxLength={MAX_TEAM_NAME_LENGTH} to the input. Or, for the optimal UX, we could give the user some feedback that there's a limit.

Copy link
Contributor Author

@igorlesnenko igorlesnenko Sep 29, 2023

Choose a reason for hiding this comment

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

I just removed this now, and allow backend to validate this. I think rarely someone would type 50 chars

const [teamName, setTeamName] = useState('')
const [teamNameManuallyEdited, setTeamNameManuallyEdited] = useState(false)

const MAX_TEAM_NAME_LENGTH = 50
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 it looks like the limit in pg is 100 characters so I was wondering why 50 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nickoferrall we have 50 characters validation set on the backend and when we creating a team from http://localhost:3000/newteam/1. So I kept it as is here too

Copy link
Contributor

@tghanken tghanken left a comment

Choose a reason for hiding this comment

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

Analytics look good!

packages/client/components/AddTeamDialog.tsx Outdated Show resolved Hide resolved
@igorlesnenko
Copy link
Contributor Author

igorlesnenko commented Sep 29, 2023

I noticed this little bug while testing: https://www.loom.com/share/90dd014360bc44ce8d28312134d5a808

Two small changes and then it LGTM!

@nickoferrall so was it some wrong data in the DB?

Copy link
Contributor

@nickoferrall nickoferrall left a comment

Choose a reason for hiding this comment

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

@nickoferrall so was it some wrong data in the DB?

Yep, that was it. LGTM!

packages/client/components/AddTeamDialog.tsx Outdated Show resolved Hide resolved
packages/client/components/AddTeamDialog.tsx Outdated Show resolved Hide resolved
packages/client/components/AddTeamDialog.tsx Outdated Show resolved Hide resolved
return (
<Suspense fallback={renderLoader()}>
{queryRef && (
<AddTeamDialog onAddTeam={onAddTeam} isOpen={true} onClose={onClose} queryRef={queryRef} />
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 normally one would mount the dialog and then only modify isOpen so we can get a transition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Transition works for me like this. Can you record a video?

I'll merge this PR in the mean time, and will fix it in next PRs if it is an issue

@igorlesnenko igorlesnenko merged commit 14a32aa into master Oct 5, 2023
@igorlesnenko igorlesnenko deleted the ad-hoc-dialog branch October 5, 2023 16:37
@sentry-io
Copy link

sentry-io bot commented Oct 10, 2023

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: Cannot read properties of undefined (reading 'orgId') defaultOrgId(packages/client/components/Activit... View Issue

Did you find this useful? React with a 👍 or 👎

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.

Ad-hoc: add team dialog
5 participants