feat(print): display list of ignored notes

This commit is contained in:
Elian Doran 2025-12-24 18:50:50 +02:00
parent 60866c959f
commit 293ef60350
No known key found for this signature in database
2 changed files with 21 additions and 2 deletions

View File

@ -1773,7 +1773,9 @@
"printing_pdf": "Exporting to PDF in progress...",
"print_report_title": "Print report",
"print_report_collection_content_one": "{{count}} note in the collection could not be printed because they are not supported or they are protected.",
"print_report_collection_content_other": "{{count}} notes in the collection could not be printed because they are not supported or they are protected."
"print_report_collection_content_other": "{{count}} notes in the collection could not be printed because they are not supported or they are protected.",
"print_report_collection_details_button": "See details",
"print_report_collection_details_ignored_notes": "Ignored notes"
},
"note_title": {
"placeholder": "type note's title here...",

View File

@ -7,12 +7,14 @@ import NoteContext from "../components/note_context";
import FNote from "../entities/fnote";
import type { PrintReport } from "../print";
import attributes from "../services/attributes";
import dialog from "../services/dialog";
import { t } from "../services/i18n";
import protected_session_holder from "../services/protected_session_holder";
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 { TypeWidgetProps } from "./type_widgets/type_widget";
/**
@ -190,7 +192,22 @@ export default function NoteDetail() {
id: "print-report",
icon: "bx bx-collection",
title: t("note_detail.print_report_title"),
message: t("note_detail.print_report_collection_content", { count: printReport.ignoredNoteIds.length })
message: t("note_detail.print_report_collection_content", { count: printReport.ignoredNoteIds.length }),
buttons: [
{
text: t("note_detail.print_report_collection_details_button"),
onClick(api) {
api.dismissToast();
dialog.info(<>
<h3>{t("note_detail.print_report_collection_details_ignored_notes")}</h3>
<NoteList noteIds={printReport.ignoredNoteIds} />
</>, {
title: t("note_detail.print_report_title"),
size: "md"
});
}
}
]
});
}
}