Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If New-UDInputField -Values is passed the result of Sort-Object it errors #248

Closed
ChrisMagnuson opened this issue Jun 28, 2018 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@ChrisMagnuson
Copy link

Steps to reproduce

Get-UDDashboard | where port -eq 10003 | Stop-UDDashboard
$Dashboard = New-UDDashboard -Title "Input Quantity" -Content {
    $Var = "3","2","1" | Sort-Object
    New-UDInput -Title "Input that should have ID" -Id "TestInput" -Content {
        New-UDInputField -Name Quantity -Values $Var
    } -Endpoint {
        param (
            $Quantity
        )
        
        New-UDInputAction -Toast $Quantity
    }
}
Start-UDDashboard -Port 10003 -Dashboard $Dashboard

The dashboard displays the error Minified React error #152; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=152&args[]=t for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

@adamdriscoll adamdriscoll added the bug Something isn't working label Jul 1, 2018
@mueller-tobias
Copy link
Contributor

mueller-tobias commented Aug 29, 2018

Your Example isn't working without Sort-Object either.

What do you want to achive? a Select Field with the Values 1,2,3?

@dcherry88
Copy link

Seeing similar issue when utilizing an array that has been sorted in the New-UDInputField. In our case, when we sort the array and start the dashboard the page is just blank. When we comment out the sort, page loads fine and our input field has the data, just unsorted.

#Wait-Debugger
$Users = @("Jimmy","Clark","Aaron") | Sort-Object 

$dash_board = New-UDDashboard -Title "page" -Content {
    New-UDHeading -Text "Do stuff" -Size 1
    New-UDInput -Title "Select user" -Content {
        New-UDInputField -Type select -Name users -Placeholder 'Select User' -Values $Users -DefaultValue $Users[0]
    } -Endpoint {
        
        
    }
}

Start-UDDashboard -Dashboard $dash_board -Port 1001 -Design -Name dashtest

@adamdriscoll adamdriscoll added this to the 2.5.0 milestone Jun 24, 2019
adamdriscoll added a commit that referenced this issue Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants