mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 17:45:18 -05:00
- The General/ level is gone: its 109 files moved up into the folders of the same name, and its topic table is the "Shared topics" section of Features.md. - Accessibility is one folder, docs/Features/Accessibility/, with the Admin Panel's accessibility page in it. - Every folder's main page is README.md (110 X/X.md pages renamed with git mv, five merged with an existing README.md, 26 index pages added for folders that had none), so a folder opened on GitHub shows its page. - The 73 "# Moved" forwarding pages are deleted, with the folders that held only them; every link that went to one goes to its final page. - docs/Features/README.md has the website's "Features in WeKan" overview, each feature linking to its page here. 1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose, snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when General/ or a "# Moved" page comes back, a folder has no README.md, or a relative link in the docs or README.md does not resolve. Thanks to xet7 !
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
'use strict';
|
|
|
|
// Which views the All Boards page has, and which one an account that has never
|
|
// chosen sees. Design: docs/Features/All-Boards/README.md
|
|
//
|
|
// Pure — no Meteor, no DOM, no storage — so the answer to "is this a view?" and
|
|
// "what is the default?" is unit-testable. The ReactiveVars and the localStorage
|
|
// that carry the CHOICE live in client/lib/allBoardsView.js, which is Meteor and
|
|
// cannot be loaded in a plain Node test.
|
|
|
|
const VIEW_LISTS = 'lists';
|
|
const VIEW_TABLE = 'table';
|
|
|
|
// In the order the view menu offers them. Lists first because it is the default.
|
|
const VIEWS = [VIEW_LISTS, VIEW_TABLE];
|
|
|
|
const STORAGE_KEY = 'wekan-all-boards-view';
|
|
|
|
// The board icons: what the page has always been, and what it still is unless the
|
|
// user says otherwise.
|
|
const DEFAULT_VIEW = VIEW_LISTS;
|
|
|
|
// A stored (or otherwise untrusted) value as a view, or null when it is not one.
|
|
// Null rather than the default, so a caller can tell "never chosen" from "chose
|
|
// Lists" — and so a value left by a future version does not render nothing.
|
|
function normalizeAllBoardsView(value) {
|
|
return VIEWS.includes(value) ? value : null;
|
|
}
|
|
|
|
// The view to use given whatever was stored.
|
|
function resolveAllBoardsView(stored) {
|
|
return normalizeAllBoardsView(stored) || DEFAULT_VIEW;
|
|
}
|
|
|
|
module.exports = {
|
|
VIEW_LISTS,
|
|
VIEW_TABLE,
|
|
VIEWS,
|
|
STORAGE_KEY,
|
|
DEFAULT_VIEW,
|
|
normalizeAllBoardsView,
|
|
resolveAllBoardsView,
|
|
};
|