mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
implemented "targetRelationCount" and exposed more of them in order by widget, fixes #1658
This commit is contained in:
@@ -319,14 +319,42 @@ class Note {
|
||||
return this.attributes.filter(attr => attr.type === 'label').length;
|
||||
}
|
||||
|
||||
get ownedLabelCount() {
|
||||
return this.ownedAttributes.filter(attr => attr.type === 'label').length;
|
||||
}
|
||||
|
||||
get relationCount() {
|
||||
return this.attributes.filter(attr => attr.type === 'relation' && !attr.isAutoLink()).length;
|
||||
}
|
||||
|
||||
get relationCountIncludingLinks() {
|
||||
return this.attributes.filter(attr => attr.type === 'relation').length;
|
||||
}
|
||||
|
||||
get ownedRelationCount() {
|
||||
return this.ownedAttributes.filter(attr => attr.type === 'relation' && !attr.isAutoLink()).length;
|
||||
}
|
||||
|
||||
get ownedRelationCountIncludingLinks() {
|
||||
return this.ownedAttributes.filter(attr => attr.type === 'relation').length;
|
||||
}
|
||||
|
||||
get targetRelationCount() {
|
||||
return this.targetRelations.filter(attr => !attr.isAutoLink()).length;
|
||||
}
|
||||
|
||||
get targetRelationCountIncludingLinks() {
|
||||
return this.targetRelations.length;
|
||||
}
|
||||
|
||||
get attributeCount() {
|
||||
return this.attributes.length;
|
||||
}
|
||||
|
||||
get ownedAttributeCount() {
|
||||
return this.attributes.length;
|
||||
}
|
||||
|
||||
get ancestors() {
|
||||
if (!this.ancestorCache) {
|
||||
const noteIds = new Set();
|
||||
|
||||
Reference in New Issue
Block a user