Skip to content

Commit 947627d

Browse files
committed
relation map deprecation - don't show it in menu to create new note
1 parent ed00797 commit 947627d

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

package-lock.json

Lines changed: 8 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public/app/menus/tree_context_menu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ export default class TreeContextMenu {
5050
{ title: 'Open in a new tab <kbd>Ctrl+Click</kbd>', command: "openInTab", uiIcon: "bx bx-empty", enabled: noSelectedNotes },
5151
{ title: 'Open in a new split', command: "openNoteInSplit", uiIcon: "bx bx-dock-right", enabled: noSelectedNotes },
5252
{ title: 'Insert note after <kbd data-command="createNoteAfter"></kbd>', command: "insertNoteAfter", uiIcon: "bx bx-plus",
53-
items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter") : null,
53+
items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter", {removeDeprecatedTypes: true}) : null,
5454
enabled: insertNoteAfterEnabled && noSelectedNotes },
5555
{ title: 'Insert child note <kbd data-command="createNoteInto"></kbd>', command: "insertChildNote", uiIcon: "bx bx-plus",
56-
items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote") : null,
56+
items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote", {removeDeprecatedTypes: true}) : null,
5757
enabled: notSearch && noSelectedNotes },
5858
{ title: 'Delete <kbd data-command="deleteNotes"></kbd>', command: "deleteNotes", uiIcon: "bx bx-trash",
5959
enabled: isNotRoot && !isHoisted && parentNotSearch },

src/public/app/services/note_types.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
import server from "./server.js";
22
import froca from "./froca.js";
33

4-
async function getNoteTypeItems(command) {
4+
async function getNoteTypeItems(command, opts = {}) {
5+
const removeDeprecatedTypes = !!opts.removeDeprecatedTypes;
6+
57
const items = [
68
{ title: "Text", command: command, type: "text", uiIcon: "bx bx-note" },
79
{ title: "Code", command: command, type: "code", uiIcon: "bx bx-code" },
810
{ title: "Saved Search", command: command, type: "search", uiIcon: "bx bx-file-find" },
9-
{ title: "Relation Map", command: command, type: "relationMap", uiIcon: "bx bx-map-alt" },
11+
{ title: "Relation Map", command: command, type: "relationMap", uiIcon: "bx bx-map-alt", deprecated: true },
1012
{ title: "Note Map", command: command, type: "noteMap", uiIcon: "bx bx-map-alt" },
1113
{ title: "Render Note", command: command, type: "render", uiIcon: "bx bx-extension" },
1214
{ title: "Book", command: command, type: "book", uiIcon: "bx bx-book" },
1315
{ title: "Mermaid Diagram", command: command, type: "mermaid", uiIcon: "bx bx-selection" },
1416
{ title: "Canvas", command: command, type: "canvas", uiIcon: "bx bx-pen" },
1517
{ title: "Web View", command: command, type: "webView", uiIcon: "bx bx-globe-alt" },
16-
];
18+
].filter(item => !removeDeprecatedTypes || !item.deprecated);
1719

1820
const templateNoteIds = await server.get("search-templates");
1921
const templateNotes = await froca.getNotes(templateNoteIds);

src/public/app/widgets/type_widgets/relation_map.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ export default class RelationMapTypeWidget extends TypeWidget {
184184
}
185185

186186
async loadMapData() {
187+
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);
188+
187189
this.mapData = {
188190
notes: [],
189191
// it is important to have this exact value here so that initial transform is the same as this

0 commit comments

Comments
 (0)