Skip to content

Use fallback when project/group avatar fails to load

What does this MR do and why?

This MR adds fallbackOnError prop to GlAvatar used in app/assets/javascripts/vue_shared/components/project_avatar.vue, this allows avatar to use identicon as fallback when avatar fails to load (eg; the project is behind SSO and user is not logged in).

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

To test it locally, you can either have a project made available behind SSO (see documentation), which is much more complicated, or you can just modify app/assets/javascripts/vue_shared/components/project_avatar.vue#L56 and change :src="projectAvatarUrl" to src="someimage.jpg" and then avatar should show identicon since someimage.jpg doesn't exist.

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 #402242 (closed)

Edited by Kushal Pandya

Merge request reports