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

Function submitResultMessage

deployments/desktop/static/desktop.js:2469–2505  ·  view source on GitHub ↗
(data, generateReports)

Source from the content-addressed store, hash-verified

2467 }
2468
2469 function submitResultMessage(data, generateReports) {
2470 const feedback = data.feedback || data || {};
2471 const selectedCount = itemCount(feedback.selected_numbers);
2472 const skippedCount = itemCount(feedback.skipped_numbers);
2473 const laterCount = itemCount(feedback.later_numbers);
2474 const totalFeedback = selectedCount + skippedCount + laterCount;
2475 const reportCount = Number(data.reports?.count || data.reports?.created_docs?.length || 0);
2476 const wikiBackfilled = Number(data.reports?.wiki_backfilled || 0);
2477 const feishuWarning = data.reports?.feishu_warning || "";
2478
2479 if (!totalFeedback && !reportCount) {
2480 return {
2481 type: "warning",
2482 title: ui().papers.emptyFeedbackTitle,
2483 detail: ui().papers.emptyFeedbackDetail
2484 };
2485 }
2486
2487 const title = generateReports
2488 ? reportCount
2489 ? ui().papers.submittedWithReports(reportCount)
2490 : ui().papers.submittedNoReport
2491 : ui().papers.submitted;
2492 const detailParts = [];
2493 if (totalFeedback) {
2494 detailParts.push(ui().papers.feedbackCounts(selectedCount, skippedCount, laterCount));
2495 detailParts.push(ui().papers.profileWikiUpdated);
2496 }
2497 if (wikiBackfilled) detailParts.push(ui().papers.wikiBackfilled(wikiBackfilled));
2498 if (feishuWarning) detailParts.push(feishuWarning);
2499 if (!detailParts.length && reportCount) detailParts.push(ui().papers.reportEntered);
2500 return {
2501 type: feishuWarning ? "warning" : "success",
2502 title,
2503 detail: `${detailParts.join("。")}。`
2504 };
2505 }
2506
2507 function showSubmitResult(data, generateReports) {
2508 const result = submitResultMessage(data, generateReports);

Callers 1

showSubmitResultFunction · 0.85

Calls 2

itemCountFunction · 0.85
uiFunction · 0.85

Tested by

no test coverage detected