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 "Merge Users" admin tool to resolve duplicates #3527

Open
mastercactapus opened this issue Dec 12, 2023 · 3 comments
Open

Add "Merge Users" admin tool to resolve duplicates #3527

mastercactapus opened this issue Dec 12, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@mastercactapus
Copy link
Member

What problem would you like to solve? Please describe:
Duplicate users may exist in GoAlert for various reasons such as usage of multiple identity providers or a subject ID changing from OIDC. At present, the duplicate user can only be removed which may pose administrative challenges if that user is extensively configured across the application.

Describe the solution you'd like:
Introduce a new admin tool called "Merge Users" that enables merging of one or more users into a "Primary" profile. The process should be all-or-nothing so all other profiles are deleted within the same transaction.

The merger should include:

  • Login sessions, assignments, contact methods, notification rules, auth subjects all merged into the "Primary" profile
  • Retaining the "Primary" profile config when it comes to basic auth conflicts (i.e., multiple usernames)
  • Adding a "(merged)" suffix to Contact Method names to resolve any overlapping.

A GraphQL mutation mergeUsers(primary: ID!, toMerge: [ID!]!) should be added for this process.

Describe alternatives you've considered:
The current alternative is removing the duplicate user. However, this solution is inelegant and may lead to complications if the removed user has extensive links across the application.

Additional context:
In future enhancements, implementing a search/detection tool for potential duplicates could serve as an effective supplement to the "Merge Users" tool.

@mastercactapus mastercactapus added the enhancement New feature or request label Dec 12, 2023
@mastercactapus
Copy link
Member Author

Rough design proposal:

┌───────────────────────────────────────────────────────────────────────────┐
│/admin/merge-users?users=<uuid1>&users<uuid2>&users=<uuid3>                │
├───────────────────────────────────────────────────────────────────────────┤
│                                                                           │
│  Admin / Merge Users                                          ┌─────────┐ │
│                                                               │  MERGE  │ │
│                                                               └─────────┘ │
│                                                                           │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ Primary                       UserID: "uuid1"                 <Remove>│ │
│ │                                                                       │ │
│ │  User.Name1  [Link, new tab]                                          │ │
│ │  User.Email1                 Auth Subjects:                           │ │
│ │                                  oidc: z12345                         │ │
│ │  0 Active Sessions             github: 123423                         │ │
│ │  2 Contact Methods                                                    │ │
│ │  4 Assignments                                                        │ │
│ │  1 Notification Rule                                                  │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│                                                                           │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ <Make Primary>  (moves to top) UserID: "uuid2"                <Remove>│ │
│ │                                                                       │ │
│ │  User.Name2  [Link, new tab]                                          │ │
│ │  User.Email2                 Auth Subjects:                           │ │
│ │                                  oidc: z12345                         │ │
│ │  0 Active Sessions             github: 123423                         │ │
│ │  2 Contact Methods                                                    │ │
│ │  4 Assignments                                                        │ │
│ │  1 Notification Rule                                                  │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│                                                                           │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ <Make Primary>  (moves to top) UserID: "uuid3"                <Remove>│ │
│ │                                                                       │ │
│ │  User.Name3  [Link, new tab]                                          │ │
│ │  User.Email3                 Auth Subjects:                           │ │
│ │                                  oidc: z12345                         │ │
│ │  0 Active Sessions             github: 123423                         │ │
│ │  2 Contact Methods                                                    │ │
│ │  4 Assignments                                                        │ │
│ │  1 Notification Rule                                                  │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│                                                                           │
│                                                                    ┌───┐  │
│                                                                    │ + │  │
│                                                                    └───┘  │
│                                                                           │
└───────────────────────────────────────────────────────────────────────────┘

@mastercactapus
Copy link
Member Author

"Add user to merge" dialog thoughts:

┌────────────────────────────────────────────────────────────────────┐
│     Add User to Merge                                              │
│                                                                    │
│    ┌─────────────────────────┐                                     │
│    │ Search Select           │                                     │
│    └─────────────────────────┘                                     │
│                                                                    │
│   By ID (paste ID or URL)                                          │
│    ┌─────────────────────────┐                                     │
│    │                         │                                     │
│    └─────────────────────────┘                                     │
│                                                                    │
│   ┌───────────────────────────────────────────┐                    │
│   │ User.Name                                 │                    │
│   │ User.Email                                │                    │
│   │                                           │                    │
│   │                                           │                    │
│   │                                           │                    │
│   │   (card should be a read-only version     │                    │
│   │    of the one on the parent page)         │      ┌────────┐    │
│   │                                           │      │ Submit │    │
│   └───────────────────────────────────────────┘      └────────┘    │
│                                                                    │
└────────────────────────────────────────────────────────────────────┘

@Forfold
Copy link
Contributor

Forfold commented Dec 12, 2023

These look good! We could probably put the "Add" button next to "Merge", using an outlined button group like we have in other spots around GoAlert

Also as an aside @mastercactapus, it may be worth checking out UI libraries such as Figma or Adobe XD to simplify and clean up UI mockups! You can import Material UI components and drag and drop them where you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants