mirror of
https://github.com/wekan/wekan.git
synced 2026-11-26 20:45:07 -05:00
v10.49
26
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
edd2904334 |
Fix #6533 for good: a rejected promise no longer ends the server, and four more guards.
The reporter's 10.45 log shows the startup work landing - "[startup] a startup
step could not finish because the database was busy; WeKan continues" and
"[checklists] Backfilled boardId on 0 row(s); 21 row(s) have no card to take it
from" instead of a 130k-card scan - and then the server dying anyway:
SyncedCron: Fatal error encountered (unhandledRejection): ValidationError:
... sqlite.(*collection).UpdateAll ... database is locked (5) (SQLITE_BUSY)
SyncedCron: Received UNHANDLED_REJECTION signal - cleaning up running jobs
systemd: Main process exited, code=exited, status=1/FAILURE
`quave:synced-cron` installs a process-wide unhandledRejection handler that calls
process.exit(1). So ANY unhandled rejection - including one write losing a race
for the SQLite write lock, which is transient by definition - killed the whole
server, and systemd restarted it into a database made busier by the restart. The
counter reached 73.
server/00processErrors.js takes that decision back. The package is deliberately
polite about it: it only exits `if (process.listenerCount('unhandledRejection')
=== 1)`, i.e. when nothing else has an opinion, so having one is the documented
way to stop it. A transient database error is logged and recorded for Admin
Panel / Problems and WeKan keeps serving; anything else is logged with its full
stack and WeKan still keeps serving, because ending everybody's session over one
rejected promise is a larger failure than the one being reported. An uncaught
EXCEPTION still exits unless it is a transient database error - a process that
threw out of a place nobody handled can hold half-applied state.
The four guards the same run surfaced, each a later assertion:
* boardsVisibilitySettings: the Visibility saves go through
visibilityTextFields(), which does the "is this input on screen" check once
for every field instead of per call site.
* changelogFormat: "the newest release" now means the newest RELEASE (an
Upcoming section may sit above it), the Upcoming section is checked by its
own test, and a release needs at least ONE entry - "more than five" measured
the day's workload rather than the format, and v10.46 carried two fixes.
* leftMenu: /information redirects the FlowRouter way, like /translation.
* narrowWindowLayout: the phone rules carry !important, because the desktop
rule they override is more specific.
Thanks to Nissulya and xet7 !
Fixes #6533,
|
||
|
|
64971491a6 |
Fix the four guards and the two harness faults the 15:15 run found.
Node suites: 267 run, 4 failed - each a LATER assertion in a suite fixed earlier
today, which is how this runner works.
* boardsVisibilitySettings: the template lookup tried only `name='x'`, and this
file writes both quote styles, so a template that is right there "must
exist".
* changelogFormat: my own entry's summary was 121 characters against a 120
limit, and two summaries linked no wekan/wekan commit. One is shortened; the
other two link the FerretDB commit they describe, and the guard accepts a
wekan/FerretDB link now - the fork is where that code lives, and a WeKan hash
for work that is not in this repository points at the wrong change.
* leftMenu: the old /translation URL redirects with
`redirect(FlowRouter.path('setting'))` inside triggersEnter, which is
FlowRouter's own way; the guard wanted a `FlowRouter.go`, which in a trigger
re-enters the router instead of replacing the navigation.
* narrowWindowLayout: "every rule mentioning the bell or the avatar" is three,
not two - the avatar has a second rule that only zeroes its padding. The two
PLACEMENT rules are picked by what they declare.
WebKit: 242 passed, 1 failed - "WebKit encountered an internal error" from
page.goto, which is the browser, not WeKan. openBoard retries five times for
exactly this reason, but a THROW from the navigation escaped the loop, so one
flaky goto failed a test with four attempts left. The navigation is inside the
try now, and the final message says which of the two happened: a board that never
rendered, or a navigation that never succeeded.
Database conformance: postgresql and mysql were reported as "container did not
start" when the truth was `failed to bind host port 127.0.0.1:35432: address
already in use` - a container left behind by an interrupted earlier run. The
script now removes containers named `wekan-conformance-db-*` (its own, never a
`docker compose` stack) before it starts, and a `docker run` that hits a taken
port moves to the next free one and retries instead of declaring the image
broken.
And the news from that same run: MariaDB now answers IDENTICALLY to SQLite on 98
of 100 cases, the two exceptions being the $slice / $elemMatch projections that
no backend implements. It could not create a collection this morning.
Thanks to xet7 !
|
||
|
|
e26794c9a1 |
Fix the five guards the 13:25 run found, three of them mine.
Each pass of the runner reveals the next assertion in a suite, and three of these
were broken by this morning's own fixes.
* adminCheckboxStyle: the checkbox-row ITEM rule covers two shapes now - a
label around a native checkbox, and the `a.flex > .materialCheckBox + span`
that replaced the Attachments ones - so the lookup is on the pair.
* leftMenu: a menu builder may take arguments (`function peopleMenu(user)`,
since multitenancy option D), and the helper matched `()` exactly, so it
dereferenced null.
* narrowWindowLayout: the width block was sliced up to the rule following
`position: absolute` IN it - and the hamburger is `position: static` now, the
last button in the flow rather than pinned to the corner, so that landmark
was gone and the slice ran from the start of the file. It brace-matches the
media query instead.
And two that were true before today:
* boardsVisibilitySettings: "not on screen is left alone" is
`if ($(selector).length)` - the settings are checkboxes read by `is-checked`,
not radios read by value, so `!== undefined` was the old shape.
* changelogFormat: the TODO Later section ends at whatever comes next - the
Upcoming section when there is one, otherwise the newest release. Ending it
at `# v` alone counted every Upcoming entry as a backlog entry, and those DO
thank people.
Thanks to xet7 !
|
||
|
|
f6ee6388cc |
Fix the eight guards the last run surfaced, and document fixing tests while they run.
The node runner now reports every failure, so each fix reveals the next
assertion in the same suite. Twelve of the twenty are green; these eight failed
on a LATER assertion than before, and one is new.
* themeColorPicker: the category titles are `text-align: start` now, not
`left` - a physical side is what tests/rtl.test.js fails on. The guard asks
for `start` and refuses a physical side.
* adminCheckboxStyle: Attachments left the "panes that use a native checkbox"
list, because that is exactly what #6465 was. It now asserts the REMOVAL,
and the Backup row is three material checkboxes in one row.
* boardsVisibilitySettings: the site-theme picker is a fifth group.
* changelogFormat: the open/close counts are taken on the MARKUP - an entry
that explains the format writes `<details>` in backticks, closed by nothing.
* leftMenu: the heading branch is read without its jade comments; the comment
says a heading has "nothing ... to read a data-id from", and the guard was
failing on the sentence that explains the rule.
* narrowWindowLayout: the drag-handle toggle has TWO rules in the phone block,
so the declarations are looked for across both instead of in the first.
* securityLog: the Problems menu is DATA now (PROBLEMS_MENU + the shared
+leftMenu), so the entry ids are asserted where they live.
* tablePage: "the global-search machinery is gone" is checked on the code with
comments stripped - the comment above the report's config names the
machinery it no longer uses.
Three of these eight were guards reading a COMMENT as if it were code or markup.
That is now a known shape: strip comments before asserting about source.
CLAUDE.md gains the workflow this came from: check the newest logs and fix WHILE
the run is still going - the node suites are the fastest signal (~15s for 260) -
and decide per failure whether the code or the guard is the wrong side, saying
in the test why when it is the guard.
Thanks to xet7 !
|
||
|
|
b46eecf58b |
Fix the 20 node suites the && chain had been hiding.
The new runner ran all 260 suites for the first time: 20 failed. Four were real
defects in the app, the rest were guards pinning a spelling or a design that had
since changed - each of them written when it was true, and none of them run
since, because npm stopped the chain at the first failure.
The app fixes:
* models/lib/themeAccents.js: accentOf('constructor') returned Object's
constructor - a FUNCTION - because a plain lookup answers from
Object.prototype. A board colour named after any prototype member would have
written a function into a stylesheet. Only the map's own keys are themes now.
* RTL: the dependency overlay and its connect handle each set a physical
left/right AFTER the logical property, so the physical one won and both were
pinned to the LTR side in an Arabic or Hebrew layout. The skip link, the
avatar's account badge, the stats value column and the theme-category label
were physical too. All logical now (inset-inline-*, text-align: start/end).
The guards, each corrected to what the code actually does now, with the reason:
* addBoardTileHeight, publicationArgumentGuard: a fixed-size slice
(jade + 3000, source + 1400) that a grown comment pushed the subject out of.
Both now take the whole block they are about.
* adminCheckboxStyle: the Grey Icons feature is gone; asserts its REMOVAL.
* boardsVisibilitySettings: the separator count was pinned at 3; the site-theme
picker group made it 4. Asserts the shape - one Save per section, none for
the picker that applies immediately.
* changelogFormat: "# Upcoming WeKan ® release" is a legitimate heading.
* dbConformanceWiring: the log directory honours WEKAN_LOGDIR now.
* domainTablePage: the default page is the app-wide 10, not 25.
* ferretdbOplogGating: the exec runs under the CPU launcher.
* leftMenu: peopleMenu takes the user (multitenancy option D).
* loginEmailPanesMoved: the board-member restriction is two checkboxes in
Organizations and Teams now; asserted there.
* mobileAllBoardsFit: the bell and the avatar are two rules with variants.
* narrowWindowLayout: the hamburger is the last button in the flow, not pinned.
* rulesApiTriggerNormalize: #6491 made a missing matching field mean "any
value", so the #2674 "can never match" case now matches - and removeMember
iterates assignees, not members.
* securityLog: the new-problems selector moved to models/lib/eventLogProblems.
* tablePage: the Cards report renders the page the SERVER named.
* tenantWiring: the site colour is read in two places; the autorun is the one.
* themeAccents: see above - the guard was right, the code was not.
* translationPane: the "no hand-written table" regex matched the +tablePage
include it also requires.
* uiDensity: admin table cells wrap in one td+th rule now.
* rtl: the dir attribute comes from a helper, `!important` is not part of a
value, and the scanner read CSS COMMENTS as declarations - the comment
explaining why `left: 50%` needs no RTL variant was reported as a violation.
Thanks to xet7 !
|
||
|
|
b3ea034e10 |
Admin Panel / Settings opened on Visibility instead of Version.
Caught by the newest Playwright run: the Version page test failed in all three browsers, and the page it got was Visibility. The multitenancy work decided the opening pane at onCreated: const siteAdmin = tenantAdmin.isSiteAdmin(ReactiveCache.getCurrentUser()); this.versionSetting = new ReactiveVar(siteAdmin); At onCreated the user document has often not arrived yet, so getCurrentUser() is null, "is this the site admin?" is false for EVERYONE for that moment, and the page opened on the pane meant for an Organization's own admin - for the site admin too. Admin Panel / People had the same shape and could open on the wrong pane the same way. Both open on what they always opened on again - Version and Login - and the exception for an Organization's own admin is applied in an autorun, once, when the user is actually known. Thanks to xet7 ! |
||
|
|
36b899b9d6 |
Multitenancy: one WeKan server for many domains, with Organizations as tenants.
Implements option D of docs/Design/Multitenancy/Multitenancy.md, which that document now describes as shipped. An Organization may claim hostnames (Admin Panel / People / Organizations -> Edit), carry its own branding - product name, logos, help link, legal notice and theme colour - and have its own Organization admins, appointed from the row's "..." menu. The request's host picks the Organization; its branding replaces the instance branding for that request, and the client bundle that host serves points its DDP connection back at that host instead of at the one ROOT_URL. An Organization admin administers their own Organization and nothing else: its people, its Organizations row, its theme colour and its backups. They can never grant the site-wide Admin flag, never manage a site admin, and never see another Organization's people or archives. Per-tenant backup and restore is one new control in Admin Panel / Attachments / Backup - Scope. An Organization's archive holds its boards and everything on them plus the attachments those boards use, and no accounts, no instance settings and no org/team documents, because those are shared. A restore may only write to boards that Organization owns: the board ids are the intersection of what the archive claims with what the Organization really owns, every document is checked against that, and "replace all" replaces that Organization's documents rather than everyone's. Admin Panel / Settings / Visibility gains a Change color section above Logo: the site theme, rendered by the SAME shared picker as Board Settings and Member Settings - one template for all three, the way one shared table page serves every table. Its design is the new docs/Design/Page/Theme.md. The order of themes is WeKan's default theme, then the site theme (an Organization's own value on its own hosts), then a user's own override; a board's own colour still owns the board page. All of it is OFF unless the server is started with MULTITENANCY=true (plus MULTITENANCY_TRUST_PROXY_HOST=true when a trusted proxy sets X-Forwarded-Host), so an instance that has never heard of tenants answers exactly as before. One WeKan server per customer remains the supported topology for customers who must not share a process, and the design says plainly what this does NOT isolate. The decisions are three pure modules - models/lib/tenants.js, tenantAdmin.js and tenantBackup.js - so the same rules run on the client, on the server and in the tests. Four new suites pin the separation rather than the plumbing: forged Host headers, cross-tenant queries, privilege escalation and cross-tenant restores. Thanks to xet7 ! |
||
|
|
eba25459a3 |
Comment out Admin Panel / Attachments / Sandstorm.
The pane only had content inside a Sandstorm grain: the one-time MongoDB 3 -> FerretDB migration status and a button that DELETED the raw MongoDB 3 database files to reclaim grain disk. Compacting the MongoDB database frees that space as well, so deleting raw database files is not something WeKan needs to offer. The left-menu entry, the pane template, the helpers, the template state and the click handler are commented out rather than deleted, so nothing of it runs and the grain migration report can be brought back if it is ever wanted. The server methods it called are left in place. Everything else keeps working: the storages and their statistics, moving attachments between storages, the MongoDB <-> FerretDB database migration, and Backup. The grain's own migration, which runs in sandstorm-src/start.js before the app boots, is unchanged. Thanks to xet7 ! |
||
|
|
fc0fe31779 |
Admin Panel / Problems: Broken cards is a report, and the menu says which group is which.
Broken cards was the one entry in this menu with a different set of controls: no
search box, no total, no "page X / N", just a prev/next of its own - because it
ran on the global-search machinery (CardSearchPaged, a session document and the
nextPage/previousPage publications) instead of the shared table page. It is a
column spec in REPORT_TABLES now, like Files, Rules, Boards and Cards, driven by
the same loadReport(): a new admin-only `brokenCardsReport` publication takes a
search term plus limit/skip and publishes ONE page manually (a returned
sorted+limited cursor hangs on FerretDB's OpLog, as with the other reports), and
`getBrokenCardsReportCount` gives the total behind the counter.
What "broken" means - no board, swimlane or list, or a type that is not a card
type - is now one selector shared by the report and by the standalone
/broken-cards page, which still runs on the global search and keeps its own
publication unchanged.
The menu is two named groups. Summary, then a rule and a "Settings" title over the
two panes that came from Admin Panel / Features, then a rule and a "Reports" title
over the reports. A title is a new kind of menu item - `{ heading: true, labelKey }`
- with no id, no icon and no handler class, so there is nothing to click, nothing
for the page's click handler to read a data-id from, and it can never be the active
row (or a group name could end up as a pane title). Both use an i18n key the app
already has, so no language has to translate anything new.
Performance moves down to sit with the Speed, Tests and CPU usage streams it is
about, below Impersonation Report - it was three groups away from them, up with the
other two Features panes.
While there: the separator between groups is styled with the menu itself. The rule
for it lived in adminReports.css, twice, targeting a class the shared menu does not
render - so it had never applied to anything.
Thanks to xet7 !
|
||
|
|
9a0db4343c |
Admin Panel: a pane does not repeat the title above it.
Admin Panel / Attachments / Backup showed "Backup" twice: the pane heading comes from the open left-menu entry now (docs/Design/Page/Left-Menu.md), and every Attachments pane still printed its own name under it. Those h3s are gone - all ten of them - and with them the same repeat on Roles, Shared templates and Broken cards. A heading that says something the menu label does not is not a repeat and stays: Limits keeps "Attachment And API File Size Limits" and Locked users keeps "Brute Force Protection Settings", neither of which is the label of the row that opened it. tests/leftMenu.test.cjs now reads every h1-h3 in the Admin Panel templates and fails on one whose text is a menu label - by i18n key, or by the English string for a literal heading like the Sandstorm one. Thanks to xet7 ! |
||
|
|
a9680fa3d3 |
Admin Panel / Attachments: the page opens on Backup, its first menu entry.
The row at the top of a menu and the pane that opens are the same one now - the rule Admin Panel / Settings follows for Version. Backup was moved to the top of the Attachments menu while the page still opened on Move attachments, so the menu highlighted the second row on arrival. Landing on Backup asks once whether a backup is running (pollBackupStatus only keeps polling while it is), so arriving during one shows its progress instead of a pane that looks idle. Thanks to xet7 ! |
||
|
|
d232194070 |
Admin Panel: the tables fit, every pane has a title, and Version opens first.
Reported one after another, all in the Admin Panel, and they turned out to share
two causes: a stylesheet deciding a table's width from outside the design that
owns it, and a pane having to write for itself what every pane needs.
The tables
* Admin Panel / People / People rendered NOTHING - no table, no search box, no
pager. `buildFilters` and `buildActions` were used in peopleTablePageData but
never imported. That is not a build error: it is a ReferenceError thrown inside
a helper while rendering, which Blaze answers by rendering nothing at all.
Organizations, Teams and Domains use neither function, so they drew normally,
which is what made it look like a People-only problem.
* The right-hand side of a table was off screen - reported on Domains, and just
as true of Admin Panel / Version, where the value column was cut off at the
window edge. Two admin stylesheets forced `min-width: 1200px !important;
width: max-content !important` with nowrap cells on a bare `table` selector.
peopleBody.css had no page in the selector at all, so it reached every table in
WeKan, and `!important` beat the shared table page's own width:100% +
table-layout:fixed. The same rules also made a SHORT table shrink to its
content, which is why Domains sat at a third of the panel on a narrow window.
No admin table is forced wide any more: it fits its panel and its cells wrap,
and the phone-width exception that used to undo the floor is simply the rule at
every width. The shared table page's width and wrapping are `!important` now -
a guarantee a stylesheet in another folder can silently override is not a
guarantee.
* An empty table page rendered no table at all, and the "New" link of
Organizations, Teams, People and Translation is a column HEADER - so an empty
pane had no way to create the first row. The table always renders now; the
"no items" message moved below it.
* The controls row: every control shares one height and no margin. forms.css is
`button { display: block; margin-bottom: 14px }`, written for stacked form
buttons, so a button that kept that margin was centred higher than one that did
not - "Unlock all users" sat lower and shorter than "Teams" beside it, since it
also carried a 20px margin and a 28px height from the old hand-written header.
Action buttons are themed with the pager, in the one stylesheet that owns those
colours, every state spelled out, or a bare <button> falls through to the
forms.css fallback, which is literally black.
Admin Panel / Settings / Translation now renders through the shared table page
(docs/Design/Page/Table.md) instead of a hand-written table: four columns, an
interactive row, the "New" link as a column header. It pages ONE page of 25
server-side with limit/skip and a count method, where it used to grow a window by
infinite scroll; the publication publishes the field it is sorted by, so the
client's sort matches the server's page.
The pane title
Every Admin Panel pane opens with the same heading, and the heading is the ACTIVE
LEFT MENU ENTRY's own label - `paneTitle()` in models/lib/leftMenu.js, one class
`.admin-pane-title`, which the shared table page's own title carries too. Before
this only the paginated table pages had a title at all: Domains said "Domains"
while Login, Announcement, Accessibility, PWA and Version opened with no heading.
Deriving it from the menu is what keeps them identical - a pane cannot end up with
a title of a different size or none at all - and it is why a table page inside the
Admin Panel now passes no titleKey: the section already rendered the heading.
The menus
* Version is the FIRST pane of Admin Panel / Settings and the one that opens with
the page, so what an admin sees first is the version, database and system
information they usually came for. Its page, its one-entry menu and its tab are
gone - a page whose menu had a single entry was a page in name only - and
/information redirects to Settings, the same move Translation made.
* Admin Panel / People: Domains moves up beside E-mail, the settings it is about.
* Admin Panel / Attachments: Backup moves to the top.
Tests: tests/tablePage.test.cjs gains the Translation conversion, the empty-table
header, the one-height controls row, the themed actions and a guard that no admin
stylesheet may force a table's width; tests/leftMenu.test.cjs gains the pane title
(helper, template, every page renders it, one shared size) and Version as the
first Settings pane; tests/translationPane.test.cjs is rewritten for the pane that
is left once the shared design owns the table.
Thanks to xet7 !
|
||
|
|
a4990a4741 |
Admin Panel: a long left menu scrolls inside its panel instead of spilling out.
Admin Panel / Problems is the longest menu - 15 entries since Performance, Security and Notifications joined it - and its last four sat on the page's grey with no panel behind them. The panel is a flex item stretched to the row's height, so its background, border and rounded corners end at the bottom of the page. With the default `overflow: visible` the entries simply kept rendering past that edge. Nothing was hidden and nothing was unclickable; the menu just stopped looking like a menu halfway down. It scrolls now. `min-height: 0` goes with it: a flex item does not shrink below its content without it, so the box would stay as tall as the list and the overflow would never engage - the rule would look right and change nothing. Whatever is visible is now always on the panel, at any window height and for any menu length, rather than depending on the menu being short enough. Tests: 1380 passing. Thanks to xet7 ! |
||
|
|
b72a4996dd |
Admin Panel: remove the Features tab.
Its last three panes - Performance, Security and Notifications - moved to Admin Panel /
Problems in
|
||
|
|
47b03ef894 |
Admin Panel: Login and E-mail move from Settings to People, above Organizations.
Both panes are about the people who can sign in and how they are reached, which is what the People page is for. They are its first two entries now, and Login is the pane that opens with the page. The move is only half markup. EVERY handler those two panes need was registered on Template.setting - the toggles for forgot-password, self-registration, same-org board members and Display Authentication Method, the invite-people button and its board chooser, the account-access Save, and on the E-mail side the TLS toggle, the SMTP Save and Send test e-mail. Blaze delivers an event to the handlers of the template the element is IN, so left on Template.setting each pane would have rendered on People and then quietly done nothing: no toggle sticking, no Save saving, nothing in the console. All ten moved onto Template.general and Template.email, the templates that draw them, where they work wherever the pane is rendered. Template.general also gains accountAccessHelpers, which Template.email already had - a helper the host template lacks renders as unchecked, which silently shows the wrong value. The pane TEMPLATES stay in settingBody.jade beside the other admin panes, since Blaze templates are global and their handlers now sit beside the other settings handlers. Both files say so where a reader would look for them. Settings loses the two entries, their id-map rows, their reactive vars and their isGeneralSetting / isEmailSetting helpers. generalSetting was the var that started true, so Visibility - the first entry left - is promoted to open with the page; without that the Settings page would open on no pane at all. The Sandstorm exception that drops the E-mail entry moves to People with it, so peopleMenu() is a function now rather than a bare array, because it has to read Meteor.settings at call time. Ids and i18n keys are unchanged, so every existing translation still applies. tests/loginEmailPanesMoved.test.cjs pins the whole move, including the half that fails silently: each handler must be on the pane template and NOT on Template.setting, the panes that stayed must keep theirs, exactly one pane may start open, and both pane templates must exist for their handlers - registering on a missing template throws at module load and takes out every module after it, which is how the password field vanished from /sign-in earlier in this series. Four existing suites asserted these panes were part of Settings and now assert them as part of People. Tests: 1368 passing. Thanks to xet7 ! |
||
|
|
e26706799e |
Admin Panel: the selected left-menu entry looks like the selected tab above it.
Replaces the darker-and-bold label from
|
||
|
|
b775ee1e1b |
Admin Panel / People: the tables are back, and the selected menu entry stands out.
Organizations, Teams and People drew their search box and their pager but NO TABLE. Their wrappers said `+tablePage(orgTablePageData)` while that helper was registered on Template.people - the PARENT template. Blaze resolves a name against the current template's helpers, the global helpers and the data context; it never searches an enclosing template. So the context came out undefined, and a table page with no rowCount draws its chrome and stops. Nothing threw and every test passed. Domains is the control that proves it: its helper sits on Template.domainGeneral, the template that uses it, and Domains kept working the whole time. The parent builds the context now - where the helper actually lives - and hands it down, so each wrapper renders `+tablePage(this)`. The named arguments the wrappers used to take (orgList, orgCurrentPage, hasOrgPrevPage, ...) went unused once these panes moved to the shared page, so they go too. A new test walks every `+tablePage(name)` in that file, works out which template it is written in, and requires `name` to be a helper OF THAT TEMPLATE unless it is `this`. Verified it flags `orgGeneral -> orgTablePageData` when the bug is put back. Also: the selected left-menu entry is darker and bold, so the menu says at a glance which page is showing on the right. Its colour fell back to `inherit`, which made it exactly the same grey as every unselected entry - the white background and soft shadow alone were easy to miss. A per-user theme accent still wins; only the fallback changed, from `inherit` to a grey darker than the panel's. The icon takes the same colour as its label. Tests: 1347 passing. Thanks to xet7 ! |
||
|
|
4948682c02 |
Admin Panel / Settings / Visibility: branding above the visibility choice, activities below.
The Visibility pane now reads, top to bottom: Custom Product Name Hide Logo Boards visibility: Allow private boards only Don't show the board activities on all boards ... the rest, unchanged Custom Product Name and Hide Logo were far down the pane among the logo URLs; they are the two settings that name and brand the instance, so they belong above the visibility choice rather than below a dozen link fields. "Don't show the board activities on all boards" had a left-menu pane of its own for one radio pair. It is a visibility setting, so it moves into this pane, directly under the visibility choice, and the pane, its menu entry, its reactive var, its helper and its branch of the pane switch all go with it. Its own Save button moves with it: the click handler is registered on the parent template, so it keeps working by delegation exactly as before, and folding the field into the pane's main Save would have meant rewriting that write for no gain. Its save handler is untouched, so the guard that matters still holds: a radio it cannot find is skipped rather than written as false. That is the trap this whole series of moves keeps setting - a save left reading an input that moved silently turns the setting off. Tests: 1346 passing. Thanks to xet7 ! |
||
|
|
d34d281595 |
Admin Panel: the left menu is back on every page.
Settings, People, Features, Attachments, Version and Problems all rendered an empty
panel where their left menu belongs.
The seam between the two halves of the shared menu was wrong. leftMenu.jade iterates
`each items`, and every page handed it the bare ARRAY that buildMenuItems returns - so
Spacebars looked `items` up ON the array, found nothing, and rendered nothing. The
template's own comment said the data context is `{ items }`; the six call sites did
not provide it.
Nothing failed anywhere: the template was correct, the helper was correct, every unit
test passed, and the menu was simply not there. Six pages lost their navigation to one
mismatched shape.
A new leftMenuData() states that shape once, in models/lib/leftMenu.js, and all six
pages build their context through it. buildMenuItems keeps returning an array, which
is what activeCount and the tests want.
The guard that was missing is the one that checks the SEAM rather than either half:
it reads which variable leftMenu.jade iterates, calls leftMenuData, and asserts the
returned context actually has an array under that name - so renaming the loop variable
or handing back an array fails the suite. A second test asserts no page calls
buildMenuItems directly in its menuItems helper, since that is exactly the mistake
that empties one page's menu while the others keep working.
Verified both fail when the bug is put back, then pass again when it is removed.
Tests: 1346 passing.
Thanks to xet7 !
|
||
|
|
a6af54161e |
Admin Panel: Translation becomes a Settings pane, below Accessibility.
It was a top-level Admin Panel page with its own shell, its own left menu and its own route. It is one entry in the Settings menu now, between Accessibility and PWA. The whole page template had to become the pane, not just its table. The state that feeds the table - the subscription, the search, the infinite scrolling, the count - lived on Template.translation, and Template.translationGeneral reads it from there. Moving only the table would have left it looking up state on a parent that no longer renders it, and the pane would have shown an empty table with no error. So Template.translation became Template.translationSettings, keeping its onCreated, helpers and events together with the markup that needs them. Two things it no longer needs: its own left menu (Settings provides one) and the menu handler that toggled translationSetting - a pane is either rendered or not. The /translation URL still resolves. It redirects to Settings rather than being deleted, so an admin with a bookmark lands where the pane now lives instead of on a template that no longer exists. Tests: it is an entry in the Settings menu and Settings renders the pane; the top-level tab and its active-helper are gone; the state moved with the markup (Template.translation must no longer exist); and the route redirects rather than rendering the removed template. The leftMenu suite no longer counts Translation as a page with a menu of its own - it is one entry in another page's menu now. Thanks to xet7 ! |
||
|
|
7e8d6acf10 |
Admin Panel / Settings: move the three account-access settings out of Accounts.
"Allow Email Change" moves to Email; "Allow Username Change" and "Allow users to
self delete their account" move to Login. All three were in the Accounts pane.
The helpers move with them. A radio is bound to {{#if allowEmailChange}}, and a
helper the HOST template does not have renders as false - the setting would show
as "No" whatever its stored value. They are one shared object now, registered on
Template.email and on Template.setting (which hosts the Login pane).
Saving is split the same way: Email's existing Save takes allowEmailChange, and
Login gets a Save for the other two. Both write only what they actually found on
screen - the same guard as the earlier moves, so a radio that is not rendered can
never be written as false.
That left the Accounts pane with nothing but a Save button, so the pane, its menu
entry, its state, its helper and its pane header are removed rather than left as
an empty page. The accountSettings SUBSCRIPTION stays: the settings still live in
that collection, only where they are shown changed.
Tests: each setting is in its new pane, each host pane has a Save that reaches it,
the empty pane and every reference to it are gone, the helpers are registered on
both host templates, the saves skip a radio they did not find, and the
subscription remains.
Thanks to xet7 !
|
||
|
|
1c1aefbd16 |
Admin Panel / Attachments: render its side menu from the shared left menu.
The last of the seven. 2525 characters of menu markup became one +leftMenu(menuItems); Attachments already tracked the open pane in activeSection, so nothing had to be derived, and its single click handler is untouched - the shared template puts js-attachments-menu on every entry alongside the shared class. One template addition: the Sandstorm entry is a proper noun, not a translated string, so an item may now carry a literal `label` where the others carry a `labelKey`. The Sandstorm-only condition survives as data, a null the builder drops, rather than markup wrapped in `if isSandstorm`. All seven Admin Panel pages now render the same menu from a data list. Across them: 8393 characters of duplicated markup gone, 44 entries described as data, and 19 near-identical click handlers collapsed to 7 - one per page. Tests: a check that ALL seven render the shared menu and none keeps .side-menu markup of its own - the design is only worth having if nothing is left outside it - plus the Sandstorm entry and the literal-label fallback. Remaining: People's seven pane tables still need converting to Table.md. Thanks to xet7 ! |
||
|
|
a4fa78da5c |
Admin Panel / People: render its side menu from the shared left menu.
Sixth page converted to docs/Design/Page/Left-Menu.md. 1067 characters of menu markup became one +leftMenu(menuItems), and the seven near-identical 'click a.js-<pane>-menu' handlers became one 'click .js-left-menu-item'. People tracked the open pane by toggling a DOM class, which is why it was left until now: it needed an active id first. switchMenu already derived all seven pane booleans from the clicked data-id, so the id was there - it just was not kept. It is now this.activeMenuId, starting at 'org-setting', which is the pane orgSetting already started true for, so the page opens exactly as before. With the active row rendered from that state, the manual removeClass/addClass is gone - it would have fought the next re-render - and the "already open" guard compares ids instead of reading a DOM class. data-id is resolved from the anchor rather than event.target, which may be the icon inside it. The per-pane extras survive the collapse: switching to Organizations, Teams or People still resets that pane to page 1 and refreshes its total. Same styling: Locked users keeps the red lock it always had, through the coloured icon wrapper the shared template supports for exactly this case. Tests: the page renders the shared menu, keeps no .side-menu markup, builds its entries through the shared helper, has none of the seven old handlers and exactly one new one, still runs the three per-pane refreshes, holds the open pane in state, and keeps the red lock. Remaining for Left-Menu.md: Attachments. Remaining for Table.md: People's seven pane tables. Thanks to xet7 ! |
||
|
|
f8225cd744 |
Admin Panel Settings, Features, Translation and Info: render the shared left menu.
Four more pages converted to docs/Design/Page/Left-Menu.md. Their menus are data now, not markup: 1956 + 724 + 189 + 184 characters of hand-written .side-menu blocks became one +leftMenu(menuItems) each. Same styling: all four kept the icon shape they had. Settings and Features pass emoji:true, which renders the empty span.emoji-icon they always had before the icon; Translation and Info render the bare i.fa they always had. Settings needed one derivation. It tracks the open pane with eight separate ReactiveVars rather than an active id, so activeSettingId() maps them to the id the menu highlights - no behaviour change, and the menu still cannot highlight two rows. Its Sandstorm exception survives as data: the e-mail entry is a null the builder drops, instead of markup wrapped in `unless isSandstorm`. Each page keeps its own single click handler, so their behaviour is untouched - the shared template puts both js-left-menu-item and the page's own class on every entry. Tests: tests/leftMenu.test.cjs checks all four render the shared menu, keep no .side-menu markup of their own, build through the shared helper and keep their handler class; and that Settings still has its Sandstorm exception and maps every one of its eight panes to an id (an unmapped pane would never highlight). Remaining: People and Attachments. Both track the open pane by toggling a DOM class rather than in state, so they need an active-id var first. Thanks to xet7 ! |
||
|
|
f46aab011b |
Admin Panel / Problems: render its side menu from the shared left menu.
First page converted to docs/Design/Page/Left-Menu.md. Its thirteen entries were
six lines of markup each plus, for twelve of them, an identical click handler.
They are now a data list:
{ id, icon, labelKey } and { separator: true }
built by buildMenuItems() and rendered by the one leftMenu template. 1895
characters of markup in adminReports.jade became a single +leftMenu(menuItems).
Same styling, deliberately: the shared template reproduces all three icon shapes
the Admin Panel pages already used, so a conversion changes no pixel - an empty
span.emoji-icon before the icon (Settings, Features), the icon inside a coloured
span.emoji-icon (People / Locked users), or a bare i.fa (Problems, People,
Translation, Info). Problems uses the bare shape it had.
The twelve 'click a.js-report-<name>' handlers, all of which called switchMenu,
are one 'click .js-left-menu-item'. switchMenu no longer toggles the active class
by hand either: the active row is rendered from activeReport, so the manual
removeClass/addClass would have fought the next re-render. Its "already open"
guard now compares ids instead of reading a DOM class, and it resolves data-id
from the anchor rather than event.target, which may be the icon inside it.
Three suites looked for the menu ids in adminReports.jade; the menu is DATA now,
so they read the .js. Same intent, right file.
Tests: tests/leftMenu.test.cjs gains the conversion checks - the page renders the
shared menu, keeps no .side-menu markup of its own, builds its entries through
the shared helper, has exactly one menu handler and no manual active-class
toggling, and the three icon shapes are reproduced.
Still to convert: Settings, People, Features, Attachments, Translation and Info.
Settings, Features and the two single-entry pages are the same mechanical swap.
People and Attachments additionally need an active-id reactive var, because they
track the open pane by toggling a DOM class rather than in state.
Thanks to xet7 !
|
||
|
|
33a0cf6160 |
Design docs: move Table-Page.md under Design/Page/, and add Left-Menu.md.
docs/Design/Table-Page.md -> docs/Design/Page/Table.md, with every reference updated: the three design docs that link to it (History, CPU-usage, Recovery), the code comments in the shared template, stylesheet and helpers, and the four test suites that read it. Its own link to History.md is re-based, since the file is one level deeper now. docs/Design/Page/Left-Menu.md is the second page design: the menu beside the content on every Admin Panel page. It records what those seven menus share, which pages use it, the entry shape, and how a page adds one. Which side it is on is part of the design, not an accident of the markup: for a left-to-right language the menu is on the LEFT with the content to its right; for a right-to-left language the whole panel MIRRORS - the menu is on the right, the content to its left, and inside each entry the icon and label mirror too. That works only through the document direction plus logical CSS, so the doc says to never write left/right/margin-left/padding-left for this menu. Checking that turned up two places where the current CSS did exactly that: - .side-menu had `box-shadow: inset -0.2vh ...`. An inset shadow offset on the X axis is a PHYSICAL direction and does not mirror, so it shaded the wrong inner edge once the menu moved to the right. The X offset is dropped. - the entries used `padding: 1.3vh 0 1.3vh 1.3vw`, i.e. padding-LEFT, so under an RTL language the indent stayed on the left - the outer edge of a right-hand menu. Now padding-block + padding-inline-start. Theme: the menu was entirely hard-coded greys. Most of it stays neutral on purpose - it is chrome, and tinting the whole card would fight the content beside it - but the entry you are ON now takes the per-user theme accent (Member Settings -> Change color sets --theme-accent on :root), with `inherit` as the fallback so the WeKan default look is byte-for-byte unchanged when no colour is chosen. No brand colour is hard-coded in the menu. The shared pieces are in place: client/components/settings/leftMenu.jade renders the menu from an item list, and models/lib/leftMenu.js turns (items, activeId) into it - marking exactly ONE entry active, dropping conditional holes, and supporting group separators. Tests: tests/leftMenu.test.cjs is the one suite for this design - the pure helpers, the template, the mirroring, the theming, the shared narrow-window stacking, and that every path in the doc's related-files table exists. NOT done yet: the seven Admin Panel templates still render their own copy of the menu markup. Converting them to +leftMenu is the next step; the design, the template, the helpers and the tests it will be checked against are ready. Thanks to xet7 ! |