Order issues by label priority instead of id on board lists
This commit is contained in:
parent
57deadce46
commit
7937321bce
3 changed files with 6 additions and 1 deletions
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue