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:
@@ -10,7 +10,7 @@ namespace SharepointToolbox.Services.Export;
|
||||
/// </summary>
|
||||
public class DuplicatesHtmlExportService
|
||||
{
|
||||
public string BuildHtml(IReadOnlyList<DuplicateGroup> groups)
|
||||
public string BuildHtml(IReadOnlyList<DuplicateGroup> groups, ReportBranding? branding = null)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -52,6 +52,9 @@ public class DuplicatesHtmlExportService
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
""");
|
||||
sb.Append(BrandingHtmlHelper.BuildBrandingHeader(branding));
|
||||
sb.AppendLine("""
|
||||
<h1>Duplicate Detection Report</h1>
|
||||
""");
|
||||
|
||||
@@ -117,9 +120,9 @@ public class DuplicatesHtmlExportService
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public async Task WriteAsync(IReadOnlyList<DuplicateGroup> groups, string filePath, CancellationToken ct)
|
||||
public async Task WriteAsync(IReadOnlyList<DuplicateGroup> groups, string filePath, CancellationToken ct, ReportBranding? branding = null)
|
||||
{
|
||||
var html = BuildHtml(groups);
|
||||
var html = BuildHtml(groups, branding);
|
||||
await System.IO.File.WriteAllTextAsync(filePath, html, Encoding.UTF8, ct);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user