Skip to content

Refactor how user avatar is updated

What does this MR do and why?

Refactor how user avatar is updated

Updating the user avatar was done by simply replacing the URL of the avatar elements. This is potentially tricky if the underlying Avatar implementation changes (and also was done via the test-id).

Let's trigger a custom event instead once a user uploads a new avatar.

Remove legacy tracking for "buy minutes" link

The legacy buy minutes link isn't used any longer. The new one has tracking enabled as well. So this part of the code can be deleted.

See also: https://gitlab.com/gitlab-org/gitlab/-/blob/ea882a427be6a45857664ceb73e88ed83936f2a6/app/assets/javascripts/super_sidebar/components/user_menu.vue#L105-116

Remove old todo counter logic

The legacy sidebar used to update todo counts by manipulating the DOM directly. As we do not use the sidebar any longer, we can remove this code. The new sidebar still has this functionality, see: app/assets/javascripts/super_sidebar/user_counts_manager.js

Screenshots or screen recordings

Before After
Screen_Recording_2023-11-20_at_09.49.37

How to set up and validate locally

  1. Upload an avatar to a user
  2. Remove avatar if necessary.

MR acceptance checklist

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

Edited by Lukas 'ai-pi' Eipert

Merge request reports