mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	label and relation definition are now displayed without prefixes in the attr detail view
This commit is contained in:
		@@ -237,12 +237,16 @@ export default class AttributeDetailWidget extends BasicWidget {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        results = results.filter(({noteId}) => noteId !== this.noteId);
 | 
					        results = results.filter(({noteId}) => noteId !== this.noteId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        const attrName =
 | 
				
			||||||
 | 
					            this.attrType === 'label-definition' ? attribute.name.substr(6)
 | 
				
			||||||
 | 
					                : (this.attrType === 'relation-definition' ? attribute.name.substr(9) : attribute.name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (results.length === 0) {
 | 
					        if (results.length === 0) {
 | 
				
			||||||
            this.$relatedNotesContainer.hide();
 | 
					            this.$relatedNotesContainer.hide();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            this.$relatedNotesContainer.show();
 | 
					            this.$relatedNotesContainer.show();
 | 
				
			||||||
            this.$relatedNotesTitle.text(`Other notes with ${attribute.type} name "${attribute.name}"`);
 | 
					            this.$relatedNotesTitle.text(`Other notes with ${attribute.type} name "${attrName}"`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.$relatedNotesList.empty();
 | 
					            this.$relatedNotesList.empty();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -278,7 +282,7 @@ export default class AttributeDetailWidget extends BasicWidget {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.$attrInputName
 | 
					        this.$attrInputName
 | 
				
			||||||
            .val(attribute.name)
 | 
					            .val(attrName)
 | 
				
			||||||
            .attr('readonly', () => !isOwned);
 | 
					            .attr('readonly', () => !isOwned);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.$attrRowValue.toggle(this.attrType === 'label');
 | 
					        this.$attrRowValue.toggle(this.attrType === 'label');
 | 
				
			||||||
@@ -352,7 +356,15 @@ export default class AttributeDetailWidget extends BasicWidget {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    updateParent() {
 | 
					    updateParent() {
 | 
				
			||||||
        this.attribute.name = this.$attrInputName.val();
 | 
					        let attrName = this.$attrInputName.val();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (this.attrType === 'label-definition') {
 | 
				
			||||||
 | 
					            attrName = 'label:' + attrName;
 | 
				
			||||||
 | 
					        } else if (this.attrType === 'relation-definition') {
 | 
				
			||||||
 | 
					            attrName = 'relation:' + attrName;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        this.attribute.name = attrName;
 | 
				
			||||||
        this.attribute.value = this.$attrInputValue.val();
 | 
					        this.attribute.value = this.$attrInputValue.val();
 | 
				
			||||||
        this.attribute.isInheritable = this.$attrInputInheritable.is(":checked");
 | 
					        this.attribute.isInheritable = this.$attrInputInheritable.is(":checked");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user