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

Fixed #1082 #1107

Merged
merged 1 commit into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion src/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"presentation": {
"reveal": "always",
"panel": "new"
}
},
"problemMatcher": []
},
{
"label": "Build Release",
Expand Down
20 changes: 20 additions & 0 deletions src/UniversalDashboard.UITest/Integration/Input.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions src/UniversalDashboard/Controllers/ComponentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public ComponentController(IExecutionService executionService, IDashboardService
_stateRequestService = stateRequestService;
}

private async Task<IActionResult> RunScript(Endpoint endpoint, Dictionary<string, object> parameters = null)
private async Task<IActionResult> RunScript(Endpoint endpoint, Dictionary<string, object> parameters = null, bool noSerialization = false)
{
try {
var variables = new Dictionary<string, object> {
Expand All @@ -71,6 +71,8 @@ private async Task<IActionResult> RunScript(Endpoint endpoint, Dictionary<string
}

ExecutionContext executionContext = new ExecutionContext(endpoint, variables, parameters, HttpContext?.User);
executionContext.NoSerialization = noSerialization;

if (HttpContext.Session.TryGetValue("SessionId", out byte[] sessionIdBytes))
{
var sessionId = new Guid(sessionIdBytes);
Expand Down Expand Up @@ -318,7 +320,7 @@ public async Task<IActionResult> Input([FromRoute]string id)
return NotFound();
}

return await RunScript(endpoint, variables);
return await RunScript(endpoint, variables, true);
}

[HttpPost]
Expand Down