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

Add ability to move pending invited users between teams #1838

Closed
2 tasks
noahtalerman opened this issue Aug 27, 2021 · 9 comments
Closed
2 tasks

Add ability to move pending invited users between teams #1838

noahtalerman opened this issue Aug 27, 2021 · 9 comments
Assignees
Labels
~customer request An enhancement requested by a Fleet customer

Comments

@noahtalerman
Copy link
Member

noahtalerman commented Aug 27, 2021

Goal

As a Fleet user, I want the ability to move pending invited users between teams so that I don't have to wait for the user to log in to Fleet before I can edit their level of access.

Figma

⚙️ Settings - Users: https://www.figma.com/file/qpdty1e2n22uZntKUZKEJl/%E2%9C%85-Fleet-EE-(current%2C-dev-ready)?node-id=3279%3A73070

API wireframes

New PATCH /api/v1/fleet/invites/{id} API route that supports the updating of invites. The available parameters should be the same as those that are available in the PATCH /api/v1/fleet/users/{id}:

PATCH /api/v1/fleet/invites/{id}

Parameters:

Name Type In Description
id integer path Required. The user's id.
name string body The user's name.
position string body The user's position.
email string body The user's email.
sso_enabled boolean body Whether or not SSO is enabled for the user.
api_only boolean body User is an "API-only" user (cannot use web UI) if true.
global_role string body The role assigned to the user. In Fleet 4.0.0, 3 user roles were introduced (admin, maintainer, and observer). If global_role is specified, teams cannot be specified.
teams array body Available in Fleet Premium The teams and respective roles assigned to the user. Should contain an array of objects in which each object includes the team's id and the user's role on each team. In Fleet 4.0.0, 3 user roles were introduced (admin, maintainer, and observer). If teams is specified, global_role cannot be specified.

Example request:

{
  "email": "ravina@example.com",
  "name": "Ravina Rhodes",
  "sso_enabled": false,
  "global_role": null,
  "teams": [
    {
      "id": 1,
      "role": "observer"
    },
    {
      "id": 4,
      "role": "maintainer"
    },
  ]
}

Example response:

{
  "invite": {
    "created_at": "0001-01-01T00:00:00Z",
    "updated_at": "0001-01-01T00:00:00Z",
    "id": 3,
    "invited_by": 1,
    "email": "ravina@example.com",
    "name": "Ravina Rhodes",
    "sso_enabled": false,
    "teams": [
      {
        "id": 1,
        "created_at": "0001-01-01T00:00:00Z",
        "name": "Client Platform Engineering",
        "description": "",
        "agent_options": null,
        "user_count": 0,
        "host_count": 0,
        "role": "observer"
      },
      {
        "id": 4,
        "created_at": "0001-01-01T00:00:00Z",
        "name": "Technologically Advanced Systems with an extraordinarily life",
        "description": "",
        "agent_options": null,
        "user_count": 0,
        "host_count": 0,
        "role": "maintainer"
      }
    ]
  }
}

How?

Frontend

  • Enabled the "Edit" option in the "Actions" dropdown in the "Users" table for users that have the "Status" of "Invite pending"
    • Selecting the "Edit" option for invited users should open the existing "Edit user" modal. Selecting "Save" in this modal should make a request to the new PATCH /api/v1/fleet/invites/{id} API route.

Backend

  • Add support for the new PATCH /api/v1/fleet/invites/{id} API route.
    • Only users with the Global admin role should be able to modify invites.
@noahtalerman
Copy link
Member Author

noahtalerman commented Sep 9, 2021

Backend estimation: Zach and Tomas will follow up on decision for merging user and invite entities.

@mikermcneil mikermcneil added :estimate Requires engineering estimation. ~customer request An enhancement requested by a Fleet customer and removed #core labels Sep 25, 2021
@noahtalerman
Copy link
Member Author

Tomas: We should move forward with adding this ability to invites in isolation from users (no merge).

@noahtalerman noahtalerman added !5 and removed :estimate Requires engineering estimation. labels Oct 21, 2021
@noahtalerman
Copy link
Member Author

Frontend estimation includes refactoring.

@noahtalerman
Copy link
Member Author

Zach: Modify user users the old style API routes. Let's take this opportunity to migrate users to the new style.

@noahtalerman noahtalerman added the 5 label Oct 21, 2021
@lukeheath lukeheath self-assigned this Nov 2, 2021
@chiiph chiiph assigned chiiph and lukeheath and unassigned lukeheath Nov 3, 2021
@chiiph
Copy link
Contributor

chiiph commented Nov 8, 2021

BE PR: #2837

@chiiph
Copy link
Contributor

chiiph commented Nov 11, 2021

Backend has been merged.

@rlynnj11
Copy link
Contributor

@noahtalerman this is another one that can't be done in a preview environment. Enlisting dev help.

@RachelElysia
Copy link
Member

@rlynnj11 cc: @noahtalerman

It works! Here's a loom showing it works.

https://www.loom.com/share/36f1395e81114d66964b407b74510936

@rlynnj11
Copy link
Contributor

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
~customer request An enhancement requested by a Fleet customer
Development

No branches or pull requests

7 participants