Add goal tree toolbox module
All checks were successful
Deploy Sokko G / deploy (push) Successful in 15s

This commit is contained in:
Shinuwa 2026-08-22 18:15:39 +02:00
parent e4cbe3e087
commit 59fdcb0927
63 changed files with 4062 additions and 252 deletions

View file

@ -269,6 +269,67 @@ export function validateSiteContent(site) {
"toolboxes.modules.calculator.useEntryTitle",
"toolboxes.modules.calculator.renameTitle",
"toolboxes.modules.calculator.deleteTitle",
"toolboxes.modules.goalTree.editorTitle",
"toolboxes.modules.goalTree.treeTitle",
"toolboxes.modules.goalTree.addRootButton",
"toolboxes.modules.goalTree.addRootSchemaButton",
"toolboxes.modules.goalTree.addChildButton",
"toolboxes.modules.goalTree.addChildTitle",
"toolboxes.modules.goalTree.addContentItemTitle",
"toolboxes.modules.goalTree.addContentItemTooltip",
"toolboxes.modules.goalTree.verticalViewTitle",
"toolboxes.modules.goalTree.horizontalViewTitle",
"toolboxes.modules.goalTree.cardActionsLabel",
"toolboxes.modules.goalTree.editTitle",
"toolboxes.modules.goalTree.baseTab",
"toolboxes.modules.goalTree.contentTab",
"toolboxes.modules.goalTree.advancedTab",
"toolboxes.modules.goalTree.resetTimeLabel",
"toolboxes.modules.goalTree.weeklyResetDayLabel",
"toolboxes.modules.goalTree.titleLabel",
"toolboxes.modules.goalTree.listTitleLabel",
"toolboxes.modules.goalTree.kindLabel",
"toolboxes.modules.goalTree.stepKind",
"toolboxes.modules.goalTree.textKind",
"toolboxes.modules.goalTree.checklistKind",
"toolboxes.modules.goalTree.iconLabel",
"toolboxes.modules.goalTree.iconColorLabel",
"toolboxes.modules.goalTree.targetQuantityLabel",
"toolboxes.modules.goalTree.quantitySectionTitle",
"toolboxes.modules.goalTree.progressSectionTitle",
"toolboxes.modules.goalTree.autoProgressLabel",
"toolboxes.modules.goalTree.manualProgressLabel",
"toolboxes.modules.goalTree.autoProgressTitle",
"toolboxes.modules.goalTree.manualProgressTitle",
"toolboxes.modules.goalTree.autoProgressHint",
"toolboxes.modules.goalTree.manualProgressHint",
"toolboxes.modules.goalTree.contentSectionTitle",
"toolboxes.modules.goalTree.itemLabelLabel",
"toolboxes.modules.goalTree.itemLabelPlaceholder",
"toolboxes.modules.goalTree.itemCheckedLabel",
"toolboxes.modules.goalTree.itemTotalLabel",
"toolboxes.modules.goalTree.itemTotalPlaceholder",
"toolboxes.modules.goalTree.itemTotalHelp",
"toolboxes.modules.goalTree.prerequisitesSectionTitle",
"toolboxes.modules.goalTree.contentTabHint",
"toolboxes.modules.goalTree.stepContentUnavailable",
"toolboxes.modules.goalTree.decrementItemTitle",
"toolboxes.modules.goalTree.incrementItemTitle",
"toolboxes.modules.goalTree.addContentItemButton",
"toolboxes.modules.goalTree.formulaPlaceholder",
"toolboxes.modules.goalTree.formulaHelp",
"toolboxes.modules.goalTree.resetTypeLabel",
"toolboxes.modules.goalTree.noneReset",
"toolboxes.modules.goalTree.dailyReset",
"toolboxes.modules.goalTree.weeklyReset",
"toolboxes.modules.goalTree.closeButton",
"toolboxes.modules.goalTree.deleteButton",
"toolboxes.modules.goalTree.deleteTitle",
"toolboxes.modules.goalTree.reorderTitle",
"toolboxes.modules.goalTree.showChildrenTitle",
"toolboxes.modules.goalTree.hideChildrenTitle",
"toolboxes.modules.goalTree.emptySelection",
"toolboxes.modules.goalTree.emptyTree",
"toolboxes.modules.table.toolbarLabel",
"toolboxes.modules.table.gridLabel",
"toolboxes.modules.table.cellLabel",
@ -557,7 +618,7 @@ export function validateSiteContent(site) {
});
const libraryToolDocs = valueAt(site, "library.toolDocs");
["notepad", "checklist", "counters", "images", "imageAnnotation", "links", "calculator", "table", "timer", "calendar", "taskPlanner", "combos", "equipmentPlanner"].forEach((toolType) => {
["notepad", "checklist", "counters", "images", "imageAnnotation", "links", "calculator", "table", "goalTree", "timer", "calendar", "taskPlanner", "combos", "equipmentPlanner"].forEach((toolType) => {
const docs = libraryToolDocs?.[toolType];
assert.equal(typeof docs, "object", `library.toolDocs.${toolType} must be an object`);
assert.ok(Array.isArray(docs.controls), `library.toolDocs.${toolType}.controls must be an array`);
@ -770,7 +831,7 @@ export function validateLibraryData(payload) {
assert.deepEqual(new Set(twoColumnIds), moduleIds, "library.toolbox.moduleOrder.two must contain every module exactly once");
assert.equal(twoColumnIds.length, moduleIds.size, "library.toolbox.moduleOrder.two must not contain duplicate modules");
["notepad", "checklist", "images", "links", "counters", "combos", "calculator", "table", "timer", "calendar", "taskPlanner", "equipmentPlanner", "imageAnnotation"].forEach((type) => {
["notepad", "checklist", "images", "links", "counters", "combos", "calculator", "table", "goalTree", "timer", "calendar", "taskPlanner", "equipmentPlanner", "imageAnnotation"].forEach((type) => {
assert.ok(payload.toolbox.modules.some((module) => module.type === type), `library must include a ${type} example`);
});
@ -790,6 +851,11 @@ export function validateLibraryData(payload) {
assert.ok(Array.isArray(taskData.relations), "library task planner example must contain relations");
assert.ok(taskData.relations.length >= 1, "library task planner example must include a parent/child relation");
const goalTreeModule = payload.toolbox.modules.find((module) => module.type === "goalTree");
const goalTreeData = payload.modules[goalTreeModule.id];
assert.ok(Array.isArray(goalTreeData.nodes), "library goal tree example must contain nodes");
assert.ok(goalTreeData.nodes.some((node) => node.parentId), "library goal tree example must include a parent/child node");
const equipmentModule = payload.toolbox.modules.find((module) => module.type === "equipmentPlanner");
const equipmentData = payload.modules[equipmentModule.id];
assert.ok(Array.isArray(equipmentData.types), "library equipment planner example must contain types");