From ece7b21c911e2156fbcaf0a873c41d41e7310d14 Mon Sep 17 00:00:00 2001 From: Adam Driscoll Date: Thu, 12 Sep 2019 15:14:34 -0600 Subject: [PATCH] Fixed #1082 --- src/.vscode/tasks.json | 3 ++- .../Integration/Input.Tests.ps1 | 20 +++++++++++++++++++ .../Controllers/ComponentController.cs | 6 ++++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/.vscode/tasks.json b/src/.vscode/tasks.json index 02f95997..4b91fbd0 100644 --- a/src/.vscode/tasks.json +++ b/src/.vscode/tasks.json @@ -16,7 +16,8 @@ "presentation": { "reveal": "always", "panel": "new" - } + }, + "problemMatcher": [] }, { "label": "Build Release", diff --git a/src/UniversalDashboard.UITest/Integration/Input.Tests.ps1 b/src/UniversalDashboard.UITest/Integration/Input.Tests.ps1 index 7f7f4352..aacdc3f4 100644 --- a/src/UniversalDashboard.UITest/Integration/Input.Tests.ps1 +++ b/src/UniversalDashboard.UITest/Integration/Input.Tests.ps1 @@ -14,6 +14,26 @@ $Driver = Start-SeFirefox Describe "Input" { + + Context "drops to pipeline" { + $Dashboard = New-UDDashboard -Title "Test" -Content { + New-UDInput -Title "Simple Form" -Id "Form" -Endpoint { + "This is some stuff" + + New-UDInputAction -Content { New-UDElement -Tag 'div' -Id 'hello' } + } + } + + $Server.DashboardService.SetDashboard($Dashboard) + Enter-SeUrl -Driver $Driver -Url "http://localhost:$BrowserPort" + + It "should not spin forever if an item is dropped to the pipeline that isn't UDInputAction" { + $Button = Find-SeElement -Id "btnForm" -Driver $Driver + Invoke-SeClick $Button + Find-SeElement -Id 'hello' -Driver $Driver | should not be $null + } + } + Context "textbox" { $Dashboard = New-UDDashboard -Title "Test" -Content { New-UDInput -Title "Simple Form" -Id "Form" -Content { diff --git a/src/UniversalDashboard/Controllers/ComponentController.cs b/src/UniversalDashboard/Controllers/ComponentController.cs index 9bf90821..f340fc0f 100644 --- a/src/UniversalDashboard/Controllers/ComponentController.cs +++ b/src/UniversalDashboard/Controllers/ComponentController.cs @@ -44,7 +44,7 @@ public ComponentController(IExecutionService executionService, IDashboardService _stateRequestService = stateRequestService; } - private async Task RunScript(Endpoint endpoint, Dictionary parameters = null) + private async Task RunScript(Endpoint endpoint, Dictionary parameters = null, bool noSerialization = false) { try { var variables = new Dictionary { @@ -71,6 +71,8 @@ private async Task RunScript(Endpoint endpoint, Dictionary Input([FromRoute]string id) return NotFound(); } - return await RunScript(endpoint, variables); + return await RunScript(endpoint, variables, true); } [HttpPost]