feat(11-02): add optional ReportBranding parameter to all 5 HTML export services

- Added ReportBranding? branding = null to BuildHtml on all 5 services
- Added ReportBranding? branding = null after CancellationToken ct on all WriteAsync overloads
- Injected BrandingHtmlHelper.BuildBrandingHeader(branding) between <body> and <h1> in each
- StorageHtmlExportService both overloads updated (nodes-only and nodes+fileTypeMetrics)
- HtmlExportService both overloads updated (PermissionEntry and SimplifiedPermissionEntry)
- Build passes with 0 warnings — all existing callers compile unchanged via default null
This commit is contained in:
Dev
2026-04-08 14:44:23 +02:00
parent 2e8ceea279
commit 2233fb86a9
5 changed files with 36 additions and 21 deletions

View File

@@ -15,7 +15,7 @@ public class UserAccessHtmlExportService
/// <summary>
/// Builds a self-contained HTML string from the supplied user access entries.
/// </summary>
public string BuildHtml(IReadOnlyList<UserAccessEntry> entries)
public string BuildHtml(IReadOnlyList<UserAccessEntry> entries, ReportBranding? branding = null)
{
// Compute stats
var totalAccesses = entries.Count;
@@ -88,6 +88,7 @@ a:hover { text-decoration: underline; }
// ── BODY ───────────────────────────────────────────────────────────────
sb.AppendLine("<body>");
sb.Append(BrandingHtmlHelper.BuildBrandingHeader(branding));
sb.AppendLine("<h1>User Access Audit Report</h1>");
// Stats cards
@@ -320,9 +321,9 @@ function sortTable(view, col) {
/// <summary>
/// Writes the HTML report to the specified file path using UTF-8 without BOM.
/// </summary>
public async Task WriteAsync(IReadOnlyList<UserAccessEntry> entries, string filePath, CancellationToken ct)
public async Task WriteAsync(IReadOnlyList<UserAccessEntry> entries, string filePath, CancellationToken ct, ReportBranding? branding = null)
{
var html = BuildHtml(entries);
var html = BuildHtml(entries, branding);
await File.WriteAllTextAsync(filePath, html, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), ct);
}