Skip to content

Commit

Permalink
template LABEL should not be inherited #4349
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Nov 15, 2023
1 parent 0507c46 commit 0afc410
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"jimp": "0.22.10",
"joplin-turndown-plugin-gfm": "1.0.12",
"jsdom": "22.1.0",
"marked": "9.1.2",
"marked": "9.1.6",
"mime-types": "2.1.35",
"multer": "1.4.5-lts.1",
"node-abi": "3.50.0",
Expand Down Expand Up @@ -101,7 +101,7 @@
},
"devDependencies": {
"cross-env": "7.0.3",
"electron": "25.9.2",
"electron": "25.9.5",
"electron-builder": "24.6.4",
"electron-packager": "17.1.2",
"electron-rebuild": "3.2.9",
Expand Down
8 changes: 4 additions & 4 deletions src/services/search/expressions/attribute_exists.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class AttributeExistsExp extends Expression {

this.attributeType = attributeType;
this.attributeName = attributeName;
// template attr is used as a marker for templates, but it's not meant to be inherited
this.isTemplateLabel = this.attributeType === 'label' && (this.attributeName === 'template' || this.attributeName === 'workspacetemplate');
this.prefixMatch = prefixMatch;
}

Expand All @@ -23,12 +25,10 @@ class AttributeExistsExp extends Expression {
for (const attr of attrs) {
const note = attr.note;

if (attr.isInheritable) {
if (attr.isInheritable && !this.isTemplateLabel) {
resultNoteSet.addAll(note.getSubtreeNotesIncludingTemplated());
}
else if (note.isInherited() &&
// template attr is used as a marker for templates, but it's not meant to be inherited
!(this.attributeType === 'label' && (this.attributeName === 'template' || this.attributeName === 'workspacetemplate'))) {
else if (note.isInherited() && !this.isTemplateLabel) {
resultNoteSet.addAll(note.getInheritingNotes());
}
else {
Expand Down

0 comments on commit 0afc410

Please sign in to comment.