Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix validation issue + attribute not triggering change event on delete
azivnerf071d3f6510a
diff --git a/src/entities/attribute.js b/src/entities/attribute.jsindex c478ffaf8d..4fbbdd396a 100644--- a/src/entities/attribute.js+++ b/src/entities/attribute.js@@ -8,7 +8,7 @@ const sql = require('../services/sql');class Attribute extends Entity {static get tableName() { return "attributes"; }static get primaryKeyName() { return "attributeId"; }- static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "dateCreated"]; }+ static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "dateCreated"]; }constructor(row) {super(row);diff --git a/src/public/javascripts/dialogs/attributes.js b/src/public/javascripts/dialogs/attributes.jsindex d8a8fad088..fa192ff4da 100644--- a/src/public/javascripts/dialogs/attributes.js+++ b/src/public/javascripts/dialogs/attributes.js@@ -227,7 +227,7 @@ function AttributesModel() {this.isEmptyName = function(index) {const cur = self.ownedAttributes()[index]();- return cur.name.trim() === "" && (cur.attributeId !== "" || cur.labelValue !== "" || cur.relationValue);+ return cur.name.trim() === "" && !cur.isDeleted && (cur.attributeId !== "" || cur.labelValue !== "" || cur.relationValue);};this.getTargetAttribute = function(target) {