mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	relation map deprecation - don't show it in menu to create new note
This commit is contained in:
		
							parent
							
								
									ed00797179
								
							
						
					
					
						commit
						947627d8a0
					
				
							
								
								
									
										17
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										17
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@ -5,7 +5,6 @@
 | 
				
			|||||||
  "requires": true,
 | 
					  "requires": true,
 | 
				
			||||||
  "packages": {
 | 
					  "packages": {
 | 
				
			||||||
    "": {
 | 
					    "": {
 | 
				
			||||||
      "name": "trilium",
 | 
					 | 
				
			||||||
      "version": "0.62.2",
 | 
					      "version": "0.62.2",
 | 
				
			||||||
      "hasInstallScript": true,
 | 
					      "hasInstallScript": true,
 | 
				
			||||||
      "license": "AGPL-3.0-only",
 | 
					      "license": "AGPL-3.0-only",
 | 
				
			||||||
@ -35,7 +34,7 @@
 | 
				
			|||||||
        "express-partial-content": "1.0.2",
 | 
					        "express-partial-content": "1.0.2",
 | 
				
			||||||
        "express-rate-limit": "7.1.4",
 | 
					        "express-rate-limit": "7.1.4",
 | 
				
			||||||
        "express-session": "1.17.3",
 | 
					        "express-session": "1.17.3",
 | 
				
			||||||
        "force-graph": "^1.43.4",
 | 
					        "force-graph": "1.43.4",
 | 
				
			||||||
        "fs-extra": "11.1.1",
 | 
					        "fs-extra": "11.1.1",
 | 
				
			||||||
        "helmet": "7.1.0",
 | 
					        "helmet": "7.1.0",
 | 
				
			||||||
        "html": "1.0.0",
 | 
					        "html": "1.0.0",
 | 
				
			||||||
@ -48,19 +47,19 @@
 | 
				
			|||||||
        "is-svg": "4.3.2",
 | 
					        "is-svg": "4.3.2",
 | 
				
			||||||
        "jimp": "0.22.10",
 | 
					        "jimp": "0.22.10",
 | 
				
			||||||
        "joplin-turndown-plugin-gfm": "1.0.12",
 | 
					        "joplin-turndown-plugin-gfm": "1.0.12",
 | 
				
			||||||
        "jquery": "^3.7.1",
 | 
					        "jquery": "3.7.1",
 | 
				
			||||||
        "jquery-hotkeys": "^0.2.2",
 | 
					        "jquery-hotkeys": "0.2.2",
 | 
				
			||||||
        "jsdom": "22.1.0",
 | 
					        "jsdom": "22.1.0",
 | 
				
			||||||
        "katex": "0.16.9",
 | 
					        "katex": "0.16.9",
 | 
				
			||||||
        "marked": "9.1.6",
 | 
					        "marked": "9.1.6",
 | 
				
			||||||
        "mermaid": "^10.6.1",
 | 
					        "mermaid": "10.6.1",
 | 
				
			||||||
        "mime-types": "2.1.35",
 | 
					        "mime-types": "2.1.35",
 | 
				
			||||||
        "multer": "1.4.5-lts.1",
 | 
					        "multer": "1.4.5-lts.1",
 | 
				
			||||||
        "node-abi": "3.51.0",
 | 
					        "node-abi": "3.51.0",
 | 
				
			||||||
        "normalize-strings": "1.1.1",
 | 
					        "normalize-strings": "1.1.1",
 | 
				
			||||||
        "open": "8.4.1",
 | 
					        "open": "8.4.1",
 | 
				
			||||||
        "panzoom": "^9.4.3",
 | 
					        "panzoom": "9.4.3",
 | 
				
			||||||
        "print-this": "^2.0.0",
 | 
					        "print-this": "2.0.0",
 | 
				
			||||||
        "rand-token": "1.0.1",
 | 
					        "rand-token": "1.0.1",
 | 
				
			||||||
        "react": "18.2.0",
 | 
					        "react": "18.2.0",
 | 
				
			||||||
        "react-dom": "18.2.0",
 | 
					        "react-dom": "18.2.0",
 | 
				
			||||||
@ -73,11 +72,11 @@
 | 
				
			|||||||
        "semver": "7.5.4",
 | 
					        "semver": "7.5.4",
 | 
				
			||||||
        "serve-favicon": "2.5.0",
 | 
					        "serve-favicon": "2.5.0",
 | 
				
			||||||
        "session-file-store": "1.5.0",
 | 
					        "session-file-store": "1.5.0",
 | 
				
			||||||
        "split.js": "^1.6.5",
 | 
					        "split.js": "1.6.5",
 | 
				
			||||||
        "stream-throttle": "0.1.3",
 | 
					        "stream-throttle": "0.1.3",
 | 
				
			||||||
        "striptags": "3.2.0",
 | 
					        "striptags": "3.2.0",
 | 
				
			||||||
        "tmp": "0.2.1",
 | 
					        "tmp": "0.2.1",
 | 
				
			||||||
        "tree-kill": "^1.2.2",
 | 
					        "tree-kill": "1.2.2",
 | 
				
			||||||
        "turndown": "7.1.2",
 | 
					        "turndown": "7.1.2",
 | 
				
			||||||
        "unescape": "1.0.1",
 | 
					        "unescape": "1.0.1",
 | 
				
			||||||
        "ws": "8.14.2",
 | 
					        "ws": "8.14.2",
 | 
				
			||||||
 | 
				
			|||||||
@ -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 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: '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",
 | 
					            { 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 },
 | 
					                enabled: insertNoteAfterEnabled && noSelectedNotes },
 | 
				
			||||||
            { title: 'Insert child note <kbd data-command="createNoteInto"></kbd>', command: "insertChildNote", uiIcon: "bx bx-plus",
 | 
					            { 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 },
 | 
					                enabled: notSearch && noSelectedNotes },
 | 
				
			||||||
            { title: 'Delete <kbd data-command="deleteNotes"></kbd>', command: "deleteNotes", uiIcon: "bx bx-trash",
 | 
					            { title: 'Delete <kbd data-command="deleteNotes"></kbd>', command: "deleteNotes", uiIcon: "bx bx-trash",
 | 
				
			||||||
                enabled: isNotRoot && !isHoisted && parentNotSearch },
 | 
					                enabled: isNotRoot && !isHoisted && parentNotSearch },
 | 
				
			||||||
 | 
				
			|||||||
@ -1,19 +1,21 @@
 | 
				
			|||||||
import server from "./server.js";
 | 
					import server from "./server.js";
 | 
				
			||||||
import froca from "./froca.js";
 | 
					import froca from "./froca.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function getNoteTypeItems(command) {
 | 
					async function getNoteTypeItems(command, opts = {}) {
 | 
				
			||||||
 | 
					    const removeDeprecatedTypes = !!opts.removeDeprecatedTypes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const items = [
 | 
					    const items = [
 | 
				
			||||||
        { title: "Text", command: command, type: "text", uiIcon: "bx bx-note" },
 | 
					        { title: "Text", command: command, type: "text", uiIcon: "bx bx-note" },
 | 
				
			||||||
        { title: "Code", command: command, type: "code", uiIcon: "bx bx-code" },
 | 
					        { title: "Code", command: command, type: "code", uiIcon: "bx bx-code" },
 | 
				
			||||||
        { title: "Saved Search", command: command, type: "search", uiIcon: "bx bx-file-find" },
 | 
					        { 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: "Note Map", command: command, type: "noteMap", uiIcon: "bx bx-map-alt" },
 | 
				
			||||||
        { title: "Render Note", command: command, type: "render", uiIcon: "bx bx-extension" },
 | 
					        { title: "Render Note", command: command, type: "render", uiIcon: "bx bx-extension" },
 | 
				
			||||||
        { title: "Book", command: command, type: "book", uiIcon: "bx bx-book" },
 | 
					        { title: "Book", command: command, type: "book", uiIcon: "bx bx-book" },
 | 
				
			||||||
        { title: "Mermaid Diagram", command: command, type: "mermaid", uiIcon: "bx bx-selection" },
 | 
					        { title: "Mermaid Diagram", command: command, type: "mermaid", uiIcon: "bx bx-selection" },
 | 
				
			||||||
        { title: "Canvas", command: command, type: "canvas", uiIcon: "bx bx-pen" },
 | 
					        { title: "Canvas", command: command, type: "canvas", uiIcon: "bx bx-pen" },
 | 
				
			||||||
        { title: "Web View", command: command, type: "webView", uiIcon: "bx bx-globe-alt" },
 | 
					        { 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 templateNoteIds = await server.get("search-templates");
 | 
				
			||||||
    const templateNotes = await froca.getNotes(templateNoteIds);
 | 
					    const templateNotes = await froca.getNotes(templateNoteIds);
 | 
				
			||||||
 | 
				
			|||||||
@ -184,6 +184,8 @@ export default class RelationMapTypeWidget extends TypeWidget {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async loadMapData() {
 | 
					    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 = {
 | 
					        this.mapData = {
 | 
				
			||||||
            notes: [],
 | 
					            notes: [],
 | 
				
			||||||
            // it is important to have this exact value here so that initial transform is the same as this
 | 
					            // it is important to have this exact value here so that initial transform is the same as this
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user