Add toolbox spaces and recover from stale asset bundles
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s
This commit is contained in:
parent
0959c6740b
commit
0acf5ecf21
30 changed files with 1252 additions and 179 deletions
|
|
@ -217,6 +217,24 @@ export function validateSiteContent(site) {
|
|||
"toolboxes.storageStatus.errorMessage",
|
||||
"toolboxes.storageStatus.retryLabel",
|
||||
"toolboxes.storageStatus.writeErrorTitle",
|
||||
"toolboxes.spaces.toolbarLabel",
|
||||
"toolboxes.spaces.tabsLabel",
|
||||
"toolboxes.spaces.addLabel",
|
||||
"toolboxes.spaces.createTitle",
|
||||
"toolboxes.spaces.renameTitle",
|
||||
"toolboxes.spaces.renameLabel",
|
||||
"toolboxes.spaces.deleteTitle",
|
||||
"toolboxes.spaces.deleteLabel",
|
||||
"toolboxes.spaces.deleteEmpty",
|
||||
"toolboxes.spaces.deleteWithTools",
|
||||
"toolboxes.spaces.nameLabel",
|
||||
"toolboxes.spaces.cancelLabel",
|
||||
"toolboxes.spaces.saveLabel",
|
||||
"toolboxes.spaces.reorderLabel",
|
||||
"toolboxes.spaces.moveLabel",
|
||||
"toolboxes.spaces.moveSuccess",
|
||||
"toolboxes.spaces.emptyText",
|
||||
"toolboxes.spaces.limitReached",
|
||||
"toolboxes.title",
|
||||
"toolboxes.newButton",
|
||||
"toolboxes.libraryLink",
|
||||
|
|
@ -1150,15 +1168,20 @@ export function validateLibraryData(payload) {
|
|||
moduleIds.add(module.id);
|
||||
assert.equal(typeof payload.modules[module.id], "object", `library.modules.${module.id} must be an object`);
|
||||
});
|
||||
assert.deepEqual(payload.toolbox.moduleOrder?.one, [...moduleIds], "library.toolbox.moduleOrder.one must match toolbox modules");
|
||||
assert.ok(Array.isArray(payload.toolbox.moduleOrder?.two), "library.toolbox.moduleOrder.two must be an array");
|
||||
assert.equal(payload.toolbox.moduleOrder.two.length, 2, "library.toolbox.moduleOrder.two must contain 2 columns");
|
||||
payload.toolbox.moduleOrder.two.forEach((column, index) => {
|
||||
assert.ok(Array.isArray(column), `library.toolbox.moduleOrder.two[${index}] must be an array`);
|
||||
assert.ok(Array.isArray(payload.toolbox.spaces), "library.toolbox.spaces must be an array");
|
||||
assert.equal(payload.toolbox.spaces.length, 1, "library.toolbox must declare one default space");
|
||||
const defaultSpace = payload.toolbox.spaces[0];
|
||||
assert.equal(payload.toolbox.defaultSpaceId, defaultSpace.id, "library.toolbox.defaultSpaceId must target the default space");
|
||||
assert.equal(payload.toolbox.activeSpaceId, defaultSpace.id, "library.toolbox.activeSpaceId must target the default space");
|
||||
assert.deepEqual(defaultSpace.moduleOrder?.one, [...moduleIds], "library default space order must match toolbox modules");
|
||||
assert.ok(Array.isArray(defaultSpace.moduleOrder?.two), "library default space two-column order must be an array");
|
||||
assert.equal(defaultSpace.moduleOrder.two.length, 2, "library default space must contain 2 columns");
|
||||
defaultSpace.moduleOrder.two.forEach((column, index) => {
|
||||
assert.ok(Array.isArray(column), `library default space column ${index} must be an array`);
|
||||
});
|
||||
const twoColumnIds = payload.toolbox.moduleOrder.two.flat();
|
||||
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");
|
||||
const twoColumnIds = defaultSpace.moduleOrder.two.flat();
|
||||
assert.deepEqual(new Set(twoColumnIds), moduleIds, "library default space must contain every module exactly once");
|
||||
assert.equal(twoColumnIds.length, moduleIds.size, "library default space must not contain duplicate modules");
|
||||
|
||||
["memos", "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`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue