Order issues by label priority instead of id on board lists

This commit is contained in:
Douglas Barbosa Alexandre 2016-08-09 18:05:17 -03:00 committed by Phil Hughes
parent 57deadce46
commit 7937321bce
3 changed files with 6 additions and 1 deletions

View file

@ -12,6 +12,10 @@ class Issue {
obj.labels.forEach((label) => {
this.labels.push(new Label(label));
});
this.priority = this.labels.reduce((max, label) => {
return (label.priority < max) ? label.priority : max;
}, Infinity);
}
addLabel (label) {

View file

@ -4,5 +4,6 @@ class Label {
this.title = obj.title;
this.color = obj.color;
this.description = obj.description;
this.priority = (obj.priority !== null) ? obj.priority : Infinity;
}
}

View file

@ -1,5 +1,5 @@
%board-card{ "inline-template" => true,
"v-for" => "issue in issues | orderBy 'id' -1",
"v-for" => "issue in issues | orderBy ['priority', 'id']",
":issue" => "issue",
":issue-link-base" => "issueLinkBase",
":disabled" => "disabled",