Merge remote-tracking branch 'upstream/master' into excalidraw

conflict in
- package-lock (accept incoming),
- routes (remove the option to have image without filename, since it is not really necessary for canvas_note)
- note_detail
This commit is contained in:
Tom
2022-05-03 21:56:52 +02:00
38 changed files with 867 additions and 283 deletions

View File

@@ -194,7 +194,7 @@ function deleteBranch(req) {
const taskContext = TaskContext.getInstance(req.query.taskId, 'delete-notes');
const deleteId = utils.randomString(10);
const noteDeleted = noteService.deleteBranch(branch, deleteId, taskContext);
const noteDeleted = branch.deleteBranch(deleteId, taskContext);
if (eraseNotes) {
noteService.eraseNotesWithDeleteId(deleteId);

View File

@@ -138,7 +138,7 @@ function processContent(images, note, content) {
value: imageNote.noteId
}).save();
log.info(`Replacing ${imageId} with ${url} in note ${note.noteId}`);
log.info(`Replacing '${imageId}' with '${url}' in note '${note.noteId}'`);
rewrittenContent = utils.replaceAll(rewrittenContent, imageId, url);
}

View File

@@ -73,7 +73,7 @@ function deleteNote(req) {
const taskContext = TaskContext.getInstance(taskId, 'delete-notes');
noteService.deleteNote(note, deleteId, taskContext);
note.deleteNote(deleteId, taskContext);
if (eraseNotes) {
noteService.eraseNotesWithDeleteId(deleteId);
@@ -96,7 +96,7 @@ function sortChildNotes(req) {
const noteId = req.params.noteId;
const {sortBy, sortDirection} = req.body;
log.info(`Sorting ${noteId} children with ${sortBy} ${sortDirection}`);
log.info(`Sorting '${noteId}' children with ${sortBy} ${sortDirection}`);
const reverse = sortDirection === 'desc';
@@ -196,11 +196,11 @@ function changeTitle(req) {
const note = becca.getNote(noteId);
if (!note) {
return [404, `Note ${noteId} has not been found`];
return [404, `Note '${noteId}' has not been found`];
}
if (!note.isContentAvailable()) {
return [400, `Note ${noteId} is not available for change`];
return [400, `Note '${noteId}' is not available for change`];
}
const noteTitleChanged = note.title !== title;
@@ -289,10 +289,10 @@ function uploadModifiedFile(req) {
const note = becca.getNote(noteId);
if (!note) {
return [404, `Note ${noteId} has not been found`];
return [404, `Note '${noteId}' has not been found`];
}
log.info(`Updating note ${noteId} with content from ${filePath}`);
log.info(`Updating note '${noteId}' with content from ${filePath}`);
noteRevisionService.createNoteRevision(note);