mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	system links (internal, image, relation map) should follow camelCase convention used for other attributes
This commit is contained in:
		| @@ -0,0 +1,3 @@ | |||||||
|  | UPDATE attributes SET name = 'internalLink' WHERE name = 'internal-link'; | ||||||
|  | UPDATE attributes SET name = 'imageLink' WHERE name = 'image-link'; | ||||||
|  | UPDATE attributes SET name = 'relationMapLink' WHERE name = 'relation-map-link'; | ||||||
							
								
								
									
										68
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										68
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "trilium", |   "name": "trilium", | ||||||
|   "version": "0.37.3", |   "version": "0.37.4", | ||||||
|   "lockfileVersion": 1, |   "lockfileVersion": 1, | ||||||
|   "requires": true, |   "requires": true, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
| @@ -55,9 +55,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "@electron/get": { |     "@electron/get": { | ||||||
|       "version": "1.6.0", |       "version": "1.7.1", | ||||||
|       "resolved": "https://registry.npmjs.org/@electron/get/-/get-1.6.0.tgz", |       "resolved": "https://registry.npmjs.org/@electron/get/-/get-1.7.1.tgz", | ||||||
|       "integrity": "sha512-xuvAzbN9iBApfAMvW0hKUpxHR5wPVbG9RaoSTbpu/WaHISDu0MVfMWYhfeU0X730CpBV0G2RkLgwAs9WDan3GA==", |       "integrity": "sha512-+BOIzkmYbe+oOBGqSByq8zXYXCFztccoymR3uNkvX5ckJ/5xU+4peVyEvFyH6+zfv58hCo99RxgIpwuaMfRtRg==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "debug": "^4.1.1", |         "debug": "^4.1.1", | ||||||
| @@ -1152,9 +1152,9 @@ | |||||||
|       "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" |       "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" | ||||||
|     }, |     }, | ||||||
|     "boolean": { |     "boolean": { | ||||||
|       "version": "2.0.2", |       "version": "3.0.0", | ||||||
|       "resolved": "https://registry.npmjs.org/boolean/-/boolean-2.0.2.tgz", |       "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.0.0.tgz", | ||||||
|       "integrity": "sha512-ymsbJQlux/uogyEWfsXJUYzuyoOzPyp6NvEV71s6/ptQR7ptKO9uHF+WZL2GRATDeN52EFhNyrIu+exNZKh3Cw==", |       "integrity": "sha512-OElxJ1lUSinuoUnkpOgLmxp0DC4ytEhODEL6QJU0NpxE/mI4rUSh8h1P1Wkvfi3xQEBcxXR2gBIPNYNuaFcAbQ==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "optional": true |       "optional": true | ||||||
|     }, |     }, | ||||||
| @@ -3059,13 +3059,13 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "electron-notarize": { |     "electron-notarize": { | ||||||
|       "version": "0.1.1", |       "version": "0.2.1", | ||||||
|       "resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-0.1.1.tgz", |       "resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-0.2.1.tgz", | ||||||
|       "integrity": "sha512-TpKfJcz4LXl5jiGvZTs5fbEx+wUFXV5u8voeG5WCHWfY/cdgdD8lDZIZRqLVOtR3VO+drgJ9aiSHIO9TYn/fKg==", |       "integrity": "sha512-oZ6/NhKeXmEKNROiFmRNfytqu3cxqC95sjooG7kBXQVEUSQkZnbiAhxVh5jXngL881G197pbwpeVPJyM7Ikmxw==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "debug": "^4.1.1", |         "debug": "^4.1.1", | ||||||
|         "fs-extra": "^8.0.1" |         "fs-extra": "^8.1.0" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "electron-osx-sign": { |     "electron-osx-sign": { | ||||||
| @@ -3103,16 +3103,16 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "electron-packager": { |     "electron-packager": { | ||||||
|       "version": "14.1.0", |       "version": "14.1.1", | ||||||
|       "resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-14.1.0.tgz", |       "resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-14.1.1.tgz", | ||||||
|       "integrity": "sha512-4oGtQYYjSA/M4BGOwG0NBqEtThBf7aCV76C2AZsD71eGocYqZNvtvfzeeMnKkc3EW1nPq7iJ4Wge+GXma0kwIA==", |       "integrity": "sha512-PODWJ8LFfwUCniTMy4Z5iiZyVHi4W71Pvn/SxJPC6kbI3EfZvo8n5H856XATxNUGVxlmAB5qeSbRym8/f9jISg==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "@electron/get": "^1.6.0", |         "@electron/get": "^1.6.0", | ||||||
|         "asar": "^2.0.1", |         "asar": "^2.0.1", | ||||||
|         "cross-zip": "^2.1.5", |         "cross-zip": "^2.1.5", | ||||||
|         "debug": "^4.0.1", |         "debug": "^4.0.1", | ||||||
|         "electron-notarize": "^0.1.1", |         "electron-notarize": "^0.2.0", | ||||||
|         "electron-osx-sign": "^0.4.11", |         "electron-osx-sign": "^0.4.11", | ||||||
|         "fs-extra": "^8.1.0", |         "fs-extra": "^8.1.0", | ||||||
|         "galactus": "^0.2.1", |         "galactus": "^0.2.1", | ||||||
| @@ -3134,9 +3134,9 @@ | |||||||
|           "dev": true |           "dev": true | ||||||
|         }, |         }, | ||||||
|         "yargs-parser": { |         "yargs-parser": { | ||||||
|           "version": "16.0.0", |           "version": "16.1.0", | ||||||
|           "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.0.0.tgz", |           "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.1.0.tgz", | ||||||
|           "integrity": "sha512-WyNdFYED0penIaLqLSDSeFksC5lVjrjp9vNkG7IKfgQNiAYa6FfHuJXjuaQgt0eOVN2z+gJhHJSX7uRhJKPc7Q==", |           "integrity": "sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==", | ||||||
|           "dev": true, |           "dev": true, | ||||||
|           "requires": { |           "requires": { | ||||||
|             "camelcase": "^5.0.0", |             "camelcase": "^5.0.0", | ||||||
| @@ -4423,25 +4423,25 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "global-agent": { |     "global-agent": { | ||||||
|       "version": "2.1.5", |       "version": "2.1.7", | ||||||
|       "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-2.1.5.tgz", |       "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-2.1.7.tgz", | ||||||
|       "integrity": "sha512-pYJjCxxNBzYxo6iNO62JZn8iCFVbvpiM0zE4w/G5hBNIvLjnvzIeCVQPMKc3aK8ju5L7Q8NNI/oBSosU0eeSYw==", |       "integrity": "sha512-ooK7eqGYZku+LgnbfH/Iv0RJ74XfhrBZDlke1QSzcBt0bw1PmJcnRADPAQuFE+R45pKKDTynAr25SBasY2kvow==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "optional": true, |       "optional": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "boolean": "^2.0.2", |         "boolean": "^3.0.0", | ||||||
|         "core-js": "^3.3.3", |         "core-js": "^3.4.1", | ||||||
|         "es6-error": "^4.1.1", |         "es6-error": "^4.1.1", | ||||||
|         "matcher": "^2.0.0", |         "matcher": "^2.0.0", | ||||||
|         "roarr": "^2.14.2", |         "roarr": "^2.14.5", | ||||||
|         "semver": "^6.3.0", |         "semver": "^6.3.0", | ||||||
|         "serialize-error": "^5.0.0" |         "serialize-error": "^5.0.0" | ||||||
|       }, |       }, | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "core-js": { |         "core-js": { | ||||||
|           "version": "3.3.5", |           "version": "3.4.2", | ||||||
|           "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.3.5.tgz", |           "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.2.tgz", | ||||||
|           "integrity": "sha512-0J3K+Par/ZydhKg8pEiTcK/9d65/nqJOzY62uMkjeBmt05fDOt/khUVjDdh8TpeIuGQDy1yLDDCjiWN/8pFIuw==", |           "integrity": "sha512-bUTfqFWtNKWp73oNIfRkqwYZJeNT3lstzZcAkhhiuvDraRSgOH1/+F9ZklbpR4zpdKuo4cpXN8tKP7s61yjX+g==", | ||||||
|           "dev": true, |           "dev": true, | ||||||
|           "optional": true |           "optional": true | ||||||
|         } |         } | ||||||
| @@ -6092,9 +6092,9 @@ | |||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
|     "matcher": { |     "matcher": { | ||||||
|       "version": "2.0.0", |       "version": "2.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/matcher/-/matcher-2.0.0.tgz", |       "resolved": "https://registry.npmjs.org/matcher/-/matcher-2.1.0.tgz", | ||||||
|       "integrity": "sha512-nlmfSlgHBFx36j/Pl/KQPbIaqE8Zf0TqmSMjsuddHDg6PMSVgmyW9HpkLs0o0M1n2GIZ/S2BZBLIww/xjhiGng==", |       "integrity": "sha512-o+nZr+vtJtgPNklyeUKkkH42OsK8WAfdgaJE2FNxcjLPg+5QbeEoT6vRj8Xq/iv18JlQ9cmKsEu0b94ixWf1YQ==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "optional": true, |       "optional": true, | ||||||
|       "requires": { |       "requires": { | ||||||
| @@ -8886,13 +8886,13 @@ | |||||||
|       "integrity": "sha1-8z/pz7Urv9UgqhgyO8ZdsRCht2w=" |       "integrity": "sha1-8z/pz7Urv9UgqhgyO8ZdsRCht2w=" | ||||||
|     }, |     }, | ||||||
|     "roarr": { |     "roarr": { | ||||||
|       "version": "2.14.2", |       "version": "2.14.6", | ||||||
|       "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.14.2.tgz", |       "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.14.6.tgz", | ||||||
|       "integrity": "sha512-ibqv70DCUhGVMfPe0JSUHBZ9PKLhxdk8VJ/Y2M7vVr+L4VakW1CdVTU9cJQBbM2STQa84CgBAzd7hJGcnALGeg==", |       "integrity": "sha512-qjbw0BEesKA+3XFBPt+KVe1PC/Z6ShfJ4wPlx2XifqH5h2Lj8/KQT5XJTsy3n1Es5kai+BwKALaECW3F70B1cg==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "optional": true, |       "optional": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "boolean": "^2.0.2", |         "boolean": "^3.0.0", | ||||||
|         "detect-node": "^2.0.4", |         "detect-node": "^2.0.4", | ||||||
|         "globalthis": "^1.0.0", |         "globalthis": "^1.0.0", | ||||||
|         "json-stringify-safe": "^5.0.1", |         "json-stringify-safe": "^5.0.1", | ||||||
|   | |||||||
| @@ -80,7 +80,7 @@ | |||||||
|     "electron": "6.0.12", |     "electron": "6.0.12", | ||||||
|     "electron-builder": "22.1.0", |     "electron-builder": "22.1.0", | ||||||
|     "electron-installer-debian": "2.0.1", |     "electron-installer-debian": "2.0.1", | ||||||
|     "electron-packager": "14.1.0", |     "electron-packager": "14.1.1", | ||||||
|     "electron-rebuild": "1.8.8", |     "electron-rebuild": "1.8.8", | ||||||
|     "jsdoc": "3.6.3", |     "jsdoc": "3.6.3", | ||||||
|     "lorem-ipsum": "2.0.3" |     "lorem-ipsum": "2.0.3" | ||||||
|   | |||||||
| @@ -701,7 +701,7 @@ class Note extends Entity { | |||||||
|             WHERE noteId = ? AND  |             WHERE noteId = ? AND  | ||||||
|                   isDeleted = 0 AND  |                   isDeleted = 0 AND  | ||||||
|                   type = 'relation' AND  |                   type = 'relation' AND  | ||||||
|                   name IN ('internal-link', 'image-link', 'relation-map-link')`, [this.noteId]); |                   name IN ('internalLink', 'imageLink', 'relationMapLink')`, [this.noteId]); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|   | |||||||
| @@ -437,6 +437,7 @@ div.ui-tooltip { | |||||||
|  |  | ||||||
| .btn.active:not(.btn-primary) { | .btn.active:not(.btn-primary) { | ||||||
|     background-color: var(--button-disabled-background-color) !important; |     background-color: var(--button-disabled-background-color) !important; | ||||||
|  |     opacity: 0.4; | ||||||
| } | } | ||||||
|  |  | ||||||
| .note-path-list a.current { | .note-path-list a.current { | ||||||
|   | |||||||
| @@ -96,7 +96,7 @@ async function addImagesToNote(images, note, content) { | |||||||
|                 noteId: note.noteId, |                 noteId: note.noteId, | ||||||
|                 type: 'relation', |                 type: 'relation', | ||||||
|                 value: imageNote.noteId, |                 value: imageNote.noteId, | ||||||
|                 name: 'image-link' |                 name: 'imageLink' | ||||||
|             }).save(); |             }).save(); | ||||||
|  |  | ||||||
|             console.log(`Replacing ${imageId} with ${url}`); |             console.log(`Replacing ${imageId} with ${url}`); | ||||||
|   | |||||||
| @@ -130,7 +130,9 @@ async function getRelationMap(req) { | |||||||
|         noteTitles: {}, |         noteTitles: {}, | ||||||
|         relations: [], |         relations: [], | ||||||
|         // relation name => inverse relation name |         // relation name => inverse relation name | ||||||
|         inverseRelations: {} |         inverseRelations: { | ||||||
|  |             'internalLink': 'internalLink' | ||||||
|  |         } | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|     if (noteIds.length === 0) { |     if (noteIds.length === 0) { | ||||||
|   | |||||||
| @@ -4,8 +4,8 @@ const build = require('./build'); | |||||||
| const packageJson = require('../../package'); | const packageJson = require('../../package'); | ||||||
| const {TRILIUM_DATA_DIR} = require('./data_dir'); | const {TRILIUM_DATA_DIR} = require('./data_dir'); | ||||||
|  |  | ||||||
| const APP_DB_VERSION = 153; | const APP_DB_VERSION = 154; | ||||||
| const SYNC_VERSION = 11; | const SYNC_VERSION = 12; | ||||||
| const CLIPPER_PROTOCOL_VERSION = "1.0"; | const CLIPPER_PROTOCOL_VERSION = "1.0"; | ||||||
|  |  | ||||||
| module.exports = { | module.exports = { | ||||||
|   | |||||||
| @@ -147,7 +147,7 @@ async function importTar(taskContext, fileBuffer, importRootNote) { | |||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (attr.type === 'relation' && ['internal-link', 'image-link', 'relation-map-link'].includes(attr.name)) { |             if (attr.type === 'relation' && ['internalLink', 'imageLink', 'relationMapLink'].includes(attr.name)) { | ||||||
|                 // these relations are created automatically and as such don't need to be duplicated in the import |                 // these relations are created automatically and as such don't need to be duplicated in the import | ||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
| @@ -312,7 +312,7 @@ async function importTar(taskContext, fileBuffer, importRootNote) { | |||||||
|  |  | ||||||
|         if (type === 'relation-map' && noteMeta) { |         if (type === 'relation-map' && noteMeta) { | ||||||
|             const relationMapLinks = (noteMeta.attributes || []) |             const relationMapLinks = (noteMeta.attributes || []) | ||||||
|                 .filter(attr => attr.type === 'relation' && attr.name === 'relation-map-link'); |                 .filter(attr => attr.type === 'relation' && attr.name === 'relationMapLink'); | ||||||
|  |  | ||||||
|             // this will replace relation map links |             // this will replace relation map links | ||||||
|             for (const link of relationMapLinks) { |             for (const link of relationMapLinks) { | ||||||
|   | |||||||
| @@ -214,7 +214,7 @@ function findImageLinks(content, foundLinks) { | |||||||
|  |  | ||||||
|     while (match = re.exec(content)) { |     while (match = re.exec(content)) { | ||||||
|         foundLinks.push({ |         foundLinks.push({ | ||||||
|             name: 'image-link', |             name: 'imageLink', | ||||||
|             value: match[1] |             value: match[1] | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| @@ -230,7 +230,7 @@ function findInternalLinks(content, foundLinks) { | |||||||
|  |  | ||||||
|     while (match = re.exec(content)) { |     while (match = re.exec(content)) { | ||||||
|         foundLinks.push({ |         foundLinks.push({ | ||||||
|             name: 'internal-link', |             name: 'internalLink', | ||||||
|             value: match[1] |             value: match[1] | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| @@ -244,7 +244,7 @@ function findRelationMapLinks(content, foundLinks) { | |||||||
|  |  | ||||||
|     for (const note of obj.notes) { |     for (const note of obj.notes) { | ||||||
|         foundLinks.push({ |         foundLinks.push({ | ||||||
|             name: 'relation-map-link', |             name: 'relationMapLink', | ||||||
|             value: note.noteId |             value: note.noteId | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user