relation map deprecation - don't show it in menu to create new note

This commit is contained in:
zadam 2023-11-27 10:50:17 +01:00
parent ed00797179
commit 947627d8a0
4 changed files with 17 additions and 14 deletions

17
package-lock.json generated
View File

@ -5,7 +5,6 @@
"requires": true,
"packages": {
"": {
"name": "trilium",
"version": "0.62.2",
"hasInstallScript": true,
"license": "AGPL-3.0-only",
@ -35,7 +34,7 @@
"express-partial-content": "1.0.2",
"express-rate-limit": "7.1.4",
"express-session": "1.17.3",
"force-graph": "^1.43.4",
"force-graph": "1.43.4",
"fs-extra": "11.1.1",
"helmet": "7.1.0",
"html": "1.0.0",
@ -48,19 +47,19 @@
"is-svg": "4.3.2",
"jimp": "0.22.10",
"joplin-turndown-plugin-gfm": "1.0.12",
"jquery": "^3.7.1",
"jquery-hotkeys": "^0.2.2",
"jquery": "3.7.1",
"jquery-hotkeys": "0.2.2",
"jsdom": "22.1.0",
"katex": "0.16.9",
"marked": "9.1.6",
"mermaid": "^10.6.1",
"mermaid": "10.6.1",
"mime-types": "2.1.35",
"multer": "1.4.5-lts.1",
"node-abi": "3.51.0",
"normalize-strings": "1.1.1",
"open": "8.4.1",
"panzoom": "^9.4.3",
"print-this": "^2.0.0",
"panzoom": "9.4.3",
"print-this": "2.0.0",
"rand-token": "1.0.1",
"react": "18.2.0",
"react-dom": "18.2.0",
@ -73,11 +72,11 @@
"semver": "7.5.4",
"serve-favicon": "2.5.0",
"session-file-store": "1.5.0",
"split.js": "^1.6.5",
"split.js": "1.6.5",
"stream-throttle": "0.1.3",
"striptags": "3.2.0",
"tmp": "0.2.1",
"tree-kill": "^1.2.2",
"tree-kill": "1.2.2",
"turndown": "7.1.2",
"unescape": "1.0.1",
"ws": "8.14.2",

View File

@ -50,10 +50,10 @@ export default class TreeContextMenu {
{ title: 'Open in a new tab <kbd>Ctrl+Click</kbd>', 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 <kbd data-command="createNoteAfter"></kbd>', command: "insertNoteAfter", uiIcon: "bx bx-plus",
items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter") : null,
items: insertNoteAfterEnabled ? await noteTypesService.getNoteTypeItems("insertNoteAfter", {removeDeprecatedTypes: true}) : null,
enabled: insertNoteAfterEnabled && noSelectedNotes },
{ title: 'Insert child note <kbd data-command="createNoteInto"></kbd>', command: "insertChildNote", uiIcon: "bx bx-plus",
items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote") : null,
items: notSearch ? await noteTypesService.getNoteTypeItems("insertChildNote", {removeDeprecatedTypes: true}) : null,
enabled: notSearch && noSelectedNotes },
{ title: 'Delete <kbd data-command="deleteNotes"></kbd>', command: "deleteNotes", uiIcon: "bx bx-trash",
enabled: isNotRoot && !isHoisted && parentNotSearch },

View File

@ -1,19 +1,21 @@
import server from "./server.js";
import froca from "./froca.js";
async function getNoteTypeItems(command) {
async function getNoteTypeItems(command, opts = {}) {
const removeDeprecatedTypes = !!opts.removeDeprecatedTypes;
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" },
{ title: "Relation Map", command: command, type: "relationMap", uiIcon: "bx bx-map-alt", deprecated: true },
{ 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);

View File

@ -184,6 +184,8 @@ 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