mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -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 !
36 lines
1.7 KiB
JavaScript
36 lines
1.7 KiB
JavaScript
import './cardDetails.jade';
|
|
import { Utils } from '/client/lib/utils';
|
|
|
|
// docs/Features/Cards/Card-Fields.md: an opened card shows every field its
|
|
// board shows on cards, empty or not, less the Card Settings sections the
|
|
// board hides on Show on Card. The rules are models/lib/cardShownFields.js.
|
|
const f = require('/models/lib/cardShownFields');
|
|
|
|
// The board as its opened cards see it (cardShownFields.js boardForCard): the
|
|
// same for every card of the board, empty or not, so `data` (the card) does
|
|
// not change it - it is kept so the callers read as before.
|
|
export function cardBoardView(data) { // eslint-disable-line no-unused-vars
|
|
return f.boardForCard(Utils.getCurrentBoard());
|
|
}
|
|
|
|
// The opened card and each of its section templates read `currentBoard`; this
|
|
// template-level helper answers before the global one, so every
|
|
// `currentBoard.allowsX` in them asks the card's view - and a template not
|
|
// listed here (the board, Card Settings itself) is unchanged. The minicard has
|
|
// its own (client/components/cards/minicard.js MINICARD_FIELD_TEMPLATES).
|
|
export const CARD_FIELD_TEMPLATES = Object.freeze([
|
|
// One per Card Settings section the opened card draws (cardDetails.jade).
|
|
'cardDetails', 'cardFieldSectionLabels', 'cardFieldSectionDate', 'cardFieldSectionMembers',
|
|
'cardFieldSectionCard', 'cardFieldSectionTime', 'cardFieldSectionCustomFields',
|
|
'cardFieldSectionVote', 'cardFieldSectionPoker', 'cardFieldSectionDescription', 'cardFieldSectionScrum',
|
|
'cardFieldSectionChecklists', 'cardFieldSectionSubtasks', 'cardFieldSectionAttachments', 'cardCommentsSection',
|
|
]);
|
|
CARD_FIELD_TEMPLATES.forEach(name => {
|
|
Template[name].helpers({
|
|
currentBoard() {
|
|
const tpl = Template.instance();
|
|
return cardBoardView(tpl && tpl.data);
|
|
},
|
|
});
|
|
});
|