Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
12b7240
chore: update module version to 1.0.7 and enhance Add-HtmlSignatureTa…
rebelinux Apr 25, 2026
9909853
refactor: streamline Add-HtmlSignatureTable function and improve logo…
rebelinux Apr 25, 2026
5c3f07e
refactor: optimize Add-HtmlLabel function for improved readability an…
rebelinux Apr 25, 2026
e8eafd7
test: update HTML table background color in Add-HtmlSignatureTable te…
rebelinux Apr 25, 2026
c7fd000
refactor: simplify AditionalInfo handling and consolidate font parame…
rebelinux Apr 25, 2026
90a24f3
refactor: improve formatting consistency in Add-HtmlNodeTable function
rebelinux Apr 25, 2026
7dbd00d
refactor: add IconPath parameter and improve icon handling in Add-Htm…
rebelinux Apr 25, 2026
d8b3893
refactor: streamline font parameter handling and improve subgraph ico…
rebelinux Apr 25, 2026
813778c
refactor: enhance icon handling and streamline additional info proces…
rebelinux Apr 25, 2026
711c9ad
refactor: optimize HTML table generation and streamline parameter han…
rebelinux Apr 25, 2026
c81f283
refactor: streamline font parameter handling in Add-NodeText function
rebelinux Apr 25, 2026
0df56f5
fix: resolve duplicate pester test names in AdvancedExample02.Tests
rebelinux May 2, 2026
1be7ef8
Merge branch 'AsBuiltReport:dev' into dev
rebelinux May 2, 2026
4188f36
Potential fix for pull request finding
rebelinux May 2, 2026
a0bfe57
Potential fix for pull request finding
rebelinux May 2, 2026
691a305
Merge pull request #24 from rebelinux/dev
rebelinux May 2, 2026
eefd77c
style: standardize formatting of font parameters across multiple func…
rebelinux May 2, 2026
a7e177c
Update CHANGELOG.md
rebelinux May 2, 2026
3b0917a
Merge branch 'AsBuiltReport:dev' into dev
rebelinux May 2, 2026
c18623b
Merge pull request #25 from rebelinux/dev
rebelinux May 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AsBuiltReport.Diagram/AsBuiltReport.Diagram.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AsBuiltReport.Diagram.psm1'

# Version number of this module.
ModuleVersion = '1.0.6'
ModuleVersion = '1.0.7'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
101 changes: 55 additions & 46 deletions AsBuiltReport.Diagram/Src/Private/Add-HtmlLabel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -281,71 +281,80 @@ function Add-HtmlLabel {
[string] $Port = 'EdgeDot'
)

if ($IconType -eq 'NoIcon') {
$ICON = 'NoIcon'
} elseif ($ImagesObj[$IconType]) {
$ICON = $ImagesObj[$IconType]
} else { $ICON = 'no_icon.png' }
$ICON = if ($IconType -eq 'NoIcon') { 'NoIcon' }
elseif ($ImagesObj[$IconType]) { $ImagesObj[$IconType] }
else { 'no_icon.png' }

if ($ImageSizePercent -lt 100) {
$CalculatedImageSize = $null
if ($ImageSizePercent -lt 100 -and $ICON -ne 'NoIcon') {
if (-not $IconPath) {
throw 'IconPath is required when ImageSizePercent is less than 100.'
}
$CalculatedImageSize = Get-ImagePercent -ImageInput (Join-Path -Path $IconPath -Child $ICON) -Percent $ImageSizePercent
}

$FormattedLabel = Format-HtmlFontProperty -Text $Label -FontSize $FontSize -FontColor $FontColor -FontBold:$FontBold -FontItalic:$FontItalic -FontUnderline:$FontUnderline -FontName $FontName -FontSubscript:$FontSubscript -FontSuperscript:$FontSuperscript -FontStrikeThrough:$FontStrikeThrough -FontOverline:$FontOverline

if (-not $SubgraphLabel) {

if ($IconDebug) {
$TRContent = '<TR><TD BGCOLOR="#FFCCCC" ALIGN="{0}" COLSPAN="1">{1} Logo</TD></TR><TR><TD BGCOLOR="#FFCCCC" ALIGN="{0}" ><FONT FACE="{2}" Color="{3}" POINT-SIZE="{4}">{5}</FONT></TD></TR><TR><TD ALIGN="{0}"><FONT Color="red">DraftMode ON</FONT></TD></TR>' -f $Align, $ICON, $FontName, $FontColor, $FontSize, $Label

Format-HtmlTable -Port $Port -TableStyle $TableStyle -TableBorder $TableBorder -CellSpacing $CellSpacing -CellPadding $CellPadding -TableRowContent $TRContent -CellBorder $CellBorder
} elseif ($ICON -ne 'NoIcon') {
if ($IconWidth -and $IconHeight) {
$TRContent = '<TR><TD ALIGN="{0}" BGCOLOR="{1}" FIXEDSIZE="true" WIDTH="{2}" HEIGHT="{3}"><img SRC="{4}"/></TD></TR><TR><TD ALIGN="{0}">{5}</TD></TR>' -f $Align, $CellBackgroundColor, $IconWidth, $IconHeight, $ICON, $FormattedLabel

Format-HtmlTable -Port $Port -TableBackgroundColor $TableBackgroundColor -TableStyle $TableStyle -TableBorder $TableBorder -CellSpacing $CellSpacing -CellPadding $CellPadding -TableRowContent $TRContent -CellBorder $CellBorder
} elseif ($CalculatedImageSize) {
$TRContent = '<TR><TD ALIGN="{0}" BGCOLOR="{1}" COLSPAN="1" FIXEDSIZE="true" WIDTH="{2}" HEIGHT="{3}"><img SRC="{4}"/></TD></TR><TR><TD ALIGN="{0}">{5}</TD></TR>' -f $Align, $CellBackgroundColor, $CalculatedImageSize.Width, $CalculatedImageSize.Height, $ICON, $FormattedLabel

Format-HtmlTable -Port $Port -TableBackgroundColor $TableBackgroundColor -TableStyle $TableStyle -TableBorder $TableBorder -CellSpacing $CellSpacing -CellPadding $CellPadding -TableRowContent $TRContent -CellBorder $CellBorder
} else {
$TRContent = '<TR><TD ALIGN="{0}" BGCOLOR="{1}" COLSPAN="1"><img SRC="{2}"/></TD></TR><TR><TD ALIGN="{0}">{3}</TD></TR>' -f $Align, $CellBackgroundColor, $ICON, $FormattedLabel

Format-HtmlTable -Port $Port -TableBackgroundColor $TableBackgroundColor -TableStyle $TableStyle -TableBorder $TableBorder -CellSpacing $CellSpacing -CellPadding $CellPadding -TableRowContent $TRContent -CellBorder $CellBorder
}
} else {
$TRContent = '<TR><TD BGCOLOR="{1}" ALIGN="{0}">{2}</TD></TR>' -f $Align, $CellBackgroundColor, $FormattedLabel

Format-HtmlTable -Port $Port -TableBackgroundColor $TableBackgroundColor -TableStyle $TableStyle -TableBorder $TableBorder -CellSpacing $CellSpacing -CellPadding $CellPadding -TableRowContent $TRContent -CellBorder $CellBorder
}
$fontParams = @{
FontSize = $FontSize
FontColor = $FontColor
FontBold = $FontBold
FontItalic = $FontItalic
FontUnderline = $FontUnderline
FontName = $FontName
FontSubscript = $FontSubscript
FontSuperscript = $FontSuperscript
FontStrikeThrough = $FontStrikeThrough
FontOverline = $FontOverline
}
$FormattedLabel = Format-HtmlFontProperty -Text $Label @fontParams

$effectiveCellSpacing = if ($SubgraphLabel) { $SubgraphCellSpacing } else { $CellSpacing }
$effectiveCellPadding = if ($SubgraphLabel) { $SubgraphCellPadding } else { $CellPadding }

# Base table params shared by all branches; TableBackgroundColor is added for non-debug branches only.
$baseTableParams = @{
Port = $Port
TableStyle = $TableStyle
TableBorder = $TableBorder
CellBorder = $CellBorder
CellSpacing = $effectiveCellSpacing
CellPadding = $effectiveCellPadding
}
if ($SubgraphLabel) {

if ($IconDebug) {
if ($IconDebug) {
if ($SubgraphLabel) {
$TRContent = '<TR><TD BGCOLOR="#FFCCCC" ALIGN="{0}" COLSPAN="1">{1} Logo</TD><TD BGCOLOR="#FFCCCC" ALIGN="Center">{2}</TD></TR>' -f $Align, $ICON, $FormattedLabel

Format-HtmlTable -Port $Port -TableStyle $TableStyle -TableBorder $TableBorder -CellSpacing $SubgraphCellSpacing -CellPadding $SubgraphCellPadding -TableRowContent $TRContent -CellBorder $CellBorder
} elseif ($ICON -ne 'NoIcon') {
} else {
$TRContent = '<TR><TD BGCOLOR="#FFCCCC" ALIGN="{0}" COLSPAN="1">{1} Logo</TD></TR><TR><TD BGCOLOR="#FFCCCC" ALIGN="{0}" ><FONT FACE="{2}" Color="{3}" POINT-SIZE="{4}">{5}</FONT></TD></TR><TR><TD ALIGN="{0}"><FONT Color="red">DraftMode ON</FONT></TD></TR>' -f $Align, $ICON, $FontName, $FontColor, $FontSize, $Label
}
Format-HtmlTable @baseTableParams -TableRowContent $TRContent
} elseif ($ICON -ne 'NoIcon') {
if ($SubgraphLabel) {
# Side-by-side layout: icon cell | label cell in same TR. Uses uppercase <IMG>.
if ($IconWidth -and $IconHeight) {
$TRContent = '<TR><TD ALIGN="{0}" BGCOLOR="{1}" COLSPAN="1" FIXEDSIZE="true" WIDTH="{2}" HEIGHT="{3}"><IMG SRC="{4}"/></TD><TD ALIGN="{0}">{5}</TD></TR>' -f $Align, $CellBackgroundColor, $IconWidth, $IconHeight, $ICON, $FormattedLabel

Format-HtmlTable -Port $Port -TableBackgroundColor $TableBackgroundColor -TableStyle $TableStyle -TableBorder $TableBorder -CellSpacing $SubgraphCellSpacing -CellPadding $SubgraphCellPadding -TableRowContent $TRContent -CellBorder $CellBorder
} elseif ($CalculatedImageSize) {
$TRContent = '<TR><TD ALIGN="{0}" BGCOLOR="{1}" COLSPAN="1" FIXEDSIZE="true" WIDTH="{2}" HEIGHT="{3}"><IMG SRC="{4}"/></TD><TD ALIGN="{0}">{5}</TD></TR>' -f $Align, $CellBackgroundColor, $CalculatedImageSize.Width, $CalculatedImageSize.Height, $ICON, $FormattedLabel

Format-HtmlTable -Port $Port -TableBackgroundColor $TableBackgroundColor -TableStyle $TableStyle -TableBorder $TableBorder -CellSpacing $SubgraphCellSpacing -CellPadding $SubgraphCellPadding -TableRowContent $TRContent -CellBorder $CellBorder
} else {
$TRContent = '<TR><TD ALIGN="{0}" BGCOLOR="{1}" COLSPAN="1"><IMG SRC="{2}"/></TD><TD ALIGN="{0}">{3}</TD></TR>' -f $Align, $CellBackgroundColor, $ICON, $FormattedLabel

Format-HtmlTable -Port $Port -TableBackgroundColor $TableBackgroundColor -TableStyle $TableStyle -TableBorder $TableBorder -CellSpacing $SubgraphCellSpacing -CellPadding $SubgraphCellPadding -TableRowContent $TRContent -CellBorder $CellBorder
}
} else {
# Stacked layout: icon TR on top, label TR below. Uses lowercase <img>.
if ($IconWidth -and $IconHeight) {
$TRContent = '<TR><TD ALIGN="{0}" BGCOLOR="{1}" FIXEDSIZE="true" WIDTH="{2}" HEIGHT="{3}"><img SRC="{4}"/></TD></TR><TR><TD ALIGN="{0}">{5}</TD></TR>' -f $Align, $CellBackgroundColor, $IconWidth, $IconHeight, $ICON, $FormattedLabel
} elseif ($CalculatedImageSize) {
$TRContent = '<TR><TD ALIGN="{0}" BGCOLOR="{1}" COLSPAN="1" FIXEDSIZE="true" WIDTH="{2}" HEIGHT="{3}"><img SRC="{4}"/></TD></TR><TR><TD ALIGN="{0}">{5}</TD></TR>' -f $Align, $CellBackgroundColor, $CalculatedImageSize.Width, $CalculatedImageSize.Height, $ICON, $FormattedLabel
} else {
$TRContent = '<TR><TD ALIGN="{0}" BGCOLOR="{1}" COLSPAN="1"><img SRC="{2}"/></TD></TR><TR><TD ALIGN="{0}">{3}</TD></TR>' -f $Align, $CellBackgroundColor, $ICON, $FormattedLabel
}
}
Format-HtmlTable @baseTableParams -TableBackgroundColor $TableBackgroundColor -TableRowContent $TRContent
} else {
# NoIcon: attribute order differs intentionally between layouts (preserved from original).
if ($SubgraphLabel) {
$TRContent = '<TR><TD ALIGN="{0}" BGCOLOR="{1}">{2}</TD></TR>' -f $Align, $CellBackgroundColor, $FormattedLabel

Format-HtmlTable -Port $Port -TableBackgroundColor $TableBackgroundColor -TableStyle $TableStyle -TableBorder $TableBorder -CellSpacing $SubgraphCellSpacing -CellPadding $SubgraphCellPadding -TableRowContent $TRContent -CellBorder $CellBorder
} else {
$TRContent = '<TR><TD BGCOLOR="{0}" ALIGN="{1}">{2}</TD></TR>' -f $CellBackgroundColor, $Align, $FormattedLabel
}
Format-HtmlTable @baseTableParams -TableBackgroundColor $TableBackgroundColor -TableRowContent $TRContent
}
}
Loading
Loading