mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 02:30:42 +01:00
support for cssClass label on note
This commit is contained in:
@@ -26,10 +26,19 @@ async function cloneNoteToParent(noteId, parentNoteId, prefix) {
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
// this is identical to cloneNoteToParent except for the intention - if cloned note is already in parent,
|
||||
// then this is successful result
|
||||
async function ensureNoteIsPresentInParent(noteId, parentNoteId, prefix) {
|
||||
await cloneNoteToParent(noteId, parentNoteId, prefix);
|
||||
const validationResult = await treeService.validateParentChild(parentNoteId, noteId);
|
||||
|
||||
if (!validationResult.success) {
|
||||
return validationResult;
|
||||
}
|
||||
|
||||
await new Branch({
|
||||
noteId: noteId,
|
||||
parentNoteId: parentNoteId,
|
||||
prefix: prefix,
|
||||
isExpanded: 0
|
||||
}).save();
|
||||
}
|
||||
|
||||
async function ensureNoteIsAbsentFromParent(noteId, parentNoteId) {
|
||||
|
||||
@@ -10,6 +10,10 @@ async function setEntityConstructor(constructor) {
|
||||
}
|
||||
|
||||
async function getEntityFromName(entityName, entityId) {
|
||||
if (!entityName || !entityId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const constructor = entityConstructor.getEntityFromTableName(entityName);
|
||||
|
||||
return await getEntity(`SELECT * FROM ${constructor.tableName} WHERE ${constructor.primaryKeyName} = ?`, [entityId]);
|
||||
|
||||
Reference in New Issue
Block a user