Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(print/table): missing title
Elian Doranc43820776f9a
diff --git a/apps/client/src/widgets/collections/table/TablePrintView.tsx b/apps/client/src/widgets/collections/table/TablePrintView.tsxindex 09f5519694..278df64138 100644--- a/apps/client/src/widgets/collections/table/TablePrintView.tsx+++ b/apps/client/src/widgets/collections/table/TablePrintView.tsx@@ -12,31 +12,36 @@ export default function TablePrintView({ note, noteIds, viewConfig }: ViewModePrconst [ html, setHtml ] = useState<string>();return rowData && (- <div className="table-print-view">- {!html ? (- <Tabulator- tabulatorRef={tabulatorRef}- className="table-print-view-container"- modules={[ PrintModule, ExportModule, FormatModule ]}- columns={columnDefs ?? []}- data={rowData}- index="branchId"- dataTree={hasChildren}- printStyled={true}- onReady={() => {- const tabulator = tabulatorRef.current;- if (!tabulator) return;- const generatedTable = tabulator.modules.export.generateTable(tabulator.options.printConfig, tabulator.options.printStyled, tabulator.options.printRowRange, "print");- if(tabulator.options.printFormatter){- tabulator.options.printFormatter(tabulator.element, generatedTable);- }- setHtml(generatedTable.outerHTML);- }}- />- ) : (- <RawHtmlBlock html={html} className="tabulator-print-fullscreen" />- )}- </div>+ <>+ <h1>{note.title}</h1>++ <div className="table-print-view">++ {!html ? (+ <Tabulator+ tabulatorRef={tabulatorRef}+ className="table-print-view-container"+ modules={[ PrintModule, ExportModule, FormatModule ]}+ columns={columnDefs ?? []}+ data={rowData}+ index="branchId"+ dataTree={hasChildren}+ printStyled={true}+ onReady={() => {+ const tabulator = tabulatorRef.current;+ if (!tabulator) return;+ const generatedTable = tabulator.modules.export.generateTable(tabulator.options.printConfig, tabulator.options.printStyled, tabulator.options.printRowRange, "print");+ if(tabulator.options.printFormatter){+ tabulator.options.printFormatter(tabulator.element, generatedTable);+ }+ setHtml(generatedTable.outerHTML);+ }}+ />+ ) : (+ <RawHtmlBlock html={html} />+ )}+ </div>+ </>)}