-
-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
bug 🐛Something isn't workingSomething isn't working
Description
Describe the Bug
Passing an Icon object to Initialize-PodeWebTableColumn in a New-PodeWebTable call causes table creation to silently fail. As below:
# Works:
New-PodeWebTable -Name 'Fulfilment' -DataColumn SurveyId -ScriptBlock {
Get-Content -Path 'C:\Temp\Fulfilment.csv' | ConvertFrom-Csv
} -Columns @(
Initialize-PodeWebTableColumn -Key Discovered -Icon 'account-box-multiple-outline' -Name "`0"
Initialize-PodeWebTableColumn -Key Ingressed -Icon 'database-import' -Name "`0"
Initialize-PodeWebTableColumn -Key Conditioned -Icon 'factory' -Name "`0"
Initialize-PodeWebTableColumn -Key Egressed -Icon 'database-export' -Name "`0"
)
# Does not work:
New-PodeWebTable -Name 'Fulfilment' -DataColumn SurveyId -ScriptBlock {
Get-Content -Path 'C:\Temp\Fulfilment.csv' | ConvertFrom-Csv
} -Columns @(
Initialize-PodeWebTableColumn -Key Discovered -Icon 'account-box-multiple-outline' -Name "`0"
Initialize-PodeWebTableColumn -Key Ingressed -Icon 'database-import' -Name "`0"
Initialize-PodeWebTableColumn -Key Conditioned -Icon (New-PodeWebIcon -Name 'factory') -Name "`0"
Initialize-PodeWebTableColumn -Key Egressed -Icon 'database-export' -Name "`0"
)
Steps To Reproduce
Steps to reproduce the behavior:
- (as above) Instantiate New-PodeWebTable with:
- Columns param containing:
- Initialize-PodeWebTableColumn expression with:
- Icon param set to hashtable result from New-PodeWebIcon expression
Expected Behavior
Table would instantiate or throw an exception when an Icon object hashtable is passed as a param to a nested Initialize-PodeWebTableColumn expression
Platform
- OS: Windows 11
- Browser: Chrome
- Versions:
- Pode: v2.12.0
- Pode.Web: v1.0.0
- PowerShell: 7.5.2
Additional Context
(I think) I've traced this back to buildTableHeader in default.js, where Icon is treated as a string rather than being polymorphic:
if (column.Icon) {
value += `<span class='mdi mdi-${column.Icon.toLowerCase()} mRight04'></span>`;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🐛Something isn't workingSomething isn't working
Projects
Status
Backlog