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

Navigation for managing organizations #11261

Merged
merged 25 commits into from
May 10, 2022

Conversation

divbzero
Copy link
Contributor

@divbzero divbzero commented Apr 26, 2022

Navigation from managing "Your account" to managing an organization:

  • Add "Your organizations" link to "Your account" sidebar
  • Add organizations list to "Your organizations" page
  • Add "Manage" button each organization in organizations list

Navigation for managing each organization:

  • Add "Collaborators" management page for each organization
  • Add sidebar for managing each organization

Together this glues together two pages needed for managing members of an organization (#11076, #11077, #11078, #11081) and accepting/declining an organization invite (#11083).

@divbzero divbzero force-pushed the feature/manage-organizations-navigation branch 2 times, most recently from ed2aac8 to 9449e3c Compare April 26, 2022 21:37
@divbzero divbzero requested a review from ewdurbin April 26, 2022 22:00
@divbzero divbzero marked this pull request as draft April 26, 2022 22:00
@divbzero
Copy link
Contributor Author

Depends on #11208. Wait until that’s in before merging this PR.

@divbzero divbzero force-pushed the feature/manage-organizations-navigation branch 3 times, most recently from 20ec570 to b2da684 Compare May 1, 2022 13:57
@divbzero divbzero marked this pull request as ready for review May 1, 2022 14:39
@divbzero
Copy link
Contributor Author

divbzero commented May 1, 2022

vrodou referenced this pull request May 2, 2022
* tests, warehouse: validate job_workflow_ref

Add a bunch of counterexample tests to be certain.

* oidc/models: wrap `re.match` to make mypy happy

* tests/oidc: update

* warehouse, tests: fix `job_workflow_ref` regex

* tests, warehouse: refactor `job_workflow_ref` again

* warehouse, tests: refactor `job_workflow_ref` verification again

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
@divbzero divbzero force-pushed the feature/manage-organizations-navigation branch 2 times, most recently from d8b46e5 to 2048322 Compare May 4, 2022 19:36
sterbo and others added 16 commits May 5, 2022 14:17
Borrowing styles from list of projects for now.
Use the same gradient of grays as white-cube.svg.
- {.package-snippet__project-badge => .package-snippet__badge}
- {.package-snippet__released => .package-snippet__created}
Cards with similar styling but different icons:
- .organization-snippet
- .package-snippet
"Manage" link for each organization listed on /manage/organizations/
navigates to a "Collaborators" management page for the organization.
divbzero and others added 7 commits May 5, 2022 14:20
Discussed with @s-mm and renaming to differentiate "people" in
organizations from "collaborators" in projects.
I already added "Your organizations" to the sidebar for desktop but
forgot to add it for mobile.
Status badges:
- "Request Submitted" if still awaiting approve/decline
- "Inactive" if declined or inactive for other reasons

Role badges:
- "Manager" for organization manager
- "Owner" for organization owner
- "Billing Manager" for billing manager
This is my third attempt at stabilizing these tests but I finally see
the light of what I was doing wrong. I should not rely on probabilistic
tests at all even if the probability is "very very very low". @sterbo
actually suggested this earlier but it didn't fully click in my head
until now.

Co-authored-by: sterbo <matt.sterba@gmail.com>
@divbzero divbzero force-pushed the feature/manage-organizations-navigation branch from 2048322 to 43cd066 Compare May 5, 2022 21:21
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 couple suggested changes.

Probably the only important ones are to use the font-awesome Users icon instead of adding a new one, and the deduplication of DB queries one.

warehouse/manage/views.py Outdated Show resolved Hide resolved
warehouse/manage/views.py Outdated Show resolved Hide resolved
warehouse/templates/manage/manage_base.html Show resolved Hide resolved
warehouse/manage/views.py Show resolved Hide resolved
@ewdurbin ewdurbin enabled auto-merge (squash) May 10, 2022 14:54
@ewdurbin ewdurbin merged commit 64fc7f1 into pypi:main May 10, 2022
domdfcoding pushed a commit to domdfcoding/warehouse that referenced this pull request Jun 7, 2022
* Added three get organizations variations

* List organizations on /manage/organizations/ page

Borrowing styles from list of projects for now.

* Add SVG of `fa-users` from Font Awesome 5.13.0

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

* Convert users.svg to light gray

* 3 shades of gray for users.svg

Use the same gradient of grays as white-cube.svg.

* Darker shades of gray for users.svg

* Add Font Awesome 5.13.0 attribution to users.svg

* Resize users.svg to match size of white-cube.svg

* Convert {users.svg => users.png}

* NFC: Rename {_package-snippet => _snippet}.scss

* NFC: Rename .package-snippet__* classes

- {.package-snippet__project-badge => .package-snippet__badge}
- {.package-snippet__released => .package-snippet__created}

* `snippet` mixin for organizations and packages

Cards with similar styling but different icons:
- .organization-snippet
- .package-snippet

* Add "Your organizations" to "Your account" sidebar

* Display callout block if user has no organizations

* NFC: Use for..else Jinja2 syntax for projects.html

* "Manage" collaborators for each organization

"Manage" link for each organization listed on /manage/organizations/
navigates to a "Collaborators" management page for the organization.

* Add sidebar for managing "Your organizations"

* Clean up SCSS imports to fix `bin/static_lint`

* Rename {Collaborators => People} for organizations

Discussed with @s-mm and renaming to differentiate "people" in
organizations from "collaborators" in projects.

* Update "Your account" sidebar for mobile

I already added "Your organizations" to the sidebar for desktop but
forgot to add it for mobile.

* Add status/role badges for /manage/organizations/

Status badges:
- "Request Submitted" if still awaiting approve/decline
- "Inactive" if declined or inactive for other reasons

Role badges:
- "Manager" for organization manager
- "Owner" for organization owner
- "Billing Manager" for billing manager

* admin: Fix table spacing for cells with long text

* admin: Stabilize /admin/organizations/ tests more

This is my third attempt at stabilizing these tests but I finally see
the light of what I was doing wrong. I should not rely on probabilistic
tests at all even if the probability is "very very very low". @sterbo
actually suggested this earlier but it didn't fully click in my head
until now.

Co-authored-by: sterbo <matt.sterba@gmail.com>

* Apply suggestions from code review

Co-authored-by: sterbo <matt.sterba@gmail.com>
Co-authored-by: Ee Durbin <ewdurbin@gmail.com>
@queenmoon-bot

This comment was marked as spam.

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.

4 participants