Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(attributes): recognise the board and note map attributes as system ones
Elian Doran3e768201bac9
diff --git a/apps/client/src/services/attributes.spec.ts b/apps/client/src/services/attributes.spec.tsindex 6c09e69dd9..cf3129a729 100644--- a/apps/client/src/services/attributes.spec.ts+++ b/apps/client/src/services/attributes.spec.ts@@ -395,6 +395,18 @@ describe("isBuiltinAttribute", () => {expect(isBuiltinAttribute("label", "calendar:startDate")).toBe(true);});+ it("recognizes the board's task-state names", () => {+ expect(isBuiltinAttribute("label", "board:groupBy")).toBe(true);+ expect(isBuiltinAttribute("label", "stateId")).toBe(true);+ expect(isBuiltinAttribute("label", "isCompleted")).toBe(true);+ });++ it("recognizes the map names", () => {+ expect(isBuiltinAttribute("label", "geolocation")).toBe(true);+ expect(isBuiltinAttribute("label", "map:style")).toBe(true);+ expect(isBuiltinAttribute("label", "excludeFromNoteMap")).toBe(true);+ });+it("matches exactly, so prefixed names are not built-ins", () => {// A definition describes a built-in without being one, and a disabled one is inert.expect(isBuiltinAttribute("label", "label:archived")).toBe(false);diff --git a/packages/commons/src/lib/builtin_attributes.ts b/packages/commons/src/lib/builtin_attributes.tsindex 3504413f43..dc1a1a50ff 100644--- a/packages/commons/src/lib/builtin_attributes.ts+++ b/packages/commons/src/lib/builtin_attributes.ts@@ -93,6 +93,8 @@ const BUILTIN_ATTRIBUTES = [{ type: "label", name: "mapRootNoteId", valueType: "string" },{ type: "label", name: "mapExcludeRelation", valueType: "string" },{ type: "label", name: "mapIncludeRelation", valueType: "string" },+ // Keeps a note out of the note map -- unless the map is rooted at it, which journals rely on.+ { type: "label", name: "excludeFromNoteMap", valueType: "boolean" },{ type: "label", name: "bookmarkFolder", valueType: "boolean" },{ type: "label", name: "sorted", valueType: "boolean" },{ type: "label", name: "sortDirection", valueType: "string" },@@ -154,6 +156,11 @@ const BUILTIN_ATTRIBUTES = [// Collections{ type: "label", name: "status", valueType: "string", hasUserValue: true },{ type: "label", name: "board:groupBy", valueType: "string", hasUserValue: true },+ // Carried by the task-state definition notes under `_taskStates`, which back the board columns.+ { type: "label", name: "stateId", valueType: "string", hasUserValue: true },+ { type: "label", name: "markdownSymbol", valueType: "string" },+ { type: "label", name: "isCompleted", valueType: "boolean" },+ { type: "label", name: "isHidden", valueType: "boolean" },{ type: "label", name: "maxNestingDepth", valueType: "number", hasUserValue: true },{ type: "label", name: "includeArchived", valueType: "boolean", hasUserValue: true },{ type: "label", name: "calendar:view", valueType: "string", hasUserValue: true },