Skip to content

v1.0.7#24

Merged
rebelinux merged 15 commits intoAsBuiltReport:devfrom
rebelinux:dev
May 2, 2026
Merged

v1.0.7#24
rebelinux merged 15 commits intoAsBuiltReport:devfrom
rebelinux:dev

Conversation

@rebelinux
Copy link
Copy Markdown
Collaborator

[1.0.7] - Unreleased

🔃 Changed

  • Update module version to v1.0.7
  • Enhance Add-HtmlSignatureTable with background color parameters
  • refactor: streamline Add-HtmlSignatureTable function and improve logo handling
  • refactor: optimize Add-HtmlLabel function for improved readability and maintainability
  • refactor: simplify Additional Info handling and consolidate font parameter usage in Add-HtmlNodeTable function
  • refactor: add IconPath parameter and improve icon handling in Add-HtmlSubGraph function
  • refactor: streamline font parameter handling and improve subgraph icon logic in Add-HtmlTable function
  • refactor: enhance icon handling and streamline additional info processing in Add-NodeIcon function
  • refactor: optimize HTML table generation and streamline parameter handling in Add-NodeImage function
  • refactor: streamline font parameter handling in Add-NodeText function

🔧 Fixed

  • Fix duplicate pester test names in AdvancedExample02.Tests tests

Copilot AI review requested due to automatic review settings May 2, 2026 18:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the AsBuiltReport.Diagram PowerShell module for the upcoming v1.0.7 release by bumping the module version, updating the changelog, and refactoring several HTML/Graphviz helper functions (icons, labels, tables) to streamline parameter handling and improve readability/consistency.

Changes:

  • Bump module version to 1.0.7 and add an Unreleased 1.0.7 changelog section.
  • Extend/refactor HTML helper functions (notably signature table background color options and icon handling/percent sizing logic).
  • Fix duplicate Pester test names and adjust test expectations for updated HTML output.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Tests/AdvancedExample02.Tests.ps1 Renames duplicated Context blocks to avoid duplicate Pester test names.
Tests/Add-HtmlSignatureTable.Tests.ps1 Updates expected HTML string output to match new background color handling.
CHANGELOG.md Adds 1.0.7 “Unreleased” section summarizing changes/fixes.
AsBuiltReport.Diagram/Src/Private/Add-NodeText.ps1 Refactors font parameter passing and centralizes Format-NodeObject call.
AsBuiltReport.Diagram/Src/Private/Add-NodeImage.ps1 Refactors table parameter handling and centralizes Format-NodeObject call.
AsBuiltReport.Diagram/Src/Private/Add-NodeIcon.ps1 Refactors additional info + font/table param handling; adjusts image sizing condition.
AsBuiltReport.Diagram/Src/Private/Add-HtmlTable.ps1 Refactors font params and subgraph label/icon rendering logic to reduce duplication.
AsBuiltReport.Diagram/Src/Private/Add-HtmlSubGraph.ps1 Adds IconPath parameter and refactors subgraph icon sizing/table param handling.
AsBuiltReport.Diagram/Src/Private/Add-HtmlSignatureTable.ps1 Adds background color parameters; refactors logo handling and row generation.
AsBuiltReport.Diagram/Src/Private/Add-HtmlNodeTable.ps1 Refactors additional info + font parameter handling and icon null semantics.
AsBuiltReport.Diagram/Src/Private/Add-HtmlLabel.ps1 Refactors for readability, consolidates table parameters, and improves image sizing logic.
AsBuiltReport.Diagram/AsBuiltReport.Diagram.psd1 Updates ModuleVersion to 1.0.7.

Comment thread AsBuiltReport.Diagram/Src/Private/Add-HtmlSignatureTable.ps1 Outdated
Comment on lines +257 to +268
$fontParams = @{
FontSize = $FontSize
FontColor = $FontColor
FontBold = $FontBold
FontItalic = $FontItalic
FontUnderline = $FontUnderline
FontName = $FontName
FontSubscript = $FontSubscript
FontSuperscript = $FontSuperscript
FontStrikeThrough = $FontStrikeThrough
FontOverline = $FontOverline
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Comment on lines +463 to 464
$FontBold = $true

Comment on lines +225 to +235
[Parameter(
Mandatory = $false,
HelpMessage = 'Allow to set a table background color'
)]
[string] $TableBackgroundColor = '#FFFFFF',

[Parameter(
Mandatory = $false,
HelpMessage = 'Allow to set a cell background color'
)]
[string] $CellBackgroundColor = '#FFFFFF',
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Comment on lines 278 to 322
@@ -303,15 +309,14 @@ function Add-HtmlSubGraph {

if ($ImagesObj -and $ImagesObj[$IconType]) {
$Icon = $ImagesObj[$IconType]
} else { $Icon = $false }
} else { $Icon = $null }

# Set the image size if ImageSizePercent is less than 100
if ($ImageSizePercent -lt 100) {
if ($Icon -and $ImageSizePercent -lt 100) {
if (-not $IconPath) {
throw 'IconPath is required when ImageSizePercent is less than 100.'
}
$ImageSize = Get-ImagePercent -ImageInput (Join-Path -Path $IconPath -Child $Icon) -Percent $ImageSizePercent

$IconWidth = $ImageSize.Width
$IconHeight = $ImageSize.Height
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

$HTML = Format-HtmlTable -TableBackgroundColor '#FFCCCC' -TableBorderColor 'red' -CellBorder 0 -CellSpacing $CellSpacing -CellPadding $CellPadding -TableRowContent $TRContent

Format-NodeObject -Name $Name -HtmlObject $HTML -GraphvizAttributes $GraphvizAttributes -AsHtml:(-not $NodeObject)
$HTML = Format-HtmlTable -TableBackgroundColor '#FFCCCC' -TableBorderColor 'red' -CellBorder 0 -CellSpacing 0 -CellPadding 0 -TableRowContent $TRContent
Comment thread AsBuiltReport.Diagram/Src/Private/Add-HtmlSignatureTable.ps1 Outdated
Comment on lines 20 to +24
It 'Should return a multiple column HTML table with an Logo' {
$HTMLSignaturewithLogo | Should -BeExactly '<TABLE PORT="EdgeDot" STYLE="rounded,dashed" BORDER="0" CELLBORDER="0" CELLSPACING="5" CELLPADDING="5" BGCOLOR="white" COLOR="#000000"><TR><TD fixedsize="true" width="80" height="80" ALIGN="Center" colspan="1" rowspan="4"><img src="AsBuiltReport.png"/></TD></TR><TR><TD valign="top" align="Center" colspan="2"><FONT FACE="Segoe Ui" POINT-SIZE="14" COLOR="#000000">Jonathan Colon</FONT></TD></TR><TR><TD valign="top" align="Center" colspan="2"><FONT FACE="Segoe Ui" POINT-SIZE="14" COLOR="#000000">Zen PR Solutions</FONT></TD></TR></TABLE>'
$HTMLSignaturewithLogo | Should -BeExactly '<TABLE PORT="EdgeDot" STYLE="rounded,dashed" BORDER="0" CELLBORDER="0" CELLSPACING="5" CELLPADDING="5" BGCOLOR="#FFFFFF" COLOR="#000000"><TR><TD fixedsize="true" width="80" height="80" ALIGN="Center" colspan="1" rowspan="4"><img src="AsBuiltReport.png"/></TD></TR><TR><TD BGCOLOR="#FFFFFF" valign="top" align="Center" colspan="2"><FONT FACE="Segoe Ui" POINT-SIZE="14" COLOR="#000000">Jonathan Colon</FONT></TD></TR><TR><TD BGCOLOR="#FFFFFF" valign="top" align="Center" colspan="2"><FONT FACE="Segoe Ui" POINT-SIZE="14" COLOR="#000000">Zen PR Solutions</FONT></TD></TR></TABLE>'
}
It 'Should return a multiple column HTML table with an Logo in Debug Mode' {
$HTMLSignaturewithLogoDebug | Should -BeExactly '<TABLE PORT="EdgeDot" STYLE="rounded,dashed" BORDER="0" CELLBORDER="0" CELLSPACING="5" CELLPADDING="5" BGCOLOR="white" COLOR="black"><TR><TD bgcolor="#FFCCCC" ALIGN="Center" colspan="1" rowspan="4">AsBuiltReport.png</TD></TR><TR><TD valign="top" align="Center" colspan="2"><FONT FACE="Segoe Ui" POINT-SIZE="14" COLOR="#000000">Jonathan Colon</FONT></TD></TR><TR><TD valign="top" align="Center" colspan="2"><FONT FACE="Segoe Ui" POINT-SIZE="14" COLOR="#000000">Zen PR Solutions</FONT></TD></TR></TABLE>'
$HTMLSignaturewithLogoDebug | Should -BeExactly '<TABLE PORT="EdgeDot" STYLE="rounded,dashed" BORDER="0" CELLBORDER="0" CELLSPACING="5" CELLPADDING="5" BGCOLOR="#FFFFFF" COLOR="#000000"><TR><TD bgcolor="#FFCCCC" ALIGN="Center" colspan="1" rowspan="4">AsBuiltReport.png</TD></TR><TR><TD BGCOLOR="#FFFFFF" valign="top" align="Center" colspan="2"><FONT FACE="Segoe Ui" POINT-SIZE="14" COLOR="#000000">Jonathan Colon</FONT></TD></TR><TR><TD BGCOLOR="#FFFFFF" valign="top" align="Center" colspan="2"><FONT FACE="Segoe Ui" POINT-SIZE="14" COLOR="#000000">Zen PR Solutions</FONT></TD></TR></TABLE>'
if (-not $IconPath) {
throw 'IconPath is required when ImageSizePercent is less than 100.'
}
$ImageSize = Get-ImagePercent -ImageInput (Join-Path -Path $IconPath -Child $Icon) -Percent $ImageSizePercent
} else {
$FontBold = $true
}
$FontBold = $true
Comment on lines +370 to 377
$isPSCustomObj = $AditionalInfo.GetType().Name -in 'PSCustomObject', 'Object[]'
foreach ($r in $AditionalInfo) {
$entries = if ($isPSCustomObj) { $r.PSObject.Properties } else { $r.getEnumerator() }
[string]$TRAditionalInfo += $entries | ForEach-Object {
$key = if ($isPSCustomObj) { $_.Name } else { $_.Key }
'<TR><TD PORT="{0}" BGCOLOR="{1}" ALIGN="{2}" colspan="1"><FONT POINT-SIZE="{3}">{4}: {5}</FONT></TD></TR>' -f $key, $CellBackgroundColor, $Align, $FontSize, $key, $_.Value
}
}
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@rebelinux rebelinux merged commit 691a305 into AsBuiltReport:dev May 2, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants