mirror of
https://github.com/zadam/trilium.git
synced 2025-12-29 10:44:25 +01:00
feat(print): add links to print report
This commit is contained in:
parent
293ef60350
commit
c2214493dc
@ -14,7 +14,7 @@ import toast from "../services/toast.js";
|
||||
import { dynamicRequire, isElectron, isMobile } from "../services/utils";
|
||||
import { ExtendedNoteType, TYPE_MAPPINGS, TypeWidget } from "./note_types";
|
||||
import { useNoteContext, useTriliumEvent } from "./react/hooks";
|
||||
import NoteList from "./react/NoteList";
|
||||
import { NoteListWithLinks } from "./react/NoteList";
|
||||
import { TypeWidgetProps } from "./type_widgets/type_widget";
|
||||
|
||||
/**
|
||||
@ -200,7 +200,7 @@ export default function NoteDetail() {
|
||||
api.dismissToast();
|
||||
dialog.info(<>
|
||||
<h3>{t("note_detail.print_report_collection_details_ignored_notes")}</h3>
|
||||
<NoteList noteIds={printReport.ignoredNoteIds} />
|
||||
<NoteListWithLinks noteIds={printReport.ignoredNoteIds} />
|
||||
</>, {
|
||||
title: t("note_detail.print_report_title"),
|
||||
size: "md"
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import type { CSSProperties } from "preact/compat";
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
|
||||
import type FNote from "../../entities/fnote";
|
||||
import froca from "../../services/froca";
|
||||
import type { CSSProperties } from "preact/compat";
|
||||
import NoteLink from "./NoteLink";
|
||||
|
||||
interface NoteListProps {
|
||||
noteIds?: string[];
|
||||
@ -33,4 +35,24 @@ export default function NoteList({ noteIds, branchIds, style }: NoteListProps) {
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function NoteListWithLinks({ noteIds }: {
|
||||
noteIds: string[]
|
||||
}) {
|
||||
const [ notes, setNotes ] = useState<FNote[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
froca.getNotes(noteIds).then((notes) => setNotes(notes));
|
||||
}, [ noteIds ]);
|
||||
|
||||
return (notes &&
|
||||
<ul>
|
||||
{notes.map(note => (
|
||||
<li key={note.noteId}>
|
||||
<NoteLink notePath={note.noteId} showNotePath showNoteIcon noPreview />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user