On this issue, we will work on creating the GraphQL endpoints that will be used by the improved user mapping.
Two types of users will interact with the feature: group owners and assigned users.
Initially, group owners will use the User reassignment UI, which will be supported by the GraphQL endpoints created here.
Group owners will be able to list all import source users and reassign a real user to a source user. They can also cancel that reassignment if needed. This endpoint must:
Only be accessible to group owners.
Return paginated Import::SourceUser records
Include a mutation for assigning a real user to an Import::SourceUser
Include a mutation to revoke the assignment of a user from an Import::SourceUser
Include a mutation to keep as a placeholder user
Note: These endpoints should only be available when the feature flag improved_user_mapping is enabled.
Questions: Should the email actions also be accessible via these endpoints?
Thanks! Yes, I think if the current plan is to implement the group owner-facing endpoints only in GraphQL, we can close this issue and clarify the issue body of #443555 (closed).
It might be better to clarify the issue body of #443555 (closed) and update this issue to reflect that we want to implement the group owner actions in GraphQL. It really doesn't matter either way, the comments discussing how to implement this is GraphQL are super helpful and enough to start work on it. I just have a preference for more small issues over one big one with multiple MRs
@rodrigo.tomonari@.luke I just had a look at the MR and I noticed that both this issue and MR don't have the Notify action (when state is awaiting_approval and admins want to resend the email to the mapped user). Can we add it as it's part of the design? Separate MR is fine too.
@justin_ho, I thought the Notify action would be implemented by #455912 (closed). Do you think we need a separate issue to implement the Notify action?
@rodrigo.tomonari I don't think these are the same. The issue above is about sending the email when admins first reassign a source user. What I am referring to is re-sending that notification manually. You can have a look at the designs (see "Pending approval" state) to see what the UI looks like.
I basically need an endpoint to which the frontend will send a request and get a success / error.
@rodrigo.tomonari I started work on the frontend to fetch the data from GraphQL and so far it's working pretty good. One very small thing we need to add is allowing users to filter the results into 2 tabs: "Awaiting reassignment" (all pending states) and "Reassigned" (kept as placeholder and complete states). You can have a look at the design. Do you think it can be added as a small MR? (Feel free to create a separate issue if needed)
Something worth mentioning is that I did not add a filter as described above. However, the frontend can supply an array of statuses to achieve the desired result. I believe that with this approach, the GraphQL API becomes more flexible, but the downside is that the frontend has to understand the meaning of each state. Is this okay from the frontend perspective?