Skip to content

Commit a64a0e5

Browse files
committed
Merge branch 'refs/heads/stable'
# Conflicts: # package-lock.json
2 parents 8ebebec + 88c4171 commit a64a0e5

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

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", {removeDeprecatedTypes: true}) : null,
53+
items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter") : 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", {removeDeprecatedTypes: true}) : null,
56+
items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote") : 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: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
import server from "./server.js";
22
import froca from "./froca.js";
33

4-
async function getNoteTypeItems(command, opts = {}) {
5-
const removeDeprecatedTypes = !!opts.removeDeprecatedTypes;
6-
4+
async function getNoteTypeItems(command) {
75
const items = [
86
{ title: "Text", command: command, type: "text", uiIcon: "bx bx-note" },
97
{ title: "Code", command: command, type: "code", uiIcon: "bx bx-code" },
108
{ title: "Saved Search", command: command, type: "search", uiIcon: "bx bx-file-find" },
11-
{ title: "Relation Map", command: command, type: "relationMap", uiIcon: "bx bx-map-alt", deprecated: true },
9+
{ title: "Relation Map", command: command, type: "relationMap", uiIcon: "bx bx-map-alt" },
1210
{ title: "Note Map", command: command, type: "noteMap", uiIcon: "bx bx-map-alt" },
1311
{ title: "Render Note", command: command, type: "render", uiIcon: "bx bx-extension" },
1412
{ title: "Book", command: command, type: "book", uiIcon: "bx bx-book" },
1513
{ title: "Mermaid Diagram", command: command, type: "mermaid", uiIcon: "bx bx-selection" },
1614
{ title: "Canvas", command: command, type: "canvas", uiIcon: "bx bx-pen" },
1715
{ title: "Web View", command: command, type: "webView", uiIcon: "bx bx-globe-alt" },
18-
].filter(item => !removeDeprecatedTypes || !item.deprecated);
16+
];
1917

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

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ 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-
189187
this.mapData = {
190188
notes: [],
191189
// it is important to have this exact value here so that initial transform is the same as this

src/services/notes.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -458,13 +458,18 @@ function findIncludeNoteLinks(content, foundLinks) {
458458
}
459459

460460
function findRelationMapLinks(content, foundLinks) {
461-
const obj = JSON.parse(content);
461+
try {
462+
const obj = JSON.parse(content);
462463

463-
for (const note of obj.notes) {
464-
foundLinks.push({
465-
name: 'relationMapLink',
466-
value: note.noteId
467-
});
464+
for (const note of obj.notes) {
465+
foundLinks.push({
466+
name: 'relationMapLink',
467+
value: note.noteId
468+
});
469+
}
470+
}
471+
catch (e) {
472+
log.error("Could not scan for relation map links: " + e.message);
468473
}
469474
}
470475

0 commit comments

Comments
 (0)