loading of custom widgets

This commit is contained in:
zadam
2019-08-17 11:28:36 +02:00
parent 53c4bb8a94
commit fd9b79e115
7 changed files with 63 additions and 12 deletions

View File

@@ -248,6 +248,21 @@ class Note extends Entity {
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise<Note[]>}
*/
async getRelationTargets(name) {
const relations = await this.getRelations(name);
const targets = [];
for (const relation of relations) {
targets.push(await relation.getTargetNote());
}
return targets;
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise<Attribute[]>} all note's relation definitions including inherited ones