mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[Report] Surface resolution audit info in report details (#7443)
- Add resolved_by_name to ServerInfo_Report and join resolved_by users in the report list, my-list and details queries - Render resolution note and resolved-at/by in the report detail pane instead of duplicating the description into the chat log context Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
4a010bd17f
commit
74a6acde91
3 changed files with 58 additions and 27 deletions
|
|
@ -100,10 +100,27 @@ void renderReportDetails(QTextEdit *chatLogEdit,
|
|||
const QString &moderatorPrefix,
|
||||
const QString &nonModeratorPrefix)
|
||||
{
|
||||
QString details;
|
||||
if (report.has_resolution_note() && !report.resolution_note().empty()) {
|
||||
details = QObject::tr("Resolution note: %1").arg(QString::fromStdString(report.resolution_note()));
|
||||
}
|
||||
if (report.has_resolution_time()) {
|
||||
QString resolvedBy = QObject::tr("unknown");
|
||||
if (report.has_resolved_by_name() && !report.resolved_by_name().empty()) {
|
||||
resolvedBy = QString::fromStdString(report.resolved_by_name());
|
||||
}
|
||||
if (!details.isEmpty()) {
|
||||
details += "\n";
|
||||
}
|
||||
details += QObject::tr("Resolved at %1 by %2").arg(formatReportTime(report.resolution_time()), resolvedBy);
|
||||
}
|
||||
|
||||
if (report.has_chat_log() && !report.chat_log().empty()) {
|
||||
chatLogEdit->setPlainText(QString::fromStdString(report.chat_log()));
|
||||
const QString chatLog = QString::fromStdString(report.chat_log());
|
||||
chatLogEdit->setPlainText(
|
||||
details.isEmpty() ? chatLog : details + "\n\n" + QObject::tr("=== Chat Log ===") + "\n" + chatLog);
|
||||
} else {
|
||||
chatLogEdit->clear();
|
||||
chatLogEdit->setPlainText(details);
|
||||
}
|
||||
|
||||
commentsEdit->clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue