mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
#5695 #4897 #4654 #5174 #4825 #5659 #4730 #4419 #4158 #4560 #4036
#1959 #1971.
- Startup schema upgrade (server/lib/schemaUpgradeSteps.js): on start,
check that data from EVERY old WeKan version is migrated to the newest
structure and migrate only what is missing - all platforms, MongoDB and
FerretDB. Version-gated (marker stores WeKan version + datetime of the
last re-check; one findOne per boot until a new release), non-blocking,
live dashboard at /schema-upgrade-status showing the product name, fast
on big databases (distinct() set-joins, updateMany batches). Steps:
archived-flag backfill, swimlane structure + visibility rescue
(#1959 #1971: cards under deleted/archived/foreign swimlanes reassigned
to a visible swimlane; card-insert hook validates supplied swimlaneIds),
merge-per-swimlane-lists (v7.98/v8.0x list copies merged back into
shared lists: no duplicate columns in Lists view, everything visible in
Swimlanes view, cards keep their swimlane), embedded checklist items,
customFields boardIds, allows* backfills, members isActive, permission
lowercase, filesystem path healing.
- Migration speed (5-hour reports): insertMany batches in the text phase,
preloaded target-record maps in the file phases.
- Snap attachment-repair + FILES_ONLY importer mode (see prior commit
wiring) extended with CFS FileSystem-store coverage
(ATTACHMENTS_STORE_PATH era), missing-binary reporting, and
migrate-gridfs-to-fs.mjs bucket fixes.
- OAuth2/OIDC: OAUTH2_LOGIN_STYLE=redirect honored (#5695); concurrent
logins no longer contaminate each other's user data (#4897); account
merge no longer wipes avatars/templates (#4560).
- LDAP: background sync fixed (#4654), password login rejected after LDAP
migration (#4419), LDAP_ENCRYPTION=true actually encrypts (#4158),
group filter accepts multiple groups and admits admin-sync groups
(#4036).
- All Boards tiles: per-list card counts + member avatars restored
non-reactively (#5174 #4825). Uniform default list widths (#5659).
Declined invitations no longer resurrect membership (#4730).
- Tests with negative cases for every fix (tests/*.test.cjs; suite green
except the pre-existing environment-only htmljs failure).
Closes #5600: OAUTH2_CA_CERT already works - the fetch migration
(49a272d6c) applies the CA to all OIDC calls via https.Agent.
Closes #3828: board members seeing all board cards is by design (no
per-card visibility model), and organizations/teams now exist.
Thanks to mueschel, ArturRuta, gerardo-junior, fabianrbz, Miuler,
butteredCat-2021, Griiimm, preciousamorc, farwayer, LeoLu-eng, hnb1,
rangersdo and xet7.
138 lines
4.8 KiB
JavaScript
138 lines
4.8 KiB
JavaScript
'use strict';
|
|
|
|
// Plain-Node regression guard (no Meteor) for issue #4023: in Japanese and
|
|
// Chinese UI the add-card form footer wrapped labels mid-word ("追加" broke
|
|
// onto two lines inside the submit button, "リンク" rendered as リン / ク in
|
|
// the "or link / search / template" footer). CJK text has no spaces, so
|
|
// browsers may break between any two characters unless the footer opts into
|
|
// `word-break: keep-all` (and `white-space: nowrap` for the short labels).
|
|
// Run: node tests/cjkLabelWrap.test.cjs
|
|
|
|
const assert = require('assert');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const repoRoot = path.resolve(__dirname, '..');
|
|
const read = rel => fs.readFileSync(path.join(repoRoot, rel), 'utf8');
|
|
|
|
const formsCss = read('client/components/forms/forms.css');
|
|
const listBodyJade = read('client/components/lists/listBody.jade');
|
|
|
|
// Strip comments so assertions match real declarations only.
|
|
const css = formsCss.replace(/\/\*[\s\S]*?\*\//g, '');
|
|
|
|
// Split a stylesheet into { selector, body } rules (flat rules only; rules
|
|
// nested in at-rules keep their own selector text, which is fine here).
|
|
function rules(stylesheet) {
|
|
const out = [];
|
|
const re = /([^{}]+)\{([^{}]*)\}/g;
|
|
let m;
|
|
while ((m = re.exec(stylesheet)) !== null) {
|
|
out.push({ selector: m[1].trim(), body: m[2] });
|
|
}
|
|
return out;
|
|
}
|
|
|
|
function findRule(stylesheet, selectorPart, declaration) {
|
|
return rules(stylesheet).some(
|
|
r => r.selector.includes(selectorPart) && r.body.includes(declaration),
|
|
);
|
|
}
|
|
|
|
let passed = 0;
|
|
function test(name, fn) {
|
|
fn();
|
|
passed += 1;
|
|
console.log(' ok -', name);
|
|
}
|
|
|
|
test('add-card footer (.add-controls) forbids mid-word CJK breaks via word-break: keep-all', () => {
|
|
assert.ok(
|
|
findRule(css, '.add-controls', 'word-break: keep-all'),
|
|
'.add-controls must declare word-break: keep-all',
|
|
);
|
|
});
|
|
|
|
test('edit footer (.edit-controls) gets the same keep-all guard (same bug class)', () => {
|
|
assert.ok(
|
|
findRule(css, '.edit-controls', 'word-break: keep-all'),
|
|
'.edit-controls must declare word-break: keep-all',
|
|
);
|
|
});
|
|
|
|
test('the keep-all footer can still wrap BETWEEN links (flex-wrap: wrap)', () => {
|
|
const flexWrapRule = rules(css).find(
|
|
r =>
|
|
r.selector.includes('.add-controls') &&
|
|
r.body.includes('flex-wrap: wrap'),
|
|
);
|
|
assert.ok(flexWrapRule, '.add-controls must declare flex-wrap: wrap');
|
|
assert.ok(
|
|
findRule(css, '.add-controls', 'display: flex'),
|
|
'.add-controls is a flex container, so flex-wrap is effective',
|
|
);
|
|
});
|
|
|
|
test('submit button label ("追加") never splits onto two lines', () => {
|
|
assert.ok(
|
|
findRule(css, '.add-controls button[type=submit]', 'white-space: nowrap'),
|
|
'submit button in .add-controls must declare white-space: nowrap',
|
|
);
|
|
});
|
|
|
|
test('footer link groups ("or リンク", "/ 検索", "/ テンプレート") stay on one line each', () => {
|
|
assert.ok(
|
|
findRule(css, '.add-controls .quiet', 'white-space: nowrap'),
|
|
'.add-controls .quiet must declare white-space: nowrap',
|
|
);
|
|
});
|
|
|
|
test('the footer markup this pins still exists (link/search/template in a .quiet span)', () => {
|
|
assert.ok(/span\.quiet\s*\n\s*\|\s*\{\{_ 'or'\}\}\s*\n\s*a\.js-link/.test(listBodyJade),
|
|
'addCardForm footer: span.quiet wrapping the "or" + js-link anchor');
|
|
assert.ok(/a\.js-search \{\{_ 'search'\}\}/.test(listBodyJade));
|
|
assert.ok(/a\.js-card-template \{\{_ 'template'\}\}/.test(listBodyJade));
|
|
assert.ok(/button\.primary\.confirm\(type="submit"\) \{\{_ 'add'\}\}/.test(listBodyJade));
|
|
});
|
|
|
|
test('negative: no global keep-all/nowrap that would change Latin or long-URL wrapping', () => {
|
|
const globalish = rules(css).filter(r =>
|
|
/(?:^|,)\s*(?:\*|html|body)\s*(?:,|$)/.test(r.selector),
|
|
);
|
|
for (const r of globalish) {
|
|
assert.ok(
|
|
!r.body.includes('word-break'),
|
|
`global selector "${r.selector}" must not set word-break`,
|
|
);
|
|
assert.ok(
|
|
!r.body.includes('white-space: nowrap'),
|
|
`global selector "${r.selector}" must not set white-space: nowrap`,
|
|
);
|
|
}
|
|
});
|
|
|
|
test('negative: keep-all is scoped to the footers, not sprayed across the stylesheet', () => {
|
|
const keepAllRules = rules(css).filter(r => r.body.includes('keep-all'));
|
|
assert.ok(keepAllRules.length >= 1, 'at least one keep-all rule exists');
|
|
for (const r of keepAllRules) {
|
|
assert.ok(
|
|
r.selector.split(',').every(s => /\.(add|edit)-controls/.test(s)),
|
|
`keep-all rule "${r.selector}" must only target .add-controls / .edit-controls`,
|
|
);
|
|
}
|
|
});
|
|
|
|
test('negative: fix does not use word-break: break-all (which would break Latin words)', () => {
|
|
const addControlRules = rules(css).filter(r =>
|
|
r.selector.includes('.add-controls'),
|
|
);
|
|
for (const r of addControlRules) {
|
|
assert.ok(
|
|
!r.body.includes('break-all'),
|
|
`"${r.selector}" must not use word-break: break-all`,
|
|
);
|
|
}
|
|
});
|
|
|
|
console.log(`\n${passed} tests passed`);
|