Skip to content

User Contribution Mapping - Sort dropdown should change on refresh when sort direction or type are present

What does this MR do and why?

On page load, initialSortBy needs to use the querySort param if it exists. This MR enforces that rule, to prevent situations where the URL query param does not match the chosen sort (as displayed in the sort dropdown).

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot 2024-10-09 at 12.03.40 AM.png Screenshot 2024-10-09 at 12.14.39 AM.png

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. To see in the UI, you'd need to have the feature flags enabled for user contribution mapping: importer_user_mapping and bulk_import_importer_user_mapping
  2. In your local database client, you'll need records in the import_source_users table. There is an unmerged branch with a rake task for creating dummy records. First take note of the group ID of one of the top level groups when you log into localhost.
  3. Checkout the unmerged branch and follow the instructions in this file https://gitlab.com/gitlab-org/gitlab/-/blob/seed-placeholder-users-task/lib/tasks/gitlab/seed/placeholder_users.rake . Replace "22" with your chosen group id.
  4. Verify that there are records in the Import::SourceUser table
  5. Open rails console and run the following Import::SourceUser.update_all(source_hostname: 'https://github.com')
  6. Navigate to /groups/[your-group]/-/group_members?tab=placeholders. For example I would go to 127.0.0.1:3000/groups/flightjs/-/group_members?tab=placeholders
  7. The sort label should say Source name (default) and the sort icon is Ascending
  8. Add STATUS_DESC to the url as sort query. EG. http://127.0.0.1:3000/groups/flightjs/-/group_members?tab=placeholders&sort=STATUS_DESC
  9. The sort label should now be Status and icon changed to descending.

Related to #495520 (closed)

Edited by Oiza Baiye

Merge request reports

Loading