mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:27:08 +00:00
Add popularLabels computed property.
Returns a list of labels used in the current view, in order of popularity (most used first). NOTE: this property is not actually used. It's technically dead code.
This commit is contained in:
@@ -287,6 +287,18 @@ export default {
|
||||
}
|
||||
}
|
||||
return filtered;
|
||||
|
||||
},
|
||||
|
||||
popularLabels () {
|
||||
const tuples = this.items.flatMap( i => i.labels )
|
||||
.filter( l => (this.labels[l]??{})?.model?.user )
|
||||
.reduce( (acc, cur) => {
|
||||
return cur in acc ? ++acc[cur][1] : acc[cur]=[cur,1], acc
|
||||
}, {});
|
||||
|
||||
return Object.values(tuples)
|
||||
.sort( (a, b) => b[1]-a[1] );
|
||||
},
|
||||
|
||||
defaultSequence () {
|
||||
|
||||
Reference in New Issue
Block a user