Fixed avatar not displaying in issue boards

This happens when Gravatar is disabled in the admin settings, the avatar is returned as null & then frontend didn't do anything about it.

Closes #31428
This commit is contained in:
Phil Hughes 2017-04-28 11:27:52 +01:00
parent ef518df28a
commit 79d50538c4
4 changed files with 8 additions and 1 deletions

View File

@ -1,11 +1,12 @@
/* eslint-disable no-unused-vars */
import defaultAvatar from '../utils/default_avatar';
class ListUser {
constructor(user) {
this.id = user.id;
this.name = user.name;
this.username = user.username;
this.avatar = user.avatar_url;
this.avatar = user.avatar_url || defaultAvatar();
}
}

View File

@ -0,0 +1 @@
export default () => document.getElementById('board-app').dataset.defaultAvatar;

View File

@ -9,6 +9,7 @@ module BoardsHelper
issue_link_base: namespace_project_issues_path(@project.namespace, @project),
root_path: root_path,
bulk_update_path: bulk_update_namespace_project_issues_path(@project.namespace, @project),
default_avatar: image_path(default_avatar)
}
end
end

View File

@ -0,0 +1,4 @@
---
title: Fixed avatar not display on issue boards when Gravatar is disabled
merge_request:
author: