diff --git a/package-lock.json b/package-lock.json index 30c6b8511..71100cbfa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "trilium", - "version": "0.34.1", + "version": "0.34.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/public/javascripts/services/attributes.js b/src/public/javascripts/services/attributes.js index ea15bcf32..5ee1db06e 100644 --- a/src/public/javascripts/services/attributes.js +++ b/src/public/javascripts/services/attributes.js @@ -11,8 +11,6 @@ class Attributes { */ constructor(ctx) { this.ctx = ctx; - this.$attributeList = ctx.$tabContent.find(".attribute-list"); - this.$attributeListInner = ctx.$tabContent.find(".attribute-list-inner"); this.$promotedAttributesContainer = ctx.$tabContent.find(".note-detail-promoted-attributes"); this.$savedIndicator = ctx.$tabContent.find(".saved-indicator"); this.attributePromise = null; @@ -42,10 +40,6 @@ class Attributes { async showAttributes() { this.$promotedAttributesContainer.empty(); - this.$attributeList.hide(); - this.$attributeListInner.empty(); - - const note = this.ctx.note; const attributes = await this.getAttributes(); @@ -89,36 +83,6 @@ class Attributes { // (previously we saw promoted attributes doubling) this.$promotedAttributesContainer.empty().append($tbody); } - else if (note.type !== 'relation-map') { - // display only "own" notes - const ownedAttributes = attributes.filter(attr => attr.noteId === note.noteId); - - if (ownedAttributes.length > 0) { - for (const attribute of ownedAttributes) { - if (attribute.type === 'label') { - this.$attributeListInner.append(utils.formatLabel(attribute) + " "); - } - else if (attribute.type === 'relation') { - if (attribute.value) { - this.$attributeListInner.append('@' + attribute.name + "="); - this.$attributeListInner.append(await linkService.createNoteLink(attribute.value)); - this.$attributeListInner.append(" "); - } - else { - messagingService.logError(`Relation ${attribute.attributeId} has empty target`); - } - } - else if (attribute.type === 'label-definition' || attribute.type === 'relation-definition') { - this.$attributeListInner.append(attribute.name + " definition "); - } - else { - messagingService.logError("Unknown attr type: " + attribute.type); - } - } - - this.$attributeList.show(); - } - } return attributes; } diff --git a/src/public/javascripts/services/sidebar.js b/src/public/javascripts/services/sidebar.js index 32415c376..1a47d14e6 100644 --- a/src/public/javascripts/services/sidebar.js +++ b/src/public/javascripts/services/sidebar.js @@ -1,6 +1,7 @@ import NoteInfoWidget from "../widgets/note_info.js"; import LinkMapWidget from "../widgets/link_map.js"; import NoteRevisionsWidget from "../widgets/note_revisions.js"; +import AttributesWidget from "../widgets/attributes.js"; const WIDGET_TPL = `
- -