Files
wekan/client/features/cards.js
T
Lauri Ojansivu bc8caeba5d Add a per-card markdown text note, editable in a popup (#595).
A card's own description was the only place to put markdown text, so anything
beyond a single block had to be crammed into it. This adds CardTextNotes: a
small collection of named markdown notes per card, modeled on Checklists (a
denormalized boardId, the same publish/allow/deny shape, the same
GHSA-gv8h-5p3p-6hx7 cross-board-move guard).

Each note renders as a tile with its title and a markdown-rendered preview
(the `viewer` template). "Add text note" and a note's "Edit" open a popup
that reuses the description's own `editor`/`viewer` widgets verbatim - no new
markdown editor was written. "Delete" removes the note, scoped to its own
_id.

Wired into the reactive cache (getCardTextNote/getCardTextNotes, matching the
CardComments pattern), the board/linked-card/lazy-window/single-card
publications, and server/permissions/cardTextNotes.js.

tests/cardTextNotes.test.cjs pins: the model's cardId/boardId scoping, the
allow/deny permission shape, the popup's reuse of `editor`/`viewer` (positive:
+editor is used; negative: exactly one `editor` and one `viewer` template is
declared anywhere under client/components/{cards,main} - the whole tree, not
just the new files, so a competing widget cannot be introduced elsewhere
either), and that add/edit/delete are scoped calls rather than broad
selectors.

Thanks to Lapin0t and xet7 !

Closes #595,
2026-09-10 21:29:22 +03:00

47 lines
2.1 KiB
JavaScript

import '/client/components/cards/attachments.jade';
import '/client/components/cards/cardCustomFields.jade';
import '/client/components/cards/cardDate.jade';
import '/client/components/cards/cardDescription.jade';
import '/client/components/cards/cardDetails.jade';
import '/client/components/cards/cardFlowtime.jade';
import '/client/components/cards/cardPomodoro.jade';
import '/client/components/cards/cardStickers.jade';
import '/client/components/cards/cardTextNotes.jade';
import '/client/components/cards/cardTime.jade';
import '/client/components/cards/checklists.jade';
import '/client/components/cards/inlinedCardDescription.jade';
import '/client/components/cards/labels.jade';
import '/client/components/cards/minicard.jade';
import '/client/components/cards/resultCard.jade';
import '/client/components/cards/subtasks.jade';
import '/client/components/cards/attachments.js';
import '/client/components/cards/cardCustomFields.js';
import '/client/components/cards/cardDate.js';
import '/client/components/cards/cardDescription.js';
import '/client/components/cards/cardDetails.js';
import '/client/components/cards/cardFlowtime.js';
import '/client/components/cards/cardPomodoro.js';
import '/client/components/cards/cardStickers.js';
import '/client/components/cards/cardTextNotes.js';
import '/client/components/cards/cardTime.js';
import '/client/components/cards/checklists.js';
import '/client/components/cards/labels.js';
import '/client/components/cards/minicard.js';
import '/client/components/cards/resultCard.js';
import '/client/components/cards/subtasks.js';
import '/client/components/cards/attachments.css';
import '/client/components/cards/cardDate.css';
import '/client/components/cards/cardDescription.css';
import '/client/components/cards/cardDetails.css';
import '/client/components/cards/cardFlowtime.css';
import '/client/components/cards/cardPomodoro.css';
import '/client/components/cards/cardTime.css';
import '/client/components/cards/checklists.css';
import '/client/components/cards/labels.css';
import '/client/components/cards/minicard.css';
import '/client/components/cards/resultCard.css';
import '/client/components/cards/subtasks.css';