mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
rename inheritableAttributeCache to __inheritableAttributeCache for consistency
This commit is contained in:
parent
c802bf7d8b
commit
b5cfc28912
@ -108,7 +108,7 @@ class BNote extends AbstractBeccaEntity {
|
|||||||
this.__attributeCache = null;
|
this.__attributeCache = null;
|
||||||
/** @type {BAttribute[]|null}
|
/** @type {BAttribute[]|null}
|
||||||
* @private */
|
* @private */
|
||||||
this.inheritableAttributeCache = null;
|
this.__inheritableAttributeCache = null;
|
||||||
|
|
||||||
/** @type {BAttribute[]}
|
/** @type {BAttribute[]}
|
||||||
* @private */
|
* @private */
|
||||||
@ -454,11 +454,11 @@ class BNote extends AbstractBeccaEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.inheritableAttributeCache = [];
|
this.__inheritableAttributeCache = [];
|
||||||
|
|
||||||
for (const attr of this.__attributeCache) {
|
for (const attr of this.__attributeCache) {
|
||||||
if (attr.isInheritable) {
|
if (attr.isInheritable) {
|
||||||
this.inheritableAttributeCache.push(attr);
|
this.__inheritableAttributeCache.push(attr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -475,11 +475,11 @@ class BNote extends AbstractBeccaEntity {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.inheritableAttributeCache) {
|
if (!this.__inheritableAttributeCache) {
|
||||||
this.__getAttributes(path); // will refresh also this.inheritableAttributeCache
|
this.__getAttributes(path); // will refresh also this.__inheritableAttributeCache
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.inheritableAttributeCache;
|
return this.__inheritableAttributeCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
__validateTypeName(type, name) {
|
__validateTypeName(type, name) {
|
||||||
@ -845,7 +845,7 @@ class BNote extends AbstractBeccaEntity {
|
|||||||
this.flatTextCache = null;
|
this.flatTextCache = null;
|
||||||
|
|
||||||
this.__attributeCache = null;
|
this.__attributeCache = null;
|
||||||
this.inheritableAttributeCache = null;
|
this.__inheritableAttributeCache = null;
|
||||||
this.ancestorCache = null;
|
this.ancestorCache = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/** @param {BNote} note */
|
||||||
function mapNoteToPojo(note) {
|
function mapNoteToPojo(note) {
|
||||||
return {
|
return {
|
||||||
noteId: note.noteId,
|
noteId: note.noteId,
|
||||||
@ -17,6 +18,7 @@ function mapNoteToPojo(note) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @param {BBranch} branch */
|
||||||
function mapBranchToPojo(branch) {
|
function mapBranchToPojo(branch) {
|
||||||
return {
|
return {
|
||||||
branchId: branch.branchId,
|
branchId: branch.branchId,
|
||||||
@ -29,6 +31,7 @@ function mapBranchToPojo(branch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @param {BAttribute} attr */
|
||||||
function mapAttributeToPojo(attr) {
|
function mapAttributeToPojo(attr) {
|
||||||
return {
|
return {
|
||||||
attributeId: attr.attributeId,
|
attributeId: attr.attributeId,
|
||||||
|
@ -40,7 +40,7 @@ class SNote extends AbstractShacaEntity {
|
|||||||
/** @param {SAttribute[]|null} */
|
/** @param {SAttribute[]|null} */
|
||||||
this.__attributeCache = null;
|
this.__attributeCache = null;
|
||||||
/** @param {SAttribute[]|null} */
|
/** @param {SAttribute[]|null} */
|
||||||
this.inheritableAttributeCache = null;
|
this.__inheritableAttributeCache = null;
|
||||||
|
|
||||||
/** @param {SAttribute[]} */
|
/** @param {SAttribute[]} */
|
||||||
this.targetRelations = [];
|
this.targetRelations = [];
|
||||||
@ -190,11 +190,11 @@ class SNote extends AbstractShacaEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.inheritableAttributeCache = [];
|
this.__inheritableAttributeCache = [];
|
||||||
|
|
||||||
for (const attr of this.__attributeCache) {
|
for (const attr of this.__attributeCache) {
|
||||||
if (attr.isInheritable) {
|
if (attr.isInheritable) {
|
||||||
this.inheritableAttributeCache.push(attr);
|
this.__inheritableAttributeCache.push(attr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -208,11 +208,11 @@ class SNote extends AbstractShacaEntity {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.inheritableAttributeCache) {
|
if (!this.__inheritableAttributeCache) {
|
||||||
this.__getAttributes(path); // will refresh also this.inheritableAttributeCache
|
this.__getAttributes(path); // will refresh also this.__inheritableAttributeCache
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.inheritableAttributeCache;
|
return this.__inheritableAttributeCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {boolean} */
|
/** @returns {boolean} */
|
||||||
|
@ -1,67 +0,0 @@
|
|||||||
POST {{triliumHost}}/etapi/attributes
|
|
||||||
Authorization: {{authToken}}
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"noteId": "root",
|
|
||||||
"type": "label",
|
|
||||||
"name": "mylabel",
|
|
||||||
"value": "val",
|
|
||||||
"isInheritable": true
|
|
||||||
}
|
|
||||||
|
|
||||||
> {% client.global.set("createdInheritedAttributeId", response.body.attributeId); %}
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
POST {{triliumHost}}/etapi/create-note
|
|
||||||
Authorization: {{authToken}}
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"parentNoteId": "root",
|
|
||||||
"title": "Hello",
|
|
||||||
"type": "text",
|
|
||||||
"content": "Hi there!"
|
|
||||||
}
|
|
||||||
|
|
||||||
> {%
|
|
||||||
client.global.set("createdNoteId", response.body.note.noteId);
|
|
||||||
client.global.set("createdBranchId", response.body.branch.branchId);
|
|
||||||
%}
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
POST {{triliumHost}}/etapi/attributes
|
|
||||||
Authorization: {{authToken}}
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"noteId": "{{createdNoteId}}",
|
|
||||||
"type": "label",
|
|
||||||
"name": "mylabel",
|
|
||||||
"value": "val",
|
|
||||||
"isInheritable": false
|
|
||||||
}
|
|
||||||
|
|
||||||
> {% client.global.set("createdOwnedAttributeId", response.body.attributeId); %}
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
DELETE {{triliumHost}}/etapi/attributes/{{createdOwnedAttributeId}}
|
|
||||||
Authorization: {{authToken}}
|
|
||||||
|
|
||||||
> {% client.assert(response.status === 204); %}
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
|
|
||||||
Authorization: {{authToken}}
|
|
||||||
|
|
||||||
> {%
|
|
||||||
client.assert(response.status === 200);
|
|
||||||
client.assert(response.body.noteId == client.global.get("createdNoteId"));
|
|
||||||
client.assert(response.body.attributes.length == 1);
|
|
||||||
client.assert(response.body.attributes[0].attributeId ==
|
|
||||||
client.global.get("createdInheritedAttributeId"));
|
|
||||||
%}
|
|
Loading…
x
Reference in New Issue
Block a user