Skip to content
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
5 changes: 5 additions & 0 deletions InteractiveAutomationToolkit/Components/InteractiveWidget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ protected internal string DestVar
}
}

/// <summary>
/// Gets a value indicating whether the block has interactivity features enabled.
/// </summary>
internal bool HasInteractivity => BlockDefinition.WantsOnChange || BlockDefinition.WantsOnFocusLost;

/// <summary>
/// Load any changes made through user interaction.
/// </summary>
Expand Down
19 changes: 18 additions & 1 deletion InteractiveAutomationToolkit/InteractiveController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Skyline.DataMiner.Utils.InteractiveAutomationScript
{
using System;
using System.Linq;

using Skyline.DataMiner.Automation;

Expand Down Expand Up @@ -176,7 +177,7 @@ private void Run(Dialog startDialog)
else
{
SetScriptAbortPopupBehavior(CurrentDialog);
CurrentDialog.Show();
CurrentDialog.Show(RequiresResponse(CurrentDialog));
}
}
}
Expand Down Expand Up @@ -212,5 +213,21 @@ private void SetScriptAbortPopupBehavior(Dialog dialog)
return;
}
}

private bool RequiresResponse(Dialog dialog)
{
var interactiveWidgets = dialog.Widgets.OfType<InteractiveWidget>().ToList();
if (interactiveWidgets.Count == 0)
{
return false;
}

if (interactiveWidgets.Any(w => w.HasInteractivity))
{
return true;
}

return false;
}
}
}