Skip to content

[Frontend] Update audit events filter bar to search by username

What does this MR do and why?

This updates the audit events filter bar to search by username instead of user ID to resolve #335016 (closed).

This is part 2 containing the frontend changes, the backend MR is !73741 (merged).

The following changes were made:

  1. Update the utility methods to parse the username from and to the URL query.
  2. Move logic for handling primary identifier from the shared audit token to individual tokens (group, project, member & user).
  3. Update the audit filter to search by both entity_id for groups & projects, and username for users & members.
  4. Refactors shared audit event token specs.
  5. Add unit tests for the each audit token type.

Screenshots or screen recordings

Token in action

Before After
Kapture_2021-11-08_at_16.20.51 Kapture_2021-11-08_at_16.18.28

Instance audit events

Click to expand

[GDK_HOST]/admin/audit_logs

Before After
image image

Group audit events

Click to expand

[GDK_HOST]/groups/gitlab-org/-/audit_events

Before After
image image

Project audit events

Click to expand

[GDK_HOST]/gitlab-org/gitlab-shell/-/audit_events

Before After
image image

How to set up and validate locally

  1. You need a GitLab Premium license.
  2. View the different level of audit events using the above links.
  3. Try filtering by a user / member and validate the results.
  4. To create audit events, add users to a group/project or create a new group/project.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #335016 (closed)

Edited by Jiaan Louw

Merge request reports