From 305d28b5b3c6cef9e98bc4c61cb04658be97d690 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 30 May 2024 06:24:50 +0200 Subject: [PATCH] remove warning about the relation map - trilium is sunsetting anyway, there's no point now in deprecating this feature, fixes #4779 --- src/public/app/menus/tree_context_menu.js | 4 ++-- src/public/app/services/note_types.js | 8 +++----- src/public/app/widgets/type_widgets/relation_map.js | 2 -- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/public/app/menus/tree_context_menu.js b/src/public/app/menus/tree_context_menu.js index feba6d69e..38c245251 100644 --- a/src/public/app/menus/tree_context_menu.js +++ b/src/public/app/menus/tree_context_menu.js @@ -50,10 +50,10 @@ export default class TreeContextMenu { { title: 'Open in a new tab Ctrl+Click', command: "openInTab", uiIcon: "bx bx-empty", enabled: noSelectedNotes }, { title: 'Open in a new split', command: "openNoteInSplit", uiIcon: "bx bx-dock-right", enabled: noSelectedNotes }, { title: 'Insert note after ', command: "insertNoteAfter", uiIcon: "bx bx-plus", - items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter", {removeDeprecatedTypes: true}) : null, + items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter") : null, enabled: insertNoteAfterEnabled && noSelectedNotes }, { title: 'Insert child note ', command: "insertChildNote", uiIcon: "bx bx-plus", - items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote", {removeDeprecatedTypes: true}) : null, + items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote") : null, enabled: notSearch && noSelectedNotes }, { title: 'Delete ', command: "deleteNotes", uiIcon: "bx bx-trash", enabled: isNotRoot && !isHoisted && parentNotSearch }, diff --git a/src/public/app/services/note_types.js b/src/public/app/services/note_types.js index 6a44e03b3..40bc4a88b 100644 --- a/src/public/app/services/note_types.js +++ b/src/public/app/services/note_types.js @@ -1,21 +1,19 @@ import server from "./server.js"; import froca from "./froca.js"; -async function getNoteTypeItems(command, opts = {}) { - const removeDeprecatedTypes = !!opts.removeDeprecatedTypes; - +async function getNoteTypeItems(command) { const items = [ { title: "Text", command: command, type: "text", uiIcon: "bx bx-note" }, { title: "Code", command: command, type: "code", uiIcon: "bx bx-code" }, { title: "Saved Search", command: command, type: "search", uiIcon: "bx bx-file-find" }, - { title: "Relation Map", command: command, type: "relationMap", uiIcon: "bx bx-map-alt", deprecated: true }, + { title: "Relation Map", command: command, type: "relationMap", uiIcon: "bx bx-map-alt" }, { title: "Note Map", command: command, type: "noteMap", uiIcon: "bx bx-map-alt" }, { title: "Render Note", command: command, type: "render", uiIcon: "bx bx-extension" }, { title: "Book", command: command, type: "book", uiIcon: "bx bx-book" }, { title: "Mermaid Diagram", command: command, type: "mermaid", uiIcon: "bx bx-selection" }, { title: "Canvas", command: command, type: "canvas", uiIcon: "bx bx-pen" }, { title: "Web View", command: command, type: "webView", uiIcon: "bx bx-globe-alt" }, - ].filter(item => !removeDeprecatedTypes || !item.deprecated); + ]; const templateNoteIds = await server.get("search-templates"); const templateNotes = await froca.getNotes(templateNoteIds); diff --git a/src/public/app/widgets/type_widgets/relation_map.js b/src/public/app/widgets/type_widgets/relation_map.js index 6fea5eb6a..beb16ff07 100644 --- a/src/public/app/widgets/type_widgets/relation_map.js +++ b/src/public/app/widgets/type_widgets/relation_map.js @@ -184,8 +184,6 @@ export default class RelationMapTypeWidget extends TypeWidget { } async loadMapData() { - toastService.showMessage("Relation Map has been deprecated since Trilium 0.63 and will be removed in a future version. Migrate your content to some other note type (e.g. canvas) as soon as possible.", 5000); - this.mapData = { notes: [], // it is important to have this exact value here so that initial transform is the same as this