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

Show-UDToast not Showing Toasts #329

Closed
BryanDM opened this issue Sep 1, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@BryanDM
Copy link

commented Sep 1, 2018

I've attempted upgrading a couple of my dashboards to 2.0 and I'm unable to get Show-UDToast to work on any of them. I've tried ones running on IIS and through the command line of VSCode. Here is an example of a dashboard I made to test. When I click the button, I do not get a toast.

Below is my $psversiontable. I'm currently running .net 4.7.2

Name                           Value
----                           -----
PSVersion                      5.1.14393.2457
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.2457
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
$testPage = New-UDPage -Name "Ticket List" -Content { 

    New-UDButton -text "test" -onClick {
        Show-UDToast -Message "testing"
    }
        
}


$dashboard = New-UDDashboard -Pages @($testPage) -Title "Test" 
                                                                                                                                                                                                 
Start-UDDashboard -Port 10010 -Dashboard $Dashboard

@adamdriscoll adamdriscoll added the bug label Sep 1, 2018

@adamdriscoll adamdriscoll added this to the 2.0.1 milestone Sep 1, 2018

@adamdriscoll

This comment has been minimized.

Copy link
Member

commented Sep 1, 2018

Can you please look in the web developers console in your browser to see if there are any errors?

I'm seeing flaky behavior in the websocket connection that is likely related to this.

@adamdriscoll

This comment has been minimized.

Copy link
Member

commented Sep 1, 2018

Never mind. I've reproduced this and it's a different issue.

iziToast.min.js:6 Uncaught TypeError: Cannot read property 'length' of null
    at iziToast.min.js:6
    at Object.e.show (iziToast.min.js:6)
    at Object.show (toaster.jsx:6)
    at HubConnection.<anonymous> (ud-dashboard.jsx:56)
    at HubConnection.js:317
    at Array.forEach (<anonymous>)
    at HubConnection.invokeClientMethod (HubConnection.js:317)
    at HubConnection.processIncomingData (HubConnection.js:250)
    at WebSocketTransport.HubConnection.connection.onreceive (HubConnection.js:21)
@adamdriscoll

This comment has been minimized.

Copy link
Member

commented Sep 1, 2018

There is a problem with the cmdlet. It's currently requiring that you specify the -Title and the -Position for the toast to show up. I will put in defaults for those to resolve this. The title will just be an empty string and position will default to top right.

So as a work around you can do this:

$testPage = New-UDPage -Name "Ticket List" -Content { 

    New-UDButton -text "test" -onClick {
        Show-UDToast -Message "testing" -Title "Test" -Position 'topRight'
    }
        
}


$dashboard = New-UDDashboard -Pages @($testPage) -Title "Test" 
                                                                                                                                                                                                 
Start-UDDashboard -Port 10001 -Dashboard $Dashboard
@pldmgg

This comment has been minimized.

Copy link

commented Sep 1, 2018

Awesome, thanks for the workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.