Added assignee to frontend
This commit is contained in:
parent
fcee9323c0
commit
db2eabfd03
4 changed files with 20 additions and 0 deletions
|
@ -2,6 +2,11 @@ class Issue {
|
|||
constructor (obj) {
|
||||
this.id = obj.iid;
|
||||
this.title = obj.title;
|
||||
|
||||
if (obj.assignee) {
|
||||
this.assignee = new User(obj.assignee);
|
||||
}
|
||||
|
||||
this.labels = [];
|
||||
|
||||
obj.labels.forEach((label) => {
|
||||
|
|
8
app/assets/javascripts/boards/models/user.js.es6
Normal file
8
app/assets/javascripts/boards/models/user.js.es6
Normal file
|
@ -0,0 +1,8 @@
|
|||
class User {
|
||||
constructor (user) {
|
||||
this.id = user.id;
|
||||
this.name = user.name;
|
||||
this.username = user.username;
|
||||
this.avatar = user.avatar_url;
|
||||
}
|
||||
}
|
|
@ -237,3 +237,8 @@
|
|||
margin-right: 8px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.card-avatar {
|
||||
margin-top: -2px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
|
|
@ -8,3 +8,5 @@
|
|||
{{ issue.id }}
|
||||
%span.label.color-label{ "v-for" => "label in issue.labels", ":style" => "{ backgroundColor: label.color, color: label.textColor }" }
|
||||
{{ label.title }}
|
||||
%a{ ":href" => "'/u/' + issue.assignee.username", ":title" => "issue.assignee.name", "v-if" => "issue.assignee" }
|
||||
%img.card-avatar{ ":src" => "issue.assignee.avatar", width: 20, height: 20 }
|
||||
|
|
Loading…
Reference in a new issue