mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
The opened card and the minicard now draw Card Settings' sections, in
Card Settings' order, each section's fields in the order of its rows:
- Section order is per side: cardSettingsSectionOrder for the card,
the new minicardSettingsSectionOrder for the minicard. A board that
stores none: the card starts with Labels, Date, Members, Card, ...
(the card's historical order as far as the grouping allows), the
minicard with what it drew first before.
- CARD_LAYOUT's and MINICARD_LAYOUT's reorderable sections are Card
Settings' sections, so dragging a section or a row in Card Settings
moves it on the card or the minicard. Stored field orders map: a
field keeps its place relative to the others of its new section.
- On the card every section has the shared heading (its icon, title,
caret and hamburger) - Voting and Planning Poker too, which had a
heading of their own. The minicard stays compact: no headings.
Card Settings shows both sides at once: the minicard's pane first (on
the left), the card's second, each with a caret that folds it, each
scrolling on its own, stacked when the popup is too narrow for two.
The Show radio is gone. A splitter between the panes changes their
widths by dragging, like spreadsheet columns (clamped, kept per user
as a fraction, reset by a double-click, moved by the arrow keys). The
popup is wider again for two panes and its corner grip resizes it,
the panes following.
A hamburger's content opens under its line inside the pane, not in a
popup: the hamburger shows it is open (aria-expanded, highlighted, the
panel attached to it); its button, the panel's X or Escape closes it.
A custom field's edit form and the + create form open inline the same
way and close only their panel when saved. The popup layer added in
9c9742e09d is removed, as nothing uses it now.
Docs: Card-Settings.md, Card-Fields.md and Board Settings / Card.md.
New tests cardSectionsOnCard, minicardSections, cardSettingsSplit,
cardSettingsInlinePanels and card-settings-sections-order.e2e.js; the
guards of the old layouts and orders say why they changed.
Thanks to xet7 !
34 lines
1.6 KiB
JavaScript
34 lines
1.6 KiB
JavaScript
'use strict';
|
|
const {test}=require('node:test');
|
|
const assert=require('node:assert/strict');
|
|
const fs=require('node:fs');
|
|
const vm=require('node:vm');
|
|
const source=fs.readFileSync('client/components/sidebar/sidebarCustomFields.js','utf8');
|
|
const start=source.indexOf(" 'click .primary'(evt, tpl) {");
|
|
// The save ends where it steps back from its own popup, closes its panel in
|
|
// Card Settings (2026-10-28), or empties the form (client/lib/popupBack.js).
|
|
const end=source.indexOf('\n // Its own popup steps back.',start);
|
|
assert.ok(start>=0&&end>start);
|
|
const body=source.slice(source.indexOf('{',start)+1,end);
|
|
function save(type,marker){
|
|
let update;
|
|
const field={_id:'field',type,settings:{jiraTimeField:marker}};
|
|
const handler=vm.runInNewContext(`(function(evt,tpl){${body}})`,{
|
|
Template:{currentData:()=>field},ReactiveCache:{getCustomField:()=>field},
|
|
getSettings:()=>({}),CustomFields:{update:(id,modifier)=>{update=modifier.$set;}},
|
|
});
|
|
handler({preventDefault(){}},{type:{get:()=>type},find:selector=>selector==='.js-field-name'?{value:'Renamed'}:null});
|
|
return update;
|
|
}
|
|
test('numeric custom-field saves retain valid Jira estimate markers',()=>{
|
|
for(const marker of ['original','remaining']){
|
|
const data=save('number',marker);
|
|
assert.equal(data.name,'Renamed');assert.equal(data.settings.jiraTimeField,marker);
|
|
}
|
|
});
|
|
test('non-numeric and invalid integration markers do not survive a field save',()=>{
|
|
for(const [type,marker] of [['text','original'],['number','unknown'],['number',undefined]]){
|
|
assert.equal(save(type,marker).settings.jiraTimeField,undefined);
|
|
}
|
|
});
|