Merge branch 'master' into next60

# Conflicts:
#	package-lock.json
#	package.json
This commit is contained in:
zadam
2023-04-10 18:52:30 +02:00
62 changed files with 2281 additions and 369 deletions

View File

@@ -24,7 +24,7 @@ const noteTypesService = require("./note_types");
const {attach} = require("jsdom/lib/jsdom/living/helpers/svg/basic-types.js");
function getNewNotePosition(parentNote) {
if (parentNote.hasLabel('newNotesOnTop')) {
if (parentNote.isLabelTruthy('newNotesOnTop')) {
const minNotePos = parentNote.getChildBranches()
.reduce((min, note) => Math.min(min, note.notePosition), 0);
@@ -827,7 +827,7 @@ function duplicateSubtree(origNoteId, newParentNoteId) {
throw new Error('Duplicating root is not possible');
}
log.info(`Duplicating ${origNoteId} subtree into ${newParentNoteId}`);
log.info(`Duplicating '${origNoteId}' subtree into '${newParentNoteId}'`);
const origNote = becca.notes[origNoteId];
// might be null if orig note is not in the target newParentNoteId
@@ -905,7 +905,8 @@ function duplicateSubtreeInner(origNote, origBranch, newParentNoteId, noteIdMapp
attr.value = noteIdMapping[attr.value];
}
attr.save();
// the relation targets may not be created yet, the mapping is pre-generated
attr.save({skipValidation: true});
}
for (const childBranch of origNote.getChildBranches()) {