Merge remote-tracking branch 'origin/stable'

# Conflicts:
#	src/services/note_cache/entities/note.js
This commit is contained in:
zadam
2021-01-23 21:09:47 +01:00
3 changed files with 51 additions and 4 deletions

View File

@@ -152,6 +152,14 @@ class Note {
&& (!value || attr.value.toLowerCase() === value));
}
hasLabel(name) {
return this.hasAttribute('label', name);
}
hasRelation(name) {
return this.hasAttribute('relation', name);
}
getLabelValue(name) {
const label = this.attributes.find(attr => attr.type === 'label' && attr.name === name);
@@ -294,6 +302,11 @@ class Note {
return arr.flat();
}
/** @return {String[]} */
get subtreeNoteIds() {
return this.subtreeNotes.map(note => note.noteId);
}
get parentCount() {
return this.parents.length;
}