mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	add frontend API method openTabWithNote, #1645
This commit is contained in:
		| @@ -46,7 +46,6 @@ const promotedAttributeDefinitionParser = require("../services/promoted_attribut | ||||
|  * @property {boolean} isInheritable - immutable | ||||
|  * @property {boolean} isDeleted | ||||
|  * @property {string|null} deleteId - ID identifying delete transaction | ||||
|  * @property {string} utcDateCreated | ||||
|  * @property {string} utcDateModified | ||||
|  * | ||||
|  * @extends Entity | ||||
| @@ -54,7 +53,7 @@ const promotedAttributeDefinitionParser = require("../services/promoted_attribut | ||||
| class Attribute extends Entity { | ||||
|     static get entityName() { return "attributes"; } | ||||
|     static get primaryKeyName() { return "attributeId"; } | ||||
|     static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "utcDateCreated"]; } | ||||
|     static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted"]; } | ||||
|  | ||||
|     constructor(row) { | ||||
|         super(row); | ||||
| @@ -62,6 +61,10 @@ class Attribute extends Entity { | ||||
|         this.isInheritable = !!this.isInheritable; | ||||
|     } | ||||
|  | ||||
|     isAutoLink() { | ||||
|         return this.type === 'relation' && ['internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink'].includes(this.name); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @returns {Note|null} | ||||
|      */ | ||||
| @@ -127,15 +130,9 @@ class Attribute extends Entity { | ||||
|             this.isDeleted = false; | ||||
|         } | ||||
|  | ||||
|         if (!this.utcDateCreated) { | ||||
|             this.utcDateCreated = dateUtils.utcNowDateTime(); | ||||
|         } | ||||
|  | ||||
|         super.beforeSaving(); | ||||
|  | ||||
|         if (this.isChanged) { | ||||
|             this.utcDateModified = dateUtils.utcNowDateTime(); | ||||
|         } | ||||
|         this.utcDateModified = dateUtils.utcNowDateTime(); | ||||
|     } | ||||
|  | ||||
|     createClone(type, name, value, isInheritable) { | ||||
| @@ -147,7 +144,6 @@ class Attribute extends Entity { | ||||
|             position: this.position, | ||||
|             isInheritable: isInheritable, | ||||
|             isDeleted: false, | ||||
|             utcDateCreated: this.utcDateCreated, | ||||
|             utcDateModified: this.utcDateModified | ||||
|         }); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user