BigW Consortium Gitlab

Commit 7937321b by Douglas Barbosa Alexandre Committed by Phil Hughes

Order issues by label priority instead of id on board lists

parent 57deadce
...@@ -12,6 +12,10 @@ class Issue { ...@@ -12,6 +12,10 @@ class Issue {
obj.labels.forEach((label) => { obj.labels.forEach((label) => {
this.labels.push(new Label(label)); this.labels.push(new Label(label));
}); });
this.priority = this.labels.reduce((max, label) => {
return (label.priority < max) ? label.priority : max;
}, Infinity);
} }
addLabel (label) { addLabel (label) {
......
...@@ -4,5 +4,6 @@ class Label { ...@@ -4,5 +4,6 @@ class Label {
this.title = obj.title; this.title = obj.title;
this.color = obj.color; this.color = obj.color;
this.description = obj.description; this.description = obj.description;
this.priority = (obj.priority !== null) ? obj.priority : Infinity;
} }
} }
%board-card{ "inline-template" => true, %board-card{ "inline-template" => true,
"v-for" => "issue in issues | orderBy 'id' -1", "v-for" => "issue in issues | orderBy ['priority', 'id']",
":issue" => "issue", ":issue" => "issue",
":issue-link-base" => "issueLinkBase", ":issue-link-base" => "issueLinkBase",
":disabled" => "disabled", ":disabled" => "disabled",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment