From 05231bd1c2973f89e26944e136c29a7b2442a2a4 Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 16 Sep 2022 23:03:02 +0200 Subject: [PATCH] stop #workspaceTemplate from being inherited (should have the same special behavior as #template) --- src/becca/entities/note.js | 2 +- src/public/app/entities/note_short.js | 2 +- src/services/search/expressions/attribute_exists.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/becca/entities/note.js b/src/becca/entities/note.js index e00f83364..702f7dd7e 100644 --- a/src/becca/entities/note.js +++ b/src/becca/entities/note.js @@ -403,7 +403,7 @@ class Note extends AbstractEntity { templateAttributes.push( ...templateNote.__getAttributes(newPath) // template attr is used as a marker for templates, but it's not meant to be inherited - .filter(attr => !(attr.type === 'label' && attr.name === 'template')) + .filter(attr => !(attr.type === 'label' && (attr.name === 'template' || attr.name === 'workspacetemplate'))) ); } } diff --git a/src/public/app/entities/note_short.js b/src/public/app/entities/note_short.js index 345857758..c83179960 100644 --- a/src/public/app/entities/note_short.js +++ b/src/public/app/entities/note_short.js @@ -267,7 +267,7 @@ class NoteShort { attrArrs.push( templateNote.__getCachedAttributes(newPath) // template attr is used as a marker for templates, but it's not meant to be inherited - .filter(attr => !(attr.type === 'label' && attr.name === 'template')) + .filter(attr => !(attr.type === 'label' && (attr.name === 'template' || attr.name === 'workspacetemplate'))) ); } } diff --git a/src/services/search/expressions/attribute_exists.js b/src/services/search/expressions/attribute_exists.js index 8a34ee83f..f91c19b21 100644 --- a/src/services/search/expressions/attribute_exists.js +++ b/src/services/search/expressions/attribute_exists.js @@ -28,7 +28,7 @@ class AttributeExistsExp extends Expression { } else if (note.isTemplate() && // template attr is used as a marker for templates, but it's not meant to be inherited - !(this.attributeType === 'label' && this.attributeName === 'template')) { + !(this.attributeType === 'label' && (this.attributeName === 'template' || this.attributeName === 'workspacetemplate'))) { resultNoteSet.addAll(note.getTemplatedNotes()); } else {