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

[dashboard] Implement Teams UI (selector, creation wizard, members page, project page) #4401

Merged
merged 2 commits into from
Jun 10, 2021

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Jun 6, 2021

Fixes #4355
Fixes #4354

TODO:

  • Update the top navigtation with tabs so that Workspaces and Settings are palced below the account dropdown
  • Move the Admin item to the right menu
  • Introduce a dropdown to switch between teams as well as create new teams
  • Introduce a full page form to create a team
  • Polish account dropdown to better align with spec
  • Toggle Teams & Projects UI on-and-off with a permission (thanks @svenefftinge for [t&p] added permission #4396!)
  • Surface basic membership information for Teams (e.g. user ID + full name)
  • A team is reachable by its URL which is https://gitpod.io/<teamname>
  • Disallow team names that are also user names or that conflict with dashboard URLs (EDIT now tracked here: [Teams] Disallow team names that are also user names or that conflict with dashboard URLs #4469)

@jankeromnes jankeromnes force-pushed the jx/teams-ui branch 5 times, most recently from 49100ab to facd6ca Compare June 6, 2021 15:16
@jankeromnes
Copy link
Contributor Author

Currently looks like this:

Screenshot 2021-06-06 at 17 31 19

Screenshot 2021-06-06 at 17 35 53

The new Teams UI can also be disabled (showTeams=false), making the top menu look almost exactly like before (except Admin is now on the right):

Screenshot 2021-06-06 at 17 33 14

@svenefftinge
Copy link
Member

Can you also include #4354 in this PR (see)?

@jankeromnes
Copy link
Contributor Author

@svenefftinge Sure, many thanks!

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jun 8, 2021

Well, at least the new check works! 🤣

  1) TeamDBSpec
       createAndFindATeam:
     Error: Team name should match /^[A-Za-z0-9]+$/

https://github.com/gitpod-io/gitpod/blob/f83bfadeebe840ee38d95ca5b50d2b30753079ca/components/gitpod-db/src/team-db.spec.db.ts#L45

@jankeromnes jankeromnes force-pushed the jx/teams-ui branch 3 times, most recently from 0f54090 to 9b8a149 Compare June 8, 2021 16:13
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jun 9, 2021

Alright, this is now ready for review. 🎉

Please take a look! 🙏 In particular:

Notes: I'm happy to make any fixes/adjustments, but in the interest of time, I'll probably make larger changes in follow-up Pull Requests (in order to merge soon and unblock others from working on these pages too.) -- For example, there is still no team name deny-list, so you can create teams called "settings" or "workspaces" 😬 (will fix that next).

Copy link
Member

@svenefftinge svenefftinge left a comment

Choose a reason for hiding this comment

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

code looks good!

components/dashboard/src/Login.tsx Outdated Show resolved Hide resolved
const memberships = await this.teamDB.findMembershipsByTeam(team.id);
await this.guardAccess({ kind: "team", subject: team, memberships }, "get");
return Promise.all(memberships.map(async (m: DBTeamMembership): Promise<TeamMemberInfo> => {
const member = await this.userDB.findUserById(m.userId);
Copy link
Member

Choose a reason for hiding this comment

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

Depending on the team size this can become expensive. A single SQL query would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@svenefftinge
Copy link
Member

Disallow team names that are also user names or that conflict with dashboard URLs

would be good to move this to an issue, so we don't forget :-)

@jankeromnes jankeromnes changed the title [dashboard] Implement Team selector and creation wizard [dashboard] Implement Teams UI (selector, creation wizard, members page, project page) Jun 9, 2021
@gtsiolis
Copy link
Contributor

gtsiolis commented Jun 9, 2021

/werft run

👍 started the job as gitpod-build-jx-teams-ui.40

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.

Clicking those tabs feels so good! Thanks for adding this @jankeromnes! 🌟

Left some first-round comments, feel free to open follow up issues for anything that can go in a later PR or ingore any comments that seem minor. 🏀

components/dashboard/src/App.tsx Show resolved Hide resolved
}
]}>
<div className="flex p-1.5 pl-3 rounded-lg hover:bg-gray-200">
<span className="text-base text-gray-600 font-semibold">{team?.name || userFullName}</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: Reminder to restore the colors for dark theme! These can use the colors of the menu items on the right. Font size can be text-sm! 🌙

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gtsiolis Unless I'm looking at the wrong spec, the Figma file currently has text-base (i.e. 16px) for team member names, not text-sm (i.e. 14px).

Copy link
Contributor

Choose a reason for hiding this comment

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

@jankeromnes You are absolutely right! The initial specs are using 16px for the main and secondary navigation on the top right which is now still using a 14px size. May I suggest the following two items:

  1. Either use the smaller size of align all navigation elements and make sure they are using a 32px height?
  2. If we go with the specs (16px), semibold here is rendering quite bold so I'd either change the font weight to medium or even better enable font-smoothing for the product as in https://github.com/gitpod-io/website/pull/222.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now tracked in #4471

...(teams || []).map(t => ({
title: t.name,
customContent: <div className="w-full text-gray-400 flex flex-col">
<span className="text-gray-800 text-base font-semibold">{t.name}</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: Reminder to add colors for dark theme and use text-sm font size!

Suggested change
<span className="text-gray-800 text-base font-semibold">{t.name}</span>
<span className="text-gray-800 text-sm dark:text-gray-300 font-semibold">{t.name}</span>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gtsiolis: The spec currently has text-base a.k.a. 16px as font size for team names in the team switcher-menu.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now tracked in #4471

components/dashboard/src/teams/NewTeam.tsx Outdated Show resolved Hide resolved
</Link>
<div className="ml-2 text-base">
{showTeamsUI
? <ContextMenu classes="w-64 left-0" menuEntries={[
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Could we bg-gray-100 on hover and also use this background for the currently active team? 💭

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now tracked in #4471

components/dashboard/src/projects/Projects.tsx Outdated Show resolved Hide resolved
components/dashboard/src/teams/NewTeam.tsx Outdated Show resolved Hide resolved
components/dashboard/src/teams/NewTeam.tsx Outdated Show resolved Hide resolved
<Tab name='Recent' setSelection={setSelection} selection={selection} />
<Tab name='Examples' setSelection={setSelection} selection={selection} />
<TabMenuItem name='Recent' selected={selection === 'Recent'} onClick={() => setSelection('Recent')} />
<TabMenuItem name='Examples' selected={selection === 'Examples'} onClick={() => setSelection('Examples')} />
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Could we make this tab menu disappear when creating a new team similar with the specs? Low priority! 🔅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now tracked in #4471

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jun 10, 2021

Thanks again for the fantastic reviews! ❤️

Also, phew!, addressed all nits (either here or by opening follow-up issues), and double/triple-checked everything again.

One more smoke test on this deployment (because I'm getting tired and had to do some pretty crazy interactive reverts/rebases) and we should be good to merge. 🚀

EDIT: All perfect! 😌

@jankeromnes jankeromnes merged commit 2588d5f into main Jun 10, 2021
@jankeromnes jankeromnes deleted the jx/teams-ui branch June 10, 2021 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow adding and switching teams Create Feature Flag for "Teams & Projects"
3 participants