diff --git a/src/public/app/dialogs/delete_notes.js b/src/public/app/dialogs/delete_notes.js index 35eb880f5..dc1903adc 100644 --- a/src/public/app/dialogs/delete_notes.js +++ b/src/public/app/dialogs/delete_notes.js @@ -1,25 +1,61 @@ +import server from "../services/server.js"; +import treeCache from "../services/tree_cache.js"; +import linkService from "../services/link.js"; + const $dialog = $("#delete-notes-dialog"); const $confirmContent = $("#delete-notes-dialog-content"); const $okButton = $("#delete-notes-dialog-ok-button"); const $cancelButton = $("#delete-notes-dialog-cancel-button"); const $custom = $("#delete-notes-dialog-custom"); +const $deleteNotesList = $("#delete-notes-list"); +const $brokenRelationsList = $("#broken-relations-list"); +const $deletedNotesCount = $("#deleted-notes-count"); +const $noNoteToDeleteWrapper = $("#no-note-to-delete-wrapper"); +const $deleteNotesListWrapper = $("#delete-notes-list-wrapper"); +const $brokenRelationsListWrapper = $("#broken-relations-wrapper"); const DELETE_NOTE_BUTTON_ID = "delete-notes-dialog-delete-note"; let $originallyFocused; // element focused before the dialog was opened so we can return to it afterwards -export function showDialog(message) { +export async function showDialog(branchIdsToDelete) { $originallyFocused = $(':focus'); $custom.hide(); glob.activeDialog = $dialog; - if (typeof message === 'string') { - message = $("
${attr.name}
originating from `)
+ .append(await linkService.createNoteLink(attr.noteId))
+ );
+ }
$dialog.modal();
diff --git a/src/public/app/services/branches.js b/src/public/app/services/branches.js
index 8f368626b..66fdb0f7d 100644
--- a/src/public/app/services/branches.js
+++ b/src/public/app/services/branches.js
@@ -75,7 +75,7 @@ async function deleteNotes(branchIdsToDelete) {
}
const deleteNotesDialog = await import("../dialogs/delete_notes.js");
- deleteNotesDialog.showDialog();
+ deleteNotesDialog.showDialog(branchIdsToDelete);
const $deleteClonesCheckbox = $('