Skip to content

Manage organization "Teams" #11665

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

Merged
merged 56 commits into from
Jul 26, 2022

Conversation

divbzero
Copy link
Contributor

@divbzero divbzero commented Jun 23, 2022

@divbzero divbzero force-pushed the feature/manage-organization-teams branch from 10b6bc5 to 81e638c Compare June 23, 2022 18:11
@divbzero divbzero requested a review from ewdurbin June 23, 2022 18:26
@divbzero
Copy link
Contributor Author

@ewdurbin When I was adding journal entries/events, I came across a few inconsistencies in action/tag names that I tried to reconcile with commit 2264221. Please let me know —

  1. Do those changes make sense?
  2. If yes, should I remove that commit from this PR and create a separate PR with those changes?

@ewdurbin
Copy link
Member

ewdurbin commented Jul 5, 2022

@ewdurbin When I was adding journal entries/events, I came across a few inconsistencies in action/tag names that I tried to reconcile with commit 2264221. Please let me know —

  1. Do those changes make sense?
  2. If yes, should I remove that commit from this PR and create a separate PR with those changes?

A separate PR is probably best.

@ewdurbin ewdurbin requested a review from a team as a code owner July 5, 2022 15:15
Copy link
Member

@ewdurbin ewdurbin left a comment

Choose a reason for hiding this comment

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

A few minor things caught in review and some comments on TODO.

Overall this functions as expected. I believe user-testing will expose some specific user experience concerns, but I can't predict them at this time.

@divbzero divbzero requested a review from ewdurbin July 7, 2022 07:54
@divbzero
Copy link
Contributor Author

divbzero commented Jul 8, 2022

A separate PR is probably best.

Created separate PR #11779 to update project role journal entries and events.

@ewdurbin ewdurbin force-pushed the feature/manage-organization-teams branch from 33cb034 to 0a08955 Compare July 19, 2022 15:26
Copy link
Member

@ewdurbin ewdurbin left a comment

Choose a reason for hiding this comment

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

The only outstanding change that needs to be addressed before this is mergable is that we should not change the current "Owner" and "Maintainer" role names for non-org projects.

Not only due to confusion in the UI, but also due to existing documentation, our own FAQ/help page, and 3rd party docs that reference these names.

@@ -36,7 +40,17 @@ class RoleNameMixin:

role_name = wtforms.SelectField(
"Select role",
choices=[("", "Select role"), ("Maintainer", "Maintainer"), ("Owner", "Owner")],
choices=[("", "Select role"), ("Maintainer", "Upload"), ("Owner", "Admin")],
Copy link
Member

Choose a reason for hiding this comment

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

We should leave the labels for existing non-org projects as Maintainer and Owner until further notice, as merging this would change these labels and cause confusion for users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed with commit 26bbc2e.

@ewdurbin
Copy link
Member

@divbzero note that this branch was rebased off of main to resolve translations merge conflicts that weren't auto-resolvable by GitHub

@divbzero divbzero force-pushed the feature/manage-organization-teams branch from b98b784 to faa9acc Compare July 20, 2022 22:27
@divbzero
Copy link
Contributor Author

@ewdurbin I’ve reverted the roles for individual users back to Maintainer and Owner, renamed permissions from Admin to Administer, and updated the project Collaborators page to clarify the distinction between roles and permissions.

@divbzero divbzero force-pushed the feature/manage-organization-teams branch from faa9acc to 7211a16 Compare July 21, 2022 05:27
divbzero added 4 commits July 20, 2022 22:40
- Add team projects to list of user projects
- Add team projects with Administer permissions to projects owned
- Add links to organization for projects in organizations
- Add links to organization for teams in organizations
- Add display name to organization snippets
- Add member count to team snippets

These tweaks should make navigation easier and more intuitive.
@divbzero divbzero force-pushed the feature/manage-organization-teams branch from 7211a16 to 3bce85c Compare July 21, 2022 05:43
@divbzero
Copy link
Contributor Author

Fixed a few things that would have come up during user testing:

  • Tweaked navigation for organizations and teams (commits 1c00802 and 61e41b8).
  • Fixed issue where teams with Administer permissions could’t actually administer the project (commit 3bce85c).

Things should be cleaner now so users can focus on other usability issues.

@ewdurbin I think this pull request should be all set for merging. Please let me know if you spot anything else.

@divbzero divbzero requested a review from ewdurbin July 21, 2022 19:19
Copy link
Member

@ewdurbin ewdurbin left a comment

Choose a reason for hiding this comment

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

This is working as expected and is ready for user testing.

@ewdurbin ewdurbin merged commit a3d6221 into pypi:main Jul 26, 2022
woodruffw pushed a commit to trail-of-forks/warehouse that referenced this pull request Jul 27, 2022
* Create initial models for Teams

* Add services for Teams to do all the things

* Add tests for the Teams services

* Add "Teams" to manage organization menu

* Template for manage organization "Teams"

* Grant "manage:team" permissions to org Owner

* Relax Team name constraint and add normalized_name

Organization and project names correspond to public URLs and require
stricter naming constraints. In contrast, team names are used internally
within organizations so we can relax the constraint to allow non-ASCII
international names.

* `find_teamid` by organization ID and team name

* View and form for manage organization "Teams"

* .team-snippet style

* sitemap.{png,svg}

SVG of `fa-sitemap` from Font Awesome 5.13.0:

https://github.com/FortAwesome/Font-Awesome/blob/4e6402443679e0a9d12c7401ac8783ef4646657f/js-packages/%40fortawesome/free-solid-svg-icons/faSitemap.js

Resized, recolored light gray, and converted to PNG.

* Tests for manage organization "Teams"

* Emails for manage organization "Teams"

* Base template for manage team pages

* Switch icons for organizations and teams

- `fa-sitemap` for organizations
- `fa-users` for teams
- `fa-user` for collaborators/members/people

* Template for manage team "Projects"

* View for manage team "Projects"

* Tests for manage team "Projects"

* `TeamRoleType` and `TeamProjectRoleType` enums

* Template for manage team "Members"

* View and form for manage team "Members"

* Tests for manage team "Members"

* Template for manage team "Settings"

* View and form for manage team "Settings"

* Tests for manage team "Settings"

* Fix typo in "added-as-organization-member" email

* Fix typo in "organization-member-removed" email

* Emails for manage team "Members"

* Emails for manage team "Settings"

* Update Alembic revisions after merge branch 'main'

* Update template for internal project collaborators

* Views and forms for internal project collaborators

* Update project role journal entries and events

- Standardize journal entry action to be "add {role_name} {username}"
- Standardize project event tag to be "project:role:create"
- Standardize user event tag to be "account:role:create"

* Tests for internal project collaborators

* Emails for internal project collaborators

* List org owners as internal project collaborators

* Restore 2FA column for project collaborators

* Fix redirect after removing team member

* Fix redirect after renaming team

* Enable events for `Team`

* Record events for `Team`

* Rename {Team.users => Team.members}

* Fix tests after merge branch 'main'

* Fix SQLAlchemy warnings for `Team`

Similar to fixes in pypi#11378.

* Revert "Update project role journal entries and events"

This reverts commit 2264221.
The change will be included in separate pull request pypi#11779.

* Update Alembic revisions after rebase 'main'

* Revert renaming of roles for individual users

- {Admin => Owner}
- {Upload => Maintainer}

As @ewdurbin described in pypi#11665 we want to keep the original project
roles "Owner" and "Maintainer" for individual users in projects, and use
the new permissions "Administer" and "Upload" for teams in projects.

* Rename permissions for teams {Admin => Administer}

* Clarify in emails that teams have "permissions"

* Clarify in templates that teams have "permissions"

* Include team projects in user's list of projects

- Add team projects to list of user projects
- Add team projects with Administer permissions to projects owned

* Fix left align in "People" and "Members" tables

* Tweak navigation for organizations and teams

- Add links to organization for projects in organizations
- Add links to organization for teams in organizations
- Add display name to organization snippets
- Add member count to team snippets

These tweaks should make navigation easier and more intuitive.

* Grant project permissions to team members

* re-order migrations

Co-authored-by: sterbo <[email protected]>
Co-authored-by: Ee Durbin <[email protected]>
SamirPS pushed a commit to SamirPS/warehouse that referenced this pull request Aug 30, 2022
* Create initial models for Teams

* Add services for Teams to do all the things

* Add tests for the Teams services

* Add "Teams" to manage organization menu

* Template for manage organization "Teams"

* Grant "manage:team" permissions to org Owner

* Relax Team name constraint and add normalized_name

Organization and project names correspond to public URLs and require
stricter naming constraints. In contrast, team names are used internally
within organizations so we can relax the constraint to allow non-ASCII
international names.

* `find_teamid` by organization ID and team name

* View and form for manage organization "Teams"

* .team-snippet style

* sitemap.{png,svg}

SVG of `fa-sitemap` from Font Awesome 5.13.0:

https://github.com/FortAwesome/Font-Awesome/blob/4e6402443679e0a9d12c7401ac8783ef4646657f/js-packages/%40fortawesome/free-solid-svg-icons/faSitemap.js

Resized, recolored light gray, and converted to PNG.

* Tests for manage organization "Teams"

* Emails for manage organization "Teams"

* Base template for manage team pages

* Switch icons for organizations and teams

- `fa-sitemap` for organizations
- `fa-users` for teams
- `fa-user` for collaborators/members/people

* Template for manage team "Projects"

* View for manage team "Projects"

* Tests for manage team "Projects"

* `TeamRoleType` and `TeamProjectRoleType` enums

* Template for manage team "Members"

* View and form for manage team "Members"

* Tests for manage team "Members"

* Template for manage team "Settings"

* View and form for manage team "Settings"

* Tests for manage team "Settings"

* Fix typo in "added-as-organization-member" email

* Fix typo in "organization-member-removed" email

* Emails for manage team "Members"

* Emails for manage team "Settings"

* Update Alembic revisions after merge branch 'main'

* Update template for internal project collaborators

* Views and forms for internal project collaborators

* Update project role journal entries and events

- Standardize journal entry action to be "add {role_name} {username}"
- Standardize project event tag to be "project:role:create"
- Standardize user event tag to be "account:role:create"

* Tests for internal project collaborators

* Emails for internal project collaborators

* List org owners as internal project collaborators

* Restore 2FA column for project collaborators

* Fix redirect after removing team member

* Fix redirect after renaming team

* Enable events for `Team`

* Record events for `Team`

* Rename {Team.users => Team.members}

* Fix tests after merge branch 'main'

* Fix SQLAlchemy warnings for `Team`

Similar to fixes in pypi#11378.

* Revert "Update project role journal entries and events"

This reverts commit 2264221.
The change will be included in separate pull request pypi#11779.

* Update Alembic revisions after rebase 'main'

* Revert renaming of roles for individual users

- {Admin => Owner}
- {Upload => Maintainer}

As @ewdurbin described in pypi#11665 we want to keep the original project
roles "Owner" and "Maintainer" for individual users in projects, and use
the new permissions "Administer" and "Upload" for teams in projects.

* Rename permissions for teams {Admin => Administer}

* Clarify in emails that teams have "permissions"

* Clarify in templates that teams have "permissions"

* Include team projects in user's list of projects

- Add team projects to list of user projects
- Add team projects with Administer permissions to projects owned

* Fix left align in "People" and "Members" tables

* Tweak navigation for organizations and teams

- Add links to organization for projects in organizations
- Add links to organization for teams in organizations
- Add display name to organization snippets
- Add member count to team snippets

These tweaks should make navigation easier and more intuitive.

* Grant project permissions to team members

* re-order migrations

Co-authored-by: sterbo <[email protected]>
Co-authored-by: Ee Durbin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants