MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / loadReportContent

Function loadReportContent

deployments/desktop/static/desktop.js:3007–3025  ·  view source on GitHub ↗
(reportId, silent = false)

Source from the content-addressed store, hash-verified

3005 }
3006
3007 async function loadReportContent(reportId, silent = false) {
3008 if (!reportId) return;
3009 const data = await api(`/api/reports/content?report_id=${encodeURIComponent(reportId)}`);
3010 const report = data.report;
3011 if (!report) {
3012 if (!silent) throw new Error(ui().reports.missing);
3013 return;
3014 }
3015 state.currentReport = report;
3016 renderReportList(state.reports, report.report_id);
3017 $("reportViewerTitle").textContent = report.title || ui().reports.defaultTitle;
3018 $("reportViewerMeta").textContent = [report.user_id, report.saved_at, report.report_path].filter(Boolean).join(" · ");
3019 $("reportViewerBody").className = "markdown-body";
3020 const annotatedHtml = loadReportAnnotation(report.report_id);
3021 $("reportViewerBody").innerHTML = annotatedHtml || renderMarkdown(report.markdown || "");
3022 $("clearReportAnnotationsBtn").disabled = !annotatedHtml;
3023 hideReportAnnotationToolbar();
3024 setReportLinks(report);
3025 }
3026
3027 async function directRead(kind) {
3028 const isPdf = kind === "pdf";

Callers 2

refreshReportsFunction · 0.70
bindEventsFunction · 0.70

Calls 8

uiFunction · 0.85
loadReportAnnotationFunction · 0.85
setReportLinksFunction · 0.85
apiFunction · 0.70
renderReportListFunction · 0.70
$Function · 0.70
renderMarkdownFunction · 0.70

Tested by

no test coverage detected