mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 08:15:52 +01:00
fix inverse relation detection in relation maps
This commit is contained in:
@@ -380,15 +380,15 @@ class Note extends Entity {
|
||||
return firstDefinitionIndex === index;
|
||||
}
|
||||
else {
|
||||
const definitionAttr = attributes.find(el => el.type === attr.type + '-definition' && el.name === attr.name);
|
||||
const definitionAttr = attributes.find(el => el.type === 'label' && el.name === attr.type + ':' + attr.name);
|
||||
|
||||
if (!definitionAttr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const definition = definitionAttr.value;
|
||||
const definition = definitionAttr.getDefinition();
|
||||
|
||||
if (definition.multiplicityType === 'multi') {
|
||||
if (definition.multiplicity === 'multi') {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@@ -868,6 +868,16 @@ class Note extends Entity {
|
||||
return notePaths;
|
||||
}
|
||||
|
||||
getRelationDefinitions() {
|
||||
return this.getLabels()
|
||||
.filter(l => l.name.startsWith("relation:"));
|
||||
}
|
||||
|
||||
getLabelDefinitions() {
|
||||
return this.getLabels()
|
||||
.filter(l => l.name.startsWith("relation:"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ancestorNoteId
|
||||
* @return {boolean} - true if ancestorNoteId occurs in at least one of the note's paths
|
||||
|
||||
Reference in New Issue
Block a user