Skip to content

User mapping - Add fetching of importSourceUsers

Justin Ho Tuan Duong requested to merge 467371-add-graphql-actions into master

What does this MR do and why?

  • Add GraphQL query and fetching in app. Update existing code to match query response.
  • Add pagination to table.

Here is the list of MRs around the feature:

MR Status
Add basic PlaceholdersTabApp and feature flag Merged
Add placeholder users table Merged
Add placeholder actions with users select to table Merged
Add placeholder users table actions logic and validation Merged
Add fetching of importSourceUsers 👈 You are here

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
User_mapping_fetch_users_before User_mapping_fetch_users_after

How to set up and validate locally

  1. Apply this diff to show the "Placeholders" tab:
diff --git a/app/assets/javascripts/members/components/members_tabs.vue b/app/assets/javascripts/members/components/members_tabs.vue
index 05fde6369d16..be4df313533a 100644
--- a/app/assets/javascripts/members/components/members_tabs.vue
+++ b/app/assets/javascripts/members/components/members_tabs.vue
@@ -27,6 +27,7 @@ export default {
           ...getters,
           // eslint-disable-next-line @gitlab/require-i18n-strings
           [`${memberType}Count`](state) {
+            if (memberType === 'placeholder') return 1;
             return countComputed(state, memberType);
           },
         };
  1. Go to Group > Members and select the Placeholders tab. For example, http://127.0.0.1:3000/groups/gitlab-org/-/group_members?tab=placeholders.
  2. You should see an empty table.
  3. To create a few dummy Import::SourceUser records:
    1. Checkout the branch seed-placeholder-users-task.
    2. Run this rake task bin/rake gitlab:seed:placeholder_users\[22,50\], replacing 22 with any group_id. (Note: 50 is the number of users created)
    3. Open a Rails console with bin/rails console and run this:
s = Import::SourceUser.last
s.reassigned_by_user_id = 1
s.reassign_to_user_id = s.placeholder_user_id
s.status = 1
s.save

Related to #467371 (closed)

Edited by Justin Ho Tuan Duong

Merge request reports