Improve task planner reset settings
All checks were successful
Deploy Sokko G / deploy (push) Successful in 6s

This commit is contained in:
Shinuwa 2026-08-03 16:46:44 +02:00
parent d54a93e1f4
commit ee1c8afa9a
7 changed files with 180 additions and 63 deletions

View file

@ -318,6 +318,10 @@ export function validateSiteContent(site) {
"toolboxes.modules.taskPlanner.uncategorizedDropTitle",
"toolboxes.modules.taskPlanner.showCategoryTitle",
"toolboxes.modules.taskPlanner.hideCategoryTitle",
"toolboxes.modules.taskPlanner.taskDailyResetTimeLabel",
"toolboxes.modules.taskPlanner.inheritResetTime",
"toolboxes.modules.taskPlanner.taskResetLabel",
"toolboxes.modules.taskPlanner.noTaskResetLabel",
"toolboxes.modules.taskPlanner.taskWeeklyResetDayLabel",
"toolboxes.modules.taskPlanner.inheritWeeklyResetDay",
"toolboxes.modules.taskPlanner.linksLabel",

View file

@ -406,9 +406,9 @@ test("task planner data normalizes invalid settings and relations", () => {
categoryOrder: ["Raid", "Missing", "Farm", "Raid"],
collapsedCategories: ["Raid", "", "Raid"],
tasks: [
{ id: "task1", title: "Daily", type: "daily", checked: true, checkedAt: 1000, category: "Farm" },
{ id: "task1", title: "Daily", type: "daily", checked: true, checkedAt: 1000, category: "Farm", dailyResetTime: "06:30" },
{ id: "task2", title: "Weekly", type: "weekly", weeklyResetDay: 4, category: "Raid" },
{ id: "task3", title: "Invalid type", type: "later", category: "Farm" }
{ id: "task3", title: "Invalid type", type: "later", category: "Farm", dailyResetTime: "25:00" }
],
relations: [
{ id: "link1", fromTaskId: "task1", toTaskId: "task2" },
@ -424,9 +424,11 @@ test("task planner data normalizes invalid settings and relations", () => {
assert.deepEqual(normalized.categoryOrder, ["Raid"]);
assert.deepEqual(normalized.collapsedCategories, ["Raid"]);
assert.equal(normalized.tasks[0].category, undefined);
assert.equal(normalized.tasks[0].dailyResetTime, "06:30");
assert.equal(normalized.tasks[1].weeklyResetDay, 4);
assert.equal(normalized.tasks[1].category, "Raid");
assert.equal(normalized.tasks[2].type, "unique");
assert.equal(normalized.tasks[2].dailyResetTime, undefined);
assert.deepEqual(normalized.relations.map((relation) => relation.id), ["link1", "dep1"]);
assert.equal(normalized.relations[0].prerequisite, false);
assert.equal(normalized.relations[1].prerequisite, true);
@ -439,7 +441,7 @@ test("task planner storage compacts defaults and export remaps task relations",
hideCompleted: true,
collapsedCategories: ["Raid"],
tasks: [
{ id: "task1", title: "Daily", description: "", type: "daily", checked: false },
{ id: "task1", title: "Daily", description: "", type: "daily", checked: false, dailyResetTime: "06:30" },
{ id: "task2", title: "Weekly", description: "Run", type: "weekly", checked: true, checkedAt: 2000, weeklyResetDay: 5, category: "Raid" }
],
categoryOrder: ["Raid"],
@ -453,7 +455,7 @@ test("task planner storage compacts defaults and export remaps task relations",
assert.equal(compact.hideCompleted, true);
assert.deepEqual(compact.collapsedCategories, ["Raid"]);
assert.deepEqual(compact.categoryOrder, ["Raid"]);
assert.deepEqual(compact.tasks[0], { id: "task1", title: "Daily", type: "daily" });
assert.deepEqual(compact.tasks[0], { id: "task1", title: "Daily", type: "daily", dailyResetTime: "06:30" });
assert.equal(compact.tasks[1].category, "Raid");
assert.equal(compact.tasks[1].weeklyResetDay, 5);