mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
with a popup for what to include. #1173 "Add Feature: Print Board with Params" has been open since 2017, and two things were missing. There was no CHOICE of what to print. The board's Excel and PDF exports took everything they knew how to render and nothing else, while the card export already had a popup with a checkbox per section. And they did not LOOK like the card export: the board's Excel export was a spreadsheet table, one row per card and eighteen columns, which is a data dump rather than a printed board. Both now render a board as its own header followed by every card as the CARD export's block, drawn by the card export's own code - cardBlockLines() for the PDF, ExporterExcelCard.renderCardBlock() for the Excel one. A card looks the same whether it was exported alone or inside its board, and the two cannot drift into two layouts again. Each card starts on its own page in the Excel export, because a printed board is read a card at a time. The swimlane and list menus offer the same export, which is the board export with one query parameter saying which cards are in scope. They sit beside "Copy link" rather than under the permission checks, because exporting is reading, and the file is named for what was exported - a PDF titled with the board that holds one list is a file nobody can place afterwards. The selection is one popup body used by all three menus, and one list: models/lib/exportFields.js, imported by the exporters and by every popup. The card export's list used to live twice, in the server and in cardDetails.js under a comment reading "Must match ALL_FIELDS ..." - which is a comment, not a mechanism, and a section added on one side is either a checkbox that does nothing or a section nobody can turn off. The same ?fields= now gates the same sections in both formats; the card popup's checkboxes used to say "fields to include in Excel export" and did nothing to the PDF. A card block cannot be streamed - it merges cells, styles them and returns to earlier rows - and models/server/ExporterExcel.js streams on purpose, after the in-memory version ate gigabytes on boards with thousands of cards. That exporter is still there and still reachable: unticking "Card details" asks for it. A checkbox, not a silent fallback. A board's per-card data is read once per collection and grouped by card. The card export's own per-card queries would be fifteen hundred round trips on a board of three hundred cards. tests/boardExportScope.test.cjs pins the shared block, the shared list, the gating, the three menus and the streaming exporter still being reachable. Two guards moved rather than being deleted: they pinned the board PDF building its own labels and the server's own copy of the field list, which is the behaviour that deliberately changed. Thanks to xet7 ! Fixes #1173,