Merge branch 'master' into next55

# Conflicts:
#	electron.js
#	package-lock.json
#	package.json
#	src/public/app/layouts/desktop_layout.js
#	src/public/app/widgets/note_tree.js
#	src/services/port.js
This commit is contained in:
zadam
2022-10-15 12:09:25 +02:00
112 changed files with 1817 additions and 418 deletions

View File

@@ -11,7 +11,7 @@ async function moveBeforeBranch(branchIdsToMove, beforeBranchId) {
branchIdsToMove = filterSearchBranches(branchIdsToMove);
if (beforeBranchId === 'root') {
alert('Cannot move notes before root note.');
toastService.showError('Cannot move notes before root note.');
return;
}
@@ -19,7 +19,7 @@ async function moveBeforeBranch(branchIdsToMove, beforeBranchId) {
const resp = await server.put(`branches/${branchIdToMove}/move-before/${beforeBranchId}`);
if (!resp.success) {
alert(resp.message);
toastService.showError(resp.message);
return;
}
}
@@ -32,7 +32,7 @@ async function moveAfterBranch(branchIdsToMove, afterBranchId) {
const afterNote = await froca.getBranch(afterBranchId).getNote();
if (afterNote.noteId === 'root' || afterNote.noteId === hoistedNoteService.getHoistedNoteId()) {
alert('Cannot move notes after root note.');
toastService.showError('Cannot move notes after root note.');
return;
}
@@ -42,7 +42,7 @@ async function moveAfterBranch(branchIdsToMove, afterBranchId) {
const resp = await server.put(`branches/${branchIdToMove}/move-after/${afterBranchId}`);
if (!resp.success) {
alert(resp.message);
toastService.showError(resp.message);
return;
}
}
@@ -62,13 +62,13 @@ async function moveToParentNote(branchIdsToMove, newParentBranchId) {
const resp = await server.put(`branches/${branchIdToMove}/move-to/${newParentBranchId}`);
if (!resp.success) {
alert(resp.message);
toastService.showError(resp.message);
return;
}
}
}
async function deleteNotes(branchIdsToDelete) {
async function deleteNotes(branchIdsToDelete, forceDeleteAllClones = false) {
branchIdsToDelete = filterRootNote(branchIdsToDelete);
if (branchIdsToDelete.length === 0) {
@@ -83,7 +83,7 @@ async function deleteNotes(branchIdsToDelete) {
}
else {
({proceed, deleteAllClones, eraseNotes} = await new Promise(res =>
appContext.triggerCommand('showDeleteNotesDialog', {branchIdsToDelete, callback: res})));
appContext.triggerCommand('showDeleteNotesDialog', {branchIdsToDelete, callback: res, forceDeleteAllClones})));
}
if (!proceed) {
@@ -130,7 +130,7 @@ async function moveNodeUpInHierarchy(node) {
const resp = await server.put(`branches/${branchIdToMove}/move-after/${targetBranchId}`);
if (!resp.success) {
alert(resp.message);
toastService.showError(resp.message);
return;
}
@@ -206,7 +206,7 @@ async function cloneNoteToBranch(childNoteId, parentBranchId, prefix) {
});
if (!resp.success) {
alert(resp.message);
toastService.showError(resp.message);
}
}
@@ -216,7 +216,7 @@ async function cloneNoteToNote(childNoteId, parentNoteId, prefix) {
});
if (!resp.success) {
alert(resp.message);
toastService.showError(resp.message);
}
}
@@ -225,7 +225,7 @@ async function cloneNoteAfter(noteId, afterBranchId) {
const resp = await server.put('notes/' + noteId + '/clone-after/' + afterBranchId);
if (!resp.success) {
alert(resp.message);
toastService.showError(resp.message);
}
}